From 739d875dd6982618020d30f58f8acf10f6076e6d Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 8 Mar 2018 09:48:46 +0000 Subject: mn10300: Remove the architecture Remove the MN10300 arch as the hardware is defunct. Suggested-by: Arnd Bergmann Signed-off-by: David Howells cc: Masahiro Yamada cc: linux-am33-list@redhat.com Signed-off-by: Arnd Bergmann --- tools/arch/mn10300/include/uapi/asm/bitsperlong.h | 1 - tools/arch/mn10300/include/uapi/asm/mman.h | 7 ------- 2 files changed, 8 deletions(-) delete mode 100644 tools/arch/mn10300/include/uapi/asm/bitsperlong.h delete mode 100644 tools/arch/mn10300/include/uapi/asm/mman.h (limited to 'tools/arch') diff --git a/tools/arch/mn10300/include/uapi/asm/bitsperlong.h b/tools/arch/mn10300/include/uapi/asm/bitsperlong.h deleted file mode 100644 index 6dc0bb0c13b2..000000000000 --- a/tools/arch/mn10300/include/uapi/asm/bitsperlong.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/tools/arch/mn10300/include/uapi/asm/mman.h b/tools/arch/mn10300/include/uapi/asm/mman.h deleted file mode 100644 index b9360639974f..000000000000 --- a/tools/arch/mn10300/include/uapi/asm/mman.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H -#define TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H -#include -/* MAP_32BIT is undefined on mn10300, fix it for perf */ -#define MAP_32BIT 0 -#endif -- cgit 1.4.1 From fd8773f9f544955f6f47dc2ac3ab85ad64376b7f Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 7 Mar 2018 21:21:59 +0100 Subject: arch: remove frv port The Fujitsu FRV kernel port has been around for a long time, but has not seen regular updates in several years and instead was marked 'Orphaned' in 2016 by long-time maintainer David Howells. The SoC product line apparently is apparently still around in the form of the Socionext Milbeaut image processor, but this one no longer uses the FRV CPU cores. This removes all FRV specific files from the kernel. Link: http://www.socionext.com/en/products/assp/milbeaut/ Cc: David Howells Signed-off-by: Arnd Bergmann --- Documentation/00-INDEX | 2 - Documentation/frv/README.txt | 51 - Documentation/frv/atomic-ops.txt | 134 -- Documentation/frv/booting.txt | 182 --- Documentation/frv/clock.txt | 65 - Documentation/frv/configuring.txt | 125 -- Documentation/frv/features.txt | 310 ---- Documentation/frv/gdbinit | 102 -- Documentation/frv/gdbstub.txt | 130 -- Documentation/frv/kernel-ABI.txt | 262 --- Documentation/frv/mmu-layout.txt | 306 ---- MAINTAINERS | 4 - arch/frv/Kconfig | 386 ----- arch/frv/Kconfig.debug | 49 - arch/frv/Makefile | 90 -- arch/frv/boot/Makefile | 76 - arch/frv/defconfig | 39 - arch/frv/include/asm/Kbuild | 12 - arch/frv/include/asm/asm-offsets.h | 1 - arch/frv/include/asm/atomic.h | 224 --- arch/frv/include/asm/atomic_defs.h | 175 -- arch/frv/include/asm/ax88796.h | 22 - arch/frv/include/asm/barrier.h | 23 - arch/frv/include/asm/bitops.h | 325 ---- arch/frv/include/asm/bug.h | 56 - arch/frv/include/asm/bugs.h | 14 - arch/frv/include/asm/busctl-regs.h | 41 - arch/frv/include/asm/cache.h | 23 - arch/frv/include/asm/cacheflush.h | 105 -- arch/frv/include/asm/checksum.h | 180 --- arch/frv/include/asm/cmpxchg.h | 171 -- arch/frv/include/asm/cpu-irqs.h | 81 - arch/frv/include/asm/current.h | 30 - arch/frv/include/asm/delay.h | 50 - arch/frv/include/asm/div64.h | 1 - arch/frv/include/asm/dm9000.h | 37 - arch/frv/include/asm/dma-mapping.h | 18 - arch/frv/include/asm/dma.h | 125 -- arch/frv/include/asm/elf.h | 140 -- arch/frv/include/asm/emergency-restart.h | 6 - arch/frv/include/asm/fpu.h | 12 - arch/frv/include/asm/ftrace.h | 1 - arch/frv/include/asm/futex.h | 22 - arch/frv/include/asm/gdb-stub.h | 146 -- arch/frv/include/asm/gpio-regs.h | 116 -- arch/frv/include/asm/hardirq.h | 26 - arch/frv/include/asm/highmem.h | 149 -- arch/frv/include/asm/hw_irq.h | 16 - arch/frv/include/asm/io.h | 414 ----- arch/frv/include/asm/irc-regs.h | 53 - arch/frv/include/asm/irq.h | 30 - arch/frv/include/asm/irq_regs.h | 27 - arch/frv/include/asm/irqflags.h | 158 -- arch/frv/include/asm/kdebug.h | 1 - arch/frv/include/asm/kmap_types.h | 8 - arch/frv/include/asm/linkage.h | 7 - arch/frv/include/asm/local.h | 7 - arch/frv/include/asm/local64.h | 1 - arch/frv/include/asm/math-emu.h | 302 ---- arch/frv/include/asm/mb-regs.h | 200 --- arch/frv/include/asm/mb86943a.h | 42 - arch/frv/include/asm/mb93091-fpga-irqs.h | 42 - arch/frv/include/asm/mb93093-fpga-irqs.h | 29 - arch/frv/include/asm/mb93493-irqs.h | 50 - arch/frv/include/asm/mb93493-regs.h | 281 ---- arch/frv/include/asm/mem-layout.h | 86 - arch/frv/include/asm/mmu.h | 41 - arch/frv/include/asm/mmu_context.h | 50 - arch/frv/include/asm/module.h | 22 - arch/frv/include/asm/page.h | 74 - arch/frv/include/asm/pci.h | 40 - arch/frv/include/asm/percpu.h | 7 - arch/frv/include/asm/perf_event.h | 15 - arch/frv/include/asm/pgalloc.h | 69 - arch/frv/include/asm/pgtable.h | 528 ------ arch/frv/include/asm/processor.h | 110 -- arch/frv/include/asm/ptrace.h | 41 - arch/frv/include/asm/sections.h | 40 - arch/frv/include/asm/segment.h | 44 - arch/frv/include/asm/serial-regs.h | 44 - arch/frv/include/asm/serial.h | 14 - arch/frv/include/asm/setup.h | 26 - arch/frv/include/asm/shmparam.h | 8 - arch/frv/include/asm/signal.h | 7 - arch/frv/include/asm/smp.h | 10 - arch/frv/include/asm/spinlock.h | 17 - arch/frv/include/asm/spr-regs.h | 416 ----- arch/frv/include/asm/string.h | 50 - arch/frv/include/asm/switch_to.h | 35 - arch/frv/include/asm/syscall.h | 123 -- arch/frv/include/asm/termios.h | 15 - arch/frv/include/asm/thread_info.h | 116 -- arch/frv/include/asm/timer-regs.h | 106 -- arch/frv/include/asm/timex.h | 27 - arch/frv/include/asm/tlb.h | 28 - arch/frv/include/asm/tlbflush.h | 73 - arch/frv/include/asm/topology.h | 13 - arch/frv/include/asm/types.h | 22 - arch/frv/include/asm/uaccess.h | 285 ---- arch/frv/include/asm/ucontext.h | 13 - arch/frv/include/asm/unaligned.h | 22 - arch/frv/include/asm/unistd.h | 34 - arch/frv/include/asm/user.h | 80 - arch/frv/include/asm/vga.h | 17 - arch/frv/include/asm/virtconvert.h | 41 - arch/frv/include/asm/xor.h | 1 - arch/frv/include/uapi/asm/Kbuild | 5 - arch/frv/include/uapi/asm/auxvec.h | 4 - arch/frv/include/uapi/asm/bitsperlong.h | 2 - arch/frv/include/uapi/asm/byteorder.h | 7 - arch/frv/include/uapi/asm/errno.h | 8 - arch/frv/include/uapi/asm/fcntl.h | 2 - arch/frv/include/uapi/asm/ioctl.h | 2 - arch/frv/include/uapi/asm/ioctls.h | 11 - arch/frv/include/uapi/asm/ipcbuf.h | 2 - arch/frv/include/uapi/asm/kvm_para.h | 2 - arch/frv/include/uapi/asm/mman.h | 2 - arch/frv/include/uapi/asm/msgbuf.h | 33 - arch/frv/include/uapi/asm/param.h | 9 - arch/frv/include/uapi/asm/poll.h | 11 - arch/frv/include/uapi/asm/posix_types.h | 27 - arch/frv/include/uapi/asm/ptrace.h | 61 - arch/frv/include/uapi/asm/registers.h | 233 --- arch/frv/include/uapi/asm/resource.h | 8 - arch/frv/include/uapi/asm/sembuf.h | 27 - arch/frv/include/uapi/asm/setup.h | 19 - arch/frv/include/uapi/asm/shmbuf.h | 44 - arch/frv/include/uapi/asm/sigcontext.h | 27 - arch/frv/include/uapi/asm/signal.h | 37 - arch/frv/include/uapi/asm/socket.h | 109 -- arch/frv/include/uapi/asm/sockios.h | 15 - arch/frv/include/uapi/asm/stat.h | 101 -- arch/frv/include/uapi/asm/statfs.h | 8 - arch/frv/include/uapi/asm/swab.h | 11 - arch/frv/include/uapi/asm/termbits.h | 204 --- arch/frv/include/uapi/asm/termios.h | 47 - arch/frv/include/uapi/asm/types.h | 12 - arch/frv/include/uapi/asm/unistd.h | 349 ---- arch/frv/kernel/.gitignore | 1 - arch/frv/kernel/Makefile | 24 - arch/frv/kernel/asm-offsets.c | 96 -- arch/frv/kernel/break.S | 792 --------- arch/frv/kernel/cmode.S | 189 --- arch/frv/kernel/debug-stub.c | 258 --- arch/frv/kernel/dma.c | 463 ------ arch/frv/kernel/entry-table.S | 329 ---- arch/frv/kernel/entry.S | 1519 ----------------- arch/frv/kernel/frv_ksyms.c | 109 -- arch/frv/kernel/futex.c | 223 --- arch/frv/kernel/gdb-io.c | 215 --- arch/frv/kernel/gdb-io.h | 55 - arch/frv/kernel/gdb-stub.c | 2149 ------------------------- arch/frv/kernel/head-mmu-fr451.S | 374 ----- arch/frv/kernel/head-uc-fr401.S | 311 ---- arch/frv/kernel/head-uc-fr451.S | 174 -- arch/frv/kernel/head-uc-fr555.S | 347 ---- arch/frv/kernel/head.S | 638 -------- arch/frv/kernel/head.inc | 50 - arch/frv/kernel/irq-mb93091.c | 157 -- arch/frv/kernel/irq-mb93093.c | 129 -- arch/frv/kernel/irq-mb93493.c | 147 -- arch/frv/kernel/irq.c | 159 -- arch/frv/kernel/local.h | 59 - arch/frv/kernel/local64.h | 1 - arch/frv/kernel/module.c | 27 - arch/frv/kernel/pm-mb93093.c | 65 - arch/frv/kernel/pm.c | 352 ---- arch/frv/kernel/process.c | 275 ---- arch/frv/kernel/ptrace.c | 377 ----- arch/frv/kernel/setup.c | 1178 -------------- arch/frv/kernel/signal.c | 426 ----- arch/frv/kernel/sleep.S | 373 ----- arch/frv/kernel/switch_to.S | 489 ------ arch/frv/kernel/sys_frv.c | 44 - arch/frv/kernel/sysctl.c | 221 --- arch/frv/kernel/time.c | 122 -- arch/frv/kernel/traps.c | 642 -------- arch/frv/kernel/uaccess.c | 100 -- arch/frv/kernel/vmlinux.lds.S | 136 -- arch/frv/lib/Makefile | 8 - arch/frv/lib/__ashldi3.S | 40 - arch/frv/lib/__ashrdi3.S | 41 - arch/frv/lib/__lshrdi3.S | 40 - arch/frv/lib/__muldi3.S | 32 - arch/frv/lib/__negdi2.S | 28 - arch/frv/lib/__ucmpdi2.S | 45 - arch/frv/lib/atomic-lib.c | 8 - arch/frv/lib/atomic-ops.S | 62 - arch/frv/lib/atomic64-ops.S | 68 - arch/frv/lib/cache.S | 98 -- arch/frv/lib/checksum.c | 166 -- arch/frv/lib/insl_ns.S | 52 - arch/frv/lib/insl_sw.S | 40 - arch/frv/lib/memcpy.S | 135 -- arch/frv/lib/memset.S | 182 --- arch/frv/lib/outsl_ns.S | 59 - arch/frv/lib/outsl_sw.S | 45 - arch/frv/mb93090-mb00/Makefile | 16 - arch/frv/mb93090-mb00/flash.c | 90 -- arch/frv/mb93090-mb00/pci-dma-nommu.c | 176 -- arch/frv/mb93090-mb00/pci-dma.c | 118 -- arch/frv/mb93090-mb00/pci-frv.c | 193 --- arch/frv/mb93090-mb00/pci-frv.h | 33 - arch/frv/mb93090-mb00/pci-irq.c | 62 - arch/frv/mb93090-mb00/pci-vdk.c | 419 ----- arch/frv/mm/Makefile | 9 - arch/frv/mm/cache-page.c | 71 - arch/frv/mm/dma-alloc.c | 183 --- arch/frv/mm/elf-fdpic.c | 114 -- arch/frv/mm/extable.c | 49 - arch/frv/mm/fault.c | 328 ---- arch/frv/mm/highmem.c | 86 - arch/frv/mm/init.c | 144 -- arch/frv/mm/kmap.c | 51 - arch/frv/mm/mmu-context.c | 210 --- arch/frv/mm/pgalloc.c | 157 -- arch/frv/mm/tlb-flush.S | 184 --- arch/frv/mm/tlb-miss.S | 629 -------- tools/arch/frv/include/uapi/asm/bitsperlong.h | 2 - tools/arch/frv/include/uapi/asm/mman.h | 7 - 220 files changed, 28837 deletions(-) delete mode 100644 Documentation/frv/README.txt delete mode 100644 Documentation/frv/atomic-ops.txt delete mode 100644 Documentation/frv/booting.txt delete mode 100644 Documentation/frv/clock.txt delete mode 100644 Documentation/frv/configuring.txt delete mode 100644 Documentation/frv/features.txt delete mode 100644 Documentation/frv/gdbinit delete mode 100644 Documentation/frv/gdbstub.txt delete mode 100644 Documentation/frv/kernel-ABI.txt delete mode 100644 Documentation/frv/mmu-layout.txt delete mode 100644 arch/frv/Kconfig delete mode 100644 arch/frv/Kconfig.debug delete mode 100644 arch/frv/Makefile delete mode 100644 arch/frv/boot/Makefile delete mode 100644 arch/frv/defconfig delete mode 100644 arch/frv/include/asm/Kbuild delete mode 100644 arch/frv/include/asm/asm-offsets.h delete mode 100644 arch/frv/include/asm/atomic.h delete mode 100644 arch/frv/include/asm/atomic_defs.h delete mode 100644 arch/frv/include/asm/ax88796.h delete mode 100644 arch/frv/include/asm/barrier.h delete mode 100644 arch/frv/include/asm/bitops.h delete mode 100644 arch/frv/include/asm/bug.h delete mode 100644 arch/frv/include/asm/bugs.h delete mode 100644 arch/frv/include/asm/busctl-regs.h delete mode 100644 arch/frv/include/asm/cache.h delete mode 100644 arch/frv/include/asm/cacheflush.h delete mode 100644 arch/frv/include/asm/checksum.h delete mode 100644 arch/frv/include/asm/cmpxchg.h delete mode 100644 arch/frv/include/asm/cpu-irqs.h delete mode 100644 arch/frv/include/asm/current.h delete mode 100644 arch/frv/include/asm/delay.h delete mode 100644 arch/frv/include/asm/div64.h delete mode 100644 arch/frv/include/asm/dm9000.h delete mode 100644 arch/frv/include/asm/dma-mapping.h delete mode 100644 arch/frv/include/asm/dma.h delete mode 100644 arch/frv/include/asm/elf.h delete mode 100644 arch/frv/include/asm/emergency-restart.h delete mode 100644 arch/frv/include/asm/fpu.h delete mode 100644 arch/frv/include/asm/ftrace.h delete mode 100644 arch/frv/include/asm/futex.h delete mode 100644 arch/frv/include/asm/gdb-stub.h delete mode 100644 arch/frv/include/asm/gpio-regs.h delete mode 100644 arch/frv/include/asm/hardirq.h delete mode 100644 arch/frv/include/asm/highmem.h delete mode 100644 arch/frv/include/asm/hw_irq.h delete mode 100644 arch/frv/include/asm/io.h delete mode 100644 arch/frv/include/asm/irc-regs.h delete mode 100644 arch/frv/include/asm/irq.h delete mode 100644 arch/frv/include/asm/irq_regs.h delete mode 100644 arch/frv/include/asm/irqflags.h delete mode 100644 arch/frv/include/asm/kdebug.h delete mode 100644 arch/frv/include/asm/kmap_types.h delete mode 100644 arch/frv/include/asm/linkage.h delete mode 100644 arch/frv/include/asm/local.h delete mode 100644 arch/frv/include/asm/local64.h delete mode 100644 arch/frv/include/asm/math-emu.h delete mode 100644 arch/frv/include/asm/mb-regs.h delete mode 100644 arch/frv/include/asm/mb86943a.h delete mode 100644 arch/frv/include/asm/mb93091-fpga-irqs.h delete mode 100644 arch/frv/include/asm/mb93093-fpga-irqs.h delete mode 100644 arch/frv/include/asm/mb93493-irqs.h delete mode 100644 arch/frv/include/asm/mb93493-regs.h delete mode 100644 arch/frv/include/asm/mem-layout.h delete mode 100644 arch/frv/include/asm/mmu.h delete mode 100644 arch/frv/include/asm/mmu_context.h delete mode 100644 arch/frv/include/asm/module.h delete mode 100644 arch/frv/include/asm/page.h delete mode 100644 arch/frv/include/asm/pci.h delete mode 100644 arch/frv/include/asm/percpu.h delete mode 100644 arch/frv/include/asm/perf_event.h delete mode 100644 arch/frv/include/asm/pgalloc.h delete mode 100644 arch/frv/include/asm/pgtable.h delete mode 100644 arch/frv/include/asm/processor.h delete mode 100644 arch/frv/include/asm/ptrace.h delete mode 100644 arch/frv/include/asm/sections.h delete mode 100644 arch/frv/include/asm/segment.h delete mode 100644 arch/frv/include/asm/serial-regs.h delete mode 100644 arch/frv/include/asm/serial.h delete mode 100644 arch/frv/include/asm/setup.h delete mode 100644 arch/frv/include/asm/shmparam.h delete mode 100644 arch/frv/include/asm/signal.h delete mode 100644 arch/frv/include/asm/smp.h delete mode 100644 arch/frv/include/asm/spinlock.h delete mode 100644 arch/frv/include/asm/spr-regs.h delete mode 100644 arch/frv/include/asm/string.h delete mode 100644 arch/frv/include/asm/switch_to.h delete mode 100644 arch/frv/include/asm/syscall.h delete mode 100644 arch/frv/include/asm/termios.h delete mode 100644 arch/frv/include/asm/thread_info.h delete mode 100644 arch/frv/include/asm/timer-regs.h delete mode 100644 arch/frv/include/asm/timex.h delete mode 100644 arch/frv/include/asm/tlb.h delete mode 100644 arch/frv/include/asm/tlbflush.h delete mode 100644 arch/frv/include/asm/topology.h delete mode 100644 arch/frv/include/asm/types.h delete mode 100644 arch/frv/include/asm/uaccess.h delete mode 100644 arch/frv/include/asm/ucontext.h delete mode 100644 arch/frv/include/asm/unaligned.h delete mode 100644 arch/frv/include/asm/unistd.h delete mode 100644 arch/frv/include/asm/user.h delete mode 100644 arch/frv/include/asm/vga.h delete mode 100644 arch/frv/include/asm/virtconvert.h delete mode 100644 arch/frv/include/asm/xor.h delete mode 100644 arch/frv/include/uapi/asm/Kbuild delete mode 100644 arch/frv/include/uapi/asm/auxvec.h delete mode 100644 arch/frv/include/uapi/asm/bitsperlong.h delete mode 100644 arch/frv/include/uapi/asm/byteorder.h delete mode 100644 arch/frv/include/uapi/asm/errno.h delete mode 100644 arch/frv/include/uapi/asm/fcntl.h delete mode 100644 arch/frv/include/uapi/asm/ioctl.h delete mode 100644 arch/frv/include/uapi/asm/ioctls.h delete mode 100644 arch/frv/include/uapi/asm/ipcbuf.h delete mode 100644 arch/frv/include/uapi/asm/kvm_para.h delete mode 100644 arch/frv/include/uapi/asm/mman.h delete mode 100644 arch/frv/include/uapi/asm/msgbuf.h delete mode 100644 arch/frv/include/uapi/asm/param.h delete mode 100644 arch/frv/include/uapi/asm/poll.h delete mode 100644 arch/frv/include/uapi/asm/posix_types.h delete mode 100644 arch/frv/include/uapi/asm/ptrace.h delete mode 100644 arch/frv/include/uapi/asm/registers.h delete mode 100644 arch/frv/include/uapi/asm/resource.h delete mode 100644 arch/frv/include/uapi/asm/sembuf.h delete mode 100644 arch/frv/include/uapi/asm/setup.h delete mode 100644 arch/frv/include/uapi/asm/shmbuf.h delete mode 100644 arch/frv/include/uapi/asm/sigcontext.h delete mode 100644 arch/frv/include/uapi/asm/signal.h delete mode 100644 arch/frv/include/uapi/asm/socket.h delete mode 100644 arch/frv/include/uapi/asm/sockios.h delete mode 100644 arch/frv/include/uapi/asm/stat.h delete mode 100644 arch/frv/include/uapi/asm/statfs.h delete mode 100644 arch/frv/include/uapi/asm/swab.h delete mode 100644 arch/frv/include/uapi/asm/termbits.h delete mode 100644 arch/frv/include/uapi/asm/termios.h delete mode 100644 arch/frv/include/uapi/asm/types.h delete mode 100644 arch/frv/include/uapi/asm/unistd.h delete mode 100644 arch/frv/kernel/.gitignore delete mode 100644 arch/frv/kernel/Makefile delete mode 100644 arch/frv/kernel/asm-offsets.c delete mode 100644 arch/frv/kernel/break.S delete mode 100644 arch/frv/kernel/cmode.S delete mode 100644 arch/frv/kernel/debug-stub.c delete mode 100644 arch/frv/kernel/dma.c delete mode 100644 arch/frv/kernel/entry-table.S delete mode 100644 arch/frv/kernel/entry.S delete mode 100644 arch/frv/kernel/frv_ksyms.c delete mode 100644 arch/frv/kernel/futex.c delete mode 100644 arch/frv/kernel/gdb-io.c delete mode 100644 arch/frv/kernel/gdb-io.h delete mode 100644 arch/frv/kernel/gdb-stub.c delete mode 100644 arch/frv/kernel/head-mmu-fr451.S delete mode 100644 arch/frv/kernel/head-uc-fr401.S delete mode 100644 arch/frv/kernel/head-uc-fr451.S delete mode 100644 arch/frv/kernel/head-uc-fr555.S delete mode 100644 arch/frv/kernel/head.S delete mode 100644 arch/frv/kernel/head.inc delete mode 100644 arch/frv/kernel/irq-mb93091.c delete mode 100644 arch/frv/kernel/irq-mb93093.c delete mode 100644 arch/frv/kernel/irq-mb93493.c delete mode 100644 arch/frv/kernel/irq.c delete mode 100644 arch/frv/kernel/local.h delete mode 100644 arch/frv/kernel/local64.h delete mode 100644 arch/frv/kernel/module.c delete mode 100644 arch/frv/kernel/pm-mb93093.c delete mode 100644 arch/frv/kernel/pm.c delete mode 100644 arch/frv/kernel/process.c delete mode 100644 arch/frv/kernel/ptrace.c delete mode 100644 arch/frv/kernel/setup.c delete mode 100644 arch/frv/kernel/signal.c delete mode 100644 arch/frv/kernel/sleep.S delete mode 100644 arch/frv/kernel/switch_to.S delete mode 100644 arch/frv/kernel/sys_frv.c delete mode 100644 arch/frv/kernel/sysctl.c delete mode 100644 arch/frv/kernel/time.c delete mode 100644 arch/frv/kernel/traps.c delete mode 100644 arch/frv/kernel/uaccess.c delete mode 100644 arch/frv/kernel/vmlinux.lds.S delete mode 100644 arch/frv/lib/Makefile delete mode 100644 arch/frv/lib/__ashldi3.S delete mode 100644 arch/frv/lib/__ashrdi3.S delete mode 100644 arch/frv/lib/__lshrdi3.S delete mode 100644 arch/frv/lib/__muldi3.S delete mode 100644 arch/frv/lib/__negdi2.S delete mode 100644 arch/frv/lib/__ucmpdi2.S delete mode 100644 arch/frv/lib/atomic-lib.c delete mode 100644 arch/frv/lib/atomic-ops.S delete mode 100644 arch/frv/lib/atomic64-ops.S delete mode 100644 arch/frv/lib/cache.S delete mode 100644 arch/frv/lib/checksum.c delete mode 100644 arch/frv/lib/insl_ns.S delete mode 100644 arch/frv/lib/insl_sw.S delete mode 100644 arch/frv/lib/memcpy.S delete mode 100644 arch/frv/lib/memset.S delete mode 100644 arch/frv/lib/outsl_ns.S delete mode 100644 arch/frv/lib/outsl_sw.S delete mode 100644 arch/frv/mb93090-mb00/Makefile delete mode 100644 arch/frv/mb93090-mb00/flash.c delete mode 100644 arch/frv/mb93090-mb00/pci-dma-nommu.c delete mode 100644 arch/frv/mb93090-mb00/pci-dma.c delete mode 100644 arch/frv/mb93090-mb00/pci-frv.c delete mode 100644 arch/frv/mb93090-mb00/pci-frv.h delete mode 100644 arch/frv/mb93090-mb00/pci-irq.c delete mode 100644 arch/frv/mb93090-mb00/pci-vdk.c delete mode 100644 arch/frv/mm/Makefile delete mode 100644 arch/frv/mm/cache-page.c delete mode 100644 arch/frv/mm/dma-alloc.c delete mode 100644 arch/frv/mm/elf-fdpic.c delete mode 100644 arch/frv/mm/extable.c delete mode 100644 arch/frv/mm/fault.c delete mode 100644 arch/frv/mm/highmem.c delete mode 100644 arch/frv/mm/init.c delete mode 100644 arch/frv/mm/kmap.c delete mode 100644 arch/frv/mm/mmu-context.c delete mode 100644 arch/frv/mm/pgalloc.c delete mode 100644 arch/frv/mm/tlb-flush.S delete mode 100644 arch/frv/mm/tlb-miss.S delete mode 100644 tools/arch/frv/include/uapi/asm/bitsperlong.h delete mode 100644 tools/arch/frv/include/uapi/asm/mman.h (limited to 'tools/arch') diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index bd7e2d08d790..b56b88e20196 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX @@ -172,8 +172,6 @@ fmc/ - information about the FMC bus abstraction fpga/ - FPGA Manager Core. -frv/ - - Fujitsu FR-V Linux documentation. futex-requeue-pi.txt - info on requeueing of tasks from a non-PI futex to a PI futex gcc-plugins.txt diff --git a/Documentation/frv/README.txt b/Documentation/frv/README.txt deleted file mode 100644 index a984faa968e8..000000000000 --- a/Documentation/frv/README.txt +++ /dev/null @@ -1,51 +0,0 @@ - ================================ - Fujitsu FR-V LINUX DOCUMENTATION - ================================ - -This directory contains documentation for the Fujitsu FR-V CPU architecture -port of Linux. - -The following documents are available: - - (*) features.txt - - A description of the basic features inherent in this architecture port. - - - (*) configuring.txt - - A summary of the configuration options particular to this architecture. - - - (*) booting.txt - - A description of how to boot the kernel image and a summary of the kernel - command line options. - - - (*) gdbstub.txt - - A description of how to debug the kernel using GDB attached by serial - port, and a summary of the services available. - - - (*) mmu-layout.txt - - A description of the virtual and physical memory layout used in the - MMU linux kernel, and the registers used to support it. - - - (*) gdbinit - - An example .gdbinit file for use with GDB. It includes macros for viewing - MMU state on the FR451. See mmu-layout.txt for more information. - - - (*) clock.txt - - A description of the CPU clock scaling interface. - - - (*) atomic-ops.txt - - A description of how the FR-V kernel's atomic operations work. diff --git a/Documentation/frv/atomic-ops.txt b/Documentation/frv/atomic-ops.txt deleted file mode 100644 index 96638e9b9fe0..000000000000 --- a/Documentation/frv/atomic-ops.txt +++ /dev/null @@ -1,134 +0,0 @@ - ===================================== - FUJITSU FR-V KERNEL ATOMIC OPERATIONS - ===================================== - -On the FR-V CPUs, there is only one atomic Read-Modify-Write operation: the SWAP/SWAPI -instruction. Unfortunately, this alone can't be used to implement the following operations: - - (*) Atomic add to memory - - (*) Atomic subtract from memory - - (*) Atomic bit modification (set, clear or invert) - - (*) Atomic compare and exchange - -On such CPUs, the standard way of emulating such operations in uniprocessor mode is to disable -interrupts, but on the FR-V CPUs, modifying the PSR takes a lot of clock cycles, and it has to be -done twice. This means the CPU runs for a relatively long time with interrupts disabled, -potentially having a great effect on interrupt latency. - - -============= -NEW ALGORITHM -============= - -To get around this, the following algorithm has been implemented. It operates in a way similar to -the LL/SC instruction pairs supported on a number of platforms. - - (*) The CCCR.CC3 register is reserved within the kernel to act as an atomic modify abort flag. - - (*) In the exception prologues run on kernel->kernel entry, CCCR.CC3 is set to 0 (Undefined - state). - - (*) All atomic operations can then be broken down into the following algorithm: - - (1) Set ICC3.Z to true and set CC3 to True (ORCC/CKEQ/ORCR). - - (2) Load the value currently in the memory to be modified into a register. - - (3) Make changes to the value. - - (4) If CC3 is still True, simultaneously and atomically (by VLIW packing): - - (a) Store the modified value back to memory. - - (b) Set ICC3.Z to false (CORCC on GR29 is sufficient for this - GR29 holds the current - task pointer in the kernel, and so is guaranteed to be non-zero). - - (5) If ICC3.Z is still true, go back to step (1). - -This works in a non-SMP environment because any interrupt or other exception that happens between -steps (1) and (4) will set CC3 to the Undefined, thus aborting the store in (4a), and causing the -condition in ICC3 to remain with the Z flag set, thus causing step (5) to loop back to step (1). - - -This algorithm suffers from two problems: - - (1) The condition CCCR.CC3 is cleared unconditionally by an exception, irrespective of whether or - not any changes were made to the target memory location during that exception. - - (2) The branch from step (5) back to step (1) may have to happen more than once until the store - manages to take place. In theory, this loop could cycle forever because there are too many - interrupts coming in, but it's unlikely. - - -======= -EXAMPLE -======= - -Taking an example from include/asm-frv/atomic.h: - - static inline int atomic_add_return(int i, atomic_t *v) - { - unsigned long val; - - asm("0: \n" - -It starts by setting ICC3.Z to true for later use, and also transforming that into CC3 being in the -True state. - - " orcc gr0,gr0,gr0,icc3 \n" <-- (1) - " ckeq icc3,cc7 \n" <-- (1) - -Then it does the load. Note that the final phase of step (1) is done at the same time as the -load. The VLIW packing ensures they are done simultaneously. The ".p" on the load must not be -removed without swapping the order of these two instructions. - - " ld.p %M0,%1 \n" <-- (2) - " orcr cc7,cc7,cc3 \n" <-- (1) - -Then the proposed modification is generated. Note that the old value can be retained if required -(such as in test_and_set_bit()). - - " add%I2 %1,%2,%1 \n" <-- (3) - -Then it attempts to store the value back, contingent on no exception having cleared CC3 since it -was set to True. - - " cst.p %1,%M0 ,cc3,#1 \n" <-- (4a) - -It simultaneously records the success or failure of the store in ICC3.Z. - - " corcc gr29,gr29,gr0 ,cc3,#1 \n" <-- (4b) - -Such that the branch can then be taken if the operation was aborted. - - " beq icc3,#0,0b \n" <-- (5) - : "+U"(v->counter), "=&r"(val) - : "NPr"(i) - : "memory", "cc7", "cc3", "icc3" - ); - - return val; - } - - -============= -CONFIGURATION -============= - -The atomic ops implementation can be made inline or out-of-line by changing the -CONFIG_FRV_OUTOFLINE_ATOMIC_OPS configuration variable. Making it out-of-line has a number of -advantages: - - - The resulting kernel image may be smaller - - Debugging is easier as atomic ops can just be stepped over and they can be breakpointed - -Keeping it inline also has a number of advantages: - - - The resulting kernel may be Faster - - no out-of-line function calls need to be made - - the compiler doesn't have half its registers clobbered by making a call - -The out-of-line implementations live in arch/frv/lib/atomic-ops.S. diff --git a/Documentation/frv/booting.txt b/Documentation/frv/booting.txt deleted file mode 100644 index cd9dc1dfb144..000000000000 --- a/Documentation/frv/booting.txt +++ /dev/null @@ -1,182 +0,0 @@ - ========================= - BOOTING FR-V LINUX KERNEL - ========================= - -====================== -PROVIDING A FILESYSTEM -====================== - -First of all, a root filesystem must be made available. This can be done in -one of two ways: - - (1) NFS Export - - A filesystem should be constructed in a directory on an NFS server that - the target board can reach. This directory should then be NFS exported - such that the target board can read and write into it as root. - - (2) Flash Filesystem (JFFS2 Recommended) - - In this case, the image must be stored or built up on flash before it - can be used. A complete image can be built using the mkfs.jffs2 or - similar program and then downloaded and stored into flash by RedBoot. - - -======================== -LOADING THE KERNEL IMAGE -======================== - -The kernel will need to be loaded into RAM by RedBoot (or by some alternative -boot loader) before it can be run. The kernel image (arch/frv/boot/Image) may -be loaded in one of three ways: - - (1) Load from Flash - - This is the simplest. RedBoot can store an image in the flash (see the - RedBoot documentation) and then load it back into RAM. RedBoot keeps - track of the load address, entry point and size, so the command to do - this is simply: - - fis load linux - - The image is then ready to be executed. - - (2) Load by TFTP - - The following command will download a raw binary kernel image from the - default server (as negotiated by BOOTP) and store it into RAM: - - load -b 0x00100000 -r /tftpboot/image.bin - - The image is then ready to be executed. - - (3) Load by Y-Modem - - The following command will download a raw binary kernel image across the - serial port that RedBoot is currently using: - - load -m ymodem -b 0x00100000 -r zImage - - The serial client (such as minicom) must then be told to transmit the - program by Y-Modem. - - When finished, the image will then be ready to be executed. - - -================== -BOOTING THE KERNEL -================== - -Boot the image with the following RedBoot command: - - exec -c "" 0x00100000 - -For example: - - exec -c "console=ttySM0,115200 ip=:::::dhcp root=/dev/mtdblock2 rw" - -This will start the kernel running. Note that if the GDB-stub is compiled in, -then the kernel will immediately wait for GDB to connect over serial before -doing anything else. See the section on kernel debugging with GDB. - -The kernel command line tells the kernel where its console is and -how to find its root filesystem. This is made up of the following components, -separated by spaces: - - (*) console=ttyS[,[[[]]]] - - This specifies that the system console should output through on-chip - serial port (which can be "0" or "1"). - - is a standard baud rate between 1200 and 115200 (default 9600). - - is a parity setting of "N", "O", "E", "M" or "S" for None, Odd, - Even, Mark or Space. "None" is the default. - - is "7" or "8" for the number of bits per character. "8" is the - default. - - is "r" to use flow control (XCTS on serial port 2 only). The - default is to not use flow control. - - For example: - - console=ttyS0,115200 - - To use the first on-chip serial port at baud rate 115200, no parity, 8 - bits, and no flow control. - - (*) root= - - This specifies the device upon which the root filesystem resides. It - may be specified by major and minor number, device path, or even - partition uuid, if supported. For example: - - /dev/nfs NFS root filesystem - /dev/mtdblock3 Fourth RedBoot partition on the System Flash - PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF/PARTNROFF=1 - first partition after the partition with the given UUID - 253:0 Device with major 253 and minor 0 - - Authoritative information can be found in - "Documentation/admin-guide/kernel-parameters.rst". - - (*) rw - - Start with the root filesystem mounted Read/Write. - - The remaining components are all optional: - - (*) ip=:::::: - - Configure the network interface. If is "off" then should - specify the IP address for the network device . provide - the hostname for the device. - - If is "bootp" or "dhcp", then all of these parameters will be - discovered by consulting a BOOTP or DHCP server. - - For example, the following might be used: - - ip=192.168.73.12::::frv:eth0:off - - This sets the IP address on the VDK motherboard RTL8029 ethernet chipset - (eth0) to be 192.168.73.12, and sets the board's hostname to be "frv". - - (*) nfsroot=:[,v] - - This is mandatory if "root=/dev/nfs" is given as an option. It tells the - kernel the IP address of the NFS server providing its root filesystem, - and the pathname on that server of the filesystem. - - The NFS version to use can also be specified. v2 and v3 are supported by - Linux. - - For example: - - nfsroot=192.168.73.1:/nfsroot-frv - - (*) profile=1 - - Turns on the kernel profiler (accessible through /proc/profile). - - (*) console=gdb0 - - This can be used as an alternative to the "console=ttyS..." listed - above. I tells the kernel to pass the console output to GDB if the - gdbstub is compiled in to the kernel. - - If this is used, then the gdbstub passes the text to GDB, which then - simply dumps it to its standard output. - - (*) mem=M - - Normally the kernel will work out how much SDRAM it has by reading the - SDRAM controller registers. That can be overridden with this - option. This allows the kernel to be told that it has megabytes of - memory available. - - (*) init= [ [ [ ...]]] - - This tells the kernel what program to run initially. By default this is - /sbin/init, but /sbin/sash or /bin/sh are common alternatives. diff --git a/Documentation/frv/clock.txt b/Documentation/frv/clock.txt deleted file mode 100644 index c72d350e177a..000000000000 --- a/Documentation/frv/clock.txt +++ /dev/null @@ -1,65 +0,0 @@ -Clock scaling -------------- - -The kernel supports scaling of CLCK.CMODE, CLCK.CM and CLKC.P0 clock -registers. If built with CONFIG_PM and CONFIG_SYSCTL options enabled, four -extra files will appear in the directory /proc/sys/pm/. Reading these files -will show: - - p0 -- current value of the P0 bit in CLKC register. - cm -- current value of the CM bits in CLKC register. - cmode -- current value of the CMODE bits in CLKC register. - -On all boards, the 'p0' file should also be writable, and either '1' or '0' -can be rewritten, to set or clear the CLKC_P0 bit respectively, hence -controlling whether the resource bus rate clock is halved. - -The 'cm' file should also be available on all boards. '0' can be written to it -to shift the board into High-Speed mode (normal), and '1' can be written to -shift the board into Medium-Speed mode. Selecting Low-Speed mode is not -supported by this interface, even though some CPUs do support it. - -On the boards with FR405 CPU (i.e. CB60 and CB70), the 'cmode' file is also -writable, allowing the CPU core speed (and other clock speeds) to be -controlled from userspace. - - -Determining current and possible settings ------------------------------------------ - -The current state and the available masks can be found in /proc/cpuinfo. For -example, on the CB70: - - # cat /proc/cpuinfo - CPU-Series: fr400 - CPU-Core: fr405, gr0-31, BE, CCCR - CPU: mb93405 - MMU: Prot - FP-Media: fr0-31, Media - System: mb93091-cb70, mb93090-mb00 - PM-Controls: cmode=0xd31f, cm=0x3, p0=0x3, suspend=0x9 - PM-Status: cmode=3, cm=0, p0=0 - Clock-In: 50.00 MHz - Clock-Core: 300.00 MHz - Clock-SDRAM: 100.00 MHz - Clock-CBus: 100.00 MHz - Clock-Res: 50.00 MHz - Clock-Ext: 50.00 MHz - Clock-DSU: 25.00 MHz - BogoMips: 300.00 - -And on the PDK, the PM lines look like the following: - - PM-Controls: cm=0x3, p0=0x3, suspend=0x9 - PM-Status: cmode=9, cm=0, p0=0 - -The PM-Controls line, if present, will indicate which /proc/sys/pm files can -be set to what values. The specification values are bitmasks; so, for example, -"suspend=0x9" indicates that 0 and 3 can be written validly to -/proc/sys/pm/suspend. - -The PM-Controls line will only be present if CONFIG_PM is configured to Y. - -The PM-Status line indicates which clock controls are set to which value. If -the file can be read, then the suspend value must be 0, and so that's not -included. diff --git a/Documentation/frv/configuring.txt b/Documentation/frv/configuring.txt deleted file mode 100644 index 36e76a2336fa..000000000000 --- a/Documentation/frv/configuring.txt +++ /dev/null @@ -1,125 +0,0 @@ - ======================================= - FUJITSU FR-V LINUX KERNEL CONFIGURATION - ======================================= - -===================== -CONFIGURATION OPTIONS -===================== - -The most important setting is in the "MMU support options" tab (the first -presented in the configuration tools available): - - (*) "Kernel Type" - - This options allows selection of normal, MMU-requiring linux, and uClinux - (which doesn't require an MMU and doesn't have inter-process protection). - -There are a number of settings in the "Processor type and features" section of -the kernel configuration that need to be considered. - - (*) "CPU" - - The register and instruction sets at the core of the processor. This can - only be set to "FR40x/45x/55x" at the moment - but this permits usage of - the kernel with MB93091 CB10, CB11, CB30, CB41, CB60, CB70 and CB451 - CPU boards, and with the MB93093 PDK board. - - (*) "System" - - This option allows a choice of basic system. This governs the peripherals - that are expected to be available. - - (*) "Motherboard" - - This specifies the type of motherboard being used, and the peripherals - upon it. Currently only "MB93090-MB00" can be set here. - - (*) "Default cache-write mode" - - This controls the initial data cache write management mode. By default - Write-Through is selected, but Write-Back (Copy-Back) can also be - selected. This can be changed dynamically once the kernel is running (see - features.txt). - -There are some architecture specific configuration options in the "General -Setup" section of the kernel configuration too: - - (*) "Reserve memory uncached for (PCI) DMA" - - This requests that a uClinux kernel set aside some memory in an uncached - window for the use as consistent DMA memory (mainly for PCI). At least a - megabyte will be allocated in this way, possibly more. Any memory so - reserved will not be available for normal allocations. - - (*) "Kernel support for ELF-FDPIC binaries" - - This enables the binary-format driver for the new FDPIC ELF binaries that - this platform normally uses. These binaries are totally relocatable - - their separate sections can relocated independently, allowing them to be - shared on uClinux where possible. This should normally be enabled. - - (*) "Kernel image protection" - - This makes the protection register governing access to the core kernel - image prohibit access by userspace programs. This option is available on - uClinux only. - -There are also a number of settings in the "Kernel Hacking" section of the -kernel configuration especially for debugging a kernel on this -architecture. See the "gdbstub.txt" file for information about those. - - -====================== -DEFAULT CONFIGURATIONS -====================== - -The kernel sources include a number of example default configurations: - - (*) defconfig-mb93091 - - Default configuration for the MB93091-VDK with both CPU board and - MB93090-MB00 motherboard running uClinux. - - - (*) defconfig-mb93091-fb - - Default configuration for the MB93091-VDK with CPU board, - MB93090-MB00 motherboard, and DAV board running uClinux. - Includes framebuffer driver. - - - (*) defconfig-mb93093 - - Default configuration for the MB93093-PDK board running uClinux. - - - (*) defconfig-cb70-standalone - - Default configuration for the MB93091-VDK with only CB70 CPU board - running uClinux. This will use the CB70's DM9000 for network access. - - - (*) defconfig-mmu - - Default configuration for the MB93091-VDK with both CB451 CPU board and - MB93090-MB00 motherboard running MMU linux. - - (*) defconfig-mmu-audio - - Default configuration for the MB93091-VDK with CB451 CPU board, DAV - board, and MB93090-MB00 motherboard running MMU linux. Includes - audio driver. - - (*) defconfig-mmu-fb - - Default configuration for the MB93091-VDK with CB451 CPU board, DAV - board, and MB93090-MB00 motherboard running MMU linux. Includes - framebuffer driver. - - (*) defconfig-mmu-standalone - - Default configuration for the MB93091-VDK with only CB451 CPU board - running MMU linux. - - - diff --git a/Documentation/frv/features.txt b/Documentation/frv/features.txt deleted file mode 100644 index fa20c0e72833..000000000000 --- a/Documentation/frv/features.txt +++ /dev/null @@ -1,310 +0,0 @@ - =========================== - FUJITSU FR-V LINUX FEATURES - =========================== - -This kernel port has a number of features of which the user should be aware: - - (*) Linux and uClinux - - The FR-V architecture port supports both normal MMU linux and uClinux out - of the same sources. - - - (*) CPU support - - Support for the FR401, FR403, FR405, FR451 and FR555 CPUs should work with - the same uClinux kernel configuration. - - In normal (MMU) Linux mode, only the FR451 CPU will work as that is the - only one with a suitably featured CPU. - - The kernel is written and compiled with the assumption that only the - bottom 32 GR registers and no FR registers will be used by the kernel - itself, however all extra userspace registers will be saved on context - switch. Note that since most CPUs can't support lazy switching, no attempt - is made to do lazy register saving where that would be possible (FR555 - only currently). - - - (*) Board support - - The board on which the kernel will run can be configured on the "Processor - type and features" configuration tab. - - Set the System to "MB93093-PDK" to boot from the MB93093 (FR403) PDK. - - Set the System to "MB93091-VDK" to boot from the CB11, CB30, CB41, CB60, - CB70 or CB451 VDK boards. Set the Motherboard setting to "MB93090-MB00" to - boot with the standard ATA90590B VDK motherboard, and set it to "None" to - boot without any motherboard. - - - (*) Binary Formats - - The only userspace binary format supported is FDPIC ELF. Normal ELF, FLAT - and AOUT binaries are not supported for this architecture. - - FDPIC ELF supports shared library and program interpreter facilities. - - - (*) Scheduler Speed - - The kernel scheduler runs at 100Hz irrespective of the clock speed on this - architecture. This value is set in asm/param.h (see the HZ macro defined - there). - - - (*) Normal (MMU) Linux Memory Layout. - - See mmu-layout.txt in this directory for a description of the normal linux - memory layout - - See include/asm-frv/mem-layout.h for constants pertaining to the memory - layout. - - See include/asm-frv/mb-regs.h for the constants pertaining to the I/O bus - controller configuration. - - - (*) uClinux Memory Layout - - The memory layout used by the uClinux kernel is as follows: - - 0x00000000 - 0x00000FFF Null pointer catch page - 0x20000000 - 0x200FFFFF CS2# [PDK] FPGA - 0xC0000000 - 0xCFFFFFFF SDRAM - 0xC0000000 Base of Linux kernel image - 0xE0000000 - 0xEFFFFFFF CS2# [VDK] SLBUS/PCI window - 0xF0000000 - 0xF0FFFFFF CS5# MB93493 CSC area (DAV daughter board) - 0xF1000000 - 0xF1FFFFFF CS7# [CB70/CB451] CPU-card PCMCIA port space - 0xFC000000 - 0xFC0FFFFF CS1# [VDK] MB86943 config space - 0xFC100000 - 0xFC1FFFFF CS6# [CB70/CB451] CPU-card DM9000 NIC space - 0xFC100000 - 0xFC1FFFFF CS6# [PDK] AX88796 NIC space - 0xFC200000 - 0xFC2FFFFF CS3# MB93493 CSR area (DAV daughter board) - 0xFD000000 - 0xFDFFFFFF CS4# [CB70/CB451] CPU-card extra flash space - 0xFE000000 - 0xFEFFFFFF Internal CPU peripherals - 0xFF000000 - 0xFF1FFFFF CS0# Flash 1 - 0xFF200000 - 0xFF3FFFFF CS0# Flash 2 - 0xFFC00000 - 0xFFC0001F CS0# [VDK] FPGA - - The kernel reads the size of the SDRAM from the memory bus controller - registers by default. - - The kernel initialisation code (1) adjusts the SDRAM base addresses to - move the SDRAM to desired address, (2) moves the kernel image down to the - bottom of SDRAM, (3) adjusts the bus controller registers to move I/O - windows, and (4) rearranges the protection registers to protect all of - this. - - The reasons for doing this are: (1) the page at address 0 should be - inaccessible so that NULL pointer errors can be caught; and (2) the bottom - three quarters are left unoccupied so that an FR-V CPU with an MMU can use - it for virtual userspace mappings. - - See include/asm-frv/mem-layout.h for constants pertaining to the memory - layout. - - See include/asm-frv/mb-regs.h for the constants pertaining to the I/O bus - controller configuration. - - - (*) uClinux Memory Protection - - A DAMPR register is used to cover the entire region used for I/O - (0xE0000000 - 0xFFFFFFFF). This permits the kernel to make uncached - accesses to this region. Userspace is not permitted to access it. - - The DAMPR/IAMPR protection registers not in use for any other purpose are - tiled over the top of the SDRAM such that: - - (1) The core kernel image is covered by as small a tile as possible - granting only the kernel access to the underlying data, whilst - making sure no SDRAM is actually made unavailable by this approach. - - (2) All other tiles are arranged to permit userspace access to the rest - of the SDRAM. - - Barring point (1), there is nothing to protect kernel data against - userspace damage - but this is uClinux. - - - (*) Exceptions and Fixups - - Since the FR40x and FR55x CPUs that do not have full MMUs generate - imprecise data error exceptions, there are currently no automatic fixup - services available in uClinux. This includes misaligned memory access - fixups. - - Userspace EFAULT errors can be trapped by issuing a MEMBAR instruction and - forcing the fault to happen there. - - On the FR451, however, data exceptions are mostly precise, and so - exception fixup handling is implemented as normal. - - - (*) Userspace Breakpoints - - The ptrace() system call supports the following userspace debugging - features: - - (1) Hardware assisted single step. - - (2) Breakpoint via the FR-V "BREAK" instruction. - - (3) Breakpoint via the FR-V "TIRA GR0, #1" instruction. - - (4) Syscall entry/exit trap. - - Each of the above generates a SIGTRAP. - - - (*) On-Chip Serial Ports - - The FR-V on-chip serial ports are made available as ttyS0 and ttyS1. Note - that if the GDB stub is compiled in, ttyS1 will not actually be available - as it will be being used for the GDB stub. - - These ports can be made by: - - mknod /dev/ttyS0 c 4 64 - mknod /dev/ttyS1 c 4 65 - - - (*) Maskable Interrupts - - Level 15 (Non-maskable) interrupts are dealt with by the GDB stub if - present, and cause a panic if not. If the GDB stub is present, ttyS1's - interrupts are rated at level 15. - - All other interrupts are distributed over the set of available priorities - so that no IRQs are shared where possible. The arch interrupt handling - routines attempt to disentangle the various sources available through the - CPU's own multiplexor, and those on off-CPU peripherals. - - - (*) Accessing PCI Devices - - Where PCI is available, care must be taken when dealing with drivers that - access PCI devices. PCI devices present their data in little-endian form, - but the CPU sees it in big-endian form. The macros in asm/io.h try to get - this right, but may not under all circumstances... - - - (*) Ax88796 Ethernet Driver - - The MB93093 PDK board has an Ax88796 ethernet chipset (an NE2000 clone). A - driver has been written to deal specifically with this. The driver - provides MII services for the card. - - The driver can be configured by running make xconfig, and going to: - - (*) Network device support - - turn on "Network device support" - (*) Ethernet (10 or 100Mbit) - - turn on "Ethernet (10 or 100Mbit)" - - turn on "AX88796 NE2000 compatible chipset" - - The driver can be found in: - - drivers/net/ax88796.c - include/asm/ax88796.h - - - (*) WorkRAM Driver - - This driver provides a character device that permits access to the WorkRAM - that can be found on the FR451 CPU. Each page is accessible through a - separate minor number, thereby permitting each page to have its own - filesystem permissions set on the device file. - - The device files should be: - - mknod /dev/frv/workram0 c 240 0 - mknod /dev/frv/workram1 c 240 1 - mknod /dev/frv/workram2 c 240 2 - ... - - The driver will not permit the opening of any device file that does not - correspond to at least a partial page of WorkRAM. So the first device file - is the only one available on the FR451. If any other CPU is detected, none - of the devices will be openable. - - The devices can be accessed with read, write and llseek, and can also be - mmapped. If they're mmapped, they will only map at the appropriate - 0x7e8nnnnn address on linux and at the 0xfe8nnnnn address on uClinux. If - MAP_FIXED is not specified, the appropriate address will be chosen anyway. - - The mappings must be MAP_SHARED not MAP_PRIVATE, and must not be - PROT_EXEC. They must also start at file offset 0, and must not be longer - than one page in size. - - This driver can be configured by running make xconfig, and going to: - - (*) Character devices - - turn on "Fujitsu FR-V CPU WorkRAM support" - - - (*) Dynamic data cache write mode changing - - It is possible to view and to change the data cache's write mode through - the /proc/sys/frv/cache-mode file while the kernel is running. There are - two modes available: - - NAME MEANING - ===== ========================================== - wthru Data cache is in Write-Through mode - wback Data cache is in Write-Back/Copy-Back mode - - To read the cache mode: - - # cat /proc/sys/frv/cache-mode - wthru - - To change the cache mode: - - # echo wback >/proc/sys/frv/cache-mode - # cat /proc/sys/frv/cache-mode - wback - - - (*) MMU Context IDs and Pinning - - On MMU Linux the CPU supports the concept of a context ID in its MMU to - make it more efficient (TLB entries are labelled with a context ID to link - them to specific tasks). - - Normally once a context ID is allocated, it will remain affixed to a task - or CLONE_VM'd group of tasks for as long as it exists. However, since the - kernel is capable of supporting more tasks than there are possible ID - numbers, the kernel will pass context IDs from one task to another if - there are insufficient available. - - The context ID currently in use by a task can be viewed in /proc: - - # grep CXNR /proc/1/status - CXNR: 1 - - Note that kernel threads do not have a userspace context, and so will not - show a CXNR entry in that file. - - Under some circumstances, however, it is desirable to pin a context ID on - a process such that the kernel won't pass it on. This can be done by - writing the process ID of the target process to a special file: - - # echo 17 >/proc/sys/frv/pin-cxnr - - Reading from the file will then show the context ID pinned. - - # cat /proc/sys/frv/pin-cxnr - 4 - - The context ID will remain pinned as long as any process is using that - context, i.e.: when the all the subscribing processes have exited or - exec'd; or when an unpinning request happens: - - # echo 0 >/proc/sys/frv/pin-cxnr - - When there isn't a pinned context, the file shows -1: - - # cat /proc/sys/frv/pin-cxnr - -1 diff --git a/Documentation/frv/gdbinit b/Documentation/frv/gdbinit deleted file mode 100644 index 51517b6f307f..000000000000 --- a/Documentation/frv/gdbinit +++ /dev/null @@ -1,102 +0,0 @@ -set remotebreak 1 - -define _amr - -printf "AMRx DAMR IAMR \n" -printf "==== ===================== =====================\n" -printf "amr0 : L:%08lx P:%08lx : L:%08lx P:%08lx\n",__debug_mmu.damr[0x0].L,__debug_mmu.damr[0x0].P,__debug_mmu.iamr[0x0].L,__debug_mmu.iamr[0x0].P -printf "amr1 : L:%08lx P:%08lx : L:%08lx P:%08lx\n",__debug_mmu.damr[0x1].L,__debug_mmu.damr[0x1].P,__debug_mmu.iamr[0x1].L,__debug_mmu.iamr[0x1].P -printf "amr2 : L:%08lx P:%08lx : L:%08lx P:%08lx\n",__debug_mmu.damr[0x2].L,__debug_mmu.damr[0x2].P,__debug_mmu.iamr[0x2].L,__debug_mmu.iamr[0x2].P -printf "amr3 : L:%08lx P:%08lx : L:%08lx P:%08lx\n",__debug_mmu.damr[0x3].L,__debug_mmu.damr[0x3].P,__debug_mmu.iamr[0x3].L,__debug_mmu.iamr[0x3].P -printf "amr4 : L:%08lx P:%08lx : L:%08lx P:%08lx\n",__debug_mmu.damr[0x4].L,__debug_mmu.damr[0x4].P,__debug_mmu.iamr[0x4].L,__debug_mmu.iamr[0x4].P -printf "amr5 : L:%08lx P:%08lx : L:%08lx P:%08lx\n",__debug_mmu.damr[0x5].L,__debug_mmu.damr[0x5].P,__debug_mmu.iamr[0x5].L,__debug_mmu.iamr[0x5].P -printf "amr6 : L:%08lx P:%08lx : L:%08lx P:%08lx\n",__debug_mmu.damr[0x6].L,__debug_mmu.damr[0x6].P,__debug_mmu.iamr[0x6].L,__debug_mmu.iamr[0x6].P -printf "amr7 : L:%08lx P:%08lx : L:%08lx P:%08lx\n",__debug_mmu.damr[0x7].L,__debug_mmu.damr[0x7].P,__debug_mmu.iamr[0x7].L,__debug_mmu.iamr[0x7].P - -printf "amr8 : L:%08lx P:%08lx\n",__debug_mmu.damr[0x8].L,__debug_mmu.damr[0x8].P -printf "amr9 : L:%08lx P:%08lx\n",__debug_mmu.damr[0x9].L,__debug_mmu.damr[0x9].P -printf "amr10: L:%08lx P:%08lx\n",__debug_mmu.damr[0xa].L,__debug_mmu.damr[0xa].P -printf "amr11: L:%08lx P:%08lx\n",__debug_mmu.damr[0xb].L,__debug_mmu.damr[0xb].P - -end - - -define _tlb -printf "tlb[0x00]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x0].L,__debug_mmu.tlb[0x0].P,__debug_mmu.tlb[0x40+0x0].L,__debug_mmu.tlb[0x40+0x0].P -printf "tlb[0x01]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x1].L,__debug_mmu.tlb[0x1].P,__debug_mmu.tlb[0x40+0x1].L,__debug_mmu.tlb[0x40+0x1].P -printf "tlb[0x02]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x2].L,__debug_mmu.tlb[0x2].P,__debug_mmu.tlb[0x40+0x2].L,__debug_mmu.tlb[0x40+0x2].P -printf "tlb[0x03]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x3].L,__debug_mmu.tlb[0x3].P,__debug_mmu.tlb[0x40+0x3].L,__debug_mmu.tlb[0x40+0x3].P -printf "tlb[0x04]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x4].L,__debug_mmu.tlb[0x4].P,__debug_mmu.tlb[0x40+0x4].L,__debug_mmu.tlb[0x40+0x4].P -printf "tlb[0x05]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x5].L,__debug_mmu.tlb[0x5].P,__debug_mmu.tlb[0x40+0x5].L,__debug_mmu.tlb[0x40+0x5].P -printf "tlb[0x06]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x6].L,__debug_mmu.tlb[0x6].P,__debug_mmu.tlb[0x40+0x6].L,__debug_mmu.tlb[0x40+0x6].P -printf "tlb[0x07]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x7].L,__debug_mmu.tlb[0x7].P,__debug_mmu.tlb[0x40+0x7].L,__debug_mmu.tlb[0x40+0x7].P -printf "tlb[0x08]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x8].L,__debug_mmu.tlb[0x8].P,__debug_mmu.tlb[0x40+0x8].L,__debug_mmu.tlb[0x40+0x8].P -printf "tlb[0x09]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x9].L,__debug_mmu.tlb[0x9].P,__debug_mmu.tlb[0x40+0x9].L,__debug_mmu.tlb[0x40+0x9].P -printf "tlb[0x0a]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0xa].L,__debug_mmu.tlb[0xa].P,__debug_mmu.tlb[0x40+0xa].L,__debug_mmu.tlb[0x40+0xa].P -printf "tlb[0x0b]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0xb].L,__debug_mmu.tlb[0xb].P,__debug_mmu.tlb[0x40+0xb].L,__debug_mmu.tlb[0x40+0xb].P -printf "tlb[0x0c]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0xc].L,__debug_mmu.tlb[0xc].P,__debug_mmu.tlb[0x40+0xc].L,__debug_mmu.tlb[0x40+0xc].P -printf "tlb[0x0d]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0xd].L,__debug_mmu.tlb[0xd].P,__debug_mmu.tlb[0x40+0xd].L,__debug_mmu.tlb[0x40+0xd].P -printf "tlb[0x0e]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0xe].L,__debug_mmu.tlb[0xe].P,__debug_mmu.tlb[0x40+0xe].L,__debug_mmu.tlb[0x40+0xe].P -printf "tlb[0x0f]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0xf].L,__debug_mmu.tlb[0xf].P,__debug_mmu.tlb[0x40+0xf].L,__debug_mmu.tlb[0x40+0xf].P -printf "tlb[0x10]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x10].L,__debug_mmu.tlb[0x10].P,__debug_mmu.tlb[0x40+0x10].L,__debug_mmu.tlb[0x40+0x10].P -printf "tlb[0x11]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x11].L,__debug_mmu.tlb[0x11].P,__debug_mmu.tlb[0x40+0x11].L,__debug_mmu.tlb[0x40+0x11].P -printf "tlb[0x12]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x12].L,__debug_mmu.tlb[0x12].P,__debug_mmu.tlb[0x40+0x12].L,__debug_mmu.tlb[0x40+0x12].P -printf "tlb[0x13]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x13].L,__debug_mmu.tlb[0x13].P,__debug_mmu.tlb[0x40+0x13].L,__debug_mmu.tlb[0x40+0x13].P -printf "tlb[0x14]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x14].L,__debug_mmu.tlb[0x14].P,__debug_mmu.tlb[0x40+0x14].L,__debug_mmu.tlb[0x40+0x14].P -printf "tlb[0x15]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x15].L,__debug_mmu.tlb[0x15].P,__debug_mmu.tlb[0x40+0x15].L,__debug_mmu.tlb[0x40+0x15].P -printf "tlb[0x16]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x16].L,__debug_mmu.tlb[0x16].P,__debug_mmu.tlb[0x40+0x16].L,__debug_mmu.tlb[0x40+0x16].P -printf "tlb[0x17]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x17].L,__debug_mmu.tlb[0x17].P,__debug_mmu.tlb[0x40+0x17].L,__debug_mmu.tlb[0x40+0x17].P -printf "tlb[0x18]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x18].L,__debug_mmu.tlb[0x18].P,__debug_mmu.tlb[0x40+0x18].L,__debug_mmu.tlb[0x40+0x18].P -printf "tlb[0x19]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x19].L,__debug_mmu.tlb[0x19].P,__debug_mmu.tlb[0x40+0x19].L,__debug_mmu.tlb[0x40+0x19].P -printf "tlb[0x1a]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x1a].L,__debug_mmu.tlb[0x1a].P,__debug_mmu.tlb[0x40+0x1a].L,__debug_mmu.tlb[0x40+0x1a].P -printf "tlb[0x1b]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x1b].L,__debug_mmu.tlb[0x1b].P,__debug_mmu.tlb[0x40+0x1b].L,__debug_mmu.tlb[0x40+0x1b].P -printf "tlb[0x1c]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x1c].L,__debug_mmu.tlb[0x1c].P,__debug_mmu.tlb[0x40+0x1c].L,__debug_mmu.tlb[0x40+0x1c].P -printf "tlb[0x1d]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x1d].L,__debug_mmu.tlb[0x1d].P,__debug_mmu.tlb[0x40+0x1d].L,__debug_mmu.tlb[0x40+0x1d].P -printf "tlb[0x1e]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x1e].L,__debug_mmu.tlb[0x1e].P,__debug_mmu.tlb[0x40+0x1e].L,__debug_mmu.tlb[0x40+0x1e].P -printf "tlb[0x1f]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x1f].L,__debug_mmu.tlb[0x1f].P,__debug_mmu.tlb[0x40+0x1f].L,__debug_mmu.tlb[0x40+0x1f].P -printf "tlb[0x20]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x20].L,__debug_mmu.tlb[0x20].P,__debug_mmu.tlb[0x40+0x20].L,__debug_mmu.tlb[0x40+0x20].P -printf "tlb[0x21]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x21].L,__debug_mmu.tlb[0x21].P,__debug_mmu.tlb[0x40+0x21].L,__debug_mmu.tlb[0x40+0x21].P -printf "tlb[0x22]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x22].L,__debug_mmu.tlb[0x22].P,__debug_mmu.tlb[0x40+0x22].L,__debug_mmu.tlb[0x40+0x22].P -printf "tlb[0x23]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x23].L,__debug_mmu.tlb[0x23].P,__debug_mmu.tlb[0x40+0x23].L,__debug_mmu.tlb[0x40+0x23].P -printf "tlb[0x24]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x24].L,__debug_mmu.tlb[0x24].P,__debug_mmu.tlb[0x40+0x24].L,__debug_mmu.tlb[0x40+0x24].P -printf "tlb[0x25]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x25].L,__debug_mmu.tlb[0x25].P,__debug_mmu.tlb[0x40+0x25].L,__debug_mmu.tlb[0x40+0x25].P -printf "tlb[0x26]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x26].L,__debug_mmu.tlb[0x26].P,__debug_mmu.tlb[0x40+0x26].L,__debug_mmu.tlb[0x40+0x26].P -printf "tlb[0x27]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x27].L,__debug_mmu.tlb[0x27].P,__debug_mmu.tlb[0x40+0x27].L,__debug_mmu.tlb[0x40+0x27].P -printf "tlb[0x28]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x28].L,__debug_mmu.tlb[0x28].P,__debug_mmu.tlb[0x40+0x28].L,__debug_mmu.tlb[0x40+0x28].P -printf "tlb[0x29]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x29].L,__debug_mmu.tlb[0x29].P,__debug_mmu.tlb[0x40+0x29].L,__debug_mmu.tlb[0x40+0x29].P -printf "tlb[0x2a]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x2a].L,__debug_mmu.tlb[0x2a].P,__debug_mmu.tlb[0x40+0x2a].L,__debug_mmu.tlb[0x40+0x2a].P -printf "tlb[0x2b]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x2b].L,__debug_mmu.tlb[0x2b].P,__debug_mmu.tlb[0x40+0x2b].L,__debug_mmu.tlb[0x40+0x2b].P -printf "tlb[0x2c]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x2c].L,__debug_mmu.tlb[0x2c].P,__debug_mmu.tlb[0x40+0x2c].L,__debug_mmu.tlb[0x40+0x2c].P -printf "tlb[0x2d]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x2d].L,__debug_mmu.tlb[0x2d].P,__debug_mmu.tlb[0x40+0x2d].L,__debug_mmu.tlb[0x40+0x2d].P -printf "tlb[0x2e]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x2e].L,__debug_mmu.tlb[0x2e].P,__debug_mmu.tlb[0x40+0x2e].L,__debug_mmu.tlb[0x40+0x2e].P -printf "tlb[0x2f]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x2f].L,__debug_mmu.tlb[0x2f].P,__debug_mmu.tlb[0x40+0x2f].L,__debug_mmu.tlb[0x40+0x2f].P -printf "tlb[0x30]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x30].L,__debug_mmu.tlb[0x30].P,__debug_mmu.tlb[0x40+0x30].L,__debug_mmu.tlb[0x40+0x30].P -printf "tlb[0x31]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x31].L,__debug_mmu.tlb[0x31].P,__debug_mmu.tlb[0x40+0x31].L,__debug_mmu.tlb[0x40+0x31].P -printf "tlb[0x32]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x32].L,__debug_mmu.tlb[0x32].P,__debug_mmu.tlb[0x40+0x32].L,__debug_mmu.tlb[0x40+0x32].P -printf "tlb[0x33]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x33].L,__debug_mmu.tlb[0x33].P,__debug_mmu.tlb[0x40+0x33].L,__debug_mmu.tlb[0x40+0x33].P -printf "tlb[0x34]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x34].L,__debug_mmu.tlb[0x34].P,__debug_mmu.tlb[0x40+0x34].L,__debug_mmu.tlb[0x40+0x34].P -printf "tlb[0x35]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x35].L,__debug_mmu.tlb[0x35].P,__debug_mmu.tlb[0x40+0x35].L,__debug_mmu.tlb[0x40+0x35].P -printf "tlb[0x36]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x36].L,__debug_mmu.tlb[0x36].P,__debug_mmu.tlb[0x40+0x36].L,__debug_mmu.tlb[0x40+0x36].P -printf "tlb[0x37]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x37].L,__debug_mmu.tlb[0x37].P,__debug_mmu.tlb[0x40+0x37].L,__debug_mmu.tlb[0x40+0x37].P -printf "tlb[0x38]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x38].L,__debug_mmu.tlb[0x38].P,__debug_mmu.tlb[0x40+0x38].L,__debug_mmu.tlb[0x40+0x38].P -printf "tlb[0x39]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x39].L,__debug_mmu.tlb[0x39].P,__debug_mmu.tlb[0x40+0x39].L,__debug_mmu.tlb[0x40+0x39].P -printf "tlb[0x3a]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x3a].L,__debug_mmu.tlb[0x3a].P,__debug_mmu.tlb[0x40+0x3a].L,__debug_mmu.tlb[0x40+0x3a].P -printf "tlb[0x3b]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x3b].L,__debug_mmu.tlb[0x3b].P,__debug_mmu.tlb[0x40+0x3b].L,__debug_mmu.tlb[0x40+0x3b].P -printf "tlb[0x3c]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x3c].L,__debug_mmu.tlb[0x3c].P,__debug_mmu.tlb[0x40+0x3c].L,__debug_mmu.tlb[0x40+0x3c].P -printf "tlb[0x3d]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x3d].L,__debug_mmu.tlb[0x3d].P,__debug_mmu.tlb[0x40+0x3d].L,__debug_mmu.tlb[0x40+0x3d].P -printf "tlb[0x3e]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x3e].L,__debug_mmu.tlb[0x3e].P,__debug_mmu.tlb[0x40+0x3e].L,__debug_mmu.tlb[0x40+0x3e].P -printf "tlb[0x3f]: %08lx %08lx %08lx %08lx\n",__debug_mmu.tlb[0x3f].L,__debug_mmu.tlb[0x3f].P,__debug_mmu.tlb[0x40+0x3f].L,__debug_mmu.tlb[0x40+0x3f].P -end - - -define _pgd -p (pgd_t[0x40])*(pgd_t*)(__debug_mmu.damr[0x3].L) -end - -define _ptd_i -p (pte_t[0x1000])*(pte_t*)(__debug_mmu.damr[0x4].L) -end - -define _ptd_d -p (pte_t[0x1000])*(pte_t*)(__debug_mmu.damr[0x5].L) -end diff --git a/Documentation/frv/gdbstub.txt b/Documentation/frv/gdbstub.txt deleted file mode 100644 index b92bfd902a4e..000000000000 --- a/Documentation/frv/gdbstub.txt +++ /dev/null @@ -1,130 +0,0 @@ - ==================== - DEBUGGING FR-V LINUX - ==================== - - -The kernel contains a GDB stub that talks GDB remote protocol across a serial -port. This permits GDB to single step through the kernel, set breakpoints and -trap exceptions that happen in kernel space and interrupt execution. It also -permits the NMI interrupt button or serial port events to jump the kernel into -the debugger. - -On the CPUs that have on-chip UARTs (FR400, FR403, FR405, FR555), the -GDB stub hijacks a serial port for its own purposes, and makes it -generate level 15 interrupts (NMI). The kernel proper cannot see the serial -port in question under these conditions. - -On the MB93091-VDK CPU boards, the GDB stub uses UART1, which would otherwise -be /dev/ttyS1. On the MB93093-PDK, the GDB stub uses UART0. Therefore, on the -PDK there is no externally accessible serial port and the serial port to -which the touch screen is attached becomes /dev/ttyS0. - -Note that the GDB stub runs entirely within CPU debug mode, and so should not -incur any exceptions or interrupts whilst it is active. In particular, note -that the clock will lose time since it is implemented in software. - - -================== -KERNEL PREPARATION -================== - -Firstly, a debuggable kernel must be built. To do this, unpack the kernel tree -and copy the configuration that you wish to use to .config. Then reconfigure -the following things on the "Kernel Hacking" tab: - - (*) "Include debugging information" - - Set this to "Y". This causes all C and Assembly files to be compiled - to include debugging information. - - (*) "In-kernel GDB stub" - - Set this to "Y". This causes the GDB stub to be compiled into the - kernel. - - (*) "Immediate activation" - - Set this to "Y" if you want the GDB stub to activate as soon as possible - and wait for GDB to connect. This allows you to start tracing right from - the beginning of start_kernel() in init/main.c. - - (*) "Console through GDB stub" - - Set this to "Y" if you wish to be able to use "console=gdb0" on the - command line. That tells the kernel to pass system console messages to - GDB (which then prints them on its standard output). This is useful when - debugging the serial drivers that'd otherwise be used to pass console - messages to the outside world. - -Then build as usual, download to the board and execute. Note that if -"Immediate activation" was selected, then the kernel will wait for GDB to -attach. If not, then the kernel will boot immediately and GDB will have to -interrupt it or wait for an exception to occur before doing anything with -the kernel. - - -========================= -KERNEL DEBUGGING WITH GDB -========================= - -Set the serial port on the computer that's going to run GDB to the appropriate -baud rate. Assuming the board's debug port is connected to ttyS0/COM1 on the -computer doing the debugging: - - stty -F /dev/ttyS0 115200 - -Then start GDB in the base of the kernel tree: - - frv-uclinux-gdb linux [uClinux] - -Or: - - frv-uclinux-gdb vmlinux [MMU linux] - -When the prompt appears: - - GNU gdb frv-031024 - Copyright 2003 Free Software Foundation, Inc. - GDB is free software, covered by the GNU General Public License, and you are - welcome to change it and/or distribute copies of it under certain conditions. - Type "show copying" to see the conditions. - There is absolutely no warranty for GDB. Type "show warranty" for details. - This GDB was configured as "--host=i686-pc-linux-gnu --target=frv-uclinux"... - (gdb) - -Attach to the board like this: - - (gdb) target remote /dev/ttyS0 - Remote debugging using /dev/ttyS0 - start_kernel () at init/main.c:395 - (gdb) - -This should show the appropriate lines from the source too. The kernel can -then be debugged almost as if it's any other program. - - -=============================== -INTERRUPTING THE RUNNING KERNEL -=============================== - -The kernel can be interrupted whilst it is running, causing a jump back to the -GDB stub and the debugger: - - (*) Pressing Ctrl-C in GDB. This will cause GDB to try and interrupt the - kernel by sending an RS232 BREAK over the serial line to the GDB - stub. This will (mostly) immediately interrupt the kernel and return it - to the debugger. - - (*) Pressing the NMI button on the board will also cause a jump into the - debugger. - - (*) Setting a software breakpoint. This sets a break instruction at the - desired location which the GDB stub then traps the exception for. - - (*) Setting a hardware breakpoint. The GDB stub is capable of using the IBAR - and DBAR registers to assist debugging. - -Furthermore, the GDB stub will intercept a number of exceptions automatically -if they are caused by kernel execution. It will also intercept BUG() macro -invocation. - diff --git a/Documentation/frv/kernel-ABI.txt b/Documentation/frv/kernel-ABI.txt deleted file mode 100644 index aaa1cec86f0b..000000000000 --- a/Documentation/frv/kernel-ABI.txt +++ /dev/null @@ -1,262 +0,0 @@ - ================================= - INTERNAL KERNEL ABI FOR FR-V ARCH - ================================= - -The internal FRV kernel ABI is not quite the same as the userspace ABI. A -number of the registers are used for special purposed, and the ABI is not -consistent between modules vs core, and MMU vs no-MMU. - -This partly stems from the fact that FRV CPUs do not have a separate -supervisor stack pointer, and most of them do not have any scratch -registers, thus requiring at least one general purpose register to be -clobbered in such an event. Also, within the kernel core, it is possible to -simply jump or call directly between functions using a relative offset. -This cannot be extended to modules for the displacement is likely to be too -far. Thus in modules the address of a function to call must be calculated -in a register and then used, requiring two extra instructions. - -This document has the following sections: - - (*) System call register ABI - (*) CPU operating modes - (*) Internal kernel-mode register ABI - (*) Internal debug-mode register ABI - (*) Virtual interrupt handling - - -======================== -SYSTEM CALL REGISTER ABI -======================== - -When a system call is made, the following registers are effective: - - REGISTERS CALL RETURN - =============== ======================= ======================= - GR7 System call number Preserved - GR8 Syscall arg #1 Return value - GR9-GR13 Syscall arg #2-6 Preserved - - -=================== -CPU OPERATING MODES -=================== - -The FR-V CPU has three basic operating modes. In order of increasing -capability: - - (1) User mode. - - Basic userspace running mode. - - (2) Kernel mode. - - Normal kernel mode. There are many additional control registers - available that may be accessed in this mode, in addition to all the - stuff available to user mode. This has two submodes: - - (a) Exceptions enabled (PSR.T == 1). - - Exceptions will invoke the appropriate normal kernel mode - handler. On entry to the handler, the PSR.T bit will be cleared. - - (b) Exceptions disabled (PSR.T == 0). - - No exceptions or interrupts may happen. Any mandatory exceptions - will cause the CPU to halt unless the CPU is told to jump into - debug mode instead. - - (3) Debug mode. - - No exceptions may happen in this mode. Memory protection and - management exceptions will be flagged for later consideration, but - the exception handler won't be invoked. Debugging traps such as - hardware breakpoints and watchpoints will be ignored. This mode is - entered only by debugging events obtained from the other two modes. - - All kernel mode registers may be accessed, plus a few extra debugging - specific registers. - - -================================= -INTERNAL KERNEL-MODE REGISTER ABI -================================= - -There are a number of permanent register assignments that are set up by -entry.S in the exception prologue. Note that there is a complete set of -exception prologues for each of user->kernel transition and kernel->kernel -transition. There are also user->debug and kernel->debug mode transition -prologues. - - - REGISTER FLAVOUR USE - =============== ======= ============================================== - GR1 Supervisor stack pointer - GR15 Current thread info pointer - GR16 GP-Rel base register for small data - GR28 Current exception frame pointer (__frame) - GR29 Current task pointer (current) - GR30 Destroyed by kernel mode entry - GR31 NOMMU Destroyed by debug mode entry - GR31 MMU Destroyed by TLB miss kernel mode entry - CCR.ICC2 Virtual interrupt disablement tracking - CCCR.CC3 Cleared by exception prologue - (atomic op emulation) - SCR0 MMU See mmu-layout.txt. - SCR1 MMU See mmu-layout.txt. - SCR2 MMU Save for EAR0 (destroyed by icache insns - in debug mode) - SCR3 MMU Save for GR31 during debug exceptions - DAMR/IAMR NOMMU Fixed memory protection layout. - DAMR/IAMR MMU See mmu-layout.txt. - - -Certain registers are also used or modified across function calls: - - REGISTER CALL RETURN - =============== =============================== ====================== - GR0 Fixed Zero - - GR2 Function call frame pointer - GR3 Special Preserved - GR3-GR7 - Clobbered - GR8 Function call arg #1 Return value - (or clobbered) - GR9 Function call arg #2 Return value MSW - (or clobbered) - GR10-GR13 Function call arg #3-#6 Clobbered - GR14 - Clobbered - GR15-GR16 Special Preserved - GR17-GR27 - Preserved - GR28-GR31 Special Only accessed - explicitly - LR Return address after CALL Clobbered - CCR/CCCR - Mostly Clobbered - - -================================ -INTERNAL DEBUG-MODE REGISTER ABI -================================ - -This is the same as the kernel-mode register ABI for functions calls. The -difference is that in debug-mode there's a different stack and a different -exception frame. Almost all the global registers from kernel-mode -(including the stack pointer) may be changed. - - REGISTER FLAVOUR USE - =============== ======= ============================================== - GR1 Debug stack pointer - GR16 GP-Rel base register for small data - GR31 Current debug exception frame pointer - (__debug_frame) - SCR3 MMU Saved value of GR31 - - -Note that debug mode is able to interfere with the kernel's emulated atomic -ops, so it must be exceedingly careful not to do any that would interact -with the main kernel in this regard. Hence the debug mode code (gdbstub) is -almost completely self-contained. The only external code used is the -sprintf family of functions. - -Furthermore, break.S is so complicated because single-step mode does not -switch off on entry to an exception. That means unless manually disabled, -single-stepping will blithely go on stepping into things like interrupts. -See gdbstub.txt for more information. - - -========================== -VIRTUAL INTERRUPT HANDLING -========================== - -Because accesses to the PSR is so slow, and to disable interrupts we have -to access it twice (once to read and once to write), we don't actually -disable interrupts at all if we don't have to. What we do instead is use -the ICC2 condition code flags to note virtual disablement, such that if we -then do take an interrupt, we note the flag, really disable interrupts, set -another flag and resume execution at the point the interrupt happened. -Setting condition flags as a side effect of an arithmetic or logical -instruction is really fast. This use of the ICC2 only occurs within the -kernel - it does not affect userspace. - -The flags we use are: - - (*) CCR.ICC2.Z [Zero flag] - - Set to virtually disable interrupts, clear when interrupts are - virtually enabled. Can be modified by logical instructions without - affecting the Carry flag. - - (*) CCR.ICC2.C [Carry flag] - - Clear to indicate hardware interrupts are really disabled, set otherwise. - - -What happens is this: - - (1) Normal kernel-mode operation. - - ICC2.Z is 0, ICC2.C is 1. - - (2) An interrupt occurs. The exception prologue examines ICC2.Z and - determines that nothing needs doing. This is done simply with an - unlikely BEQ instruction. - - (3) The interrupts are disabled (local_irq_disable) - - ICC2.Z is set to 1. - - (4) If interrupts were then re-enabled (local_irq_enable): - - ICC2.Z would be set to 0. - - A TIHI #2 instruction (trap #2 if condition HI - Z==0 && C==0) would - be used to trap if interrupts were now virtually enabled, but - physically disabled - which they're not, so the trap isn't taken. The - kernel would then be back to state (1). - - (5) An interrupt occurs. The exception prologue examines ICC2.Z and - determines that the interrupt shouldn't actually have happened. It - jumps aside, and there disabled interrupts by setting PSR.PIL to 14 - and then it clears ICC2.C. - - (6) If interrupts were then saved and disabled again (local_irq_save): - - ICC2.Z would be shifted into the save variable and masked off - (giving a 1). - - ICC2.Z would then be set to 1 (thus unchanged), and ICC2.C would be - unaffected (ie: 0). - - (7) If interrupts were then restored from state (6) (local_irq_restore): - - ICC2.Z would be set to indicate the result of XOR'ing the saved - value (ie: 1) with 1, which gives a result of 0 - thus leaving - ICC2.Z set. - - ICC2.C would remain unaffected (ie: 0). - - A TIHI #2 instruction would be used to again assay the current state, - but this would do nothing as Z==1. - - (8) If interrupts were then enabled (local_irq_enable): - - ICC2.Z would be cleared. ICC2.C would be left unaffected. Both - flags would now be 0. - - A TIHI #2 instruction again issued to assay the current state would - then trap as both Z==0 [interrupts virtually enabled] and C==0 - [interrupts really disabled] would then be true. - - (9) The trap #2 handler would simply enable hardware interrupts - (set PSR.PIL to 0), set ICC2.C to 1 and return. - -(10) Immediately upon returning, the pending interrupt would be taken. - -(11) The interrupt handler would take the path of actually processing the - interrupt (ICC2.Z is clear, BEQ fails as per step (2)). - -(12) The interrupt handler would then set ICC2.C to 1 since hardware - interrupts are definitely enabled - or else the kernel wouldn't be here. - -(13) On return from the interrupt handler, things would be back to state (1). - -This trap (#2) is only available in kernel mode. In user mode it will -result in SIGILL. diff --git a/Documentation/frv/mmu-layout.txt b/Documentation/frv/mmu-layout.txt deleted file mode 100644 index db10250df6be..000000000000 --- a/Documentation/frv/mmu-layout.txt +++ /dev/null @@ -1,306 +0,0 @@ - ================================= - FR451 MMU LINUX MEMORY MANAGEMENT - ================================= - -============ -MMU HARDWARE -============ - -FR451 MMU Linux puts the MMU into EDAT mode whilst running. This means that it uses both the SAT -registers and the DAT TLB to perform address translation. - -There are 8 IAMLR/IAMPR register pairs and 16 DAMLR/DAMPR register pairs for SAT mode. - -In DAT mode, there is also a TLB organised in cache format as 64 lines x 2 ways. Each line spans a -16KB range of addresses, but can match a larger region. - - -=========================== -MEMORY MANAGEMENT REGISTERS -=========================== - -Certain control registers are used by the kernel memory management routines: - - REGISTERS USAGE - ====================== ================================================== - IAMR0, DAMR0 Kernel image and data mappings - IAMR1, DAMR1 First-chance TLB lookup mapping - DAMR2 Page attachment for cache flush by page - DAMR3 Current PGD mapping - SCR0, DAMR4 Instruction TLB PGE/PTD cache - SCR1, DAMR5 Data TLB PGE/PTD cache - DAMR6-10 kmap_atomic() mappings - DAMR11 I/O mapping - CXNR mm_struct context ID - TTBR Page directory (PGD) pointer (physical address) - - -===================== -GENERAL MEMORY LAYOUT -===================== - -The physical memory layout is as follows: - - PHYSICAL ADDRESS CONTROLLER DEVICE - =================== ============== ======================================= - 00000000 - BFFFFFFF SDRAM SDRAM area - E0000000 - EFFFFFFF L-BUS CS2# VDK SLBUS/PCI window - F0000000 - F0FFFFFF L-BUS CS5# MB93493 CSC area (DAV daughter board) - F1000000 - F1FFFFFF L-BUS CS7# (CB70 CPU-card PCMCIA port I/O space) - FC000000 - FC0FFFFF L-BUS CS1# VDK MB86943 config space - FC100000 - FC1FFFFF L-BUS CS6# DM9000 NIC I/O space - FC200000 - FC2FFFFF L-BUS CS3# MB93493 CSR area (DAV daughter board) - FD000000 - FDFFFFFF L-BUS CS4# (CB70 CPU-card extra flash space) - FE000000 - FEFFFFFF Internal CPU peripherals - FF000000 - FF1FFFFF L-BUS CS0# Flash 1 - FF200000 - FF3FFFFF L-BUS CS0# Flash 2 - FFC00000 - FFC0001F L-BUS CS0# FPGA - -The virtual memory layout is: - - VIRTUAL ADDRESS PHYSICAL TRANSLATOR FLAGS SIZE OCCUPATION - ================= ======== ============== ======= ======= =================================== - 00004000-BFFFFFFF various TLB,xAMR1 D-N-??V 3GB Userspace - C0000000-CFFFFFFF 00000000 xAMPR0 -L-S--V 256MB Kernel image and data - D0000000-D7FFFFFF various TLB,xAMR1 D-NS??V 128MB vmalloc area - D8000000-DBFFFFFF various TLB,xAMR1 D-NS??V 64MB kmap() area - DC000000-DCFFFFFF various TLB 1MB Secondary kmap_atomic() frame - DD000000-DD27FFFF various DAMR 160KB Primary kmap_atomic() frame - DD040000 DAMR2/IAMR2 -L-S--V page Page cache flush attachment point - DD080000 DAMR3 -L-SC-V page Page Directory (PGD) - DD0C0000 DAMR4 -L-SC-V page Cached insn TLB Page Table lookup - DD100000 DAMR5 -L-SC-V page Cached data TLB Page Table lookup - DD140000 DAMR6 -L-S--V page kmap_atomic(KM_BOUNCE_READ) - DD180000 DAMR7 -L-S--V page kmap_atomic(KM_SKB_SUNRPC_DATA) - DD1C0000 DAMR8 -L-S--V page kmap_atomic(KM_SKB_DATA_SOFTIRQ) - DD200000 DAMR9 -L-S--V page kmap_atomic(KM_USER0) - DD240000 DAMR10 -L-S--V page kmap_atomic(KM_USER1) - E0000000-FFFFFFFF E0000000 DAMR11 -L-SC-V 512MB I/O region - -IAMPR1 and DAMPR1 are used as an extension to the TLB. - - -==================== -KMAP AND KMAP_ATOMIC -==================== - -To access pages in the page cache (which may not be directly accessible if highmem is available), -the kernel calls kmap(), does the access and then calls kunmap(); or it calls kmap_atomic(), does -the access and then calls kunmap_atomic(). - -kmap() creates an attachment between an arbitrary inaccessible page and a range of virtual -addresses by installing a PTE in a special page table. The kernel can then access this page as it -wills. When it's finished, the kernel calls kunmap() to clear the PTE. - -kmap_atomic() does something slightly different. In the interests of speed, it chooses one of two -strategies: - - (1) If possible, kmap_atomic() attaches the requested page to one of DAMPR5 through DAMPR10 - register pairs; and the matching kunmap_atomic() clears the DAMPR. This makes high memory - support really fast as there's no need to flush the TLB or modify the page tables. The DAMLR - registers being used for this are preset during boot and don't change over the lifetime of the - process. There's a direct mapping between the first few kmap_atomic() types, DAMR number and - virtual address slot. - - However, there are more kmap_atomic() types defined than there are DAMR registers available, - so we fall back to: - - (2) kmap_atomic() uses a slot in the secondary frame (determined by the type parameter), and then - locks an entry in the TLB to translate that slot to the specified page. The number of slots is - obviously limited, and their positions are controlled such that each slot is matched by a - different line in the TLB. kunmap() ejects the entry from the TLB. - -Note that the first three kmap atomic types are really just declared as placeholders. The DAMPR -registers involved are actually modified directly. - -Also note that kmap() itself may sleep, kmap_atomic() may never sleep and both always succeed; -furthermore, a driver using kmap() may sleep before calling kunmap(), but may not sleep before -calling kunmap_atomic() if it had previously called kmap_atomic(). - - -=============================== -USING MORE THAN 256MB OF MEMORY -=============================== - -The kernel cannot access more than 256MB of memory directly. The physical layout, however, permits -up to 3GB of SDRAM (possibly 3.25GB) to be made available. By using CONFIG_HIGHMEM, the kernel can -allow userspace (by way of page tables) and itself (by way of kmap) to deal with the memory -allocation. - -External devices can, of course, still DMA to and from all of the SDRAM, even if the kernel can't -see it directly. The kernel translates page references into real addresses for communicating to the -devices. - - -=================== -PAGE TABLE TOPOLOGY -=================== - -The page tables are arranged in 2-layer format. There is a middle layer (PMD) that would be used in -3-layer format tables but that is folded into the top layer (PGD) and so consumes no extra memory -or processing power. - - +------+ PGD PMD - | TTBR |--->+-------------------+ - +------+ | | : STE | - | PGE0 | PME0 : STE | - | | : STE | - +-------------------+ Page Table - | | : STE -------------->+--------+ +0x0000 - | PGE1 | PME0 : STE -----------+ | PTE0 | - | | : STE -------+ | +--------+ - +-------------------+ | | | PTE63 | - | | : STE | | +-->+--------+ +0x0100 - | PGE2 | PME0 : STE | | | PTE64 | - | | : STE | | +--------+ - +-------------------+ | | PTE127 | - | | : STE | +------>+--------+ +0x0200 - | PGE3 | PME0 : STE | | PTE128 | - | | : STE | +--------+ - +-------------------+ | PTE191 | - +--------+ +0x0300 - -Each Page Directory (PGD) is 16KB (page size) in size and is divided into 64 entries (PGEs). Each -PGE contains one Page Mid Directory (PMD). - -Each PMD is 256 bytes in size and contains a single entry (PME). Each PME holds 64 FR451 MMU -segment table entries of 4 bytes apiece. Each PME "points to" a page table. In practice, each STE -points to a subset of the page table, the first to PT+0x0000, the second to PT+0x0100, the third to -PT+0x200, and so on. - -Each PGE and PME covers 64MB of the total virtual address space. - -Each Page Table (PTD) is 16KB (page size) in size, and is divided into 4096 entries (PTEs). Each -entry can point to one 16KB page. In practice, each Linux page table is subdivided into 64 FR451 -MMU page tables. But they are all grouped together to make management easier, in particular rmap -support is then trivial. - -Grouping page tables in this fashion makes PGE caching in SCR0/SCR1 more efficient because the -coverage of the cached item is greater. - -Page tables for the vmalloc area are allocated at boot time and shared between all mm_structs. - - -================= -USER SPACE LAYOUT -================= - -For MMU capable Linux, the regions userspace code are allowed to access are kept entirely separate -from those dedicated to the kernel: - - VIRTUAL ADDRESS SIZE PURPOSE - ================= ===== =================================== - 00000000-00003fff 4KB NULL pointer access trap - 00004000-01ffffff ~32MB lower mmap space (grows up) - 02000000-021fffff 2MB Stack space (grows down from top) - 02200000-nnnnnnnn Executable mapping - nnnnnnnn- brk space (grows up) - -bfffffff upper mmap space (grows down) - -This is so arranged so as to make best use of the 16KB page tables and the way in which PGEs/PMEs -are cached by the TLB handler. The lower mmap space is filled first, and then the upper mmap space -is filled. - - -=============================== -GDB-STUB MMU DEBUGGING SERVICES -=============================== - -The gdb-stub included in this kernel provides a number of services to aid in the debugging of MMU -related kernel services: - - (*) Every time the kernel stops, certain state information is dumped into __debug_mmu. This - variable is defined in arch/frv/kernel/gdb-stub.c. Note that the gdbinit file in this - directory has some useful macros for dealing with this. - - (*) __debug_mmu.tlb[] - - This receives the current TLB contents. This can be viewed with the _tlb GDB macro: - - (gdb) _tlb - tlb[0x00]: 01000005 00718203 01000002 00718203 - tlb[0x01]: 01004002 006d4201 01004005 006d4203 - tlb[0x02]: 01008002 006d0201 01008006 00004200 - tlb[0x03]: 0100c006 007f4202 0100c002 0064c202 - tlb[0x04]: 01110005 00774201 01110002 00774201 - tlb[0x05]: 01114005 00770201 01114002 00770201 - tlb[0x06]: 01118002 0076c201 01118005 0076c201 - ... - tlb[0x3d]: 010f4002 00790200 001f4002 0054ca02 - tlb[0x3e]: 010f8005 0078c201 010f8002 0078c201 - tlb[0x3f]: 001fc002 0056ca01 001fc005 00538a01 - - (*) __debug_mmu.iamr[] - (*) __debug_mmu.damr[] - - These receive the current IAMR and DAMR contents. These can be viewed with the _amr - GDB macro: - - (gdb) _amr - AMRx DAMR IAMR - ==== ===================== ===================== - amr0 : L:c0000000 P:00000cb9 : L:c0000000 P:000004b9 - amr1 : L:01070005 P:006f9203 : L:0102c005 P:006a1201 - amr2 : L:d8d00000 P:00000000 : L:d8d00000 P:00000000 - amr3 : L:d8d04000 P:00534c0d : L:00000000 P:00000000 - amr4 : L:d8d08000 P:00554c0d : L:00000000 P:00000000 - amr5 : L:d8d0c000 P:00554c0d : L:00000000 P:00000000 - amr6 : L:d8d10000 P:00000000 : L:00000000 P:00000000 - amr7 : L:d8d14000 P:00000000 : L:00000000 P:00000000 - amr8 : L:d8d18000 P:00000000 - amr9 : L:d8d1c000 P:00000000 - amr10: L:d8d20000 P:00000000 - amr11: L:e0000000 P:e0000ccd - - (*) The current task's page directory is bound to DAMR3. - - This can be viewed with the _pgd GDB macro: - - (gdb) _pgd - $3 = {{pge = {{ste = {0x554001, 0x554101, 0x554201, 0x554301, 0x554401, - 0x554501, 0x554601, 0x554701, 0x554801, 0x554901, 0x554a01, - 0x554b01, 0x554c01, 0x554d01, 0x554e01, 0x554f01, 0x555001, - 0x555101, 0x555201, 0x555301, 0x555401, 0x555501, 0x555601, - 0x555701, 0x555801, 0x555901, 0x555a01, 0x555b01, 0x555c01, - 0x555d01, 0x555e01, 0x555f01, 0x556001, 0x556101, 0x556201, - 0x556301, 0x556401, 0x556501, 0x556601, 0x556701, 0x556801, - 0x556901, 0x556a01, 0x556b01, 0x556c01, 0x556d01, 0x556e01, - 0x556f01, 0x557001, 0x557101, 0x557201, 0x557301, 0x557401, - 0x557501, 0x557601, 0x557701, 0x557801, 0x557901, 0x557a01, - 0x557b01, 0x557c01, 0x557d01, 0x557e01, 0x557f01}}}}, {pge = {{ - ste = {0x0 }}}} , {pge = {{ste = { - 0x248001, 0x248101, 0x248201, 0x248301, 0x248401, 0x248501, - 0x248601, 0x248701, 0x248801, 0x248901, 0x248a01, 0x248b01, - 0x248c01, 0x248d01, 0x248e01, 0x248f01, 0x249001, 0x249101, - 0x249201, 0x249301, 0x249401, 0x249501, 0x249601, 0x249701, - 0x249801, 0x249901, 0x249a01, 0x249b01, 0x249c01, 0x249d01, - 0x249e01, 0x249f01, 0x24a001, 0x24a101, 0x24a201, 0x24a301, - 0x24a401, 0x24a501, 0x24a601, 0x24a701, 0x24a801, 0x24a901, - 0x24aa01, 0x24ab01, 0x24ac01, 0x24ad01, 0x24ae01, 0x24af01, - 0x24b001, 0x24b101, 0x24b201, 0x24b301, 0x24b401, 0x24b501, - 0x24b601, 0x24b701, 0x24b801, 0x24b901, 0x24ba01, 0x24bb01, - 0x24bc01, 0x24bd01, 0x24be01, 0x24bf01}}}}, {pge = {{ste = { - 0x0 }}}} } - - (*) The PTD last used by the instruction TLB miss handler is attached to DAMR4. - (*) The PTD last used by the data TLB miss handler is attached to DAMR5. - - These can be viewed with the _ptd_i and _ptd_d GDB macros: - - (gdb) _ptd_d - $5 = {{pte = 0x0} , {pte = 0x539b01}, { - pte = 0x0} , {pte = 0x719303}, {pte = 0x6d5303}, { - pte = 0x0}, {pte = 0x0}, {pte = 0x0}, {pte = 0x0}, {pte = 0x0}, { - pte = 0x0}, {pte = 0x0}, {pte = 0x0}, {pte = 0x0}, {pte = 0x6a1303}, { - pte = 0x0} , {pte = 0x709303}, {pte = 0x0}, {pte = 0x0}, - {pte = 0x6fd303}, {pte = 0x6f9303}, {pte = 0x6f5303}, {pte = 0x0}, { - pte = 0x6ed303}, {pte = 0x531b01}, {pte = 0x50db01}, { - pte = 0x0} , {pte = 0x5303}, {pte = 0x7f5303}, { - pte = 0x509b01}, {pte = 0x505b01}, {pte = 0x7c9303}, {pte = 0x7b9303}, { - pte = 0x7b5303}, {pte = 0x7b1303}, {pte = 0x7ad303}, {pte = 0x0}, { - pte = 0x0}, {pte = 0x7a1303}, {pte = 0x0}, {pte = 0x795303}, {pte = 0x0}, { - pte = 0x78d303}, {pte = 0x0}, {pte = 0x0}, {pte = 0x0}, {pte = 0x0}, { - pte = 0x0}, {pte = 0x775303}, {pte = 0x771303}, {pte = 0x76d303}, { - pte = 0x0}, {pte = 0x765303}, {pte = 0x7c5303}, {pte = 0x501b01}, { - pte = 0x4f1b01}, {pte = 0x4edb01}, {pte = 0x0}, {pte = 0x4f9b01}, { - pte = 0x4fdb01}, {pte = 0x0} } diff --git a/MAINTAINERS b/MAINTAINERS index 69123be5bb64..3655d284af20 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5799,10 +5799,6 @@ F: fs/crypto/ F: include/linux/fscrypt*.h F: Documentation/filesystems/fscrypt.rst -FUJITSU FR-V (FRV) PORT -S: Orphan -F: arch/frv/ - FUJITSU LAPTOP EXTRAS M: Jonathan Woithe L: platform-driver-x86@vger.kernel.org diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig deleted file mode 100644 index af369b05fed5..000000000000 --- a/arch/frv/Kconfig +++ /dev/null @@ -1,386 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -config FRV - bool - default y - select HAVE_IDE - select HAVE_ARCH_TRACEHOOK - select HAVE_PERF_EVENTS - select HAVE_UID16 - select VIRT_TO_BUS - select GENERIC_IRQ_SHOW - select HAVE_DEBUG_BUGVERBOSE - select ARCH_HAVE_NMI_SAFE_CMPXCHG - select GENERIC_CPU_DEVICES - select ARCH_HAS_DEVMEM_IS_ALLOWED - select ARCH_WANT_IPC_PARSE_VERSION - select OLD_SIGSUSPEND3 - select OLD_SIGACTION - select HAVE_DEBUG_STACKOVERFLOW - select ARCH_NO_COHERENT_DMA_MMAP - -config CPU_BIG_ENDIAN - def_bool y - -config ZONE_DMA - bool - default y - -config RWSEM_GENERIC_SPINLOCK - bool - default y - -config RWSEM_XCHGADD_ALGORITHM - bool - -config GENERIC_HWEIGHT - bool - default y - -config GENERIC_CALIBRATE_DELAY - bool - default n - -config TIME_LOW_RES - bool - default y - -config QUICKLIST - bool - default y - -config ARCH_HAS_ILOG2_U32 - bool - default y - -config ARCH_HAS_ILOG2_U64 - bool - default y - -config HZ - int - default 1000 - -source "init/Kconfig" - -source "kernel/Kconfig.freezer" - - -menu "Fujitsu FR-V system setup" - -config MMU - bool "MMU support" - help - This options switches on and off support for the FR-V MMU - (effectively switching between vmlinux and uClinux). Not all FR-V - CPUs support this. Currently only the FR451 has a sufficiently - featured MMU. - -config FRV_OUTOFLINE_ATOMIC_OPS - bool "Out-of-line the FRV atomic operations" - default n - help - Setting this option causes the FR-V atomic operations to be mostly - implemented out-of-line. - - See Documentation/frv/atomic-ops.txt for more information. - -config HIGHMEM - bool "High memory support" - depends on MMU - default y - help - If you wish to use more than 256MB of memory with your MMU based - system, you will need to select this option. The kernel can only see - the memory between 0xC0000000 and 0xD0000000 directly... everything - else must be kmapped. - - The arch is, however, capable of supporting up to 3GB of SDRAM. - -config HIGHPTE - bool "Allocate page tables in highmem" - depends on HIGHMEM - default y - help - The VM uses one page of memory for each page table. For systems - with a lot of RAM, this can be wasteful of precious low memory. - Setting this option will put user-space page tables in high memory. - -source "mm/Kconfig" - -choice - prompt "uClinux kernel load address" - depends on !MMU - default UCPAGE_OFFSET_C0000000 - help - This option sets the base address for the uClinux kernel. The kernel - will rearrange the SDRAM layout to start at this address, and move - itself to start there. It must be greater than 0, and it must be - sufficiently less than 0xE0000000 that the SDRAM does not intersect - the I/O region. - - The base address must also be aligned such that the SDRAM controller - can decode it. For instance, a 512MB SDRAM bank must be 512MB aligned. - -config UCPAGE_OFFSET_20000000 - bool "0x20000000" - -config UCPAGE_OFFSET_40000000 - bool "0x40000000" - -config UCPAGE_OFFSET_60000000 - bool "0x60000000" - -config UCPAGE_OFFSET_80000000 - bool "0x80000000" - -config UCPAGE_OFFSET_A0000000 - bool "0xA0000000" - -config UCPAGE_OFFSET_C0000000 - bool "0xC0000000 (Recommended)" - -endchoice - -config PAGE_OFFSET - hex - default 0x20000000 if UCPAGE_OFFSET_20000000 - default 0x40000000 if UCPAGE_OFFSET_40000000 - default 0x60000000 if UCPAGE_OFFSET_60000000 - default 0x80000000 if UCPAGE_OFFSET_80000000 - default 0xA0000000 if UCPAGE_OFFSET_A0000000 - default 0xC0000000 - -config PROTECT_KERNEL - bool "Protect core kernel against userspace" - depends on !MMU - default y - help - Selecting this option causes the uClinux kernel to change the - permittivity of DAMPR register covering the core kernel image to - prevent userspace accessing the underlying memory directly. - -choice - prompt "CPU Caching mode" - default FRV_DEFL_CACHE_WBACK - help - This option determines the default caching mode for the kernel. - - Write-Back caching mode involves the all reads and writes causing - the affected cacheline to be read into the cache first before being - operated upon. Memory is not then updated by a write until the cache - is filled and a cacheline needs to be displaced from the cache to - make room. Only at that point is it written back. - - Write-Behind caching is similar to Write-Back caching, except that a - write won't fetch a cacheline into the cache if there isn't already - one there; it will write directly to memory instead. - - Write-Through caching only fetches cachelines from memory on a - read. Writes always get written directly to memory. If the affected - cacheline is also in cache, it will be updated too. - - The final option is to turn of caching entirely. - - Note that not all CPUs support Write-Behind caching. If the CPU on - which the kernel is running doesn't, it'll fall back to Write-Back - caching. - -config FRV_DEFL_CACHE_WBACK - bool "Write-Back" - -config FRV_DEFL_CACHE_WBEHIND - bool "Write-Behind" - -config FRV_DEFL_CACHE_WTHRU - bool "Write-Through" - -config FRV_DEFL_CACHE_DISABLED - bool "Disabled" - -endchoice - -menu "CPU core support" - -config CPU_FR401 - bool "Include FR401 core support" - depends on !MMU - default y - help - This enables support for the FR401, FR401A and FR403 CPUs - -config CPU_FR405 - bool "Include FR405 core support" - depends on !MMU - default y - help - This enables support for the FR405 CPU - -config CPU_FR451 - bool "Include FR451 core support" - default y - help - This enables support for the FR451 CPU - -config CPU_FR451_COMPILE - bool "Specifically compile for FR451 core" - depends on CPU_FR451 && !CPU_FR401 && !CPU_FR405 && !CPU_FR551 - default y - help - This causes appropriate flags to be passed to the compiler to - optimise for the FR451 CPU - -config CPU_FR551 - bool "Include FR551 core support" - depends on !MMU - default y - help - This enables support for the FR555 CPU - -config CPU_FR551_COMPILE - bool "Specifically compile for FR551 core" - depends on CPU_FR551 && !CPU_FR401 && !CPU_FR405 && !CPU_FR451 - default y - help - This causes appropriate flags to be passed to the compiler to - optimise for the FR555 CPU - -config FRV_L1_CACHE_SHIFT - int - default "5" if CPU_FR401 || CPU_FR405 || CPU_FR451 - default "6" if CPU_FR551 - -endmenu - -choice - prompt "System support" - default MB93091_VDK - -config MB93091_VDK - bool "MB93091 CPU board with or without motherboard" - -config MB93093_PDK - bool "MB93093 PDK unit" - -endchoice - -if MB93091_VDK -choice - prompt "Motherboard support" - default MB93090_MB00 - -config MB93090_MB00 - bool "Use the MB93090-MB00 motherboard" - help - Select this option if the MB93091 CPU board is going to be used with - a MB93090-MB00 VDK motherboard - -config MB93091_NO_MB - bool "Use standalone" - help - Select this option if the MB93091 CPU board is going to be used - without a motherboard - -endchoice -endif - -config FUJITSU_MB93493 - bool "MB93493 Multimedia chip" - help - Select this option if the MB93493 multimedia chip is going to be - used. - -choice - prompt "GP-Relative data support" - default GPREL_DATA_8 - help - This option controls what data, if any, should be placed in the GP - relative data sections. Using this means that the compiler can - generate accesses to the data using GR16-relative addressing which - is faster than absolute instructions and saves space (2 instructions - per access). - - However, the GPREL region is limited in size because the immediate - value used in the load and store instructions is limited to a 12-bit - signed number. - - So if the linker starts complaining that accesses to GPREL data are - out of range, try changing this option from the default. - - Note that modules will always be compiled with this feature disabled - as the module data will not be in range of the GP base address. - -config GPREL_DATA_8 - bool "Put data objects of up to 8 bytes into GP-REL" - -config GPREL_DATA_4 - bool "Put data objects of up to 4 bytes into GP-REL" - -config GPREL_DATA_NONE - bool "Don't use GP-REL" - -endchoice - -config FRV_ONCPU_SERIAL - bool "Use on-CPU serial ports" - select SERIAL_8250 - default y - -config PCI - bool "Use PCI" - depends on MB93090_MB00 - default y - select GENERIC_PCI_IOMAP - help - Some FR-V systems (such as the MB93090-MB00 VDK) have PCI - onboard. If you have one of these boards and you wish to use the PCI - facilities, say Y here. - -config RESERVE_DMA_COHERENT - bool "Reserve DMA coherent memory" - depends on PCI && !MMU - default y - help - Many PCI drivers require access to uncached memory for DMA device - communications (such as is done with some Ethernet buffer rings). If - a fully featured MMU is available, this can be done through page - table settings, but if not, a region has to be set aside and marked - with a special DAMPR register. - - Setting this option causes uClinux to set aside a portion of the - available memory for use in this manner. The memory will then be - unavailable for normal kernel use. - -source "drivers/pci/Kconfig" - -source "drivers/pcmcia/Kconfig" - -menu "Power management options" - -config ARCH_SUSPEND_POSSIBLE - def_bool y - -source kernel/power/Kconfig -endmenu - -endmenu - - -menu "Executable formats" - -source "fs/Kconfig.binfmt" - -endmenu - -source "net/Kconfig" - -source "drivers/Kconfig" - -source "fs/Kconfig" - -source "arch/frv/Kconfig.debug" - -source "security/Kconfig" - -source "crypto/Kconfig" - -source "lib/Kconfig" diff --git a/arch/frv/Kconfig.debug b/arch/frv/Kconfig.debug deleted file mode 100644 index ecab6d8a79ed..000000000000 --- a/arch/frv/Kconfig.debug +++ /dev/null @@ -1,49 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -menu "Kernel hacking" - -source "lib/Kconfig.debug" - -config GDBSTUB - bool "Remote GDB kernel debugging" - depends on DEBUG_KERNEL - select DEBUG_INFO - select FRAME_POINTER - help - If you say Y here, it will be possible to remotely debug the kernel - using gdb. This enlarges your kernel ELF image disk size by several - megabytes and requires a machine with more than 16 MB, better 32 MB - RAM to avoid excessive linking time. This is only useful for kernel - hackers. If unsure, say N. - -choice - prompt "GDB stub port" - default GDBSTUB_UART1 - depends on GDBSTUB - help - Select the on-CPU port used for GDB-stub - -config GDBSTUB_UART0 - bool "/dev/ttyS0" - -config GDBSTUB_UART1 - bool "/dev/ttyS1" - -endchoice - -config GDBSTUB_IMMEDIATE - bool "Break into GDB stub immediately" - depends on GDBSTUB - help - If you say Y here, GDB stub will break into the program as soon as - possible, leaving the program counter at the beginning of - start_kernel() in init/main.c. - -config GDB_CONSOLE - bool "Console output to GDB" - depends on GDBSTUB - help - If you are using GDB for remote debugging over a serial port and - would like kernel messages to be formatted into GDB $O packets so - that GDB prints them as program output, say 'Y'. - -endmenu diff --git a/arch/frv/Makefile b/arch/frv/Makefile deleted file mode 100644 index 2a8fb730d1ca..000000000000 --- a/arch/frv/Makefile +++ /dev/null @@ -1,90 +0,0 @@ -# -# frv/Makefile -# -# This file is included by the global makefile so that you can add your own -# architecture-specific flags and dependencies. Remember to do have actions -# for "archclean" and "archdep" for cleaning up and making dependencies for -# this architecture -# -# 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) 2003, 2004 Red Hat Inc. -# - Written by David Howells -# - Derived from arch/m68knommu/Makefile, -# Copyright (c) 1999,2001 D. Jeff Dionne , -# Rt-Control Inc. / Lineo, Inc. -# -# Copyright (C) 1998,1999 D. Jeff Dionne , -# Kenneth Albanowski , -# -# Based on arch/m68k/Makefile: -# Copyright (C) 1994 by Hamish Macdonald -# - -ifdef CONFIG_MMU -UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\" -else -UTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\" -endif - -KBUILD_AFLAGS_MODULE += -G0 -mlong-calls -KBUILD_CFLAGS_MODULE += -G0 -mlong-calls - -ifdef CONFIG_GPREL_DATA_8 -KBUILD_CFLAGS += -G8 -else -ifdef CONFIG_GPREL_DATA_4 -KBUILD_CFLAGS += -G4 -else -ifdef CONFIG_GPREL_DATA_NONE -KBUILD_CFLAGS += -G0 -endif -endif -endif - -#LDFLAGS_vmlinux := -Map linkmap.txt - -ifdef CONFIG_GC_SECTIONS -KBUILD_CFLAGS += -ffunction-sections -fdata-sections -endif - -ifndef CONFIG_FRAME_POINTER -KBUILD_CFLAGS += -mno-linked-fp -endif - -ifdef CONFIG_CPU_FR451_COMPILE -KBUILD_CFLAGS += -mcpu=fr450 -KBUILD_AFLAGS += -mcpu=fr450 -else -ifdef CONFIG_CPU_FR551_COMPILE -KBUILD_CFLAGS += -mcpu=fr550 -KBUILD_AFLAGS += -mcpu=fr550 -else -KBUILD_CFLAGS += -mcpu=fr400 -KBUILD_AFLAGS += -mcpu=fr400 -endif -endif - -# pretend the kernel is going to run on an FR400 with no media-fp unit -# - reserve CC3 for use with atomic ops -# - all the extra registers are dealt with only at context switch time -KBUILD_CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media -KBUILD_CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2 -KBUILD_AFLAGS += -mno-fdpic - -head-y := arch/frv/kernel/head.o - -core-y += arch/frv/kernel/ arch/frv/mm/ -libs-y += arch/frv/lib/ - -core-$(CONFIG_MB93090_MB00) += arch/frv/mb93090-mb00/ - -all: Image - -Image: vmlinux - $(Q)$(MAKE) $(build)=arch/frv/boot $@ - -archclean: - $(Q)$(MAKE) $(clean)=arch/frv/boot diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile deleted file mode 100644 index 636d5bbcd53f..000000000000 --- a/arch/frv/boot/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -# -# arch/arm/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) 1995-2000 Russell King -# - -targets := Image zImage bootpImage - -SYSTEM =$(LINUX) - -ZTEXTADDR = 0x02080000 -PARAMS_PHYS = 0x0207c000 -INITRD_PHYS = 0x02180000 -INITRD_VIRT = 0x02180000 - -OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment - -# -# If you don't define ZRELADDR above, -# then it defaults to ZTEXTADDR -# -ifeq ($(ZRELADDR),) -ZRELADDR = $(ZTEXTADDR) -endif - -export SYSTEM ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS INITRD_VIRT PARAMS_PHYS - -Image: $(obj)/Image - -targets: $(obj)/Image - -$(obj)/Image: vmlinux FORCE - $(OBJCOPY) $(OBJCOPYFLAGS) -S vmlinux $@ - -#$(obj)/Image: $(CONFIGURE) $(SYSTEM) -# $(OBJCOPY) $(OBJCOPYFLAGS) -g -S $(SYSTEM) $@ - -bzImage: zImage - -zImage: $(CONFIGURE) compressed/$(LINUX) - $(OBJCOPY) $(OBJCOPYFLAGS) -S compressed/$(LINUX) $@ - -bootpImage: bootp/bootp - $(OBJCOPY) $(OBJCOPYFLAGS) -S bootp/bootp $@ - -compressed/$(LINUX): $(LINUX) dep - @$(MAKE) -C compressed $(LINUX) - -bootp/bootp: zImage initrd - @$(MAKE) -C bootp bootp - -initrd: - @test "$(INITRD_VIRT)" != "" || (echo This architecture does not support INITRD; exit -1) - @test "$(INITRD)" != "" || (echo You must specify INITRD; exit -1) - -# -# installation -# -install: $(CONFIGURE) Image - sh ./install.sh $(KERNELRELEASE) Image System.map "$(INSTALL_PATH)" - -zinstall: $(CONFIGURE) zImage - sh ./install.sh $(KERNELRELEASE) zImage System.map "$(INSTALL_PATH)" - -# -# miscellany -# -mrproper clean: -# @$(MAKE) -C compressed clean -# @$(MAKE) -C bootp clean - -dep: diff --git a/arch/frv/defconfig b/arch/frv/defconfig deleted file mode 100644 index b1b792610fdf..000000000000 --- a/arch/frv/defconfig +++ /dev/null @@ -1,39 +0,0 @@ -CONFIG_EXPERIMENTAL=y -CONFIG_SYSVIPC=y -CONFIG_POSIX_MQUEUE=y -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_HOTPLUG is not set -CONFIG_MMU=y -CONFIG_FRV_OUTOFLINE_ATOMIC_OPS=y -CONFIG_FRV_DEFL_CACHE_WTHRU=y -CONFIG_GPREL_DATA_4=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -# CONFIG_IPV6 is not set -# CONFIG_STANDALONE is not set -# CONFIG_PREVENT_FIRMWARE_BUILD is not set -CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y -CONFIG_MII=y -CONFIG_NET_PCI=y -CONFIG_NE2K_PCI=y -# CONFIG_INPUT is not set -# CONFIG_SERIO is not set -# CONFIG_VT is not set -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_NR_UARTS=1 -CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -CONFIG_SERIAL_8250_EXTENDED=y -CONFIG_SERIAL_8250_SHARE_IRQ=y -# CONFIG_LEGACY_PTYS is not set -CONFIG_TMPFS=y -CONFIG_NFS_FS=y -CONFIG_ROOT_NFS=y -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_BUGVERBOSE is not set -CONFIG_DEBUG_STACKOVERFLOW=y diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild deleted file mode 100644 index b16b9c48ea09..000000000000 --- a/arch/frv/include/asm/Kbuild +++ /dev/null @@ -1,12 +0,0 @@ - -generic-y += device.h -generic-y += exec.h -generic-y += extable.h -generic-y += fb.h -generic-y += irq_work.h -generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h -generic-y += preempt.h -generic-y += trace_clock.h -generic-y += word-at-a-time.h -generic-y += kprobes.h diff --git a/arch/frv/include/asm/asm-offsets.h b/arch/frv/include/asm/asm-offsets.h deleted file mode 100644 index d370ee36a182..000000000000 --- a/arch/frv/include/asm/asm-offsets.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h deleted file mode 100644 index e93c9494503a..000000000000 --- a/arch/frv/include/asm/atomic.h +++ /dev/null @@ -1,224 +0,0 @@ -/* atomic.h: atomic operation emulation for FR-V - * - * For an explanation of how atomic ops work in this arch, see: - * Documentation/frv/atomic-ops.txt - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_ATOMIC_H -#define _ASM_ATOMIC_H - -#include -#include -#include - -#ifdef CONFIG_SMP -#error not SMP safe -#endif - -#include - -/* - * Atomic operations that C can't guarantee us. Useful for - * resource counting etc.. - * - * We do not have SMP systems, so we don't have to deal with that. - */ - -#define ATOMIC_INIT(i) { (i) } -#define atomic_read(v) READ_ONCE((v)->counter) -#define atomic_set(v, i) WRITE_ONCE(((v)->counter), (i)) - -static inline int atomic_inc_return(atomic_t *v) -{ - return __atomic_add_return(1, &v->counter); -} - -static inline int atomic_dec_return(atomic_t *v) -{ - return __atomic_sub_return(1, &v->counter); -} - -static inline int atomic_add_return(int i, atomic_t *v) -{ - return __atomic_add_return(i, &v->counter); -} - -static inline int atomic_sub_return(int i, atomic_t *v) -{ - return __atomic_sub_return(i, &v->counter); -} - -static inline int atomic_add_negative(int i, atomic_t *v) -{ - return atomic_add_return(i, v) < 0; -} - -static inline void atomic_inc(atomic_t *v) -{ - atomic_inc_return(v); -} - -static inline void atomic_dec(atomic_t *v) -{ - atomic_dec_return(v); -} - -#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) -#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) -#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) - -/* - * 64-bit atomic ops - */ -typedef struct { - long long counter; -} atomic64_t; - -#define ATOMIC64_INIT(i) { (i) } - -static inline long long atomic64_read(const atomic64_t *v) -{ - long long counter; - - asm("ldd%I1 %M1,%0" - : "=e"(counter) - : "m"(v->counter)); - - return counter; -} - -static inline void atomic64_set(atomic64_t *v, long long i) -{ - asm volatile("std%I0 %1,%M0" - : "=m"(v->counter) - : "e"(i)); -} - -static inline long long atomic64_inc_return(atomic64_t *v) -{ - return __atomic64_add_return(1, &v->counter); -} - -static inline long long atomic64_dec_return(atomic64_t *v) -{ - return __atomic64_sub_return(1, &v->counter); -} - -static inline long long atomic64_add_return(long long i, atomic64_t *v) -{ - return __atomic64_add_return(i, &v->counter); -} - -static inline long long atomic64_sub_return(long long i, atomic64_t *v) -{ - return __atomic64_sub_return(i, &v->counter); -} - -static inline long long atomic64_add_negative(long long i, atomic64_t *v) -{ - return atomic64_add_return(i, v) < 0; -} - -static inline void atomic64_inc(atomic64_t *v) -{ - atomic64_inc_return(v); -} - -static inline void atomic64_dec(atomic64_t *v) -{ - atomic64_dec_return(v); -} - -#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0) -#define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0) -#define atomic64_inc_and_test(v) (atomic64_inc_return((v)) == 0) -#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) - -#define atomic_cmpxchg(v, old, new) (cmpxchg(&(v)->counter, old, new)) -#define atomic_xchg(v, new) (xchg(&(v)->counter, new)) -#define atomic64_cmpxchg(v, old, new) (__cmpxchg_64(old, new, &(v)->counter)) -#define atomic64_xchg(v, new) (__xchg_64(new, &(v)->counter)) - -static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) -{ - int c, old; - c = atomic_read(v); - for (;;) { - if (unlikely(c == (u))) - break; - old = atomic_cmpxchg((v), c, c + (a)); - if (likely(old == c)) - break; - c = old; - } - return c; -} - -static inline int atomic64_add_unless(atomic64_t *v, long long i, long long u) -{ - long long c, old; - - c = atomic64_read(v); - for (;;) { - if (unlikely(c == u)) - break; - old = atomic64_cmpxchg(v, c, c + i); - if (likely(old == c)) - break; - c = old; - } - return c != u; -} - -static inline long long atomic64_dec_if_positive(atomic64_t *v) -{ - long long c, old, dec; - - c = atomic64_read(v); - for (;;) { - dec = c - 1; - if (unlikely(dec < 0)) - break; - old = atomic64_cmpxchg((v), c, dec); - if (likely(old == c)) - break; - c = old; - } - return dec; -} - -#define ATOMIC_OP(op) \ -static inline int atomic_fetch_##op(int i, atomic_t *v) \ -{ \ - return __atomic32_fetch_##op(i, &v->counter); \ -} \ -static inline void atomic_##op(int i, atomic_t *v) \ -{ \ - (void)__atomic32_fetch_##op(i, &v->counter); \ -} \ - \ -static inline long long atomic64_fetch_##op(long long i, atomic64_t *v) \ -{ \ - return __atomic64_fetch_##op(i, &v->counter); \ -} \ -static inline void atomic64_##op(long long i, atomic64_t *v) \ -{ \ - (void)__atomic64_fetch_##op(i, &v->counter); \ -} - -ATOMIC_OP(or) -ATOMIC_OP(and) -ATOMIC_OP(xor) -ATOMIC_OP(add) -ATOMIC_OP(sub) - -#undef ATOMIC_OP - -#endif /* _ASM_ATOMIC_H */ diff --git a/arch/frv/include/asm/atomic_defs.h b/arch/frv/include/asm/atomic_defs.h deleted file mode 100644 index ce3b8a4efc12..000000000000 --- a/arch/frv/include/asm/atomic_defs.h +++ /dev/null @@ -1,175 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#include - -#ifdef __ATOMIC_LIB__ - -#ifdef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS - -#define ATOMIC_QUALS -#define ATOMIC_EXPORT(x) EXPORT_SYMBOL(x) - -#else /* !OUTOFLINE && LIB */ - -#define ATOMIC_OP_RETURN(op) -#define ATOMIC_FETCH_OP(op) - -#endif /* OUTOFLINE */ - -#else /* !__ATOMIC_LIB__ */ - -#define ATOMIC_EXPORT(x) - -#ifdef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS - -#define ATOMIC_OP_RETURN(op) \ -extern int __atomic_##op##_return(int i, int *v); \ -extern long long __atomic64_##op##_return(long long i, long long *v); - -#define ATOMIC_FETCH_OP(op) \ -extern int __atomic32_fetch_##op(int i, int *v); \ -extern long long __atomic64_fetch_##op(long long i, long long *v); - -#else /* !OUTOFLINE && !LIB */ - -#define ATOMIC_QUALS static inline - -#endif /* OUTOFLINE */ -#endif /* __ATOMIC_LIB__ */ - - -/* - * Note on the 64 bit inline asm variants... - * - * CSTD is a conditional instruction and needs a constrained memory reference. - * Normally 'U' provides the correct constraints for conditional instructions - * and this is used for the 32 bit version, however 'U' does not appear to work - * for 64 bit values (gcc-4.9) - * - * The exact constraint is that conditional instructions cannot deal with an - * immediate displacement in the memory reference, so what we do is we read the - * address through a volatile cast into a local variable in order to insure we - * _have_ to compute the correct address without displacement. This allows us - * to use the regular 'm' for the memory address. - * - * Furthermore, the %Ln operand, which prints the low word register (r+1), - * really only works for registers, this means we cannot allow immediate values - * for the 64 bit versions -- like we do for the 32 bit ones. - * - */ - -#ifndef ATOMIC_OP_RETURN -#define ATOMIC_OP_RETURN(op) \ -ATOMIC_QUALS int __atomic_##op##_return(int i, int *v) \ -{ \ - int val; \ - \ - asm volatile( \ - "0: \n" \ - " orcc gr0,gr0,gr0,icc3 \n" \ - " ckeq icc3,cc7 \n" \ - " ld.p %M0,%1 \n" \ - " orcr cc7,cc7,cc3 \n" \ - " "#op"%I2 %1,%2,%1 \n" \ - " cst.p %1,%M0 ,cc3,#1 \n" \ - " corcc gr29,gr29,gr0 ,cc3,#1 \n" \ - " beq icc3,#0,0b \n" \ - : "+U"(*v), "=&r"(val) \ - : "NPr"(i) \ - : "memory", "cc7", "cc3", "icc3" \ - ); \ - \ - return val; \ -} \ -ATOMIC_EXPORT(__atomic_##op##_return); \ - \ -ATOMIC_QUALS long long __atomic64_##op##_return(long long i, long long *v) \ -{ \ - long long *__v = READ_ONCE(v); \ - long long val; \ - \ - asm volatile( \ - "0: \n" \ - " orcc gr0,gr0,gr0,icc3 \n" \ - " ckeq icc3,cc7 \n" \ - " ldd.p %M0,%1 \n" \ - " orcr cc7,cc7,cc3 \n" \ - " "#op"cc %L1,%L2,%L1,icc0 \n" \ - " "#op"x %1,%2,%1,icc0 \n" \ - " cstd.p %1,%M0 ,cc3,#1 \n" \ - " corcc gr29,gr29,gr0 ,cc3,#1 \n" \ - " beq icc3,#0,0b \n" \ - : "+m"(*__v), "=&e"(val) \ - : "e"(i) \ - : "memory", "cc7", "cc3", "icc0", "icc3" \ - ); \ - \ - return val; \ -} \ -ATOMIC_EXPORT(__atomic64_##op##_return); -#endif - -#ifndef ATOMIC_FETCH_OP -#define ATOMIC_FETCH_OP(op) \ -ATOMIC_QUALS int __atomic32_fetch_##op(int i, int *v) \ -{ \ - int old, tmp; \ - \ - asm volatile( \ - "0: \n" \ - " orcc gr0,gr0,gr0,icc3 \n" \ - " ckeq icc3,cc7 \n" \ - " ld.p %M0,%1 \n" \ - " orcr cc7,cc7,cc3 \n" \ - " "#op"%I3 %1,%3,%2 \n" \ - " cst.p %2,%M0 ,cc3,#1 \n" \ - " corcc gr29,gr29,gr0 ,cc3,#1 \n" \ - " beq icc3,#0,0b \n" \ - : "+U"(*v), "=&r"(old), "=r"(tmp) \ - : "NPr"(i) \ - : "memory", "cc7", "cc3", "icc3" \ - ); \ - \ - return old; \ -} \ -ATOMIC_EXPORT(__atomic32_fetch_##op); \ - \ -ATOMIC_QUALS long long __atomic64_fetch_##op(long long i, long long *v) \ -{ \ - long long *__v = READ_ONCE(v); \ - long long old, tmp; \ - \ - asm volatile( \ - "0: \n" \ - " orcc gr0,gr0,gr0,icc3 \n" \ - " ckeq icc3,cc7 \n" \ - " ldd.p %M0,%1 \n" \ - " orcr cc7,cc7,cc3 \n" \ - " "#op" %L1,%L3,%L2 \n" \ - " "#op" %1,%3,%2 \n" \ - " cstd.p %2,%M0 ,cc3,#1 \n" \ - " corcc gr29,gr29,gr0 ,cc3,#1 \n" \ - " beq icc3,#0,0b \n" \ - : "+m"(*__v), "=&e"(old), "=e"(tmp) \ - : "e"(i) \ - : "memory", "cc7", "cc3", "icc3" \ - ); \ - \ - return old; \ -} \ -ATOMIC_EXPORT(__atomic64_fetch_##op); -#endif - -ATOMIC_FETCH_OP(or) -ATOMIC_FETCH_OP(and) -ATOMIC_FETCH_OP(xor) -ATOMIC_FETCH_OP(add) -ATOMIC_FETCH_OP(sub) - -ATOMIC_OP_RETURN(add) -ATOMIC_OP_RETURN(sub) - -#undef ATOMIC_FETCH_OP -#undef ATOMIC_OP_RETURN -#undef ATOMIC_QUALS -#undef ATOMIC_EXPORT diff --git a/arch/frv/include/asm/ax88796.h b/arch/frv/include/asm/ax88796.h deleted file mode 100644 index 637e980393c5..000000000000 --- a/arch/frv/include/asm/ax88796.h +++ /dev/null @@ -1,22 +0,0 @@ -/* ax88796.h: access points to the driver for the AX88796 NE2000 clone - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_AX88796_H -#define _ASM_AX88796_H - -#include - -#define AX88796_IOADDR (__region_CS1 + 0x200) -#define AX88796_IRQ IRQ_CPU_EXTERNAL7 -#define AX88796_FULL_DUPLEX 0 /* force full duplex */ -#define AX88796_BUS_INFO "CS1#+0x200" /* bus info for ethtool */ - -#endif /* _ASM_AX88796_H */ diff --git a/arch/frv/include/asm/barrier.h b/arch/frv/include/asm/barrier.h deleted file mode 100644 index abbef470154c..000000000000 --- a/arch/frv/include/asm/barrier.h +++ /dev/null @@ -1,23 +0,0 @@ -/* FR-V CPU memory barrier definitions - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_BARRIER_H -#define _ASM_BARRIER_H - -#define nop() asm volatile ("nop"::) - -#define mb() asm volatile ("membar" : : :"memory") -#define rmb() asm volatile ("membar" : : :"memory") -#define wmb() asm volatile ("membar" : : :"memory") - -#include - -#endif /* _ASM_BARRIER_H */ diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h deleted file mode 100644 index 0df8e95e3715..000000000000 --- a/arch/frv/include/asm/bitops.h +++ /dev/null @@ -1,325 +0,0 @@ -/* bitops.h: bit operations for the Fujitsu FR-V CPUs - * - * For an explanation of how atomic ops work in this arch, see: - * Documentation/frv/atomic-ops.txt - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_BITOPS_H -#define _ASM_BITOPS_H - -#include -#include - -#ifdef __KERNEL__ - -#ifndef _LINUX_BITOPS_H -#error only can be included directly -#endif - -#include - -#include - -static inline int test_and_clear_bit(unsigned long nr, volatile void *addr) -{ - unsigned int *ptr = (void *)addr; - unsigned int mask = 1UL << (nr & 31); - ptr += nr >> 5; - return (__atomic32_fetch_and(~mask, ptr) & mask) != 0; -} - -static inline int test_and_set_bit(unsigned long nr, volatile void *addr) -{ - unsigned int *ptr = (void *)addr; - unsigned int mask = 1UL << (nr & 31); - ptr += nr >> 5; - return (__atomic32_fetch_or(mask, ptr) & mask) != 0; -} - -static inline int test_and_change_bit(unsigned long nr, volatile void *addr) -{ - unsigned int *ptr = (void *)addr; - unsigned int mask = 1UL << (nr & 31); - ptr += nr >> 5; - return (__atomic32_fetch_xor(mask, ptr) & mask) != 0; -} - -static inline void clear_bit(unsigned long nr, volatile void *addr) -{ - test_and_clear_bit(nr, addr); -} - -static inline void set_bit(unsigned long nr, volatile void *addr) -{ - test_and_set_bit(nr, addr); -} - -static inline void change_bit(unsigned long nr, volatile void *addr) -{ - test_and_change_bit(nr, addr); -} - -static inline void __clear_bit(unsigned long nr, volatile void *addr) -{ - volatile unsigned long *a = addr; - int mask; - - a += nr >> 5; - mask = 1 << (nr & 31); - *a &= ~mask; -} - -static inline void __set_bit(unsigned long nr, volatile void *addr) -{ - volatile unsigned long *a = addr; - int mask; - - a += nr >> 5; - mask = 1 << (nr & 31); - *a |= mask; -} - -static inline void __change_bit(unsigned long nr, volatile void *addr) -{ - volatile unsigned long *a = addr; - int mask; - - a += nr >> 5; - mask = 1 << (nr & 31); - *a ^= mask; -} - -static inline int __test_and_clear_bit(unsigned long nr, volatile void *addr) -{ - volatile unsigned long *a = addr; - int mask, retval; - - a += nr >> 5; - mask = 1 << (nr & 31); - retval = (mask & *a) != 0; - *a &= ~mask; - return retval; -} - -static inline int __test_and_set_bit(unsigned long nr, volatile void *addr) -{ - volatile unsigned long *a = addr; - int mask, retval; - - a += nr >> 5; - mask = 1 << (nr & 31); - retval = (mask & *a) != 0; - *a |= mask; - return retval; -} - -static inline int __test_and_change_bit(unsigned long nr, volatile void *addr) -{ - volatile unsigned long *a = addr; - int mask, retval; - - a += nr >> 5; - mask = 1 << (nr & 31); - retval = (mask & *a) != 0; - *a ^= mask; - return retval; -} - -/* - * This routine doesn't need to be atomic. - */ -static inline int -__constant_test_bit(unsigned long nr, const volatile void *addr) -{ - return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0; -} - -static inline int __test_bit(unsigned long nr, const volatile void *addr) -{ - int * a = (int *) addr; - int mask; - - a += nr >> 5; - mask = 1 << (nr & 0x1f); - return ((mask & *a) != 0); -} - -#define test_bit(nr,addr) \ -(__builtin_constant_p(nr) ? \ - __constant_test_bit((nr),(addr)) : \ - __test_bit((nr),(addr))) - -#include - -/** - * fls - find last bit set - * @x: the word to search - * - * This is defined the same way as ffs: - * - return 32..1 to indicate bit 31..0 most significant bit set - * - return 0 to indicate no bits set - */ -#define fls(x) \ -({ \ - int bit; \ - \ - asm(" subcc %1,gr0,gr0,icc0 \n" \ - " ckne icc0,cc4 \n" \ - " cscan.p %1,gr0,%0 ,cc4,#1 \n" \ - " csub %0,%0,%0 ,cc4,#0 \n" \ - " csub %2,%0,%0 ,cc4,#1 \n" \ - : "=&r"(bit) \ - : "r"(x), "r"(32) \ - : "icc0", "cc4" \ - ); \ - \ - bit; \ -}) - -/** - * fls64 - find last bit set in a 64-bit value - * @n: the value to search - * - * This is defined the same way as ffs: - * - return 64..1 to indicate bit 63..0 most significant bit set - * - return 0 to indicate no bits set - */ -static inline __attribute__((const)) -int fls64(u64 n) -{ - union { - u64 ll; - struct { u32 h, l; }; - } _; - int bit, x, y; - - _.ll = n; - - asm(" subcc.p %3,gr0,gr0,icc0 \n" - " subcc %4,gr0,gr0,icc1 \n" - " ckne icc0,cc4 \n" - " ckne icc1,cc5 \n" - " norcr cc4,cc5,cc6 \n" - " csub.p %0,%0,%0 ,cc6,1 \n" - " orcr cc5,cc4,cc4 \n" - " andcr cc4,cc5,cc4 \n" - " cscan.p %3,gr0,%0 ,cc4,0 \n" - " setlos #64,%1 \n" - " cscan.p %4,gr0,%0 ,cc4,1 \n" - " setlos #32,%2 \n" - " csub.p %1,%0,%0 ,cc4,0 \n" - " csub %2,%0,%0 ,cc4,1 \n" - : "=&r"(bit), "=r"(x), "=r"(y) - : "0r"(_.h), "r"(_.l) - : "icc0", "icc1", "cc4", "cc5", "cc6" - ); - return bit; - -} - -/** - * ffs - find first bit set - * @x: the word to search - * - * - return 32..1 to indicate bit 31..0 most least significant bit set - * - return 0 to indicate no bits set - */ -static inline __attribute__((const)) -int ffs(int x) -{ - /* Note: (x & -x) gives us a mask that is the least significant - * (rightmost) 1-bit of the value in x. - */ - return fls(x & -x); -} - -/** - * __ffs - find first bit set - * @x: the word to search - * - * - return 31..0 to indicate bit 31..0 most least significant bit set - * - if no bits are set in x, the result is undefined - */ -static inline __attribute__((const)) -int __ffs(unsigned long x) -{ - int bit; - asm("scan %1,gr0,%0" : "=r"(bit) : "r"(x & -x)); - return 31 - bit; -} - -/** - * __fls - find last (most-significant) set bit in a long word - * @word: the word to search - * - * Undefined if no set bit exists, so code should check against 0 first. - */ -static inline unsigned long __fls(unsigned long word) -{ - unsigned long bit; - asm("scan %1,gr0,%0" : "=r"(bit) : "r"(word)); - return bit; -} - -/* - * special slimline version of fls() for calculating ilog2_u32() - * - note: no protection against n == 0 - */ -#define ARCH_HAS_ILOG2_U32 -static inline __attribute__((const)) -int __ilog2_u32(u32 n) -{ - int bit; - asm("scan %1,gr0,%0" : "=r"(bit) : "r"(n)); - return 31 - bit; -} - -/* - * special slimline version of fls64() for calculating ilog2_u64() - * - note: no protection against n == 0 - */ -#define ARCH_HAS_ILOG2_U64 -static inline __attribute__((const)) -int __ilog2_u64(u64 n) -{ - union { - u64 ll; - struct { u32 h, l; }; - } _; - int bit, x, y; - - _.ll = n; - - asm(" subcc %3,gr0,gr0,icc0 \n" - " ckeq icc0,cc4 \n" - " cscan.p %3,gr0,%0 ,cc4,0 \n" - " setlos #63,%1 \n" - " cscan.p %4,gr0,%0 ,cc4,1 \n" - " setlos #31,%2 \n" - " csub.p %1,%0,%0 ,cc4,0 \n" - " csub %2,%0,%0 ,cc4,1 \n" - : "=&r"(bit), "=r"(x), "=r"(y) - : "0r"(_.h), "r"(_.l) - : "icc0", "cc4" - ); - return bit; -} - -#include -#include -#include - -#include - -#include - -#endif /* __KERNEL__ */ - -#endif /* _ASM_BITOPS_H */ diff --git a/arch/frv/include/asm/bug.h b/arch/frv/include/asm/bug.h deleted file mode 100644 index dd01bcf42ee6..000000000000 --- a/arch/frv/include/asm/bug.h +++ /dev/null @@ -1,56 +0,0 @@ -/* bug.h: FRV bug trapping - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_BUG_H -#define _ASM_BUG_H - -#include - -#ifdef CONFIG_BUG -/* - * Tell the user there is some problem. - */ -extern asmlinkage void __debug_bug_trap(int signr); - -#ifdef CONFIG_NO_KERNEL_MSG -#define _debug_bug_printk() -#else -extern void __debug_bug_printk(const char *file, unsigned line); -#define _debug_bug_printk() __debug_bug_printk(__FILE__, __LINE__) -#endif - -#define _debug_bug_trap(signr) \ -do { \ - __debug_bug_trap(signr); \ - asm volatile("nop"); \ -} while(1) - -#define HAVE_ARCH_BUG -#define BUG() \ -do { \ - _debug_bug_printk(); \ - _debug_bug_trap(6 /*SIGABRT*/); \ -} while (0) - -#ifdef CONFIG_GDBSTUB -#define HAVE_ARCH_KGDB_RAISE -#define kgdb_raise(signr) do { _debug_bug_trap(signr); } while(0) - -#define HAVE_ARCH_KGDB_BAD_PAGE -#define kgdb_bad_page(page) do { kgdb_raise(SIGABRT); } while(0) -#endif - -#endif /* CONFIG_BUG */ - -#include - -extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2))); - -#endif diff --git a/arch/frv/include/asm/bugs.h b/arch/frv/include/asm/bugs.h deleted file mode 100644 index f2382be2b46c..000000000000 --- a/arch/frv/include/asm/bugs.h +++ /dev/null @@ -1,14 +0,0 @@ -/* bugs.h: arch bug checking entry - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -static inline void check_bugs(void) -{ -} diff --git a/arch/frv/include/asm/busctl-regs.h b/arch/frv/include/asm/busctl-regs.h deleted file mode 100644 index bb0ff4816e27..000000000000 --- a/arch/frv/include/asm/busctl-regs.h +++ /dev/null @@ -1,41 +0,0 @@ -/* busctl-regs.h: FR400-series CPU bus controller registers - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_BUSCTL_REGS_H -#define _ASM_BUSCTL_REGS_H - -/* bus controller registers */ -#define __get_LGCR() ({ *(volatile unsigned long *)(0xfe000010); }) -#define __get_LMAICR() ({ *(volatile unsigned long *)(0xfe000030); }) -#define __get_LEMBR() ({ *(volatile unsigned long *)(0xfe000040); }) -#define __get_LEMAM() ({ *(volatile unsigned long *)(0xfe000048); }) -#define __get_LCR(R) ({ *(volatile unsigned long *)(0xfe000100 + 8*(R)); }) -#define __get_LSBR(R) ({ *(volatile unsigned long *)(0xfe000c00 + 8*(R)); }) -#define __get_LSAM(R) ({ *(volatile unsigned long *)(0xfe000d00 + 8*(R)); }) - -#define __set_LGCR(V) do { *(volatile unsigned long *)(0xfe000010) = (V); } while(0) -#define __set_LMAICR(V) do { *(volatile unsigned long *)(0xfe000030) = (V); } while(0) -#define __set_LEMBR(V) do { *(volatile unsigned long *)(0xfe000040) = (V); } while(0) -#define __set_LEMAM(V) do { *(volatile unsigned long *)(0xfe000048) = (V); } while(0) -#define __set_LCR(R,V) do { *(volatile unsigned long *)(0xfe000100 + 8*(R)) = (V); } while(0) -#define __set_LSBR(R,V) do { *(volatile unsigned long *)(0xfe000c00 + 8*(R)) = (V); } while(0) -#define __set_LSAM(R,V) do { *(volatile unsigned long *)(0xfe000d00 + 8*(R)) = (V); } while(0) - -/* FR401 SDRAM controller registers */ -#define __get_DBR(R) ({ *(volatile unsigned long *)(0xfe000e00 + 8*(R)); }) -#define __get_DAM(R) ({ *(volatile unsigned long *)(0xfe000f00 + 8*(R)); }) - -/* FR551 SDRAM controller registers */ -#define __get_DARS(R) ({ *(volatile unsigned long *)(0xfeff0100 + 8*(R)); }) -#define __get_DAMK(R) ({ *(volatile unsigned long *)(0xfeff0110 + 8*(R)); }) - - -#endif /* _ASM_BUSCTL_REGS_H */ diff --git a/arch/frv/include/asm/cache.h b/arch/frv/include/asm/cache.h deleted file mode 100644 index 2797163b8f4f..000000000000 --- a/arch/frv/include/asm/cache.h +++ /dev/null @@ -1,23 +0,0 @@ -/* cache.h: FRV cache definitions - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef __ASM_CACHE_H -#define __ASM_CACHE_H - - -/* bytes per L1 cache line */ -#define L1_CACHE_SHIFT (CONFIG_FRV_L1_CACHE_SHIFT) -#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) - -#define __cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES))) -#define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES))) - -#endif diff --git a/arch/frv/include/asm/cacheflush.h b/arch/frv/include/asm/cacheflush.h deleted file mode 100644 index edbac54ae015..000000000000 --- a/arch/frv/include/asm/cacheflush.h +++ /dev/null @@ -1,105 +0,0 @@ -/* cacheflush.h: FRV cache flushing routines - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_CACHEFLUSH_H -#define _ASM_CACHEFLUSH_H - -/* Keep includes the same across arches. */ -#include - -/* - * virtually-indexed cache management (our cache is physically indexed) - */ -#define flush_cache_all() do {} while(0) -#define flush_cache_mm(mm) do {} while(0) -#define flush_cache_dup_mm(mm) do {} while(0) -#define flush_cache_range(mm, start, end) do {} while(0) -#define flush_cache_page(vma, vmaddr, pfn) do {} while(0) -#define flush_cache_vmap(start, end) do {} while(0) -#define flush_cache_vunmap(start, end) do {} while(0) -#define flush_dcache_mmap_lock(mapping) do {} while(0) -#define flush_dcache_mmap_unlock(mapping) do {} while(0) - -/* - * physically-indexed cache management - * - see arch/frv/lib/cache.S - */ -extern void frv_dcache_writeback(unsigned long start, unsigned long size); -extern void frv_cache_invalidate(unsigned long start, unsigned long size); -extern void frv_icache_invalidate(unsigned long start, unsigned long size); -extern void frv_cache_wback_inv(unsigned long start, unsigned long size); - -static inline void __flush_cache_all(void) -{ - asm volatile(" dcef @(gr0,gr0),#1 \n" - " icei @(gr0,gr0),#1 \n" - " membar \n" - : : : "memory" - ); -} - -/* dcache/icache coherency... */ -#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 -#ifdef CONFIG_MMU -extern void flush_dcache_page(struct page *page); -#else -static inline void flush_dcache_page(struct page *page) -{ - unsigned long addr = page_to_phys(page); - frv_dcache_writeback(addr, addr + PAGE_SIZE); -} -#endif - -static inline void flush_page_to_ram(struct page *page) -{ - flush_dcache_page(page); -} - -static inline void flush_icache(void) -{ - __flush_cache_all(); -} - -static inline void flush_icache_range(unsigned long start, unsigned long end) -{ - frv_cache_wback_inv(start, end); -} - -#ifdef CONFIG_MMU -extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, - unsigned long start, unsigned long len); -#else -static inline void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, - unsigned long start, unsigned long len) -{ - frv_cache_wback_inv(start, start + len); -} -#endif - -static inline void flush_icache_page(struct vm_area_struct *vma, struct page *page) -{ - flush_icache_user_range(vma, page, page_to_phys(page), PAGE_SIZE); -} - -/* - * permit ptrace to access another process's address space through the icache - * and the dcache - */ -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ -do { \ - memcpy((dst), (src), (len)); \ - flush_icache_user_range((vma), (page), (vaddr), (len)); \ -} while(0) - -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ - memcpy((dst), (src), (len)) - -#endif /* _ASM_CACHEFLUSH_H */ diff --git a/arch/frv/include/asm/checksum.h b/arch/frv/include/asm/checksum.h deleted file mode 100644 index b77388c5901d..000000000000 --- a/arch/frv/include/asm/checksum.h +++ /dev/null @@ -1,180 +0,0 @@ -/* checksum.h: FRV checksumming - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_CHECKSUM_H -#define _ASM_CHECKSUM_H - -#include - -/* - * computes the checksum of a memory block at buff, length len, - * and adds in "sum" (32-bit) - * - * returns a 32-bit number suitable for feeding into itself - * or csum_tcpudp_magic - * - * this function must be called with even lengths, except - * for the last fragment, which may be odd - * - * it's best to have buff aligned on a 32-bit boundary - */ -__wsum csum_partial(const void *buff, int len, __wsum sum); - -/* - * the same as csum_partial, but copies from src while it - * checksums - * - * here even more important to align src and dst on a 32-bit (or even - * better 64-bit) boundary - */ -__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); - -/* - * the same as csum_partial_copy, but copies from user space. - * - * here even more important to align src and dst on a 32-bit (or even - * better 64-bit) boundary - */ -extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, - int len, __wsum sum, int *csum_err); - -/* - * This is a version of ip_compute_csum() optimized for IP headers, - * which always checksum on 4 octet boundaries. - * - */ -static inline -__sum16 ip_fast_csum(const void *iph, unsigned int ihl) -{ - unsigned int tmp, inc, sum = 0; - - asm(" addcc gr0,gr0,gr0,icc0\n" /* clear icc0.C */ - " subi %1,#4,%1 \n" - "0: \n" - " ldu.p @(%1,%3),%4 \n" - " subicc %2,#1,%2,icc1 \n" - " addxcc.p %4,%0,%0,icc0 \n" - " bhi icc1,#2,0b \n" - - /* fold the 33-bit result into 16-bits */ - " addxcc gr0,%0,%0,icc0 \n" - " srli %0,#16,%1 \n" - " sethi #0,%0 \n" - " add %1,%0,%0 \n" - " srli %0,#16,%1 \n" - " add %1,%0,%0 \n" - - : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (inc), "=&r"(tmp) - : "0" (sum), "1" (iph), "2" (ihl), "3" (4), - "m"(*(volatile struct { int _[100]; } *)iph) - : "icc0", "icc1", "memory" - ); - - return (__force __sum16)~sum; -} - -/* - * Fold a partial checksum - */ -static inline __sum16 csum_fold(__wsum sum) -{ - unsigned int tmp; - - asm(" srli %0,#16,%1 \n" - " sethi #0,%0 \n" - " add %1,%0,%0 \n" - " srli %0,#16,%1 \n" - " add %1,%0,%0 \n" - : "=r"(sum), "=&r"(tmp) - : "0"(sum) - ); - - return (__force __sum16)~sum; -} - -/* - * computes the checksum of the TCP/UDP pseudo-header - * returns a 16-bit checksum, already complemented - */ -static inline __wsum -csum_tcpudp_nofold(__be32 saddr, __be32 daddr, __u32 len, - __u8 proto, __wsum sum) -{ - asm(" addcc %1,%0,%0,icc0 \n" - " addxcc %2,%0,%0,icc0 \n" - " addxcc %3,%0,%0,icc0 \n" - " addxcc gr0,%0,%0,icc0 \n" - : "=r" (sum) - : "r" (daddr), "r" (saddr), "r" (len + proto), "0"(sum) - : "icc0" - ); - return sum; -} - -static inline __sum16 -csum_tcpudp_magic(__be32 saddr, __be32 daddr, __u32 len, - __u8 proto, __wsum sum) -{ - return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); -} - -/* - * this routine is used for miscellaneous IP-like checksums, mainly - * in icmp.c - */ -extern __sum16 ip_compute_csum(const void *buff, int len); - -#define _HAVE_ARCH_IPV6_CSUM -static inline __sum16 -csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, - __u32 len, __u8 proto, __wsum sum) -{ - unsigned long tmp, tmp2; - - asm(" addcc %2,%0,%0,icc0 \n" - - /* add up the source addr */ - " ldi @(%3,0),%1 \n" - " addxcc %1,%0,%0,icc0 \n" - " ldi @(%3,4),%2 \n" - " addxcc %2,%0,%0,icc0 \n" - " ldi @(%3,8),%1 \n" - " addxcc %1,%0,%0,icc0 \n" - " ldi @(%3,12),%2 \n" - " addxcc %2,%0,%0,icc0 \n" - - /* add up the dest addr */ - " ldi @(%4,0),%1 \n" - " addxcc %1,%0,%0,icc0 \n" - " ldi @(%4,4),%2 \n" - " addxcc %2,%0,%0,icc0 \n" - " ldi @(%4,8),%1 \n" - " addxcc %1,%0,%0,icc0 \n" - " ldi @(%4,12),%2 \n" - " addxcc %2,%0,%0,icc0 \n" - - /* fold the 33-bit result into 16-bits */ - " addxcc gr0,%0,%0,icc0 \n" - " srli %0,#16,%1 \n" - " sethi #0,%0 \n" - " add %1,%0,%0 \n" - " srli %0,#16,%1 \n" - " add %1,%0,%0 \n" - - : "=r" (sum), "=&r" (tmp), "=r" (tmp2) - : "r" (saddr), "r" (daddr), "0" (sum), "2" (len + proto) - : "icc0" - ); - - return (__force __sum16)~sum; -} - -#endif /* _ASM_CHECKSUM_H */ diff --git a/arch/frv/include/asm/cmpxchg.h b/arch/frv/include/asm/cmpxchg.h deleted file mode 100644 index ad1f11cfa92a..000000000000 --- a/arch/frv/include/asm/cmpxchg.h +++ /dev/null @@ -1,171 +0,0 @@ -/* xchg and cmpxchg operation emulation for FR-V - * - * For an explanation of how atomic ops work in this arch, see: - * Documentation/frv/atomic-ops.txt - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_CMPXCHG_H -#define _ASM_CMPXCHG_H - -#include - -/*****************************************************************************/ -/* - * exchange value with memory - */ -extern uint64_t __xchg_64(uint64_t i, volatile void *v); - -#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS - -#define xchg(ptr, x) \ -({ \ - __typeof__(ptr) __xg_ptr = (ptr); \ - __typeof__(*(ptr)) __xg_orig; \ - \ - switch (sizeof(__xg_orig)) { \ - case 4: \ - asm volatile( \ - "swap%I0 %M0,%1" \ - : "+m"(*__xg_ptr), "=r"(__xg_orig) \ - : "1"(x) \ - : "memory" \ - ); \ - break; \ - \ - default: \ - __xg_orig = (__typeof__(__xg_orig))0; \ - asm volatile("break"); \ - break; \ - } \ - \ - __xg_orig; \ -}) - -#else - -extern uint32_t __xchg_32(uint32_t i, volatile void *v); - -#define xchg(ptr, x) \ -({ \ - __typeof__(ptr) __xg_ptr = (ptr); \ - __typeof__(*(ptr)) __xg_orig; \ - \ - switch (sizeof(__xg_orig)) { \ - case 4: __xg_orig = (__typeof__(*(ptr))) __xchg_32((uint32_t) x, __xg_ptr); break; \ - default: \ - __xg_orig = (__typeof__(__xg_orig))0; \ - asm volatile("break"); \ - break; \ - } \ - __xg_orig; \ -}) - -#endif - -/*****************************************************************************/ -/* - * compare and conditionally exchange value with memory - * - if (*ptr == test) then orig = *ptr; *ptr = test; - * - if (*ptr != test) then orig = *ptr; - */ -extern uint64_t __cmpxchg_64(uint64_t test, uint64_t new, volatile uint64_t *v); -#define cmpxchg64(p, o, n) __cmpxchg_64((o), (n), (p)) - -#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS - -#define cmpxchg(ptr, test, new) \ -({ \ - __typeof__(ptr) __xg_ptr = (ptr); \ - __typeof__(*(ptr)) __xg_orig, __xg_tmp; \ - __typeof__(*(ptr)) __xg_test = (test); \ - __typeof__(*(ptr)) __xg_new = (new); \ - \ - switch (sizeof(__xg_orig)) { \ - case 4: \ - asm volatile( \ - "0: \n" \ - " orcc gr0,gr0,gr0,icc3 \n" \ - " ckeq icc3,cc7 \n" \ - " ld.p %M0,%1 \n" \ - " orcr cc7,cc7,cc3 \n" \ - " sub%I4cc %1,%4,%2,icc0 \n" \ - " bne icc0,#0,1f \n" \ - " cst.p %3,%M0 ,cc3,#1 \n" \ - " corcc gr29,gr29,gr0 ,cc3,#1 \n" \ - " beq icc3,#0,0b \n" \ - "1: \n" \ - : "+U"(*__xg_ptr), "=&r"(__xg_orig), "=&r"(__xg_tmp) \ - : "r"(__xg_new), "NPr"(__xg_test) \ - : "memory", "cc7", "cc3", "icc3", "icc0" \ - ); \ - break; \ - \ - default: \ - __xg_orig = (__typeof__(__xg_orig))0; \ - asm volatile("break"); \ - break; \ - } \ - \ - __xg_orig; \ -}) - -#else - -extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new); - -#define cmpxchg(ptr, test, new) \ -({ \ - __typeof__(ptr) __xg_ptr = (ptr); \ - __typeof__(*(ptr)) __xg_orig; \ - __typeof__(*(ptr)) __xg_test = (test); \ - __typeof__(*(ptr)) __xg_new = (new); \ - \ - switch (sizeof(__xg_orig)) { \ - case 4: __xg_orig = (__force __typeof__(*ptr)) \ - __cmpxchg_32((__force uint32_t *)__xg_ptr, \ - (__force uint32_t)__xg_test, \ - (__force uint32_t)__xg_new); break; \ - default: \ - __xg_orig = (__typeof__(__xg_orig))0; \ - asm volatile("break"); \ - break; \ - } \ - \ - __xg_orig; \ -}) - -#endif - -#include - -static inline unsigned long __cmpxchg_local(volatile void *ptr, - unsigned long old, - unsigned long new, int size) -{ - switch (size) { - case 4: - return cmpxchg((unsigned long *)ptr, old, new); - default: - return __cmpxchg_local_generic(ptr, old, new, size); - } - - return old; -} - -/* - * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make - * them available. - */ -#define cmpxchg_local(ptr, o, n) \ - ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ - (unsigned long)(n), sizeof(*(ptr)))) -#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) - -#endif /* _ASM_CMPXCHG_H */ diff --git a/arch/frv/include/asm/cpu-irqs.h b/arch/frv/include/asm/cpu-irqs.h deleted file mode 100644 index 478f3498fcfe..000000000000 --- a/arch/frv/include/asm/cpu-irqs.h +++ /dev/null @@ -1,81 +0,0 @@ -/* cpu-irqs.h: on-CPU peripheral irqs - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_CPU_IRQS_H -#define _ASM_CPU_IRQS_H - -#ifndef __ASSEMBLY__ - -/* IRQ to level mappings */ -#define IRQ_GDBSTUB_LEVEL 15 -#define IRQ_UART_LEVEL 13 - -#ifdef CONFIG_GDBSTUB_UART0 -#define IRQ_UART0_LEVEL IRQ_GDBSTUB_LEVEL -#else -#define IRQ_UART0_LEVEL IRQ_UART_LEVEL -#endif - -#ifdef CONFIG_GDBSTUB_UART1 -#define IRQ_UART1_LEVEL IRQ_GDBSTUB_LEVEL -#else -#define IRQ_UART1_LEVEL IRQ_UART_LEVEL -#endif - -#define IRQ_DMA0_LEVEL 14 -#define IRQ_DMA1_LEVEL 14 -#define IRQ_DMA2_LEVEL 14 -#define IRQ_DMA3_LEVEL 14 -#define IRQ_DMA4_LEVEL 14 -#define IRQ_DMA5_LEVEL 14 -#define IRQ_DMA6_LEVEL 14 -#define IRQ_DMA7_LEVEL 14 - -#define IRQ_TIMER0_LEVEL 12 -#define IRQ_TIMER1_LEVEL 11 -#define IRQ_TIMER2_LEVEL 10 - -#define IRQ_XIRQ0_LEVEL 1 -#define IRQ_XIRQ1_LEVEL 2 -#define IRQ_XIRQ2_LEVEL 3 -#define IRQ_XIRQ3_LEVEL 4 -#define IRQ_XIRQ4_LEVEL 5 -#define IRQ_XIRQ5_LEVEL 6 -#define IRQ_XIRQ6_LEVEL 7 -#define IRQ_XIRQ7_LEVEL 8 - -/* IRQ IDs presented to drivers */ -#define IRQ_CPU__UNUSED IRQ_BASE_CPU -#define IRQ_CPU_UART0 (IRQ_BASE_CPU + IRQ_UART0_LEVEL) -#define IRQ_CPU_UART1 (IRQ_BASE_CPU + IRQ_UART1_LEVEL) -#define IRQ_CPU_TIMER0 (IRQ_BASE_CPU + IRQ_TIMER0_LEVEL) -#define IRQ_CPU_TIMER1 (IRQ_BASE_CPU + IRQ_TIMER1_LEVEL) -#define IRQ_CPU_TIMER2 (IRQ_BASE_CPU + IRQ_TIMER2_LEVEL) -#define IRQ_CPU_DMA0 (IRQ_BASE_CPU + IRQ_DMA0_LEVEL) -#define IRQ_CPU_DMA1 (IRQ_BASE_CPU + IRQ_DMA1_LEVEL) -#define IRQ_CPU_DMA2 (IRQ_BASE_CPU + IRQ_DMA2_LEVEL) -#define IRQ_CPU_DMA3 (IRQ_BASE_CPU + IRQ_DMA3_LEVEL) -#define IRQ_CPU_DMA4 (IRQ_BASE_CPU + IRQ_DMA4_LEVEL) -#define IRQ_CPU_DMA5 (IRQ_BASE_CPU + IRQ_DMA5_LEVEL) -#define IRQ_CPU_DMA6 (IRQ_BASE_CPU + IRQ_DMA6_LEVEL) -#define IRQ_CPU_DMA7 (IRQ_BASE_CPU + IRQ_DMA7_LEVEL) -#define IRQ_CPU_EXTERNAL0 (IRQ_BASE_CPU + IRQ_XIRQ0_LEVEL) -#define IRQ_CPU_EXTERNAL1 (IRQ_BASE_CPU + IRQ_XIRQ1_LEVEL) -#define IRQ_CPU_EXTERNAL2 (IRQ_BASE_CPU + IRQ_XIRQ2_LEVEL) -#define IRQ_CPU_EXTERNAL3 (IRQ_BASE_CPU + IRQ_XIRQ3_LEVEL) -#define IRQ_CPU_EXTERNAL4 (IRQ_BASE_CPU + IRQ_XIRQ4_LEVEL) -#define IRQ_CPU_EXTERNAL5 (IRQ_BASE_CPU + IRQ_XIRQ5_LEVEL) -#define IRQ_CPU_EXTERNAL6 (IRQ_BASE_CPU + IRQ_XIRQ6_LEVEL) -#define IRQ_CPU_EXTERNAL7 (IRQ_BASE_CPU + IRQ_XIRQ7_LEVEL) - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ASM_CPU_IRQS_H */ diff --git a/arch/frv/include/asm/current.h b/arch/frv/include/asm/current.h deleted file mode 100644 index 86b027491b08..000000000000 --- a/arch/frv/include/asm/current.h +++ /dev/null @@ -1,30 +0,0 @@ -/* current.h: FRV current task pointer - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_CURRENT_H -#define _ASM_CURRENT_H - -#ifndef __ASSEMBLY__ - -/* - * dedicate GR29 to keeping the current task pointer - */ -register struct task_struct *current asm("gr29"); - -#define get_current() current - -#else - -#define CURRENT gr29 - -#endif - -#endif /* _ASM_CURRENT_H */ diff --git a/arch/frv/include/asm/delay.h b/arch/frv/include/asm/delay.h deleted file mode 100644 index 597b4ebf03b4..000000000000 --- a/arch/frv/include/asm/delay.h +++ /dev/null @@ -1,50 +0,0 @@ -/* delay.h: FRV delay code - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_DELAY_H -#define _ASM_DELAY_H - -#include -#include - -/* - * delay loop - runs at __core_clock_speed_HZ / 2 [there are 2 insns in the loop] - */ -extern unsigned long __delay_loops_MHz; - -static inline void __delay(unsigned long loops) -{ - asm volatile("1: subicc %0,#1,%0,icc0 \n" - " bnc icc0,#2,1b \n" - : "=r" (loops) - : "0" (loops) - : "icc0" - ); -} - -/* - * Use only for very small delays ( < 1 msec). Should probably use a - * lookup table, really, as the multiplications take much too long with - * short delays. This is a "reasonable" implementation, though (and the - * first constant multiplications gets optimized away if the delay is - * a constant) - */ - -extern unsigned long loops_per_jiffy; - -static inline void udelay(unsigned long usecs) -{ - __delay(usecs * __delay_loops_MHz); -} - -#define ndelay(n) udelay((n) * 5) - -#endif /* _ASM_DELAY_H */ diff --git a/arch/frv/include/asm/div64.h b/arch/frv/include/asm/div64.h deleted file mode 100644 index 6cd978cefb28..000000000000 --- a/arch/frv/include/asm/div64.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/frv/include/asm/dm9000.h b/arch/frv/include/asm/dm9000.h deleted file mode 100644 index f6f48fd9ec6e..000000000000 --- a/arch/frv/include/asm/dm9000.h +++ /dev/null @@ -1,37 +0,0 @@ -/* dm9000.h: Davicom DM9000 adapter configuration - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_DM9000_H -#define _ASM_DM9000_H - -#include - -#define DM9000_ARCH_IOBASE (__region_CS6 + 0x300) -#define DM9000_ARCH_IRQ IRQ_CPU_EXTERNAL3 /* XIRQ #3 (shared with FPGA) */ -#undef DM9000_ARCH_IRQ_ACTLOW /* IRQ pin active high */ -#define DM9000_ARCH_BUS_INFO "CS6#+0x300" /* bus info for ethtool */ - -#undef __is_PCI_IO -#define __is_PCI_IO(addr) 0 /* not PCI */ - -#undef inl -#define inl(addr) \ -({ \ - unsigned long __ioaddr = (unsigned long) addr; \ - uint32_t x = readl(__ioaddr); \ - ((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00) | ((x >> 24) & 0xff); \ -}) - -#undef insl -#define insl(a,b,l) __insl(a,b,l,0) /* don't byte-swap */ - - -#endif /* _ASM_DM9000_H */ diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h deleted file mode 100644 index fd80e840a1e6..000000000000 --- a/arch/frv/include/asm/dma-mapping.h +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_DMA_MAPPING_H -#define _ASM_DMA_MAPPING_H - -#include -#include - -extern unsigned long __nongprelbss dma_coherent_mem_start; -extern unsigned long __nongprelbss dma_coherent_mem_end; - -extern const struct dma_map_ops frv_dma_ops; - -static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) -{ - return &frv_dma_ops; -} - -#endif /* _ASM_DMA_MAPPING_H */ diff --git a/arch/frv/include/asm/dma.h b/arch/frv/include/asm/dma.h deleted file mode 100644 index 683c47d48a5b..000000000000 --- a/arch/frv/include/asm/dma.h +++ /dev/null @@ -1,125 +0,0 @@ -/* dma.h: FRV DMA controller management - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_DMA_H -#define _ASM_DMA_H - -//#define DMA_DEBUG 1 - -#include - -#undef MAX_DMA_CHANNELS /* don't use kernel/dma.c */ - -/* under 2.4 this is actually needed by the new bootmem allocator */ -#define MAX_DMA_ADDRESS PAGE_OFFSET - -/* - * FRV DMA controller management - */ -typedef irqreturn_t (*dma_irq_handler_t)(int dmachan, unsigned long cstr, void *data); - -extern void frv_dma_init(void); - -extern int frv_dma_open(const char *devname, - unsigned long dmamask, - int dmacap, - dma_irq_handler_t handler, - unsigned long irq_flags, - void *data); - -/* channels required */ -#define FRV_DMA_MASK_ANY ULONG_MAX /* any channel */ - -/* capabilities required */ -#define FRV_DMA_CAP_DREQ 0x01 /* DMA request pin */ -#define FRV_DMA_CAP_DACK 0x02 /* DMA ACK pin */ -#define FRV_DMA_CAP_DONE 0x04 /* DMA done pin */ - -extern void frv_dma_close(int dma); - -extern void frv_dma_config(int dma, unsigned long ccfr, unsigned long cctr, unsigned long apr); - -extern void frv_dma_start(int dma, - unsigned long sba, unsigned long dba, - unsigned long pix, unsigned long six, unsigned long bcl); - -extern void frv_dma_restart_circular(int dma, unsigned long six); - -extern void frv_dma_stop(int dma); - -extern int is_frv_dma_interrupting(int dma); - -extern void frv_dma_dump(int dma); - -extern void frv_dma_status_clear(int dma); - -#define FRV_DMA_NCHANS 8 -#define FRV_DMA_4CHANS 4 -#define FRV_DMA_8CHANS 8 - -#define DMAC_CCFRx 0x00 /* channel configuration reg */ -#define DMAC_CCFRx_CM_SHIFT 16 -#define DMAC_CCFRx_CM_DA 0x00000000 -#define DMAC_CCFRx_CM_SCA 0x00010000 -#define DMAC_CCFRx_CM_DCA 0x00020000 -#define DMAC_CCFRx_CM_2D 0x00030000 -#define DMAC_CCFRx_ATS_SHIFT 8 -#define DMAC_CCFRx_RS_INTERN 0x00000000 -#define DMAC_CCFRx_RS_EXTERN 0x00000001 -#define DMAC_CCFRx_RS_SHIFT 0 - -#define DMAC_CSTRx 0x08 /* channel status reg */ -#define DMAC_CSTRx_FS 0x0000003f -#define DMAC_CSTRx_NE 0x00000100 -#define DMAC_CSTRx_FED 0x00000200 -#define DMAC_CSTRx_WER 0x00000800 -#define DMAC_CSTRx_RER 0x00001000 -#define DMAC_CSTRx_CE 0x00002000 -#define DMAC_CSTRx_INT 0x00800000 -#define DMAC_CSTRx_BUSY 0x80000000 - -#define DMAC_CCTRx 0x10 /* channel control reg */ -#define DMAC_CCTRx_DSIZ_1 0x00000000 -#define DMAC_CCTRx_DSIZ_2 0x00000001 -#define DMAC_CCTRx_DSIZ_4 0x00000002 -#define DMAC_CCTRx_DSIZ_32 0x00000005 -#define DMAC_CCTRx_DAU_HOLD 0x00000000 -#define DMAC_CCTRx_DAU_INC 0x00000010 -#define DMAC_CCTRx_DAU_DEC 0x00000020 -#define DMAC_CCTRx_SSIZ_1 0x00000000 -#define DMAC_CCTRx_SSIZ_2 0x00000100 -#define DMAC_CCTRx_SSIZ_4 0x00000200 -#define DMAC_CCTRx_SSIZ_32 0x00000500 -#define DMAC_CCTRx_SAU_HOLD 0x00000000 -#define DMAC_CCTRx_SAU_INC 0x00001000 -#define DMAC_CCTRx_SAU_DEC 0x00002000 -#define DMAC_CCTRx_FC 0x08000000 -#define DMAC_CCTRx_ICE 0x10000000 -#define DMAC_CCTRx_IE 0x40000000 -#define DMAC_CCTRx_ACT 0x80000000 - -#define DMAC_SBAx 0x18 /* source base address reg */ -#define DMAC_DBAx 0x20 /* data base address reg */ -#define DMAC_PIXx 0x28 /* primary index reg */ -#define DMAC_SIXx 0x30 /* secondary index reg */ -#define DMAC_BCLx 0x38 /* byte count limit reg */ -#define DMAC_APRx 0x40 /* alternate pointer reg */ - -/* - * required for PCI + MODULES - */ -#ifdef CONFIG_PCI -extern int isa_dma_bridge_buggy; -#else -#define isa_dma_bridge_buggy (0) -#endif - -#endif /* _ASM_DMA_H */ diff --git a/arch/frv/include/asm/elf.h b/arch/frv/include/asm/elf.h deleted file mode 100644 index 2bac6446db41..000000000000 --- a/arch/frv/include/asm/elf.h +++ /dev/null @@ -1,140 +0,0 @@ -/* elf.h: FR-V ELF definitions - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from include/asm-m68knommu/elf.h - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef __ASM_ELF_H -#define __ASM_ELF_H - -#include -#include - -struct elf32_hdr; - -/* - * ELF header e_flags defines. - */ -#define EF_FRV_GPR_MASK 0x00000003 /* mask for # of gprs */ -#define EF_FRV_GPR32 0x00000001 /* Only uses GR on 32-register */ -#define EF_FRV_GPR64 0x00000002 /* Only uses GR on 64-register */ -#define EF_FRV_FPR_MASK 0x0000000c /* mask for # of fprs */ -#define EF_FRV_FPR32 0x00000004 /* Only uses FR on 32-register */ -#define EF_FRV_FPR64 0x00000008 /* Only uses FR on 64-register */ -#define EF_FRV_FPR_NONE 0x0000000C /* Uses software floating-point */ -#define EF_FRV_DWORD_MASK 0x00000030 /* mask for dword support */ -#define EF_FRV_DWORD_YES 0x00000010 /* Assumes stack aligned to 8-byte boundaries. */ -#define EF_FRV_DWORD_NO 0x00000020 /* Assumes stack aligned to 4-byte boundaries. */ -#define EF_FRV_DOUBLE 0x00000040 /* Uses double instructions. */ -#define EF_FRV_MEDIA 0x00000080 /* Uses media instructions. */ -#define EF_FRV_PIC 0x00000100 /* Uses position independent code. */ -#define EF_FRV_NON_PIC_RELOCS 0x00000200 /* Does not use position Independent code. */ -#define EF_FRV_MULADD 0x00000400 /* -mmuladd */ -#define EF_FRV_BIGPIC 0x00000800 /* -fPIC */ -#define EF_FRV_LIBPIC 0x00001000 /* -mlibrary-pic */ -#define EF_FRV_G0 0x00002000 /* -G 0, no small data ptr */ -#define EF_FRV_NOPACK 0x00004000 /* -mnopack */ -#define EF_FRV_FDPIC 0x00008000 /* -mfdpic */ -#define EF_FRV_CPU_MASK 0xff000000 /* specific cpu bits */ -#define EF_FRV_CPU_GENERIC 0x00000000 /* Set CPU type is FR-V */ -#define EF_FRV_CPU_FR500 0x01000000 /* Set CPU type is FR500 */ -#define EF_FRV_CPU_FR300 0x02000000 /* Set CPU type is FR300 */ -#define EF_FRV_CPU_SIMPLE 0x03000000 /* SIMPLE */ -#define EF_FRV_CPU_TOMCAT 0x04000000 /* Tomcat, FR500 prototype */ -#define EF_FRV_CPU_FR400 0x05000000 /* Set CPU type is FR400 */ -#define EF_FRV_CPU_FR550 0x06000000 /* Set CPU type is FR550 */ -#define EF_FRV_CPU_FR405 0x07000000 /* Set CPU type is FR405 */ -#define EF_FRV_CPU_FR450 0x08000000 /* Set CPU type is FR450 */ - -/* - * FR-V ELF relocation types - */ - - -/* - * ELF register definitions.. - */ -typedef unsigned long elf_greg_t; - -#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; - -typedef struct user_fpmedia_regs elf_fpregset_t; - -/* - * This is used to ensure we don't load something for the wrong architecture. - */ -extern int elf_check_arch(const struct elf32_hdr *hdr); - -#define elf_check_fdpic(x) ((x)->e_flags & EF_FRV_FDPIC && !((x)->e_flags & EF_FRV_NON_PIC_RELOCS)) -#define elf_check_const_displacement(x) ((x)->e_flags & EF_FRV_PIC) - -/* - * These are used to set parameters in the core dumps. - */ -#define ELF_CLASS ELFCLASS32 -#define ELF_DATA ELFDATA2MSB -#define ELF_ARCH EM_FRV - -#define ELF_PLAT_INIT(_r) \ -do { \ - __kernel_frame0_ptr->gr16 = 0; \ - __kernel_frame0_ptr->gr17 = 0; \ - __kernel_frame0_ptr->gr18 = 0; \ - __kernel_frame0_ptr->gr19 = 0; \ - __kernel_frame0_ptr->gr20 = 0; \ - __kernel_frame0_ptr->gr21 = 0; \ - __kernel_frame0_ptr->gr22 = 0; \ - __kernel_frame0_ptr->gr23 = 0; \ - __kernel_frame0_ptr->gr24 = 0; \ - __kernel_frame0_ptr->gr25 = 0; \ - __kernel_frame0_ptr->gr26 = 0; \ - __kernel_frame0_ptr->gr27 = 0; \ - __kernel_frame0_ptr->gr29 = 0; \ -} while(0) - -#define ELF_FDPIC_PLAT_INIT(_regs, _exec_map_addr, _interp_map_addr, _dynamic_addr) \ -do { \ - __kernel_frame0_ptr->gr16 = _exec_map_addr; \ - __kernel_frame0_ptr->gr17 = _interp_map_addr; \ - __kernel_frame0_ptr->gr18 = _dynamic_addr; \ - __kernel_frame0_ptr->gr19 = 0; \ - __kernel_frame0_ptr->gr20 = 0; \ - __kernel_frame0_ptr->gr21 = 0; \ - __kernel_frame0_ptr->gr22 = 0; \ - __kernel_frame0_ptr->gr23 = 0; \ - __kernel_frame0_ptr->gr24 = 0; \ - __kernel_frame0_ptr->gr25 = 0; \ - __kernel_frame0_ptr->gr26 = 0; \ - __kernel_frame0_ptr->gr27 = 0; \ - __kernel_frame0_ptr->gr29 = 0; \ -} while(0) - -#define CORE_DUMP_USE_REGSET -#define ELF_FDPIC_CORE_EFLAGS EF_FRV_FDPIC -#define ELF_EXEC_PAGESIZE 16384 - -/* This is the location that an ET_DYN program is loaded if exec'ed. Typical - use of this is to invoke "./ld.so someprog" to test out a new version of - the loader. We need to make sure that it is out of the way of the program - that it will "exec", and that there is sufficient room for the brk. */ - -#define ELF_ET_DYN_BASE 0x08000000UL - -/* This yields a mask that user programs can use to figure out what - instruction set this cpu supports. */ - -#define ELF_HWCAP (0) - -/* This yields a string that ld.so will use to load implementation - specific libraries for optimization. This is more specific in - intent than poking at uname or /proc/cpuinfo. */ - -#define ELF_PLATFORM (NULL) - -#endif diff --git a/arch/frv/include/asm/emergency-restart.h b/arch/frv/include/asm/emergency-restart.h deleted file mode 100644 index 108d8c48e42e..000000000000 --- a/arch/frv/include/asm/emergency-restart.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_EMERGENCY_RESTART_H -#define _ASM_EMERGENCY_RESTART_H - -#include - -#endif /* _ASM_EMERGENCY_RESTART_H */ diff --git a/arch/frv/include/asm/fpu.h b/arch/frv/include/asm/fpu.h deleted file mode 100644 index 2f0929333f91..000000000000 --- a/arch/frv/include/asm/fpu.h +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_FPU_H -#define __ASM_FPU_H - - -/* - * MAX floating point unit state size (FSAVE/FRESTORE) - */ - -#define kernel_fpu_end() do { asm volatile("bar":::"memory"); preempt_enable(); } while(0) - -#endif /* __ASM_FPU_H */ diff --git a/arch/frv/include/asm/ftrace.h b/arch/frv/include/asm/ftrace.h deleted file mode 100644 index 40a8c178f10d..000000000000 --- a/arch/frv/include/asm/ftrace.h +++ /dev/null @@ -1 +0,0 @@ -/* empty */ diff --git a/arch/frv/include/asm/futex.h b/arch/frv/include/asm/futex.h deleted file mode 100644 index dfcc3484231d..000000000000 --- a/arch/frv/include/asm/futex.h +++ /dev/null @@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_FUTEX_H -#define _ASM_FUTEX_H - -#ifdef __KERNEL__ - -#include -#include -#include - -extern int arch_futex_atomic_op_inuser(int op, int oparg, int *oval, - u32 __user *uaddr); - -static inline int -futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, - u32 oldval, u32 newval) -{ - return -ENOSYS; -} - -#endif -#endif diff --git a/arch/frv/include/asm/gdb-stub.h b/arch/frv/include/asm/gdb-stub.h deleted file mode 100644 index e6bedd0cd9a5..000000000000 --- a/arch/frv/include/asm/gdb-stub.h +++ /dev/null @@ -1,146 +0,0 @@ -/* gdb-stub.h: FRV GDB stub - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from asm-mips/gdb-stub.h (c) 1995 Andreas Busse - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef __ASM_GDB_STUB_H -#define __ASM_GDB_STUB_H - -#undef GDBSTUB_DEBUG_IO -#undef GDBSTUB_DEBUG_PROTOCOL - -#include - -/* - * important register numbers in GDB protocol - * - GR0, GR1, GR2, GR3, GR4, GR5, GR6, GR7, - * - GR8, GR9, GR10, GR11, GR12, GR13, GR14, GR15, - * - GR16, GR17, GR18, GR19, GR20, GR21, GR22, GR23, - * - GR24, GR25, GR26, GR27, GR28, GR29, GR30, GR31, - * - GR32, GR33, GR34, GR35, GR36, GR37, GR38, GR39, - * - GR40, GR41, GR42, GR43, GR44, GR45, GR46, GR47, - * - GR48, GR49, GR50, GR51, GR52, GR53, GR54, GR55, - * - GR56, GR57, GR58, GR59, GR60, GR61, GR62, GR63, - * - FR0, FR1, FR2, FR3, FR4, FR5, FR6, FR7, - * - FR8, FR9, FR10, FR11, FR12, FR13, FR14, FR15, - * - FR16, FR17, FR18, FR19, FR20, FR21, FR22, FR23, - * - FR24, FR25, FR26, FR27, FR28, FR29, FR30, FR31, - * - FR32, FR33, FR34, FR35, FR36, FR37, FR38, FR39, - * - FR40, FR41, FR42, FR43, FR44, FR45, FR46, FR47, - * - FR48, FR49, FR50, FR51, FR52, FR53, FR54, FR55, - * - FR56, FR57, FR58, FR59, FR60, FR61, FR62, FR63, - * - PC, PSR, CCR, CCCR, - * - _X132, _X133, _X134 - * - TBR, BRR, DBAR0, DBAR1, DBAR2, DBAR3, - * - SCR0, SCR1, SCR2, SCR3, - * - LR, LCR, - * - IACC0H, IACC0L, - * - FSR0, - * - ACC0, ACC1, ACC2, ACC3, ACC4, ACC5, ACC6, ACC7, - * - ACCG0123, ACCG4567, - * - MSR0, MSR1, - * - GNER0, GNER1, - * - FNER0, FNER1, - */ -#define GDB_REG_GR(N) (N) -#define GDB_REG_FR(N) (64+(N)) -#define GDB_REG_PC 128 -#define GDB_REG_PSR 129 -#define GDB_REG_CCR 130 -#define GDB_REG_CCCR 131 -#define GDB_REG_TBR 135 -#define GDB_REG_BRR 136 -#define GDB_REG_DBAR(N) (137+(N)) -#define GDB_REG_SCR(N) (141+(N)) -#define GDB_REG_LR 145 -#define GDB_REG_LCR 146 -#define GDB_REG_FSR0 149 -#define GDB_REG_ACC(N) (150+(N)) -#define GDB_REG_ACCG(N) (158+(N)/4) -#define GDB_REG_MSR(N) (160+(N)) -#define GDB_REG_GNER(N) (162+(N)) -#define GDB_REG_FNER(N) (164+(N)) - -#define GDB_REG_SP GDB_REG_GR(1) -#define GDB_REG_FP GDB_REG_GR(2) - -#ifndef _LANGUAGE_ASSEMBLY - -/* - * Prototypes - */ -extern void show_registers_only(struct pt_regs *regs); - -extern void gdbstub_init(void); -extern void gdbstub(int type); -extern void gdbstub_exit(int status); - -extern void gdbstub_io_init(void); -extern void gdbstub_set_baud(unsigned baud); -extern int gdbstub_rx_char(unsigned char *_ch, int nonblock); -extern void gdbstub_tx_char(unsigned char ch); -extern void gdbstub_tx_flush(void); -extern void gdbstub_do_rx(void); - -extern asmlinkage void __debug_stub_init_break(void); -extern asmlinkage void __break_hijack_kernel_event(void); -extern asmlinkage void __break_hijack_kernel_event_breaks_here(void); - -extern asmlinkage void gdbstub_rx_handler(void); -extern asmlinkage void gdbstub_rx_irq(void); -extern asmlinkage void gdbstub_intercept(void); - -extern uint32_t __entry_usertrap_table[]; -extern uint32_t __entry_kerneltrap_table[]; - -extern volatile u8 gdbstub_rx_buffer[PAGE_SIZE]; -extern volatile u32 gdbstub_rx_inp; -extern volatile u32 gdbstub_rx_outp; -extern volatile u8 gdbstub_rx_overflow; -extern u8 gdbstub_rx_unget; - -extern void gdbstub_printk(const char *fmt, ...); -extern void debug_to_serial(const char *p, int n); -extern void console_set_baud(unsigned baud); - -#ifdef GDBSTUB_DEBUG_IO -#define gdbstub_io(FMT,...) gdbstub_printk(FMT, ##__VA_ARGS__) -#else -#define gdbstub_io(FMT,...) ({ 0; }) -#endif - -#ifdef GDBSTUB_DEBUG_PROTOCOL -#define gdbstub_proto(FMT,...) gdbstub_printk(FMT,##__VA_ARGS__) -#else -#define gdbstub_proto(FMT,...) ({ 0; }) -#endif - -/* - * we dedicate GR31 to keeping a pointer to the gdbstub exception frame - * - gr31 is destroyed on entry to the gdbstub if !MMU - * - gr31 is saved in scr3 on entry to the gdbstub if in !MMU - */ -register struct frv_frame0 *__debug_frame0 asm("gr31"); - -#define __debug_frame (&__debug_frame0->regs) -#define __debug_user_context (&__debug_frame0->uc) -#define __debug_regs (&__debug_frame0->debug) -#define __debug_reg(X) ((unsigned long *) ((unsigned long) &__debug_frame0 + (X))) - -struct frv_debug_status { - unsigned long bpsr; - unsigned long dcr; - unsigned long brr; - unsigned long nmar; -}; - -extern struct frv_debug_status __debug_status; - -#endif /* _LANGUAGE_ASSEMBLY */ -#endif /* __ASM_GDB_STUB_H */ diff --git a/arch/frv/include/asm/gpio-regs.h b/arch/frv/include/asm/gpio-regs.h deleted file mode 100644 index 9edf5d5d4d3f..000000000000 --- a/arch/frv/include/asm/gpio-regs.h +++ /dev/null @@ -1,116 +0,0 @@ -/* gpio-regs.h: on-chip general purpose I/O registers - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_GPIO_REGS -#define _ASM_GPIO_REGS - -#define __reg(ADDR) (*(volatile unsigned long *)(ADDR)) - -#define __get_PDR() ({ __reg(0xfeff0400); }) -#define __set_PDR(V) do { __reg(0xfeff0400) = (V); mb(); } while(0) - -#define __get_GPDR() ({ __reg(0xfeff0408); }) -#define __set_GPDR(V) do { __reg(0xfeff0408) = (V); mb(); } while(0) - -#define __get_SIR() ({ __reg(0xfeff0410); }) -#define __set_SIR(V) do { __reg(0xfeff0410) = (V); mb(); } while(0) - -#define __get_SOR() ({ __reg(0xfeff0418); }) -#define __set_SOR(V) do { __reg(0xfeff0418) = (V); mb(); } while(0) - -#define __set_PDSR(V) do { __reg(0xfeff0420) = (V); mb(); } while(0) - -#define __set_PDCR(V) do { __reg(0xfeff0428) = (V); mb(); } while(0) - -#define __get_RSTR() ({ __reg(0xfeff0500); }) -#define __set_RSTR(V) do { __reg(0xfeff0500) = (V); mb(); } while(0) - - - -/* PDR definitions */ -#define PDR_GPIO_DATA(X) (1 << (X)) - -/* GPDR definitions */ -#define GPDR_INPUT 0 -#define GPDR_OUTPUT 1 -#define GPDR_DREQ0_BIT 0x00001000 -#define GPDR_DREQ1_BIT 0x00008000 -#define GPDR_DREQ2_BIT 0x00040000 -#define GPDR_DREQ3_BIT 0x00080000 -#define GPDR_DREQ4_BIT 0x00004000 -#define GPDR_DREQ5_BIT 0x00020000 -#define GPDR_DREQ6_BIT 0x00100000 -#define GPDR_DREQ7_BIT 0x00200000 -#define GPDR_DACK0_BIT 0x00002000 -#define GPDR_DACK1_BIT 0x00010000 -#define GPDR_DACK2_BIT 0x00100000 -#define GPDR_DACK3_BIT 0x00200000 -#define GPDR_DONE0_BIT 0x00004000 -#define GPDR_DONE1_BIT 0x00020000 -#define GPDR_GPIO_DIR(X,D) ((D) << (X)) - -/* SIR definitions */ -#define SIR_GPIO_INPUT 0 -#define SIR_DREQ7_INPUT 0x00200000 -#define SIR_DREQ6_INPUT 0x00100000 -#define SIR_DREQ3_INPUT 0x00080000 -#define SIR_DREQ2_INPUT 0x00040000 -#define SIR_DREQ5_INPUT 0x00020000 -#define SIR_DREQ1_INPUT 0x00008000 -#define SIR_DREQ4_INPUT 0x00004000 -#define SIR_DREQ0_INPUT 0x00001000 -#define SIR_RXD1_INPUT 0x00000400 -#define SIR_CTS0_INPUT 0x00000100 -#define SIR_RXD0_INPUT 0x00000040 -#define SIR_GATE1_INPUT 0x00000020 -#define SIR_GATE0_INPUT 0x00000010 -#define SIR_IRQ3_INPUT 0x00000008 -#define SIR_IRQ2_INPUT 0x00000004 -#define SIR_IRQ1_INPUT 0x00000002 -#define SIR_IRQ0_INPUT 0x00000001 -#define SIR_DREQ_BITS (SIR_DREQ0_INPUT | SIR_DREQ1_INPUT | \ - SIR_DREQ2_INPUT | SIR_DREQ3_INPUT | \ - SIR_DREQ4_INPUT | SIR_DREQ5_INPUT | \ - SIR_DREQ6_INPUT | SIR_DREQ7_INPUT) - -/* SOR definitions */ -#define SOR_GPIO_OUTPUT 0 -#define SOR_DACK3_OUTPUT 0x00200000 -#define SOR_DACK2_OUTPUT 0x00100000 -#define SOR_DONE1_OUTPUT 0x00020000 -#define SOR_DACK1_OUTPUT 0x00010000 -#define SOR_DONE0_OUTPUT 0x00004000 -#define SOR_DACK0_OUTPUT 0x00002000 -#define SOR_TXD1_OUTPUT 0x00000800 -#define SOR_RTS0_OUTPUT 0x00000200 -#define SOR_TXD0_OUTPUT 0x00000080 -#define SOR_TOUT1_OUTPUT 0x00000020 -#define SOR_TOUT0_OUTPUT 0x00000010 -#define SOR_DONE_BITS (SOR_DONE0_OUTPUT | SOR_DONE1_OUTPUT) -#define SOR_DACK_BITS (SOR_DACK0_OUTPUT | SOR_DACK1_OUTPUT | \ - SOR_DACK2_OUTPUT | SOR_DACK3_OUTPUT) - -/* PDSR definitions */ -#define PDSR_UNCHANGED 0 -#define PDSR_SET_BIT(X) (1 << (X)) - -/* PDCR definitions */ -#define PDCR_UNCHANGED 0 -#define PDCR_CLEAR_BIT(X) (1 << (X)) - -/* RSTR definitions */ -/* Read Only */ -#define RSTR_POWERON 0x00000400 -#define RSTR_SOFTRESET_STATUS 0x00000100 -/* Write Only */ -#define RSTR_SOFTRESET 0x00000001 - -#endif /* _ASM_GPIO_REGS */ diff --git a/arch/frv/include/asm/hardirq.h b/arch/frv/include/asm/hardirq.h deleted file mode 100644 index c62833d6ebbb..000000000000 --- a/arch/frv/include/asm/hardirq.h +++ /dev/null @@ -1,26 +0,0 @@ -/* hardirq.h: FRV hardware IRQ management - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef __ASM_HARDIRQ_H -#define __ASM_HARDIRQ_H - -#include - -extern atomic_t irq_err_count; -static inline void ack_bad_irq(int irq) -{ - atomic_inc(&irq_err_count); -} -#define ack_bad_irq ack_bad_irq - -#include - -#endif diff --git a/arch/frv/include/asm/highmem.h b/arch/frv/include/asm/highmem.h deleted file mode 100644 index 1f58938703ab..000000000000 --- a/arch/frv/include/asm/highmem.h +++ /dev/null @@ -1,149 +0,0 @@ -/* highmem.h: virtual kernel memory mappings for high memory - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from include/asm-i386/highmem.h - * - * See Documentation/frv/mmu-layout.txt for more information. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_HIGHMEM_H -#define _ASM_HIGHMEM_H - -#ifdef __KERNEL__ - -#include -#include -#include -#include -#include - -#define NR_TLB_LINES 64 /* number of lines in the TLB */ - -#ifndef __ASSEMBLY__ - -#include -#include -#include - -#ifdef CONFIG_DEBUG_HIGHMEM -#define HIGHMEM_DEBUG 1 -#else -#define HIGHMEM_DEBUG 0 -#endif - -/* declarations for highmem.c */ -extern unsigned long highstart_pfn, highend_pfn; - -#define kmap_prot PAGE_KERNEL -#define kmap_pte ______kmap_pte_in_TLB -extern pte_t *pkmap_page_table; - -#define flush_cache_kmaps() do { } while (0) - -/* - * Right now we initialize only a single pte table. It can be extended - * easily, subsequent pte tables have to be allocated in one physical - * chunk of RAM. - */ -#define LAST_PKMAP PTRS_PER_PTE -#define LAST_PKMAP_MASK (LAST_PKMAP - 1) -#define PKMAP_NR(virt) ((virt - PKMAP_BASE) >> PAGE_SHIFT) -#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) - -extern void *kmap_high(struct page *page); -extern void kunmap_high(struct page *page); - -extern void *kmap(struct page *page); -extern void kunmap(struct page *page); - -#endif /* !__ASSEMBLY__ */ - -/* - * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap - * gives a more generic (and caching) interface. But kmap_atomic can - * be used in IRQ contexts, so in some (very limited) cases we need - * it. - */ -#define KMAP_ATOMIC_CACHE_DAMR 8 - -#ifndef __ASSEMBLY__ - -#define __kmap_atomic_primary(cached, paddr, ampr) \ -({ \ - unsigned long damlr, dampr; \ - \ - dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ - \ - if (!cached) \ - asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \ - else \ - /* cache flush page attachment point */ \ - asm volatile("movgs %0,iampr"#ampr"\n" \ - "movgs %0,dampr"#ampr"\n" \ - :: "r"(dampr) : "memory" \ - ); \ - \ - asm("movsg damlr"#ampr",%0" : "=r"(damlr)); \ - \ - /*printk("DAMR"#ampr": PRIM sl=%d L=%08lx P=%08lx\n", type, damlr, dampr);*/ \ - \ - (void *) damlr; \ -}) - -#define __kmap_atomic_secondary(slot, paddr) \ -({ \ - unsigned long damlr = KMAP_ATOMIC_SECONDARY_FRAME + (slot) * PAGE_SIZE; \ - unsigned long dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ - \ - asm volatile("movgs %0,tplr \n" \ - "movgs %1,tppr \n" \ - "tlbpr %0,gr0,#2,#1" \ - : : "r"(damlr), "r"(dampr) : "memory"); \ - \ - /*printk("TLB: SECN sl=%d L=%08lx P=%08lx\n", slot, damlr, dampr);*/ \ - \ - (void *) damlr; \ -}) - -static inline void *kmap_atomic_primary(struct page *page) -{ - unsigned long paddr; - - pagefault_disable(); - paddr = page_to_phys(page); - - return __kmap_atomic_primary(1, paddr, 2); -} - -#define __kunmap_atomic_primary(cached, ampr) \ -do { \ - asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \ - if (cached) \ - asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \ -} while(0) - -#define __kunmap_atomic_secondary(slot, vaddr) \ -do { \ - asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \ -} while(0) - -static inline void kunmap_atomic_primary(void *kvaddr) -{ - __kunmap_atomic_primary(1, 2); - pagefault_enable(); -} - -void *kmap_atomic(struct page *page); -void __kunmap_atomic(void *kvaddr); - -#endif /* !__ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif /* _ASM_HIGHMEM_H */ diff --git a/arch/frv/include/asm/hw_irq.h b/arch/frv/include/asm/hw_irq.h deleted file mode 100644 index 522ad37923d8..000000000000 --- a/arch/frv/include/asm/hw_irq.h +++ /dev/null @@ -1,16 +0,0 @@ -/* hw_irq.h: FR-V specific h/w IRQ stuff - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_HW_IRQ_H -#define _ASM_HW_IRQ_H - - -#endif /* _ASM_HW_IRQ_H */ diff --git a/arch/frv/include/asm/io.h b/arch/frv/include/asm/io.h deleted file mode 100644 index 8062fc73fad0..000000000000 --- a/arch/frv/include/asm/io.h +++ /dev/null @@ -1,414 +0,0 @@ -/* io.h: FRV I/O operations - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * This gets interesting when talking to the PCI bus - the CPU is in big endian - * mode, the PCI bus is little endian and the hardware in the middle can do - * byte swapping - */ -#ifndef _ASM_IO_H -#define _ASM_IO_H - -#ifdef __KERNEL__ - -#define ARCH_HAS_IOREMAP_WT - -#include -#include -#include -#include -#include -#include - -/* - * swap functions are sometimes needed to interface little-endian hardware - */ - -static inline unsigned short _swapw(unsigned short v) -{ - return ((v << 8) | (v >> 8)); -} - -static inline unsigned long _swapl(unsigned long v) -{ - return ((v << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24)); -} - -//#define __iormb() asm volatile("membar") -//#define __iowmb() asm volatile("membar") - -static inline u8 __raw_readb(const volatile void __iomem *addr) -{ - return __builtin_read8((volatile void __iomem *)addr); -} - -static inline u16 __raw_readw(const volatile void __iomem *addr) -{ - return __builtin_read16((volatile void __iomem *)addr); -} - -static inline u32 __raw_readl(const volatile void __iomem *addr) -{ - return __builtin_read32((volatile void __iomem *)addr); -} - -#define __raw_writeb(datum, addr) __builtin_write8(addr, datum) -#define __raw_writew(datum, addr) __builtin_write16(addr, datum) -#define __raw_writel(datum, addr) __builtin_write32(addr, datum) - -static inline void io_outsb(unsigned int addr, const void *buf, int len) -{ - unsigned long __ioaddr = (unsigned long) addr; - const uint8_t *bp = buf; - - while (len--) - __builtin_write8((volatile void __iomem *) __ioaddr, *bp++); -} - -static inline void io_outsw(unsigned int addr, const void *buf, int len) -{ - unsigned long __ioaddr = (unsigned long) addr; - const uint16_t *bp = buf; - - while (len--) - __builtin_write16((volatile void __iomem *) __ioaddr, (*bp++)); -} - -extern void __outsl_ns(unsigned int addr, const void *buf, int len); -extern void __outsl_sw(unsigned int addr, const void *buf, int len); -static inline void __outsl(unsigned int addr, const void *buf, int len, int swap) -{ - unsigned long __ioaddr = (unsigned long) addr; - - if (!swap) - __outsl_ns(__ioaddr, buf, len); - else - __outsl_sw(__ioaddr, buf, len); -} - -static inline void io_insb(unsigned long addr, void *buf, int len) -{ - uint8_t *bp = buf; - - while (len--) - *bp++ = __builtin_read8((volatile void __iomem *) addr); -} - -static inline void io_insw(unsigned long addr, void *buf, int len) -{ - uint16_t *bp = buf; - - while (len--) - *bp++ = __builtin_read16((volatile void __iomem *) addr); -} - -extern void __insl_ns(unsigned long addr, void *buf, int len); -extern void __insl_sw(unsigned long addr, void *buf, int len); -static inline void __insl(unsigned long addr, void *buf, int len, int swap) -{ - if (!swap) - __insl_ns(addr, buf, len); - else - __insl_sw(addr, buf, len); -} - -#define mmiowb() mb() - -/* - * make the short names macros so specific devices - * can override them as required - */ - -static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) -{ - memset((void __force *) addr, val, count); -} - -static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) -{ - memcpy(dst, (void __force *) src, count); -} - -static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count) -{ - memcpy((void __force *) dst, src, count); -} - -static inline uint8_t inb(unsigned long addr) -{ - return __builtin_read8((void __iomem *)addr); -} - -static inline uint16_t inw(unsigned long addr) -{ - uint16_t ret = __builtin_read16((void __iomem *)addr); - - if (__is_PCI_IO(addr)) - ret = _swapw(ret); - - return ret; -} - -static inline uint32_t inl(unsigned long addr) -{ - uint32_t ret = __builtin_read32((void __iomem *)addr); - - if (__is_PCI_IO(addr)) - ret = _swapl(ret); - - return ret; -} - -static inline void outb(uint8_t datum, unsigned long addr) -{ - __builtin_write8((void __iomem *)addr, datum); -} - -static inline void outw(uint16_t datum, unsigned long addr) -{ - if (__is_PCI_IO(addr)) - datum = _swapw(datum); - __builtin_write16((void __iomem *)addr, datum); -} - -static inline void outl(uint32_t datum, unsigned long addr) -{ - if (__is_PCI_IO(addr)) - datum = _swapl(datum); - __builtin_write32((void __iomem *)addr, datum); -} - -#define inb_p(addr) inb(addr) -#define inw_p(addr) inw(addr) -#define inl_p(addr) inl(addr) -#define outb_p(x,addr) outb(x,addr) -#define outw_p(x,addr) outw(x,addr) -#define outl_p(x,addr) outl(x,addr) - -#define outsb(a,b,l) io_outsb(a,b,l) -#define outsw(a,b,l) io_outsw(a,b,l) -#define outsl(a,b,l) __outsl(a,b,l,0) - -#define insb(a,b,l) io_insb(a,b,l) -#define insw(a,b,l) io_insw(a,b,l) -#define insl(a,b,l) __insl(a,b,l,0) - -#define IO_SPACE_LIMIT 0xffffffff - -static inline uint8_t readb(const volatile void __iomem *addr) -{ - return __builtin_read8((__force void volatile __iomem *) addr); -} - -static inline uint16_t readw(const volatile void __iomem *addr) -{ - uint16_t ret = __builtin_read16((__force void volatile __iomem *)addr); - - if (__is_PCI_MEM(addr)) - ret = _swapw(ret); - return ret; -} - -static inline uint32_t readl(const volatile void __iomem *addr) -{ - uint32_t ret = __builtin_read32((__force void volatile __iomem *)addr); - - if (__is_PCI_MEM(addr)) - ret = _swapl(ret); - - return ret; -} - -#define readb_relaxed readb -#define readw_relaxed readw -#define readl_relaxed readl - -static inline void writeb(uint8_t datum, volatile void __iomem *addr) -{ - __builtin_write8(addr, datum); - if (__is_PCI_MEM(addr)) - __flush_PCI_writes(); -} - -static inline void writew(uint16_t datum, volatile void __iomem *addr) -{ - if (__is_PCI_MEM(addr)) - datum = _swapw(datum); - - __builtin_write16(addr, datum); - if (__is_PCI_MEM(addr)) - __flush_PCI_writes(); -} - -static inline void writel(uint32_t datum, volatile void __iomem *addr) -{ - if (__is_PCI_MEM(addr)) - datum = _swapl(datum); - - __builtin_write32(addr, datum); - if (__is_PCI_MEM(addr)) - __flush_PCI_writes(); -} - -#define writeb_relaxed writeb -#define writew_relaxed writew -#define writel_relaxed writel - -/* Values for nocacheflag and cmode */ -#define IOMAP_FULL_CACHING 0 -#define IOMAP_NOCACHE_SER 1 -#define IOMAP_NOCACHE_NONSER 2 -#define IOMAP_WRITETHROUGH 3 - -extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); - -static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) -{ - return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); -} - -static inline void __iomem *ioremap_nocache(unsigned long physaddr, unsigned long size) -{ - return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); -} - -static inline void __iomem *ioremap_wt(unsigned long physaddr, unsigned long size) -{ - return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); -} - -static inline void __iomem *ioremap_fullcache(unsigned long physaddr, unsigned long size) -{ - return __ioremap(physaddr, size, IOMAP_FULL_CACHING); -} - -#define ioremap_wc ioremap_nocache -#define ioremap_uc ioremap_nocache - -extern void iounmap(void volatile __iomem *addr); - -static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) -{ - return (void __iomem *) port; -} - -static inline void ioport_unmap(void __iomem *p) -{ -} - -static inline void flush_write_buffers(void) -{ - __asm__ __volatile__ ("membar" : : :"memory"); -} - -/* - * do appropriate I/O accesses for token type - */ -static inline unsigned int ioread8(void __iomem *p) -{ - return __builtin_read8(p); -} - -static inline unsigned int ioread16(void __iomem *p) -{ - uint16_t ret = __builtin_read16(p); - if (__is_PCI_addr(p)) - ret = _swapw(ret); - return ret; -} - -static inline unsigned int ioread32(void __iomem *p) -{ - uint32_t ret = __builtin_read32(p); - if (__is_PCI_addr(p)) - ret = _swapl(ret); - return ret; -} - -static inline void iowrite8(u8 val, void __iomem *p) -{ - __builtin_write8(p, val); - if (__is_PCI_MEM(p)) - __flush_PCI_writes(); -} - -static inline void iowrite16(u16 val, void __iomem *p) -{ - if (__is_PCI_addr(p)) - val = _swapw(val); - __builtin_write16(p, val); - if (__is_PCI_MEM(p)) - __flush_PCI_writes(); -} - -static inline void iowrite32(u32 val, void __iomem *p) -{ - if (__is_PCI_addr(p)) - val = _swapl(val); - __builtin_write32(p, val); - if (__is_PCI_MEM(p)) - __flush_PCI_writes(); -} - -#define ioread16be(addr) be16_to_cpu(ioread16(addr)) -#define ioread32be(addr) be32_to_cpu(ioread32(addr)) -#define iowrite16be(v, addr) iowrite16(cpu_to_be16(v), (addr)) -#define iowrite32be(v, addr) iowrite32(cpu_to_be32(v), (addr)) - -static inline void ioread8_rep(void __iomem *p, void *dst, unsigned long count) -{ - io_insb((unsigned long) p, dst, count); -} - -static inline void ioread16_rep(void __iomem *p, void *dst, unsigned long count) -{ - io_insw((unsigned long) p, dst, count); -} - -static inline void ioread32_rep(void __iomem *p, void *dst, unsigned long count) -{ - __insl_ns((unsigned long) p, dst, count); -} - -static inline void iowrite8_rep(void __iomem *p, const void *src, unsigned long count) -{ - io_outsb((unsigned long) p, src, count); -} - -static inline void iowrite16_rep(void __iomem *p, const void *src, unsigned long count) -{ - io_outsw((unsigned long) p, src, count); -} - -static inline void iowrite32_rep(void __iomem *p, const void *src, unsigned long count) -{ - __outsl_ns((unsigned long) p, src, count); -} - -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -struct pci_dev; -static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) -{ -} - - -/* - * Convert a physical pointer to a virtual kernel pointer for /dev/mem - * access - */ -#define xlate_dev_mem_ptr(p) __va(p) - -/* - * Convert a virtual cached pointer to an uncached pointer - */ -#define xlate_dev_kmem_ptr(p) p - -#endif /* __KERNEL__ */ - -#endif /* _ASM_IO_H */ diff --git a/arch/frv/include/asm/irc-regs.h b/arch/frv/include/asm/irc-regs.h deleted file mode 100644 index afa30aeacc82..000000000000 --- a/arch/frv/include/asm/irc-regs.h +++ /dev/null @@ -1,53 +0,0 @@ -/* irc-regs.h: on-chip interrupt controller registers - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_IRC_REGS -#define _ASM_IRC_REGS - -#define __reg(ADDR) (*(volatile unsigned long *)(ADDR)) - -#define __get_TM0() ({ __reg(0xfeff9800); }) -#define __get_TM1() ({ __reg(0xfeff9808); }) -#define __set_TM1(V) do { __reg(0xfeff9808) = (V); mb(); } while(0) - -#define __set_TM1x(XI,V) \ -do { \ - int shift = (XI) * 2 + 16; \ - unsigned long tm1 = __reg(0xfeff9808); \ - tm1 &= ~(0x3 << shift); \ - tm1 |= (V) << shift; \ - __reg(0xfeff9808) = tm1; \ - mb(); \ -} while(0) - -#define __get_RS(C) ({ (__reg(0xfeff9810) >> ((C)+16)) & 1; }) - -#define __clr_RC(C) do { __reg(0xfeff9818) = 1 << ((C)+16); mb(); } while(0) - -#define __get_MASK(C) ({ (__reg(0xfeff9820) >> ((C)+16)) & 1; }) -#define __set_MASK(C) do { __reg(0xfeff9820) |= 1 << ((C)+16); mb(); } while(0) -#define __clr_MASK(C) do { __reg(0xfeff9820) &= ~(1 << ((C)+16)); mb(); } while(0) - -#define __get_MASK_all() __get_MASK(0) -#define __set_MASK_all() __set_MASK(0) -#define __clr_MASK_all() __clr_MASK(0) - -#define __get_IRL() ({ (__reg(0xfeff9828) >> 16) & 0xf; }) -#define __clr_IRL() do { __reg(0xfeff9828) = 0x100000; mb(); } while(0) - -#define __get_IRR(N) ({ __reg(0xfeff9840 + (N) * 8); }) -#define __set_IRR(N,V) do { __reg(0xfeff9840 + (N) * 8) = (V); } while(0) - -#define __get_IITMR(N) ({ __reg(0xfeff9880 + (N) * 8); }) -#define __set_IITMR(N,V) do { __reg(0xfeff9880 + (N) * 8) = (V); } while(0) - - -#endif /* _ASM_IRC_REGS */ diff --git a/arch/frv/include/asm/irq.h b/arch/frv/include/asm/irq.h deleted file mode 100644 index 3a66ebd754bd..000000000000 --- a/arch/frv/include/asm/irq.h +++ /dev/null @@ -1,30 +0,0 @@ -/* irq.h: FRV IRQ definitions - * - * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_IRQ_H_ -#define _ASM_IRQ_H_ - -#define NR_IRQS 48 -#define IRQ_BASE_CPU (0 * 16) -#define IRQ_BASE_FPGA (1 * 16) -#define IRQ_BASE_MB93493 (2 * 16) - -/* probe returns a 32-bit IRQ mask:-/ */ -#define MIN_PROBE_IRQ (NR_IRQS - 32) - -#ifndef __ASSEMBLY__ -static inline int irq_canonicalize(int irq) -{ - return irq; -} -#endif - -#endif /* _ASM_IRQ_H_ */ diff --git a/arch/frv/include/asm/irq_regs.h b/arch/frv/include/asm/irq_regs.h deleted file mode 100644 index d22e83289ad1..000000000000 --- a/arch/frv/include/asm/irq_regs.h +++ /dev/null @@ -1,27 +0,0 @@ -/* FRV per-CPU frame pointer holder - * - * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_IRQ_REGS_H -#define _ASM_IRQ_REGS_H - -/* - * Per-cpu current frame pointer - the location of the last exception frame on - * the stack - * - on FRV, GR28 is dedicated to keeping a pointer to the current exception - * frame - */ -#define ARCH_HAS_OWN_IRQ_REGS - -#ifndef __ASSEMBLY__ -#define get_irq_regs() (__frame) -#endif - -#endif /* _ASM_IRQ_REGS_H */ diff --git a/arch/frv/include/asm/irqflags.h b/arch/frv/include/asm/irqflags.h deleted file mode 100644 index 82f0b5363f42..000000000000 --- a/arch/frv/include/asm/irqflags.h +++ /dev/null @@ -1,158 +0,0 @@ -/* FR-V interrupt handling - * - * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public Licence - * as published by the Free Software Foundation; either version - * 2 of the Licence, or (at your option) any later version. - */ - -#ifndef _ASM_IRQFLAGS_H -#define _ASM_IRQFLAGS_H - -/* - * interrupt flag manipulation - * - use virtual interrupt management since touching the PSR is slow - * - ICC2.Z: T if interrupts virtually disabled - * - ICC2.C: F if interrupts really disabled - * - if Z==1 upon interrupt: - * - C is set to 0 - * - interrupts are really disabled - * - entry.S returns immediately - * - uses TIHI (TRAP if Z==0 && C==0) #2 to really reenable interrupts - * - if taken, the trap: - * - sets ICC2.C - * - enables interrupts - */ -static inline void arch_local_irq_disable(void) -{ - /* set Z flag, but don't change the C flag */ - asm volatile(" andcc gr0,gr0,gr0,icc2 \n" - : - : - : "memory", "icc2" - ); -} - -static inline void arch_local_irq_enable(void) -{ - /* clear Z flag and then test the C flag */ - asm volatile(" oricc gr0,#1,gr0,icc2 \n" - " tihi icc2,gr0,#2 \n" - : - : - : "memory", "icc2" - ); -} - -static inline unsigned long arch_local_save_flags(void) -{ - unsigned long flags; - - asm volatile("movsg ccr,%0" - : "=r"(flags) - : - : "memory"); - - /* shift ICC2.Z to bit 0 */ - flags >>= 26; - - /* make flags 1 if interrupts disabled, 0 otherwise */ - return flags & 1UL; - -} - -static inline unsigned long arch_local_irq_save(void) -{ - unsigned long flags = arch_local_save_flags(); - arch_local_irq_disable(); - return flags; -} - -static inline void arch_local_irq_restore(unsigned long flags) -{ - /* load the Z flag by turning 1 if disabled into 0 if disabled - * and thus setting the Z flag but not the C flag */ - asm volatile(" xoricc %0,#1,gr0,icc2 \n" - /* then trap if Z=0 and C=0 */ - " tihi icc2,gr0,#2 \n" - : - : "r"(flags) - : "memory", "icc2" - ); - -} - -static inline bool arch_irqs_disabled_flags(unsigned long flags) -{ - return flags; -} - -static inline bool arch_irqs_disabled(void) -{ - return arch_irqs_disabled_flags(arch_local_save_flags()); -} - -/* - * real interrupt flag manipulation - */ -#define __arch_local_irq_disable() \ -do { \ - unsigned long psr; \ - asm volatile(" movsg psr,%0 \n" \ - " andi %0,%2,%0 \n" \ - " ori %0,%1,%0 \n" \ - " movgs %0,psr \n" \ - : "=r"(psr) \ - : "i" (PSR_PIL_14), "i" (~PSR_PIL) \ - : "memory"); \ -} while (0) - -#define __arch_local_irq_enable() \ -do { \ - unsigned long psr; \ - asm volatile(" movsg psr,%0 \n" \ - " andi %0,%1,%0 \n" \ - " movgs %0,psr \n" \ - : "=r"(psr) \ - : "i" (~PSR_PIL) \ - : "memory"); \ -} while (0) - -#define __arch_local_save_flags(flags) \ -do { \ - typecheck(unsigned long, flags); \ - asm("movsg psr,%0" \ - : "=r"(flags) \ - : \ - : "memory"); \ -} while (0) - -#define __arch_local_irq_save(flags) \ -do { \ - unsigned long npsr; \ - typecheck(unsigned long, flags); \ - asm volatile(" movsg psr,%0 \n" \ - " andi %0,%3,%1 \n" \ - " ori %1,%2,%1 \n" \ - " movgs %1,psr \n" \ - : "=r"(flags), "=r"(npsr) \ - : "i" (PSR_PIL_14), "i" (~PSR_PIL) \ - : "memory"); \ -} while (0) - -#define __arch_local_irq_restore(flags) \ -do { \ - typecheck(unsigned long, flags); \ - asm volatile(" movgs %0,psr \n" \ - : \ - : "r" (flags) \ - : "memory"); \ -} while (0) - -#define __arch_irqs_disabled() \ - ((__get_PSR() & PSR_PIL) >= PSR_PIL_14) - -#endif /* _ASM_IRQFLAGS_H */ diff --git a/arch/frv/include/asm/kdebug.h b/arch/frv/include/asm/kdebug.h deleted file mode 100644 index 6ece1b037665..000000000000 --- a/arch/frv/include/asm/kdebug.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/frv/include/asm/kmap_types.h b/arch/frv/include/asm/kmap_types.h deleted file mode 100644 index 0849db1362d6..000000000000 --- a/arch/frv/include/asm/kmap_types.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#ifndef _ASM_KMAP_TYPES_H -#define _ASM_KMAP_TYPES_H - -#define KM_TYPE_NR 17 - -#endif diff --git a/arch/frv/include/asm/linkage.h b/arch/frv/include/asm/linkage.h deleted file mode 100644 index 636c1bced7d4..000000000000 --- a/arch/frv/include/asm/linkage.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_LINKAGE_H -#define __ASM_LINKAGE_H - -#define __ALIGN .align 4 -#define __ALIGN_STR ".align 4" - -#endif diff --git a/arch/frv/include/asm/local.h b/arch/frv/include/asm/local.h deleted file mode 100644 index 259ae7b041a7..000000000000 --- a/arch/frv/include/asm/local.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_LOCAL_H -#define _ASM_LOCAL_H - -#include - -#endif /* _ASM_LOCAL_H */ diff --git a/arch/frv/include/asm/local64.h b/arch/frv/include/asm/local64.h deleted file mode 100644 index 36c93b5cc239..000000000000 --- a/arch/frv/include/asm/local64.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/frv/include/asm/math-emu.h b/arch/frv/include/asm/math-emu.h deleted file mode 100644 index 8af762dd6109..000000000000 --- a/arch/frv/include/asm/math-emu.h +++ /dev/null @@ -1,302 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_MATH_EMU_H -#define _ASM_MATH_EMU_H - -#include -#include - -/* Status Register bits */ - -/* accrued exception bits */ -#define FPSR_AEXC_INEX 3 -#define FPSR_AEXC_DZ 4 -#define FPSR_AEXC_UNFL 5 -#define FPSR_AEXC_OVFL 6 -#define FPSR_AEXC_IOP 7 - -/* exception status bits */ -#define FPSR_EXC_INEX1 8 -#define FPSR_EXC_INEX2 9 -#define FPSR_EXC_DZ 10 -#define FPSR_EXC_UNFL 11 -#define FPSR_EXC_OVFL 12 -#define FPSR_EXC_OPERR 13 -#define FPSR_EXC_SNAN 14 -#define FPSR_EXC_BSUN 15 - -/* quotient byte, assumes big-endian, of course */ -#define FPSR_QUOTIENT(fpsr) (*((signed char *) &(fpsr) + 1)) - -/* condition code bits */ -#define FPSR_CC_NAN 24 -#define FPSR_CC_INF 25 -#define FPSR_CC_Z 26 -#define FPSR_CC_NEG 27 - - -/* Control register bits */ - -/* rounding mode */ -#define FPCR_ROUND_RN 0 /* round to nearest/even */ -#define FPCR_ROUND_RZ 1 /* round to zero */ -#define FPCR_ROUND_RM 2 /* minus infinity */ -#define FPCR_ROUND_RP 3 /* plus infinity */ - -/* rounding precision */ -#define FPCR_PRECISION_X 0 /* long double */ -#define FPCR_PRECISION_S 1 /* double */ -#define FPCR_PRECISION_D 2 /* float */ - - -/* Flags to select the debugging output */ -#define PDECODE 0 -#define PEXECUTE 1 -#define PCONV 2 -#define PNORM 3 -#define PREGISTER 4 -#define PINSTR 5 -#define PUNIMPL 6 -#define PMOVEM 7 - -#define PMDECODE (1< -#include - -union fp_mant64 { - unsigned long long m64; - unsigned long m32[2]; -}; - -union fp_mant128 { - unsigned long long m64[2]; - unsigned long m32[4]; -}; - -/* internal representation of extended fp numbers */ -struct fp_ext { - unsigned char lowmant; - unsigned char sign; - unsigned short exp; - union fp_mant64 mant; -}; - -/* C representation of FPU registers */ -/* NOTE: if you change this, you have to change the assembler offsets - below and the size in , too */ -struct fp_data { - struct fp_ext fpreg[8]; - unsigned int fpcr; - unsigned int fpsr; - unsigned int fpiar; - unsigned short prec; - unsigned short rnd; - struct fp_ext temp[2]; -}; - -#if FPU_EMU_DEBUG -extern unsigned int fp_debugprint; - -#define dprint(bit, fmt, args...) ({ \ - if (fp_debugprint & (1 << (bit))) \ - printk(fmt, ## args); \ -}) -#else -#define dprint(bit, fmt, args...) -#endif - -#define uprint(str) ({ \ - static int __count = 3; \ - \ - if (__count > 0) { \ - printk("You just hit an unimplemented " \ - "fpu instruction (%s)\n", str); \ - printk("Please report this to ....\n"); \ - __count--; \ - } \ -}) - -#define FPDATA ((struct fp_data *)current->thread.fp) - -#else /* __ASSEMBLY__ */ - -#define FPDATA %a2 - -/* offsets from the base register to the floating point data in the task struct */ -#define FPD_FPREG (TASK_THREAD+THREAD_FPREG+0) -#define FPD_FPCR (TASK_THREAD+THREAD_FPREG+96) -#define FPD_FPSR (TASK_THREAD+THREAD_FPREG+100) -#define FPD_FPIAR (TASK_THREAD+THREAD_FPREG+104) -#define FPD_PREC (TASK_THREAD+THREAD_FPREG+108) -#define FPD_RND (TASK_THREAD+THREAD_FPREG+110) -#define FPD_TEMPFP1 (TASK_THREAD+THREAD_FPREG+112) -#define FPD_TEMPFP2 (TASK_THREAD+THREAD_FPREG+124) -#define FPD_SIZEOF (TASK_THREAD+THREAD_FPREG+136) - -/* offsets on the stack to access saved registers, - * these are only used during instruction decoding - * where we always know how deep we're on the stack. - */ -#define FPS_DO (PT_D0) -#define FPS_D1 (PT_D1) -#define FPS_D2 (PT_D2) -#define FPS_A0 (PT_A0) -#define FPS_A1 (PT_A1) -#define FPS_A2 (PT_A2) -#define FPS_SR (PT_SR) -#define FPS_PC (PT_PC) -#define FPS_EA (PT_PC+6) -#define FPS_PC2 (PT_PC+10) - -.macro fp_get_fp_reg - lea (FPD_FPREG,FPDATA,%d0.w*4),%a0 - lea (%a0,%d0.w*8),%a0 -.endm - -/* Macros used to get/put the current program counter. - * 020/030 use a different stack frame then 040/060, for the - * 040/060 the return pc points already to the next location, - * so this only needs to be modified for jump instructions. - */ -.macro fp_get_pc dest - move.l (FPS_PC+4,%sp),\dest -.endm - -.macro fp_put_pc src,jump=0 - move.l \src,(FPS_PC+4,%sp) -.endm - -.macro fp_get_instr_data f,s,dest,label - getuser \f,%sp@(FPS_PC+4)@(0),\dest,\label,%sp@(FPS_PC+4) - addq.l #\s,%sp@(FPS_PC+4) -.endm - -.macro fp_get_instr_word dest,label,addr - fp_get_instr_data w,2,\dest,\label,\addr -.endm - -.macro fp_get_instr_long dest,label,addr - fp_get_instr_data l,4,\dest,\label,\addr -.endm - -/* These macros are used to read from/write to user space - * on error we jump to the fixup section, load the fault - * address into %a0 and jump to the exit. - * (derived from ) - */ -.macro getuser size,src,dest,label,addr -| printf ,"[\size<%08x]",1,\addr -.Lu1\@: moves\size \src,\dest - - .section .fixup,"ax" - .even -.Lu2\@: move.l \addr,%a0 - jra \label - .previous - - .section __ex_table,"a" - .align 4 - .long .Lu1\@,.Lu2\@ - .previous -.endm - -.macro putuser size,src,dest,label,addr -| printf ,"[\size>%08x]",1,\addr -.Lu1\@: moves\size \src,\dest -.Lu2\@: - - .section .fixup,"ax" - .even -.Lu3\@: move.l \addr,%a0 - jra \label - .previous - - .section __ex_table,"a" - .align 4 - .long .Lu1\@,.Lu3\@ - .long .Lu2\@,.Lu3\@ - .previous -.endm - - -.macro movestack nr,arg1,arg2,arg3,arg4,arg5 - .if \nr - movestack (\nr-1),\arg2,\arg3,\arg4,\arg5 - move.l \arg1,-(%sp) - .endif -.endm - -.macro printf bit=-1,string,nr=0,arg1,arg2,arg3,arg4,arg5 -#ifdef FPU_EMU_DEBUG - .data -.Lpdata\@: - .string "\string" - .previous - - movem.l %d0/%d1/%a0/%a1,-(%sp) - .if \bit+1 -#if 0 - moveq #\bit,%d0 - andw #7,%d0 - btst %d0,fp_debugprint+((31-\bit)/8) -#else - btst #\bit,fp_debugprint+((31-\bit)/8) -#endif - jeq .Lpskip\@ - .endif - movestack \nr,\arg1,\arg2,\arg3,\arg4,\arg5 - pea .Lpdata\@ - jsr printk - lea ((\nr+1)*4,%sp),%sp -.Lpskip\@: - movem.l (%sp)+,%d0/%d1/%a0/%a1 -#endif -.endm - -.macro printx bit,fp -#ifdef FPU_EMU_DEBUG - movem.l %d0/%a0,-(%sp) - lea \fp,%a0 -#if 0 - moveq #'+',%d0 - tst.w (%a0) - jeq .Lx1\@ - moveq #'-',%d0 -.Lx1\@: printf \bit," %c",1,%d0 - move.l (4,%a0),%d0 - bclr #31,%d0 - jne .Lx2\@ - printf \bit,"0." - jra .Lx3\@ -.Lx2\@: printf \bit,"1." -.Lx3\@: printf \bit,"%08x%08x",2,%d0,%a0@(8) - move.w (2,%a0),%d0 - ext.l %d0 - printf \bit,"E%04x",1,%d0 -#else - printf \bit," %08x%08x%08x",3,%a0@,%a0@(4),%a0@(8) -#endif - movem.l (%sp)+,%d0/%a0 -#endif -.endm - -.macro debug instr,args -#ifdef FPU_EMU_DEBUG - \instr \args -#endif -.endm - - -#endif /* __ASSEMBLY__ */ - -#endif /* _ASM_FRV_MATH_EMU_H */ - diff --git a/arch/frv/include/asm/mb-regs.h b/arch/frv/include/asm/mb-regs.h deleted file mode 100644 index 219e5f926f18..000000000000 --- a/arch/frv/include/asm/mb-regs.h +++ /dev/null @@ -1,200 +0,0 @@ -/* mb-regs.h: motherboard registers - * - * Copyright (C) 2003, 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_MB_REGS_H -#define _ASM_MB_REGS_H - -#include -#include -#include - -#ifndef __ASSEMBLY__ -/* gcc builtins, annotated */ - -unsigned long __builtin_read8(volatile void __iomem *); -unsigned long __builtin_read16(volatile void __iomem *); -unsigned long __builtin_read32(volatile void __iomem *); -void __builtin_write8(volatile void __iomem *, unsigned char); -void __builtin_write16(volatile void __iomem *, unsigned short); -void __builtin_write32(volatile void __iomem *, unsigned long); -#endif - -#define __region_IO KERNEL_IO_START /* the region from 0xe0000000 to 0xffffffff has suitable - * protection laid over the top for use in memory-mapped - * I/O - */ - -#define __region_CS0 0xff000000 /* Boot ROMs area */ - -#ifdef CONFIG_MB93091_VDK -/* - * VDK motherboard and CPU card specific stuff - */ - -#include - -#define IRQ_CPU_MB93493_0 IRQ_CPU_EXTERNAL0 -#define IRQ_CPU_MB93493_1 IRQ_CPU_EXTERNAL1 - -#define __region_CS2 0xe0000000 /* SLBUS/PCI I/O space */ -#define __region_CS2_M 0x0fffffff /* mask */ -#define __region_CS2_C 0x00000000 /* control */ -#define __region_CS5 0xf0000000 /* MB93493 CSC area (DAV daughter board) */ -#define __region_CS5_M 0x00ffffff -#define __region_CS5_C 0x00010000 -#define __region_CS7 0xf1000000 /* CB70 CPU-card PCMCIA port I/O space */ -#define __region_CS7_M 0x00ffffff -#define __region_CS7_C 0x00410701 -#define __region_CS1 0xfc000000 /* SLBUS/PCI bridge control registers */ -#define __region_CS1_M 0x000fffff -#define __region_CS1_C 0x00000000 -#define __region_CS6 0xfc100000 /* CB70 CPU-card DM9000 LAN I/O space */ -#define __region_CS6_M 0x000fffff -#define __region_CS6_C 0x00400707 -#define __region_CS3 0xfc200000 /* MB93493 CSR area (DAV daughter board) */ -#define __region_CS3_M 0x000fffff -#define __region_CS3_C 0xc8100000 -#define __region_CS4 0xfd000000 /* CB70 CPU-card extra flash space */ -#define __region_CS4_M 0x00ffffff -#define __region_CS4_C 0x00000f07 - -#define __region_PCI_IO (__region_CS2 + 0x04000000UL) -#define __region_PCI_MEM (__region_CS2 + 0x08000000UL) -#define __flush_PCI_writes() \ -do { \ - __builtin_write8((volatile void __iomem *) __region_PCI_MEM, 0); \ -} while(0) - -#define __is_PCI_IO(addr) \ - (((unsigned long)(addr) >> 24) - (__region_PCI_IO >> 24) < (0x04000000UL >> 24)) - -#define __is_PCI_MEM(addr) \ - ((unsigned long)(addr) - __region_PCI_MEM < 0x08000000UL) - -#define __is_PCI_addr(addr) \ - ((unsigned long)(addr) - __region_PCI_IO < 0x0c000000UL) - -#define __get_CLKSW() ({ *(volatile unsigned long *)(__region_CS2 + 0x0130000cUL) & 0xffUL; }) -#define __get_CLKIN() (__get_CLKSW() * 125U * 100000U / 24U) - -#ifndef __ASSEMBLY__ -extern int __nongprelbss mb93090_mb00_detected; -#endif - -#define __addr_LEDS() (__region_CS2 + 0x01200004UL) -#ifdef CONFIG_MB93090_MB00 -#define __set_LEDS(X) \ -do { \ - if (mb93090_mb00_detected) \ - __builtin_write32((void __iomem *) __addr_LEDS(), ~(X)); \ -} while (0) -#else -#define __set_LEDS(X) -#endif - -#define __addr_LCD() (__region_CS2 + 0x01200008UL) -#define __get_LCD(B) __builtin_read32((volatile void __iomem *) (B)) -#define __set_LCD(B,X) __builtin_write32((volatile void __iomem *) (B), (X)) - -#define LCD_D 0x000000ff /* LCD data bus */ -#define LCD_RW 0x00000100 /* LCD R/W signal */ -#define LCD_RS 0x00000200 /* LCD Register Select */ -#define LCD_E 0x00000400 /* LCD Start Enable Signal */ - -#define LCD_CMD_CLEAR (LCD_E|0x001) -#define LCD_CMD_HOME (LCD_E|0x002) -#define LCD_CMD_CURSOR_INC (LCD_E|0x004) -#define LCD_CMD_SCROLL_INC (LCD_E|0x005) -#define LCD_CMD_CURSOR_DEC (LCD_E|0x006) -#define LCD_CMD_SCROLL_DEC (LCD_E|0x007) -#define LCD_CMD_OFF (LCD_E|0x008) -#define LCD_CMD_ON(CRSR,BLINK) (LCD_E|0x00c|(CRSR<<1)|BLINK) -#define LCD_CMD_CURSOR_MOVE_L (LCD_E|0x010) -#define LCD_CMD_CURSOR_MOVE_R (LCD_E|0x014) -#define LCD_CMD_DISPLAY_SHIFT_L (LCD_E|0x018) -#define LCD_CMD_DISPLAY_SHIFT_R (LCD_E|0x01c) -#define LCD_CMD_FUNCSET(DL,N,F) (LCD_E|0x020|(DL<<4)|(N<<3)|(F<<2)) -#define LCD_CMD_SET_CG_ADDR(X) (LCD_E|0x040|X) -#define LCD_CMD_SET_DD_ADDR(X) (LCD_E|0x080|X) -#define LCD_CMD_READ_BUSY (LCD_E|LCD_RW) -#define LCD_DATA_WRITE(X) (LCD_E|LCD_RS|(X)) -#define LCD_DATA_READ (LCD_E|LCD_RS|LCD_RW) - -#else -/* - * PDK unit specific stuff - */ - -#include - -#define IRQ_CPU_MB93493_0 IRQ_CPU_EXTERNAL0 -#define IRQ_CPU_MB93493_1 IRQ_CPU_EXTERNAL1 - -#define __region_CS5 0xf0000000 /* MB93493 CSC area (DAV daughter board) */ -#define __region_CS5_M 0x00ffffff /* mask */ -#define __region_CS5_C 0x00010000 /* control */ -#define __region_CS2 0x20000000 /* FPGA registers */ -#define __region_CS2_M 0x000fffff -#define __region_CS2_C 0x00000000 -#define __region_CS1 0xfc100000 /* LAN registers */ -#define __region_CS1_M 0x000fffff -#define __region_CS1_C 0x00010404 -#define __region_CS3 0xfc200000 /* MB93493 CSR area (DAV daughter board) */ -#define __region_CS3_M 0x000fffff -#define __region_CS3_C 0xc8000000 -#define __region_CS4 0xfd000000 /* extra ROMs area */ -#define __region_CS4_M 0x00ffffff -#define __region_CS4_C 0x00000f07 - -#define __region_CS6 0xfe000000 /* not used - hide behind CPU resource I/O regs */ -#define __region_CS6_M 0x000fffff -#define __region_CS6_C 0x00000f07 -#define __region_CS7 0xfe000000 /* not used - hide behind CPU resource I/O regs */ -#define __region_CS7_M 0x000fffff -#define __region_CS7_C 0x00000f07 - -#define __is_PCI_IO(addr) 0 /* no PCI */ -#define __is_PCI_MEM(addr) 0 -#define __is_PCI_addr(addr) 0 -#define __region_PCI_IO 0 -#define __region_PCI_MEM 0 -#define __flush_PCI_writes() do { } while(0) - -#define __get_CLKSW() 0UL -#define __get_CLKIN() 66000000UL - -#define __addr_LEDS() (__region_CS2 + 0x00000023UL) -#define __set_LEDS(X) __builtin_write8((volatile void __iomem *) __addr_LEDS(), (X)) - -#define __addr_FPGATR() (__region_CS2 + 0x00000030UL) -#define __set_FPGATR(X) __builtin_write32((volatile void __iomem *) __addr_FPGATR(), (X)) -#define __get_FPGATR() __builtin_read32((volatile void __iomem *) __addr_FPGATR()) - -#define MB93093_FPGA_FPGATR_AUDIO_CLK 0x00000003 - -#define __set_FPGATR_AUDIO_CLK(V) \ - __set_FPGATR((__get_FPGATR() & ~MB93093_FPGA_FPGATR_AUDIO_CLK) | (V)) - -#define MB93093_FPGA_FPGATR_AUDIO_CLK_OFF 0x0 -#define MB93093_FPGA_FPGATR_AUDIO_CLK_11MHz 0x1 -#define MB93093_FPGA_FPGATR_AUDIO_CLK_12MHz 0x2 -#define MB93093_FPGA_FPGATR_AUDIO_CLK_02MHz 0x3 - -#define MB93093_FPGA_SWR_PUSHSWMASK (0x1F<<26) -#define MB93093_FPGA_SWR_PUSHSW4 (1<<29) - -#define __addr_FPGA_SWR ((volatile void __iomem *)(__region_CS2 + 0x28UL)) -#define __get_FPGA_PUSHSW1_5() (__builtin_read32(__addr_FPGA_SWR) & MB93093_FPGA_SWR_PUSHSWMASK) - - -#endif - -#endif /* _ASM_MB_REGS_H */ diff --git a/arch/frv/include/asm/mb86943a.h b/arch/frv/include/asm/mb86943a.h deleted file mode 100644 index e87ef924bfb4..000000000000 --- a/arch/frv/include/asm/mb86943a.h +++ /dev/null @@ -1,42 +0,0 @@ -/* mb86943a.h: MB86943 SPARClite <-> PCI bridge registers - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_MB86943A_H -#define _ASM_MB86943A_H - -#include - -#define __reg_MB86943_sl_ctl *(volatile uint32_t *) (__region_CS1 + 0x00) - -#define MB86943_SL_CTL_BUS_WIDTH_64 0x00000001 -#define MB86943_SL_CTL_AS_HOST 0x00000002 -#define MB86943_SL_CTL_DRCT_MASTER_SWAP 0x00000004 -#define MB86943_SL_CTL_DRCT_SLAVE_SWAP 0x00000008 -#define MB86943_SL_CTL_PCI_CONFIG_SWAP 0x00000010 -#define MB86943_SL_CTL_ECS0_ENABLE 0x00000020 -#define MB86943_SL_CTL_ECS1_ENABLE 0x00000040 -#define MB86943_SL_CTL_ECS2_ENABLE 0x00000080 - -#define __reg_MB86943_ecs_ctl(N) *(volatile uint32_t *) (__region_CS1 + 0x08 + (0x08*(N))) -#define __reg_MB86943_ecs_range(N) *(volatile uint32_t *) (__region_CS1 + 0x20 + (0x10*(N))) -#define __reg_MB86943_ecs_base(N) *(volatile uint32_t *) (__region_CS1 + 0x28 + (0x10*(N))) - -#define __reg_MB86943_sl_pci_io_range *(volatile uint32_t *) (__region_CS1 + 0x50) -#define __reg_MB86943_sl_pci_io_base *(volatile uint32_t *) (__region_CS1 + 0x58) -#define __reg_MB86943_sl_pci_mem_range *(volatile uint32_t *) (__region_CS1 + 0x60) -#define __reg_MB86943_sl_pci_mem_base *(volatile uint32_t *) (__region_CS1 + 0x68) -#define __reg_MB86943_pci_sl_io_base *(volatile uint32_t *) (__region_CS1 + 0x70) -#define __reg_MB86943_pci_sl_mem_base *(volatile uint32_t *) (__region_CS1 + 0x78) - -#define __reg_MB86943_pci_arbiter *(volatile uint32_t *) (__region_CS2 + 0x01300014) -#define MB86943_PCIARB_EN 0x00000001 - -#endif /* _ASM_MB86943A_H */ diff --git a/arch/frv/include/asm/mb93091-fpga-irqs.h b/arch/frv/include/asm/mb93091-fpga-irqs.h deleted file mode 100644 index 19778c5ba9d6..000000000000 --- a/arch/frv/include/asm/mb93091-fpga-irqs.h +++ /dev/null @@ -1,42 +0,0 @@ -/* mb93091-fpga-irqs.h: MB93091 CPU board FPGA IRQs - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_MB93091_FPGA_IRQS_H -#define _ASM_MB93091_FPGA_IRQS_H - -#include - -#ifndef __ASSEMBLY__ - -/* IRQ IDs presented to drivers */ -enum { - IRQ_FPGA__UNUSED = IRQ_BASE_FPGA, - IRQ_FPGA_SYSINT_BUS_EXPANSION_1, - IRQ_FPGA_SL_BUS_EXPANSION_2, - IRQ_FPGA_PCI_INTD, - IRQ_FPGA_PCI_INTC, - IRQ_FPGA_PCI_INTB, - IRQ_FPGA_PCI_INTA, - IRQ_FPGA_SL_BUS_EXPANSION_7, - IRQ_FPGA_SYSINT_BUS_EXPANSION_8, - IRQ_FPGA_SL_BUS_EXPANSION_9, - IRQ_FPGA_MB86943_PCI_INTA, - IRQ_FPGA_MB86943_SLBUS_SIDE, - IRQ_FPGA_RTL8029_INTA, - IRQ_FPGA_SYSINT_BUS_EXPANSION_13, - IRQ_FPGA_SL_BUS_EXPANSION_14, - IRQ_FPGA_NMI, -}; - - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ASM_MB93091_FPGA_IRQS_H */ diff --git a/arch/frv/include/asm/mb93093-fpga-irqs.h b/arch/frv/include/asm/mb93093-fpga-irqs.h deleted file mode 100644 index 590266b1a6d3..000000000000 --- a/arch/frv/include/asm/mb93093-fpga-irqs.h +++ /dev/null @@ -1,29 +0,0 @@ -/* mb93093-fpga-irqs.h: MB93093 CPU board FPGA IRQs - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_MB93093_FPGA_IRQS_H -#define _ASM_MB93093_FPGA_IRQS_H - -#include - -#ifndef __ASSEMBLY__ - -/* IRQ IDs presented to drivers */ -enum { - IRQ_FPGA_PUSH_BUTTON_SW1_5 = IRQ_BASE_FPGA + 8, - IRQ_FPGA_ROCKER_C_SW8 = IRQ_BASE_FPGA + 9, - IRQ_FPGA_ROCKER_C_SW9 = IRQ_BASE_FPGA + 10, -}; - - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ASM_MB93093_FPGA_IRQS_H */ diff --git a/arch/frv/include/asm/mb93493-irqs.h b/arch/frv/include/asm/mb93493-irqs.h deleted file mode 100644 index 82c7aeddd333..000000000000 --- a/arch/frv/include/asm/mb93493-irqs.h +++ /dev/null @@ -1,50 +0,0 @@ -/* mb93493-irqs.h: MB93493 companion chip IRQs - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_MB93493_IRQS_H -#define _ASM_MB93493_IRQS_H - -#include - -#ifndef __ASSEMBLY__ - -/* IRQ IDs presented to drivers */ -enum { - IRQ_MB93493_VDC = IRQ_BASE_MB93493 + 0, - IRQ_MB93493_VCC = IRQ_BASE_MB93493 + 1, - IRQ_MB93493_AUDIO_OUT = IRQ_BASE_MB93493 + 2, - IRQ_MB93493_I2C_0 = IRQ_BASE_MB93493 + 3, - IRQ_MB93493_I2C_1 = IRQ_BASE_MB93493 + 4, - IRQ_MB93493_USB = IRQ_BASE_MB93493 + 5, - IRQ_MB93493_LOCAL_BUS = IRQ_BASE_MB93493 + 7, - IRQ_MB93493_PCMCIA = IRQ_BASE_MB93493 + 8, - IRQ_MB93493_GPIO = IRQ_BASE_MB93493 + 9, - IRQ_MB93493_AUDIO_IN = IRQ_BASE_MB93493 + 10, -}; - -/* IRQ multiplexor mappings */ -#define ROUTE_VIA_IRQ0 0 /* route IRQ by way of CPU external IRQ 0 */ -#define ROUTE_VIA_IRQ1 1 /* route IRQ by way of CPU external IRQ 1 */ - -#define IRQ_MB93493_VDC_ROUTE ROUTE_VIA_IRQ0 -#define IRQ_MB93493_VCC_ROUTE ROUTE_VIA_IRQ1 -#define IRQ_MB93493_AUDIO_OUT_ROUTE ROUTE_VIA_IRQ1 -#define IRQ_MB93493_I2C_0_ROUTE ROUTE_VIA_IRQ1 -#define IRQ_MB93493_I2C_1_ROUTE ROUTE_VIA_IRQ1 -#define IRQ_MB93493_USB_ROUTE ROUTE_VIA_IRQ1 -#define IRQ_MB93493_LOCAL_BUS_ROUTE ROUTE_VIA_IRQ1 -#define IRQ_MB93493_PCMCIA_ROUTE ROUTE_VIA_IRQ1 -#define IRQ_MB93493_GPIO_ROUTE ROUTE_VIA_IRQ1 -#define IRQ_MB93493_AUDIO_IN_ROUTE ROUTE_VIA_IRQ1 - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ASM_MB93493_IRQS_H */ diff --git a/arch/frv/include/asm/mb93493-regs.h b/arch/frv/include/asm/mb93493-regs.h deleted file mode 100644 index 8a1f6aac8cf1..000000000000 --- a/arch/frv/include/asm/mb93493-regs.h +++ /dev/null @@ -1,281 +0,0 @@ -/* mb93493-regs.h: MB93493 companion chip registers - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_MB93493_REGS_H -#define _ASM_MB93493_REGS_H - -#include -#include - -#define __addr_MB93493(X) ((volatile unsigned long *)(__region_CS3 + (X))) -#define __get_MB93493(X) ({ *(volatile unsigned long *)(__region_CS3 + (X)); }) - -#define __set_MB93493(X,V) \ -do { \ - *(volatile unsigned long *)(__region_CS3 + (X)) = (V); mb(); \ -} while(0) - -#define __get_MB93493_STSR(X) __get_MB93493(0x3c0 + (X) * 4) -#define __set_MB93493_STSR(X,V) __set_MB93493(0x3c0 + (X) * 4, (V)) -#define MB93493_STSR_EN - -#define __addr_MB93493_IQSR(X) __addr_MB93493(0x3d0 + (X) * 4) -#define __get_MB93493_IQSR(X) __get_MB93493(0x3d0 + (X) * 4) -#define __set_MB93493_IQSR(X,V) __set_MB93493(0x3d0 + (X) * 4, (V)) - -#define __get_MB93493_DQSR(X) __get_MB93493(0x3e0 + (X) * 4) -#define __set_MB93493_DQSR(X,V) __set_MB93493(0x3e0 + (X) * 4, (V)) - -#define __get_MB93493_LBSER() __get_MB93493(0x3f0) -#define __set_MB93493_LBSER(V) __set_MB93493(0x3f0, (V)) - -#define MB93493_LBSER_VDC 0x00010000 -#define MB93493_LBSER_VCC 0x00020000 -#define MB93493_LBSER_AUDIO 0x00040000 -#define MB93493_LBSER_I2C_0 0x00080000 -#define MB93493_LBSER_I2C_1 0x00100000 -#define MB93493_LBSER_USB 0x00200000 -#define MB93493_LBSER_GPIO 0x00800000 -#define MB93493_LBSER_PCMCIA 0x01000000 - -#define __get_MB93493_LBSR() __get_MB93493(0x3fc) -#define __set_MB93493_LBSR(V) __set_MB93493(0x3fc, (V)) - -/* - * video display controller - */ -#define __get_MB93493_VDC(X) __get_MB93493(MB93493_VDC_##X) -#define __set_MB93493_VDC(X,V) __set_MB93493(MB93493_VDC_##X, (V)) - -#define MB93493_VDC_RCURSOR 0x140 /* cursor position */ -#define MB93493_VDC_RCT1 0x144 /* cursor colour 1 */ -#define MB93493_VDC_RCT2 0x148 /* cursor colour 2 */ -#define MB93493_VDC_RHDC 0x150 /* horizontal display period */ -#define MB93493_VDC_RH_MARGINS 0x154 /* horizontal margin sizes */ -#define MB93493_VDC_RVDC 0x158 /* vertical display period */ -#define MB93493_VDC_RV_MARGINS 0x15c /* vertical margin sizes */ -#define MB93493_VDC_RC 0x170 /* VDC control */ -#define MB93493_VDC_RCLOCK 0x174 /* clock divider, DMA req delay */ -#define MB93493_VDC_RBLACK 0x178 /* black insert sizes */ -#define MB93493_VDC_RS 0x17c /* VDC status */ - -#define __addr_MB93493_VDC_BCI(X) ({ (volatile unsigned long *)(__region_CS3 + 0x000 + (X)); }) -#define __addr_MB93493_VDC_TPO(X) (__region_CS3 + 0x1c0 + (X)) - -#define VDC_TPO_WIDTH 32 - -#define VDC_RC_DSR 0x00000080 /* VDC master reset */ - -#define VDC_RS_IT 0x00060000 /* interrupt indicators */ -#define VDC_RS_IT_UNDERFLOW 0x00040000 /* - underflow event */ -#define VDC_RS_IT_VSYNC 0x00020000 /* - VSYNC event */ -#define VDC_RS_DFI 0x00010000 /* current interlace field number */ -#define VDC_RS_DFI_TOP 0x00000000 /* - top field */ -#define VDC_RS_DFI_BOTTOM 0x00010000 /* - bottom field */ -#define VDC_RS_DCSR 0x00000010 /* cursor state */ -#define VDC_RS_DCM 0x00000003 /* display mode */ -#define VDC_RS_DCM_DISABLED 0x00000000 /* - display disabled */ -#define VDC_RS_DCM_STOPPED 0x00000001 /* - VDC stopped */ -#define VDC_RS_DCM_FREERUNNING 0x00000002 /* - VDC free-running */ -#define VDC_RS_DCM_TRANSFERRING 0x00000003 /* - data being transferred to VDC */ - -/* - * video capture controller - */ -#define __get_MB93493_VCC(X) __get_MB93493(MB93493_VCC_##X) -#define __set_MB93493_VCC(X,V) __set_MB93493(MB93493_VCC_##X, (V)) - -#define MB93493_VCC_RREDUCT 0x104 /* reduction rate */ -#define MB93493_VCC_RHY 0x108 /* horizontal brightness filter coefficients */ -#define MB93493_VCC_RHC 0x10c /* horizontal colour-difference filter coefficients */ -#define MB93493_VCC_RHSIZE 0x110 /* horizontal cycle sizes */ -#define MB93493_VCC_RHBC 0x114 /* horizontal back porch size */ -#define MB93493_VCC_RVCC 0x118 /* vertical capture period */ -#define MB93493_VCC_RVBC 0x11c /* vertical back porch period */ -#define MB93493_VCC_RV 0x120 /* vertical filter coefficients */ -#define MB93493_VCC_RDTS 0x128 /* DMA transfer size */ -#define MB93493_VCC_RDTS_4B 0x01000000 /* 4-byte transfer */ -#define MB93493_VCC_RDTS_32B 0x03000000 /* 32-byte transfer */ -#define MB93493_VCC_RDTS_SHIFT 24 -#define MB93493_VCC_RCC 0x130 /* VCC control */ -#define MB93493_VCC_RIS 0x134 /* VCC interrupt status */ - -#define __addr_MB93493_VCC_TPI(X) (__region_CS3 + 0x180 + (X)) - -#define VCC_RHSIZE_RHCC 0x000007ff -#define VCC_RHSIZE_RHCC_SHIFT 0 -#define VCC_RHSIZE_RHTCC 0x0fff0000 -#define VCC_RHSIZE_RHTCC_SHIFT 16 - -#define VCC_RVBC_RVBC 0x00003f00 -#define VCC_RVBC_RVBC_SHIFT 8 - -#define VCC_RREDUCT_RHR 0x07ff0000 -#define VCC_RREDUCT_RHR_SHIFT 16 -#define VCC_RREDUCT_RVR 0x000007ff -#define VCC_RREDUCT_RVR_SHIFT 0 - -#define VCC_RCC_CE 0x00000001 /* VCC enable */ -#define VCC_RCC_CS 0x00000002 /* request video capture start */ -#define VCC_RCC_CPF 0x0000000c /* pixel format */ -#define VCC_RCC_CPF_YCBCR_16 0x00000000 /* - YCbCr 4:2:2 16-bit format */ -#define VCC_RCC_CPF_RGB 0x00000004 /* - RGB 4:4:4 format */ -#define VCC_RCC_CPF_YCBCR_24 0x00000008 /* - YCbCr 4:2:2 24-bit format */ -#define VCC_RCC_CPF_BT656 0x0000000c /* - ITU R-BT.656 format */ -#define VCC_RCC_CPF_SHIFT 2 -#define VCC_RCC_CSR 0x00000080 /* request reset */ -#define VCC_RCC_HSIP 0x00000100 /* HSYNC polarity */ -#define VCC_RCC_HSIP_LOACT 0x00000000 /* - low active */ -#define VCC_RCC_HSIP_HIACT 0x00000100 /* - high active */ -#define VCC_RCC_VSIP 0x00000200 /* VSYNC polarity */ -#define VCC_RCC_VSIP_LOACT 0x00000000 /* - low active */ -#define VCC_RCC_VSIP_HIACT 0x00000200 /* - high active */ -#define VCC_RCC_CIE 0x00000800 /* interrupt enable */ -#define VCC_RCC_CFP 0x00001000 /* RGB pixel packing */ -#define VCC_RCC_CFP_4TO3 0x00000000 /* - pack 4 pixels into 3 words */ -#define VCC_RCC_CFP_1TO1 0x00001000 /* - pack 1 pixel into 1 words */ -#define VCC_RCC_CSM 0x00006000 /* interlace specification */ -#define VCC_RCC_CSM_ONEPASS 0x00002000 /* - non-interlaced */ -#define VCC_RCC_CSM_INTERLACE 0x00004000 /* - interlaced */ -#define VCC_RCC_CSM_SHIFT 13 -#define VCC_RCC_ES 0x00008000 /* capture start polarity */ -#define VCC_RCC_ES_NEG 0x00000000 /* - negative edge */ -#define VCC_RCC_ES_POS 0x00008000 /* - positive edge */ -#define VCC_RCC_IFI 0x00080000 /* inferlace field evaluation reverse */ -#define VCC_RCC_FDTS 0x00300000 /* interlace field start */ -#define VCC_RCC_FDTS_3_8 0x00000000 /* - 3/8 of horizontal entire cycle */ -#define VCC_RCC_FDTS_1_4 0x00100000 /* - 1/4 of horizontal entire cycle */ -#define VCC_RCC_FDTS_7_16 0x00200000 /* - 7/16 of horizontal entire cycle */ -#define VCC_RCC_FDTS_SHIFT 20 -#define VCC_RCC_MOV 0x00400000 /* test bit - always set to 1 */ -#define VCC_RCC_STP 0x00800000 /* request video capture stop */ -#define VCC_RCC_TO 0x01000000 /* input during top-field only */ - -#define VCC_RIS_VSYNC 0x01000000 /* VSYNC interrupt */ -#define VCC_RIS_OV 0x02000000 /* overflow interrupt */ -#define VCC_RIS_BOTTOM 0x08000000 /* interlace bottom field */ -#define VCC_RIS_STARTED 0x10000000 /* capture started */ - -/* - * I2C - */ -#define MB93493_I2C_BSR 0x340 /* bus status */ -#define MB93493_I2C_BCR 0x344 /* bus control */ -#define MB93493_I2C_CCR 0x348 /* clock control */ -#define MB93493_I2C_ADR 0x34c /* address */ -#define MB93493_I2C_DTR 0x350 /* data */ -#define MB93493_I2C_BC2R 0x35c /* bus control 2 */ - -#define __addr_MB93493_I2C(port,X) (__region_CS3 + MB93493_I2C_##X + ((port)*0x20)) -#define __get_MB93493_I2C(port,X) __get_MB93493(MB93493_I2C_##X + ((port)*0x20)) -#define __set_MB93493_I2C(port,X,V) __set_MB93493(MB93493_I2C_##X + ((port)*0x20), (V)) - -#define I2C_BSR_BB (1 << 7) - -/* - * audio controller (I2S) registers - */ -#define __get_MB93493_I2S(X) __get_MB93493(MB93493_I2S_##X) -#define __set_MB93493_I2S(X,V) __set_MB93493(MB93493_I2S_##X, (V)) - -#define MB93493_I2S_ALDR 0x300 /* L-channel data */ -#define MB93493_I2S_ARDR 0x304 /* R-channel data */ -#define MB93493_I2S_APDR 0x308 /* 16-bit packed data */ -#define MB93493_I2S_AISTR 0x310 /* status */ -#define MB93493_I2S_AICR 0x314 /* control */ - -#define __addr_MB93493_I2S_ALDR(X) (__region_CS3 + MB93493_I2S_ALDR + (X)) -#define __addr_MB93493_I2S_ARDR(X) (__region_CS3 + MB93493_I2S_ARDR + (X)) -#define __addr_MB93493_I2S_APDR(X) (__region_CS3 + MB93493_I2S_APDR + (X)) -#define __addr_MB93493_I2S_ADR(X) (__region_CS3 + 0x320 + (X)) - -#define I2S_AISTR_OTST 0x00000003 /* status of output data transfer */ -#define I2S_AISTR_OTR 0x00000010 /* output transfer request pending */ -#define I2S_AISTR_OUR 0x00000020 /* output FIFO underrun detected */ -#define I2S_AISTR_OOR 0x00000040 /* output FIFO overrun detected */ -#define I2S_AISTR_ODS 0x00000100 /* output DMA transfer size */ -#define I2S_AISTR_ODE 0x00000400 /* output DMA transfer request enable */ -#define I2S_AISTR_OTRIE 0x00001000 /* output transfer request interrupt enable */ -#define I2S_AISTR_OURIE 0x00002000 /* output FIFO underrun interrupt enable */ -#define I2S_AISTR_OORIE 0x00004000 /* output FIFO overrun interrupt enable */ -#define I2S_AISTR__OUT_MASK 0x00007570 -#define I2S_AISTR_ITST 0x00030000 /* status of input data transfer */ -#define I2S_AISTR_ITST_SHIFT 16 -#define I2S_AISTR_ITR 0x00100000 /* input transfer request pending */ -#define I2S_AISTR_IUR 0x00200000 /* input FIFO underrun detected */ -#define I2S_AISTR_IOR 0x00400000 /* input FIFO overrun detected */ -#define I2S_AISTR_IDS 0x01000000 /* input DMA transfer size */ -#define I2S_AISTR_IDE 0x04000000 /* input DMA transfer request enable */ -#define I2S_AISTR_ITRIE 0x10000000 /* input transfer request interrupt enable */ -#define I2S_AISTR_IURIE 0x20000000 /* input FIFO underrun interrupt enable */ -#define I2S_AISTR_IORIE 0x40000000 /* input FIFO overrun interrupt enable */ -#define I2S_AISTR__IN_MASK 0x75700000 - -#define I2S_AICR_MI 0x00000001 /* mono input requested */ -#define I2S_AICR_AMI 0x00000002 /* relation between LRCKI/FS1 and SDI */ -#define I2S_AICR_LRI 0x00000004 /* function of LRCKI pin */ -#define I2S_AICR_SDMI 0x00000070 /* format of input audio data */ -#define I2S_AICR_SDMI_SHIFT 4 -#define I2S_AICR_CLI 0x00000080 /* input FIFO clearing control */ -#define I2S_AICR_IM 0x00000300 /* input state control */ -#define I2S_AICR_IM_SHIFT 8 -#define I2S_AICR__IN_MASK 0x000003f7 -#define I2S_AICR_MO 0x00001000 /* mono output requested */ -#define I2S_AICR_AMO 0x00002000 /* relation between LRCKO/FS0 and SDO */ -#define I2S_AICR_AMO_SHIFT 13 -#define I2S_AICR_LRO 0x00004000 /* function of LRCKO pin */ -#define I2S_AICR_SDMO 0x00070000 /* format of output audio data */ -#define I2S_AICR_SDMO_SHIFT 16 -#define I2S_AICR_CLO 0x00080000 /* output FIFO clearing control */ -#define I2S_AICR_OM 0x00100000 /* output state control */ -#define I2S_AICR__OUT_MASK 0x001f7000 -#define I2S_AICR_DIV 0x03000000 /* frequency division rate */ -#define I2S_AICR_DIV_SHIFT 24 -#define I2S_AICR_FL 0x20000000 /* frame length */ -#define I2S_AICR_FS 0x40000000 /* frame sync method */ -#define I2S_AICR_ME 0x80000000 /* master enable */ - -/* - * PCMCIA - */ -#define __addr_MB93493_PCMCIA(X) ((volatile unsigned long *)(__region_CS5 + (X))) - -/* - * GPIO - */ -#define __get_MB93493_GPIO_PDR(X) __get_MB93493(0x380 + (X) * 0xc0) -#define __set_MB93493_GPIO_PDR(X,V) __set_MB93493(0x380 + (X) * 0xc0, (V)) - -#define __get_MB93493_GPIO_GPDR(X) __get_MB93493(0x384 + (X) * 0xc0) -#define __set_MB93493_GPIO_GPDR(X,V) __set_MB93493(0x384 + (X) * 0xc0, (V)) - -#define __get_MB93493_GPIO_SIR(X) __get_MB93493(0x388 + (X) * 0xc0) -#define __set_MB93493_GPIO_SIR(X,V) __set_MB93493(0x388 + (X) * 0xc0, (V)) - -#define __get_MB93493_GPIO_SOR(X) __get_MB93493(0x38c + (X) * 0xc0) -#define __set_MB93493_GPIO_SOR(X,V) __set_MB93493(0x38c + (X) * 0xc0, (V)) - -#define __get_MB93493_GPIO_PDSR(X) __get_MB93493(0x390 + (X) * 0xc0) -#define __set_MB93493_GPIO_PDSR(X,V) __set_MB93493(0x390 + (X) * 0xc0, (V)) - -#define __get_MB93493_GPIO_PDCR(X) __get_MB93493(0x394 + (X) * 0xc0) -#define __set_MB93493_GPIO_PDCR(X,V) __set_MB93493(0x394 + (X) * 0xc0, (V)) - -#define __get_MB93493_GPIO_INTST(X) __get_MB93493(0x398 + (X) * 0xc0) -#define __set_MB93493_GPIO_INTST(X,V) __set_MB93493(0x398 + (X) * 0xc0, (V)) - -#define __get_MB93493_GPIO_IEHL(X) __get_MB93493(0x39c + (X) * 0xc0) -#define __set_MB93493_GPIO_IEHL(X,V) __set_MB93493(0x39c + (X) * 0xc0, (V)) - -#define __get_MB93493_GPIO_IELH(X) __get_MB93493(0x3a0 + (X) * 0xc0) -#define __set_MB93493_GPIO_IELH(X,V) __set_MB93493(0x3a0 + (X) * 0xc0, (V)) - -#endif /* _ASM_MB93493_REGS_H */ diff --git a/arch/frv/include/asm/mem-layout.h b/arch/frv/include/asm/mem-layout.h deleted file mode 100644 index e9a0ec85a402..000000000000 --- a/arch/frv/include/asm/mem-layout.h +++ /dev/null @@ -1,86 +0,0 @@ -/* mem-layout.h: memory layout - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_MEM_LAYOUT_H -#define _ASM_MEM_LAYOUT_H - -#ifndef __ASSEMBLY__ -#define __UL(X) ((unsigned long) (X)) -#else -#define __UL(X) (X) -#endif - -/* - * PAGE_SHIFT determines the page size - */ -#define PAGE_SHIFT 14 - -#ifndef __ASSEMBLY__ -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#else -#define PAGE_SIZE (1 << PAGE_SHIFT) -#endif - -#define PAGE_MASK (~(PAGE_SIZE-1)) - -/* - * the slab must be aligned such that load- and store-double instructions don't - * fault if used - */ -#define ARCH_DMA_MINALIGN L1_CACHE_BYTES -#define ARCH_SLAB_MINALIGN L1_CACHE_BYTES - -/*****************************************************************************/ -/* - * virtual memory layout from kernel's point of view - */ -#define PAGE_OFFSET ((unsigned long) &__page_offset) - -#ifdef CONFIG_MMU - -/* see Documentation/frv/mmu-layout.txt */ -#define KERNEL_LOWMEM_START __UL(0xc0000000) -#define KERNEL_LOWMEM_END __UL(0xd0000000) -#define VMALLOC_START __UL(0xd0000000) -#define VMALLOC_END __UL(0xd8000000) -#define PKMAP_BASE __UL(0xd8000000) -#define PKMAP_END __UL(0xdc000000) -#define KMAP_ATOMIC_SECONDARY_FRAME __UL(0xdc000000) -#define KMAP_ATOMIC_PRIMARY_FRAME __UL(0xdd000000) - -#endif - -#define KERNEL_IO_START __UL(0xe0000000) - - -/*****************************************************************************/ -/* - * memory layout from userspace's point of view - */ -#define BRK_BASE __UL(2 * 1024 * 1024 + PAGE_SIZE) -#define STACK_TOP __UL(2 * 1024 * 1024) -#define STACK_TOP_MAX __UL(0xc0000000) - -/* userspace process size */ -#ifdef CONFIG_MMU -#define TASK_SIZE (PAGE_OFFSET) -#else -#define TASK_SIZE __UL(0xFFFFFFFFUL) -#endif - -/* base of area at which unspecified mmaps will start */ -#ifdef CONFIG_BINFMT_ELF_FDPIC -#define TASK_UNMAPPED_BASE __UL(16 * 1024 * 1024) -#else -#define TASK_UNMAPPED_BASE __UL(TASK_SIZE / 3) -#endif - -#endif /* _ASM_MEM_LAYOUT_H */ diff --git a/arch/frv/include/asm/mmu.h b/arch/frv/include/asm/mmu.h deleted file mode 100644 index 86ca0e86e7d2..000000000000 --- a/arch/frv/include/asm/mmu.h +++ /dev/null @@ -1,41 +0,0 @@ -/* mmu.h: memory management context for FR-V with or without MMU support - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_MMU_H -#define _ASM_MMU_H - -typedef struct { -#ifdef CONFIG_MMU - struct list_head id_link; /* link in list of context ID owners */ - unsigned short id; /* MMU context ID */ - unsigned short id_busy; /* true if ID is in CXNR */ - unsigned long itlb_cached_pge; /* [SCR0] PGE cached for insn TLB handler */ - unsigned long itlb_ptd_mapping; /* [DAMR4] PTD mapping for itlb cached PGE */ - unsigned long dtlb_cached_pge; /* [SCR1] PGE cached for data TLB handler */ - unsigned long dtlb_ptd_mapping; /* [DAMR5] PTD mapping for dtlb cached PGE */ - -#else - unsigned long end_brk; - -#endif - -#ifdef CONFIG_BINFMT_ELF_FDPIC - unsigned long exec_fdpic_loadmap; - unsigned long interp_fdpic_loadmap; -#endif - -} mm_context_t; - -#ifdef CONFIG_MMU -extern int __nongpreldata cxn_pinned; -extern int cxn_pin_by_pid(pid_t pid); -#endif - -#endif /* _ASM_MMU_H */ diff --git a/arch/frv/include/asm/mmu_context.h b/arch/frv/include/asm/mmu_context.h deleted file mode 100644 index c7daa395156a..000000000000 --- a/arch/frv/include/asm/mmu_context.h +++ /dev/null @@ -1,50 +0,0 @@ -/* mmu_context.h: MMU context management routines - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_MMU_CONTEXT_H -#define _ASM_MMU_CONTEXT_H - -#include -#include -#include -#include - -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) -{ -} - -#ifdef CONFIG_MMU -extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); -extern void change_mm_context(mm_context_t *old, mm_context_t *ctx, pgd_t *_pgd); -extern void destroy_context(struct mm_struct *mm); - -#else -#define init_new_context(tsk, mm) ({ 0; }) -#define change_mm_context(old, ctx, _pml4) do {} while(0) -#define destroy_context(mm) do {} while(0) -#endif - -#define switch_mm(prev, next, tsk) \ -do { \ - if (prev != next) \ - change_mm_context(&prev->context, &next->context, next->pgd); \ -} while(0) - -#define activate_mm(prev, next) \ -do { \ - change_mm_context(&prev->context, &next->context, next->pgd); \ -} while(0) - -#define deactivate_mm(tsk, mm) \ -do { \ -} while(0) - -#endif diff --git a/arch/frv/include/asm/module.h b/arch/frv/include/asm/module.h deleted file mode 100644 index a8848f09a217..000000000000 --- a/arch/frv/include/asm/module.h +++ /dev/null @@ -1,22 +0,0 @@ -/* module.h: FRV module stuff - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_MODULE_H -#define _ASM_MODULE_H - -#include - -/* - * Include the architecture version. - */ -#define MODULE_ARCH_VERMAGIC __stringify(PROCESSOR_MODEL_NAME) " " - -#endif /* _ASM_MODULE_H */ - diff --git a/arch/frv/include/asm/page.h b/arch/frv/include/asm/page.h deleted file mode 100644 index 0f76a0d586f6..000000000000 --- a/arch/frv/include/asm/page.h +++ /dev/null @@ -1,74 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_PAGE_H -#define _ASM_PAGE_H - -#include -#include -#include -#include - -#ifndef __ASSEMBLY__ - -#define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE) -#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE) - -#define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE) -#define copy_user_page(vto, vfrom, vaddr, topg) memcpy((vto), (vfrom), PAGE_SIZE) - -/* - * These are used to make use of C type-checking.. - */ -typedef struct { unsigned long pte; } pte_t; -typedef struct { unsigned long ste[64];} pmd_t; -typedef struct { pmd_t pue[1]; } pud_t; -typedef struct { pud_t pge[1]; } pgd_t; -typedef struct { unsigned long pgprot; } pgprot_t; -typedef struct page *pgtable_t; - -#define pte_val(x) ((x).pte) -#define pmd_val(x) ((x).ste[0]) -#define pud_val(x) ((x).pue[0]) -#define pgd_val(x) ((x).pge[0]) -#define pgprot_val(x) ((x).pgprot) - -#define __pte(x) ((pte_t) { (x) } ) -#define __pmd(x) ((pmd_t) { { (x) } } ) -#define __pud(x) ((pud_t) { (x) } ) -#define __pgd(x) ((pgd_t) { (x) } ) -#define __pgprot(x) ((pgprot_t) { (x) } ) -#define PTE_MASK PAGE_MASK - -#define devmem_is_allowed(pfn) 1 - -#define __pa(vaddr) virt_to_phys((void *) (unsigned long) (vaddr)) -#define __va(paddr) phys_to_virt((unsigned long) (paddr)) - -#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) - -extern unsigned long max_low_pfn; -extern unsigned long min_low_pfn; -extern unsigned long max_pfn; - -#ifdef CONFIG_MMU -#define pfn_valid(pfn) ((pfn) < max_mapnr) -#else -#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) -#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_low_pfn) - -#endif - -#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) - - -#define VM_DATA_DEFAULT_FLAGS \ - (VM_READ | VM_WRITE | \ - ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ - VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) - -#endif /* __ASSEMBLY__ */ - -#include -#include - -#endif /* _ASM_PAGE_H */ diff --git a/arch/frv/include/asm/pci.h b/arch/frv/include/asm/pci.h deleted file mode 100644 index 895af9d558ba..000000000000 --- a/arch/frv/include/asm/pci.h +++ /dev/null @@ -1,40 +0,0 @@ -/* pci.h: FR-V specific PCI declarations - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from include/asm-m68k/pci.h - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_FRV_PCI_H -#define _ASM_FRV_PCI_H - -#include -#include -#include - -#define pcibios_assign_all_busses() 0 - -#ifdef CONFIG_MMU -extern void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle); -extern void consistent_free(void *vaddr); -extern void consistent_sync(void *vaddr, size_t size, int direction); -extern void consistent_sync_page(struct page *page, unsigned long offset, - size_t size, int direction); -#endif - -/* Return the index of the PCI controller for device PDEV. */ -#define pci_controller_num(PDEV) (0) - -/* - * These are pretty much arbitrary with the CoMEM implementation. - * We have the whole address space to ourselves. - */ -#define PCIBIOS_MIN_IO 0x100 -#define PCIBIOS_MIN_MEM 0x00010000 - -#endif /* _ASM_FRV_PCI_H */ diff --git a/arch/frv/include/asm/percpu.h b/arch/frv/include/asm/percpu.h deleted file mode 100644 index 4209fe5fe0a2..000000000000 --- a/arch/frv/include/asm/percpu.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_PERCPU_H -#define __ASM_PERCPU_H - -#include - -#endif /* __ASM_PERCPU_H */ diff --git a/arch/frv/include/asm/perf_event.h b/arch/frv/include/asm/perf_event.h deleted file mode 100644 index c52ea5546b5b..000000000000 --- a/arch/frv/include/asm/perf_event.h +++ /dev/null @@ -1,15 +0,0 @@ -/* FRV performance event support - * - * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public Licence - * as published by the Free Software Foundation; either version - * 2 of the Licence, or (at your option) any later version. - */ - -#ifndef _ASM_PERF_EVENT_H -#define _ASM_PERF_EVENT_H - -#endif /* _ASM_PERF_EVENT_H */ diff --git a/arch/frv/include/asm/pgalloc.h b/arch/frv/include/asm/pgalloc.h deleted file mode 100644 index 416d19a632f2..000000000000 --- a/arch/frv/include/asm/pgalloc.h +++ /dev/null @@ -1,69 +0,0 @@ -/* pgalloc.h: Page allocation routines for FRV - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Derived from: - * include/asm-m68knommu/pgalloc.h - * include/asm-i386/pgalloc.h - */ -#ifndef _ASM_PGALLOC_H -#define _ASM_PGALLOC_H - -#include -#include - -#ifdef CONFIG_MMU - -#define pmd_populate_kernel(mm, pmd, pte) __set_pmd(pmd, __pa(pte) | _PAGE_TABLE) -#define pmd_populate(MM, PMD, PAGE) \ -do { \ - __set_pmd((PMD), page_to_pfn(PAGE) << PAGE_SHIFT | _PAGE_TABLE); \ -} while(0) -#define pmd_pgtable(pmd) pmd_page(pmd) - -/* - * Allocate and free page tables. - */ - -extern pgd_t *pgd_alloc(struct mm_struct *); -extern void pgd_free(struct mm_struct *mm, pgd_t *); - -extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); - -extern pgtable_t pte_alloc_one(struct mm_struct *, unsigned long); - -static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) -{ - free_page((unsigned long)pte); -} - -static inline void pte_free(struct mm_struct *mm, pgtable_t pte) -{ - pgtable_page_dtor(pte); - __free_page(pte); -} - -#define __pte_free_tlb(tlb,pte,address) \ -do { \ - pgtable_page_dtor(pte); \ - tlb_remove_page((tlb),(pte)); \ -} while (0) - -/* - * allocating and freeing a pmd is trivial: the 1-entry pmd is - * inside the pgd, so has no extra memory associated with it. - * (In the PAE case we free the pmds as part of the pgd.) - */ -#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) -#define pmd_free(mm, x) do { } while (0) -#define __pmd_free_tlb(tlb,x,a) do { } while (0) - -#endif /* CONFIG_MMU */ - -#endif /* _ASM_PGALLOC_H */ diff --git a/arch/frv/include/asm/pgtable.h b/arch/frv/include/asm/pgtable.h deleted file mode 100644 index ab6e7e961b54..000000000000 --- a/arch/frv/include/asm/pgtable.h +++ /dev/null @@ -1,528 +0,0 @@ -/* pgtable.h: FR-V page table mangling - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Derived from: - * include/asm-m68knommu/pgtable.h - * include/asm-i386/pgtable.h - */ - -#ifndef _ASM_PGTABLE_H -#define _ASM_PGTABLE_H - -#include -#include -#include -#include - -#ifndef __ASSEMBLY__ -#include -#include -#include -#include -#include -struct vm_area_struct; -#endif - -#ifndef __ASSEMBLY__ -#if defined(CONFIG_HIGHPTE) -typedef unsigned long pte_addr_t; -#else -typedef pte_t *pte_addr_t; -#endif -#endif - -/*****************************************************************************/ -/* - * MMU-less operation case first - */ -#ifndef CONFIG_MMU - -#define pgd_present(pgd) (1) /* pages are always present on NO_MM */ -#define pgd_none(pgd) (0) -#define pgd_bad(pgd) (0) -#define pgd_clear(pgdp) -#define kern_addr_valid(addr) (1) -#define pmd_offset(a, b) ((void *) 0) - -#define PAGE_NONE __pgprot(0) /* these mean nothing to NO_MM */ -#define PAGE_SHARED __pgprot(0) /* these mean nothing to NO_MM */ -#define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */ -#define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */ -#define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */ - -#define __swp_type(x) (0) -#define __swp_offset(x) (0) -#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) -#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) -#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) - -#define ZERO_PAGE(vaddr) ({ BUG(); NULL; }) - -#define swapper_pg_dir ((pgd_t *) NULL) - -#define pgtable_cache_init() do {} while (0) - -#include - -#else /* !CONFIG_MMU */ -/*****************************************************************************/ -/* - * then MMU operation - */ - -/* - * ZERO_PAGE is a global shared page that is always zero: used - * for zero-mapped memory areas etc.. - */ -#ifndef __ASSEMBLY__ -extern unsigned long empty_zero_page; -#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) -#endif - -/* - * we use 2-level page tables, folding the PMD (mid-level table) into the PGE (top-level entry) - * [see Documentation/frv/mmu-layout.txt] - * - * Page Directory: - * - Size: 16KB - * - 64 PGEs per PGD - * - Each PGE holds 1 PUD and covers 64MB - * - * Page Upper Directory: - * - Size: 256B - * - 1 PUE per PUD - * - Each PUE holds 1 PMD and covers 64MB - * - * Page Mid-Level Directory - * - Size: 256B - * - 1 PME per PMD - * - Each PME holds 64 STEs, all of which point to separate chunks of the same Page Table - * - All STEs are instantiated at the same time - * - * Page Table - * - Size: 16KB - * - 4096 PTEs per PT - * - Each Linux PT is subdivided into 64 FR451 PT's, each of which holds 64 entries - * - * Pages - * - Size: 4KB - * - * total PTEs - * = 1 PML4E * 64 PGEs * 1 PUEs * 1 PMEs * 4096 PTEs - * = 1 PML4E * 64 PGEs * 64 STEs * 64 PTEs/FR451-PT - * = 262144 (or 256 * 1024) - */ -#define PGDIR_SHIFT 26 -#define PGDIR_SIZE (1UL << PGDIR_SHIFT) -#define PGDIR_MASK (~(PGDIR_SIZE - 1)) -#define PTRS_PER_PGD 64 - -#define __PAGETABLE_PUD_FOLDED -#define PUD_SHIFT 26 -#define PTRS_PER_PUD 1 -#define PUD_SIZE (1UL << PUD_SHIFT) -#define PUD_MASK (~(PUD_SIZE - 1)) -#define PUE_SIZE 256 - -#define __PAGETABLE_PMD_FOLDED -#define PMD_SHIFT 26 -#define PMD_SIZE (1UL << PMD_SHIFT) -#define PMD_MASK (~(PMD_SIZE - 1)) -#define PTRS_PER_PMD 1 -#define PME_SIZE 256 - -#define __frv_PT_SIZE 256 - -#define PTRS_PER_PTE 4096 - -#define USER_PGDS_IN_LAST_PML4 (TASK_SIZE / PGDIR_SIZE) -#define FIRST_USER_ADDRESS 0UL - -#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT) -#define KERNEL_PGD_PTRS (PTRS_PER_PGD - USER_PGD_PTRS) - -#define TWOLEVEL_PGDIR_SHIFT 26 -#define BOOT_USER_PGD_PTRS (__PAGE_OFFSET >> TWOLEVEL_PGDIR_SHIFT) -#define BOOT_KERNEL_PGD_PTRS (PTRS_PER_PGD - BOOT_USER_PGD_PTRS) - -#ifndef __ASSEMBLY__ - -extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; - -#define pte_ERROR(e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte) -#define pmd_ERROR(e) \ - printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) -#define pud_ERROR(e) \ - printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pmd_val(pud_val(e))) -#define pgd_ERROR(e) \ - printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pmd_val(pud_val(pgd_val(e)))) - -/* - * Certain architectures need to do special things when PTEs - * within a page table are directly modified. Thus, the following - * hook is made available. - */ -#define set_pte(pteptr, pteval) \ -do { \ - *(pteptr) = (pteval); \ - asm volatile("dcf %M0" :: "U"(*pteptr)); \ -} while(0) -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) - -/* - * pgd_offset() returns a (pgd_t *) - * pgd_index() is used get the offset into the pgd page's array of pgd_t's; - */ -#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) - -/* - * a shortcut which implies the use of the kernel's pgd, instead - * of a process's - */ -#define pgd_offset_k(address) pgd_offset(&init_mm, address) - -/* - * The "pgd_xxx()" functions here are trivial for a folded two-level - * setup: the pud is never bad, and a pud always exists (as it's folded - * into the pgd entry) - */ -static inline int pgd_none(pgd_t pgd) { return 0; } -static inline int pgd_bad(pgd_t pgd) { return 0; } -static inline int pgd_present(pgd_t pgd) { return 1; } -static inline void pgd_clear(pgd_t *pgd) { } - -#define pgd_populate(mm, pgd, pud) do { } while (0) -/* - * (puds are folded into pgds so this doesn't get actually called, - * but the define is needed for a generic inline function.) - */ -#define set_pgd(pgdptr, pgdval) \ -do { \ - memcpy((pgdptr), &(pgdval), sizeof(pgd_t)); \ - asm volatile("dcf %M0" :: "U"(*(pgdptr))); \ -} while(0) - -static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) -{ - return (pud_t *) pgd; -} - -#define pgd_page(pgd) (pud_page((pud_t){ pgd })) -#define pgd_page_vaddr(pgd) (pud_page_vaddr((pud_t){ pgd })) - -/* - * allocating and freeing a pud is trivial: the 1-entry pud is - * inside the pgd, so has no extra memory associated with it. - */ -#define pud_alloc_one(mm, address) NULL -#define pud_free(mm, x) do { } while (0) -#define __pud_free_tlb(tlb, x, address) do { } while (0) - -/* - * The "pud_xxx()" functions here are trivial for a folded two-level - * setup: the pmd is never bad, and a pmd always exists (as it's folded - * into the pud entry) - */ -static inline int pud_none(pud_t pud) { return 0; } -static inline int pud_bad(pud_t pud) { return 0; } -static inline int pud_present(pud_t pud) { return 1; } -static inline void pud_clear(pud_t *pud) { } - -#define pud_populate(mm, pmd, pte) do { } while (0) - -/* - * (pmds are folded into puds so this doesn't get actually called, - * but the define is needed for a generic inline function.) - */ -#define set_pud(pudptr, pudval) set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval }) - -#define pud_page(pud) (pmd_page((pmd_t){ pud })) -#define pud_page_vaddr(pud) (pmd_page_vaddr((pmd_t){ pud })) - -/* - * (pmds are folded into pgds so this doesn't get actually called, - * but the define is needed for a generic inline function.) - */ -extern void __set_pmd(pmd_t *pmdptr, unsigned long __pmd); - -#define set_pmd(pmdptr, pmdval) \ -do { \ - __set_pmd((pmdptr), (pmdval).ste[0]); \ -} while(0) - -#define __pmd_index(address) 0 - -static inline pmd_t *pmd_offset(pud_t *dir, unsigned long address) -{ - return (pmd_t *) dir + __pmd_index(address); -} - -#define pte_same(a, b) ((a).pte == (b).pte) -#define pte_page(x) (mem_map + ((unsigned long)(((x).pte >> PAGE_SHIFT)))) -#define pte_none(x) (!(x).pte) -#define pte_pfn(x) ((unsigned long)(((x).pte >> PAGE_SHIFT))) -#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) -#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) - -#define VMALLOC_VMADDR(x) ((unsigned long) (x)) - -#endif /* !__ASSEMBLY__ */ - -/* - * control flags in AMPR registers and TLB entries - */ -#define _PAGE_BIT_PRESENT xAMPRx_V_BIT -#define _PAGE_BIT_WP DAMPRx_WP_BIT -#define _PAGE_BIT_NOCACHE xAMPRx_C_BIT -#define _PAGE_BIT_SUPER xAMPRx_S_BIT -#define _PAGE_BIT_ACCESSED xAMPRx_RESERVED8_BIT -#define _PAGE_BIT_DIRTY xAMPRx_M_BIT -#define _PAGE_BIT_NOTGLOBAL xAMPRx_NG_BIT - -#define _PAGE_PRESENT xAMPRx_V -#define _PAGE_WP DAMPRx_WP -#define _PAGE_NOCACHE xAMPRx_C -#define _PAGE_SUPER xAMPRx_S -#define _PAGE_ACCESSED xAMPRx_RESERVED8 /* accessed if set */ -#define _PAGE_DIRTY xAMPRx_M -#define _PAGE_NOTGLOBAL xAMPRx_NG - -#define _PAGE_RESERVED_MASK (xAMPRx_RESERVED8 | xAMPRx_RESERVED13) - -#define _PAGE_PROTNONE 0x000 /* If not present */ - -#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) - -#define __PGPROT_BASE \ - (_PAGE_PRESENT | xAMPRx_SS_16Kb | xAMPRx_D | _PAGE_NOTGLOBAL | _PAGE_ACCESSED) - -#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED) -#define PAGE_SHARED __pgprot(__PGPROT_BASE) -#define PAGE_COPY __pgprot(__PGPROT_BASE | _PAGE_WP) -#define PAGE_READONLY __pgprot(__PGPROT_BASE | _PAGE_WP) - -#define __PAGE_KERNEL (__PGPROT_BASE | _PAGE_SUPER | _PAGE_DIRTY) -#define __PAGE_KERNEL_NOCACHE (__PGPROT_BASE | _PAGE_SUPER | _PAGE_DIRTY | _PAGE_NOCACHE) -#define __PAGE_KERNEL_RO (__PGPROT_BASE | _PAGE_SUPER | _PAGE_DIRTY | _PAGE_WP) - -#define MAKE_GLOBAL(x) __pgprot((x) & ~_PAGE_NOTGLOBAL) - -#define PAGE_KERNEL MAKE_GLOBAL(__PAGE_KERNEL) -#define PAGE_KERNEL_RO MAKE_GLOBAL(__PAGE_KERNEL_RO) -#define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE) - -#define _PAGE_TABLE (_PAGE_PRESENT | xAMPRx_SS_16Kb) - -#ifndef __ASSEMBLY__ - -/* - * The FR451 can do execute protection by virtue of having separate TLB miss handlers for - * instruction access and for data access. However, we don't have enough reserved bits to say - * "execute only", so we don't bother. If you can read it, you can execute it and vice versa. - */ -#define __P000 PAGE_NONE -#define __P001 PAGE_READONLY -#define __P010 PAGE_COPY -#define __P011 PAGE_COPY -#define __P100 PAGE_READONLY -#define __P101 PAGE_READONLY -#define __P110 PAGE_COPY -#define __P111 PAGE_COPY - -#define __S000 PAGE_NONE -#define __S001 PAGE_READONLY -#define __S010 PAGE_SHARED -#define __S011 PAGE_SHARED -#define __S100 PAGE_READONLY -#define __S101 PAGE_READONLY -#define __S110 PAGE_SHARED -#define __S111 PAGE_SHARED - -/* - * Define this to warn about kernel memory accesses that are - * done without a 'access_ok(VERIFY_WRITE,..)' - */ -#undef TEST_ACCESS_OK - -#define pte_present(x) (pte_val(x) & _PAGE_PRESENT) -#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) - -#define pmd_none(x) (!pmd_val(x)) -#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) -#define pmd_bad(x) (pmd_val(x) & xAMPRx_SS) -#define pmd_clear(xp) do { __set_pmd(xp, 0); } while(0) - -#define pmd_page_vaddr(pmd) \ - ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) - -#ifndef CONFIG_DISCONTIGMEM -#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) -#endif - -#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) - -/* - * The following only work if pte_present() is true. - * Undefined behaviour if not.. - */ -static inline int pte_dirty(pte_t pte) { return (pte).pte & _PAGE_DIRTY; } -static inline int pte_young(pte_t pte) { return (pte).pte & _PAGE_ACCESSED; } -static inline int pte_write(pte_t pte) { return !((pte).pte & _PAGE_WP); } -static inline int pte_special(pte_t pte) { return 0; } - -static inline pte_t pte_mkclean(pte_t pte) { (pte).pte &= ~_PAGE_DIRTY; return pte; } -static inline pte_t pte_mkold(pte_t pte) { (pte).pte &= ~_PAGE_ACCESSED; return pte; } -static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte |= _PAGE_WP; return pte; } -static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte |= _PAGE_DIRTY; return pte; } -static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte |= _PAGE_ACCESSED; return pte; } -static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte &= ~_PAGE_WP; return pte; } -static inline pte_t pte_mkspecial(pte_t pte) { return pte; } - -static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) -{ - int i = test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); - asm volatile("dcf %M0" :: "U"(*ptep)); - return i; -} - -static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) -{ - unsigned long x = xchg(&ptep->pte, 0); - asm volatile("dcf %M0" :: "U"(*ptep)); - return __pte(x); -} - -static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) -{ - set_bit(_PAGE_BIT_WP, ptep); - asm volatile("dcf %M0" :: "U"(*ptep)); -} - -/* - * Macro to mark a page protection value as "uncacheable" - */ -#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NOCACHE)) - -/* - * Conversion functions: convert a page and protection to a page entry, - * and a page entry and page directory to the page they refer to. - */ - -#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) -#define mk_pte_huge(entry) ((entry).pte_low |= _PAGE_PRESENT | _PAGE_PSE) - -/* This takes a physical page address that is used by the remapping functions */ -#define mk_pte_phys(physpage, pgprot) pfn_pte((physpage) >> PAGE_SHIFT, pgprot) - -static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) -{ - pte.pte &= _PAGE_CHG_MASK; - pte.pte |= pgprot_val(newprot); - return pte; -} - -/* to find an entry in a page-table-directory. */ -#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) -#define pgd_index_k(addr) pgd_index(addr) - -/* Find an entry in the bottom-level page table.. */ -#define __pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) - -/* - * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE] - * - * this macro returns the index of the entry in the pte page which would - * control the given virtual address - */ -#define pte_index(address) \ - (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) -#define pte_offset_kernel(dir, address) \ - ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address)) - -#if defined(CONFIG_HIGHPTE) -#define pte_offset_map(dir, address) \ - ((pte_t *)kmap_atomic(pmd_page(*(dir))) + pte_index(address)) -#define pte_unmap(pte) kunmap_atomic(pte) -#else -#define pte_offset_map(dir, address) \ - ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address)) -#define pte_unmap(pte) do { } while (0) -#endif - -/* - * Handle swap and file entries - * - the PTE is encoded in the following format: - * bit 0: Must be 0 (!_PAGE_PRESENT) - * bits 1-6: Swap type - * bits 7-31: Swap offset - */ -#define __swp_type(x) (((x).val >> 1) & 0x1f) -#define __swp_offset(x) ((x).val >> 7) -#define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 7) }) -#define __pte_to_swp_entry(_pte) ((swp_entry_t) { (_pte).pte }) -#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) - -/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ -#define PageSkip(page) (0) -#define kern_addr_valid(addr) (1) - -#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG -#define __HAVE_ARCH_PTEP_GET_AND_CLEAR -#define __HAVE_ARCH_PTEP_SET_WRPROTECT -#define __HAVE_ARCH_PTE_SAME -#include - -/* - * preload information about a newly instantiated PTE into the SCR0/SCR1 PGE cache - */ -static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) -{ - struct mm_struct *mm; - unsigned long ampr; - - mm = current->mm; - if (mm) { - pgd_t *pge = pgd_offset(mm, address); - pud_t *pue = pud_offset(pge, address); - pmd_t *pme = pmd_offset(pue, address); - - ampr = pme->ste[0] & 0xffffff00; - ampr |= xAMPRx_L | xAMPRx_SS_16Kb | xAMPRx_S | xAMPRx_C | - xAMPRx_V; - } else { - address = ULONG_MAX; - ampr = 0; - } - - asm volatile("movgs %0,scr0\n" - "movgs %0,scr1\n" - "movgs %1,dampr4\n" - "movgs %1,dampr5\n" - : - : "r"(address), "r"(ampr) - ); -} - -#ifdef CONFIG_PROC_FS -extern char *proc_pid_status_frv_cxnr(struct mm_struct *mm, char *buffer); -#endif - -extern void __init pgtable_cache_init(void); - -#endif /* !__ASSEMBLY__ */ -#endif /* !CONFIG_MMU */ - -#ifndef __ASSEMBLY__ -extern void __init paging_init(void); -#endif /* !__ASSEMBLY__ */ -#define HAVE_ARCH_UNMAPPED_AREA - -#endif /* _ASM_PGTABLE_H */ diff --git a/arch/frv/include/asm/processor.h b/arch/frv/include/asm/processor.h deleted file mode 100644 index 021cce78b401..000000000000 --- a/arch/frv/include/asm/processor.h +++ /dev/null @@ -1,110 +0,0 @@ -/* processor.h: FRV processor definitions - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_PROCESSOR_H -#define _ASM_PROCESSOR_H - -#include - -#ifndef __ASSEMBLY__ -/* - * Default implementation of macro that returns current - * instruction pointer ("program counter"). - */ -#define current_text_addr() ({ __label__ _l; _l: &&_l;}) - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Forward declaration, a strange C thing */ -struct task_struct; - -/* - * Bus types - */ -#define EISA_bus 0 - -struct thread_struct { - struct pt_regs *frame; /* [GR28] exception frame ptr for this thread */ - struct task_struct *curr; /* [GR29] current pointer for this thread */ - unsigned long sp; /* [GR1 ] kernel stack pointer */ - unsigned long fp; /* [GR2 ] kernel frame pointer */ - unsigned long lr; /* link register */ - unsigned long pc; /* program counter */ - unsigned long gr[12]; /* [GR16-GR27] */ - unsigned long sched_lr; /* LR from schedule() */ - - union { - struct pt_regs *frame0; /* top (user) stack frame */ - struct user_context *user; /* userspace context */ - }; -} __attribute__((aligned(8))); - -extern struct pt_regs *__kernel_frame0_ptr; -extern struct task_struct *__kernel_current_task; - -#endif - -#ifndef __ASSEMBLY__ -#define INIT_THREAD_FRAME0 \ - ((struct pt_regs *) \ - (sizeof(init_stack) + (unsigned long) init_stack - sizeof(struct user_context))) - -#define INIT_THREAD { \ - NULL, \ - (struct task_struct *) init_stack, \ - 0, 0, 0, 0, \ - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \ - 0, \ - { INIT_THREAD_FRAME0 }, \ -} - -/* - * do necessary setup to start up a newly executed thread. - */ -#define start_thread(_regs, _pc, _usp) \ -do { \ - _regs->pc = (_pc); \ - _regs->psr &= ~PSR_S; \ - _regs->sp = (_usp); \ -} while(0) - -/* Free all resources held by a thread. */ -static inline void release_thread(struct task_struct *dead_task) -{ -} - -extern asmlinkage void save_user_regs(struct user_context *target); -extern asmlinkage void *restore_user_regs(const struct user_context *target, ...); - -unsigned long get_wchan(struct task_struct *p); - -#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc) -#define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp) - -#define cpu_relax() barrier() - -/* data cache prefetch */ -#define ARCH_HAS_PREFETCH -static inline void prefetch(const void *x) -{ - asm volatile("dcpl %0,gr0,#0" : : "r"(x)); -} - -#endif /* __ASSEMBLY__ */ -#endif /* _ASM_PROCESSOR_H */ diff --git a/arch/frv/include/asm/ptrace.h b/arch/frv/include/asm/ptrace.h deleted file mode 100644 index 034f17934192..000000000000 --- a/arch/frv/include/asm/ptrace.h +++ /dev/null @@ -1,41 +0,0 @@ -/* ptrace.h: ptrace() relevant definitions - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_PTRACE_H -#define _ASM_PTRACE_H - -#include -#include - -#define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0) -#ifndef __ASSEMBLY__ - -struct task_struct; - -/* - * we dedicate GR28 to keeping a pointer to the current exception frame - * - gr28 is destroyed on entry to the kernel from userspace - */ -register struct pt_regs *__frame asm("gr28"); - -#define user_mode(regs) (!((regs)->psr & PSR_S)) -#define instruction_pointer(regs) ((regs)->pc) -#define user_stack_pointer(regs) ((regs)->sp) -#define current_pt_regs() (__frame) - -extern unsigned long user_stack(const struct pt_regs *); -#define profile_pc(regs) ((regs)->pc) - -#define task_pt_regs(task) ((task)->thread.frame0) - -#define arch_has_single_step() (1) - -#endif /* !__ASSEMBLY__ */ -#endif /* _ASM_PTRACE_H */ diff --git a/arch/frv/include/asm/sections.h b/arch/frv/include/asm/sections.h deleted file mode 100644 index d03fb64e93e9..000000000000 --- a/arch/frv/include/asm/sections.h +++ /dev/null @@ -1,40 +0,0 @@ -/* sections.h: linkage layout variables - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_SECTIONS_H -#define _ASM_SECTIONS_H - -#ifndef __ASSEMBLY__ - -#include -#include - -#ifdef __KERNEL__ - -/* - * we don't want to put variables in the GP-REL section if they're not used very much - that would - * be waste since GP-REL addressing is limited to GP16+/-2048 - */ -#define __nongpreldata __attribute__((section(".data"))) -#define __nongprelbss __attribute__((section(".bss"))) - -/* - * linker symbols - */ -extern const void __kernel_image_start, __kernel_image_end, __page_offset; - -extern unsigned long __nongprelbss memory_start; -extern unsigned long __nongprelbss memory_end; -extern unsigned long __nongprelbss rom_length; - -#endif -#endif -#endif /* _ASM_SECTIONS_H */ diff --git a/arch/frv/include/asm/segment.h b/arch/frv/include/asm/segment.h deleted file mode 100644 index 2305142d4cf8..000000000000 --- a/arch/frv/include/asm/segment.h +++ /dev/null @@ -1,44 +0,0 @@ -/* segment.h: MMU segment settings - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_SEGMENT_H -#define _ASM_SEGMENT_H - - -#ifndef __ASSEMBLY__ - -typedef struct { - unsigned long seg; -} mm_segment_t; - -#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) - -#ifdef CONFIG_MMU -#define USER_DS MAKE_MM_SEG(TASK_SIZE - 1) -#define KERNEL_DS MAKE_MM_SEG(0xdfffffffUL) -#else -#define USER_DS MAKE_MM_SEG(memory_end) -#define KERNEL_DS MAKE_MM_SEG(0xe0000000UL) -#endif - -#define get_ds() (KERNEL_DS) -#define get_fs() (__current_thread_info->addr_limit) -#define segment_eq(a, b) ((a).seg == (b).seg) -#define get_addr_limit() (get_fs().seg) - -#define set_fs(_x) \ -do { \ - __current_thread_info->addr_limit = (_x); \ -} while(0) - - -#endif /* __ASSEMBLY__ */ -#endif /* _ASM_SEGMENT_H */ diff --git a/arch/frv/include/asm/serial-regs.h b/arch/frv/include/asm/serial-regs.h deleted file mode 100644 index e1286bda00eb..000000000000 --- a/arch/frv/include/asm/serial-regs.h +++ /dev/null @@ -1,44 +0,0 @@ -/* serial-regs.h: serial port registers - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_SERIAL_REGS_H -#define _ASM_SERIAL_REGS_H - -#include -#include - -#define SERIAL_ICLK 33333333 /* the target serial input clock */ -#define UART0_BASE 0xfeff9c00 -#define UART1_BASE 0xfeff9c40 - -#define __get_UART0(R) ({ __reg(UART0_BASE + (R) * 8) >> 24; }) -#define __get_UART1(R) ({ __reg(UART1_BASE + (R) * 8) >> 24; }) -#define __set_UART0(R,V) do { __reg(UART0_BASE + (R) * 8) = (V) << 24; } while(0) -#define __set_UART1(R,V) do { __reg(UART1_BASE + (R) * 8) = (V) << 24; } while(0) - -#define __get_UART0_LSR() ({ __get_UART0(UART_LSR); }) -#define __get_UART1_LSR() ({ __get_UART1(UART_LSR); }) - -#define __set_UART0_IER(V) __set_UART0(UART_IER,(V)) -#define __set_UART1_IER(V) __set_UART1(UART_IER,(V)) - -/* serial prescaler select register */ -#define __get_UCPSR() ({ *(volatile unsigned long *)(0xfeff9c90); }) -#define __set_UCPSR(V) do { *(volatile unsigned long *)(0xfeff9c90) = (V); } while(0) -#define UCPSR_SELECT0 0x07000000 -#define UCPSR_SELECT1 0x38000000 - -/* serial prescaler base value register */ -#define __get_UCPVR() ({ *(volatile unsigned long *)(0xfeff9c98); mb(); }) -#define __set_UCPVR(V) do { *(volatile unsigned long *)(0xfeff9c98) = (V) << 24; mb(); } while(0) - - -#endif /* _ASM_SERIAL_REGS_H */ diff --git a/arch/frv/include/asm/serial.h b/arch/frv/include/asm/serial.h deleted file mode 100644 index 614c6d76789a..000000000000 --- a/arch/frv/include/asm/serial.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * serial.h - * - * Copyright (C) 2003 Develer S.r.l. (http://www.develer.com/) - * Author: Bernardo Innocenti - * - * Based on linux/include/asm-i386/serial.h - */ -#include - -/* - * the base baud is derived from the clock speed and so is variable - */ -#define BASE_BAUD 0 diff --git a/arch/frv/include/asm/setup.h b/arch/frv/include/asm/setup.h deleted file mode 100644 index aa76f2eac09a..000000000000 --- a/arch/frv/include/asm/setup.h +++ /dev/null @@ -1,26 +0,0 @@ -/* setup.h: setup stuff - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_SETUP_H -#define _ASM_SETUP_H - - -#include -#include - -#ifndef __ASSEMBLY__ - -#ifdef CONFIG_MMU -extern unsigned long __initdata num_mappedpages; -#endif - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ASM_SETUP_H */ diff --git a/arch/frv/include/asm/shmparam.h b/arch/frv/include/asm/shmparam.h deleted file mode 100644 index 50ea51f26c46..000000000000 --- a/arch/frv/include/asm/shmparam.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_SHMPARAM_H -#define _ASM_SHMPARAM_H - -#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ - -#endif /* _ASM_SHMPARAM_H */ - diff --git a/arch/frv/include/asm/signal.h b/arch/frv/include/asm/signal.h deleted file mode 100644 index 796394113904..000000000000 --- a/arch/frv/include/asm/signal.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_SIGNAL_H -#define _ASM_SIGNAL_H - -#include - -#endif /* _ASM_SIGNAL_H */ diff --git a/arch/frv/include/asm/smp.h b/arch/frv/include/asm/smp.h deleted file mode 100644 index 0d7fa409312d..000000000000 --- a/arch/frv/include/asm/smp.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_SMP_H -#define __ASM_SMP_H - - -#ifdef CONFIG_SMP -#error SMP not supported -#endif - -#endif diff --git a/arch/frv/include/asm/spinlock.h b/arch/frv/include/asm/spinlock.h deleted file mode 100644 index fe385f45d1fd..000000000000 --- a/arch/frv/include/asm/spinlock.h +++ /dev/null @@ -1,17 +0,0 @@ -/* spinlock.h: spinlocks for FR-V - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_SPINLOCK_H -#define _ASM_SPINLOCK_H - -#error no spinlocks for FR-V yet - -#endif /* _ASM_SPINLOCK_H */ diff --git a/arch/frv/include/asm/spr-regs.h b/arch/frv/include/asm/spr-regs.h deleted file mode 100644 index d3883021f236..000000000000 --- a/arch/frv/include/asm/spr-regs.h +++ /dev/null @@ -1,416 +0,0 @@ -/* spr-regs.h: special-purpose registers on the FRV - * - * Copyright (C) 2003, 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_SPR_REGS_H -#define _ASM_SPR_REGS_H - -/* - * PSR - Processor Status Register - */ -#define PSR_ET 0x00000001 /* enable interrupts/exceptions flag */ -#define PSR_PS 0x00000002 /* previous supervisor mode flag */ -#define PSR_S 0x00000004 /* supervisor mode flag */ -#define PSR_PIL 0x00000078 /* processor external interrupt level */ -#define PSR_PIL_0 0x00000000 /* - no interrupt in progress */ -#define PSR_PIL_13 0x00000068 /* - debugging only */ -#define PSR_PIL_14 0x00000070 /* - debugging in progress */ -#define PSR_PIL_15 0x00000078 /* - NMI in progress */ -#define PSR_EM 0x00000080 /* enable media operation */ -#define PSR_EF 0x00000100 /* enable FPU operation */ -#define PSR_BE 0x00001000 /* endianness mode */ -#define PSR_BE_LE 0x00000000 /* - little endian mode */ -#define PSR_BE_BE 0x00001000 /* - big endian mode */ -#define PSR_CM 0x00002000 /* conditional mode */ -#define PSR_NEM 0x00004000 /* non-excepting mode */ -#define PSR_ICE 0x00010000 /* in-circuit emulation mode */ -#define PSR_VERSION_SHIFT 24 /* CPU silicon ID */ -#define PSR_IMPLE_SHIFT 28 /* CPU core ID */ - -#define PSR_VERSION(psr) (((psr) >> PSR_VERSION_SHIFT) & 0xf) -#define PSR_IMPLE(psr) (((psr) >> PSR_IMPLE_SHIFT) & 0xf) - -#define PSR_IMPLE_FR401 0x2 -#define PSR_VERSION_FR401_MB93401 0x0 -#define PSR_VERSION_FR401_MB93401A 0x1 -#define PSR_VERSION_FR401_MB93403 0x2 - -#define PSR_IMPLE_FR405 0x4 -#define PSR_VERSION_FR405_MB93405 0x0 - -#define PSR_IMPLE_FR451 0x5 -#define PSR_VERSION_FR451_MB93451 0x0 - -#define PSR_IMPLE_FR501 0x1 -#define PSR_VERSION_FR501_MB93501 0x1 -#define PSR_VERSION_FR501_MB93501A 0x2 - -#define PSR_IMPLE_FR551 0x3 -#define PSR_VERSION_FR551_MB93555 0x1 - -#define __get_PSR() ({ unsigned long x; asm volatile("movsg psr,%0" : "=r"(x)); x; }) -#define __set_PSR(V) do { asm volatile("movgs %0,psr" : : "r"(V)); } while(0) - -/* - * TBR - Trap Base Register - */ -#define TBR_TT 0x00000ff0 -#define TBR_TT_INSTR_MMU_MISS (0x01 << 4) -#define TBR_TT_INSTR_ACC_ERROR (0x02 << 4) -#define TBR_TT_INSTR_ACC_EXCEP (0x03 << 4) -#define TBR_TT_PRIV_INSTR (0x06 << 4) -#define TBR_TT_ILLEGAL_INSTR (0x07 << 4) -#define TBR_TT_FP_EXCEPTION (0x0d << 4) -#define TBR_TT_MP_EXCEPTION (0x0e << 4) -#define TBR_TT_DATA_ACC_ERROR (0x11 << 4) -#define TBR_TT_DATA_MMU_MISS (0x12 << 4) -#define TBR_TT_DATA_ACC_EXCEP (0x13 << 4) -#define TBR_TT_DATA_STR_ERROR (0x14 << 4) -#define TBR_TT_DIVISION_EXCEP (0x17 << 4) -#define TBR_TT_COMMIT_EXCEP (0x19 << 4) -#define TBR_TT_INSTR_TLB_MISS (0x1a << 4) -#define TBR_TT_DATA_TLB_MISS (0x1b << 4) -#define TBR_TT_DATA_DAT_EXCEP (0x1d << 4) -#define TBR_TT_DECREMENT_TIMER (0x1f << 4) -#define TBR_TT_COMPOUND_EXCEP (0x20 << 4) -#define TBR_TT_INTERRUPT_1 (0x21 << 4) -#define TBR_TT_INTERRUPT_2 (0x22 << 4) -#define TBR_TT_INTERRUPT_3 (0x23 << 4) -#define TBR_TT_INTERRUPT_4 (0x24 << 4) -#define TBR_TT_INTERRUPT_5 (0x25 << 4) -#define TBR_TT_INTERRUPT_6 (0x26 << 4) -#define TBR_TT_INTERRUPT_7 (0x27 << 4) -#define TBR_TT_INTERRUPT_8 (0x28 << 4) -#define TBR_TT_INTERRUPT_9 (0x29 << 4) -#define TBR_TT_INTERRUPT_10 (0x2a << 4) -#define TBR_TT_INTERRUPT_11 (0x2b << 4) -#define TBR_TT_INTERRUPT_12 (0x2c << 4) -#define TBR_TT_INTERRUPT_13 (0x2d << 4) -#define TBR_TT_INTERRUPT_14 (0x2e << 4) -#define TBR_TT_INTERRUPT_15 (0x2f << 4) -#define TBR_TT_TRAP0 (0x80 << 4) -#define TBR_TT_TRAP1 (0x81 << 4) -#define TBR_TT_TRAP2 (0x82 << 4) -#define TBR_TT_TRAP3 (0x83 << 4) -#define TBR_TT_TRAP120 (0xf8 << 4) -#define TBR_TT_TRAP121 (0xf9 << 4) -#define TBR_TT_TRAP122 (0xfa << 4) -#define TBR_TT_TRAP123 (0xfb << 4) -#define TBR_TT_TRAP124 (0xfc << 4) -#define TBR_TT_TRAP125 (0xfd << 4) -#define TBR_TT_TRAP126 (0xfe << 4) -#define TBR_TT_BREAK (0xff << 4) - -#define TBR_TT_ATOMIC_CMPXCHG32 TBR_TT_TRAP120 -#define TBR_TT_ATOMIC_XCHG32 TBR_TT_TRAP121 -#define TBR_TT_ATOMIC_XOR TBR_TT_TRAP122 -#define TBR_TT_ATOMIC_OR TBR_TT_TRAP123 -#define TBR_TT_ATOMIC_AND TBR_TT_TRAP124 -#define TBR_TT_ATOMIC_SUB TBR_TT_TRAP125 -#define TBR_TT_ATOMIC_ADD TBR_TT_TRAP126 - -#define __get_TBR() ({ unsigned long x; asm volatile("movsg tbr,%0" : "=r"(x)); x; }) - -/* - * HSR0 - Hardware Status Register 0 - */ -#define HSR0_PDM 0x00000007 /* power down mode */ -#define HSR0_PDM_NORMAL 0x00000000 /* - normal mode */ -#define HSR0_PDM_CORE_SLEEP 0x00000001 /* - CPU core sleep mode */ -#define HSR0_PDM_BUS_SLEEP 0x00000003 /* - bus sleep mode */ -#define HSR0_PDM_PLL_RUN 0x00000005 /* - PLL run */ -#define HSR0_PDM_PLL_STOP 0x00000007 /* - PLL stop */ -#define HSR0_GRLE 0x00000040 /* GR lower register set enable */ -#define HSR0_GRHE 0x00000080 /* GR higher register set enable */ -#define HSR0_FRLE 0x00000100 /* FR lower register set enable */ -#define HSR0_FRHE 0x00000200 /* FR higher register set enable */ -#define HSR0_GRN 0x00000400 /* GR quantity */ -#define HSR0_GRN_64 0x00000000 /* - 64 GR registers */ -#define HSR0_GRN_32 0x00000400 /* - 32 GR registers */ -#define HSR0_FRN 0x00000800 /* FR quantity */ -#define HSR0_FRN_64 0x00000000 /* - 64 FR registers */ -#define HSR0_FRN_32 0x00000800 /* - 32 FR registers */ -#define HSR0_SA 0x00001000 /* start address (RAMBOOT#) */ -#define HSR0_ETMI 0x00008000 /* enable TIMERI (64-bit up timer) */ -#define HSR0_ETMD 0x00004000 /* enable TIMERD (32-bit down timer) */ -#define HSR0_PEDAT 0x00010000 /* previous DAT mode */ -#define HSR0_XEDAT 0x00020000 /* exception DAT mode */ -#define HSR0_EDAT 0x00080000 /* enable DAT mode */ -#define HSR0_RME 0x00400000 /* enable RAM mode */ -#define HSR0_EMEM 0x00800000 /* enable MMU_Miss mask */ -#define HSR0_EXMMU 0x01000000 /* enable extended MMU mode */ -#define HSR0_EDMMU 0x02000000 /* enable data MMU */ -#define HSR0_EIMMU 0x04000000 /* enable instruction MMU */ -#define HSR0_CBM 0x08000000 /* copy back mode */ -#define HSR0_CBM_WRITE_THRU 0x00000000 /* - write through */ -#define HSR0_CBM_COPY_BACK 0x08000000 /* - copy back */ -#define HSR0_NWA 0x10000000 /* no write allocate */ -#define HSR0_DCE 0x40000000 /* data cache enable */ -#define HSR0_ICE 0x80000000 /* instruction cache enable */ - -#define __get_HSR(R) ({ unsigned long x; asm volatile("movsg hsr"#R",%0" : "=r"(x)); x; }) -#define __set_HSR(R,V) do { asm volatile("movgs %0,hsr"#R : : "r"(V)); } while(0) - -/* - * CCR - Condition Codes Register - */ -#define CCR_FCC0 0x0000000f /* FP/Media condition 0 (fcc0 reg) */ -#define CCR_FCC1 0x000000f0 /* FP/Media condition 1 (fcc1 reg) */ -#define CCR_FCC2 0x00000f00 /* FP/Media condition 2 (fcc2 reg) */ -#define CCR_FCC3 0x0000f000 /* FP/Media condition 3 (fcc3 reg) */ -#define CCR_ICC0 0x000f0000 /* Integer condition 0 (icc0 reg) */ -#define CCR_ICC0_C 0x00010000 /* - Carry flag */ -#define CCR_ICC0_V 0x00020000 /* - Overflow flag */ -#define CCR_ICC0_Z 0x00040000 /* - Zero flag */ -#define CCR_ICC0_N 0x00080000 /* - Negative flag */ -#define CCR_ICC1 0x00f00000 /* Integer condition 1 (icc1 reg) */ -#define CCR_ICC2 0x0f000000 /* Integer condition 2 (icc2 reg) */ -#define CCR_ICC3 0xf0000000 /* Integer condition 3 (icc3 reg) */ - -/* - * CCCR - Condition Codes for Conditional Instructions Register - */ -#define CCCR_CC0 0x00000003 /* condition 0 (cc0 reg) */ -#define CCCR_CC0_FALSE 0x00000002 /* - condition is false */ -#define CCCR_CC0_TRUE 0x00000003 /* - condition is true */ -#define CCCR_CC1 0x0000000c /* condition 1 (cc1 reg) */ -#define CCCR_CC2 0x00000030 /* condition 2 (cc2 reg) */ -#define CCCR_CC3 0x000000c0 /* condition 3 (cc3 reg) */ -#define CCCR_CC4 0x00000300 /* condition 4 (cc4 reg) */ -#define CCCR_CC5 0x00000c00 /* condition 5 (cc5 reg) */ -#define CCCR_CC6 0x00003000 /* condition 6 (cc6 reg) */ -#define CCCR_CC7 0x0000c000 /* condition 7 (cc7 reg) */ - -/* - * ISR - Integer Status Register - */ -#define ISR_EMAM 0x00000001 /* memory misaligned access handling */ -#define ISR_EMAM_EXCEPTION 0x00000000 /* - generate exception */ -#define ISR_EMAM_FUDGE 0x00000001 /* - mask out invalid address bits */ -#define ISR_AEXC 0x00000004 /* accrued [overflow] exception */ -#define ISR_DTT 0x00000018 /* division type trap */ -#define ISR_DTT_IGNORE 0x00000000 /* - ignore division error */ -#define ISR_DTT_DIVBYZERO 0x00000008 /* - generate exception */ -#define ISR_DTT_OVERFLOW 0x00000010 /* - record overflow */ -#define ISR_EDE 0x00000020 /* enable division exception */ -#define ISR_PLI 0x20000000 /* pre-load instruction information */ -#define ISR_QI 0x80000000 /* quad data implementation information */ - -/* - * EPCR0 - Exception PC Register - */ -#define EPCR0_V 0x00000001 /* register content validity indicator */ -#define EPCR0_PC 0xfffffffc /* faulting instruction address */ - -/* - * ESR0/14/15 - Exception Status Register - */ -#define ESRx_VALID 0x00000001 /* register content validity indicator */ -#define ESRx_EC 0x0000003e /* exception type */ -#define ESRx_EC_DATA_STORE 0x00000000 /* - data_store_error */ -#define ESRx_EC_INSN_ACCESS 0x00000006 /* - instruction_access_error */ -#define ESRx_EC_PRIV_INSN 0x00000008 /* - privileged_instruction */ -#define ESRx_EC_ILL_INSN 0x0000000a /* - illegal_instruction */ -#define ESRx_EC_MP_EXCEP 0x0000001c /* - mp_exception */ -#define ESRx_EC_DATA_ACCESS 0x00000020 /* - data_access_error */ -#define ESRx_EC_DIVISION 0x00000026 /* - division_exception */ -#define ESRx_EC_ITLB_MISS 0x00000034 /* - instruction_access_TLB_miss */ -#define ESRx_EC_DTLB_MISS 0x00000036 /* - data_access_TLB_miss */ -#define ESRx_EC_DATA_ACCESS_DAT 0x0000003a /* - data_access_DAT_exception */ - -#define ESR0_IAEC 0x00000100 /* info for instruction-access-exception */ -#define ESR0_IAEC_RESV 0x00000000 /* - reserved */ -#define ESR0_IAEC_PROT_VIOL 0x00000100 /* - protection violation */ - -#define ESR0_ATXC 0x00f00000 /* address translation exception code */ -#define ESR0_ATXC_MMU_MISS 0x00000000 /* - MMU miss exception and more (?) */ -#define ESR0_ATXC_MULTI_DAT 0x00800000 /* - multiple DAT entry hit */ -#define ESR0_ATXC_MULTI_SAT 0x00900000 /* - multiple SAT entry hit */ -#define ESR0_ATXC_AMRTLB_MISS 0x00a00000 /* - MMU/TLB miss exception */ -#define ESR0_ATXC_PRIV_EXCEP 0x00c00000 /* - privilege protection fault */ -#define ESR0_ATXC_WP_EXCEP 0x00d00000 /* - write protection fault */ - -#define ESR0_EAV 0x00000800 /* true if EAR0 register valid */ -#define ESR15_EAV 0x00000800 /* true if EAR15 register valid */ - -/* - * ESFR1 - Exception Status Valid Flag Register - */ -#define ESFR1_ESR0 0x00000001 /* true if ESR0 is valid */ -#define ESFR1_ESR14 0x00004000 /* true if ESR14 is valid */ -#define ESFR1_ESR15 0x00008000 /* true if ESR15 is valid */ - -/* - * MSR - Media Status Register - */ -#define MSR0_AOVF 0x00000001 /* overflow exception accrued */ -#define MSRx_OVF 0x00000002 /* overflow exception detected */ -#define MSRx_SIE 0x0000003c /* last SIMD instruction exception detected */ -#define MSRx_SIE_NONE 0x00000000 /* - none detected */ -#define MSRx_SIE_FRkHI_ACCk 0x00000020 /* - exception at FRkHI or ACCk */ -#define MSRx_SIE_FRkLO_ACCk1 0x00000010 /* - exception at FRkLO or ACCk+1 */ -#define MSRx_SIE_FRk1HI_ACCk2 0x00000008 /* - exception at FRk+1HI or ACCk+2 */ -#define MSRx_SIE_FRk1LO_ACCk3 0x00000004 /* - exception at FRk+1LO or ACCk+3 */ -#define MSR0_MTT 0x00007000 /* type of last media trap detected */ -#define MSR0_MTT_NONE 0x00000000 /* - none detected */ -#define MSR0_MTT_OVERFLOW 0x00001000 /* - overflow detected */ -#define MSR0_HI 0x00c00000 /* hardware implementation */ -#define MSR0_HI_ROUNDING 0x00000000 /* - rounding mode */ -#define MSR0_HI_NONROUNDING 0x00c00000 /* - non-rounding mode */ -#define MSR0_EMCI 0x01000000 /* enable media custom instructions */ -#define MSR0_SRDAV 0x10000000 /* select rounding mode of MAVEH */ -#define MSR0_SRDAV_RDAV 0x00000000 /* - controlled by MSR.RDAV */ -#define MSR0_SRDAV_RD 0x10000000 /* - controlled by MSR.RD */ -#define MSR0_RDAV 0x20000000 /* rounding mode of MAVEH */ -#define MSR0_RDAV_NEAREST_MI 0x00000000 /* - round to nearest minus */ -#define MSR0_RDAV_NEAREST_PL 0x20000000 /* - round to nearest plus */ -#define MSR0_RD 0xc0000000 /* rounding mode */ -#define MSR0_RD_NEAREST 0x00000000 /* - nearest */ -#define MSR0_RD_ZERO 0x40000000 /* - zero */ -#define MSR0_RD_POS_INF 0x80000000 /* - positive infinity */ -#define MSR0_RD_NEG_INF 0xc0000000 /* - negative infinity */ - -/* - * IAMPR0-7 - Instruction Address Mapping Register - * DAMPR0-7 - Data Address Mapping Register - */ -#define xAMPRx_V 0x00000001 /* register content validity indicator */ -#define DAMPRx_WP 0x00000002 /* write protect */ -#define DAMPRx_WP_RW 0x00000000 /* - read/write */ -#define DAMPRx_WP_RO 0x00000002 /* - read-only */ -#define xAMPRx_C 0x00000004 /* cached/uncached */ -#define xAMPRx_C_CACHED 0x00000000 /* - cached */ -#define xAMPRx_C_UNCACHED 0x00000004 /* - uncached */ -#define xAMPRx_S 0x00000008 /* supervisor only */ -#define xAMPRx_S_USER 0x00000000 /* - userspace can access */ -#define xAMPRx_S_KERNEL 0x00000008 /* - kernel only */ -#define xAMPRx_SS 0x000000f0 /* segment size */ -#define xAMPRx_SS_16Kb 0x00000000 /* - 16 kilobytes */ -#define xAMPRx_SS_64Kb 0x00000010 /* - 64 kilobytes */ -#define xAMPRx_SS_256Kb 0x00000020 /* - 256 kilobytes */ -#define xAMPRx_SS_1Mb 0x00000030 /* - 1 megabyte */ -#define xAMPRx_SS_2Mb 0x00000040 /* - 2 megabytes */ -#define xAMPRx_SS_4Mb 0x00000050 /* - 4 megabytes */ -#define xAMPRx_SS_8Mb 0x00000060 /* - 8 megabytes */ -#define xAMPRx_SS_16Mb 0x00000070 /* - 16 megabytes */ -#define xAMPRx_SS_32Mb 0x00000080 /* - 32 megabytes */ -#define xAMPRx_SS_64Mb 0x00000090 /* - 64 megabytes */ -#define xAMPRx_SS_128Mb 0x000000a0 /* - 128 megabytes */ -#define xAMPRx_SS_256Mb 0x000000b0 /* - 256 megabytes */ -#define xAMPRx_SS_512Mb 0x000000c0 /* - 512 megabytes */ -#define xAMPRx_RESERVED8 0x00000100 /* reserved bit */ -#define xAMPRx_NG 0x00000200 /* non-global */ -#define xAMPRx_L 0x00000400 /* locked */ -#define xAMPRx_M 0x00000800 /* modified */ -#define xAMPRx_D 0x00001000 /* DAT entry */ -#define xAMPRx_RESERVED13 0x00002000 /* reserved bit */ -#define xAMPRx_PPFN 0xfff00000 /* physical page frame number */ - -#define xAMPRx_V_BIT 0 -#define DAMPRx_WP_BIT 1 -#define xAMPRx_C_BIT 2 -#define xAMPRx_S_BIT 3 -#define xAMPRx_RESERVED8_BIT 8 -#define xAMPRx_NG_BIT 9 -#define xAMPRx_L_BIT 10 -#define xAMPRx_M_BIT 11 -#define xAMPRx_D_BIT 12 -#define xAMPRx_RESERVED13_BIT 13 - -#define __get_IAMPR(R) ({ unsigned long x; asm volatile("movsg iampr"#R",%0" : "=r"(x)); x; }) -#define __get_DAMPR(R) ({ unsigned long x; asm volatile("movsg dampr"#R",%0" : "=r"(x)); x; }) - -#define __get_IAMLR(R) ({ unsigned long x; asm volatile("movsg iamlr"#R",%0" : "=r"(x)); x; }) -#define __get_DAMLR(R) ({ unsigned long x; asm volatile("movsg damlr"#R",%0" : "=r"(x)); x; }) - -#define __set_IAMPR(R,V) do { asm volatile("movgs %0,iampr"#R : : "r"(V)); } while(0) -#define __set_DAMPR(R,V) do { asm volatile("movgs %0,dampr"#R : : "r"(V)); } while(0) - -#define __set_IAMLR(R,V) do { asm volatile("movgs %0,iamlr"#R : : "r"(V)); } while(0) -#define __set_DAMLR(R,V) do { asm volatile("movgs %0,damlr"#R : : "r"(V)); } while(0) - -#define save_dampr(R, _dampr) \ -do { \ - asm volatile("movsg dampr"R",%0" : "=r"(_dampr)); \ -} while(0) - -#define restore_dampr(R, _dampr) \ -do { \ - asm volatile("movgs %0,dampr"R :: "r"(_dampr)); \ -} while(0) - -/* - * AMCR - Address Mapping Control Register - */ -#define AMCR_IAMRN 0x000000ff /* quantity of IAMPR registers */ -#define AMCR_DAMRN 0x0000ff00 /* quantity of DAMPR registers */ - -/* - * TTBR - Address Translation Table Base Register - */ -#define __get_TTBR() ({ unsigned long x; asm volatile("movsg ttbr,%0" : "=r"(x)); x; }) - -/* - * TPXR - TLB Probe Extend Register - */ -#define TPXR_E 0x00000001 -#define TPXR_LMAX_SHIFT 20 -#define TPXR_LMAX_SMASK 0xf -#define TPXR_WMAX_SHIFT 24 -#define TPXR_WMAX_SMASK 0xf -#define TPXR_WAY_SHIFT 28 -#define TPXR_WAY_SMASK 0xf - -/* - * DCR - Debug Control Register - */ -#define DCR_IBCE3 0x00000001 /* break on conditional insn pointed to by IBAR3 */ -#define DCR_IBE3 0x00000002 /* break on insn pointed to by IBAR3 */ -#define DCR_IBCE1 0x00000004 /* break on conditional insn pointed to by IBAR2 */ -#define DCR_IBE1 0x00000008 /* break on insn pointed to by IBAR2 */ -#define DCR_IBCE2 0x00000010 /* break on conditional insn pointed to by IBAR1 */ -#define DCR_IBE2 0x00000020 /* break on insn pointed to by IBAR1 */ -#define DCR_IBCE0 0x00000040 /* break on conditional insn pointed to by IBAR0 */ -#define DCR_IBE0 0x00000080 /* break on insn pointed to by IBAR0 */ - -#define DCR_DDBE1 0x00004000 /* use DBDR1x when checking DBAR1 */ -#define DCR_DWBE1 0x00008000 /* break on store to address in DBAR1/DBMR1x */ -#define DCR_DRBE1 0x00010000 /* break on load from address in DBAR1/DBMR1x */ -#define DCR_DDBE0 0x00020000 /* use DBDR0x when checking DBAR0 */ -#define DCR_DWBE0 0x00040000 /* break on store to address in DBAR0/DBMR0x */ -#define DCR_DRBE0 0x00080000 /* break on load from address in DBAR0/DBMR0x */ - -#define DCR_EIM 0x0c000000 /* external interrupt disable */ -#define DCR_IBM 0x10000000 /* instruction break disable */ -#define DCR_SE 0x20000000 /* single step enable */ -#define DCR_EBE 0x40000000 /* exception break enable */ - -/* - * BRR - Break Interrupt Request Register - */ -#define BRR_ST 0x00000001 /* single-step detected */ -#define BRR_SB 0x00000002 /* break instruction detected */ -#define BRR_BB 0x00000004 /* branch with hint detected */ -#define BRR_CBB 0x00000008 /* branch to LR detected */ -#define BRR_IBx 0x000000f0 /* hardware breakpoint detected */ -#define BRR_DBx 0x00000f00 /* hardware watchpoint detected */ -#define BRR_DBNEx 0x0000f000 /* ? */ -#define BRR_EBTT 0x00ff0000 /* trap type of exception break */ -#define BRR_TB 0x10000000 /* external break request detected */ -#define BRR_CB 0x20000000 /* ICE break command detected */ -#define BRR_EB 0x40000000 /* exception break detected */ - -/* - * BPSR - Break PSR Save Register - */ -#define BPSR_BET 0x00000001 /* former PSR.ET */ -#define BPSR_BS 0x00001000 /* former PSR.S */ - -#endif /* _ASM_SPR_REGS_H */ diff --git a/arch/frv/include/asm/string.h b/arch/frv/include/asm/string.h deleted file mode 100644 index 1f6c35990439..000000000000 --- a/arch/frv/include/asm/string.h +++ /dev/null @@ -1,50 +0,0 @@ -/* string.h: FRV string handling - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_STRING_H_ -#define _ASM_STRING_H_ - -#ifdef __KERNEL__ /* only set these up for kernel code */ - -#define __HAVE_ARCH_MEMSET 1 -#define __HAVE_ARCH_MEMCPY 1 - -extern void *memset(void *, int, __kernel_size_t); -extern void *memcpy(void *, const void *, __kernel_size_t); - -#else /* KERNEL */ - -/* - * let user libraries deal with these, - * IMHO the kernel has no place defining these functions for user apps - */ - -#define __HAVE_ARCH_STRCPY 1 -#define __HAVE_ARCH_STRNCPY 1 -#define __HAVE_ARCH_STRCAT 1 -#define __HAVE_ARCH_STRNCAT 1 -#define __HAVE_ARCH_STRCMP 1 -#define __HAVE_ARCH_STRNCMP 1 -#define __HAVE_ARCH_STRCHR 1 -#define __HAVE_ARCH_STRRCHR 1 -#define __HAVE_ARCH_STRSTR 1 -#define __HAVE_ARCH_STRLEN 1 -#define __HAVE_ARCH_STRNLEN 1 -#define __HAVE_ARCH_MEMSET 1 -#define __HAVE_ARCH_MEMCPY 1 -#define __HAVE_ARCH_MEMMOVE 1 -#define __HAVE_ARCH_MEMSCAN 1 -#define __HAVE_ARCH_MEMCMP 1 -#define __HAVE_ARCH_MEMCHR 1 -#define __HAVE_ARCH_STRTOK 1 - -#endif /* KERNEL */ -#endif /* _ASM_STRING_H_ */ diff --git a/arch/frv/include/asm/switch_to.h b/arch/frv/include/asm/switch_to.h deleted file mode 100644 index 2cf0f6a7fbb1..000000000000 --- a/arch/frv/include/asm/switch_to.h +++ /dev/null @@ -1,35 +0,0 @@ -/* FR-V CPU basic task switching - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_SWITCH_TO_H -#define _ASM_SWITCH_TO_H - -#include - -/* - * switch_to(prev, next) should switch from task `prev' to `next' - * `prev' will never be the same as `next'. - * The `mb' is to tell GCC not to cache `current' across this call. - */ -extern asmlinkage -struct task_struct *__switch_to(struct thread_struct *prev_thread, - struct thread_struct *next_thread, - struct task_struct *prev); - -#define switch_to(prev, next, last) \ -do { \ - (prev)->thread.sched_lr = \ - (unsigned long) __builtin_return_address(0); \ - (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \ - mb(); \ -} while(0) - -#endif /* _ASM_SWITCH_TO_H */ diff --git a/arch/frv/include/asm/syscall.h b/arch/frv/include/asm/syscall.h deleted file mode 100644 index 70689eb29b98..000000000000 --- a/arch/frv/include/asm/syscall.h +++ /dev/null @@ -1,123 +0,0 @@ -/* syscall parameter access functions - * - * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public Licence - * as published by the Free Software Foundation; either version - * 2 of the Licence, or (at your option) any later version. - */ - -#ifndef _ASM_SYSCALL_H -#define _ASM_SYSCALL_H - -#include -#include - -/* - * Get the system call number or -1 - */ -static inline long syscall_get_nr(struct task_struct *task, - struct pt_regs *regs) -{ - return regs->syscallno; -} - -/* - * Restore the clobbered GR8 register - * (1st syscall arg was overwritten with syscall return or error) - */ -static inline void syscall_rollback(struct task_struct *task, - struct pt_regs *regs) -{ - regs->gr8 = regs->orig_gr8; -} - -/* - * See if the syscall return value is an error, returning it if it is and 0 if - * not - */ -static inline long syscall_get_error(struct task_struct *task, - struct pt_regs *regs) -{ - return IS_ERR_VALUE(regs->gr8) ? regs->gr8 : 0; -} - -/* - * Get the syscall return value - */ -static inline long syscall_get_return_value(struct task_struct *task, - struct pt_regs *regs) -{ - return regs->gr8; -} - -/* - * Set the syscall return value - */ -static inline void syscall_set_return_value(struct task_struct *task, - struct pt_regs *regs, - int error, long val) -{ - if (error) - regs->gr8 = -error; - else - regs->gr8 = val; -} - -/* - * Retrieve the system call arguments - */ -static inline void syscall_get_arguments(struct task_struct *task, - struct pt_regs *regs, - unsigned int i, unsigned int n, - unsigned long *args) -{ - /* - * Do this simply for now. If we need to start supporting - * fetching arguments from arbitrary indices, this will need some - * extra logic. Presently there are no in-tree users that depend - * on this behaviour. - */ - BUG_ON(i); - - /* Argument pattern is: GR8, GR9, GR10, GR11, GR12, GR13 */ - switch (n) { - case 6: args[5] = regs->gr13; - case 5: args[4] = regs->gr12; - case 4: args[3] = regs->gr11; - case 3: args[2] = regs->gr10; - case 2: args[1] = regs->gr9; - case 1: args[0] = regs->gr8; - break; - default: - BUG(); - } -} - -/* - * Alter the system call arguments - */ -static inline void syscall_set_arguments(struct task_struct *task, - struct pt_regs *regs, - unsigned int i, unsigned int n, - const unsigned long *args) -{ - /* Same note as above applies */ - BUG_ON(i); - - switch (n) { - case 6: regs->gr13 = args[5]; - case 5: regs->gr12 = args[4]; - case 4: regs->gr11 = args[3]; - case 3: regs->gr10 = args[2]; - case 2: regs->gr9 = args[1]; - case 1: regs->gr8 = args[0]; - break; - default: - BUG(); - } -} - -#endif /* _ASM_SYSCALL_H */ diff --git a/arch/frv/include/asm/termios.h b/arch/frv/include/asm/termios.h deleted file mode 100644 index 5a8c63554617..000000000000 --- a/arch/frv/include/asm/termios.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_TERMIOS_H -#define _ASM_TERMIOS_H - -#include - -/* intr=^C quit=^| erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" -#include -#endif /* _ASM_TERMIOS_H */ diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h deleted file mode 100644 index 0f950845fad9..000000000000 --- a/arch/frv/include/asm/thread_info.h +++ /dev/null @@ -1,116 +0,0 @@ -/* thread_info.h: description - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * Derived from include/asm-i386/thread_info.h - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_THREAD_INFO_H -#define _ASM_THREAD_INFO_H - -#ifdef __KERNEL__ - -#ifndef __ASSEMBLY__ -#include -#endif - -#define THREAD_SIZE 8192 - -/* - * low level task data that entry.S needs immediate access to - * - this struct should fit entirely inside of one cache line - * - this struct shares the supervisor stack pages - * - if the contents of this structure are changed, the assembly constants must also be changed - */ -#ifndef __ASSEMBLY__ - -struct thread_info { - struct task_struct *task; /* main task structure */ - unsigned long flags; /* low level flags */ - unsigned long status; /* thread-synchronous flags */ - __u32 cpu; /* current CPU */ - int preempt_count; /* 0 => preemptable, <0 => BUG */ - - mm_segment_t addr_limit; /* thread address space: - * 0-0xBFFFFFFF for user-thead - * 0-0xFFFFFFFF for kernel-thread - */ - - __u8 supervisor_stack[0]; -}; - -#else /* !__ASSEMBLY__ */ - -#include - -#endif - -/* - * macros/functions for gaining access to the thread information structure - */ -#ifndef __ASSEMBLY__ - -#define INIT_THREAD_INFO(tsk) \ -{ \ - .task = &tsk, \ - .flags = 0, \ - .cpu = 0, \ - .preempt_count = INIT_PREEMPT_COUNT, \ - .addr_limit = KERNEL_DS, \ -} - -/* how to get the thread information struct from C */ -register struct thread_info *__current_thread_info asm("gr15"); - -#define current_thread_info() ({ __current_thread_info; }) - -#endif /* __ASSEMBLY__ */ - -/* - * thread information flags - * - these are process state flags that various assembly files may need to access - * - pending work-to-be-done flags are in LSW - * - other flags in MSW - */ -#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ -#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ -#define TIF_SIGPENDING 2 /* signal pending */ -#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ -#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ -#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ -#define TIF_MEMDIE 7 /* is terminating due to OOM killer */ - -#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) -#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) -#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) -#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) -#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) - -/* work to do on interrupt/exception return */ -#define _TIF_WORK_MASK \ - (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_SINGLESTEP) - -/* work to do on any return to u-space */ -#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK | _TIF_SYSCALL_TRACE) - -#if _TIF_ALLWORK_MASK >= 0x2000 -#error "_TIF_ALLWORK_MASK won't fit in an ANDI now (see entry.S)" -#endif - -/* - * Thread-synchronous status. - * - * This is different from the flags in that nobody else - * ever touches our thread-synchronous status, so we don't - * have to worry about atomic accesses. - */ -#define TS_USEDFPM 0x0001 /* FPU/Media was used by this task this quantum (SMP) */ - -#endif /* __KERNEL__ */ - -#endif /* _ASM_THREAD_INFO_H */ diff --git a/arch/frv/include/asm/timer-regs.h b/arch/frv/include/asm/timer-regs.h deleted file mode 100644 index 6c5a871ce5e9..000000000000 --- a/arch/frv/include/asm/timer-regs.h +++ /dev/null @@ -1,106 +0,0 @@ -/* timer-regs.h: hardware timer register definitions - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_TIMER_REGS_H -#define _ASM_TIMER_REGS_H - -#include - -extern unsigned long __nongprelbss __clkin_clock_speed_HZ; -extern unsigned long __nongprelbss __ext_bus_clock_speed_HZ; -extern unsigned long __nongprelbss __res_bus_clock_speed_HZ; -extern unsigned long __nongprelbss __sdram_clock_speed_HZ; -extern unsigned long __nongprelbss __core_bus_clock_speed_HZ; -extern unsigned long __nongprelbss __core_clock_speed_HZ; -extern unsigned long __nongprelbss __dsu_clock_speed_HZ; -extern unsigned long __nongprelbss __serial_clock_speed_HZ; - -#define __get_CLKC() ({ *(volatile unsigned long *)(0xfeff9a00); }) - -static inline void __set_CLKC(unsigned long v) -{ - int tmp; - - asm volatile(" st%I0.p %2,%M0 \n" - " setlos %3,%1 \n" - " membar \n" - "0: \n" - " subicc %1,#1,%1,icc0 \n" - " bnc icc0,#1,0b \n" - : "=m"(*(volatile unsigned long *) 0xfeff9a00), "=r"(tmp) - : "r"(v), "i"(256) - : "icc0"); -} - -#define __get_TCTR() ({ *(volatile unsigned long *)(0xfeff9418); }) -#define __get_TPRV() ({ *(volatile unsigned long *)(0xfeff9420); }) -#define __get_TPRCKSL() ({ *(volatile unsigned long *)(0xfeff9428); }) -#define __get_TCSR(T) ({ *(volatile unsigned long *)(0xfeff9400 + 8 * (T)); }) -#define __get_TxCKSL(T) ({ *(volatile unsigned long *)(0xfeff9430 + 8 * (T)); }) - -#define __get_TCSR_DATA(T) ({ __get_TCSR(T) >> 24; }) - -#define __set_TCTR(V) do { *(volatile unsigned long *)(0xfeff9418) = (V); mb(); } while(0) -#define __set_TPRV(V) do { *(volatile unsigned long *)(0xfeff9420) = (V) << 24; mb(); } while(0) -#define __set_TPRCKSL(V) do { *(volatile unsigned long *)(0xfeff9428) = (V); mb(); } while(0) -#define __set_TCSR(T,V) \ -do { *(volatile unsigned long *)(0xfeff9400 + 8 * (T)) = (V); mb(); } while(0) - -#define __set_TxCKSL(T,V) \ -do { *(volatile unsigned long *)(0xfeff9430 + 8 * (T)) = (V); mb(); } while(0) - -#define __set_TCSR_DATA(T,V) __set_TCSR(T, (V) << 24) -#define __set_TxCKSL_DATA(T,V) __set_TxCKSL(T, TxCKSL_EIGHT | __TxCKSL_SELECT((V))) - -/* clock control register */ -#define CLKC_CMODE 0x0f000000 -#define CLKC_SLPL 0x000f0000 -#define CLKC_P0 0x00000100 -#define CLKC_CM 0x00000003 - -#define CLKC_CMODE_s 24 - -/* timer control register - non-readback mode */ -#define TCTR_MODE_0 0x00000000 -#define TCTR_MODE_2 0x04000000 -#define TCTR_MODE_4 0x08000000 -#define TCTR_MODE_5 0x0a000000 -#define TCTR_RL_LATCH 0x00000000 -#define TCTR_RL_RW_LOW8 0x10000000 -#define TCTR_RL_RW_HIGH8 0x20000000 -#define TCTR_RL_RW_LH8 0x30000000 -#define TCTR_SC_CTR0 0x00000000 -#define TCTR_SC_CTR1 0x40000000 -#define TCTR_SC_CTR2 0x80000000 - -/* timer control register - readback mode */ -#define TCTR_CNT0 0x02000000 -#define TCTR_CNT1 0x04000000 -#define TCTR_CNT2 0x08000000 -#define TCTR_NSTATUS 0x10000000 -#define TCTR_NCOUNT 0x20000000 -#define TCTR_SC_READBACK 0xc0000000 - -/* timer control status registers - non-readback mode */ -#define TCSRx_DATA 0xff000000 - -/* timer control status registers - readback mode */ -#define TCSRx_OUTPUT 0x80000000 -#define TCSRx_NULLCOUNT 0x40000000 -#define TCSRx_RL 0x30000000 -#define TCSRx_MODE 0x07000000 - -/* timer clock select registers */ -#define TxCKSL_SELECT 0x0f000000 -#define __TxCKSL_SELECT(X) ((X) << 24) -#define TxCKSL_EIGHT 0xf0000000 - -#endif /* _ASM_TIMER_REGS_H */ diff --git a/arch/frv/include/asm/timex.h b/arch/frv/include/asm/timex.h deleted file mode 100644 index bf53166f2793..000000000000 --- a/arch/frv/include/asm/timex.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* timex.h: FR-V architecture timex specifications - */ -#ifndef _ASM_TIMEX_H -#define _ASM_TIMEX_H - -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ -#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ - -typedef unsigned long cycles_t; - -static inline cycles_t get_cycles(void) -{ - return 0; -} - -#define vxtime_lock() do {} while (0) -#define vxtime_unlock() do {} while (0) - -/* This attribute is used in include/linux/jiffies.h alongside with - * __cacheline_aligned_in_smp. It is assumed that __cacheline_aligned_in_smp - * for frv does not contain another section specification. - */ -#define __jiffy_arch_data __attribute__((__section__(".data"))) - -#endif - diff --git a/arch/frv/include/asm/tlb.h b/arch/frv/include/asm/tlb.h deleted file mode 100644 index d3e361ad725a..000000000000 --- a/arch/frv/include/asm/tlb.h +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_TLB_H -#define _ASM_TLB_H - -#include - -#ifdef CONFIG_MMU -extern void check_pgt_cache(void); -#else -#define check_pgt_cache() do {} while(0) -#endif - -/* - * we don't need any special per-pte or per-vma handling... - */ -#define tlb_start_vma(tlb, vma) do { } while (0) -#define tlb_end_vma(tlb, vma) do { } while (0) -#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0) - -/* - * .. because we flush the whole mm when it fills up - */ -#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) - -#include - -#endif /* _ASM_TLB_H */ - diff --git a/arch/frv/include/asm/tlbflush.h b/arch/frv/include/asm/tlbflush.h deleted file mode 100644 index 75879420f578..000000000000 --- a/arch/frv/include/asm/tlbflush.h +++ /dev/null @@ -1,73 +0,0 @@ -/* tlbflush.h: TLB flushing functions - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_TLBFLUSH_H -#define _ASM_TLBFLUSH_H - -#include -#include - -#ifdef CONFIG_MMU - -#ifndef __ASSEMBLY__ -extern asmlinkage void __flush_tlb_all(void); -extern asmlinkage void __flush_tlb_mm(unsigned long contextid); -extern asmlinkage void __flush_tlb_page(unsigned long contextid, unsigned long start); -extern asmlinkage void __flush_tlb_range(unsigned long contextid, - unsigned long start, unsigned long end); -#endif /* !__ASSEMBLY__ */ - -#define flush_tlb_all() \ -do { \ - preempt_disable(); \ - __flush_tlb_all(); \ - preempt_enable(); \ -} while(0) - -#define flush_tlb_mm(mm) \ -do { \ - preempt_disable(); \ - __flush_tlb_mm((mm)->context.id); \ - preempt_enable(); \ -} while(0) - -#define flush_tlb_range(vma,start,end) \ -do { \ - preempt_disable(); \ - __flush_tlb_range((vma)->vm_mm->context.id, start, end); \ - preempt_enable(); \ -} while(0) - -#define flush_tlb_page(vma,addr) \ -do { \ - preempt_disable(); \ - __flush_tlb_page((vma)->vm_mm->context.id, addr); \ - preempt_enable(); \ -} while(0) - - -#define __flush_tlb_global() flush_tlb_all() -#define flush_tlb() flush_tlb_all() -#define flush_tlb_kernel_range(start, end) flush_tlb_all() - -#else - -#define flush_tlb() BUG() -#define flush_tlb_all() BUG() -#define flush_tlb_mm(mm) BUG() -#define flush_tlb_page(vma,addr) BUG() -#define flush_tlb_range(mm,start,end) BUG() -#define flush_tlb_kernel_range(start, end) BUG() - -#endif - - -#endif /* _ASM_TLBFLUSH_H */ diff --git a/arch/frv/include/asm/topology.h b/arch/frv/include/asm/topology.h deleted file mode 100644 index 207603071f78..000000000000 --- a/arch/frv/include/asm/topology.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_TOPOLOGY_H -#define _ASM_TOPOLOGY_H - -#ifdef CONFIG_NUMA - -#error NUMA not supported yet - -#endif /* CONFIG_NUMA */ - -#include - -#endif /* _ASM_TOPOLOGY_H */ diff --git a/arch/frv/include/asm/types.h b/arch/frv/include/asm/types.h deleted file mode 100644 index 6bc63650d832..000000000000 --- a/arch/frv/include/asm/types.h +++ /dev/null @@ -1,22 +0,0 @@ -/* types.h: FRV types - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_TYPES_H -#define _ASM_TYPES_H - -#include - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ - -#define BITS_PER_LONG 32 - -#endif /* _ASM_TYPES_H */ diff --git a/arch/frv/include/asm/uaccess.h b/arch/frv/include/asm/uaccess.h deleted file mode 100644 index ff9562dc6825..000000000000 --- a/arch/frv/include/asm/uaccess.h +++ /dev/null @@ -1,285 +0,0 @@ -/* uaccess.h: userspace accessor functions - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_UACCESS_H -#define _ASM_UACCESS_H - -/* - * User space memory access functions - */ -#include -#include -#include -#include - -#define __ptr(x) ((unsigned long __force *)(x)) - -/* - * check that a range of addresses falls within the current address limit - */ -static inline int ___range_ok(unsigned long addr, unsigned long size) -{ -#ifdef CONFIG_MMU - int flag = -EFAULT, tmp; - - asm volatile ( - " addcc %3,%2,%1,icc0 \n" /* set C-flag if addr+size>4GB */ - " subcc.p %1,%4,gr0,icc1 \n" /* jump if addr+size>limit */ - " bc icc0,#0,0f \n" - " bhi icc1,#0,0f \n" - " setlos #0,%0 \n" /* mark okay */ - "0: \n" - : "=r"(flag), "=&r"(tmp) - : "r"(addr), "r"(size), "r"(get_addr_limit()), "0"(flag) - ); - - return flag; - -#else - - if (addr < memory_start || - addr > memory_end || - size > memory_end - memory_start || - addr + size > memory_end) - return -EFAULT; - - return 0; -#endif -} - -#define __range_ok(addr,size) ___range_ok((unsigned long) (addr), (unsigned long) (size)) - -#define access_ok(type,addr,size) (__range_ok((void __user *)(addr), (size)) == 0) -#define __access_ok(addr,size) (__range_ok((addr), (size)) == 0) - - -/* - * These are the main single-value transfer routines. They automatically - * use the right size if we just have the right pointer type. - */ -#define __put_user(x, ptr) \ -({ \ - int __pu_err = 0; \ - \ - typeof(*(ptr)) __pu_val = (x); \ - __chk_user_ptr(ptr); \ - \ - switch (sizeof (*(ptr))) { \ - case 1: \ - __put_user_asm(__pu_err, __pu_val, ptr, "b", "r"); \ - break; \ - case 2: \ - __put_user_asm(__pu_err, __pu_val, ptr, "h", "r"); \ - break; \ - case 4: \ - __put_user_asm(__pu_err, __pu_val, ptr, "", "r"); \ - break; \ - case 8: \ - __put_user_asm(__pu_err, __pu_val, ptr, "d", "e"); \ - break; \ - default: \ - __pu_err = __put_user_bad(); \ - break; \ - } \ - __pu_err; \ -}) - -#define put_user(x, ptr) \ -({ \ - typeof(*(ptr)) __user *_p = (ptr); \ - int _e; \ - \ - _e = __range_ok(_p, sizeof(*_p)); \ - if (_e == 0) \ - _e = __put_user((x), _p); \ - _e; \ -}) - -extern int __put_user_bad(void); - -/* - * Tell gcc we read from memory instead of writing: this is because - * we do not write to any memory gcc knows about, so there are no - * aliasing issues. - */ - -#ifdef CONFIG_MMU - -#define __put_user_asm(err,x,ptr,dsize,constraint) \ -do { \ - asm volatile("1: st"dsize"%I1 %2,%M1 \n" \ - "2: \n" \ - ".subsection 2 \n" \ - "3: setlos %3,%0 \n" \ - " bra 2b \n" \ - ".previous \n" \ - ".section __ex_table,\"a\" \n" \ - " .balign 8 \n" \ - " .long 1b,3b \n" \ - ".previous" \ - : "=r" (err) \ - : "m" (*__ptr(ptr)), constraint (x), "i"(-EFAULT), "0"(err) \ - : "memory"); \ -} while (0) - -#else - -#define __put_user_asm(err,x,ptr,bwl,con) \ -do { \ - asm(" st"bwl"%I0 %1,%M0 \n" \ - " membar \n" \ - : \ - : "m" (*__ptr(ptr)), con (x) \ - : "memory"); \ -} while (0) - -#endif - -/*****************************************************************************/ -/* - * - */ -#define __get_user(x, ptr) \ -({ \ - int __gu_err = 0; \ - __chk_user_ptr(ptr); \ - \ - switch (sizeof(*(ptr))) { \ - case 1: { \ - unsigned char __gu_val; \ - __get_user_asm(__gu_err, __gu_val, ptr, "ub", "=r"); \ - (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \ - break; \ - } \ - case 2: { \ - unsigned short __gu_val; \ - __get_user_asm(__gu_err, __gu_val, ptr, "uh", "=r"); \ - (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \ - break; \ - } \ - case 4: { \ - unsigned int __gu_val; \ - __get_user_asm(__gu_err, __gu_val, ptr, "", "=r"); \ - (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \ - break; \ - } \ - case 8: { \ - unsigned long long __gu_val; \ - __get_user_asm(__gu_err, __gu_val, ptr, "d", "=e"); \ - (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \ - break; \ - } \ - default: \ - __gu_err = __get_user_bad(); \ - break; \ - } \ - __gu_err; \ -}) - -#define get_user(x, ptr) \ -({ \ - const typeof(*(ptr)) __user *_p = (ptr);\ - int _e; \ - \ - _e = __range_ok(_p, sizeof(*_p)); \ - if (likely(_e == 0)) \ - _e = __get_user((x), _p); \ - else \ - (x) = (typeof(x)) 0; \ - _e; \ -}) - -extern int __get_user_bad(void); - -#ifdef CONFIG_MMU - -#define __get_user_asm(err,x,ptr,dtype,constraint) \ -do { \ - asm("1: ld"dtype"%I2 %M2,%1 \n" \ - "2: \n" \ - ".subsection 2 \n" \ - "3: setlos %3,%0 \n" \ - " setlos #0,%1 \n" \ - " bra 2b \n" \ - ".previous \n" \ - ".section __ex_table,\"a\" \n" \ - " .balign 8 \n" \ - " .long 1b,3b \n" \ - ".previous" \ - : "=r" (err), constraint (x) \ - : "m" (*__ptr(ptr)), "i"(-EFAULT), "0"(err) \ - ); \ -} while(0) - -#else - -#define __get_user_asm(err,x,ptr,bwl,con) \ - asm(" ld"bwl"%I1 %M1,%0 \n" \ - " membar \n" \ - : con(x) \ - : "m" (*__ptr(ptr))) - -#endif - -/*****************************************************************************/ -/* - * - */ - -#define ____force(x) (__force void *)(void __user *)(x) -#ifdef CONFIG_MMU -extern long __memset_user(void *dst, unsigned long count); -extern long __memcpy_user(void *dst, const void *src, unsigned long count); - -#define __clear_user(dst,count) __memset_user(____force(dst), (count)) - -#else - -#define __clear_user(dst,count) (memset(____force(dst), 0, (count)), 0) - -#endif - -static inline unsigned long -raw_copy_from_user(void *to, const void __user *from, unsigned long n) -{ -#ifdef CONFIG_MMU - return __memcpy_user(to, (__force const void *)from, n); -#else - memcpy(to, (__force const void *)from, n); - return 0; -#endif -} - -static inline unsigned long -raw_copy_to_user(void __user *to, const void *from, unsigned long n) -{ -#ifdef CONFIG_MMU - return __memcpy_user((__force void *)to, from, n); -#else - memcpy((__force void *)to, from, n); - return 0; -#endif -} -#define INLINE_COPY_TO_USER -#define INLINE_COPY_FROM_USER - -static inline unsigned long __must_check -clear_user(void __user *to, unsigned long n) -{ - if (likely(__access_ok(to, n))) - n = __clear_user(to, n); - return n; -} - -extern long strncpy_from_user(char *dst, const char __user *src, long count); -extern long strnlen_user(const char __user *src, long count); - -#endif /* _ASM_UACCESS_H */ diff --git a/arch/frv/include/asm/ucontext.h b/arch/frv/include/asm/ucontext.h deleted file mode 100644 index 0cc2d95dd209..000000000000 --- a/arch/frv/include/asm/ucontext.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_UCONTEXT_H -#define _ASM_UCONTEXT_H - -struct ucontext { - unsigned long uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - struct sigcontext uc_mcontext; - sigset_t uc_sigmask; /* mask last for extensibility */ -}; - -#endif diff --git a/arch/frv/include/asm/unaligned.h b/arch/frv/include/asm/unaligned.h deleted file mode 100644 index 6c61c05b2e0c..000000000000 --- a/arch/frv/include/asm/unaligned.h +++ /dev/null @@ -1,22 +0,0 @@ -/* unaligned.h: unaligned access handler - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_UNALIGNED_H -#define _ASM_UNALIGNED_H - -#include -#include -#include - -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be - -#endif /* _ASM_UNALIGNED_H */ diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h deleted file mode 100644 index b4b3f9b26b81..000000000000 --- a/arch/frv/include/asm/unistd.h +++ /dev/null @@ -1,34 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_UNISTD_H_ -#define _ASM_UNISTD_H_ - -#include - - -#define NR_syscalls 338 - -/* #define __ARCH_WANT_OLD_READDIR */ -#define __ARCH_WANT_OLD_STAT -#define __ARCH_WANT_STAT64 -#define __ARCH_WANT_SYS_ALARM -/* #define __ARCH_WANT_SYS_GETHOSTNAME */ -#define __ARCH_WANT_SYS_IPC -#define __ARCH_WANT_SYS_PAUSE -/* #define __ARCH_WANT_SYS_SIGNAL */ -#define __ARCH_WANT_SYS_TIME -#define __ARCH_WANT_SYS_UTIME -#define __ARCH_WANT_SYS_WAITPID -#define __ARCH_WANT_SYS_SOCKETCALL -#define __ARCH_WANT_SYS_FADVISE64 -#define __ARCH_WANT_SYS_GETPGRP -#define __ARCH_WANT_SYS_LLSEEK -#define __ARCH_WANT_SYS_NICE -/* #define __ARCH_WANT_SYS_OLD_GETRLIMIT */ -#define __ARCH_WANT_SYS_OLDUMOUNT -/* #define __ARCH_WANT_SYS_SIGPENDING */ -#define __ARCH_WANT_SYS_SIGPROCMASK -#define __ARCH_WANT_SYS_FORK -#define __ARCH_WANT_SYS_VFORK -#define __ARCH_WANT_SYS_CLONE - -#endif /* _ASM_UNISTD_H_ */ diff --git a/arch/frv/include/asm/user.h b/arch/frv/include/asm/user.h deleted file mode 100644 index 82fa8fab64ae..000000000000 --- a/arch/frv/include/asm/user.h +++ /dev/null @@ -1,80 +0,0 @@ -/* user.h: FR-V core file format stuff - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_USER_H -#define _ASM_USER_H - -#include -#include - -/* Core file format: The core file is written in such a way that gdb - * can understand it and provide useful information to the user (under - * linux we use the 'trad-core' bfd). There are quite a number of - * obstacles to being able to view the contents of the floating point - * registers, and until these are solved you will not be able to view - * the contents of them. Actually, you can read in the core file and - * look at the contents of the user struct to find out what the - * floating point registers contain. - * - * The actual file contents are as follows: - * UPAGE: - * 1 page consisting of a user struct that tells gdb what is present - * in the file. Directly after this is a copy of the task_struct, - * which is currently not used by gdb, but it may come in useful at - * some point. All of the registers are stored as part of the - * upage. The upage should always be only one page. - * - * DATA: - * The data area is stored. We use current->end_text to - * current->brk to pick up all of the user variables, plus any - * memory that may have been malloced. No attempt is made to - * determine if a page is demand-zero or if a page is totally - * unused, we just cover the entire range. All of the addresses are - * rounded in such a way that an integral number of pages is - * written. - * - * STACK: - * We need the stack information in order to get a meaningful - * backtrace. We need to write the data from (esp) to - * current->start_stack, so we round each of these off in order to - * be able to write an integer number of pages. The minimum core - * file size is 3 pages, or 12288 bytes. - */ - -/* When the kernel dumps core, it starts by dumping the user struct - - * this will be used by gdb to figure out where the data and stack segments - * are within the file, and what virtual addresses to use. - */ -struct user { - /* We start with the registers, to mimic the way that "memory" is returned - * from the ptrace(3,...) function. */ - struct user_context regs; - - /* The rest of this junk is to help gdb figure out what goes where */ - unsigned long u_tsize; /* Text segment size (pages). */ - unsigned long u_dsize; /* Data segment size (pages). */ - unsigned long u_ssize; /* Stack segment size (pages). */ - unsigned long start_code; /* Starting virtual address of text. */ - unsigned long start_stack; /* Starting virtual address of stack area. - * This is actually the bottom of the stack, - * the top of the stack is always found in the - * esp register. */ - long int signal; /* Signal that caused the core dump. */ - - unsigned long magic; /* To uniquely identify a core file */ - char u_comm[32]; /* User command that was responsible */ -}; - -#define NBPG PAGE_SIZE -#define UPAGES 1 -#define HOST_TEXT_START_ADDR (u.start_code) -#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) - -#endif diff --git a/arch/frv/include/asm/vga.h b/arch/frv/include/asm/vga.h deleted file mode 100644 index a702c800a229..000000000000 --- a/arch/frv/include/asm/vga.h +++ /dev/null @@ -1,17 +0,0 @@ -/* vga.h: VGA register stuff - * - * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _ASM_VGA_H -#define _ASM_VGA_H - - - -#endif /* _ASM_VGA_H */ diff --git a/arch/frv/include/asm/virtconvert.h b/arch/frv/include/asm/virtconvert.h deleted file mode 100644 index b26d70ab9111..000000000000 --- a/arch/frv/include/asm/virtconvert.h +++ /dev/null @@ -1,41 +0,0 @@ -/* virtconvert.h: virtual/physical/page address conversion - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_VIRTCONVERT_H -#define _ASM_VIRTCONVERT_H - -/* - * Macros used for converting between virtual and physical mappings. - */ - -#ifdef __KERNEL__ - -#include - -#ifdef CONFIG_MMU - -#define phys_to_virt(vaddr) ((void *) ((unsigned long)(vaddr) + PAGE_OFFSET)) -#define virt_to_phys(vaddr) ((unsigned long) (vaddr) - PAGE_OFFSET) - -#else - -#define phys_to_virt(vaddr) ((void *) (vaddr)) -#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) - -#endif - -#define virt_to_bus virt_to_phys -#define bus_to_virt phys_to_virt - -#define __page_address(page) (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT)) -#define page_to_phys(page) virt_to_phys((void *)__page_address(page)) - -#endif -#endif diff --git a/arch/frv/include/asm/xor.h b/arch/frv/include/asm/xor.h deleted file mode 100644 index c82eb12a5b18..000000000000 --- a/arch/frv/include/asm/xor.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/frv/include/uapi/asm/Kbuild b/arch/frv/include/uapi/asm/Kbuild deleted file mode 100644 index 5354b0f84d41..000000000000 --- a/arch/frv/include/uapi/asm/Kbuild +++ /dev/null @@ -1,5 +0,0 @@ -# UAPI Header export list -include include/uapi/asm-generic/Kbuild.asm - -generic-y += siginfo.h -generic-y += bpf_perf_event.h diff --git a/arch/frv/include/uapi/asm/auxvec.h b/arch/frv/include/uapi/asm/auxvec.h deleted file mode 100644 index 07710778fa10..000000000000 --- a/arch/frv/include/uapi/asm/auxvec.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef __FRV_AUXVEC_H -#define __FRV_AUXVEC_H - -#endif diff --git a/arch/frv/include/uapi/asm/bitsperlong.h b/arch/frv/include/uapi/asm/bitsperlong.h deleted file mode 100644 index 76da34b10f59..000000000000 --- a/arch/frv/include/uapi/asm/bitsperlong.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/frv/include/uapi/asm/byteorder.h b/arch/frv/include/uapi/asm/byteorder.h deleted file mode 100644 index a46f6472acdc..000000000000 --- a/arch/frv/include/uapi/asm/byteorder.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_BYTEORDER_H -#define _ASM_BYTEORDER_H - -#include - -#endif /* _ASM_BYTEORDER_H */ diff --git a/arch/frv/include/uapi/asm/errno.h b/arch/frv/include/uapi/asm/errno.h deleted file mode 100644 index c5b82f2f2970..000000000000 --- a/arch/frv/include/uapi/asm/errno.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_ERRNO_H -#define _ASM_ERRNO_H - -#include - -#endif /* _ASM_ERRNO_H */ - diff --git a/arch/frv/include/uapi/asm/fcntl.h b/arch/frv/include/uapi/asm/fcntl.h deleted file mode 100644 index a77648c505d1..000000000000 --- a/arch/frv/include/uapi/asm/fcntl.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/frv/include/uapi/asm/ioctl.h b/arch/frv/include/uapi/asm/ioctl.h deleted file mode 100644 index b809c4566e5f..000000000000 --- a/arch/frv/include/uapi/asm/ioctl.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/frv/include/uapi/asm/ioctls.h b/arch/frv/include/uapi/asm/ioctls.h deleted file mode 100644 index dd9f5eb9feda..000000000000 --- a/arch/frv/include/uapi/asm/ioctls.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef __ASM_IOCTLS_H__ -#define __ASM_IOCTLS_H__ - -#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ -#define FIOQSIZE 0x545E - -#include - -#endif /* __ASM_IOCTLS_H__ */ - diff --git a/arch/frv/include/uapi/asm/ipcbuf.h b/arch/frv/include/uapi/asm/ipcbuf.h deleted file mode 100644 index 90d6445a14df..000000000000 --- a/arch/frv/include/uapi/asm/ipcbuf.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/frv/include/uapi/asm/kvm_para.h b/arch/frv/include/uapi/asm/kvm_para.h deleted file mode 100644 index baacc4996d18..000000000000 --- a/arch/frv/include/uapi/asm/kvm_para.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/frv/include/uapi/asm/mman.h b/arch/frv/include/uapi/asm/mman.h deleted file mode 100644 index 306fc0460b80..000000000000 --- a/arch/frv/include/uapi/asm/mman.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/frv/include/uapi/asm/msgbuf.h b/arch/frv/include/uapi/asm/msgbuf.h deleted file mode 100644 index 156c81bb46d7..000000000000 --- a/arch/frv/include/uapi/asm/msgbuf.h +++ /dev/null @@ -1,33 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_MSGBUF_H -#define _ASM_MSGBUF_H - -/* - * The msqid64_ds structure for FR-V architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct msqid64_ds { - struct ipc64_perm msg_perm; - __kernel_time_t msg_stime; /* last msgsnd time */ - unsigned long __unused1; - __kernel_time_t msg_rtime; /* last msgrcv time */ - unsigned long __unused2; - __kernel_time_t msg_ctime; /* last change time */ - unsigned long __unused3; - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused4; - unsigned long __unused5; -}; - -#endif /* _ASM_MSGBUF_H */ - diff --git a/arch/frv/include/uapi/asm/param.h b/arch/frv/include/uapi/asm/param.h deleted file mode 100644 index d3e0168d8937..000000000000 --- a/arch/frv/include/uapi/asm/param.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_PARAM_H -#define _ASM_PARAM_H - -#define EXEC_PAGESIZE 16384 - -#include - -#endif /* _ASM_PARAM_H */ diff --git a/arch/frv/include/uapi/asm/poll.h b/arch/frv/include/uapi/asm/poll.h deleted file mode 100644 index f55b45f475ec..000000000000 --- a/arch/frv/include/uapi/asm/poll.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_POLL_H -#define _ASM_POLL_H - -#define POLLWRNORM POLLOUT -#define POLLWRBAND 256 - -#include -#undef POLLREMOVE - -#endif diff --git a/arch/frv/include/uapi/asm/posix_types.h b/arch/frv/include/uapi/asm/posix_types.h deleted file mode 100644 index 2995777227b3..000000000000 --- a/arch/frv/include/uapi/asm/posix_types.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_POSIX_TYPES_H -#define _ASM_POSIX_TYPES_H - -/* - * This file is generally used by user-level software, so you need to - * be a little careful about namespace pollution etc. Also, we cannot - * assume GCC is being used. - */ - -typedef unsigned short __kernel_mode_t; -#define __kernel_mode_t __kernel_mode_t - -typedef unsigned short __kernel_ipc_pid_t; -#define __kernel_ipc_pid_t __kernel_ipc_pid_t - -typedef unsigned short __kernel_uid_t; -typedef unsigned short __kernel_gid_t; -#define __kernel_uid_t __kernel_uid_t - -typedef unsigned short __kernel_old_dev_t; -#define __kernel_old_dev_t __kernel_old_dev_t - -#include - -#endif - diff --git a/arch/frv/include/uapi/asm/ptrace.h b/arch/frv/include/uapi/asm/ptrace.h deleted file mode 100644 index f1d2f652d083..000000000000 --- a/arch/frv/include/uapi/asm/ptrace.h +++ /dev/null @@ -1,61 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ -/* ptrace.h: ptrace() relevant definitions - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _UAPI_ASM_PTRACE_H -#define _UAPI_ASM_PTRACE_H - -#include - - -#define PT_PSR 0 -#define PT_ISR 1 -#define PT_CCR 2 -#define PT_CCCR 3 -#define PT_LR 4 -#define PT_LCR 5 -#define PT_PC 6 - -#define PT__STATUS 7 /* exception status */ -#define PT_SYSCALLNO 8 /* syscall number or -1 */ -#define PT_ORIG_GR8 9 /* saved GR8 for signal handling */ -#define PT_GNER0 10 -#define PT_GNER1 11 -#define PT_IACC0H 12 -#define PT_IACC0L 13 - -#define PT_GR(j) ( 14 + (j)) /* GRj for 0<=j<=63 */ -#define PT_FR(j) ( 78 + (j)) /* FRj for 0<=j<=63 */ -#define PT_FNER(j) (142 + (j)) /* FNERj for 0<=j<=1 */ -#define PT_MSR(j) (144 + (j)) /* MSRj for 0<=j<=2 */ -#define PT_ACC(j) (146 + (j)) /* ACCj for 0<=j<=7 */ -#define PT_ACCG(jklm) (154 + (jklm)) /* ACCGjklm for 0<=jklm<=1 (reads four regs per slot) */ -#define PT_FSR(j) (156 + (j)) /* FSRj for 0<=j<=0 */ -#define PT__GPEND 78 -#define PT__END 157 - -#define PT_TBR PT_GR(0) -#define PT_SP PT_GR(1) -#define PT_FP PT_GR(2) -#define PT_PREV_FRAME PT_GR(28) /* previous exception frame pointer (old gr28 value) */ -#define PT_CURR_TASK PT_GR(29) /* current task */ - - -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -#define PTRACE_GETREGS 12 -#define PTRACE_SETREGS 13 -#define PTRACE_GETFPREGS 14 -#define PTRACE_SETFPREGS 15 -#define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */ - -#define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ -#define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ - -#endif /* _UAPI_ASM_PTRACE_H */ diff --git a/arch/frv/include/uapi/asm/registers.h b/arch/frv/include/uapi/asm/registers.h deleted file mode 100644 index 4caf09b6c193..000000000000 --- a/arch/frv/include/uapi/asm/registers.h +++ /dev/null @@ -1,233 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ -/* registers.h: register frame declarations - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -/* - * notes: - * - * (1) that the members of all these structures are carefully aligned to permit - * usage of STD/STDF instructions - * - * (2) if you change these structures, you must change the code in - * arch/frvnommu/kernel/{break.S,entry.S,switch_to.S,gdb-stub.c} - * - * - * the kernel stack space block looks like this: - * - * +0x2000 +---------------------- - * | union { - * | struct frv_frame0 { - * | struct user_context { - * | struct user_int_regs - * | struct user_fpmedia_regs - * | } - * | struct frv_debug_regs - * | } - * | struct pt_regs [user exception] - * | } - * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) - * | - * | kernel stack - * | - * |...................... - * | struct pt_regs [kernel exception] - * |...................... <-- __kernel_frame0_ptr (maybe GR28) - * | - * | kernel stack - * | - * |...................... <-- stack pointer (GR1) - * | - * | unused stack space - * | - * +---------------------- - * | struct thread_info - * +0x0000 +---------------------- <-- __current_thread_info (GR15); - * - * note that GR28 points to the current exception frame - */ - -#ifndef _ASM_REGISTERS_H -#define _ASM_REGISTERS_H - -#ifndef __ASSEMBLY__ -#define __OFFSET(X,N) ((X)+(N)*4) -#define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx -#else -#define __OFFSET(X,N) ((X)+(N)*4) -#define __OFFSETC(X,N) ((X)+(N)) -#endif - -/*****************************************************************************/ -/* - * Exception/Interrupt frame - * - held on kernel stack - * - 8-byte aligned on stack (old SP is saved in frame) - * - GR0 is fixed 0, so we don't save it - */ -#ifndef __ASSEMBLY__ - -struct pt_regs { - unsigned long psr; /* Processor Status Register */ - unsigned long isr; /* Integer Status Register */ - unsigned long ccr; /* Condition Code Register */ - unsigned long cccr; /* Condition Code for Conditional Insns Register */ - unsigned long lr; /* Link Register */ - unsigned long lcr; /* Loop Count Register */ - unsigned long pc; /* Program Counter Register */ - unsigned long __status; /* exception status */ - unsigned long syscallno; /* syscall number or -1 */ - unsigned long orig_gr8; /* original syscall arg #1 */ - unsigned long gner0; - unsigned long gner1; - unsigned long long iacc0; - unsigned long tbr; /* GR0 is fixed zero, so we use this for TBR */ - unsigned long sp; /* GR1: USP/KSP */ - unsigned long fp; /* GR2: FP */ - unsigned long gr3; - unsigned long gr4; - unsigned long gr5; - unsigned long gr6; - unsigned long gr7; /* syscall number */ - unsigned long gr8; /* 1st syscall param; syscall return */ - unsigned long gr9; /* 2nd syscall param */ - unsigned long gr10; /* 3rd syscall param */ - unsigned long gr11; /* 4th syscall param */ - unsigned long gr12; /* 5th syscall param */ - unsigned long gr13; /* 6th syscall param */ - unsigned long gr14; - unsigned long gr15; - unsigned long gr16; /* GP pointer */ - unsigned long gr17; /* small data */ - unsigned long gr18; /* PIC/PID */ - unsigned long gr19; - unsigned long gr20; - unsigned long gr21; - unsigned long gr22; - unsigned long gr23; - unsigned long gr24; - unsigned long gr25; - unsigned long gr26; - unsigned long gr27; - struct pt_regs *next_frame; /* GR28 - next exception frame */ - unsigned long gr29; /* GR29 - OS reserved */ - unsigned long gr30; /* GR30 - OS reserved */ - unsigned long gr31; /* GR31 - OS reserved */ -} __attribute__((aligned(8))); - -#endif - -#define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ -#define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ -#define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ -#define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ -#define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ - -#define REG_GR(R) __OFFSET(REG_GR0, (R)) - -#define REG_SP REG_GR(1) -#define REG_FP REG_GR(2) -#define REG_PREV_FRAME REG_GR(28) /* previous exception frame pointer (old gr28 value) */ -#define REG_CURR_TASK REG_GR(29) /* current task */ - -/*****************************************************************************/ -/* - * debugging registers - */ -#ifndef __ASSEMBLY__ - -struct frv_debug_regs -{ - unsigned long dcr; - unsigned long ibar[4] __attribute__((aligned(8))); - unsigned long dbar[4] __attribute__((aligned(8))); - unsigned long dbdr[4][4] __attribute__((aligned(8))); - unsigned long dbmr[4][4] __attribute__((aligned(8))); -} __attribute__((aligned(8))); - -#endif - -/*****************************************************************************/ -/* - * userspace registers - */ -#ifndef __ASSEMBLY__ - -struct user_int_regs -{ - /* integer registers - * - up to gr[31] mirror pt_regs - * - total size must be multiple of 8 bytes - */ - unsigned long psr; /* Processor Status Register */ - unsigned long isr; /* Integer Status Register */ - unsigned long ccr; /* Condition Code Register */ - unsigned long cccr; /* Condition Code for Conditional Insns Register */ - unsigned long lr; /* Link Register */ - unsigned long lcr; /* Loop Count Register */ - unsigned long pc; /* Program Counter Register */ - unsigned long __status; /* exception status */ - unsigned long syscallno; /* syscall number or -1 */ - unsigned long orig_gr8; /* original syscall arg #1 */ - unsigned long gner[2]; - unsigned long long iacc[1]; - - union { - unsigned long tbr; - unsigned long gr[64]; - }; -}; - -struct user_fpmedia_regs -{ - /* FP/Media registers */ - unsigned long fr[64]; - unsigned long fner[2]; - unsigned long msr[2]; - unsigned long acc[8]; - unsigned char accg[8]; - unsigned long fsr[1]; -}; - -struct user_context -{ - struct user_int_regs i; - struct user_fpmedia_regs f; - - /* we provide a context extension so that we can save the regs for CPUs that - * implement many more of Fujitsu's lavish register spec - */ - void *extension; -} __attribute__((aligned(8))); - -struct frv_frame0 { - union { - struct pt_regs regs; - struct user_context uc; - }; - - struct frv_debug_regs debug; - -} __attribute__((aligned(32))); - -#endif - -#define __INT_GR(R) __OFFSET(__INT_GR0, (R)) - -#define __FPMEDIA_FR(R) __OFFSET(__FPMEDIA_FR0, (R)) -#define __FPMEDIA_FNER(R) __OFFSET(__FPMEDIA_FNER0, (R)) -#define __FPMEDIA_MSR(R) __OFFSET(__FPMEDIA_MSR0, (R)) -#define __FPMEDIA_ACC(R) __OFFSET(__FPMEDIA_ACC0, (R)) -#define __FPMEDIA_ACCG(R) __OFFSETC(__FPMEDIA_ACCG0, (R)) -#define __FPMEDIA_FSR(R) __OFFSET(__FPMEDIA_FSR0, (R)) - -#define __THREAD_GR(R) __OFFSET(__THREAD_GR16, (R) - 16) - -#endif /* _ASM_REGISTERS_H */ diff --git a/arch/frv/include/uapi/asm/resource.h b/arch/frv/include/uapi/asm/resource.h deleted file mode 100644 index 2100305f9b3e..000000000000 --- a/arch/frv/include/uapi/asm/resource.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_RESOURCE_H -#define _ASM_RESOURCE_H - -#include - -#endif /* _ASM_RESOURCE_H */ - diff --git a/arch/frv/include/uapi/asm/sembuf.h b/arch/frv/include/uapi/asm/sembuf.h deleted file mode 100644 index d5477f95832b..000000000000 --- a/arch/frv/include/uapi/asm/sembuf.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_SEMBUF_H -#define _ASM_SEMBUF_H - -/* - * The semid64_ds structure for FR-V architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - unsigned long __unused1; - __kernel_time_t sem_ctime; /* last change time */ - unsigned long __unused2; - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _ASM_SEMBUF_H */ - diff --git a/arch/frv/include/uapi/asm/setup.h b/arch/frv/include/uapi/asm/setup.h deleted file mode 100644 index f54957047900..000000000000 --- a/arch/frv/include/uapi/asm/setup.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ -/* setup.h: setup stuff - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _UAPI_ASM_SETUP_H -#define _UAPI_ASM_SETUP_H - -#define COMMAND_LINE_SIZE 512 - - -#endif /* _UAPI_ASM_SETUP_H */ diff --git a/arch/frv/include/uapi/asm/shmbuf.h b/arch/frv/include/uapi/asm/shmbuf.h deleted file mode 100644 index 1de8f892e412..000000000000 --- a/arch/frv/include/uapi/asm/shmbuf.h +++ /dev/null @@ -1,44 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_SHMBUF_H -#define _ASM_SHMBUF_H - -/* - * The shmid64_ds structure for FR-V architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - unsigned long __unused1; - __kernel_time_t shm_dtime; /* last detach time */ - unsigned long __unused2; - __kernel_time_t shm_ctime; /* last change time */ - unsigned long __unused3; - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused4; - unsigned long __unused5; -}; - -struct shminfo64 { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _ASM_SHMBUF_H */ - diff --git a/arch/frv/include/uapi/asm/sigcontext.h b/arch/frv/include/uapi/asm/sigcontext.h deleted file mode 100644 index 8fbb0b00afdd..000000000000 --- a/arch/frv/include/uapi/asm/sigcontext.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ -/* sigcontext.h: FRV signal context - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_SIGCONTEXT_H -#define _ASM_SIGCONTEXT_H - -#include - -/* - * Signal context structure - contains all info to do with the state - * before the signal handler was invoked. Note: only add new entries - * to the end of the structure. - */ -struct sigcontext { - struct user_context sc_context; - unsigned long sc_oldmask; /* old sigmask */ -} __attribute__((aligned(8))); - -#endif diff --git a/arch/frv/include/uapi/asm/signal.h b/arch/frv/include/uapi/asm/signal.h deleted file mode 100644 index 603bb796cf46..000000000000 --- a/arch/frv/include/uapi/asm/signal.h +++ /dev/null @@ -1,37 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _UAPI_ASM_SIGNAL_H -#define _UAPI_ASM_SIGNAL_H - -#include - -#ifndef __KERNEL__ -/* Here we must cater to libcs that poke about in kernel headers. */ - -#define NSIG 32 -typedef unsigned long sigset_t; - -#endif /* !__KERNEL__ */ - -#define SA_RESTORER 0x04000000 /* to get struct sigaction correct */ - -#include - -#ifndef __KERNEL__ -/* Here we must cater to libcs that poke about in kernel headers. */ - -struct sigaction { - union { - __sighandler_t _sa_handler; - void (*_sa_sigaction)(int, struct siginfo *, void *); - } _u; - sigset_t sa_mask; - unsigned long sa_flags; - void (*sa_restorer)(void); -}; - -#define sa_handler _u._sa_handler -#define sa_sigaction _u._sa_sigaction - -#endif /* __KERNEL__ */ - -#endif /* _UAPI_ASM_SIGNAL_H */ diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h deleted file mode 100644 index 9168e78fa32a..000000000000 --- a/arch/frv/include/uapi/asm/socket.h +++ /dev/null @@ -1,109 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_SOCKET_H -#define _ASM_SOCKET_H - -#include - -/* For setsockopt(2) */ -#define SOL_SOCKET 1 - -#define SO_DEBUG 1 -#define SO_REUSEADDR 2 -#define SO_TYPE 3 -#define SO_ERROR 4 -#define SO_DONTROUTE 5 -#define SO_BROADCAST 6 -#define SO_SNDBUF 7 -#define SO_RCVBUF 8 -#define SO_SNDBUFFORCE 32 -#define SO_RCVBUFFORCE 33 -#define SO_KEEPALIVE 9 -#define SO_OOBINLINE 10 -#define SO_NO_CHECK 11 -#define SO_PRIORITY 12 -#define SO_LINGER 13 -#define SO_BSDCOMPAT 14 -#define SO_REUSEPORT 15 -#define SO_PASSCRED 16 -#define SO_PEERCRED 17 -#define SO_RCVLOWAT 18 -#define SO_SNDLOWAT 19 -#define SO_RCVTIMEO 20 -#define SO_SNDTIMEO 21 - -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define SO_SECURITY_AUTHENTICATION 22 -#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 -#define SO_SECURITY_ENCRYPTION_NETWORK 24 - -#define SO_BINDTODEVICE 25 - -/* Socket filtering */ -#define SO_ATTACH_FILTER 26 -#define SO_DETACH_FILTER 27 -#define SO_GET_FILTER SO_ATTACH_FILTER - -#define SO_PEERNAME 28 -#define SO_TIMESTAMP 29 -#define SCM_TIMESTAMP SO_TIMESTAMP - -#define SO_ACCEPTCONN 30 - -#define SO_PEERSEC 31 -#define SO_PASSSEC 34 -#define SO_TIMESTAMPNS 35 -#define SCM_TIMESTAMPNS SO_TIMESTAMPNS - -#define SO_MARK 36 - -#define SO_TIMESTAMPING 37 -#define SCM_TIMESTAMPING SO_TIMESTAMPING - -#define SO_PROTOCOL 38 -#define SO_DOMAIN 39 - -#define SO_RXQ_OVFL 40 - -#define SO_WIFI_STATUS 41 -#define SCM_WIFI_STATUS SO_WIFI_STATUS -#define SO_PEEK_OFF 42 - -/* Instruct lower device to use last 4-bytes of skb data as FCS */ -#define SO_NOFCS 43 - -#define SO_LOCK_FILTER 44 - -#define SO_SELECT_ERR_QUEUE 45 - -#define SO_BUSY_POLL 46 - -#define SO_MAX_PACING_RATE 47 - -#define SO_BPF_EXTENSIONS 48 - -#define SO_INCOMING_CPU 49 - -#define SO_ATTACH_BPF 50 -#define SO_DETACH_BPF SO_DETACH_FILTER - -#define SO_ATTACH_REUSEPORT_CBPF 51 -#define SO_ATTACH_REUSEPORT_EBPF 52 - -#define SO_CNX_ADVICE 53 - -#define SCM_TIMESTAMPING_OPT_STATS 54 - -#define SO_MEMINFO 55 - -#define SO_INCOMING_NAPI_ID 56 - -#define SO_COOKIE 57 - -#define SCM_TIMESTAMPING_PKTINFO 58 - -#define SO_PEERGROUPS 59 - -#define SO_ZEROCOPY 60 - -#endif /* _ASM_SOCKET_H */ - diff --git a/arch/frv/include/uapi/asm/sockios.h b/arch/frv/include/uapi/asm/sockios.h deleted file mode 100644 index 2f62caf1ce84..000000000000 --- a/arch/frv/include/uapi/asm/sockios.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_SOCKIOS__ -#define _ASM_SOCKIOS__ - -/* Socket-level I/O control calls. */ -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ -#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ - -#endif /* _ASM_SOCKIOS__ */ - diff --git a/arch/frv/include/uapi/asm/stat.h b/arch/frv/include/uapi/asm/stat.h deleted file mode 100644 index 0ff9fab915a4..000000000000 --- a/arch/frv/include/uapi/asm/stat.h +++ /dev/null @@ -1,101 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_STAT_H -#define _ASM_STAT_H - -struct __old_kernel_stat { - unsigned short st_dev; - unsigned short st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned long st_size; - unsigned long st_atime; - unsigned long st_mtime; - unsigned long st_ctime; -}; - -/* This matches struct stat in uClibc/glibc. */ -struct stat { - unsigned char __pad1[6]; - unsigned short st_dev; - - unsigned long __pad2; - unsigned long st_ino; - - unsigned short __pad3; - unsigned short st_mode; - unsigned short __pad4; - unsigned short st_nlink; - - unsigned short __pad5; - unsigned short st_uid; - unsigned short __pad6; - unsigned short st_gid; - - unsigned char __pad7[6]; - unsigned short st_rdev; - - unsigned long __pad8; - unsigned long st_size; - - unsigned long __pad9; /* align 64-bit st_blocks to 2-word */ - unsigned long st_blksize; - - unsigned long __pad10; /* future possible st_blocks high bits */ - unsigned long st_blocks; /* Number 512-byte blocks allocated. */ - - unsigned long __unused1; - unsigned long st_atime; - - unsigned long __unused2; - unsigned long st_mtime; - - unsigned long __unused3; - unsigned long st_ctime; - - unsigned long long __unused4; -}; - -/* This matches struct stat64 in uClibc/glibc. The layout is exactly - the same as that of struct stat above, with 64-bit types taking up - space that was formerly used by padding. stat syscalls are still - different from stat64, though, in that the former tests for - overflow. */ -struct stat64 { - unsigned char __pad1[6]; - unsigned short st_dev; - - unsigned long long st_ino; - - unsigned int st_mode; - unsigned int st_nlink; - - unsigned long st_uid; - unsigned long st_gid; - - unsigned char __pad2[6]; - unsigned short st_rdev; - - long long st_size; - - unsigned long __pad3; /* align 64-bit st_blocks to 2-word */ - unsigned long st_blksize; - - unsigned long __pad4; /* future possible st_blocks high bits */ - unsigned long st_blocks; /* Number 512-byte blocks allocated. */ - - unsigned long st_atime_nsec; - unsigned long st_atime; - - unsigned int st_mtime_nsec; - unsigned long st_mtime; - - unsigned long st_ctime_nsec; - unsigned long st_ctime; - - unsigned long long __unused4; -}; - -#endif /* _ASM_STAT_H */ diff --git a/arch/frv/include/uapi/asm/statfs.h b/arch/frv/include/uapi/asm/statfs.h deleted file mode 100644 index 2a378cbff07f..000000000000 --- a/arch/frv/include/uapi/asm/statfs.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_STATFS_H -#define _ASM_STATFS_H - -#include - -#endif /* _ASM_STATFS_H */ - diff --git a/arch/frv/include/uapi/asm/swab.h b/arch/frv/include/uapi/asm/swab.h deleted file mode 100644 index c78257d172e5..000000000000 --- a/arch/frv/include/uapi/asm/swab.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_SWAB_H -#define _ASM_SWAB_H - -#include - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) -# define __SWAB_64_THRU_32__ -#endif - -#endif /* _ASM_SWAB_H */ diff --git a/arch/frv/include/uapi/asm/termbits.h b/arch/frv/include/uapi/asm/termbits.h deleted file mode 100644 index b1dcd8d0ff78..000000000000 --- a/arch/frv/include/uapi/asm/termbits.h +++ /dev/null @@ -1,204 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_TERMBITS_H__ -#define _ASM_TERMBITS_H__ - -#include - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#define NCCS 19 -struct termios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ -}; - -struct termios2 { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define XTABS 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -/* c_cflag bit meaning */ -#define CBAUD 0010017 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 -#define CBAUDEX 0010000 -#define BOTHER 0010000 -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define CIBAUD 002003600000 /* Input baud rate */ -#define CTVB 004000000000 /* VisioBraille Terminal flow control */ -#define CMSPAR 010000000000 /* mark or space (stick) parity */ -#define CRTSCTS 020000000000 /* flow control */ - -#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ - -/* c_lflag bits */ -#define ISIG 0000001 -#define ICANON 0000002 -#define XCASE 0000004 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 -#define IEXTEN 0100000 -#define EXTPROC 0200000 - - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#endif /* _ASM_TERMBITS_H__ */ - diff --git a/arch/frv/include/uapi/asm/termios.h b/arch/frv/include/uapi/asm/termios.h deleted file mode 100644 index ae35bedae6a2..000000000000 --- a/arch/frv/include/uapi/asm/termios.h +++ /dev/null @@ -1,47 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _UAPI_ASM_TERMIOS_H -#define _UAPI_ASM_TERMIOS_H - -#include -#include - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - - -/* modem lines */ -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 - -#define TIOCM_MODEM_BITS TIOCM_OUT2 /* IRDA support */ - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - - -#endif /* _UAPI_ASM_TERMIOS_H */ diff --git a/arch/frv/include/uapi/asm/types.h b/arch/frv/include/uapi/asm/types.h deleted file mode 100644 index db74ad9ba6c0..000000000000 --- a/arch/frv/include/uapi/asm/types.h +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ -/* types.h: FRV types - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include diff --git a/arch/frv/include/uapi/asm/unistd.h b/arch/frv/include/uapi/asm/unistd.h deleted file mode 100644 index 4b46acaf832b..000000000000 --- a/arch/frv/include/uapi/asm/unistd.h +++ /dev/null @@ -1,349 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _UAPI_ASM_UNISTD_H_ -#define _UAPI_ASM_UNISTD_H_ - -/* - * This file contains the system call numbers. - */ - -#define __NR_restart_syscall 0 -#define __NR_exit 1 -#define __NR_fork 2 -#define __NR_read 3 -#define __NR_write 4 -#define __NR_open 5 -#define __NR_close 6 -#define __NR_waitpid 7 -#define __NR_creat 8 -#define __NR_link 9 -#define __NR_unlink 10 -#define __NR_execve 11 -#define __NR_chdir 12 -#define __NR_time 13 -#define __NR_mknod 14 -#define __NR_chmod 15 -#define __NR_lchown 16 -#define __NR_break 17 -#define __NR_oldstat 18 -#define __NR_lseek 19 -#define __NR_getpid 20 -#define __NR_mount 21 -#define __NR_umount 22 -#define __NR_setuid 23 -#define __NR_getuid 24 -#define __NR_stime 25 -#define __NR_ptrace 26 -#define __NR_alarm 27 -#define __NR_oldfstat 28 -#define __NR_pause 29 -#define __NR_utime 30 -#define __NR_stty 31 -#define __NR_gtty 32 -#define __NR_access 33 -#define __NR_nice 34 -#define __NR_ftime 35 -#define __NR_sync 36 -#define __NR_kill 37 -#define __NR_rename 38 -#define __NR_mkdir 39 -#define __NR_rmdir 40 -#define __NR_dup 41 -#define __NR_pipe 42 -#define __NR_times 43 -#define __NR_prof 44 -#define __NR_brk 45 -#define __NR_setgid 46 -#define __NR_getgid 47 -#define __NR_signal 48 -#define __NR_geteuid 49 -#define __NR_getegid 50 -#define __NR_acct 51 -#define __NR_umount2 52 -#define __NR_lock 53 -#define __NR_ioctl 54 -#define __NR_fcntl 55 -#define __NR_mpx 56 -#define __NR_setpgid 57 -#define __NR_ulimit 58 -// #define __NR_oldolduname /* 59 */ obsolete -#define __NR_umask 60 -#define __NR_chroot 61 -#define __NR_ustat 62 -#define __NR_dup2 63 -#define __NR_getppid 64 -#define __NR_getpgrp 65 -#define __NR_setsid 66 -#define __NR_sigaction 67 -#define __NR_sgetmask 68 -#define __NR_ssetmask 69 -#define __NR_setreuid 70 -#define __NR_setregid 71 -#define __NR_sigsuspend 72 -#define __NR_sigpending 73 -#define __NR_sethostname 74 -#define __NR_setrlimit 75 -#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ -#define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 -#define __NR_getgroups 80 -#define __NR_setgroups 81 -#define __NR_select 82 -#define __NR_symlink 83 -#define __NR_oldlstat 84 -#define __NR_readlink 85 -#define __NR_uselib 86 -#define __NR_swapon 87 -#define __NR_reboot 88 -#define __NR_readdir 89 -// #define __NR_mmap 90 /* obsolete - not implemented */ -#define __NR_munmap 91 -#define __NR_truncate 92 -#define __NR_ftruncate 93 -#define __NR_fchmod 94 -#define __NR_fchown 95 -#define __NR_getpriority 96 -#define __NR_setpriority 97 -// #define __NR_profil /* 98 */ obsolete -#define __NR_statfs 99 -#define __NR_fstatfs 100 -// #define __NR_ioperm /* 101 */ not supported -#define __NR_socketcall 102 -#define __NR_syslog 103 -#define __NR_setitimer 104 -#define __NR_getitimer 105 -#define __NR_stat 106 -#define __NR_lstat 107 -#define __NR_fstat 108 -// #define __NR_olduname /* 109 */ obsolete -// #define __NR_iopl /* 110 */ not supported -#define __NR_vhangup 111 -// #define __NR_idle /* 112 */ Obsolete -// #define __NR_vm86old /* 113 */ not supported -#define __NR_wait4 114 -#define __NR_swapoff 115 -#define __NR_sysinfo 116 -#define __NR_ipc 117 -#define __NR_fsync 118 -#define __NR_sigreturn 119 -#define __NR_clone 120 -#define __NR_setdomainname 121 -#define __NR_uname 122 -// #define __NR_modify_ldt /* 123 */ not supported -#define __NR_cacheflush 123 -#define __NR_adjtimex 124 -#define __NR_mprotect 125 -#define __NR_sigprocmask 126 -#define __NR_create_module 127 -#define __NR_init_module 128 -#define __NR_delete_module 129 -#define __NR_get_kernel_syms 130 -#define __NR_quotactl 131 -#define __NR_getpgid 132 -#define __NR_fchdir 133 -#define __NR_bdflush 134 -#define __NR_sysfs 135 -#define __NR_personality 136 -#define __NR_afs_syscall 137 /* Syscall for Andrew File System */ -#define __NR_setfsuid 138 -#define __NR_setfsgid 139 -#define __NR__llseek 140 -#define __NR_getdents 141 -#define __NR__newselect 142 -#define __NR_flock 143 -#define __NR_msync 144 -#define __NR_readv 145 -#define __NR_writev 146 -#define __NR_getsid 147 -#define __NR_fdatasync 148 -#define __NR__sysctl 149 -#define __NR_mlock 150 -#define __NR_munlock 151 -#define __NR_mlockall 152 -#define __NR_munlockall 153 -#define __NR_sched_setparam 154 -#define __NR_sched_getparam 155 -#define __NR_sched_setscheduler 156 -#define __NR_sched_getscheduler 157 -#define __NR_sched_yield 158 -#define __NR_sched_get_priority_max 159 -#define __NR_sched_get_priority_min 160 -#define __NR_sched_rr_get_interval 161 -#define __NR_nanosleep 162 -#define __NR_mremap 163 -#define __NR_setresuid 164 -#define __NR_getresuid 165 -// #define __NR_vm86 /* 166 */ not supported -#define __NR_query_module 167 -#define __NR_poll 168 -#define __NR_nfsservctl 169 -#define __NR_setresgid 170 -#define __NR_getresgid 171 -#define __NR_prctl 172 -#define __NR_rt_sigreturn 173 -#define __NR_rt_sigaction 174 -#define __NR_rt_sigprocmask 175 -#define __NR_rt_sigpending 176 -#define __NR_rt_sigtimedwait 177 -#define __NR_rt_sigqueueinfo 178 -#define __NR_rt_sigsuspend 179 -#define __NR_pread64 180 -#define __NR_pwrite64 181 -#define __NR_chown 182 -#define __NR_getcwd 183 -#define __NR_capget 184 -#define __NR_capset 185 -#define __NR_sigaltstack 186 -#define __NR_sendfile 187 -#define __NR_getpmsg 188 /* some people actually want streams */ -#define __NR_putpmsg 189 /* some people actually want streams */ -#define __NR_vfork 190 -#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ -#define __NR_mmap2 192 -#define __NR_truncate64 193 -#define __NR_ftruncate64 194 -#define __NR_stat64 195 -#define __NR_lstat64 196 -#define __NR_fstat64 197 -#define __NR_lchown32 198 -#define __NR_getuid32 199 -#define __NR_getgid32 200 -#define __NR_geteuid32 201 -#define __NR_getegid32 202 -#define __NR_setreuid32 203 -#define __NR_setregid32 204 -#define __NR_getgroups32 205 -#define __NR_setgroups32 206 -#define __NR_fchown32 207 -#define __NR_setresuid32 208 -#define __NR_getresuid32 209 -#define __NR_setresgid32 210 -#define __NR_getresgid32 211 -#define __NR_chown32 212 -#define __NR_setuid32 213 -#define __NR_setgid32 214 -#define __NR_setfsuid32 215 -#define __NR_setfsgid32 216 -#define __NR_pivot_root 217 -#define __NR_mincore 218 -#define __NR_madvise 219 - -#define __NR_getdents64 220 -#define __NR_fcntl64 221 -#define __NR_security 223 /* syscall for security modules */ -#define __NR_gettid 224 -#define __NR_readahead 225 -#define __NR_setxattr 226 -#define __NR_lsetxattr 227 -#define __NR_fsetxattr 228 -#define __NR_getxattr 229 -#define __NR_lgetxattr 230 -#define __NR_fgetxattr 231 -#define __NR_listxattr 232 -#define __NR_llistxattr 233 -#define __NR_flistxattr 234 -#define __NR_removexattr 235 -#define __NR_lremovexattr 236 -#define __NR_fremovexattr 237 -#define __NR_tkill 238 -#define __NR_sendfile64 239 -#define __NR_futex 240 -#define __NR_sched_setaffinity 241 -#define __NR_sched_getaffinity 242 -#define __NR_set_thread_area 243 -#define __NR_get_thread_area 244 -#define __NR_io_setup 245 -#define __NR_io_destroy 246 -#define __NR_io_getevents 247 -#define __NR_io_submit 248 -#define __NR_io_cancel 249 -#define __NR_fadvise64 250 - -#define __NR_exit_group 252 -#define __NR_lookup_dcookie 253 -#define __NR_epoll_create 254 -#define __NR_epoll_ctl 255 -#define __NR_epoll_wait 256 -#define __NR_remap_file_pages 257 -#define __NR_set_tid_address 258 -#define __NR_timer_create 259 -#define __NR_timer_settime (__NR_timer_create+1) -#define __NR_timer_gettime (__NR_timer_create+2) -#define __NR_timer_getoverrun (__NR_timer_create+3) -#define __NR_timer_delete (__NR_timer_create+4) -#define __NR_clock_settime (__NR_timer_create+5) -#define __NR_clock_gettime (__NR_timer_create+6) -#define __NR_clock_getres (__NR_timer_create+7) -#define __NR_clock_nanosleep (__NR_timer_create+8) -#define __NR_statfs64 268 -#define __NR_fstatfs64 269 -#define __NR_tgkill 270 -#define __NR_utimes 271 -#define __NR_fadvise64_64 272 -#define __NR_vserver 273 -#define __NR_mbind 274 -#define __NR_get_mempolicy 275 -#define __NR_set_mempolicy 276 -#define __NR_mq_open 277 -#define __NR_mq_unlink (__NR_mq_open+1) -#define __NR_mq_timedsend (__NR_mq_open+2) -#define __NR_mq_timedreceive (__NR_mq_open+3) -#define __NR_mq_notify (__NR_mq_open+4) -#define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_kexec_load 283 -#define __NR_waitid 284 -/* #define __NR_sys_setaltroot 285 */ -#define __NR_add_key 286 -#define __NR_request_key 287 -#define __NR_keyctl 288 -#define __NR_ioprio_set 289 -#define __NR_ioprio_get 290 -#define __NR_inotify_init 291 -#define __NR_inotify_add_watch 292 -#define __NR_inotify_rm_watch 293 -#define __NR_migrate_pages 294 -#define __NR_openat 295 -#define __NR_mkdirat 296 -#define __NR_mknodat 297 -#define __NR_fchownat 298 -#define __NR_futimesat 299 -#define __NR_fstatat64 300 -#define __NR_unlinkat 301 -#define __NR_renameat 302 -#define __NR_linkat 303 -#define __NR_symlinkat 304 -#define __NR_readlinkat 305 -#define __NR_fchmodat 306 -#define __NR_faccessat 307 -#define __NR_pselect6 308 -#define __NR_ppoll 309 -#define __NR_unshare 310 -#define __NR_set_robust_list 311 -#define __NR_get_robust_list 312 -#define __NR_splice 313 -#define __NR_sync_file_range 314 -#define __NR_tee 315 -#define __NR_vmsplice 316 -#define __NR_move_pages 317 -#define __NR_getcpu 318 -#define __NR_epoll_pwait 319 -#define __NR_utimensat 320 -#define __NR_signalfd 321 -#define __NR_timerfd_create 322 -#define __NR_eventfd 323 -#define __NR_fallocate 324 -#define __NR_timerfd_settime 325 -#define __NR_timerfd_gettime 326 -#define __NR_signalfd4 327 -#define __NR_eventfd2 328 -#define __NR_epoll_create1 329 -#define __NR_dup3 330 -#define __NR_pipe2 331 -#define __NR_inotify_init1 332 -#define __NR_preadv 333 -#define __NR_pwritev 334 -#define __NR_rt_tgsigqueueinfo 335 -#define __NR_perf_event_open 336 -#define __NR_setns 337 - -#endif /* _UAPI_ASM_UNISTD_H_ */ diff --git a/arch/frv/kernel/.gitignore b/arch/frv/kernel/.gitignore deleted file mode 100644 index c5f676c3c224..000000000000 --- a/arch/frv/kernel/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vmlinux.lds diff --git a/arch/frv/kernel/Makefile b/arch/frv/kernel/Makefile deleted file mode 100644 index 216ddf30c3c1..000000000000 --- a/arch/frv/kernel/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Makefile for the linux kernel. -# - -heads-y := head-uc-fr401.o head-uc-fr451.o head-uc-fr555.o -heads-$(CONFIG_MMU) := head-mmu-fr451.o - -extra-y:= head.o vmlinux.lds - -obj-y := $(heads-y) entry.o entry-table.o break.o switch_to.o \ - process.o traps.o ptrace.o signal.o dma.o \ - sys_frv.o time.o setup.o frv_ksyms.o \ - debug-stub.o irq.o sleep.o uaccess.o - -obj-$(CONFIG_GDBSTUB) += gdb-stub.o gdb-io.o - -obj-$(CONFIG_MB93091_VDK) += irq-mb93091.o -obj-$(CONFIG_PM) += pm.o cmode.o -obj-$(CONFIG_MB93093_PDK) += pm-mb93093.o -obj-$(CONFIG_FUJITSU_MB93493) += irq-mb93493.o -obj-$(CONFIG_SYSCTL) += sysctl.o -obj-$(CONFIG_FUTEX) += futex.o -obj-$(CONFIG_MODULES) += module.o diff --git a/arch/frv/kernel/asm-offsets.c b/arch/frv/kernel/asm-offsets.c deleted file mode 100644 index 0a468e9b51ad..000000000000 --- a/arch/frv/kernel/asm-offsets.c +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed - * to extract and format the required data. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEF_PTREG(sym, reg) OFFSET(sym, pt_regs, reg) -#define DEF_IREG(sym, reg) OFFSET(sym, user_context, reg) -#define DEF_FREG(sym, reg) OFFSET(sym, user_context, reg) -#define DEF_0REG(sym, reg) OFFSET(sym, frv_frame0, reg) - -void foo(void) -{ - /* offsets into the thread_info structure */ - OFFSET(TI_TASK, thread_info, task); - OFFSET(TI_FLAGS, thread_info, flags); - OFFSET(TI_STATUS, thread_info, status); - OFFSET(TI_CPU, thread_info, cpu); - OFFSET(TI_PREEMPT_COUNT, thread_info, preempt_count); - OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); - BLANK(); - - /* offsets into register file storage */ - DEF_PTREG(REG_PSR, psr); - DEF_PTREG(REG_ISR, isr); - DEF_PTREG(REG_CCR, ccr); - DEF_PTREG(REG_CCCR, cccr); - DEF_PTREG(REG_LR, lr); - DEF_PTREG(REG_LCR, lcr); - DEF_PTREG(REG_PC, pc); - DEF_PTREG(REG__STATUS, __status); - DEF_PTREG(REG_SYSCALLNO, syscallno); - DEF_PTREG(REG_ORIG_GR8, orig_gr8); - DEF_PTREG(REG_GNER0, gner0); - DEF_PTREG(REG_GNER1, gner1); - DEF_PTREG(REG_IACC0, iacc0); - DEF_PTREG(REG_TBR, tbr); - DEF_PTREG(REG_GR0, tbr); - DEFINE(REG__END, sizeof(struct pt_regs)); - BLANK(); - - DEF_0REG(REG_DCR, debug.dcr); - DEF_0REG(REG_IBAR0, debug.ibar[0]); - DEF_0REG(REG_DBAR0, debug.dbar[0]); - DEF_0REG(REG_DBDR00, debug.dbdr[0][0]); - DEF_0REG(REG_DBMR00, debug.dbmr[0][0]); - BLANK(); - - DEF_IREG(__INT_GR0, i.gr[0]); - DEF_FREG(__USER_FPMEDIA, f); - DEF_FREG(__FPMEDIA_FR0, f.fr[0]); - DEF_FREG(__FPMEDIA_FNER0, f.fner[0]); - DEF_FREG(__FPMEDIA_MSR0, f.msr[0]); - DEF_FREG(__FPMEDIA_ACC0, f.acc[0]); - DEF_FREG(__FPMEDIA_ACCG0, f.accg[0]); - DEF_FREG(__FPMEDIA_FSR0, f.fsr[0]); - BLANK(); - - DEFINE(NR_PT_REGS, sizeof(struct pt_regs) / 4); - DEFINE(NR_USER_INT_REGS, sizeof(struct user_int_regs) / 4); - DEFINE(NR_USER_FPMEDIA_REGS, sizeof(struct user_fpmedia_regs) / 4); - DEFINE(NR_USER_CONTEXT, sizeof(struct user_context) / 4); - DEFINE(FRV_FRAME0_SIZE, sizeof(struct frv_frame0)); - BLANK(); - - /* offsets into thread_struct */ - OFFSET(__THREAD_FRAME, thread_struct, frame); - OFFSET(__THREAD_CURR, thread_struct, curr); - OFFSET(__THREAD_SP, thread_struct, sp); - OFFSET(__THREAD_FP, thread_struct, fp); - OFFSET(__THREAD_LR, thread_struct, lr); - OFFSET(__THREAD_PC, thread_struct, pc); - OFFSET(__THREAD_GR16, thread_struct, gr[0]); - OFFSET(__THREAD_SCHED_LR, thread_struct, sched_lr); - OFFSET(__THREAD_FRAME0, thread_struct, frame0); - OFFSET(__THREAD_USER, thread_struct, user); - BLANK(); - - /* offsets into frv_debug_status */ - OFFSET(DEBUG_BPSR, frv_debug_status, bpsr); - OFFSET(DEBUG_DCR, frv_debug_status, dcr); - OFFSET(DEBUG_BRR, frv_debug_status, brr); - OFFSET(DEBUG_NMAR, frv_debug_status, nmar); - BLANK(); -} diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S deleted file mode 100644 index cbb6958a3147..000000000000 --- a/arch/frv/kernel/break.S +++ /dev/null @@ -1,792 +0,0 @@ -/* break.S: Break interrupt handling (kept separate from entry.S) - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include - -#include - -# -# the break handler has its own stack -# - .section .bss..stack - .globl __break_user_context - .balign THREAD_SIZE -__break_stack: - .space THREAD_SIZE - FRV_FRAME0_SIZE -__break_frame_0: - .space FRV_FRAME0_SIZE - -# -# miscellaneous variables -# - .section .bss -#ifdef CONFIG_MMU - .globl __break_tlb_miss_real_return_info -__break_tlb_miss_real_return_info: - .balign 8 - .space 2*4 /* saved PCSR, PSR for TLB-miss handler fixup */ -#endif - -__break_trace_through_exceptions: - .space 4 - -#define CS2_ECS1 0xe1200000 -#define CS2_USERLED 0x4 - -.macro LEDS val,reg -# sethi.p %hi(CS2_ECS1+CS2_USERLED),gr30 -# setlo %lo(CS2_ECS1+CS2_USERLED),gr30 -# setlos #~\val,\reg -# st \reg,@(gr30,gr0) -# setlos #0x5555,\reg -# sethi.p %hi(0xffc00100),gr30 -# setlo %lo(0xffc00100),gr30 -# sth \reg,@(gr30,gr0) -# membar -.endm - -############################################################################### -# -# entry point for Break Exceptions/Interrupts -# -############################################################################### - .section .text..break - .balign 4 - .globl __entry_break -__entry_break: -#ifdef CONFIG_MMU - movgs gr31,scr3 -#endif - LEDS 0x1001,gr31 - - sethi.p %hi(__break_frame_0),gr31 - setlo %lo(__break_frame_0),gr31 - - stdi gr2,@(gr31,#REG_GR(2)) - movsg ccr,gr3 - sti gr3,@(gr31,#REG_CCR) - - # catch the return from a TLB-miss handler that had single-step disabled - # traps will be enabled, so we have to do this now -#ifdef CONFIG_MMU - movsg bpcsr,gr3 - sethi.p %hi(__break_tlb_miss_return_breaks_here),gr2 - setlo %lo(__break_tlb_miss_return_breaks_here),gr2 - subcc gr2,gr3,gr0,icc0 - beq icc0,#2,__break_return_singlestep_tlbmiss -#endif - - # determine whether we have stepped through into an exception - # - we need to take special action to suspend h/w single stepping if we've done - # that, so that the gdbstub doesn't get bogged down endlessly stepping through - # external interrupt handling - movsg bpsr,gr3 - andicc gr3,#BPSR_BET,gr0,icc0 - bne icc0,#2,__break_maybe_userspace /* jump if PSR.ET was 1 */ - - LEDS 0x1003,gr2 - - movsg brr,gr3 - andicc gr3,#BRR_ST,gr0,icc0 - andicc.p gr3,#BRR_SB,gr0,icc1 - bne icc0,#2,__break_step /* jump if single-step caused break */ - beq icc1,#2,__break_continue /* jump if BREAK didn't cause break */ - - LEDS 0x1007,gr2 - - # handle special breaks - movsg bpcsr,gr3 - - sethi.p %hi(__entry_return_singlestep_breaks_here),gr2 - setlo %lo(__entry_return_singlestep_breaks_here),gr2 - subcc gr2,gr3,gr0,icc0 - beq icc0,#2,__break_return_singlestep - - bra __break_continue - - -############################################################################### -# -# handle BREAK instruction in kernel-mode exception epilogue -# -############################################################################### -__break_return_singlestep: - LEDS 0x100f,gr2 - - # special break insn requests single-stepping to be turned back on - # HERE RETT - # PSR.ET 0 0 - # PSR.PS old PSR.S ? - # PSR.S 1 1 - # BPSR.ET 0 1 (can't have caused orig excep otherwise) - # BPSR.BS 1 old PSR.S - movsg dcr,gr2 - sethi.p %hi(DCR_SE),gr3 - setlo %lo(DCR_SE),gr3 - or gr2,gr3,gr2 - movgs gr2,dcr - - movsg psr,gr2 - andi gr2,#PSR_PS,gr2 - slli gr2,#11,gr2 /* PSR.PS -> BPSR.BS */ - ori gr2,#BPSR_BET,gr2 /* 1 -> BPSR.BET */ - movgs gr2,bpsr - - # return to the invoker of the original kernel exception - movsg pcsr,gr2 - movgs gr2,bpcsr - - LEDS 0x101f,gr2 - - ldi @(gr31,#REG_CCR),gr3 - movgs gr3,ccr - lddi.p @(gr31,#REG_GR(2)),gr2 - xor gr31,gr31,gr31 - movgs gr0,brr -#ifdef CONFIG_MMU - movsg scr3,gr31 -#endif - rett #1 - -############################################################################### -# -# handle BREAK instruction in TLB-miss handler return path -# -############################################################################### -#ifdef CONFIG_MMU -__break_return_singlestep_tlbmiss: - LEDS 0x1100,gr2 - - sethi.p %hi(__break_tlb_miss_real_return_info),gr3 - setlo %lo(__break_tlb_miss_real_return_info),gr3 - lddi @(gr3,#0),gr2 - movgs gr2,pcsr - movgs gr3,psr - - bra __break_return_singlestep -#endif - - -############################################################################### -# -# handle single stepping into an exception prologue from kernel mode -# - we try and catch it whilst it is still in the main vector table -# - if we catch it there, we have to jump to the fixup handler -# - there is a fixup table that has a pointer for every 16b slot in the trap -# table -# -############################################################################### -__break_step: - LEDS 0x2003,gr2 - - # external interrupts seem to escape from the trap table before single - # step catches up with them - movsg bpcsr,gr2 - sethi.p %hi(__entry_kernel_external_interrupt),gr3 - setlo %lo(__entry_kernel_external_interrupt),gr3 - subcc.p gr2,gr3,gr0,icc0 - sethi %hi(__entry_uspace_external_interrupt),gr3 - setlo.p %lo(__entry_uspace_external_interrupt),gr3 - beq icc0,#2,__break_step_kernel_external_interrupt - subcc.p gr2,gr3,gr0,icc0 - sethi %hi(__entry_kernel_external_interrupt_virtually_disabled),gr3 - setlo.p %lo(__entry_kernel_external_interrupt_virtually_disabled),gr3 - beq icc0,#2,__break_step_uspace_external_interrupt - subcc.p gr2,gr3,gr0,icc0 - sethi %hi(__entry_kernel_external_interrupt_virtual_reenable),gr3 - setlo.p %lo(__entry_kernel_external_interrupt_virtual_reenable),gr3 - beq icc0,#2,__break_step_kernel_external_interrupt_virtually_disabled - subcc gr2,gr3,gr0,icc0 - beq icc0,#2,__break_step_kernel_external_interrupt_virtual_reenable - - LEDS 0x2007,gr2 - - # the two main vector tables are adjacent on one 8Kb slab - movsg bpcsr,gr2 - setlos #0xffffe000,gr3 - and gr2,gr3,gr2 - sethi.p %hi(__trap_tables),gr3 - setlo %lo(__trap_tables),gr3 - subcc gr2,gr3,gr0,icc0 - bne icc0,#2,__break_continue - - LEDS 0x200f,gr2 - - # skip workaround if so requested by GDB - sethi.p %hi(__break_trace_through_exceptions),gr3 - setlo %lo(__break_trace_through_exceptions),gr3 - ld @(gr3,gr0),gr3 - subcc gr3,gr0,gr0,icc0 - bne icc0,#0,__break_continue - - LEDS 0x201f,gr2 - - # access the fixup table - there's a 1:1 mapping between the slots in the trap tables and - # the slots in the trap fixup tables allowing us to simply divide the offset into the - # former by 4 to access the latter - sethi.p %hi(__trap_tables),gr3 - setlo %lo(__trap_tables),gr3 - movsg bpcsr,gr2 - sub gr2,gr3,gr2 - srli.p gr2,#2,gr2 - - sethi %hi(__trap_fixup_tables),gr3 - setlo.p %lo(__trap_fixup_tables),gr3 - andi gr2,#~3,gr2 - ld @(gr2,gr3),gr2 - jmpil @(gr2,#0) - -# step through an internal exception from kernel mode - .globl __break_step_kernel_softprog_interrupt -__break_step_kernel_softprog_interrupt: - sethi.p %hi(__entry_kernel_softprog_interrupt_reentry),gr3 - setlo %lo(__entry_kernel_softprog_interrupt_reentry),gr3 - bra __break_return_as_kernel_prologue - -# step through an external interrupt from kernel mode - .globl __break_step_kernel_external_interrupt -__break_step_kernel_external_interrupt: - # deal with virtual interrupt disablement - beq icc2,#0,__break_step_kernel_external_interrupt_virtually_disabled - - sethi.p %hi(__entry_kernel_external_interrupt_reentry),gr3 - setlo %lo(__entry_kernel_external_interrupt_reentry),gr3 - -__break_return_as_kernel_prologue: - LEDS 0x203f,gr2 - - movgs gr3,bpcsr - - # do the bit we had to skip -#ifdef CONFIG_MMU - movsg ear0,gr2 /* EAR0 can get clobbered by gdb-stub (ICI/ICEI) */ - movgs gr2,scr2 -#endif - - or.p sp,gr0,gr2 /* set up the stack pointer */ - subi sp,#REG__END,sp - sti.p gr2,@(sp,#REG_SP) - - setlos #REG__STATUS_STEP,gr2 - sti gr2,@(sp,#REG__STATUS) /* record single step status */ - - # cancel single-stepping mode - movsg dcr,gr2 - sethi.p %hi(~DCR_SE),gr3 - setlo %lo(~DCR_SE),gr3 - and gr2,gr3,gr2 - movgs gr2,dcr - - LEDS 0x207f,gr2 - - ldi @(gr31,#REG_CCR),gr3 - movgs gr3,ccr - lddi.p @(gr31,#REG_GR(2)),gr2 - xor gr31,gr31,gr31 - movgs gr0,brr -#ifdef CONFIG_MMU - movsg scr3,gr31 -#endif - rett #1 - -# we single-stepped into an interrupt handler whilst interrupts were merely virtually disabled -# need to really disable interrupts, set flag, fix up and return -__break_step_kernel_external_interrupt_virtually_disabled: - movsg psr,gr2 - andi gr2,#~PSR_PIL,gr2 - ori gr2,#PSR_PIL_14,gr2 /* debugging interrupts only */ - movgs gr2,psr - - ldi @(gr31,#REG_CCR),gr3 - movgs gr3,ccr - subcc.p gr0,gr0,gr0,icc2 /* leave Z set, clear C */ - - # exceptions must've been enabled and we must've been in supervisor mode - setlos BPSR_BET|BPSR_BS,gr3 - movgs gr3,bpsr - - # return to where the interrupt happened - movsg pcsr,gr2 - movgs gr2,bpcsr - - lddi.p @(gr31,#REG_GR(2)),gr2 - - xor gr31,gr31,gr31 - movgs gr0,brr -#ifdef CONFIG_MMU - movsg scr3,gr31 -#endif - rett #1 - -# we stepped through into the virtual interrupt reenablement trap -# -# we also want to single step anyway, but after fixing up so that we get an event on the -# instruction after the broken-into exception returns - .globl __break_step_kernel_external_interrupt_virtual_reenable -__break_step_kernel_external_interrupt_virtual_reenable: - movsg psr,gr2 - andi gr2,#~PSR_PIL,gr2 - movgs gr2,psr - - ldi @(gr31,#REG_CCR),gr3 - movgs gr3,ccr - subicc gr0,#1,gr0,icc2 /* clear Z, set C */ - - # save the adjusted ICC2 - movsg ccr,gr3 - sti gr3,@(gr31,#REG_CCR) - - # exceptions must've been enabled and we must've been in supervisor mode - setlos BPSR_BET|BPSR_BS,gr3 - movgs gr3,bpsr - - # return to where the trap happened - movsg pcsr,gr2 - movgs gr2,bpcsr - - # and then process the single step - bra __break_continue - -# step through an internal exception from uspace mode - .globl __break_step_uspace_softprog_interrupt -__break_step_uspace_softprog_interrupt: - sethi.p %hi(__entry_uspace_softprog_interrupt_reentry),gr3 - setlo %lo(__entry_uspace_softprog_interrupt_reentry),gr3 - bra __break_return_as_uspace_prologue - -# step through an external interrupt from kernel mode - .globl __break_step_uspace_external_interrupt -__break_step_uspace_external_interrupt: - sethi.p %hi(__entry_uspace_external_interrupt_reentry),gr3 - setlo %lo(__entry_uspace_external_interrupt_reentry),gr3 - -__break_return_as_uspace_prologue: - LEDS 0x20ff,gr2 - - movgs gr3,bpcsr - - # do the bit we had to skip - sethi.p %hi(__kernel_frame0_ptr),gr28 - setlo %lo(__kernel_frame0_ptr),gr28 - ldi.p @(gr28,#0),gr28 - - setlos #REG__STATUS_STEP,gr2 - sti gr2,@(gr28,#REG__STATUS) /* record single step status */ - - # cancel single-stepping mode - movsg dcr,gr2 - sethi.p %hi(~DCR_SE),gr3 - setlo %lo(~DCR_SE),gr3 - and gr2,gr3,gr2 - movgs gr2,dcr - - LEDS 0x20fe,gr2 - - ldi @(gr31,#REG_CCR),gr3 - movgs gr3,ccr - lddi.p @(gr31,#REG_GR(2)),gr2 - xor gr31,gr31,gr31 - movgs gr0,brr -#ifdef CONFIG_MMU - movsg scr3,gr31 -#endif - rett #1 - -#ifdef CONFIG_MMU -# step through an ITLB-miss handler from user mode - .globl __break_user_insn_tlb_miss -__break_user_insn_tlb_miss: - # we'll want to try the trap stub again - sethi.p %hi(__trap_user_insn_tlb_miss),gr2 - setlo %lo(__trap_user_insn_tlb_miss),gr2 - movgs gr2,bpcsr - -__break_tlb_miss_common: - LEDS 0x2101,gr2 - - # cancel single-stepping mode - movsg dcr,gr2 - sethi.p %hi(~DCR_SE),gr3 - setlo %lo(~DCR_SE),gr3 - and gr2,gr3,gr2 - movgs gr2,dcr - - # we'll swap the real return address for one with a BREAK insn so that we can re-enable - # single stepping on return - movsg pcsr,gr2 - sethi.p %hi(__break_tlb_miss_real_return_info),gr3 - setlo %lo(__break_tlb_miss_real_return_info),gr3 - sti gr2,@(gr3,#0) - - sethi.p %hi(__break_tlb_miss_return_break),gr2 - setlo %lo(__break_tlb_miss_return_break),gr2 - movgs gr2,pcsr - - # we also have to fudge PSR because the return BREAK is in kernel space and we want - # to get a BREAK fault not an access violation should the return be to userspace - movsg psr,gr2 - sti.p gr2,@(gr3,#4) - ori gr2,#PSR_PS,gr2 - movgs gr2,psr - - LEDS 0x2102,gr2 - - ldi @(gr31,#REG_CCR),gr3 - movgs gr3,ccr - lddi @(gr31,#REG_GR(2)),gr2 - movsg scr3,gr31 - movgs gr0,brr - rett #1 - -# step through a DTLB-miss handler from user mode - .globl __break_user_data_tlb_miss -__break_user_data_tlb_miss: - # we'll want to try the trap stub again - sethi.p %hi(__trap_user_data_tlb_miss),gr2 - setlo %lo(__trap_user_data_tlb_miss),gr2 - movgs gr2,bpcsr - bra __break_tlb_miss_common - -# step through an ITLB-miss handler from kernel mode - .globl __break_kernel_insn_tlb_miss -__break_kernel_insn_tlb_miss: - # we'll want to try the trap stub again - sethi.p %hi(__trap_kernel_insn_tlb_miss),gr2 - setlo %lo(__trap_kernel_insn_tlb_miss),gr2 - movgs gr2,bpcsr - bra __break_tlb_miss_common - -# step through a DTLB-miss handler from kernel mode - .globl __break_kernel_data_tlb_miss -__break_kernel_data_tlb_miss: - # we'll want to try the trap stub again - sethi.p %hi(__trap_kernel_data_tlb_miss),gr2 - setlo %lo(__trap_kernel_data_tlb_miss),gr2 - movgs gr2,bpcsr - bra __break_tlb_miss_common -#endif - -############################################################################### -# -# handle debug events originating with userspace -# -############################################################################### -__break_maybe_userspace: - LEDS 0x3003,gr2 - - setlos #BPSR_BS,gr2 - andcc gr3,gr2,gr0,icc0 - bne icc0,#0,__break_continue /* skip if PSR.S was 1 */ - - movsg brr,gr2 - andicc gr2,#BRR_ST|BRR_SB,gr0,icc0 - beq icc0,#0,__break_continue /* jump if not BREAK or single-step */ - - LEDS 0x3007,gr2 - - # do the first part of the exception prologue here - sethi.p %hi(__kernel_frame0_ptr),gr28 - setlo %lo(__kernel_frame0_ptr),gr28 - ldi @(gr28,#0),gr28 - andi gr28,#~7,gr28 - - # set up the kernel stack pointer - sti sp ,@(gr28,#REG_SP) - ori gr28,0,sp - sti gr0 ,@(gr28,#REG_GR(28)) - - stdi gr20,@(gr28,#REG_GR(20)) - stdi gr22,@(gr28,#REG_GR(22)) - - movsg tbr,gr20 - movsg bpcsr,gr21 - movsg psr,gr22 - - # determine the exception type and cancel single-stepping mode - or gr0,gr0,gr23 - - movsg dcr,gr2 - sethi.p %hi(DCR_SE),gr3 - setlo %lo(DCR_SE),gr3 - andcc gr2,gr3,gr0,icc0 - beq icc0,#0,__break_no_user_sstep /* must have been a BREAK insn */ - - not gr3,gr3 - and gr2,gr3,gr2 - movgs gr2,dcr - ori gr23,#REG__STATUS_STEP,gr23 - -__break_no_user_sstep: - LEDS 0x300f,gr2 - - movsg brr,gr2 - andi gr2,#BRR_ST|BRR_SB,gr2 - slli gr2,#1,gr2 - or gr23,gr2,gr23 - sti.p gr23,@(gr28,#REG__STATUS) /* record single step status */ - - # adjust the value acquired from TBR - this indicates the exception - setlos #~TBR_TT,gr2 - and.p gr20,gr2,gr20 - setlos #TBR_TT_BREAK,gr2 - or.p gr20,gr2,gr20 - - # fudge PSR.PS and BPSR.BS to return to kernel mode through the trap - # table as trap 126 - andi gr22,#~PSR_PS,gr22 /* PSR.PS should be 0 */ - movgs gr22,psr - - setlos #BPSR_BS,gr2 /* BPSR.BS should be 1 and BPSR.BET 0 */ - movgs gr2,bpsr - - # return through remainder of the exception prologue - # - need to load gr23 with return handler address - sethi.p %hi(__entry_return_from_user_exception),gr23 - setlo %lo(__entry_return_from_user_exception),gr23 - sethi.p %hi(__entry_common),gr3 - setlo %lo(__entry_common),gr3 - movgs gr3,bpcsr - - LEDS 0x301f,gr2 - - ldi @(gr31,#REG_CCR),gr3 - movgs gr3,ccr - lddi.p @(gr31,#REG_GR(2)),gr2 - xor gr31,gr31,gr31 - movgs gr0,brr -#ifdef CONFIG_MMU - movsg scr3,gr31 -#endif - rett #1 - -############################################################################### -# -# resume normal debug-mode entry -# -############################################################################### -__break_continue: - LEDS 0x4003,gr2 - - # set up the kernel stack pointer - sti sp,@(gr31,#REG_SP) - - sethi.p %hi(__break_frame_0),sp - setlo %lo(__break_frame_0),sp - - # finish building the exception frame - stdi gr4 ,@(gr31,#REG_GR(4)) - stdi gr6 ,@(gr31,#REG_GR(6)) - stdi gr8 ,@(gr31,#REG_GR(8)) - stdi gr10,@(gr31,#REG_GR(10)) - stdi gr12,@(gr31,#REG_GR(12)) - stdi gr14,@(gr31,#REG_GR(14)) - stdi gr16,@(gr31,#REG_GR(16)) - stdi gr18,@(gr31,#REG_GR(18)) - stdi gr20,@(gr31,#REG_GR(20)) - stdi gr22,@(gr31,#REG_GR(22)) - stdi gr24,@(gr31,#REG_GR(24)) - stdi gr26,@(gr31,#REG_GR(26)) - sti gr0 ,@(gr31,#REG_GR(28)) /* NULL frame pointer */ - sti gr29,@(gr31,#REG_GR(29)) - sti gr30,@(gr31,#REG_GR(30)) - sti gr8 ,@(gr31,#REG_ORIG_GR8) - -#ifdef CONFIG_MMU - movsg scr3,gr19 - sti gr19,@(gr31,#REG_GR(31)) -#endif - - movsg bpsr ,gr19 - movsg tbr ,gr20 - movsg bpcsr,gr21 - movsg psr ,gr22 - movsg isr ,gr23 - movsg cccr ,gr25 - movsg lr ,gr26 - movsg lcr ,gr27 - - andi.p gr22,#~(PSR_S|PSR_ET),gr5 /* rebuild PSR */ - andi gr19,#PSR_ET,gr4 - or.p gr4,gr5,gr5 - srli gr19,#10,gr4 - andi gr4,#PSR_S,gr4 - or.p gr4,gr5,gr5 - - setlos #-1,gr6 - sti gr20,@(gr31,#REG_TBR) - sti gr21,@(gr31,#REG_PC) - sti gr5 ,@(gr31,#REG_PSR) - sti gr23,@(gr31,#REG_ISR) - sti gr25,@(gr31,#REG_CCCR) - stdi gr26,@(gr31,#REG_LR) - sti gr6 ,@(gr31,#REG_SYSCALLNO) - - # store CPU-specific regs - movsg iacc0h,gr4 - movsg iacc0l,gr5 - stdi gr4,@(gr31,#REG_IACC0) - - movsg gner0,gr4 - movsg gner1,gr5 - stdi gr4,@(gr31,#REG_GNER0) - - # build the debug register frame - movsg brr,gr4 - movgs gr0,brr - movsg nmar,gr5 - movsg dcr,gr6 - - sethi.p %hi(__debug_status),gr7 - setlo %lo(__debug_status),gr7 - - stdi gr4 ,@(gr7,#DEBUG_BRR) - sti gr19,@(gr7,#DEBUG_BPSR) - sti.p gr6 ,@(gr7,#DEBUG_DCR) - - # trap exceptions during break handling and disable h/w breakpoints/watchpoints - sethi %hi(DCR_EBE),gr5 - setlo.p %lo(DCR_EBE),gr5 - sethi %hi(__entry_breaktrap_table),gr4 - setlo %lo(__entry_breaktrap_table),gr4 - movgs gr5,dcr - movgs gr4,tbr - - # set up kernel global registers - sethi.p %hi(__kernel_current_task),gr5 - setlo %lo(__kernel_current_task),gr5 - ld @(gr5,gr0),gr29 - ldi.p @(gr29,#4),gr15 ; __current_thread_info = current->thread_info - - sethi %hi(_gp),gr16 - setlo.p %lo(_gp),gr16 - - # make sure we (the kernel) get div-zero and misalignment exceptions - setlos #ISR_EDE|ISR_DTT_DIVBYZERO|ISR_EMAM_EXCEPTION,gr5 - movgs gr5,isr - - # enter the GDB stub - LEDS 0x4007,gr2 - - or.p gr0,gr0,fp - call debug_stub - - LEDS 0x403f,gr2 - - # return from break - lddi @(gr31,#REG_IACC0),gr4 - movgs gr4,iacc0h - movgs gr5,iacc0l - - lddi @(gr31,#REG_GNER0),gr4 - movgs gr4,gner0 - movgs gr5,gner1 - - lddi @(gr31,#REG_LR) ,gr26 - lddi @(gr31,#REG_CCR) ,gr24 - lddi @(gr31,#REG_PSR) ,gr22 - ldi @(gr31,#REG_PC) ,gr21 - ldi @(gr31,#REG_TBR) ,gr20 - - sethi.p %hi(__debug_status),gr6 - setlo %lo(__debug_status),gr6 - ldi.p @(gr6,#DEBUG_DCR) ,gr6 - - andi gr22,#PSR_S,gr19 /* rebuild BPSR */ - andi.p gr22,#PSR_ET,gr5 - slli gr19,#10,gr19 - or gr5,gr19,gr19 - - movgs gr6 ,dcr - movgs gr19,bpsr - movgs gr20,tbr - movgs gr21,bpcsr - movgs gr23,isr - movgs gr24,ccr - movgs gr25,cccr - movgs gr26,lr - movgs gr27,lcr - - LEDS 0x407f,gr2 - -#ifdef CONFIG_MMU - ldi @(gr31,#REG_GR(31)),gr2 - movgs gr2,scr3 -#endif - - ldi @(gr31,#REG_GR(30)),gr30 - ldi @(gr31,#REG_GR(29)),gr29 - lddi @(gr31,#REG_GR(26)),gr26 - lddi @(gr31,#REG_GR(24)),gr24 - lddi @(gr31,#REG_GR(22)),gr22 - lddi @(gr31,#REG_GR(20)),gr20 - lddi @(gr31,#REG_GR(18)),gr18 - lddi @(gr31,#REG_GR(16)),gr16 - lddi @(gr31,#REG_GR(14)),gr14 - lddi @(gr31,#REG_GR(12)),gr12 - lddi @(gr31,#REG_GR(10)),gr10 - lddi @(gr31,#REG_GR(8)) ,gr8 - lddi @(gr31,#REG_GR(6)) ,gr6 - lddi @(gr31,#REG_GR(4)) ,gr4 - lddi @(gr31,#REG_GR(2)) ,gr2 - ldi.p @(gr31,#REG_SP) ,sp - - xor gr31,gr31,gr31 - movgs gr0,brr -#ifdef CONFIG_MMU - movsg scr3,gr31 -#endif - rett #1 - -################################################################################################### -# -# GDB stub "system calls" -# -################################################################################################### - -#ifdef CONFIG_GDBSTUB - # void gdbstub_console_write(struct console *con, const char *p, unsigned n) - .globl gdbstub_console_write -gdbstub_console_write: - break - bralr -#endif - - # GDB stub BUG() trap - # GR8 is the proposed signal number - .globl __debug_bug_trap -__debug_bug_trap: - break - bralr - - # transfer kernel exeception to GDB for handling - .globl __break_hijack_kernel_event -__break_hijack_kernel_event: - break - .globl __break_hijack_kernel_event_breaks_here -__break_hijack_kernel_event_breaks_here: - nop - -#ifdef CONFIG_MMU - # handle a return from TLB-miss that requires single-step reactivation - .globl __break_tlb_miss_return_break -__break_tlb_miss_return_break: - break -__break_tlb_miss_return_breaks_here: - nop -#endif - - # guard the first .text label in the next file from confusion - nop diff --git a/arch/frv/kernel/cmode.S b/arch/frv/kernel/cmode.S deleted file mode 100644 index 53deeb5d7e87..000000000000 --- a/arch/frv/kernel/cmode.S +++ /dev/null @@ -1,189 +0,0 @@ -/* cmode.S: clock mode management - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Woodhouse (dwmw2@infradead.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define __addr_MASK 0xfeff9820 /* interrupt controller mask */ - -#define __addr_SDRAMC 0xfe000400 /* SDRAM controller regs */ -#define SDRAMC_DSTS 0x28 /* SDRAM status */ -#define SDRAMC_DSTS_SSI 0x00000001 /* indicates that the SDRAM is in self-refresh mode */ -#define SDRAMC_DRCN 0x30 /* SDRAM refresh control */ -#define SDRAMC_DRCN_SR 0x00000001 /* transition SDRAM into self-refresh mode */ -#define __addr_CLKC 0xfeff9a00 -#define CLKC_SWCMODE 0x00000008 -#define __addr_LEDS 0xe1200004 - -.macro li v r - sethi.p %hi(\v),\r - setlo %lo(\v),\r -.endm - - .text - .balign 4 - - -############################################################################### -# -# Change CMODE -# - void frv_change_cmode(int cmode) -# -############################################################################### - .globl frv_change_cmode - .type frv_change_cmode,@function - -.macro LEDS v -#ifdef DEBUG_CMODE - setlos #~\v,gr10 - sti gr10,@(gr11,#0) - membar -#endif -.endm - -frv_change_cmode: - movsg lr,gr9 -#ifdef DEBUG_CMODE - li __addr_LEDS,gr11 -#endif - dcef @(gr0,gr0),#1 - - # Shift argument left by 24 bits to fit in SWCMODE register later. - slli gr8,#24,gr8 - - # (1) Set '0' in the PSR.ET bit, and prohibit interrupts. - movsg psr,gr14 - andi gr14,#~PSR_ET,gr3 - movgs gr3,psr - -#if 0 // Fujitsu recommend to skip this and will update docs. - # (2) Set '0' to all bits of the MASK register of the interrupt - # controller, and mask interrupts. - li __addr_MASK,gr12 - ldi @(gr12,#0),gr13 - li 0xffff0000,gr4 - sti gr4,@(gr12,#0) -#endif - - # (3) Stop the transfer function of DMAC. Stop all the bus masters - # to access SDRAM and the internal resources. - - # (already done by caller) - - # (4) Preload a series of following instructions to the instruction - # cache. - li #__cmode_icache_lock_start,gr3 - li #__cmode_icache_lock_end,gr4 - -1: icpl gr3,gr0,#1 - addi gr3,#L1_CACHE_BYTES,gr3 - cmp gr4,gr3,icc0 - bhi icc0,#0,1b - - # Set up addresses in regs for later steps. - setlos SDRAMC_DRCN_SR,gr3 - li __addr_SDRAMC,gr4 - li __addr_CLKC,gr5 - ldi @(gr5,#0),gr6 - li #0x80000000,gr7 - or gr6,gr7,gr6 - - bra __cmode_icache_lock_start - - .balign L1_CACHE_BYTES -__cmode_icache_lock_start: - - # (5) Flush the content of all caches by the DCEF instruction. - dcef @(gr0,gr0),#1 - - # (6) Execute loading the dummy for SDRAM. - ldi @(gr9,#0),gr0 - - # (7) Set '1' to the DRCN.SR bit, and change SDRAM to the - # self-refresh mode. Execute the dummy load to all memory - # devices set to cacheable on the external bus side in parallel - # with this. - sti gr3,@(gr4,#SDRAMC_DRCN) - - # (8) Execute memory barrier instruction (MEMBAR). - membar - - # (9) Read the DSTS register repeatedly until '1' stands in the - # DSTS.SSI field. -1: ldi @(gr4,#SDRAMC_DSTS),gr3 - andicc gr3,#SDRAMC_DSTS_SSI,gr3,icc0 - beq icc0,#0,1b - - # (10) Execute memory barrier instruction (MEMBAR). - membar - -#if 1 - # (11) Set the value of CMODE that you want to change to - # SWCMODE.SWCM[3:0]. - sti gr8,@(gr5,#CLKC_SWCMODE) - - # (12) Set '1' to the CLKC.SWEN bit. In that case, do not change - # fields other than SWEN of the CLKC register. - sti gr6,@(gr5,#0) -#endif - # (13) Execute the instruction just after the memory barrier - # instruction that executes the self-loop 256 times. (Meanwhile, - # the CMODE switch is done.) - membar - setlos #256,gr7 -2: subicc gr7,#1,gr7,icc0 - bne icc0,#2,2b - - LEDS 0x36 - - # (14) Release the self-refresh of SDRAM. - sti gr0,@(gr4,#SDRAMC_DRCN) - - # Wait for it... -3: ldi @(gr4,#SDRAMC_DSTS),gr3 - andicc gr3,#SDRAMC_DSTS_SSI,gr3,icc0 - bne icc0,#2,3b - -#if 0 - li 0x0100000,gr10 -4: subicc gr10,#1,gr10,icc0 - - bne icc0,#0,4b -#endif - -__cmode_icache_lock_end: - - li #__cmode_icache_lock_start,gr3 - li #__cmode_icache_lock_end,gr4 - -4: icul gr3 - addi gr3,#L1_CACHE_BYTES,gr3 - cmp gr4,gr3,icc0 - bhi icc0,#0,4b - -#if 0 // Fujitsu recommend to skip this and will update docs. - # (15) Release the interrupt mask setting of the MASK register of - # the interrupt controller if necessary. - sti gr13,@(gr12,#0) -#endif - # (16) Set 1' in the PSR.ET bit, and permit interrupt. - movgs gr14,psr - - bralr - - .size frv_change_cmode, .-frv_change_cmode diff --git a/arch/frv/kernel/debug-stub.c b/arch/frv/kernel/debug-stub.c deleted file mode 100644 index a0228f717ef2..000000000000 --- a/arch/frv/kernel/debug-stub.c +++ /dev/null @@ -1,258 +0,0 @@ -/* debug-stub.c: debug-mode stub - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include "gdb-io.h" - -/* CPU board CON5 */ -#define __UART0(X) (*(volatile uint8_t *)(UART0_BASE + (UART_##X))) - -#define LSR_WAIT_FOR0(STATE) \ -do { \ -} while (!(__UART0(LSR) & UART_LSR_##STATE)) - -#define FLOWCTL_QUERY0(LINE) ({ __UART0(MSR) & UART_MSR_##LINE; }) -#define FLOWCTL_CLEAR0(LINE) do { __UART0(MCR) &= ~UART_MCR_##LINE; } while (0) -#define FLOWCTL_SET0(LINE) do { __UART0(MCR) |= UART_MCR_##LINE; } while (0) - -#define FLOWCTL_WAIT_FOR0(LINE) \ -do { \ - gdbstub_do_rx(); \ -} while(!FLOWCTL_QUERY(LINE)) - -struct frv_debug_status __debug_status; - -static void __init debug_stub_init(void); - -/*****************************************************************************/ -/* - * debug mode handler stub - * - we come here with the CPU in debug mode and with exceptions disabled - * - handle debugging services for userspace - */ -asmlinkage void debug_stub(void) -{ - unsigned long hsr0; - int type = 0; - - static u8 inited = 0; - if (!inited) { - debug_stub_init(); - type = -1; - inited = 1; - } - - hsr0 = __get_HSR(0); - if (hsr0 & HSR0_ETMD) - __set_HSR(0, hsr0 & ~HSR0_ETMD); - - /* disable single stepping */ - __debug_status.dcr &= ~DCR_SE; - - /* kernel mode can propose an exception be handled in debug mode by jumping to a special - * location */ - if (__debug_frame->pc == (unsigned long) __break_hijack_kernel_event_breaks_here) { - /* replace the debug frame with the kernel frame and discard - * the top kernel context */ - *__debug_frame = *__frame; - __frame = __debug_frame->next_frame; - __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12; - __debug_status.brr |= BRR_EB; - } - - if (__debug_frame->pc == (unsigned long) __debug_bug_trap + 4) { - __debug_frame->pc = __debug_frame->lr; - type = __debug_frame->gr8; - } - -#ifdef CONFIG_GDBSTUB - gdbstub(type); -#endif - - if (hsr0 & HSR0_ETMD) - __set_HSR(0, __get_HSR(0) | HSR0_ETMD); - -} /* end debug_stub() */ - -/*****************************************************************************/ -/* - * debug stub initialisation - */ -static void __init debug_stub_init(void) -{ - __set_IRR(6, 0xff000000); /* map ERRs to NMI */ - __set_IITMR(1, 0x20000000); /* ERR0/1, UART0/1 IRQ detect levels */ - - asm volatile(" movgs gr0,ibar0 \n" - " movgs gr0,ibar1 \n" - " movgs gr0,ibar2 \n" - " movgs gr0,ibar3 \n" - " movgs gr0,dbar0 \n" - " movgs gr0,dbmr00 \n" - " movgs gr0,dbmr01 \n" - " movgs gr0,dbdr00 \n" - " movgs gr0,dbdr01 \n" - " movgs gr0,dbar1 \n" - " movgs gr0,dbmr10 \n" - " movgs gr0,dbmr11 \n" - " movgs gr0,dbdr10 \n" - " movgs gr0,dbdr11 \n" - ); - - /* deal with debugging stub initialisation and initial pause */ - if (__debug_frame->pc == (unsigned long) __debug_stub_init_break) - __debug_frame->pc = (unsigned long) start_kernel; - - /* enable the debug events we want to trap */ - __debug_status.dcr = DCR_EBE; - -#ifdef CONFIG_GDBSTUB - gdbstub_init(); -#endif - - __clr_MASK_all(); - __clr_MASK(15); - __clr_RC(15); - -} /* end debug_stub_init() */ - -/*****************************************************************************/ -/* - * kernel "exit" trap for gdb stub - */ -void debug_stub_exit(int status) -{ - -#ifdef CONFIG_GDBSTUB - gdbstub_exit(status); -#endif - -} /* end debug_stub_exit() */ - -/*****************************************************************************/ -/* - * send string to serial port - */ -void debug_to_serial(const char *p, int n) -{ - char ch; - - for (; n > 0; n--) { - ch = *p++; - FLOWCTL_SET0(DTR); - LSR_WAIT_FOR0(THRE); - // FLOWCTL_WAIT_FOR(CTS); - - if (ch == 0x0a) { - __UART0(TX) = 0x0d; - mb(); - LSR_WAIT_FOR0(THRE); - // FLOWCTL_WAIT_FOR(CTS); - } - __UART0(TX) = ch; - mb(); - - FLOWCTL_CLEAR0(DTR); - } - -} /* end debug_to_serial() */ - -/*****************************************************************************/ -/* - * send string to serial port - */ -void debug_to_serial2(const char *fmt, ...) -{ - va_list va; - char buf[64]; - int n; - - va_start(va, fmt); - n = vsprintf(buf, fmt, va); - va_end(va); - - debug_to_serial(buf, n); - -} /* end debug_to_serial2() */ - -/*****************************************************************************/ -/* - * set up the ttyS0 serial port baud rate timers - */ -void __init console_set_baud(unsigned baud) -{ - unsigned value, high, low; - u8 lcr; - - /* work out the divisor to give us the nearest higher baud rate */ - value = __serial_clock_speed_HZ / 16 / baud; - - /* determine the baud rate range */ - high = __serial_clock_speed_HZ / 16 / value; - low = __serial_clock_speed_HZ / 16 / (value + 1); - - /* pick the nearest bound */ - if (low + (high - low) / 2 > baud) - value++; - - lcr = __UART0(LCR); - __UART0(LCR) |= UART_LCR_DLAB; - mb(); - __UART0(DLL) = value & 0xff; - __UART0(DLM) = (value >> 8) & 0xff; - mb(); - __UART0(LCR) = lcr; - mb(); - -} /* end console_set_baud() */ - -/*****************************************************************************/ -/* - * - */ -int __init console_get_baud(void) -{ - unsigned value; - u8 lcr; - - lcr = __UART0(LCR); - __UART0(LCR) |= UART_LCR_DLAB; - mb(); - value = __UART0(DLM) << 8; - value |= __UART0(DLL); - __UART0(LCR) = lcr; - mb(); - - return value; -} /* end console_get_baud() */ - -/*****************************************************************************/ -/* - * display BUG() info - */ -#ifndef CONFIG_NO_KERNEL_MSG -void __debug_bug_printk(const char *file, unsigned line) -{ - printk("kernel BUG at %s:%d!\n", file, line); - -} /* end __debug_bug_printk() */ -#endif diff --git a/arch/frv/kernel/dma.c b/arch/frv/kernel/dma.c deleted file mode 100644 index 370dc9fa0b11..000000000000 --- a/arch/frv/kernel/dma.c +++ /dev/null @@ -1,463 +0,0 @@ -/* dma.c: DMA controller management on FR401 and the like - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct frv_dma_channel { - uint8_t flags; -#define FRV_DMA_FLAGS_RESERVED 0x01 -#define FRV_DMA_FLAGS_INUSE 0x02 -#define FRV_DMA_FLAGS_PAUSED 0x04 - uint8_t cap; /* capabilities available */ - int irq; /* completion IRQ */ - uint32_t dreqbit; - uint32_t dackbit; - uint32_t donebit; - const unsigned long ioaddr; /* DMA controller regs addr */ - const char *devname; - dma_irq_handler_t handler; - void *data; -}; - - -#define __get_DMAC(IO,X) ({ *(volatile unsigned long *)((IO) + DMAC_##X##x); }) - -#define __set_DMAC(IO,X,V) \ -do { \ - *(volatile unsigned long *)((IO) + DMAC_##X##x) = (V); \ - mb(); \ -} while(0) - -#define ___set_DMAC(IO,X,V) \ -do { \ - *(volatile unsigned long *)((IO) + DMAC_##X##x) = (V); \ -} while(0) - - -static struct frv_dma_channel frv_dma_channels[FRV_DMA_NCHANS] = { - [0] = { - .cap = FRV_DMA_CAP_DREQ | FRV_DMA_CAP_DACK | FRV_DMA_CAP_DONE, - .irq = IRQ_CPU_DMA0, - .dreqbit = SIR_DREQ0_INPUT, - .dackbit = SOR_DACK0_OUTPUT, - .donebit = SOR_DONE0_OUTPUT, - .ioaddr = 0xfe000900, - }, - [1] = { - .cap = FRV_DMA_CAP_DREQ | FRV_DMA_CAP_DACK | FRV_DMA_CAP_DONE, - .irq = IRQ_CPU_DMA1, - .dreqbit = SIR_DREQ1_INPUT, - .dackbit = SOR_DACK1_OUTPUT, - .donebit = SOR_DONE1_OUTPUT, - .ioaddr = 0xfe000980, - }, - [2] = { - .cap = FRV_DMA_CAP_DREQ | FRV_DMA_CAP_DACK, - .irq = IRQ_CPU_DMA2, - .dreqbit = SIR_DREQ2_INPUT, - .dackbit = SOR_DACK2_OUTPUT, - .ioaddr = 0xfe000a00, - }, - [3] = { - .cap = FRV_DMA_CAP_DREQ | FRV_DMA_CAP_DACK, - .irq = IRQ_CPU_DMA3, - .dreqbit = SIR_DREQ3_INPUT, - .dackbit = SOR_DACK3_OUTPUT, - .ioaddr = 0xfe000a80, - }, - [4] = { - .cap = FRV_DMA_CAP_DREQ, - .irq = IRQ_CPU_DMA4, - .dreqbit = SIR_DREQ4_INPUT, - .ioaddr = 0xfe001000, - }, - [5] = { - .cap = FRV_DMA_CAP_DREQ, - .irq = IRQ_CPU_DMA5, - .dreqbit = SIR_DREQ5_INPUT, - .ioaddr = 0xfe001080, - }, - [6] = { - .cap = FRV_DMA_CAP_DREQ, - .irq = IRQ_CPU_DMA6, - .dreqbit = SIR_DREQ6_INPUT, - .ioaddr = 0xfe001100, - }, - [7] = { - .cap = FRV_DMA_CAP_DREQ, - .irq = IRQ_CPU_DMA7, - .dreqbit = SIR_DREQ7_INPUT, - .ioaddr = 0xfe001180, - }, -}; - -static DEFINE_RWLOCK(frv_dma_channels_lock); - -unsigned int frv_dma_inprogress; - -#define frv_clear_dma_inprogress(channel) \ - (void)__atomic32_fetch_and(~(1 << (channel)), &frv_dma_inprogress); - -#define frv_set_dma_inprogress(channel) \ - (void)__atomic32_fetch_or(1 << (channel), &frv_dma_inprogress); - -/*****************************************************************************/ -/* - * DMA irq handler - determine channel involved, grab status and call real handler - */ -static irqreturn_t dma_irq_handler(int irq, void *_channel) -{ - struct frv_dma_channel *channel = _channel; - - frv_clear_dma_inprogress(channel - frv_dma_channels); - return channel->handler(channel - frv_dma_channels, - __get_DMAC(channel->ioaddr, CSTR), - channel->data); - -} /* end dma_irq_handler() */ - -/*****************************************************************************/ -/* - * Determine which DMA controllers are present on this CPU - */ -void __init frv_dma_init(void) -{ - unsigned long psr = __get_PSR(); - int num_dma, i; - - /* First, determine how many DMA channels are available */ - switch (PSR_IMPLE(psr)) { - case PSR_IMPLE_FR405: - case PSR_IMPLE_FR451: - case PSR_IMPLE_FR501: - case PSR_IMPLE_FR551: - num_dma = FRV_DMA_8CHANS; - break; - - case PSR_IMPLE_FR401: - default: - num_dma = FRV_DMA_4CHANS; - break; - } - - /* Now mark all of the non-existent channels as reserved */ - for(i = num_dma; i < FRV_DMA_NCHANS; i++) - frv_dma_channels[i].flags = FRV_DMA_FLAGS_RESERVED; - -} /* end frv_dma_init() */ - -/*****************************************************************************/ -/* - * allocate a DMA controller channel and the IRQ associated with it - */ -int frv_dma_open(const char *devname, - unsigned long dmamask, - int dmacap, - dma_irq_handler_t handler, - unsigned long irq_flags, - void *data) -{ - struct frv_dma_channel *channel; - int dma, ret; - uint32_t val; - - write_lock(&frv_dma_channels_lock); - - ret = -ENOSPC; - - for (dma = FRV_DMA_NCHANS - 1; dma >= 0; dma--) { - channel = &frv_dma_channels[dma]; - - if (!test_bit(dma, &dmamask)) - continue; - - if ((channel->cap & dmacap) != dmacap) - continue; - - if (!frv_dma_channels[dma].flags) - goto found; - } - - goto out; - - found: - ret = request_irq(channel->irq, dma_irq_handler, irq_flags, devname, channel); - if (ret < 0) - goto out; - - /* okay, we've allocated all the resources */ - channel = &frv_dma_channels[dma]; - - channel->flags |= FRV_DMA_FLAGS_INUSE; - channel->devname = devname; - channel->handler = handler; - channel->data = data; - - /* Now make sure we are set up for DMA and not GPIO */ - /* SIR bit must be set for DMA to work */ - __set_SIR(channel->dreqbit | __get_SIR()); - /* SOR bits depend on what the caller requests */ - val = __get_SOR(); - if(dmacap & FRV_DMA_CAP_DACK) - val |= channel->dackbit; - else - val &= ~channel->dackbit; - if(dmacap & FRV_DMA_CAP_DONE) - val |= channel->donebit; - else - val &= ~channel->donebit; - __set_SOR(val); - - ret = dma; - out: - write_unlock(&frv_dma_channels_lock); - return ret; -} /* end frv_dma_open() */ - -EXPORT_SYMBOL(frv_dma_open); - -/*****************************************************************************/ -/* - * close a DMA channel and its associated interrupt - */ -void frv_dma_close(int dma) -{ - struct frv_dma_channel *channel = &frv_dma_channels[dma]; - unsigned long flags; - - write_lock_irqsave(&frv_dma_channels_lock, flags); - - free_irq(channel->irq, channel); - frv_dma_stop(dma); - - channel->flags &= ~FRV_DMA_FLAGS_INUSE; - - write_unlock_irqrestore(&frv_dma_channels_lock, flags); -} /* end frv_dma_close() */ - -EXPORT_SYMBOL(frv_dma_close); - -/*****************************************************************************/ -/* - * set static configuration on a DMA channel - */ -void frv_dma_config(int dma, unsigned long ccfr, unsigned long cctr, unsigned long apr) -{ - unsigned long ioaddr = frv_dma_channels[dma].ioaddr; - - ___set_DMAC(ioaddr, CCFR, ccfr); - ___set_DMAC(ioaddr, CCTR, cctr); - ___set_DMAC(ioaddr, APR, apr); - mb(); - -} /* end frv_dma_config() */ - -EXPORT_SYMBOL(frv_dma_config); - -/*****************************************************************************/ -/* - * start a DMA channel - */ -void frv_dma_start(int dma, - unsigned long sba, unsigned long dba, - unsigned long pix, unsigned long six, unsigned long bcl) -{ - unsigned long ioaddr = frv_dma_channels[dma].ioaddr; - - ___set_DMAC(ioaddr, SBA, sba); - ___set_DMAC(ioaddr, DBA, dba); - ___set_DMAC(ioaddr, PIX, pix); - ___set_DMAC(ioaddr, SIX, six); - ___set_DMAC(ioaddr, BCL, bcl); - ___set_DMAC(ioaddr, CSTR, 0); - mb(); - - __set_DMAC(ioaddr, CCTR, __get_DMAC(ioaddr, CCTR) | DMAC_CCTRx_ACT); - frv_set_dma_inprogress(dma); - -} /* end frv_dma_start() */ - -EXPORT_SYMBOL(frv_dma_start); - -/*****************************************************************************/ -/* - * restart a DMA channel that's been stopped in circular addressing mode by comparison-end - */ -void frv_dma_restart_circular(int dma, unsigned long six) -{ - unsigned long ioaddr = frv_dma_channels[dma].ioaddr; - - ___set_DMAC(ioaddr, SIX, six); - ___set_DMAC(ioaddr, CSTR, __get_DMAC(ioaddr, CSTR) & ~DMAC_CSTRx_CE); - mb(); - - __set_DMAC(ioaddr, CCTR, __get_DMAC(ioaddr, CCTR) | DMAC_CCTRx_ACT); - frv_set_dma_inprogress(dma); - -} /* end frv_dma_restart_circular() */ - -EXPORT_SYMBOL(frv_dma_restart_circular); - -/*****************************************************************************/ -/* - * stop a DMA channel - */ -void frv_dma_stop(int dma) -{ - unsigned long ioaddr = frv_dma_channels[dma].ioaddr; - uint32_t cctr; - - ___set_DMAC(ioaddr, CSTR, 0); - cctr = __get_DMAC(ioaddr, CCTR); - cctr &= ~(DMAC_CCTRx_IE | DMAC_CCTRx_ACT); - cctr |= DMAC_CCTRx_FC; /* fifo clear */ - __set_DMAC(ioaddr, CCTR, cctr); - __set_DMAC(ioaddr, BCL, 0); - frv_clear_dma_inprogress(dma); -} /* end frv_dma_stop() */ - -EXPORT_SYMBOL(frv_dma_stop); - -/*****************************************************************************/ -/* - * test interrupt status of DMA channel - */ -int is_frv_dma_interrupting(int dma) -{ - unsigned long ioaddr = frv_dma_channels[dma].ioaddr; - - return __get_DMAC(ioaddr, CSTR) & (1 << 23); - -} /* end is_frv_dma_interrupting() */ - -EXPORT_SYMBOL(is_frv_dma_interrupting); - -/*****************************************************************************/ -/* - * dump data about a DMA channel - */ -void frv_dma_dump(int dma) -{ - unsigned long ioaddr = frv_dma_channels[dma].ioaddr; - unsigned long cstr, pix, six, bcl; - - cstr = __get_DMAC(ioaddr, CSTR); - pix = __get_DMAC(ioaddr, PIX); - six = __get_DMAC(ioaddr, SIX); - bcl = __get_DMAC(ioaddr, BCL); - - printk("DMA[%d] cstr=%lx pix=%lx six=%lx bcl=%lx\n", dma, cstr, pix, six, bcl); - -} /* end frv_dma_dump() */ - -EXPORT_SYMBOL(frv_dma_dump); - -/*****************************************************************************/ -/* - * pause all DMA controllers - * - called by clock mangling routines - * - caller must be holding interrupts disabled - */ -void frv_dma_pause_all(void) -{ - struct frv_dma_channel *channel; - unsigned long ioaddr; - unsigned long cstr, cctr; - int dma; - - write_lock(&frv_dma_channels_lock); - - for (dma = FRV_DMA_NCHANS - 1; dma >= 0; dma--) { - channel = &frv_dma_channels[dma]; - - if (!(channel->flags & FRV_DMA_FLAGS_INUSE)) - continue; - - ioaddr = channel->ioaddr; - cctr = __get_DMAC(ioaddr, CCTR); - if (cctr & DMAC_CCTRx_ACT) { - cctr &= ~DMAC_CCTRx_ACT; - __set_DMAC(ioaddr, CCTR, cctr); - - do { - cstr = __get_DMAC(ioaddr, CSTR); - } while (cstr & DMAC_CSTRx_BUSY); - - if (cstr & DMAC_CSTRx_FED) - channel->flags |= FRV_DMA_FLAGS_PAUSED; - frv_clear_dma_inprogress(dma); - } - } - -} /* end frv_dma_pause_all() */ - -EXPORT_SYMBOL(frv_dma_pause_all); - -/*****************************************************************************/ -/* - * resume paused DMA controllers - * - called by clock mangling routines - * - caller must be holding interrupts disabled - */ -void frv_dma_resume_all(void) -{ - struct frv_dma_channel *channel; - unsigned long ioaddr; - unsigned long cstr, cctr; - int dma; - - for (dma = FRV_DMA_NCHANS - 1; dma >= 0; dma--) { - channel = &frv_dma_channels[dma]; - - if (!(channel->flags & FRV_DMA_FLAGS_PAUSED)) - continue; - - ioaddr = channel->ioaddr; - cstr = __get_DMAC(ioaddr, CSTR); - cstr &= ~(DMAC_CSTRx_FED | DMAC_CSTRx_INT); - __set_DMAC(ioaddr, CSTR, cstr); - - cctr = __get_DMAC(ioaddr, CCTR); - cctr |= DMAC_CCTRx_ACT; - __set_DMAC(ioaddr, CCTR, cctr); - - channel->flags &= ~FRV_DMA_FLAGS_PAUSED; - frv_set_dma_inprogress(dma); - } - - write_unlock(&frv_dma_channels_lock); - -} /* end frv_dma_resume_all() */ - -EXPORT_SYMBOL(frv_dma_resume_all); - -/*****************************************************************************/ -/* - * dma status clear - */ -void frv_dma_status_clear(int dma) -{ - unsigned long ioaddr = frv_dma_channels[dma].ioaddr; - uint32_t cctr; - ___set_DMAC(ioaddr, CSTR, 0); - - cctr = __get_DMAC(ioaddr, CCTR); -} /* end frv_dma_status_clear() */ - -EXPORT_SYMBOL(frv_dma_status_clear); diff --git a/arch/frv/kernel/entry-table.S b/arch/frv/kernel/entry-table.S deleted file mode 100644 index 06c5ae191e59..000000000000 --- a/arch/frv/kernel/entry-table.S +++ /dev/null @@ -1,329 +0,0 @@ -/* entry-table.S: main trap vector tables and exception jump table - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - */ - -#include -#include -#include - -############################################################################### -# -# Declare the main trap and vector tables -# -# There are six tables: -# -# (1) The trap table for debug mode -# (2) The trap table for kernel mode -# (3) The trap table for user mode -# -# The CPU jumps to an appropriate slot in the appropriate table to perform -# exception processing. We have three different tables for the three -# different CPU modes because there is no hardware differentiation between -# stack pointers for these three modes, and so we have to invent one when -# crossing mode boundaries. -# -# (4) The exception handler vector table -# -# The user and kernel trap tables use the same prologue for normal -# exception processing. The prologue then jumps to the handler in this -# table, as indexed by the exception ID from the TBR. -# -# (5) The fixup table for kernel-trap single-step -# (6) The fixup table for user-trap single-step -# -# Due to the way single-stepping works on this CPU (single-step is not -# disabled when crossing exception boundaries, only when in debug mode), -# we have to catch the single-step event in break.S and jump to the fixup -# routine pointed to by this table. -# -# The linker script places the user mode and kernel mode trap tables on to -# the same 8Kb page, so that break.S can be more efficient when performing -# single-step bypass management -# -############################################################################### - - # trap table for entry from debug mode - .section .trap.break,"ax" - .balign 256*16 - .globl __entry_breaktrap_table -__entry_breaktrap_table: - - # trap table for entry from user mode - .section .trap.user,"ax" - .balign 256*16 - .globl __entry_usertrap_table -__entry_usertrap_table: - - # trap table for entry from kernel mode - .section .trap.kernel,"ax" - .balign 256*16 - .globl __entry_kerneltrap_table -__entry_kerneltrap_table: - - # exception handler jump table - .section .trap.vector,"ax" - .balign 256*4 - .globl __entry_vector_table -__entry_vector_table: - - # trap fixup table for single-stepping in user mode - .section .trap.fixup.user,"a" - .balign 256*4 - .globl __break_usertrap_fixup_table -__break_usertrap_fixup_table: - - # trap fixup table for single-stepping in user mode - .section .trap.fixup.kernel,"a" - .balign 256*4 - .globl __break_kerneltrap_fixup_table -__break_kerneltrap_fixup_table: - - # handler declaration for a software or program interrupt -.macro VECTOR_SOFTPROG tbr_tt, vec - .section .trap.user - .org \tbr_tt - bra __entry_uspace_softprog_interrupt - .section .trap.fixup.user - .org \tbr_tt >> 2 - .long __break_step_uspace_softprog_interrupt - .section .trap.kernel - .org \tbr_tt - bra __entry_kernel_softprog_interrupt - .section .trap.fixup.kernel - .org \tbr_tt >> 2 - .long __break_step_kernel_softprog_interrupt - .section .trap.vector - .org \tbr_tt >> 2 - .long \vec -.endm - - # handler declaration for a maskable external interrupt -.macro VECTOR_IRQ tbr_tt, vec - .section .trap.user - .org \tbr_tt - bra __entry_uspace_external_interrupt - .section .trap.fixup.user - .org \tbr_tt >> 2 - .long __break_step_uspace_external_interrupt - .section .trap.kernel - .org \tbr_tt - # deal with virtual interrupt disablement - beq icc2,#0,__entry_kernel_external_interrupt_virtually_disabled - bra __entry_kernel_external_interrupt - .section .trap.fixup.kernel - .org \tbr_tt >> 2 - .long __break_step_kernel_external_interrupt - .section .trap.vector - .org \tbr_tt >> 2 - .long \vec -.endm - - # handler declaration for an NMI external interrupt -.macro VECTOR_NMI tbr_tt, vec - .section .trap.user - .org \tbr_tt - break - break - break - break - .section .trap.kernel - .org \tbr_tt - break - break - break - break - .section .trap.vector - .org \tbr_tt >> 2 - .long \vec -.endm - - # handler declaration for an MMU only software or program interrupt -.macro VECTOR_SP_MMU tbr_tt, vec -#ifdef CONFIG_MMU - VECTOR_SOFTPROG \tbr_tt, \vec -#else - VECTOR_NMI \tbr_tt, 0 -#endif -.endm - - -############################################################################### -# -# specification of the vectors -# - note: each macro inserts code into multiple sections -# -############################################################################### - VECTOR_SP_MMU TBR_TT_INSTR_MMU_MISS, __entry_insn_mmu_miss - VECTOR_SOFTPROG TBR_TT_INSTR_ACC_ERROR, __entry_insn_access_error - VECTOR_SOFTPROG TBR_TT_INSTR_ACC_EXCEP, __entry_insn_access_exception - VECTOR_SOFTPROG TBR_TT_PRIV_INSTR, __entry_privileged_instruction - VECTOR_SOFTPROG TBR_TT_ILLEGAL_INSTR, __entry_illegal_instruction - VECTOR_SOFTPROG TBR_TT_FP_EXCEPTION, __entry_media_exception - VECTOR_SOFTPROG TBR_TT_MP_EXCEPTION, __entry_media_exception - VECTOR_SOFTPROG TBR_TT_DATA_ACC_ERROR, __entry_data_access_error - VECTOR_SP_MMU TBR_TT_DATA_MMU_MISS, __entry_data_mmu_miss - VECTOR_SOFTPROG TBR_TT_DATA_ACC_EXCEP, __entry_data_access_exception - VECTOR_SOFTPROG TBR_TT_DATA_STR_ERROR, __entry_data_store_error - VECTOR_SOFTPROG TBR_TT_DIVISION_EXCEP, __entry_division_exception - -#ifdef CONFIG_MMU - .section .trap.user - .org TBR_TT_INSTR_TLB_MISS - .globl __trap_user_insn_tlb_miss -__trap_user_insn_tlb_miss: - movsg ear0,gr28 /* faulting address */ - movsg scr0,gr31 /* get mapped PTD coverage start address */ - xor.p gr28,gr31,gr31 /* compare addresses */ - bra __entry_user_insn_tlb_miss - - .org TBR_TT_DATA_TLB_MISS - .globl __trap_user_data_tlb_miss -__trap_user_data_tlb_miss: - movsg ear0,gr28 /* faulting address */ - movsg scr1,gr31 /* get mapped PTD coverage start address */ - xor.p gr28,gr31,gr31 /* compare addresses */ - bra __entry_user_data_tlb_miss - - .section .trap.kernel - .org TBR_TT_INSTR_TLB_MISS - .globl __trap_kernel_insn_tlb_miss -__trap_kernel_insn_tlb_miss: - movsg ear0,gr29 /* faulting address */ - movsg scr0,gr31 /* get mapped PTD coverage start address */ - xor.p gr29,gr31,gr31 /* compare addresses */ - bra __entry_kernel_insn_tlb_miss - - .org TBR_TT_DATA_TLB_MISS - .globl __trap_kernel_data_tlb_miss -__trap_kernel_data_tlb_miss: - movsg ear0,gr29 /* faulting address */ - movsg scr1,gr31 /* get mapped PTD coverage start address */ - xor.p gr29,gr31,gr31 /* compare addresses */ - bra __entry_kernel_data_tlb_miss - - .section .trap.fixup.user - .org TBR_TT_INSTR_TLB_MISS >> 2 - .globl __trap_fixup_user_insn_tlb_miss -__trap_fixup_user_insn_tlb_miss: - .long __break_user_insn_tlb_miss - .org TBR_TT_DATA_TLB_MISS >> 2 - .globl __trap_fixup_user_data_tlb_miss -__trap_fixup_user_data_tlb_miss: - .long __break_user_data_tlb_miss - - .section .trap.fixup.kernel - .org TBR_TT_INSTR_TLB_MISS >> 2 - .globl __trap_fixup_kernel_insn_tlb_miss -__trap_fixup_kernel_insn_tlb_miss: - .long __break_kernel_insn_tlb_miss - .org TBR_TT_DATA_TLB_MISS >> 2 - .globl __trap_fixup_kernel_data_tlb_miss -__trap_fixup_kernel_data_tlb_miss: - .long __break_kernel_data_tlb_miss - - .section .trap.vector - .org TBR_TT_INSTR_TLB_MISS >> 2 - .long __entry_insn_mmu_fault - .org TBR_TT_DATA_TLB_MISS >> 2 - .long __entry_data_mmu_fault -#endif - - VECTOR_SP_MMU TBR_TT_DATA_DAT_EXCEP, __entry_data_dat_fault - VECTOR_NMI TBR_TT_DECREMENT_TIMER, __entry_do_NMI - VECTOR_SOFTPROG TBR_TT_COMPOUND_EXCEP, __entry_compound_exception - VECTOR_IRQ TBR_TT_INTERRUPT_1, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_2, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_3, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_4, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_5, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_6, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_7, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_8, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_9, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_10, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_11, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_12, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_13, __entry_do_IRQ - VECTOR_IRQ TBR_TT_INTERRUPT_14, __entry_do_IRQ - VECTOR_NMI TBR_TT_INTERRUPT_15, __entry_do_NMI - - # miscellaneous user mode entry points - .section .trap.user - .org TBR_TT_TRAP0 - .rept 127 - bra __entry_uspace_softprog_interrupt - .long 0,0,0 - .endr - .org TBR_TT_BREAK - bra __entry_break - .long 0,0,0 - - .section .trap.fixup.user - .org TBR_TT_TRAP0 >> 2 - .rept 127 - .long __break_step_uspace_softprog_interrupt - .endr - .org TBR_TT_BREAK >> 2 - .long 0 - - # miscellaneous kernel mode entry points - .section .trap.kernel - .org TBR_TT_TRAP0 - bra __entry_kernel_softprog_interrupt - .org TBR_TT_TRAP1 - bra __entry_kernel_softprog_interrupt - - # trap #2 in kernel - reenable interrupts - .org TBR_TT_TRAP2 - bra __entry_kernel_external_interrupt_virtual_reenable - - # miscellaneous kernel traps - .org TBR_TT_TRAP3 - .rept 124 - bra __entry_kernel_softprog_interrupt - .long 0,0,0 - .endr - .org TBR_TT_BREAK - bra __entry_break - .long 0,0,0 - - .section .trap.fixup.kernel - .org TBR_TT_TRAP0 >> 2 - .long __break_step_kernel_softprog_interrupt - .long __break_step_kernel_softprog_interrupt - .long __break_step_kernel_external_interrupt_virtual_reenable - .rept 124 - .long __break_step_kernel_softprog_interrupt - .endr - .org TBR_TT_BREAK >> 2 - .long 0 - - # miscellaneous debug mode entry points - .section .trap.break - .org TBR_TT_BREAK - movsg bpcsr,gr30 - jmpl @(gr30,gr0) - - # miscellaneous vectors - .section .trap.vector - .org TBR_TT_TRAP0 >> 2 - .long system_call - .rept 119 - .long __entry_unsupported_trap - .endr - - # userspace atomic op emulation, traps 120-126 - .rept 7 - .long __entry_atomic_op - .endr - - .org TBR_TT_BREAK >> 2 - .long __entry_debug_exception diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S deleted file mode 100644 index dfcd263c0517..000000000000 --- a/arch/frv/kernel/entry.S +++ /dev/null @@ -1,1519 +0,0 @@ -/* entry.S: FR-V entry - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * - * Entry to the kernel is "interesting": - * (1) There are no stack pointers, not even for the kernel - * (2) General Registers should not be clobbered - * (3) There are no kernel-only data registers - * (4) Since all addressing modes are wrt to a General Register, no global - * variables can be reached - * - * We deal with this by declaring that we shall kill GR28 on entering the - * kernel from userspace - * - * However, since break interrupts can interrupt the CPU even when PSR.ET==0, - * they can't rely on GR28 to be anything useful, and so need to clobber a - * separate register (GR31). Break interrupts are managed in break.S - * - * GR29 _is_ saved, and holds the current task pointer globally - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define nr_syscalls ((syscall_table_size)/4) - - .section .text..entry - .balign 4 - -.macro LEDS val -# sethi.p %hi(0xe1200004),gr30 -# setlo %lo(0xe1200004),gr30 -# setlos #~\val,gr31 -# st gr31,@(gr30,gr0) -# sethi.p %hi(0xffc00100),gr30 -# setlo %lo(0xffc00100),gr30 -# sth gr0,@(gr30,gr0) -# membar -.endm - -.macro LEDS32 -# not gr31,gr31 -# sethi.p %hi(0xe1200004),gr30 -# setlo %lo(0xe1200004),gr30 -# st.p gr31,@(gr30,gr0) -# srli gr31,#16,gr31 -# sethi.p %hi(0xffc00100),gr30 -# setlo %lo(0xffc00100),gr30 -# sth gr31,@(gr30,gr0) -# membar -.endm - -############################################################################### -# -# entry point for External interrupts received whilst executing userspace code -# -############################################################################### - .globl __entry_uspace_external_interrupt - .type __entry_uspace_external_interrupt,@function -__entry_uspace_external_interrupt: - LEDS 0x6200 - sethi.p %hi(__kernel_frame0_ptr),gr28 - setlo %lo(__kernel_frame0_ptr),gr28 - ldi @(gr28,#0),gr28 - - # handle h/w single-step through exceptions - sti gr0,@(gr28,#REG__STATUS) - - .globl __entry_uspace_external_interrupt_reentry -__entry_uspace_external_interrupt_reentry: - LEDS 0x6201 - - setlos #REG__END,gr30 - dcpl gr28,gr30,#0 - - # finish building the exception frame - sti sp, @(gr28,#REG_SP) - stdi gr2, @(gr28,#REG_GR(2)) - stdi gr4, @(gr28,#REG_GR(4)) - stdi gr6, @(gr28,#REG_GR(6)) - stdi gr8, @(gr28,#REG_GR(8)) - stdi gr10,@(gr28,#REG_GR(10)) - stdi gr12,@(gr28,#REG_GR(12)) - stdi gr14,@(gr28,#REG_GR(14)) - stdi gr16,@(gr28,#REG_GR(16)) - stdi gr18,@(gr28,#REG_GR(18)) - stdi gr20,@(gr28,#REG_GR(20)) - stdi gr22,@(gr28,#REG_GR(22)) - stdi gr24,@(gr28,#REG_GR(24)) - stdi gr26,@(gr28,#REG_GR(26)) - sti gr0, @(gr28,#REG_GR(28)) - sti gr29,@(gr28,#REG_GR(29)) - stdi.p gr30,@(gr28,#REG_GR(30)) - - # set up the kernel stack pointer - ori gr28,0,sp - - movsg tbr ,gr20 - movsg psr ,gr22 - movsg pcsr,gr21 - movsg isr ,gr23 - movsg ccr ,gr24 - movsg cccr,gr25 - movsg lr ,gr26 - movsg lcr ,gr27 - - setlos.p #-1,gr4 - andi gr22,#PSR_PS,gr5 /* try to rebuild original PSR value */ - andi.p gr22,#~(PSR_PS|PSR_S),gr6 - slli gr5,#1,gr5 - or gr6,gr5,gr5 - andi gr5,#~PSR_ET,gr5 - - sti gr20,@(gr28,#REG_TBR) - sti gr21,@(gr28,#REG_PC) - sti gr5 ,@(gr28,#REG_PSR) - sti gr23,@(gr28,#REG_ISR) - stdi gr24,@(gr28,#REG_CCR) - stdi gr26,@(gr28,#REG_LR) - sti gr4 ,@(gr28,#REG_SYSCALLNO) - - movsg iacc0h,gr4 - movsg iacc0l,gr5 - stdi gr4,@(gr28,#REG_IACC0) - - movsg gner0,gr4 - movsg gner1,gr5 - stdi.p gr4,@(gr28,#REG_GNER0) - - # interrupts start off fully disabled in the interrupt handler - subcc gr0,gr0,gr0,icc2 /* set Z and clear C */ - - # set up kernel global registers - sethi.p %hi(__kernel_current_task),gr5 - setlo %lo(__kernel_current_task),gr5 - sethi.p %hi(_gp),gr16 - setlo %lo(_gp),gr16 - ldi @(gr5,#0),gr29 - ldi.p @(gr29,#4),gr15 ; __current_thread_info = current->thread_info - - # make sure we (the kernel) get div-zero and misalignment exceptions - setlos #ISR_EDE|ISR_DTT_DIVBYZERO|ISR_EMAM_EXCEPTION,gr5 - movgs gr5,isr - - # switch to the kernel trap table - sethi.p %hi(__entry_kerneltrap_table),gr6 - setlo %lo(__entry_kerneltrap_table),gr6 - movgs gr6,tbr - - # set the return address - sethi.p %hi(__entry_return_from_user_interrupt),gr4 - setlo %lo(__entry_return_from_user_interrupt),gr4 - movgs gr4,lr - - # raise the minimum interrupt priority to 15 (NMI only) and enable exceptions - movsg psr,gr4 - - ori gr4,#PSR_PIL_14,gr4 - movgs gr4,psr - ori gr4,#PSR_PIL_14|PSR_ET,gr4 - movgs gr4,psr - - LEDS 0x6202 - bra do_IRQ - - .size __entry_uspace_external_interrupt,.-__entry_uspace_external_interrupt - -############################################################################### -# -# entry point for External interrupts received whilst executing kernel code -# - on arriving here, the following registers should already be set up: -# GR15 - current thread_info struct pointer -# GR16 - kernel GP-REL pointer -# GR29 - current task struct pointer -# TBR - kernel trap vector table -# ISR - kernel's preferred integer controls -# -############################################################################### - .globl __entry_kernel_external_interrupt - .type __entry_kernel_external_interrupt,@function -__entry_kernel_external_interrupt: - LEDS 0x6210 -// sub sp,gr15,gr31 -// LEDS32 - - # set up the stack pointer - or.p sp,gr0,gr30 - subi sp,#REG__END,sp - sti gr30,@(sp,#REG_SP) - - # handle h/w single-step through exceptions - sti gr0,@(sp,#REG__STATUS) - - .globl __entry_kernel_external_interrupt_reentry -__entry_kernel_external_interrupt_reentry: - LEDS 0x6211 - - # set up the exception frame - setlos #REG__END,gr30 - dcpl sp,gr30,#0 - - sti.p gr28,@(sp,#REG_GR(28)) - ori sp,0,gr28 - - # finish building the exception frame - stdi gr2,@(gr28,#REG_GR(2)) - stdi gr4,@(gr28,#REG_GR(4)) - stdi gr6,@(gr28,#REG_GR(6)) - stdi gr8,@(gr28,#REG_GR(8)) - stdi gr10,@(gr28,#REG_GR(10)) - stdi gr12,@(gr28,#REG_GR(12)) - stdi gr14,@(gr28,#REG_GR(14)) - stdi gr16,@(gr28,#REG_GR(16)) - stdi gr18,@(gr28,#REG_GR(18)) - stdi gr20,@(gr28,#REG_GR(20)) - stdi gr22,@(gr28,#REG_GR(22)) - stdi gr24,@(gr28,#REG_GR(24)) - stdi gr26,@(gr28,#REG_GR(26)) - sti gr29,@(gr28,#REG_GR(29)) - stdi.p gr30,@(gr28,#REG_GR(30)) - - # note virtual interrupts will be fully enabled upon return - subicc gr0,#1,gr0,icc2 /* clear Z, set C */ - - movsg tbr ,gr20 - movsg psr ,gr22 - movsg pcsr,gr21 - movsg isr ,gr23 - movsg ccr ,gr24 - movsg cccr,gr25 - movsg lr ,gr26 - movsg lcr ,gr27 - - setlos.p #-1,gr4 - andi gr22,#PSR_PS,gr5 /* try to rebuild original PSR value */ - andi.p gr22,#~(PSR_PS|PSR_S),gr6 - slli gr5,#1,gr5 - or gr6,gr5,gr5 - andi.p gr5,#~PSR_ET,gr5 - - # set CCCR.CC3 to Undefined to abort atomic-modify completion inside the kernel - # - for an explanation of how it works, see: Documentation/frv/atomic-ops.txt - andi gr25,#~0xc0,gr25 - - sti gr20,@(gr28,#REG_TBR) - sti gr21,@(gr28,#REG_PC) - sti gr5 ,@(gr28,#REG_PSR) - sti gr23,@(gr28,#REG_ISR) - stdi gr24,@(gr28,#REG_CCR) - stdi gr26,@(gr28,#REG_LR) - sti gr4 ,@(gr28,#REG_SYSCALLNO) - - movsg iacc0h,gr4 - movsg iacc0l,gr5 - stdi gr4,@(gr28,#REG_IACC0) - - movsg gner0,gr4 - movsg gner1,gr5 - stdi.p gr4,@(gr28,#REG_GNER0) - - # interrupts start off fully disabled in the interrupt handler - subcc gr0,gr0,gr0,icc2 /* set Z and clear C */ - - # set the return address - sethi.p %hi(__entry_return_from_kernel_interrupt),gr4 - setlo %lo(__entry_return_from_kernel_interrupt),gr4 - movgs gr4,lr - - # clear power-saving mode flags - movsg hsr0,gr4 - andi gr4,#~HSR0_PDM,gr4 - movgs gr4,hsr0 - - # raise the minimum interrupt priority to 15 (NMI only) and enable exceptions - movsg psr,gr4 - ori gr4,#PSR_PIL_14,gr4 - movgs gr4,psr - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - - LEDS 0x6212 - bra do_IRQ - - .size __entry_kernel_external_interrupt,.-__entry_kernel_external_interrupt - -############################################################################### -# -# deal with interrupts that were actually virtually disabled -# - we need to really disable them, flag the fact and return immediately -# - if you change this, you must alter break.S also -# -############################################################################### - .balign L1_CACHE_BYTES - .globl __entry_kernel_external_interrupt_virtually_disabled - .type __entry_kernel_external_interrupt_virtually_disabled,@function -__entry_kernel_external_interrupt_virtually_disabled: - movsg psr,gr30 - andi gr30,#~PSR_PIL,gr30 - ori gr30,#PSR_PIL_14,gr30 ; debugging interrupts only - movgs gr30,psr - subcc gr0,gr0,gr0,icc2 ; leave Z set, clear C - rett #0 - - .size __entry_kernel_external_interrupt_virtually_disabled,.-__entry_kernel_external_interrupt_virtually_disabled - -############################################################################### -# -# deal with re-enablement of interrupts that were pending when virtually re-enabled -# - set ICC2.C, re-enable the real interrupts and return -# - we can clear ICC2.Z because we shouldn't be here if it's not 0 [due to TIHI] -# - if you change this, you must alter break.S also -# -############################################################################### - .balign L1_CACHE_BYTES - .globl __entry_kernel_external_interrupt_virtual_reenable - .type __entry_kernel_external_interrupt_virtual_reenable,@function -__entry_kernel_external_interrupt_virtual_reenable: - movsg psr,gr30 - andi gr30,#~PSR_PIL,gr30 ; re-enable interrupts - movgs gr30,psr - subicc gr0,#1,gr0,icc2 ; clear Z, set C - rett #0 - - .size __entry_kernel_external_interrupt_virtual_reenable,.-__entry_kernel_external_interrupt_virtual_reenable - -############################################################################### -# -# entry point for Software and Progam interrupts generated whilst executing userspace code -# -############################################################################### - .globl __entry_uspace_softprog_interrupt - .type __entry_uspace_softprog_interrupt,@function - .globl __entry_uspace_handle_mmu_fault -__entry_uspace_softprog_interrupt: - LEDS 0x6000 -#ifdef CONFIG_MMU - movsg ear0,gr28 -__entry_uspace_handle_mmu_fault: - movgs gr28,scr2 -#endif - sethi.p %hi(__kernel_frame0_ptr),gr28 - setlo %lo(__kernel_frame0_ptr),gr28 - ldi @(gr28,#0),gr28 - - # handle h/w single-step through exceptions - sti gr0,@(gr28,#REG__STATUS) - - .globl __entry_uspace_softprog_interrupt_reentry -__entry_uspace_softprog_interrupt_reentry: - LEDS 0x6001 - - setlos #REG__END,gr30 - dcpl gr28,gr30,#0 - - # set up the kernel stack pointer - sti.p sp,@(gr28,#REG_SP) - ori gr28,0,sp - sti gr0,@(gr28,#REG_GR(28)) - - stdi gr20,@(gr28,#REG_GR(20)) - stdi gr22,@(gr28,#REG_GR(22)) - - movsg tbr,gr20 - movsg pcsr,gr21 - movsg psr,gr22 - - sethi.p %hi(__entry_return_from_user_exception),gr23 - setlo %lo(__entry_return_from_user_exception),gr23 - - bra __entry_common - - .size __entry_uspace_softprog_interrupt,.-__entry_uspace_softprog_interrupt - - # single-stepping was disabled on entry to a TLB handler that then faulted -#ifdef CONFIG_MMU - .globl __entry_uspace_handle_mmu_fault_sstep -__entry_uspace_handle_mmu_fault_sstep: - movgs gr28,scr2 - sethi.p %hi(__kernel_frame0_ptr),gr28 - setlo %lo(__kernel_frame0_ptr),gr28 - ldi @(gr28,#0),gr28 - - # flag single-step re-enablement - sti gr0,@(gr28,#REG__STATUS) - bra __entry_uspace_softprog_interrupt_reentry -#endif - - -############################################################################### -# -# entry point for Software and Progam interrupts generated whilst executing kernel code -# -############################################################################### - .globl __entry_kernel_softprog_interrupt - .type __entry_kernel_softprog_interrupt,@function -__entry_kernel_softprog_interrupt: - LEDS 0x6004 - -#ifdef CONFIG_MMU - movsg ear0,gr30 - movgs gr30,scr2 -#endif - - .globl __entry_kernel_handle_mmu_fault -__entry_kernel_handle_mmu_fault: - # set up the stack pointer - subi sp,#REG__END,sp - sti sp,@(sp,#REG_SP) - sti sp,@(sp,#REG_SP-4) - andi sp,#~7,sp - - # handle h/w single-step through exceptions - sti gr0,@(sp,#REG__STATUS) - - .globl __entry_kernel_softprog_interrupt_reentry -__entry_kernel_softprog_interrupt_reentry: - LEDS 0x6005 - - setlos #REG__END,gr30 - dcpl sp,gr30,#0 - - # set up the exception frame - sti.p gr28,@(sp,#REG_GR(28)) - ori sp,0,gr28 - - stdi gr20,@(gr28,#REG_GR(20)) - stdi gr22,@(gr28,#REG_GR(22)) - - ldi @(sp,#REG_SP),gr22 /* reconstruct the old SP */ - addi gr22,#REG__END,gr22 - sti gr22,@(sp,#REG_SP) - - # set CCCR.CC3 to Undefined to abort atomic-modify completion inside the kernel - # - for an explanation of how it works, see: Documentation/frv/atomic-ops.txt - movsg cccr,gr20 - andi gr20,#~0xc0,gr20 - movgs gr20,cccr - - movsg tbr,gr20 - movsg pcsr,gr21 - movsg psr,gr22 - - sethi.p %hi(__entry_return_from_kernel_exception),gr23 - setlo %lo(__entry_return_from_kernel_exception),gr23 - bra __entry_common - - .size __entry_kernel_softprog_interrupt,.-__entry_kernel_softprog_interrupt - - # single-stepping was disabled on entry to a TLB handler that then faulted -#ifdef CONFIG_MMU - .globl __entry_kernel_handle_mmu_fault_sstep -__entry_kernel_handle_mmu_fault_sstep: - # set up the stack pointer - subi sp,#REG__END,sp - sti sp,@(sp,#REG_SP) - sti sp,@(sp,#REG_SP-4) - andi sp,#~7,sp - - # flag single-step re-enablement - sethi #REG__STATUS_STEP,gr30 - sti gr30,@(sp,#REG__STATUS) - bra __entry_kernel_softprog_interrupt_reentry -#endif - - -############################################################################### -# -# the rest of the kernel entry point code -# - on arriving here, the following registers should be set up: -# GR1 - kernel stack pointer -# GR7 - syscall number (trap 0 only) -# GR8-13 - syscall args (trap 0 only) -# GR20 - saved TBR -# GR21 - saved PC -# GR22 - saved PSR -# GR23 - return handler address -# GR28 - exception frame on stack -# SCR2 - saved EAR0 where applicable (clobbered by ICI & ICEF insns on FR451) -# PSR - PSR.S 1, PSR.ET 0 -# -############################################################################### - .globl __entry_common - .type __entry_common,@function -__entry_common: - LEDS 0x6008 - - # finish building the exception frame - stdi gr2,@(gr28,#REG_GR(2)) - stdi gr4,@(gr28,#REG_GR(4)) - stdi gr6,@(gr28,#REG_GR(6)) - stdi gr8,@(gr28,#REG_GR(8)) - stdi gr10,@(gr28,#REG_GR(10)) - stdi gr12,@(gr28,#REG_GR(12)) - stdi gr14,@(gr28,#REG_GR(14)) - stdi gr16,@(gr28,#REG_GR(16)) - stdi gr18,@(gr28,#REG_GR(18)) - stdi gr24,@(gr28,#REG_GR(24)) - stdi gr26,@(gr28,#REG_GR(26)) - sti gr29,@(gr28,#REG_GR(29)) - stdi gr30,@(gr28,#REG_GR(30)) - - movsg lcr ,gr27 - movsg lr ,gr26 - movgs gr23,lr - movsg cccr,gr25 - movsg ccr ,gr24 - movsg isr ,gr23 - - setlos.p #-1,gr4 - andi gr22,#PSR_PS,gr5 /* try to rebuild original PSR value */ - andi.p gr22,#~(PSR_PS|PSR_S),gr6 - slli gr5,#1,gr5 - or gr6,gr5,gr5 - andi gr5,#~PSR_ET,gr5 - - sti gr20,@(gr28,#REG_TBR) - sti gr21,@(gr28,#REG_PC) - sti gr5 ,@(gr28,#REG_PSR) - sti gr23,@(gr28,#REG_ISR) - stdi gr24,@(gr28,#REG_CCR) - stdi gr26,@(gr28,#REG_LR) - sti gr4 ,@(gr28,#REG_SYSCALLNO) - - movsg iacc0h,gr4 - movsg iacc0l,gr5 - stdi gr4,@(gr28,#REG_IACC0) - - movsg gner0,gr4 - movsg gner1,gr5 - stdi.p gr4,@(gr28,#REG_GNER0) - - # set up virtual interrupt disablement - subicc gr0,#1,gr0,icc2 /* clear Z flag, set C flag */ - - # set up kernel global registers - sethi.p %hi(__kernel_current_task),gr5 - setlo %lo(__kernel_current_task),gr5 - sethi.p %hi(_gp),gr16 - setlo %lo(_gp),gr16 - ldi @(gr5,#0),gr29 - ldi @(gr29,#4),gr15 ; __current_thread_info = current->thread_info - - # switch to the kernel trap table - sethi.p %hi(__entry_kerneltrap_table),gr6 - setlo %lo(__entry_kerneltrap_table),gr6 - movgs gr6,tbr - - # make sure we (the kernel) get div-zero and misalignment exceptions - setlos #ISR_EDE|ISR_DTT_DIVBYZERO|ISR_EMAM_EXCEPTION,gr5 - movgs gr5,isr - - # clear power-saving mode flags - movsg hsr0,gr4 - andi gr4,#~HSR0_PDM,gr4 - movgs gr4,hsr0 - - # multiplex again using old TBR as a guide - setlos.p #TBR_TT,gr3 - sethi %hi(__entry_vector_table),gr6 - and.p gr20,gr3,gr5 - setlo %lo(__entry_vector_table),gr6 - srli gr5,#2,gr5 - ld @(gr5,gr6),gr5 - - LEDS 0x6009 - jmpl @(gr5,gr0) - - - .size __entry_common,.-__entry_common - -############################################################################### -# -# handle instruction MMU fault -# -############################################################################### -#ifdef CONFIG_MMU - .globl __entry_insn_mmu_fault -__entry_insn_mmu_fault: - LEDS 0x6010 - setlos #0,gr8 - movsg esr0,gr9 - movsg scr2,gr10 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - - sethi.p %hi(do_page_fault),gr5 - setlo %lo(do_page_fault),gr5 - jmpl @(gr5,gr0) ; call do_page_fault(0,esr0,ear0) -#endif - - -############################################################################### -# -# handle instruction access error -# -############################################################################### - .globl __entry_insn_access_error -__entry_insn_access_error: - LEDS 0x6011 - sethi.p %hi(insn_access_error),gr5 - setlo %lo(insn_access_error),gr5 - movsg esfr1,gr8 - movsg epcr0,gr9 - movsg esr0,gr10 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call insn_access_error(esfr1,epcr0,esr0) - -############################################################################### -# -# handle various instructions of dubious legality -# -############################################################################### - .globl __entry_unsupported_trap - .globl __entry_illegal_instruction - .globl __entry_privileged_instruction - .globl __entry_debug_exception -__entry_unsupported_trap: - subi gr21,#4,gr21 - sti gr21,@(gr28,#REG_PC) -__entry_illegal_instruction: -__entry_privileged_instruction: -__entry_debug_exception: - LEDS 0x6012 - sethi.p %hi(illegal_instruction),gr5 - setlo %lo(illegal_instruction),gr5 - movsg esfr1,gr8 - movsg epcr0,gr9 - movsg esr0,gr10 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call ill_insn(esfr1,epcr0,esr0) - -############################################################################### -# -# handle atomic operation emulation for userspace -# -############################################################################### - .globl __entry_atomic_op -__entry_atomic_op: - LEDS 0x6012 - sethi.p %hi(atomic_operation),gr5 - setlo %lo(atomic_operation),gr5 - movsg esfr1,gr8 - movsg epcr0,gr9 - movsg esr0,gr10 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call atomic_operation(esfr1,epcr0,esr0) - -############################################################################### -# -# handle media exception -# -############################################################################### - .globl __entry_media_exception -__entry_media_exception: - LEDS 0x6013 - sethi.p %hi(media_exception),gr5 - setlo %lo(media_exception),gr5 - movsg msr0,gr8 - movsg msr1,gr9 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call media_excep(msr0,msr1) - -############################################################################### -# -# handle data MMU fault -# handle data DAT fault (write-protect exception) -# -############################################################################### -#ifdef CONFIG_MMU - .globl __entry_data_mmu_fault -__entry_data_mmu_fault: - .globl __entry_data_dat_fault -__entry_data_dat_fault: - LEDS 0x6014 - setlos #1,gr8 - movsg esr0,gr9 - movsg scr2,gr10 ; saved EAR0 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - - sethi.p %hi(do_page_fault),gr5 - setlo %lo(do_page_fault),gr5 - jmpl @(gr5,gr0) ; call do_page_fault(1,esr0,ear0) -#endif - -############################################################################### -# -# handle data and instruction access exceptions -# -############################################################################### - .globl __entry_insn_access_exception - .globl __entry_data_access_exception -__entry_insn_access_exception: -__entry_data_access_exception: - LEDS 0x6016 - sethi.p %hi(memory_access_exception),gr5 - setlo %lo(memory_access_exception),gr5 - movsg esr0,gr8 - movsg scr2,gr9 ; saved EAR0 - movsg epcr0,gr10 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call memory_access_error(esr0,ear0,epcr0) - -############################################################################### -# -# handle data access error -# -############################################################################### - .globl __entry_data_access_error -__entry_data_access_error: - LEDS 0x6016 - sethi.p %hi(data_access_error),gr5 - setlo %lo(data_access_error),gr5 - movsg esfr1,gr8 - movsg esr15,gr9 - movsg ear15,gr10 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call data_access_error(esfr1,esr15,ear15) - -############################################################################### -# -# handle data store error -# -############################################################################### - .globl __entry_data_store_error -__entry_data_store_error: - LEDS 0x6017 - sethi.p %hi(data_store_error),gr5 - setlo %lo(data_store_error),gr5 - movsg esfr1,gr8 - movsg esr14,gr9 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call data_store_error(esfr1,esr14) - -############################################################################### -# -# handle division exception -# -############################################################################### - .globl __entry_division_exception -__entry_division_exception: - LEDS 0x6018 - sethi.p %hi(division_exception),gr5 - setlo %lo(division_exception),gr5 - movsg esfr1,gr8 - movsg esr0,gr9 - movsg isr,gr10 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call div_excep(esfr1,esr0,isr) - -############################################################################### -# -# handle compound exception -# -############################################################################### - .globl __entry_compound_exception -__entry_compound_exception: - LEDS 0x6019 - sethi.p %hi(compound_exception),gr5 - setlo %lo(compound_exception),gr5 - movsg esfr1,gr8 - movsg esr0,gr9 - movsg esr14,gr10 - movsg esr15,gr11 - movsg msr0,gr12 - movsg msr1,gr13 - - # now that we've accessed the exception regs, we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - jmpl @(gr5,gr0) ; call comp_excep(esfr1,esr0,esr14,esr15,msr0,msr1) - -############################################################################### -# -# handle interrupts and NMIs -# -############################################################################### - .globl __entry_do_IRQ -__entry_do_IRQ: - LEDS 0x6020 - - # we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - bra do_IRQ - - .globl __entry_do_NMI -__entry_do_NMI: - LEDS 0x6021 - - # we can enable exceptions - movsg psr,gr4 - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - bra do_NMI - -############################################################################### -# -# the return path for a newly forked child process -# - __switch_to() saved the old current pointer in GR8 for us -# -############################################################################### - .globl ret_from_fork -ret_from_fork: - LEDS 0x6100 - call schedule_tail - - # fork & co. return 0 to child - setlos.p #0,gr8 - bra __syscall_exit - - .globl ret_from_kernel_thread -ret_from_kernel_thread: - lddi.p @(gr28,#REG_GR(8)),gr20 - call schedule_tail - calll.p @(gr21,gr0) - or gr20,gr20,gr8 - bra __syscall_exit - -################################################################################################### -# -# Return to user mode is not as complex as all this looks, -# but we want the default path for a system call return to -# go as quickly as possible which is why some of this is -# less clear than it otherwise should be. -# -################################################################################################### - .balign L1_CACHE_BYTES - .globl system_call -system_call: - LEDS 0x6101 - movsg psr,gr4 ; enable exceptions - ori gr4,#PSR_ET,gr4 - movgs gr4,psr - - sti gr7,@(gr28,#REG_SYSCALLNO) - sti.p gr8,@(gr28,#REG_ORIG_GR8) - - subicc gr7,#nr_syscalls,gr0,icc0 - bnc icc0,#0,__syscall_badsys - - ldi @(gr15,#TI_FLAGS),gr4 - andicc gr4,#_TIF_SYSCALL_TRACE,gr0,icc0 - bne icc0,#0,__syscall_trace_entry - -__syscall_call: - slli.p gr7,#2,gr7 - sethi %hi(sys_call_table),gr5 - setlo %lo(sys_call_table),gr5 - ld @(gr5,gr7),gr4 - calll @(gr4,gr0) - - -############################################################################### -# -# return to interrupted process -# -############################################################################### -__syscall_exit: - LEDS 0x6300 - - # keep current PSR in GR23 - movsg psr,gr23 - - ldi @(gr28,#REG_PSR),gr22 - - sti.p gr8,@(gr28,#REG_GR(8)) ; save return value - - # rebuild saved psr - execve will change it for init/main.c - srli gr22,#1,gr5 - andi.p gr22,#~PSR_PS,gr22 - andi gr5,#PSR_PS,gr5 - or gr5,gr22,gr22 - ori.p gr22,#PSR_S,gr22 - - # make sure we don't miss an interrupt setting need_resched or sigpending between - # sampling and the RETT - ori gr23,#PSR_PIL_14,gr23 - movgs gr23,psr - - ldi @(gr15,#TI_FLAGS),gr4 - andicc gr4,#_TIF_ALLWORK_MASK,gr0,icc0 - bne icc0,#0,__syscall_exit_work - - # restore all registers and return -__entry_return_direct: - LEDS 0x6301 - - andi gr22,#~PSR_ET,gr22 - movgs gr22,psr - - ldi @(gr28,#REG_ISR),gr23 - lddi @(gr28,#REG_CCR),gr24 - lddi @(gr28,#REG_LR) ,gr26 - ldi @(gr28,#REG_PC) ,gr21 - ldi @(gr28,#REG_TBR),gr20 - - movgs gr20,tbr - movgs gr21,pcsr - movgs gr23,isr - movgs gr24,ccr - movgs gr25,cccr - movgs gr26,lr - movgs gr27,lcr - - lddi @(gr28,#REG_GNER0),gr4 - movgs gr4,gner0 - movgs gr5,gner1 - - lddi @(gr28,#REG_IACC0),gr4 - movgs gr4,iacc0h - movgs gr5,iacc0l - - lddi @(gr28,#REG_GR(4)) ,gr4 - lddi @(gr28,#REG_GR(6)) ,gr6 - lddi @(gr28,#REG_GR(8)) ,gr8 - lddi @(gr28,#REG_GR(10)),gr10 - lddi @(gr28,#REG_GR(12)),gr12 - lddi @(gr28,#REG_GR(14)),gr14 - lddi @(gr28,#REG_GR(16)),gr16 - lddi @(gr28,#REG_GR(18)),gr18 - lddi @(gr28,#REG_GR(20)),gr20 - lddi @(gr28,#REG_GR(22)),gr22 - lddi @(gr28,#REG_GR(24)),gr24 - lddi @(gr28,#REG_GR(26)),gr26 - ldi @(gr28,#REG_GR(29)),gr29 - lddi @(gr28,#REG_GR(30)),gr30 - - # check to see if a debugging return is required - LEDS 0x67f0 - movsg ccr,gr2 - ldi @(gr28,#REG__STATUS),gr3 - andicc gr3,#REG__STATUS_STEP,gr0,icc0 - bne icc0,#0,__entry_return_singlestep - movgs gr2,ccr - - ldi @(gr28,#REG_SP) ,sp - lddi @(gr28,#REG_GR(2)) ,gr2 - ldi @(gr28,#REG_GR(28)),gr28 - - LEDS 0x67fe -// movsg pcsr,gr31 -// LEDS32 - -#if 0 - # store the current frame in the workram on the FR451 - movgs gr28,scr2 - sethi.p %hi(0xfe800000),gr28 - setlo %lo(0xfe800000),gr28 - - stdi gr2,@(gr28,#REG_GR(2)) - stdi gr4,@(gr28,#REG_GR(4)) - stdi gr6,@(gr28,#REG_GR(6)) - stdi gr8,@(gr28,#REG_GR(8)) - stdi gr10,@(gr28,#REG_GR(10)) - stdi gr12,@(gr28,#REG_GR(12)) - stdi gr14,@(gr28,#REG_GR(14)) - stdi gr16,@(gr28,#REG_GR(16)) - stdi gr18,@(gr28,#REG_GR(18)) - stdi gr24,@(gr28,#REG_GR(24)) - stdi gr26,@(gr28,#REG_GR(26)) - sti gr29,@(gr28,#REG_GR(29)) - stdi gr30,@(gr28,#REG_GR(30)) - - movsg tbr ,gr30 - sti gr30,@(gr28,#REG_TBR) - movsg pcsr,gr30 - sti gr30,@(gr28,#REG_PC) - movsg psr ,gr30 - sti gr30,@(gr28,#REG_PSR) - movsg isr ,gr30 - sti gr30,@(gr28,#REG_ISR) - movsg ccr ,gr30 - movsg cccr,gr31 - stdi gr30,@(gr28,#REG_CCR) - movsg lr ,gr30 - movsg lcr ,gr31 - stdi gr30,@(gr28,#REG_LR) - sti gr0 ,@(gr28,#REG_SYSCALLNO) - movsg scr2,gr28 -#endif - - rett #0 - - # return via break.S -__entry_return_singlestep: - movgs gr2,ccr - lddi @(gr28,#REG_GR(2)) ,gr2 - ldi @(gr28,#REG_SP) ,sp - ldi @(gr28,#REG_GR(28)),gr28 - LEDS 0x67ff - break - .globl __entry_return_singlestep_breaks_here -__entry_return_singlestep_breaks_here: - nop - - -############################################################################### -# -# return to a process interrupted in kernel space -# - we need to consider preemption if that is enabled -# -############################################################################### - .balign L1_CACHE_BYTES -__entry_return_from_kernel_exception: - LEDS 0x6302 - movsg psr,gr23 - ori gr23,#PSR_PIL_14,gr23 - movgs gr23,psr - bra __entry_return_direct - - .balign L1_CACHE_BYTES -__entry_return_from_kernel_interrupt: - LEDS 0x6303 - movsg psr,gr23 - ori gr23,#PSR_PIL_14,gr23 - movgs gr23,psr - -#ifdef CONFIG_PREEMPT - ldi @(gr15,#TI_PRE_COUNT),gr5 - subicc gr5,#0,gr0,icc0 - beq icc0,#0,__entry_return_direct - - subcc gr0,gr0,gr0,icc2 /* set Z and clear C */ - call preempt_schedule_irq -#endif - bra __entry_return_direct - - -############################################################################### -# -# perform work that needs to be done immediately before resumption -# -############################################################################### - .globl __entry_return_from_user_exception - .balign L1_CACHE_BYTES -__entry_return_from_user_exception: - LEDS 0x6501 - -__entry_resume_userspace: - # make sure we don't miss an interrupt setting need_resched or sigpending between - # sampling and the RETT - movsg psr,gr23 - ori gr23,#PSR_PIL_14,gr23 - movgs gr23,psr - -__entry_return_from_user_interrupt: - LEDS 0x6402 - ldi @(gr15,#TI_FLAGS),gr4 - andicc gr4,#_TIF_WORK_MASK,gr0,icc0 - beq icc0,#1,__entry_return_direct - -__entry_work_pending: - LEDS 0x6404 - andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0 - beq icc0,#1,__entry_work_notifysig - -__entry_work_resched: - LEDS 0x6408 - movsg psr,gr23 - andi gr23,#~PSR_PIL,gr23 - movgs gr23,psr - call schedule - movsg psr,gr23 - ori gr23,#PSR_PIL_14,gr23 - movgs gr23,psr - - LEDS 0x6401 - ldi @(gr15,#TI_FLAGS),gr4 - andicc gr4,#_TIF_WORK_MASK,gr0,icc0 - beq icc0,#1,__entry_return_direct - andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0 - bne icc0,#1,__entry_work_resched - -__entry_work_notifysig: - LEDS 0x6410 - ori.p gr4,#0,gr8 - call do_notify_resume - bra __entry_resume_userspace - - # perform syscall entry tracing -__syscall_trace_entry: - LEDS 0x6320 - call syscall_trace_entry - - lddi.p @(gr28,#REG_GR(8)) ,gr8 - ori gr8,#0,gr7 ; syscall_trace_entry() returned new syscallno - lddi @(gr28,#REG_GR(10)),gr10 - lddi.p @(gr28,#REG_GR(12)),gr12 - - subicc gr7,#nr_syscalls,gr0,icc0 - bnc icc0,#0,__syscall_badsys - bra __syscall_call - - # perform syscall exit tracing -__syscall_exit_work: - LEDS 0x6340 - andicc gr22,#PSR_PS,gr0,icc1 ; don't handle on return to kernel mode - andicc.p gr4,#_TIF_SYSCALL_TRACE,gr0,icc0 - bne icc1,#0,__entry_return_direct - beq icc0,#1,__entry_work_pending - - movsg psr,gr23 - andi gr23,#~PSR_PIL,gr23 ; could let syscall_trace_exit() call schedule() - movgs gr23,psr - - call syscall_trace_exit - bra __entry_resume_userspace - -__syscall_badsys: - LEDS 0x6380 - setlos #-ENOSYS,gr8 - sti gr8,@(gr28,#REG_GR(8)) ; save return value - bra __entry_resume_userspace - - -############################################################################### -# -# syscall vector table -# -############################################################################### - .section .rodata -ALIGN - .globl sys_call_table -sys_call_table: - .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ - .long sys_exit - .long sys_fork - .long sys_read - .long sys_write - .long sys_open /* 5 */ - .long sys_close - .long sys_waitpid - .long sys_creat - .long sys_link - .long sys_unlink /* 10 */ - .long sys_execve - .long sys_chdir - .long sys_time - .long sys_mknod - .long sys_chmod /* 15 */ - .long sys_lchown16 - .long sys_ni_syscall /* old break syscall holder */ - .long sys_stat - .long sys_lseek - .long sys_getpid /* 20 */ - .long sys_mount - .long sys_oldumount - .long sys_setuid16 - .long sys_getuid16 - .long sys_ni_syscall // sys_stime /* 25 */ - .long sys_ptrace - .long sys_alarm - .long sys_fstat - .long sys_pause - .long sys_utime /* 30 */ - .long sys_ni_syscall /* old stty syscall holder */ - .long sys_ni_syscall /* old gtty syscall holder */ - .long sys_access - .long sys_nice - .long sys_ni_syscall /* 35 */ /* old ftime syscall holder */ - .long sys_sync - .long sys_kill - .long sys_rename - .long sys_mkdir - .long sys_rmdir /* 40 */ - .long sys_dup - .long sys_pipe - .long sys_times - .long sys_ni_syscall /* old prof syscall holder */ - .long sys_brk /* 45 */ - .long sys_setgid16 - .long sys_getgid16 - .long sys_ni_syscall // sys_signal - .long sys_geteuid16 - .long sys_getegid16 /* 50 */ - .long sys_acct - .long sys_umount /* recycled never used phys( */ - .long sys_ni_syscall /* old lock syscall holder */ - .long sys_ioctl - .long sys_fcntl /* 55 */ - .long sys_ni_syscall /* old mpx syscall holder */ - .long sys_setpgid - .long sys_ni_syscall /* old ulimit syscall holder */ - .long sys_ni_syscall /* old old uname syscall */ - .long sys_umask /* 60 */ - .long sys_chroot - .long sys_ustat - .long sys_dup2 - .long sys_getppid - .long sys_getpgrp /* 65 */ - .long sys_setsid - .long sys_sigaction - .long sys_ni_syscall // sys_sgetmask - .long sys_ni_syscall // sys_ssetmask - .long sys_setreuid16 /* 70 */ - .long sys_setregid16 - .long sys_sigsuspend - .long sys_ni_syscall // sys_sigpending - .long sys_sethostname - .long sys_setrlimit /* 75 */ - .long sys_ni_syscall // sys_old_getrlimit - .long sys_getrusage - .long sys_gettimeofday - .long sys_settimeofday - .long sys_getgroups16 /* 80 */ - .long sys_setgroups16 - .long sys_ni_syscall /* old_select slot */ - .long sys_symlink - .long sys_lstat - .long sys_readlink /* 85 */ - .long sys_uselib - .long sys_swapon - .long sys_reboot - .long sys_ni_syscall // old_readdir - .long sys_ni_syscall /* 90 */ /* old_mmap slot */ - .long sys_munmap - .long sys_truncate - .long sys_ftruncate - .long sys_fchmod - .long sys_fchown16 /* 95 */ - .long sys_getpriority - .long sys_setpriority - .long sys_ni_syscall /* old profil syscall holder */ - .long sys_statfs - .long sys_fstatfs /* 100 */ - .long sys_ni_syscall /* ioperm for i386 */ - .long sys_socketcall - .long sys_syslog - .long sys_setitimer - .long sys_getitimer /* 105 */ - .long sys_newstat - .long sys_newlstat - .long sys_newfstat - .long sys_ni_syscall /* obsolete olduname( syscall */ - .long sys_ni_syscall /* iopl for i386 */ /* 110 */ - .long sys_vhangup - .long sys_ni_syscall /* obsolete idle( syscall */ - .long sys_ni_syscall /* vm86old for i386 */ - .long sys_wait4 - .long sys_swapoff /* 115 */ - .long sys_sysinfo - .long sys_ipc - .long sys_fsync - .long sys_sigreturn - .long sys_clone /* 120 */ - .long sys_setdomainname - .long sys_newuname - .long sys_ni_syscall /* old "cacheflush" */ - .long sys_adjtimex - .long sys_mprotect /* 125 */ - .long sys_sigprocmask - .long sys_ni_syscall /* old "create_module" */ - .long sys_init_module - .long sys_delete_module - .long sys_ni_syscall /* old "get_kernel_syms" */ - .long sys_quotactl - .long sys_getpgid - .long sys_fchdir - .long sys_bdflush - .long sys_sysfs /* 135 */ - .long sys_personality - .long sys_ni_syscall /* for afs_syscall */ - .long sys_setfsuid16 - .long sys_setfsgid16 - .long sys_llseek /* 140 */ - .long sys_getdents - .long sys_select - .long sys_flock - .long sys_msync - .long sys_readv /* 145 */ - .long sys_writev - .long sys_getsid - .long sys_fdatasync - .long sys_sysctl - .long sys_mlock /* 150 */ - .long sys_munlock - .long sys_mlockall - .long sys_munlockall - .long sys_sched_setparam - .long sys_sched_getparam /* 155 */ - .long sys_sched_setscheduler - .long sys_sched_getscheduler - .long sys_sched_yield - .long sys_sched_get_priority_max - .long sys_sched_get_priority_min /* 160 */ - .long sys_sched_rr_get_interval - .long sys_nanosleep - .long sys_mremap - .long sys_setresuid16 - .long sys_getresuid16 /* 165 */ - .long sys_ni_syscall /* for vm86 */ - .long sys_ni_syscall /* Old sys_query_module */ - .long sys_poll - .long sys_ni_syscall /* Old nfsservctl */ - .long sys_setresgid16 /* 170 */ - .long sys_getresgid16 - .long sys_prctl - .long sys_rt_sigreturn - .long sys_rt_sigaction - .long sys_rt_sigprocmask /* 175 */ - .long sys_rt_sigpending - .long sys_rt_sigtimedwait - .long sys_rt_sigqueueinfo - .long sys_rt_sigsuspend - .long sys_pread64 /* 180 */ - .long sys_pwrite64 - .long sys_chown16 - .long sys_getcwd - .long sys_capget - .long sys_capset /* 185 */ - .long sys_sigaltstack - .long sys_sendfile - .long sys_ni_syscall /* streams1 */ - .long sys_ni_syscall /* streams2 */ - .long sys_vfork /* 190 */ - .long sys_getrlimit - .long sys_mmap2 - .long sys_truncate64 - .long sys_ftruncate64 - .long sys_stat64 /* 195 */ - .long sys_lstat64 - .long sys_fstat64 - .long sys_lchown - .long sys_getuid - .long sys_getgid /* 200 */ - .long sys_geteuid - .long sys_getegid - .long sys_setreuid - .long sys_setregid - .long sys_getgroups /* 205 */ - .long sys_setgroups - .long sys_fchown - .long sys_setresuid - .long sys_getresuid - .long sys_setresgid /* 210 */ - .long sys_getresgid - .long sys_chown - .long sys_setuid - .long sys_setgid - .long sys_setfsuid /* 215 */ - .long sys_setfsgid - .long sys_pivot_root - .long sys_mincore - .long sys_madvise - .long sys_getdents64 /* 220 */ - .long sys_fcntl64 - .long sys_ni_syscall /* reserved for TUX */ - .long sys_ni_syscall /* Reserved for Security */ - .long sys_gettid - .long sys_readahead /* 225 */ - .long sys_setxattr - .long sys_lsetxattr - .long sys_fsetxattr - .long sys_getxattr - .long sys_lgetxattr /* 230 */ - .long sys_fgetxattr - .long sys_listxattr - .long sys_llistxattr - .long sys_flistxattr - .long sys_removexattr /* 235 */ - .long sys_lremovexattr - .long sys_fremovexattr - .long sys_tkill - .long sys_sendfile64 - .long sys_futex /* 240 */ - .long sys_sched_setaffinity - .long sys_sched_getaffinity - .long sys_ni_syscall //sys_set_thread_area - .long sys_ni_syscall //sys_get_thread_area - .long sys_io_setup /* 245 */ - .long sys_io_destroy - .long sys_io_getevents - .long sys_io_submit - .long sys_io_cancel - .long sys_fadvise64 /* 250 */ - .long sys_ni_syscall - .long sys_exit_group - .long sys_lookup_dcookie - .long sys_epoll_create - .long sys_epoll_ctl /* 255 */ - .long sys_epoll_wait - .long sys_remap_file_pages - .long sys_set_tid_address - .long sys_timer_create - .long sys_timer_settime /* 260 */ - .long sys_timer_gettime - .long sys_timer_getoverrun - .long sys_timer_delete - .long sys_clock_settime - .long sys_clock_gettime /* 265 */ - .long sys_clock_getres - .long sys_clock_nanosleep - .long sys_statfs64 - .long sys_fstatfs64 - .long sys_tgkill /* 270 */ - .long sys_utimes - .long sys_fadvise64_64 - .long sys_ni_syscall /* sys_vserver */ - .long sys_mbind - .long sys_get_mempolicy - .long sys_set_mempolicy - .long sys_mq_open - .long sys_mq_unlink - .long sys_mq_timedsend - .long sys_mq_timedreceive /* 280 */ - .long sys_mq_notify - .long sys_mq_getsetattr - .long sys_ni_syscall /* reserved for kexec */ - .long sys_waitid - .long sys_ni_syscall /* 285 */ /* available */ - .long sys_add_key - .long sys_request_key - .long sys_keyctl - .long sys_ioprio_set - .long sys_ioprio_get /* 290 */ - .long sys_inotify_init - .long sys_inotify_add_watch - .long sys_inotify_rm_watch - .long sys_migrate_pages - .long sys_openat /* 295 */ - .long sys_mkdirat - .long sys_mknodat - .long sys_fchownat - .long sys_futimesat - .long sys_fstatat64 /* 300 */ - .long sys_unlinkat - .long sys_renameat - .long sys_linkat - .long sys_symlinkat - .long sys_readlinkat /* 305 */ - .long sys_fchmodat - .long sys_faccessat - .long sys_pselect6 - .long sys_ppoll - .long sys_unshare /* 310 */ - .long sys_set_robust_list - .long sys_get_robust_list - .long sys_splice - .long sys_sync_file_range - .long sys_tee /* 315 */ - .long sys_vmsplice - .long sys_move_pages - .long sys_getcpu - .long sys_epoll_pwait - .long sys_utimensat /* 320 */ - .long sys_signalfd - .long sys_timerfd_create - .long sys_eventfd - .long sys_fallocate - .long sys_timerfd_settime /* 325 */ - .long sys_timerfd_gettime - .long sys_signalfd4 - .long sys_eventfd2 - .long sys_epoll_create1 - .long sys_dup3 /* 330 */ - .long sys_pipe2 - .long sys_inotify_init1 - .long sys_preadv - .long sys_pwritev - .long sys_rt_tgsigqueueinfo /* 335 */ - .long sys_perf_event_open - .long sys_setns - -syscall_table_size = (. - sys_call_table) diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c deleted file mode 100644 index 6ea430d58149..000000000000 --- a/arch/frv/kernel/frv_ksyms.c +++ /dev/null @@ -1,109 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -extern long __memcpy_user(void *dst, const void *src, size_t count); -extern long __memset_user(void *dst, const void *src, size_t count); - -/* platform dependent support */ - -EXPORT_SYMBOL(__ioremap); -EXPORT_SYMBOL(iounmap); - -EXPORT_SYMBOL(ip_fast_csum); - -#if 0 -EXPORT_SYMBOL(local_irq_count); -EXPORT_SYMBOL(local_bh_count); -#endif - -EXPORT_SYMBOL(__res_bus_clock_speed_HZ); -EXPORT_SYMBOL(__page_offset); -EXPORT_SYMBOL(__memcpy_user); -EXPORT_SYMBOL(__memset_user); -EXPORT_SYMBOL(frv_dcache_writeback); -EXPORT_SYMBOL(frv_cache_invalidate); -EXPORT_SYMBOL(frv_icache_invalidate); -EXPORT_SYMBOL(frv_cache_wback_inv); - -#ifndef CONFIG_MMU -EXPORT_SYMBOL(memory_start); -EXPORT_SYMBOL(memory_end); -#endif - -EXPORT_SYMBOL(__debug_bug_trap); - -/* The following are special because they're not called - explicitly (the C compiler generates them). Fortunately, - their interface isn't gonna change any time soon now, so - it's OK to leave it out of version control. */ -EXPORT_SYMBOL(memcpy); -EXPORT_SYMBOL(memset); - -EXPORT_SYMBOL(__outsl_ns); -EXPORT_SYMBOL(__insl_ns); - -#ifdef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS -EXPORT_SYMBOL(__xchg_32); -EXPORT_SYMBOL(__cmpxchg_32); -#endif -EXPORT_SYMBOL(atomic64_add_return); -EXPORT_SYMBOL(atomic64_sub_return); -EXPORT_SYMBOL(__xchg_64); -EXPORT_SYMBOL(__cmpxchg_64); - -EXPORT_SYMBOL(__debug_bug_printk); -EXPORT_SYMBOL(__delay_loops_MHz); - -/* - * libgcc functions - functions that are used internally by the - * compiler... (prototypes are not correct though, but that - * doesn't really matter since they're not versioned). - */ -extern void __gcc_bcmp(void); -extern void __ashldi3(void); -extern void __ashrdi3(void); -extern void __cmpdi2(void); -extern void __divdi3(void); -extern void __lshrdi3(void); -extern void __moddi3(void); -extern void __muldi3(void); -extern void __mulll(void); -extern void __umulll(void); -extern void __negdi2(void); -extern void __ucmpdi2(void); -extern void __udivdi3(void); -extern void __udivmoddi4(void); -extern void __umoddi3(void); - - /* gcc lib functions */ -//EXPORT_SYMBOL(__gcc_bcmp); -EXPORT_SYMBOL(__ashldi3); -EXPORT_SYMBOL(__ashrdi3); -//EXPORT_SYMBOL(__cmpdi2); -//EXPORT_SYMBOL(__divdi3); -EXPORT_SYMBOL(__lshrdi3); -//EXPORT_SYMBOL(__moddi3); -EXPORT_SYMBOL(__muldi3); -EXPORT_SYMBOL(__mulll); -EXPORT_SYMBOL(__umulll); -EXPORT_SYMBOL(__negdi2); -EXPORT_SYMBOL(__ucmpdi2); -//EXPORT_SYMBOL(__udivdi3); -//EXPORT_SYMBOL(__udivmoddi4); -//EXPORT_SYMBOL(__umoddi3); diff --git a/arch/frv/kernel/futex.c b/arch/frv/kernel/futex.c deleted file mode 100644 index 37f7b2bf7f73..000000000000 --- a/arch/frv/kernel/futex.c +++ /dev/null @@ -1,223 +0,0 @@ -/* futex.c: futex operations - * - * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include - -/* - * the various futex operations; MMU fault checking is ignored under no-MMU - * conditions - */ -static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr, int *_oldval) -{ - int oldval, ret; - - asm("0: \n" - " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ - " ckeq icc3,cc7 \n" - "1: ld.p %M0,%1 \n" /* LD.P/ORCR must be atomic */ - " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ - "2: cst.p %3,%M0 ,cc3,#1 \n" - " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* clear ICC3.Z if store happens */ - " beq icc3,#0,0b \n" - " setlos 0,%2 \n" - "3: \n" - ".subsection 2 \n" - "4: setlos %5,%2 \n" - " bra 3b \n" - ".previous \n" - ".section __ex_table,\"a\" \n" - " .balign 8 \n" - " .long 1b,4b \n" - " .long 2b,4b \n" - ".previous" - : "+U"(*uaddr), "=&r"(oldval), "=&r"(ret), "=r"(oparg) - : "3"(oparg), "i"(-EFAULT) - : "memory", "cc7", "cc3", "icc3" - ); - - *_oldval = oldval; - return ret; -} - -static inline int atomic_futex_op_xchg_add(int oparg, u32 __user *uaddr, int *_oldval) -{ - int oldval, ret; - - asm("0: \n" - " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ - " ckeq icc3,cc7 \n" - "1: ld.p %M0,%1 \n" /* LD.P/ORCR must be atomic */ - " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ - " add %1,%3,%3 \n" - "2: cst.p %3,%M0 ,cc3,#1 \n" - " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* clear ICC3.Z if store happens */ - " beq icc3,#0,0b \n" - " setlos 0,%2 \n" - "3: \n" - ".subsection 2 \n" - "4: setlos %5,%2 \n" - " bra 3b \n" - ".previous \n" - ".section __ex_table,\"a\" \n" - " .balign 8 \n" - " .long 1b,4b \n" - " .long 2b,4b \n" - ".previous" - : "+U"(*uaddr), "=&r"(oldval), "=&r"(ret), "=r"(oparg) - : "3"(oparg), "i"(-EFAULT) - : "memory", "cc7", "cc3", "icc3" - ); - - *_oldval = oldval; - return ret; -} - -static inline int atomic_futex_op_xchg_or(int oparg, u32 __user *uaddr, int *_oldval) -{ - int oldval, ret; - - asm("0: \n" - " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ - " ckeq icc3,cc7 \n" - "1: ld.p %M0,%1 \n" /* LD.P/ORCR must be atomic */ - " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ - " or %1,%3,%3 \n" - "2: cst.p %3,%M0 ,cc3,#1 \n" - " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* clear ICC3.Z if store happens */ - " beq icc3,#0,0b \n" - " setlos 0,%2 \n" - "3: \n" - ".subsection 2 \n" - "4: setlos %5,%2 \n" - " bra 3b \n" - ".previous \n" - ".section __ex_table,\"a\" \n" - " .balign 8 \n" - " .long 1b,4b \n" - " .long 2b,4b \n" - ".previous" - : "+U"(*uaddr), "=&r"(oldval), "=&r"(ret), "=r"(oparg) - : "3"(oparg), "i"(-EFAULT) - : "memory", "cc7", "cc3", "icc3" - ); - - *_oldval = oldval; - return ret; -} - -static inline int atomic_futex_op_xchg_and(int oparg, u32 __user *uaddr, int *_oldval) -{ - int oldval, ret; - - asm("0: \n" - " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ - " ckeq icc3,cc7 \n" - "1: ld.p %M0,%1 \n" /* LD.P/ORCR must be atomic */ - " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ - " and %1,%3,%3 \n" - "2: cst.p %3,%M0 ,cc3,#1 \n" - " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* clear ICC3.Z if store happens */ - " beq icc3,#0,0b \n" - " setlos 0,%2 \n" - "3: \n" - ".subsection 2 \n" - "4: setlos %5,%2 \n" - " bra 3b \n" - ".previous \n" - ".section __ex_table,\"a\" \n" - " .balign 8 \n" - " .long 1b,4b \n" - " .long 2b,4b \n" - ".previous" - : "+U"(*uaddr), "=&r"(oldval), "=&r"(ret), "=r"(oparg) - : "3"(oparg), "i"(-EFAULT) - : "memory", "cc7", "cc3", "icc3" - ); - - *_oldval = oldval; - return ret; -} - -static inline int atomic_futex_op_xchg_xor(int oparg, u32 __user *uaddr, int *_oldval) -{ - int oldval, ret; - - asm("0: \n" - " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ - " ckeq icc3,cc7 \n" - "1: ld.p %M0,%1 \n" /* LD.P/ORCR must be atomic */ - " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ - " xor %1,%3,%3 \n" - "2: cst.p %3,%M0 ,cc3,#1 \n" - " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* clear ICC3.Z if store happens */ - " beq icc3,#0,0b \n" - " setlos 0,%2 \n" - "3: \n" - ".subsection 2 \n" - "4: setlos %5,%2 \n" - " bra 3b \n" - ".previous \n" - ".section __ex_table,\"a\" \n" - " .balign 8 \n" - " .long 1b,4b \n" - " .long 2b,4b \n" - ".previous" - : "+U"(*uaddr), "=&r"(oldval), "=&r"(ret), "=r"(oparg) - : "3"(oparg), "i"(-EFAULT) - : "memory", "cc7", "cc3", "icc3" - ); - - *_oldval = oldval; - return ret; -} - -/*****************************************************************************/ -/* - * do the futex operations - */ -int arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr) -{ - int oldval = 0, ret; - - pagefault_disable(); - - switch (op) { - case FUTEX_OP_SET: - ret = atomic_futex_op_xchg_set(oparg, uaddr, &oldval); - break; - case FUTEX_OP_ADD: - ret = atomic_futex_op_xchg_add(oparg, uaddr, &oldval); - break; - case FUTEX_OP_OR: - ret = atomic_futex_op_xchg_or(oparg, uaddr, &oldval); - break; - case FUTEX_OP_ANDN: - ret = atomic_futex_op_xchg_and(~oparg, uaddr, &oldval); - break; - case FUTEX_OP_XOR: - ret = atomic_futex_op_xchg_xor(oparg, uaddr, &oldval); - break; - default: - ret = -ENOSYS; - break; - } - - pagefault_enable(); - - if (!ret) - *oval = oldval; - - return ret; - -} /* end arch_futex_atomic_op_inuser() */ diff --git a/arch/frv/kernel/gdb-io.c b/arch/frv/kernel/gdb-io.c deleted file mode 100644 index 0707d35079ba..000000000000 --- a/arch/frv/kernel/gdb-io.c +++ /dev/null @@ -1,215 +0,0 @@ -/* gdb-io.c: FR403 GDB stub I/O - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include "gdb-io.h" - -#ifdef CONFIG_GDBSTUB_UART0 -#define __UART(X) (*(volatile uint8_t *)(UART0_BASE + (UART_##X))) -#define __UART_IRR_NMI 0xff0f0000 -#else /* CONFIG_GDBSTUB_UART1 */ -#define __UART(X) (*(volatile uint8_t *)(UART1_BASE + (UART_##X))) -#define __UART_IRR_NMI 0xfff00000 -#endif - -#define LSR_WAIT_FOR(STATE) \ -do { \ - gdbstub_do_rx(); \ -} while (!(__UART(LSR) & UART_LSR_##STATE)) - -#define FLOWCTL_QUERY(LINE) ({ __UART(MSR) & UART_MSR_##LINE; }) -#define FLOWCTL_CLEAR(LINE) do { __UART(MCR) &= ~UART_MCR_##LINE; mb(); } while (0) -#define FLOWCTL_SET(LINE) do { __UART(MCR) |= UART_MCR_##LINE; mb(); } while (0) - -#define FLOWCTL_WAIT_FOR(LINE) \ -do { \ - gdbstub_do_rx(); \ -} while(!FLOWCTL_QUERY(LINE)) - -/*****************************************************************************/ -/* - * initialise the GDB stub - * - called with PSR.ET==0, so can't incur external interrupts - */ -void gdbstub_io_init(void) -{ - /* set up the serial port */ - __UART(LCR) = UART_LCR_WLEN8; /* 1N8 */ - __UART(FCR) = - UART_FCR_ENABLE_FIFO | - UART_FCR_CLEAR_RCVR | - UART_FCR_CLEAR_XMIT | - UART_FCR_TRIGGER_1; - - FLOWCTL_CLEAR(DTR); - FLOWCTL_SET(RTS); - -// gdbstub_set_baud(115200); - - /* we want to get serial receive interrupts */ - __UART(IER) = UART_IER_RDI | UART_IER_RLSI; - mb(); - - __set_IRR(6, __UART_IRR_NMI); /* map ERRs and UARTx to NMI */ - -} /* end gdbstub_io_init() */ - -/*****************************************************************************/ -/* - * set up the GDB stub serial port baud rate timers - */ -void gdbstub_set_baud(unsigned baud) -{ - unsigned value, high, low; - u8 lcr; - - /* work out the divisor to give us the nearest higher baud rate */ - value = __serial_clock_speed_HZ / 16 / baud; - - /* determine the baud rate range */ - high = __serial_clock_speed_HZ / 16 / value; - low = __serial_clock_speed_HZ / 16 / (value + 1); - - /* pick the nearest bound */ - if (low + (high - low) / 2 > baud) - value++; - - lcr = __UART(LCR); - __UART(LCR) |= UART_LCR_DLAB; - mb(); - __UART(DLL) = value & 0xff; - __UART(DLM) = (value >> 8) & 0xff; - mb(); - __UART(LCR) = lcr; - mb(); - -} /* end gdbstub_set_baud() */ - -/*****************************************************************************/ -/* - * receive characters into the receive FIFO - */ -void gdbstub_do_rx(void) -{ - unsigned ix, nix; - - ix = gdbstub_rx_inp; - - while (__UART(LSR) & UART_LSR_DR) { - nix = (ix + 2) & 0xfff; - if (nix == gdbstub_rx_outp) - break; - - gdbstub_rx_buffer[ix++] = __UART(LSR); - gdbstub_rx_buffer[ix++] = __UART(RX); - ix = nix; - } - - gdbstub_rx_inp = ix; - - __clr_RC(15); - __clr_IRL(); - -} /* end gdbstub_do_rx() */ - -/*****************************************************************************/ -/* - * wait for a character to come from the debugger - */ -int gdbstub_rx_char(unsigned char *_ch, int nonblock) -{ - unsigned ix; - u8 ch, st; - - *_ch = 0xff; - - if (gdbstub_rx_unget) { - *_ch = gdbstub_rx_unget; - gdbstub_rx_unget = 0; - return 0; - } - - try_again: - gdbstub_do_rx(); - - /* pull chars out of the buffer */ - ix = gdbstub_rx_outp; - if (ix == gdbstub_rx_inp) { - if (nonblock) - return -EAGAIN; - //watchdog_alert_counter = 0; - goto try_again; - } - - st = gdbstub_rx_buffer[ix++]; - ch = gdbstub_rx_buffer[ix++]; - gdbstub_rx_outp = ix & 0x00000fff; - - if (st & UART_LSR_BI) { - gdbstub_proto("### GDB Rx Break Detected ###\n"); - return -EINTR; - } - else if (st & (UART_LSR_FE|UART_LSR_OE|UART_LSR_PE)) { - gdbstub_io("### GDB Rx Error (st=%02x) ###\n",st); - return -EIO; - } - else { - gdbstub_io("### GDB Rx %02x (st=%02x) ###\n",ch,st); - *_ch = ch & 0x7f; - return 0; - } - -} /* end gdbstub_rx_char() */ - -/*****************************************************************************/ -/* - * send a character to the debugger - */ -void gdbstub_tx_char(unsigned char ch) -{ - FLOWCTL_SET(DTR); - LSR_WAIT_FOR(THRE); -// FLOWCTL_WAIT_FOR(CTS); - - if (ch == 0x0a) { - __UART(TX) = 0x0d; - mb(); - LSR_WAIT_FOR(THRE); -// FLOWCTL_WAIT_FOR(CTS); - } - __UART(TX) = ch; - mb(); - - FLOWCTL_CLEAR(DTR); -} /* end gdbstub_tx_char() */ - -/*****************************************************************************/ -/* - * send a character to the debugger - */ -void gdbstub_tx_flush(void) -{ - LSR_WAIT_FOR(TEMT); - LSR_WAIT_FOR(THRE); - FLOWCTL_CLEAR(DTR); -} /* end gdbstub_tx_flush() */ diff --git a/arch/frv/kernel/gdb-io.h b/arch/frv/kernel/gdb-io.h deleted file mode 100644 index 138714bacc40..000000000000 --- a/arch/frv/kernel/gdb-io.h +++ /dev/null @@ -1,55 +0,0 @@ -/* gdb-io.h: FR403 GDB I/O port defs - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _GDB_IO_H -#define _GDB_IO_H - -#include - -#undef UART_RX -#undef UART_TX -#undef UART_DLL -#undef UART_DLM -#undef UART_IER -#undef UART_IIR -#undef UART_FCR -#undef UART_LCR -#undef UART_MCR -#undef UART_LSR -#undef UART_MSR -#undef UART_SCR - -#define UART_RX 0*8 /* In: Receive buffer (DLAB=0) */ -#define UART_TX 0*8 /* Out: Transmit buffer (DLAB=0) */ -#define UART_DLL 0*8 /* Out: Divisor Latch Low (DLAB=1) */ -#define UART_DLM 1*8 /* Out: Divisor Latch High (DLAB=1) */ -#define UART_IER 1*8 /* Out: Interrupt Enable Register */ -#define UART_IIR 2*8 /* In: Interrupt ID Register */ -#define UART_FCR 2*8 /* Out: FIFO Control Register */ -#define UART_LCR 3*8 /* Out: Line Control Register */ -#define UART_MCR 4*8 /* Out: Modem Control Register */ -#define UART_LSR 5*8 /* In: Line Status Register */ -#define UART_MSR 6*8 /* In: Modem Status Register */ -#define UART_SCR 7*8 /* I/O: Scratch Register */ - -#define UART_LCR_DLAB 0x80 /* Divisor latch access bit */ -#define UART_LCR_SBC 0x40 /* Set break control */ -#define UART_LCR_SPAR 0x20 /* Stick parity (?) */ -#define UART_LCR_EPAR 0x10 /* Even parity select */ -#define UART_LCR_PARITY 0x08 /* Parity Enable */ -#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */ -#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */ -#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */ -#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */ -#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */ - - -#endif /* _GDB_IO_H */ diff --git a/arch/frv/kernel/gdb-stub.c b/arch/frv/kernel/gdb-stub.c deleted file mode 100644 index bbe78b0bffec..000000000000 --- a/arch/frv/kernel/gdb-stub.c +++ /dev/null @@ -1,2149 +0,0 @@ -/* gdb-stub.c: FRV GDB stub - * - * Copyright (C) 2003,4 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from Linux/MIPS version, Copyright (C) 1995 Andreas Busse - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -/* - * To enable debugger support, two things need to happen. One, a - * call to set_debug_traps() is necessary in order to allow any breakpoints - * or error conditions to be properly intercepted and reported to gdb. - * Two, a breakpoint needs to be generated to begin communication. This - * is most easily accomplished by a call to breakpoint(). Breakpoint() - * simulates a breakpoint by executing a BREAK instruction. - * - * - * The following gdb commands are supported: - * - * command function Return value - * - * g return the value of the CPU registers hex data or ENN - * G set the value of the CPU registers OK or ENN - * - * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN - * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN - * - * c Resume at current address SNN ( signal NN) - * cAA..AA Continue at address AA..AA SNN - * - * s Step one instruction SNN - * sAA..AA Step one instruction from AA..AA SNN - * - * k kill - * - * ? What was the last sigval ? SNN (signal NN) - * - * bBB..BB Set baud rate to BB..BB OK or BNN, then sets - * baud rate - * - * All commands and responses are sent with a packet which includes a - * checksum. A packet consists of - * - * $#. - * - * where - * :: - * :: < two hex digits computed as modulo 256 sum of > - * - * When a packet is received, it is first acknowledged with either '+' or '-'. - * '+' indicates a successful transfer. '-' indicates a failed transfer. - * - * Example: - * - * Host: Reply: - * $m0,10#2a +$00010203040506070809101112131415#42 - * - * - * ============== - * MORE EXAMPLES: - * ============== - * - * For reference -- the following are the steps that one - * company took (RidgeRun Inc) to get remote gdb debugging - * going. In this scenario the host machine was a PC and the - * target platform was a Galileo EVB64120A MIPS evaluation - * board. - * - * Step 1: - * First download gdb-5.0.tar.gz from the internet. - * and then build/install the package. - * - * Example: - * $ tar zxf gdb-5.0.tar.gz - * $ cd gdb-5.0 - * $ ./configure --target=frv-elf-gdb - * $ make - * $ frv-elf-gdb - * - * Step 2: - * Configure linux for remote debugging and build it. - * - * Example: - * $ cd ~/linux - * $ make menuconfig - * $ make vmlinux - * - * Step 3: - * Download the kernel to the remote target and start - * the kernel running. It will promptly halt and wait - * for the host gdb session to connect. It does this - * since the "Kernel Hacking" option has defined - * CONFIG_REMOTE_DEBUG which in turn enables your calls - * to: - * set_debug_traps(); - * breakpoint(); - * - * Step 4: - * Start the gdb session on the host. - * - * Example: - * $ frv-elf-gdb vmlinux - * (gdb) set remotebaud 115200 - * (gdb) target remote /dev/ttyS1 - * ...at this point you are connected to - * the remote target and can use gdb - * in the normal fasion. Setting - * breakpoints, single stepping, - * printing variables, etc. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define LEDS(x) do { /* *(u32*)0xe1200004 = ~(x); mb(); */ } while(0) - -#undef GDBSTUB_DEBUG_PROTOCOL - -extern void debug_to_serial(const char *p, int n); -extern void gdbstub_console_write(struct console *co, const char *p, unsigned n); - -extern volatile uint32_t __break_error_detect[3]; /* ESFR1, ESR15, EAR15 */ - -struct __debug_amr { - unsigned long L, P; -} __attribute__((aligned(8))); - -struct __debug_mmu { - struct { - unsigned long hsr0, pcsr, esr0, ear0, epcr0; -#ifdef CONFIG_MMU - unsigned long tplr, tppr, tpxr, cxnr; -#endif - } regs; - - struct __debug_amr iamr[16]; - struct __debug_amr damr[16]; - -#ifdef CONFIG_MMU - struct __debug_amr tlb[64*2]; -#endif -}; - -static struct __debug_mmu __debug_mmu; - -/* - * BUFMAX defines the maximum number of characters in inbound/outbound buffers - * at least NUMREGBYTES*2 are needed for register packets - */ -#define BUFMAX 2048 - -#define BREAK_INSN 0x801000c0 /* use "break" as bkpt */ - -static const char gdbstub_banner[] = "Linux/FR-V GDB Stub (c) RedHat 2003\n"; - -volatile u8 gdbstub_rx_buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); -volatile u32 gdbstub_rx_inp = 0; -volatile u32 gdbstub_rx_outp = 0; -volatile u8 gdbstub_rx_overflow = 0; -u8 gdbstub_rx_unget = 0; - -/* set with GDB whilst running to permit step through exceptions */ -extern volatile u32 __attribute__((section(".bss"))) gdbstub_trace_through_exceptions; - -static char input_buffer[BUFMAX]; -static char output_buffer[BUFMAX]; - -static const char *regnames[] = { - "PSR ", "ISR ", "CCR ", "CCCR", - "LR ", "LCR ", "PC ", "_stt", - "sys ", "GR8*", "GNE0", "GNE1", - "IACH", "IACL", - "TBR ", "SP ", "FP ", "GR3 ", - "GR4 ", "GR5 ", "GR6 ", "GR7 ", - "GR8 ", "GR9 ", "GR10", "GR11", - "GR12", "GR13", "GR14", "GR15", - "GR16", "GR17", "GR18", "GR19", - "GR20", "GR21", "GR22", "GR23", - "GR24", "GR25", "GR26", "GR27", - "EFRM", "CURR", "GR30", "BFRM" -}; - -struct gdbstub_bkpt { - unsigned long addr; /* address of breakpoint */ - unsigned len; /* size of breakpoint */ - uint32_t originsns[7]; /* original instructions */ -}; - -static struct gdbstub_bkpt gdbstub_bkpts[256]; - -/* - * local prototypes - */ - -static void gdbstub_recv_packet(char *buffer); -static int gdbstub_send_packet(char *buffer); -static int gdbstub_compute_signal(unsigned long tbr); -static int hex(unsigned char ch); -static int hexToInt(char **ptr, unsigned long *intValue); -static unsigned char *mem2hex(const void *mem, char *buf, int count, int may_fault); -static char *hex2mem(const char *buf, void *_mem, int count); - -/* - * Convert ch from a hex digit to an int - */ -static int hex(unsigned char ch) -{ - if (ch >= 'a' && ch <= 'f') - return ch-'a'+10; - if (ch >= '0' && ch <= '9') - return ch-'0'; - if (ch >= 'A' && ch <= 'F') - return ch-'A'+10; - return -1; -} - -void gdbstub_printk(const char *fmt, ...) -{ - static char buf[1024]; - va_list args; - int len; - - /* Emit the output into the temporary buffer */ - va_start(args, fmt); - len = vsnprintf(buf, sizeof(buf), fmt, args); - va_end(args); - debug_to_serial(buf, len); -} - -static inline char *gdbstub_strcpy(char *dst, const char *src) -{ - int loop = 0; - while ((dst[loop] = src[loop])) - loop++; - return dst; -} - -static void gdbstub_purge_cache(void) -{ - asm volatile(" dcef @(gr0,gr0),#1 \n" - " icei @(gr0,gr0),#1 \n" - " membar \n" - " bar \n" - ); -} - -/*****************************************************************************/ -/* - * scan for the sequence $# - */ -static void gdbstub_recv_packet(char *buffer) -{ - unsigned char checksum; - unsigned char xmitcsum; - unsigned char ch; - int count, i, ret, error; - - for (;;) { - /* wait around for the start character, ignore all other characters */ - do { - gdbstub_rx_char(&ch, 0); - } while (ch != '$'); - - checksum = 0; - xmitcsum = -1; - count = 0; - error = 0; - - /* now, read until a # or end of buffer is found */ - while (count < BUFMAX) { - ret = gdbstub_rx_char(&ch, 0); - if (ret < 0) - error = ret; - - if (ch == '#') - break; - checksum += ch; - buffer[count] = ch; - count++; - } - - if (error == -EIO) { - gdbstub_proto("### GDB Rx Error - Skipping packet ###\n"); - gdbstub_proto("### GDB Tx NAK\n"); - gdbstub_tx_char('-'); - continue; - } - - if (count >= BUFMAX || error) - continue; - - buffer[count] = 0; - - /* read the checksum */ - ret = gdbstub_rx_char(&ch, 0); - if (ret < 0) - error = ret; - xmitcsum = hex(ch) << 4; - - ret = gdbstub_rx_char(&ch, 0); - if (ret < 0) - error = ret; - xmitcsum |= hex(ch); - - if (error) { - if (error == -EIO) - gdbstub_proto("### GDB Rx Error - Skipping packet\n"); - gdbstub_proto("### GDB Tx NAK\n"); - gdbstub_tx_char('-'); - continue; - } - - /* check the checksum */ - if (checksum != xmitcsum) { - gdbstub_proto("### GDB Tx NAK\n"); - gdbstub_tx_char('-'); /* failed checksum */ - continue; - } - - gdbstub_proto("### GDB Rx '$%s#%02x' ###\n", buffer, checksum); - gdbstub_proto("### GDB Tx ACK\n"); - gdbstub_tx_char('+'); /* successful transfer */ - - /* if a sequence char is present, reply the sequence ID */ - if (buffer[2] == ':') { - gdbstub_tx_char(buffer[0]); - gdbstub_tx_char(buffer[1]); - - /* remove sequence chars from buffer */ - count = 0; - while (buffer[count]) count++; - for (i=3; i <= count; i++) - buffer[i - 3] = buffer[i]; - } - - break; - } -} /* end gdbstub_recv_packet() */ - -/*****************************************************************************/ -/* - * send the packet in buffer. - * - return 0 if successfully ACK'd - * - return 1 if abandoned due to new incoming packet - */ -static int gdbstub_send_packet(char *buffer) -{ - unsigned char checksum; - int count; - unsigned char ch; - - /* $# */ - gdbstub_proto("### GDB Tx '%s' ###\n", buffer); - - do { - gdbstub_tx_char('$'); - checksum = 0; - count = 0; - - while ((ch = buffer[count]) != 0) { - gdbstub_tx_char(ch); - checksum += ch; - count += 1; - } - - gdbstub_tx_char('#'); - gdbstub_tx_char(hex_asc_hi(checksum)); - gdbstub_tx_char(hex_asc_lo(checksum)); - - } while (gdbstub_rx_char(&ch,0), -#ifdef GDBSTUB_DEBUG_PROTOCOL - ch=='-' && (gdbstub_proto("### GDB Rx NAK\n"),0), - ch!='-' && ch!='+' && (gdbstub_proto("### GDB Rx ??? %02x\n",ch),0), -#endif - ch!='+' && ch!='$'); - - if (ch=='+') { - gdbstub_proto("### GDB Rx ACK\n"); - return 0; - } - - gdbstub_proto("### GDB Tx Abandoned\n"); - gdbstub_rx_unget = ch; - return 1; -} /* end gdbstub_send_packet() */ - -/* - * While we find nice hex chars, build an int. - * Return number of chars processed. - */ -static int hexToInt(char **ptr, unsigned long *_value) -{ - int count = 0, ch; - - *_value = 0; - while (**ptr) { - ch = hex(**ptr); - if (ch < 0) - break; - - *_value = (*_value << 4) | ((uint8_t) ch & 0xf); - count++; - - (*ptr)++; - } - - return count; -} - -/*****************************************************************************/ -/* - * probe an address to see whether it maps to anything - */ -static inline int gdbstub_addr_probe(const void *vaddr) -{ -#ifdef CONFIG_MMU - unsigned long paddr; - - asm("lrad %1,%0,#1,#0,#0" : "=r"(paddr) : "r"(vaddr)); - if (!(paddr & xAMPRx_V)) - return 0; -#endif - - return 1; -} /* end gdbstub_addr_probe() */ - -#ifdef CONFIG_MMU -static unsigned long __saved_dampr, __saved_damlr; - -static inline unsigned long gdbstub_virt_to_pte(unsigned long vaddr) -{ - pgd_t *pgd; - pud_t *pud; - pmd_t *pmd; - pte_t *pte; - unsigned long val, dampr5; - - pgd = (pgd_t *) __get_DAMLR(3) + pgd_index(vaddr); - pud = pud_offset(pgd, vaddr); - pmd = pmd_offset(pud, vaddr); - - if (pmd_bad(*pmd) || !pmd_present(*pmd)) - return 0; - - /* make sure dampr5 maps to the correct pmd */ - dampr5 = __get_DAMPR(5); - val = pmd_val(*pmd); - __set_DAMPR(5, val | xAMPRx_L | xAMPRx_SS_16Kb | xAMPRx_S | xAMPRx_C | xAMPRx_V); - - /* now its safe to access pmd */ - pte = (pte_t *)__get_DAMLR(5) + __pte_index(vaddr); - if (pte_present(*pte)) - val = pte_val(*pte); - else - val = 0; - - /* restore original dampr5 */ - __set_DAMPR(5, dampr5); - - return val; -} -#endif - -static inline int gdbstub_addr_map(const void *vaddr) -{ -#ifdef CONFIG_MMU - unsigned long pte; - - __saved_dampr = __get_DAMPR(2); - __saved_damlr = __get_DAMLR(2); -#endif - if (gdbstub_addr_probe(vaddr)) - return 1; -#ifdef CONFIG_MMU - pte = gdbstub_virt_to_pte((unsigned long) vaddr); - if (pte) { - __set_DAMPR(2, pte); - __set_DAMLR(2, (unsigned long) vaddr & PAGE_MASK); - return 1; - } -#endif - return 0; -} - -static inline void gdbstub_addr_unmap(void) -{ -#ifdef CONFIG_MMU - __set_DAMPR(2, __saved_dampr); - __set_DAMLR(2, __saved_damlr); -#endif -} - -/* - * access potentially dodgy memory through a potentially dodgy pointer - */ -static inline int gdbstub_read_dword(const void *addr, uint32_t *_res) -{ - unsigned long brr; - uint32_t res; - - if (!gdbstub_addr_map(addr)) - return 0; - - asm volatile(" movgs gr0,brr \n" - " ld%I2 %M2,%0 \n" - " movsg brr,%1 \n" - : "=r"(res), "=r"(brr) - : "m"(*(uint32_t *) addr)); - *_res = res; - gdbstub_addr_unmap(); - return likely(!brr); -} - -static inline int gdbstub_write_dword(void *addr, uint32_t val) -{ - unsigned long brr; - - if (!gdbstub_addr_map(addr)) - return 0; - - asm volatile(" movgs gr0,brr \n" - " st%I2 %1,%M2 \n" - " movsg brr,%0 \n" - : "=r"(brr) - : "r"(val), "m"(*(uint32_t *) addr)); - gdbstub_addr_unmap(); - return likely(!brr); -} - -static inline int gdbstub_read_word(const void *addr, uint16_t *_res) -{ - unsigned long brr; - uint16_t res; - - if (!gdbstub_addr_map(addr)) - return 0; - - asm volatile(" movgs gr0,brr \n" - " lduh%I2 %M2,%0 \n" - " movsg brr,%1 \n" - : "=r"(res), "=r"(brr) - : "m"(*(uint16_t *) addr)); - *_res = res; - gdbstub_addr_unmap(); - return likely(!brr); -} - -static inline int gdbstub_write_word(void *addr, uint16_t val) -{ - unsigned long brr; - - if (!gdbstub_addr_map(addr)) - return 0; - - asm volatile(" movgs gr0,brr \n" - " sth%I2 %1,%M2 \n" - " movsg brr,%0 \n" - : "=r"(brr) - : "r"(val), "m"(*(uint16_t *) addr)); - gdbstub_addr_unmap(); - return likely(!brr); -} - -static inline int gdbstub_read_byte(const void *addr, uint8_t *_res) -{ - unsigned long brr; - uint8_t res; - - if (!gdbstub_addr_map(addr)) - return 0; - - asm volatile(" movgs gr0,brr \n" - " ldub%I2 %M2,%0 \n" - " movsg brr,%1 \n" - : "=r"(res), "=r"(brr) - : "m"(*(uint8_t *) addr)); - *_res = res; - gdbstub_addr_unmap(); - return likely(!brr); -} - -static inline int gdbstub_write_byte(void *addr, uint8_t val) -{ - unsigned long brr; - - if (!gdbstub_addr_map(addr)) - return 0; - - asm volatile(" movgs gr0,brr \n" - " stb%I2 %1,%M2 \n" - " movsg brr,%0 \n" - : "=r"(brr) - : "r"(val), "m"(*(uint8_t *) addr)); - gdbstub_addr_unmap(); - return likely(!brr); -} - -static void __gdbstub_console_write(struct console *co, const char *p, unsigned n) -{ - char outbuf[26]; - int qty; - - outbuf[0] = 'O'; - - while (n > 0) { - qty = 1; - - while (n > 0 && qty < 20) { - mem2hex(p, outbuf + qty, 2, 0); - qty += 2; - if (*p == 0x0a) { - outbuf[qty++] = '0'; - outbuf[qty++] = 'd'; - } - p++; - n--; - } - - outbuf[qty] = 0; - gdbstub_send_packet(outbuf); - } -} - -#if 0 -void debug_to_serial(const char *p, int n) -{ - gdbstub_console_write(NULL,p,n); -} -#endif - -#ifdef CONFIG_GDB_CONSOLE - -static struct console gdbstub_console = { - .name = "gdb", - .write = gdbstub_console_write, /* in break.S */ - .flags = CON_PRINTBUFFER, - .index = -1, -}; - -#endif - -/*****************************************************************************/ -/* - * Convert the memory pointed to by mem into hex, placing result in buf. - * - if successful, return a pointer to the last char put in buf (NUL) - * - in case of mem fault, return NULL - * may_fault is non-zero if we are reading from arbitrary memory, but is currently - * not used. - */ -static unsigned char *mem2hex(const void *_mem, char *buf, int count, int may_fault) -{ - const uint8_t *mem = _mem; - uint8_t ch[4] __attribute__((aligned(4))); - - if ((uint32_t)mem&1 && count>=1) { - if (!gdbstub_read_byte(mem,ch)) - return NULL; - buf = hex_byte_pack(buf, ch[0]); - mem++; - count--; - } - - if ((uint32_t)mem&3 && count>=2) { - if (!gdbstub_read_word(mem,(uint16_t *)ch)) - return NULL; - buf = hex_byte_pack(buf, ch[0]); - buf = hex_byte_pack(buf, ch[1]); - mem += 2; - count -= 2; - } - - while (count>=4) { - if (!gdbstub_read_dword(mem,(uint32_t *)ch)) - return NULL; - buf = hex_byte_pack(buf, ch[0]); - buf = hex_byte_pack(buf, ch[1]); - buf = hex_byte_pack(buf, ch[2]); - buf = hex_byte_pack(buf, ch[3]); - mem += 4; - count -= 4; - } - - if (count>=2) { - if (!gdbstub_read_word(mem,(uint16_t *)ch)) - return NULL; - buf = hex_byte_pack(buf, ch[0]); - buf = hex_byte_pack(buf, ch[1]); - mem += 2; - count -= 2; - } - - if (count>=1) { - if (!gdbstub_read_byte(mem,ch)) - return NULL; - buf = hex_byte_pack(buf, ch[0]); - } - - *buf = 0; - - return buf; -} /* end mem2hex() */ - -/*****************************************************************************/ -/* - * convert the hex array pointed to by buf into binary to be placed in mem - * return a pointer to the character AFTER the last byte of buffer consumed - */ -static char *hex2mem(const char *buf, void *_mem, int count) -{ - uint8_t *mem = _mem; - union { - uint32_t l; - uint16_t w; - uint8_t b[4]; - } ch; - - if ((u32)mem&1 && count>=1) { - ch.b[0] = hex(*buf++) << 4; - ch.b[0] |= hex(*buf++); - if (!gdbstub_write_byte(mem,ch.b[0])) - return NULL; - mem++; - count--; - } - - if ((u32)mem&3 && count>=2) { - ch.b[0] = hex(*buf++) << 4; - ch.b[0] |= hex(*buf++); - ch.b[1] = hex(*buf++) << 4; - ch.b[1] |= hex(*buf++); - if (!gdbstub_write_word(mem,ch.w)) - return NULL; - mem += 2; - count -= 2; - } - - while (count>=4) { - ch.b[0] = hex(*buf++) << 4; - ch.b[0] |= hex(*buf++); - ch.b[1] = hex(*buf++) << 4; - ch.b[1] |= hex(*buf++); - ch.b[2] = hex(*buf++) << 4; - ch.b[2] |= hex(*buf++); - ch.b[3] = hex(*buf++) << 4; - ch.b[3] |= hex(*buf++); - if (!gdbstub_write_dword(mem,ch.l)) - return NULL; - mem += 4; - count -= 4; - } - - if (count>=2) { - ch.b[0] = hex(*buf++) << 4; - ch.b[0] |= hex(*buf++); - ch.b[1] = hex(*buf++) << 4; - ch.b[1] |= hex(*buf++); - if (!gdbstub_write_word(mem,ch.w)) - return NULL; - mem += 2; - count -= 2; - } - - if (count>=1) { - ch.b[0] = hex(*buf++) << 4; - ch.b[0] |= hex(*buf++); - if (!gdbstub_write_byte(mem,ch.b[0])) - return NULL; - } - - return (char *) buf; -} /* end hex2mem() */ - -/*****************************************************************************/ -/* - * This table contains the mapping between FRV TBR.TT exception codes, - * and signals, which are primarily what GDB understands. It also - * indicates which hardware traps we need to commandeer when - * initializing the stub. - */ -static const struct brr_to_sig_map { - unsigned long brr_mask; /* BRR bitmask */ - unsigned long tbr_tt; /* TBR.TT code (in BRR.EBTT) */ - unsigned int signo; /* Signal that we map this into */ -} brr_to_sig_map[] = { - { BRR_EB, TBR_TT_INSTR_ACC_ERROR, SIGSEGV }, - { BRR_EB, TBR_TT_ILLEGAL_INSTR, SIGILL }, - { BRR_EB, TBR_TT_PRIV_INSTR, SIGILL }, - { BRR_EB, TBR_TT_MP_EXCEPTION, SIGFPE }, - { BRR_EB, TBR_TT_DATA_ACC_ERROR, SIGSEGV }, - { BRR_EB, TBR_TT_DATA_STR_ERROR, SIGSEGV }, - { BRR_EB, TBR_TT_DIVISION_EXCEP, SIGFPE }, - { BRR_EB, TBR_TT_COMPOUND_EXCEP, SIGSEGV }, - { BRR_EB, TBR_TT_INTERRUPT_13, SIGALRM }, /* watchdog */ - { BRR_EB, TBR_TT_INTERRUPT_14, SIGINT }, /* GDB serial */ - { BRR_EB, TBR_TT_INTERRUPT_15, SIGQUIT }, /* NMI */ - { BRR_CB, 0, SIGUSR1 }, - { BRR_TB, 0, SIGUSR2 }, - { BRR_DBNEx, 0, SIGTRAP }, - { BRR_DBx, 0, SIGTRAP }, /* h/w watchpoint */ - { BRR_IBx, 0, SIGTRAP }, /* h/w breakpoint */ - { BRR_CBB, 0, SIGTRAP }, - { BRR_SB, 0, SIGTRAP }, - { BRR_ST, 0, SIGTRAP }, /* single step */ - { 0, 0, SIGHUP } /* default */ -}; - -/*****************************************************************************/ -/* - * convert the FRV BRR register contents into a UNIX signal number - */ -static inline int gdbstub_compute_signal(unsigned long brr) -{ - const struct brr_to_sig_map *map; - unsigned long tbr = (brr & BRR_EBTT) >> 12; - - for (map = brr_to_sig_map; map->brr_mask; map++) - if (map->brr_mask & brr) - if (!map->tbr_tt || map->tbr_tt == tbr) - break; - - return map->signo; -} /* end gdbstub_compute_signal() */ - -/*****************************************************************************/ -/* - * set a software breakpoint or a hardware breakpoint or watchpoint - */ -static int gdbstub_set_breakpoint(unsigned long type, unsigned long addr, unsigned long len) -{ - unsigned long tmp; - int bkpt, loop, xloop; - - union { - struct { - unsigned long mask0, mask1; - }; - uint8_t bytes[8]; - } dbmr; - - //gdbstub_printk("setbkpt(%ld,%08lx,%ld)\n", type, addr, len); - - switch (type) { - /* set software breakpoint */ - case 0: - if (addr & 3 || len > 7*4) - return -EINVAL; - - for (bkpt = 255; bkpt >= 0; bkpt--) - if (!gdbstub_bkpts[bkpt].addr) - break; - if (bkpt < 0) - return -ENOSPC; - - for (loop = 0; loop < len/4; loop++) - if (!gdbstub_read_dword(&((uint32_t *) addr)[loop], - &gdbstub_bkpts[bkpt].originsns[loop])) - return -EFAULT; - - for (loop = 0; loop < len/4; loop++) - if (!gdbstub_write_dword(&((uint32_t *) addr)[loop], - BREAK_INSN) - ) { - /* need to undo the changes if possible */ - for (xloop = 0; xloop < loop; xloop++) - gdbstub_write_dword(&((uint32_t *) addr)[xloop], - gdbstub_bkpts[bkpt].originsns[xloop]); - return -EFAULT; - } - - gdbstub_bkpts[bkpt].addr = addr; - gdbstub_bkpts[bkpt].len = len; - -#if 0 - gdbstub_printk("Set BKPT[%02x]: %08lx #%d {%04x, %04x} -> { %04x, %04x }\n", - bkpt, - gdbstub_bkpts[bkpt].addr, - gdbstub_bkpts[bkpt].len, - gdbstub_bkpts[bkpt].originsns[0], - gdbstub_bkpts[bkpt].originsns[1], - ((uint32_t *) addr)[0], - ((uint32_t *) addr)[1] - ); -#endif - return 0; - - /* set hardware breakpoint */ - case 1: - if (addr & 3 || len != 4) - return -EINVAL; - - if (!(__debug_regs->dcr & DCR_IBE0)) { - //gdbstub_printk("set h/w break 0: %08lx\n", addr); - __debug_regs->dcr |= DCR_IBE0; - __debug_regs->ibar[0] = addr; - asm volatile("movgs %0,ibar0" : : "r"(addr)); - return 0; - } - - if (!(__debug_regs->dcr & DCR_IBE1)) { - //gdbstub_printk("set h/w break 1: %08lx\n", addr); - __debug_regs->dcr |= DCR_IBE1; - __debug_regs->ibar[1] = addr; - asm volatile("movgs %0,ibar1" : : "r"(addr)); - return 0; - } - - if (!(__debug_regs->dcr & DCR_IBE2)) { - //gdbstub_printk("set h/w break 2: %08lx\n", addr); - __debug_regs->dcr |= DCR_IBE2; - __debug_regs->ibar[2] = addr; - asm volatile("movgs %0,ibar2" : : "r"(addr)); - return 0; - } - - if (!(__debug_regs->dcr & DCR_IBE3)) { - //gdbstub_printk("set h/w break 3: %08lx\n", addr); - __debug_regs->dcr |= DCR_IBE3; - __debug_regs->ibar[3] = addr; - asm volatile("movgs %0,ibar3" : : "r"(addr)); - return 0; - } - - return -ENOSPC; - - /* set data read/write/access watchpoint */ - case 2: - case 3: - case 4: - if ((addr & ~7) != ((addr + len - 1) & ~7)) - return -EINVAL; - - tmp = addr & 7; - - memset(dbmr.bytes, 0xff, sizeof(dbmr.bytes)); - for (loop = 0; loop < len; loop++) - dbmr.bytes[tmp + loop] = 0; - - addr &= ~7; - - if (!(__debug_regs->dcr & (DCR_DRBE0|DCR_DWBE0))) { - //gdbstub_printk("set h/w watchpoint 0 type %ld: %08lx\n", type, addr); - tmp = type==2 ? DCR_DWBE0 : type==3 ? DCR_DRBE0 : DCR_DRBE0|DCR_DWBE0; - - __debug_regs->dcr |= tmp; - __debug_regs->dbar[0] = addr; - __debug_regs->dbmr[0][0] = dbmr.mask0; - __debug_regs->dbmr[0][1] = dbmr.mask1; - __debug_regs->dbdr[0][0] = 0; - __debug_regs->dbdr[0][1] = 0; - - asm volatile(" movgs %0,dbar0 \n" - " movgs %1,dbmr00 \n" - " movgs %2,dbmr01 \n" - " movgs gr0,dbdr00 \n" - " movgs gr0,dbdr01 \n" - : : "r"(addr), "r"(dbmr.mask0), "r"(dbmr.mask1)); - return 0; - } - - if (!(__debug_regs->dcr & (DCR_DRBE1|DCR_DWBE1))) { - //gdbstub_printk("set h/w watchpoint 1 type %ld: %08lx\n", type, addr); - tmp = type==2 ? DCR_DWBE1 : type==3 ? DCR_DRBE1 : DCR_DRBE1|DCR_DWBE1; - - __debug_regs->dcr |= tmp; - __debug_regs->dbar[1] = addr; - __debug_regs->dbmr[1][0] = dbmr.mask0; - __debug_regs->dbmr[1][1] = dbmr.mask1; - __debug_regs->dbdr[1][0] = 0; - __debug_regs->dbdr[1][1] = 0; - - asm volatile(" movgs %0,dbar1 \n" - " movgs %1,dbmr10 \n" - " movgs %2,dbmr11 \n" - " movgs gr0,dbdr10 \n" - " movgs gr0,dbdr11 \n" - : : "r"(addr), "r"(dbmr.mask0), "r"(dbmr.mask1)); - return 0; - } - - return -ENOSPC; - - default: - return -EINVAL; - } - -} /* end gdbstub_set_breakpoint() */ - -/*****************************************************************************/ -/* - * clear a breakpoint or watchpoint - */ -int gdbstub_clear_breakpoint(unsigned long type, unsigned long addr, unsigned long len) -{ - unsigned long tmp; - int bkpt, loop; - - union { - struct { - unsigned long mask0, mask1; - }; - uint8_t bytes[8]; - } dbmr; - - //gdbstub_printk("clearbkpt(%ld,%08lx,%ld)\n", type, addr, len); - - switch (type) { - /* clear software breakpoint */ - case 0: - for (bkpt = 255; bkpt >= 0; bkpt--) - if (gdbstub_bkpts[bkpt].addr == addr && gdbstub_bkpts[bkpt].len == len) - break; - if (bkpt < 0) - return -ENOENT; - - gdbstub_bkpts[bkpt].addr = 0; - - for (loop = 0; loop < len/4; loop++) - if (!gdbstub_write_dword(&((uint32_t *) addr)[loop], - gdbstub_bkpts[bkpt].originsns[loop])) - return -EFAULT; - return 0; - - /* clear hardware breakpoint */ - case 1: - if (addr & 3 || len != 4) - return -EINVAL; - -#define __get_ibar(X) ({ unsigned long x; asm volatile("movsg ibar"#X",%0" : "=r"(x)); x; }) - - if (__debug_regs->dcr & DCR_IBE0 && __get_ibar(0) == addr) { - //gdbstub_printk("clear h/w break 0: %08lx\n", addr); - __debug_regs->dcr &= ~DCR_IBE0; - __debug_regs->ibar[0] = 0; - asm volatile("movgs gr0,ibar0"); - return 0; - } - - if (__debug_regs->dcr & DCR_IBE1 && __get_ibar(1) == addr) { - //gdbstub_printk("clear h/w break 1: %08lx\n", addr); - __debug_regs->dcr &= ~DCR_IBE1; - __debug_regs->ibar[1] = 0; - asm volatile("movgs gr0,ibar1"); - return 0; - } - - if (__debug_regs->dcr & DCR_IBE2 && __get_ibar(2) == addr) { - //gdbstub_printk("clear h/w break 2: %08lx\n", addr); - __debug_regs->dcr &= ~DCR_IBE2; - __debug_regs->ibar[2] = 0; - asm volatile("movgs gr0,ibar2"); - return 0; - } - - if (__debug_regs->dcr & DCR_IBE3 && __get_ibar(3) == addr) { - //gdbstub_printk("clear h/w break 3: %08lx\n", addr); - __debug_regs->dcr &= ~DCR_IBE3; - __debug_regs->ibar[3] = 0; - asm volatile("movgs gr0,ibar3"); - return 0; - } - - return -EINVAL; - - /* clear data read/write/access watchpoint */ - case 2: - case 3: - case 4: - if ((addr & ~7) != ((addr + len - 1) & ~7)) - return -EINVAL; - - tmp = addr & 7; - - memset(dbmr.bytes, 0xff, sizeof(dbmr.bytes)); - for (loop = 0; loop < len; loop++) - dbmr.bytes[tmp + loop] = 0; - - addr &= ~7; - -#define __get_dbar(X) ({ unsigned long x; asm volatile("movsg dbar"#X",%0" : "=r"(x)); x; }) -#define __get_dbmr0(X) ({ unsigned long x; asm volatile("movsg dbmr"#X"0,%0" : "=r"(x)); x; }) -#define __get_dbmr1(X) ({ unsigned long x; asm volatile("movsg dbmr"#X"1,%0" : "=r"(x)); x; }) - - /* consider DBAR 0 */ - tmp = type==2 ? DCR_DWBE0 : type==3 ? DCR_DRBE0 : DCR_DRBE0|DCR_DWBE0; - - if ((__debug_regs->dcr & (DCR_DRBE0|DCR_DWBE0)) != tmp || - __get_dbar(0) != addr || - __get_dbmr0(0) != dbmr.mask0 || - __get_dbmr1(0) != dbmr.mask1) - goto skip_dbar0; - - //gdbstub_printk("clear h/w watchpoint 0 type %ld: %08lx\n", type, addr); - __debug_regs->dcr &= ~(DCR_DRBE0|DCR_DWBE0); - __debug_regs->dbar[0] = 0; - __debug_regs->dbmr[0][0] = 0; - __debug_regs->dbmr[0][1] = 0; - __debug_regs->dbdr[0][0] = 0; - __debug_regs->dbdr[0][1] = 0; - - asm volatile(" movgs gr0,dbar0 \n" - " movgs gr0,dbmr00 \n" - " movgs gr0,dbmr01 \n" - " movgs gr0,dbdr00 \n" - " movgs gr0,dbdr01 \n"); - return 0; - - skip_dbar0: - /* consider DBAR 0 */ - tmp = type==2 ? DCR_DWBE1 : type==3 ? DCR_DRBE1 : DCR_DRBE1|DCR_DWBE1; - - if ((__debug_regs->dcr & (DCR_DRBE1|DCR_DWBE1)) != tmp || - __get_dbar(1) != addr || - __get_dbmr0(1) != dbmr.mask0 || - __get_dbmr1(1) != dbmr.mask1) - goto skip_dbar1; - - //gdbstub_printk("clear h/w watchpoint 1 type %ld: %08lx\n", type, addr); - __debug_regs->dcr &= ~(DCR_DRBE1|DCR_DWBE1); - __debug_regs->dbar[1] = 0; - __debug_regs->dbmr[1][0] = 0; - __debug_regs->dbmr[1][1] = 0; - __debug_regs->dbdr[1][0] = 0; - __debug_regs->dbdr[1][1] = 0; - - asm volatile(" movgs gr0,dbar1 \n" - " movgs gr0,dbmr10 \n" - " movgs gr0,dbmr11 \n" - " movgs gr0,dbdr10 \n" - " movgs gr0,dbdr11 \n"); - return 0; - - skip_dbar1: - return -ENOSPC; - - default: - return -EINVAL; - } -} /* end gdbstub_clear_breakpoint() */ - -/*****************************************************************************/ -/* - * check a for an internal software breakpoint, and wind the PC back if necessary - */ -static void gdbstub_check_breakpoint(void) -{ - unsigned long addr = __debug_frame->pc - 4; - int bkpt; - - for (bkpt = 255; bkpt >= 0; bkpt--) - if (gdbstub_bkpts[bkpt].addr == addr) - break; - if (bkpt >= 0) - __debug_frame->pc = addr; - - //gdbstub_printk("alter pc [%d] %08lx\n", bkpt, __debug_frame->pc); - -} /* end gdbstub_check_breakpoint() */ - -/*****************************************************************************/ -/* - * - */ -static void __maybe_unused gdbstub_show_regs(void) -{ - unsigned long *reg; - int loop; - - gdbstub_printk("\n"); - - gdbstub_printk("Frame: @%p [%s]\n", - __debug_frame, - __debug_frame->psr & PSR_S ? "kernel" : "user"); - - reg = (unsigned long *) __debug_frame; - for (loop = 0; loop < NR_PT_REGS; loop++) { - printk("%s %08lx", regnames[loop + 0], reg[loop + 0]); - - if (loop == NR_PT_REGS - 1 || loop % 5 == 4) - printk("\n"); - else - printk(" | "); - } - - gdbstub_printk("Process %s (pid: %d)\n", current->comm, current->pid); -} /* end gdbstub_show_regs() */ - -/*****************************************************************************/ -/* - * dump debugging regs - */ -static void __maybe_unused gdbstub_dump_debugregs(void) -{ - gdbstub_printk("DCR %08lx ", __debug_status.dcr); - gdbstub_printk("BRR %08lx\n", __debug_status.brr); - - gdbstub_printk("IBAR0 %08lx ", __get_ibar(0)); - gdbstub_printk("IBAR1 %08lx ", __get_ibar(1)); - gdbstub_printk("IBAR2 %08lx ", __get_ibar(2)); - gdbstub_printk("IBAR3 %08lx\n", __get_ibar(3)); - - gdbstub_printk("DBAR0 %08lx ", __get_dbar(0)); - gdbstub_printk("DBMR00 %08lx ", __get_dbmr0(0)); - gdbstub_printk("DBMR01 %08lx\n", __get_dbmr1(0)); - - gdbstub_printk("DBAR1 %08lx ", __get_dbar(1)); - gdbstub_printk("DBMR10 %08lx ", __get_dbmr0(1)); - gdbstub_printk("DBMR11 %08lx\n", __get_dbmr1(1)); - - gdbstub_printk("\n"); -} /* end gdbstub_dump_debugregs() */ - -/*****************************************************************************/ -/* - * dump the MMU state into a structure so that it can be accessed with GDB - */ -void gdbstub_get_mmu_state(void) -{ - asm volatile("movsg hsr0,%0" : "=r"(__debug_mmu.regs.hsr0)); - asm volatile("movsg pcsr,%0" : "=r"(__debug_mmu.regs.pcsr)); - asm volatile("movsg esr0,%0" : "=r"(__debug_mmu.regs.esr0)); - asm volatile("movsg ear0,%0" : "=r"(__debug_mmu.regs.ear0)); - asm volatile("movsg epcr0,%0" : "=r"(__debug_mmu.regs.epcr0)); - - /* read the protection / SAT registers */ - __debug_mmu.iamr[0].L = __get_IAMLR(0); - __debug_mmu.iamr[0].P = __get_IAMPR(0); - __debug_mmu.iamr[1].L = __get_IAMLR(1); - __debug_mmu.iamr[1].P = __get_IAMPR(1); - __debug_mmu.iamr[2].L = __get_IAMLR(2); - __debug_mmu.iamr[2].P = __get_IAMPR(2); - __debug_mmu.iamr[3].L = __get_IAMLR(3); - __debug_mmu.iamr[3].P = __get_IAMPR(3); - __debug_mmu.iamr[4].L = __get_IAMLR(4); - __debug_mmu.iamr[4].P = __get_IAMPR(4); - __debug_mmu.iamr[5].L = __get_IAMLR(5); - __debug_mmu.iamr[5].P = __get_IAMPR(5); - __debug_mmu.iamr[6].L = __get_IAMLR(6); - __debug_mmu.iamr[6].P = __get_IAMPR(6); - __debug_mmu.iamr[7].L = __get_IAMLR(7); - __debug_mmu.iamr[7].P = __get_IAMPR(7); - __debug_mmu.iamr[8].L = __get_IAMLR(8); - __debug_mmu.iamr[8].P = __get_IAMPR(8); - __debug_mmu.iamr[9].L = __get_IAMLR(9); - __debug_mmu.iamr[9].P = __get_IAMPR(9); - __debug_mmu.iamr[10].L = __get_IAMLR(10); - __debug_mmu.iamr[10].P = __get_IAMPR(10); - __debug_mmu.iamr[11].L = __get_IAMLR(11); - __debug_mmu.iamr[11].P = __get_IAMPR(11); - __debug_mmu.iamr[12].L = __get_IAMLR(12); - __debug_mmu.iamr[12].P = __get_IAMPR(12); - __debug_mmu.iamr[13].L = __get_IAMLR(13); - __debug_mmu.iamr[13].P = __get_IAMPR(13); - __debug_mmu.iamr[14].L = __get_IAMLR(14); - __debug_mmu.iamr[14].P = __get_IAMPR(14); - __debug_mmu.iamr[15].L = __get_IAMLR(15); - __debug_mmu.iamr[15].P = __get_IAMPR(15); - - __debug_mmu.damr[0].L = __get_DAMLR(0); - __debug_mmu.damr[0].P = __get_DAMPR(0); - __debug_mmu.damr[1].L = __get_DAMLR(1); - __debug_mmu.damr[1].P = __get_DAMPR(1); - __debug_mmu.damr[2].L = __get_DAMLR(2); - __debug_mmu.damr[2].P = __get_DAMPR(2); - __debug_mmu.damr[3].L = __get_DAMLR(3); - __debug_mmu.damr[3].P = __get_DAMPR(3); - __debug_mmu.damr[4].L = __get_DAMLR(4); - __debug_mmu.damr[4].P = __get_DAMPR(4); - __debug_mmu.damr[5].L = __get_DAMLR(5); - __debug_mmu.damr[5].P = __get_DAMPR(5); - __debug_mmu.damr[6].L = __get_DAMLR(6); - __debug_mmu.damr[6].P = __get_DAMPR(6); - __debug_mmu.damr[7].L = __get_DAMLR(7); - __debug_mmu.damr[7].P = __get_DAMPR(7); - __debug_mmu.damr[8].L = __get_DAMLR(8); - __debug_mmu.damr[8].P = __get_DAMPR(8); - __debug_mmu.damr[9].L = __get_DAMLR(9); - __debug_mmu.damr[9].P = __get_DAMPR(9); - __debug_mmu.damr[10].L = __get_DAMLR(10); - __debug_mmu.damr[10].P = __get_DAMPR(10); - __debug_mmu.damr[11].L = __get_DAMLR(11); - __debug_mmu.damr[11].P = __get_DAMPR(11); - __debug_mmu.damr[12].L = __get_DAMLR(12); - __debug_mmu.damr[12].P = __get_DAMPR(12); - __debug_mmu.damr[13].L = __get_DAMLR(13); - __debug_mmu.damr[13].P = __get_DAMPR(13); - __debug_mmu.damr[14].L = __get_DAMLR(14); - __debug_mmu.damr[14].P = __get_DAMPR(14); - __debug_mmu.damr[15].L = __get_DAMLR(15); - __debug_mmu.damr[15].P = __get_DAMPR(15); - -#ifdef CONFIG_MMU - do { - /* read the DAT entries from the TLB */ - struct __debug_amr *p; - int loop; - - asm volatile("movsg tplr,%0" : "=r"(__debug_mmu.regs.tplr)); - asm volatile("movsg tppr,%0" : "=r"(__debug_mmu.regs.tppr)); - asm volatile("movsg tpxr,%0" : "=r"(__debug_mmu.regs.tpxr)); - asm volatile("movsg cxnr,%0" : "=r"(__debug_mmu.regs.cxnr)); - - p = __debug_mmu.tlb; - - /* way 0 */ - asm volatile("movgs %0,tpxr" :: "r"(0 << TPXR_WAY_SHIFT)); - for (loop = 0; loop < 64; loop++) { - asm volatile("tlbpr %0,gr0,#1,#0" :: "r"(loop << PAGE_SHIFT)); - asm volatile("movsg tplr,%0" : "=r"(p->L)); - asm volatile("movsg tppr,%0" : "=r"(p->P)); - p++; - } - - /* way 1 */ - asm volatile("movgs %0,tpxr" :: "r"(1 << TPXR_WAY_SHIFT)); - for (loop = 0; loop < 64; loop++) { - asm volatile("tlbpr %0,gr0,#1,#0" :: "r"(loop << PAGE_SHIFT)); - asm volatile("movsg tplr,%0" : "=r"(p->L)); - asm volatile("movsg tppr,%0" : "=r"(p->P)); - p++; - } - - asm volatile("movgs %0,tplr" :: "r"(__debug_mmu.regs.tplr)); - asm volatile("movgs %0,tppr" :: "r"(__debug_mmu.regs.tppr)); - asm volatile("movgs %0,tpxr" :: "r"(__debug_mmu.regs.tpxr)); - } while(0); -#endif - -} /* end gdbstub_get_mmu_state() */ - -/* - * handle general query commands of the form 'qXXXXX' - */ -static void gdbstub_handle_query(void) -{ - if (strcmp(input_buffer, "qAttached") == 0) { - /* return current thread ID */ - sprintf(output_buffer, "1"); - return; - } - - if (strcmp(input_buffer, "qC") == 0) { - /* return current thread ID */ - sprintf(output_buffer, "QC 0"); - return; - } - - if (strcmp(input_buffer, "qOffsets") == 0) { - /* return relocation offset of text and data segments */ - sprintf(output_buffer, "Text=0;Data=0;Bss=0"); - return; - } - - if (strcmp(input_buffer, "qSymbol::") == 0) { - sprintf(output_buffer, "OK"); - return; - } - - if (strcmp(input_buffer, "qSupported") == 0) { - /* query of supported features */ - sprintf(output_buffer, "PacketSize=%u;ReverseContinue-;ReverseStep-", - sizeof(input_buffer)); - return; - } - - gdbstub_strcpy(output_buffer,"E01"); -} - -/*****************************************************************************/ -/* - * handle event interception and GDB remote protocol processing - * - on entry: - * PSR.ET==0, PSR.S==1 and the CPU is in debug mode - * __debug_frame points to the saved registers - * __frame points to the kernel mode exception frame, if it was in kernel - * mode when the break happened - */ -void gdbstub(int sigval) -{ - unsigned long addr, length, loop, dbar, temp, temp2, temp3; - uint32_t zero; - char *ptr; - int flush_cache = 0; - - LEDS(0x5000); - - if (sigval < 0) { -#ifndef CONFIG_GDBSTUB_IMMEDIATE - /* return immediately if GDB immediate activation option not set */ - return; -#else - sigval = SIGINT; -#endif - } - - save_user_regs(&__debug_frame0->uc); - -#if 0 - gdbstub_printk("--> gdbstub() %08x %p %08x %08x\n", - __debug_frame->pc, - __debug_frame, - __debug_regs->brr, - __debug_regs->bpsr); -// gdbstub_show_regs(); -#endif - - LEDS(0x5001); - - /* if we were interrupted by input on the serial gdbstub serial port, - * restore the context prior to the interrupt so that we return to that - * directly - */ - temp = (unsigned long) __entry_kerneltrap_table; - temp2 = (unsigned long) __entry_usertrap_table; - temp3 = __debug_frame->pc & ~15; - - if (temp3 == temp + TBR_TT_INTERRUPT_15 || - temp3 == temp2 + TBR_TT_INTERRUPT_15 - ) { - asm volatile("movsg pcsr,%0" : "=r"(__debug_frame->pc)); - __debug_frame->psr |= PSR_ET; - __debug_frame->psr &= ~PSR_S; - if (__debug_frame->psr & PSR_PS) - __debug_frame->psr |= PSR_S; - __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12; - __debug_status.brr |= BRR_EB; - sigval = SIGINT; - } - - /* handle the decrement timer going off (FR451 only) */ - if (temp3 == temp + TBR_TT_DECREMENT_TIMER || - temp3 == temp2 + TBR_TT_DECREMENT_TIMER - ) { - asm volatile("movgs %0,timerd" :: "r"(10000000)); - asm volatile("movsg pcsr,%0" : "=r"(__debug_frame->pc)); - __debug_frame->psr |= PSR_ET; - __debug_frame->psr &= ~PSR_S; - if (__debug_frame->psr & PSR_PS) - __debug_frame->psr |= PSR_S; - __debug_status.brr = (__debug_frame->tbr & TBR_TT) << 12; - __debug_status.brr |= BRR_EB; - sigval = SIGXCPU; - } - - LEDS(0x5002); - - /* after a BREAK insn, the PC lands on the far side of it */ - if (__debug_status.brr & BRR_SB) - gdbstub_check_breakpoint(); - - LEDS(0x5003); - - /* handle attempts to write console data via GDB "O" commands */ - if (__debug_frame->pc == (unsigned long) gdbstub_console_write + 4) { - __gdbstub_console_write((struct console *) __debug_frame->gr8, - (const char *) __debug_frame->gr9, - (unsigned) __debug_frame->gr10); - goto done; - } - - if (gdbstub_rx_unget) { - sigval = SIGINT; - goto packet_waiting; - } - - if (!sigval) - sigval = gdbstub_compute_signal(__debug_status.brr); - - LEDS(0x5004); - - /* send a message to the debugger's user saying what happened if it may - * not be clear cut (we can't map exceptions onto signals properly) - */ - if (sigval != SIGINT && sigval != SIGTRAP && sigval != SIGILL) { - static const char title[] = "Break "; - static const char crlf[] = "\r\n"; - unsigned long brr = __debug_status.brr; - char hx; - - ptr = output_buffer; - *ptr++ = 'O'; - ptr = mem2hex(title, ptr, sizeof(title) - 1,0); - - hx = hex_asc_hi(brr >> 24); - ptr = hex_byte_pack(ptr, hx); - hx = hex_asc_lo(brr >> 24); - ptr = hex_byte_pack(ptr, hx); - hx = hex_asc_hi(brr >> 16); - ptr = hex_byte_pack(ptr, hx); - hx = hex_asc_lo(brr >> 16); - ptr = hex_byte_pack(ptr, hx); - hx = hex_asc_hi(brr >> 8); - ptr = hex_byte_pack(ptr, hx); - hx = hex_asc_lo(brr >> 8); - ptr = hex_byte_pack(ptr, hx); - hx = hex_asc_hi(brr); - ptr = hex_byte_pack(ptr, hx); - hx = hex_asc_lo(brr); - ptr = hex_byte_pack(ptr, hx); - - ptr = mem2hex(crlf, ptr, sizeof(crlf) - 1, 0); - *ptr = 0; - gdbstub_send_packet(output_buffer); /* send it off... */ - } - - LEDS(0x5005); - - /* tell the debugger that an exception has occurred */ - ptr = output_buffer; - - /* Send trap type (converted to signal) */ - *ptr++ = 'T'; - ptr = hex_byte_pack(ptr, sigval); - - /* Send Error PC */ - ptr = hex_byte_pack(ptr, GDB_REG_PC); - *ptr++ = ':'; - ptr = mem2hex(&__debug_frame->pc, ptr, 4, 0); - *ptr++ = ';'; - - /* - * Send frame pointer - */ - ptr = hex_byte_pack(ptr, GDB_REG_FP); - *ptr++ = ':'; - ptr = mem2hex(&__debug_frame->fp, ptr, 4, 0); - *ptr++ = ';'; - - /* - * Send stack pointer - */ - ptr = hex_byte_pack(ptr, GDB_REG_SP); - *ptr++ = ':'; - ptr = mem2hex(&__debug_frame->sp, ptr, 4, 0); - *ptr++ = ';'; - - *ptr++ = 0; - gdbstub_send_packet(output_buffer); /* send it off... */ - - LEDS(0x5006); - - packet_waiting: - gdbstub_get_mmu_state(); - - /* wait for input from remote GDB */ - while (1) { - output_buffer[0] = 0; - - LEDS(0x5007); - gdbstub_recv_packet(input_buffer); - LEDS(0x5600 | input_buffer[0]); - - switch (input_buffer[0]) { - /* request repeat of last signal number */ - case '?': - output_buffer[0] = 'S'; - output_buffer[1] = hex_asc_hi(sigval); - output_buffer[2] = hex_asc_lo(sigval); - output_buffer[3] = 0; - break; - - case 'd': - /* toggle debug flag */ - break; - - /* return the value of the CPU registers - * - GR0, GR1, GR2, GR3, GR4, GR5, GR6, GR7, - * - GR8, GR9, GR10, GR11, GR12, GR13, GR14, GR15, - * - GR16, GR17, GR18, GR19, GR20, GR21, GR22, GR23, - * - GR24, GR25, GR26, GR27, GR28, GR29, GR30, GR31, - * - GR32, GR33, GR34, GR35, GR36, GR37, GR38, GR39, - * - GR40, GR41, GR42, GR43, GR44, GR45, GR46, GR47, - * - GR48, GR49, GR50, GR51, GR52, GR53, GR54, GR55, - * - GR56, GR57, GR58, GR59, GR60, GR61, GR62, GR63, - * - FP0, FP1, FP2, FP3, FP4, FP5, FP6, FP7, - * - FP8, FP9, FP10, FP11, FP12, FP13, FP14, FP15, - * - FP16, FP17, FP18, FP19, FP20, FP21, FP22, FP23, - * - FP24, FP25, FP26, FP27, FP28, FP29, FP30, FP31, - * - FP32, FP33, FP34, FP35, FP36, FP37, FP38, FP39, - * - FP40, FP41, FP42, FP43, FP44, FP45, FP46, FP47, - * - FP48, FP49, FP50, FP51, FP52, FP53, FP54, FP55, - * - FP56, FP57, FP58, FP59, FP60, FP61, FP62, FP63, - * - PC, PSR, CCR, CCCR, - * - _X132, _X133, _X134 - * - TBR, BRR, DBAR0, DBAR1, DBAR2, DBAR3, - * - _X141, _X142, _X143, _X144, - * - LR, LCR - */ - case 'g': - zero = 0; - ptr = output_buffer; - - /* deal with GR0, GR1-GR27, GR28-GR31, GR32-GR63 */ - ptr = mem2hex(&zero, ptr, 4, 0); - - for (loop = 1; loop <= 27; loop++) - ptr = mem2hex(&__debug_user_context->i.gr[loop], ptr, 4, 0); - temp = (unsigned long) __frame; - ptr = mem2hex(&temp, ptr, 4, 0); - ptr = mem2hex(&__debug_user_context->i.gr[29], ptr, 4, 0); - ptr = mem2hex(&__debug_user_context->i.gr[30], ptr, 4, 0); -#ifdef CONFIG_MMU - ptr = mem2hex(&__debug_user_context->i.gr[31], ptr, 4, 0); -#else - temp = (unsigned long) __debug_frame; - ptr = mem2hex(&temp, ptr, 4, 0); -#endif - - for (loop = 32; loop <= 63; loop++) - ptr = mem2hex(&__debug_user_context->i.gr[loop], ptr, 4, 0); - - /* deal with FR0-FR63 */ - for (loop = 0; loop <= 63; loop++) - ptr = mem2hex(&__debug_user_context->f.fr[loop], ptr, 4, 0); - - /* deal with special registers */ - ptr = mem2hex(&__debug_frame->pc, ptr, 4, 0); - ptr = mem2hex(&__debug_frame->psr, ptr, 4, 0); - ptr = mem2hex(&__debug_frame->ccr, ptr, 4, 0); - ptr = mem2hex(&__debug_frame->cccr, ptr, 4, 0); - ptr = mem2hex(&zero, ptr, 4, 0); - ptr = mem2hex(&zero, ptr, 4, 0); - ptr = mem2hex(&zero, ptr, 4, 0); - ptr = mem2hex(&__debug_frame->tbr, ptr, 4, 0); - ptr = mem2hex(&__debug_status.brr , ptr, 4, 0); - - asm volatile("movsg dbar0,%0" : "=r"(dbar)); - ptr = mem2hex(&dbar, ptr, 4, 0); - asm volatile("movsg dbar1,%0" : "=r"(dbar)); - ptr = mem2hex(&dbar, ptr, 4, 0); - asm volatile("movsg dbar2,%0" : "=r"(dbar)); - ptr = mem2hex(&dbar, ptr, 4, 0); - asm volatile("movsg dbar3,%0" : "=r"(dbar)); - ptr = mem2hex(&dbar, ptr, 4, 0); - - asm volatile("movsg scr0,%0" : "=r"(dbar)); - ptr = mem2hex(&dbar, ptr, 4, 0); - asm volatile("movsg scr1,%0" : "=r"(dbar)); - ptr = mem2hex(&dbar, ptr, 4, 0); - asm volatile("movsg scr2,%0" : "=r"(dbar)); - ptr = mem2hex(&dbar, ptr, 4, 0); - asm volatile("movsg scr3,%0" : "=r"(dbar)); - ptr = mem2hex(&dbar, ptr, 4, 0); - - ptr = mem2hex(&__debug_frame->lr, ptr, 4, 0); - ptr = mem2hex(&__debug_frame->lcr, ptr, 4, 0); - - ptr = mem2hex(&__debug_frame->iacc0, ptr, 8, 0); - - ptr = mem2hex(&__debug_user_context->f.fsr[0], ptr, 4, 0); - - for (loop = 0; loop <= 7; loop++) - ptr = mem2hex(&__debug_user_context->f.acc[loop], ptr, 4, 0); - - ptr = mem2hex(&__debug_user_context->f.accg, ptr, 8, 0); - - for (loop = 0; loop <= 1; loop++) - ptr = mem2hex(&__debug_user_context->f.msr[loop], ptr, 4, 0); - - ptr = mem2hex(&__debug_frame->gner0, ptr, 4, 0); - ptr = mem2hex(&__debug_frame->gner1, ptr, 4, 0); - - ptr = mem2hex(&__debug_user_context->f.fner[0], ptr, 4, 0); - ptr = mem2hex(&__debug_user_context->f.fner[1], ptr, 4, 0); - - break; - - /* set the values of the CPU registers */ - case 'G': - ptr = &input_buffer[1]; - - /* deal with GR0, GR1-GR27, GR28-GR31, GR32-GR63 */ - ptr = hex2mem(ptr, &temp, 4); - - for (loop = 1; loop <= 27; loop++) - ptr = hex2mem(ptr, &__debug_user_context->i.gr[loop], 4); - - ptr = hex2mem(ptr, &temp, 4); - __frame = (struct pt_regs *) temp; - ptr = hex2mem(ptr, &__debug_frame->gr29, 4); - ptr = hex2mem(ptr, &__debug_frame->gr30, 4); -#ifdef CONFIG_MMU - ptr = hex2mem(ptr, &__debug_frame->gr31, 4); -#else - ptr = hex2mem(ptr, &temp, 4); -#endif - - for (loop = 32; loop <= 63; loop++) - ptr = hex2mem(ptr, &__debug_user_context->i.gr[loop], 4); - - /* deal with FR0-FR63 */ - for (loop = 0; loop <= 63; loop++) - ptr = mem2hex(&__debug_user_context->f.fr[loop], ptr, 4, 0); - - /* deal with special registers */ - ptr = hex2mem(ptr, &__debug_frame->pc, 4); - ptr = hex2mem(ptr, &__debug_frame->psr, 4); - ptr = hex2mem(ptr, &__debug_frame->ccr, 4); - ptr = hex2mem(ptr, &__debug_frame->cccr,4); - - for (loop = 132; loop <= 140; loop++) - ptr = hex2mem(ptr, &temp, 4); - - ptr = hex2mem(ptr, &temp, 4); - asm volatile("movgs %0,scr0" :: "r"(temp)); - ptr = hex2mem(ptr, &temp, 4); - asm volatile("movgs %0,scr1" :: "r"(temp)); - ptr = hex2mem(ptr, &temp, 4); - asm volatile("movgs %0,scr2" :: "r"(temp)); - ptr = hex2mem(ptr, &temp, 4); - asm volatile("movgs %0,scr3" :: "r"(temp)); - - ptr = hex2mem(ptr, &__debug_frame->lr, 4); - ptr = hex2mem(ptr, &__debug_frame->lcr, 4); - - ptr = hex2mem(ptr, &__debug_frame->iacc0, 8); - - ptr = hex2mem(ptr, &__debug_user_context->f.fsr[0], 4); - - for (loop = 0; loop <= 7; loop++) - ptr = hex2mem(ptr, &__debug_user_context->f.acc[loop], 4); - - ptr = hex2mem(ptr, &__debug_user_context->f.accg, 8); - - for (loop = 0; loop <= 1; loop++) - ptr = hex2mem(ptr, &__debug_user_context->f.msr[loop], 4); - - ptr = hex2mem(ptr, &__debug_frame->gner0, 4); - ptr = hex2mem(ptr, &__debug_frame->gner1, 4); - - ptr = hex2mem(ptr, &__debug_user_context->f.fner[0], 4); - ptr = hex2mem(ptr, &__debug_user_context->f.fner[1], 4); - - gdbstub_strcpy(output_buffer,"OK"); - break; - - /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */ - case 'm': - ptr = &input_buffer[1]; - - if (hexToInt(&ptr, &addr) && - *ptr++ == ',' && - hexToInt(&ptr, &length) - ) { - if (mem2hex((char *)addr, output_buffer, length, 1)) - break; - gdbstub_strcpy (output_buffer, "E03"); - } - else { - gdbstub_strcpy(output_buffer,"E01"); - } - break; - - /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ - case 'M': - ptr = &input_buffer[1]; - - if (hexToInt(&ptr, &addr) && - *ptr++ == ',' && - hexToInt(&ptr, &length) && - *ptr++ == ':' - ) { - if (hex2mem(ptr, (char *)addr, length)) { - gdbstub_strcpy(output_buffer, "OK"); - } - else { - gdbstub_strcpy(output_buffer, "E03"); - } - } - else - gdbstub_strcpy(output_buffer, "E02"); - - flush_cache = 1; - break; - - /* pNN: Read value of reg N and return it */ - case 'p': - /* return no value, indicating that we don't support - * this command and that gdb should use 'g' instead */ - break; - - /* PNN,=RRRRRRRR: Write value R to reg N return OK */ - case 'P': - ptr = &input_buffer[1]; - - if (!hexToInt(&ptr, &addr) || - *ptr++ != '=' || - !hexToInt(&ptr, &temp) - ) { - gdbstub_strcpy(output_buffer, "E01"); - break; - } - - temp2 = 1; - switch (addr) { - case GDB_REG_GR(0): - break; - case GDB_REG_GR(1) ... GDB_REG_GR(63): - __debug_user_context->i.gr[addr - GDB_REG_GR(0)] = temp; - break; - case GDB_REG_FR(0) ... GDB_REG_FR(63): - __debug_user_context->f.fr[addr - GDB_REG_FR(0)] = temp; - break; - case GDB_REG_PC: - __debug_user_context->i.pc = temp; - break; - case GDB_REG_PSR: - __debug_user_context->i.psr = temp; - break; - case GDB_REG_CCR: - __debug_user_context->i.ccr = temp; - break; - case GDB_REG_CCCR: - __debug_user_context->i.cccr = temp; - break; - case GDB_REG_BRR: - __debug_status.brr = temp; - break; - case GDB_REG_LR: - __debug_user_context->i.lr = temp; - break; - case GDB_REG_LCR: - __debug_user_context->i.lcr = temp; - break; - case GDB_REG_FSR0: - __debug_user_context->f.fsr[0] = temp; - break; - case GDB_REG_ACC(0) ... GDB_REG_ACC(7): - __debug_user_context->f.acc[addr - GDB_REG_ACC(0)] = temp; - break; - case GDB_REG_ACCG(0): - *(uint32_t *) &__debug_user_context->f.accg[0] = temp; - break; - case GDB_REG_ACCG(4): - *(uint32_t *) &__debug_user_context->f.accg[4] = temp; - break; - case GDB_REG_MSR(0) ... GDB_REG_MSR(1): - __debug_user_context->f.msr[addr - GDB_REG_MSR(0)] = temp; - break; - case GDB_REG_GNER(0) ... GDB_REG_GNER(1): - __debug_user_context->i.gner[addr - GDB_REG_GNER(0)] = temp; - break; - case GDB_REG_FNER(0) ... GDB_REG_FNER(1): - __debug_user_context->f.fner[addr - GDB_REG_FNER(0)] = temp; - break; - default: - temp2 = 0; - break; - } - - if (temp2) { - gdbstub_strcpy(output_buffer, "OK"); - } - else { - gdbstub_strcpy(output_buffer, "E02"); - } - break; - - /* cAA..AA Continue at address AA..AA(optional) */ - case 'c': - /* try to read optional parameter, pc unchanged if no parm */ - ptr = &input_buffer[1]; - if (hexToInt(&ptr, &addr)) - __debug_frame->pc = addr; - goto done; - - /* kill the program */ - case 'k' : - goto done; /* just continue */ - - /* detach */ - case 'D': - gdbstub_strcpy(output_buffer, "OK"); - break; - - /* reset the whole machine (FIXME: system dependent) */ - case 'r': - break; - - - /* step to next instruction */ - case 's': - __debug_regs->dcr |= DCR_SE; - __debug_status.dcr |= DCR_SE; - goto done; - - /* extended command */ - case 'v': - if (strcmp(input_buffer, "vCont?") == 0) { - output_buffer[0] = 0; - break; - } - goto unsupported_cmd; - - /* set baud rate (bBB) */ - case 'b': - ptr = &input_buffer[1]; - if (!hexToInt(&ptr, &temp)) { - gdbstub_strcpy(output_buffer,"B01"); - break; - } - - if (temp) { - /* ack before changing speed */ - gdbstub_send_packet("OK"); - gdbstub_set_baud(temp); - } - break; - - /* set breakpoint */ - case 'Z': - ptr = &input_buffer[1]; - - if (!hexToInt(&ptr,&temp) || *ptr++ != ',' || - !hexToInt(&ptr,&addr) || *ptr++ != ',' || - !hexToInt(&ptr,&length) - ) { - gdbstub_strcpy(output_buffer,"E01"); - break; - } - - if (temp >= 5) { - gdbstub_strcpy(output_buffer,"E03"); - break; - } - - if (gdbstub_set_breakpoint(temp, addr, length) < 0) { - gdbstub_strcpy(output_buffer,"E03"); - break; - } - - if (temp == 0) - flush_cache = 1; /* soft bkpt by modified memory */ - - gdbstub_strcpy(output_buffer,"OK"); - break; - - /* clear breakpoint */ - case 'z': - ptr = &input_buffer[1]; - - if (!hexToInt(&ptr,&temp) || *ptr++ != ',' || - !hexToInt(&ptr,&addr) || *ptr++ != ',' || - !hexToInt(&ptr,&length) - ) { - gdbstub_strcpy(output_buffer,"E01"); - break; - } - - if (temp >= 5) { - gdbstub_strcpy(output_buffer,"E03"); - break; - } - - if (gdbstub_clear_breakpoint(temp, addr, length) < 0) { - gdbstub_strcpy(output_buffer,"E03"); - break; - } - - if (temp == 0) - flush_cache = 1; /* soft bkpt by modified memory */ - - gdbstub_strcpy(output_buffer,"OK"); - break; - - /* Thread-setting packet */ - case 'H': - gdbstub_strcpy(output_buffer, "OK"); - break; - - case 'q': - gdbstub_handle_query(); - break; - - default: - unsupported_cmd: - gdbstub_proto("### GDB Unsupported Cmd '%s'\n",input_buffer); - gdbstub_strcpy(output_buffer,"E01"); - break; - } - - /* reply to the request */ - LEDS(0x5009); - gdbstub_send_packet(output_buffer); - } - - done: - restore_user_regs(&__debug_frame0->uc); - - //gdbstub_dump_debugregs(); - //gdbstub_printk("<-- gdbstub() %08x\n", __debug_frame->pc); - - /* need to flush the instruction cache before resuming, as we may have - * deposited a breakpoint, and the icache probably has no way of - * knowing that a data ref to some location may have changed something - * that is in the instruction cache. NB: We flush both caches, just to - * be sure... - */ - - /* note: flushing the icache will clobber EAR0 on the FR451 */ - if (flush_cache) - gdbstub_purge_cache(); - - LEDS(0x5666); - -} /* end gdbstub() */ - -/*****************************************************************************/ -/* - * initialise the GDB stub - */ -void __init gdbstub_init(void) -{ -#ifdef CONFIG_GDBSTUB_IMMEDIATE - unsigned char ch; - int ret; -#endif - - gdbstub_printk("%s", gdbstub_banner); - - gdbstub_io_init(); - - /* try to talk to GDB (or anyone insane enough to want to type GDB protocol by hand) */ - gdbstub_proto("### GDB Tx ACK\n"); - gdbstub_tx_char('+'); /* 'hello world' */ - -#ifdef CONFIG_GDBSTUB_IMMEDIATE - gdbstub_printk("GDB Stub waiting for packet\n"); - - /* - * In case GDB is started before us, ack any packets - * (presumably "$?#xx") sitting there. - */ - do { gdbstub_rx_char(&ch, 0); } while (ch != '$'); - do { gdbstub_rx_char(&ch, 0); } while (ch != '#'); - do { ret = gdbstub_rx_char(&ch, 0); } while (ret != 0); /* eat first csum byte */ - do { ret = gdbstub_rx_char(&ch, 0); } while (ret != 0); /* eat second csum byte */ - - gdbstub_proto("### GDB Tx NAK\n"); - gdbstub_tx_char('-'); /* nak it */ - -#else - gdbstub_printk("GDB Stub set\n"); -#endif - -#if 0 - /* send banner */ - ptr = output_buffer; - *ptr++ = 'O'; - ptr = mem2hex(gdbstub_banner, ptr, sizeof(gdbstub_banner) - 1, 0); - gdbstub_send_packet(output_buffer); -#endif -#if defined(CONFIG_GDB_CONSOLE) && defined(CONFIG_GDBSTUB_IMMEDIATE) - register_console(&gdbstub_console); -#endif - -} /* end gdbstub_init() */ - -/*****************************************************************************/ -/* - * register the console at a more appropriate time - */ -#if defined (CONFIG_GDB_CONSOLE) && !defined(CONFIG_GDBSTUB_IMMEDIATE) -static int __init gdbstub_postinit(void) -{ - printk("registering console\n"); - register_console(&gdbstub_console); - return 0; -} /* end gdbstub_postinit() */ - -__initcall(gdbstub_postinit); -#endif - -/*****************************************************************************/ -/* - * send an exit message to GDB - */ -void gdbstub_exit(int status) -{ - unsigned char checksum; - int count; - unsigned char ch; - - sprintf(output_buffer,"W%02x",status&0xff); - - gdbstub_tx_char('$'); - checksum = 0; - count = 0; - - while ((ch = output_buffer[count]) != 0) { - gdbstub_tx_char(ch); - checksum += ch; - count += 1; - } - - gdbstub_tx_char('#'); - gdbstub_tx_char(hex_asc_hi(checksum)); - gdbstub_tx_char(hex_asc_lo(checksum)); - - /* make sure the output is flushed, or else RedBoot might clobber it */ - gdbstub_tx_char('-'); - gdbstub_tx_flush(); - -} /* end gdbstub_exit() */ - -/*****************************************************************************/ -/* - * GDB wants to call malloc() and free() to allocate memory for calling kernel - * functions directly from its command line - */ -static void *malloc(size_t size) __maybe_unused; -static void *malloc(size_t size) -{ - return kmalloc(size, GFP_ATOMIC); -} - -static void free(void *p) __maybe_unused; -static void free(void *p) -{ - kfree(p); -} - -static uint32_t ___get_HSR0(void) __maybe_unused; -static uint32_t ___get_HSR0(void) -{ - return __get_HSR(0); -} - -static uint32_t ___set_HSR0(uint32_t x) __maybe_unused; -static uint32_t ___set_HSR0(uint32_t x) -{ - __set_HSR(0, x); - return __get_HSR(0); -} diff --git a/arch/frv/kernel/head-mmu-fr451.S b/arch/frv/kernel/head-mmu-fr451.S deleted file mode 100644 index 98f87d586e59..000000000000 --- a/arch/frv/kernel/head-mmu-fr451.S +++ /dev/null @@ -1,374 +0,0 @@ -/* head-mmu-fr451.S: FR451 mmu-linux specific bits of initialisation - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "head.inc" - - -#define __400_DBR0 0xfe000e00 -#define __400_DBR1 0xfe000e08 -#define __400_DBR2 0xfe000e10 -#define __400_DBR3 0xfe000e18 -#define __400_DAM0 0xfe000f00 -#define __400_DAM1 0xfe000f08 -#define __400_DAM2 0xfe000f10 -#define __400_DAM3 0xfe000f18 -#define __400_LGCR 0xfe000010 -#define __400_LCR 0xfe000100 -#define __400_LSBR 0xfe000c00 - - __INIT - .balign 4 - -############################################################################### -# -# describe the position and layout of the SDRAM controller registers -# -# ENTRY: EXIT: -# GR5 - cacheline size -# GR11 - displacement of 2nd SDRAM addr reg from GR14 -# GR12 - displacement of 3rd SDRAM addr reg from GR14 -# GR13 - displacement of 4th SDRAM addr reg from GR14 -# GR14 - address of 1st SDRAM addr reg -# GR15 - amount to shift address by to match SDRAM addr reg -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# CC0 - T if DBR0 is present -# CC1 - T if DBR1 is present -# CC2 - T if DBR2 is present -# CC3 - T if DBR3 is present -# -############################################################################### - .globl __head_fr451_describe_sdram -__head_fr451_describe_sdram: - sethi.p %hi(__400_DBR0),gr14 - setlo %lo(__400_DBR0),gr14 - setlos.p #__400_DBR1-__400_DBR0,gr11 - setlos #__400_DBR2-__400_DBR0,gr12 - setlos.p #__400_DBR3-__400_DBR0,gr13 - setlos #32,gr5 ; cacheline size - setlos.p #0,gr15 ; amount to shift addr reg by - setlos #0x00ff,gr4 - movgs gr4,cccr ; extant DARS/DAMK regs - bralr - -############################################################################### -# -# rearrange the bus controller registers -# -# ENTRY: EXIT: -# GR26 &__head_reference [saved] -# GR30 LED address revised LED address -# -############################################################################### - .globl __head_fr451_set_busctl -__head_fr451_set_busctl: - sethi.p %hi(__400_LGCR),gr4 - setlo %lo(__400_LGCR),gr4 - sethi.p %hi(__400_LSBR),gr10 - setlo %lo(__400_LSBR),gr10 - sethi.p %hi(__400_LCR),gr11 - setlo %lo(__400_LCR),gr11 - - # set the bus controller - ldi @(gr4,#0),gr5 - ori gr5,#0xff,gr5 ; make sure all chip-selects are enabled - sti gr5,@(gr4,#0) - - sethi.p %hi(__region_CS1),gr4 - setlo %lo(__region_CS1),gr4 - sethi.p %hi(__region_CS1_M),gr5 - setlo %lo(__region_CS1_M),gr5 - sethi.p %hi(__region_CS1_C),gr6 - setlo %lo(__region_CS1_C),gr6 - sti gr4,@(gr10,#1*0x08) - sti gr5,@(gr10,#1*0x08+0x100) - sti gr6,@(gr11,#1*0x08) - sethi.p %hi(__region_CS2),gr4 - setlo %lo(__region_CS2),gr4 - sethi.p %hi(__region_CS2_M),gr5 - setlo %lo(__region_CS2_M),gr5 - sethi.p %hi(__region_CS2_C),gr6 - setlo %lo(__region_CS2_C),gr6 - sti gr4,@(gr10,#2*0x08) - sti gr5,@(gr10,#2*0x08+0x100) - sti gr6,@(gr11,#2*0x08) - sethi.p %hi(__region_CS3),gr4 - setlo %lo(__region_CS3),gr4 - sethi.p %hi(__region_CS3_M),gr5 - setlo %lo(__region_CS3_M),gr5 - sethi.p %hi(__region_CS3_C),gr6 - setlo %lo(__region_CS3_C),gr6 - sti gr4,@(gr10,#3*0x08) - sti gr5,@(gr10,#3*0x08+0x100) - sti gr6,@(gr11,#3*0x08) - sethi.p %hi(__region_CS4),gr4 - setlo %lo(__region_CS4),gr4 - sethi.p %hi(__region_CS4_M),gr5 - setlo %lo(__region_CS4_M),gr5 - sethi.p %hi(__region_CS4_C),gr6 - setlo %lo(__region_CS4_C),gr6 - sti gr4,@(gr10,#4*0x08) - sti gr5,@(gr10,#4*0x08+0x100) - sti gr6,@(gr11,#4*0x08) - sethi.p %hi(__region_CS5),gr4 - setlo %lo(__region_CS5),gr4 - sethi.p %hi(__region_CS5_M),gr5 - setlo %lo(__region_CS5_M),gr5 - sethi.p %hi(__region_CS5_C),gr6 - setlo %lo(__region_CS5_C),gr6 - sti gr4,@(gr10,#5*0x08) - sti gr5,@(gr10,#5*0x08+0x100) - sti gr6,@(gr11,#5*0x08) - sethi.p %hi(__region_CS6),gr4 - setlo %lo(__region_CS6),gr4 - sethi.p %hi(__region_CS6_M),gr5 - setlo %lo(__region_CS6_M),gr5 - sethi.p %hi(__region_CS6_C),gr6 - setlo %lo(__region_CS6_C),gr6 - sti gr4,@(gr10,#6*0x08) - sti gr5,@(gr10,#6*0x08+0x100) - sti gr6,@(gr11,#6*0x08) - sethi.p %hi(__region_CS7),gr4 - setlo %lo(__region_CS7),gr4 - sethi.p %hi(__region_CS7_M),gr5 - setlo %lo(__region_CS7_M),gr5 - sethi.p %hi(__region_CS7_C),gr6 - setlo %lo(__region_CS7_C),gr6 - sti gr4,@(gr10,#7*0x08) - sti gr5,@(gr10,#7*0x08+0x100) - sti gr6,@(gr11,#7*0x08) - membar - bar - - # adjust LED bank address -#ifdef CONFIG_MB93091_VDK - sethi.p %hi(__region_CS2 + 0x01200004),gr30 - setlo %lo(__region_CS2 + 0x01200004),gr30 -#endif - bralr - -############################################################################### -# -# determine the total SDRAM size -# -# ENTRY: EXIT: -# GR25 - SDRAM size -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# -############################################################################### - .globl __head_fr451_survey_sdram -__head_fr451_survey_sdram: - sethi.p %hi(__400_DAM0),gr11 - setlo %lo(__400_DAM0),gr11 - sethi.p %hi(__400_DBR0),gr12 - setlo %lo(__400_DBR0),gr12 - - sethi.p %hi(0xfe000000),gr17 ; unused SDRAM DBR value - setlo %lo(0xfe000000),gr17 - setlos #0,gr25 - - ldi @(gr12,#0x00),gr4 ; DAR0 - subcc gr4,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS0 - ldi @(gr11,#0x00),gr6 ; DAM0: bits 31:20 match addr 31:20 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS0: - - ldi @(gr12,#0x08),gr4 ; DAR1 - subcc gr4,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS1 - ldi @(gr11,#0x08),gr6 ; DAM1: bits 31:20 match addr 31:20 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS1: - - ldi @(gr12,#0x10),gr4 ; DAR2 - subcc gr4,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS2 - ldi @(gr11,#0x10),gr6 ; DAM2: bits 31:20 match addr 31:20 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS2: - - ldi @(gr12,#0x18),gr4 ; DAR3 - subcc gr4,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS3 - ldi @(gr11,#0x18),gr6 ; DAM3: bits 31:20 match addr 31:20 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS3: - bralr - -############################################################################### -# -# set the protection map with the I/DAMPR registers -# -# ENTRY: EXIT: -# GR25 SDRAM size [saved] -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# -# -# Using this map: -# REGISTERS ADDRESS RANGE VIEW -# =============== ====================== =============================== -# IAMPR0/DAMPR0 0xC0000000-0xCFFFFFFF Cached kernel RAM Window -# DAMPR11 0xE0000000-0xFFFFFFFF Uncached I/O -# -############################################################################### - .globl __head_fr451_set_protection -__head_fr451_set_protection: - movsg lr,gr27 - - # set the I/O region protection registers for FR451 in MMU mode -#define PGPROT_IO xAMPRx_L|xAMPRx_M|xAMPRx_S_KERNEL|xAMPRx_C|xAMPRx_V - - sethi.p %hi(__region_IO),gr5 - setlo %lo(__region_IO),gr5 - setlos #PGPROT_IO|xAMPRx_SS_512Mb,gr4 - or gr4,gr5,gr4 - movgs gr5,damlr11 ; General I/O tile - movgs gr4,dampr11 - - # need to open a window onto at least part of the RAM for the kernel's use - sethi.p %hi(__sdram_base),gr8 - setlo %lo(__sdram_base),gr8 ; physical address - sethi.p %hi(__page_offset),gr9 - setlo %lo(__page_offset),gr9 ; virtual address - - setlos #xAMPRx_L|xAMPRx_M|xAMPRx_SS_256Mb|xAMPRx_S_KERNEL|xAMPRx_V,gr11 - or gr8,gr11,gr8 - - movgs gr9,iamlr0 ; mapped from real address 0 - movgs gr8,iampr0 ; cached kernel memory at 0xC0000000 - movgs gr9,damlr0 - movgs gr8,dampr0 - - # set a temporary mapping for the kernel running at address 0 until we've turned on the MMU - sethi.p %hi(__sdram_base),gr9 - setlo %lo(__sdram_base),gr9 ; virtual address - - and.p gr4,gr11,gr4 - and gr5,gr11,gr5 - or.p gr4,gr11,gr4 - or gr5,gr11,gr5 - - movgs gr9,iamlr1 ; mapped from real address 0 - movgs gr8,iampr1 ; cached kernel memory at 0x00000000 - movgs gr9,damlr1 - movgs gr8,dampr1 - - # we use DAMR2-10 for kmap_atomic(), cache flush and TLB management - # since the DAMLR regs are not going to change, we can set them now - # also set up IAMLR2 to the same as DAMLR5 - sethi.p %hi(KMAP_ATOMIC_PRIMARY_FRAME),gr4 - setlo %lo(KMAP_ATOMIC_PRIMARY_FRAME),gr4 - sethi.p %hi(PAGE_SIZE),gr5 - setlo %lo(PAGE_SIZE),gr5 - - movgs gr4,damlr2 - movgs gr4,iamlr2 - add gr4,gr5,gr4 - movgs gr4,damlr3 - add gr4,gr5,gr4 - movgs gr4,damlr4 - add gr4,gr5,gr4 - movgs gr4,damlr5 - add gr4,gr5,gr4 - movgs gr4,damlr6 - add gr4,gr5,gr4 - movgs gr4,damlr7 - add gr4,gr5,gr4 - movgs gr4,damlr8 - add gr4,gr5,gr4 - movgs gr4,damlr9 - add gr4,gr5,gr4 - movgs gr4,damlr10 - - movgs gr0,dampr2 - movgs gr0,dampr4 - movgs gr0,dampr5 - movgs gr0,dampr6 - movgs gr0,dampr7 - movgs gr0,dampr8 - movgs gr0,dampr9 - movgs gr0,dampr10 - - movgs gr0,iamlr3 - movgs gr0,iamlr4 - movgs gr0,iamlr5 - movgs gr0,iamlr6 - movgs gr0,iamlr7 - - movgs gr0,iampr2 - movgs gr0,iampr3 - movgs gr0,iampr4 - movgs gr0,iampr5 - movgs gr0,iampr6 - movgs gr0,iampr7 - - # start in TLB context 0 with the swapper's page tables - movgs gr0,cxnr - - sethi.p %hi(swapper_pg_dir),gr4 - setlo %lo(swapper_pg_dir),gr4 - sethi.p %hi(__page_offset),gr5 - setlo %lo(__page_offset),gr5 - sub gr4,gr5,gr4 - movgs gr4,ttbr - setlos #xAMPRx_L|xAMPRx_M|xAMPRx_SS_16Kb|xAMPRx_S|xAMPRx_C|xAMPRx_V,gr5 - or gr4,gr5,gr4 - movgs gr4,dampr3 - - # the FR451 also has an extra trap base register - movsg tbr,gr4 - movgs gr4,btbr - - LEDS 0x3300 - jmpl @(gr27,gr0) - -############################################################################### -# -# finish setting up the protection registers -# -############################################################################### - .globl __head_fr451_finalise_protection -__head_fr451_finalise_protection: - # turn on the timers as appropriate - movgs gr0,timerh - movgs gr0,timerl - movgs gr0,timerd - movsg hsr0,gr4 - sethi.p %hi(HSR0_ETMI),gr5 - setlo %lo(HSR0_ETMI),gr5 - or gr4,gr5,gr4 - movgs gr4,hsr0 - - # clear the TLB entry cache - movgs gr0,iamlr1 - movgs gr0,iampr1 - movgs gr0,damlr1 - movgs gr0,dampr1 - - # clear the PGE cache - sethi.p %hi(__flush_tlb_all),gr4 - setlo %lo(__flush_tlb_all),gr4 - jmpl @(gr4,gr0) diff --git a/arch/frv/kernel/head-uc-fr401.S b/arch/frv/kernel/head-uc-fr401.S deleted file mode 100644 index 438643cfa38e..000000000000 --- a/arch/frv/kernel/head-uc-fr401.S +++ /dev/null @@ -1,311 +0,0 @@ -/* head-uc-fr401.S: FR401/3/5 uc-linux specific bits of initialisation - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include "head.inc" - - -#define __400_DBR0 0xfe000e00 -#define __400_DBR1 0xfe000e08 -#define __400_DBR2 0xfe000e10 /* not on FR401 */ -#define __400_DBR3 0xfe000e18 /* not on FR401 */ -#define __400_DAM0 0xfe000f00 -#define __400_DAM1 0xfe000f08 -#define __400_DAM2 0xfe000f10 /* not on FR401 */ -#define __400_DAM3 0xfe000f18 /* not on FR401 */ -#define __400_LGCR 0xfe000010 -#define __400_LCR 0xfe000100 -#define __400_LSBR 0xfe000c00 - - __INIT - .balign 4 - -############################################################################### -# -# describe the position and layout of the SDRAM controller registers -# -# ENTRY: EXIT: -# GR5 - cacheline size -# GR11 - displacement of 2nd SDRAM addr reg from GR14 -# GR12 - displacement of 3rd SDRAM addr reg from GR14 -# GR13 - displacement of 4th SDRAM addr reg from GR14 -# GR14 - address of 1st SDRAM addr reg -# GR15 - amount to shift address by to match SDRAM addr reg -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# CC0 - T if DBR0 is present -# CC1 - T if DBR1 is present -# CC2 - T if DBR2 is present (not FR401/FR401A) -# CC3 - T if DBR3 is present (not FR401/FR401A) -# -############################################################################### - .globl __head_fr401_describe_sdram -__head_fr401_describe_sdram: - sethi.p %hi(__400_DBR0),gr14 - setlo %lo(__400_DBR0),gr14 - setlos.p #__400_DBR1-__400_DBR0,gr11 - setlos #__400_DBR2-__400_DBR0,gr12 - setlos.p #__400_DBR3-__400_DBR0,gr13 - setlos #32,gr5 ; cacheline size - setlos.p #0,gr15 ; amount to shift addr reg by - - # specify which DBR regs are present - setlos #0x00ff,gr4 - movgs gr4,cccr - movsg psr,gr3 ; check for FR401/FR401A - srli gr3,#25,gr3 - subicc gr3,#0x20>>1,gr0,icc0 - bnelr icc0,#1 - setlos #0x000f,gr4 - movgs gr4,cccr - bralr - -############################################################################### -# -# rearrange the bus controller registers -# -# ENTRY: EXIT: -# GR26 &__head_reference [saved] -# GR30 LED address revised LED address -# -############################################################################### - .globl __head_fr401_set_busctl -__head_fr401_set_busctl: - sethi.p %hi(__400_LGCR),gr4 - setlo %lo(__400_LGCR),gr4 - sethi.p %hi(__400_LSBR),gr10 - setlo %lo(__400_LSBR),gr10 - sethi.p %hi(__400_LCR),gr11 - setlo %lo(__400_LCR),gr11 - - # set the bus controller - ldi @(gr4,#0),gr5 - ori gr5,#0xff,gr5 ; make sure all chip-selects are enabled - sti gr5,@(gr4,#0) - - sethi.p %hi(__region_CS1),gr4 - setlo %lo(__region_CS1),gr4 - sethi.p %hi(__region_CS1_M),gr5 - setlo %lo(__region_CS1_M),gr5 - sethi.p %hi(__region_CS1_C),gr6 - setlo %lo(__region_CS1_C),gr6 - sti gr4,@(gr10,#1*0x08) - sti gr5,@(gr10,#1*0x08+0x100) - sti gr6,@(gr11,#1*0x08) - sethi.p %hi(__region_CS2),gr4 - setlo %lo(__region_CS2),gr4 - sethi.p %hi(__region_CS2_M),gr5 - setlo %lo(__region_CS2_M),gr5 - sethi.p %hi(__region_CS2_C),gr6 - setlo %lo(__region_CS2_C),gr6 - sti gr4,@(gr10,#2*0x08) - sti gr5,@(gr10,#2*0x08+0x100) - sti gr6,@(gr11,#2*0x08) - sethi.p %hi(__region_CS3),gr4 - setlo %lo(__region_CS3),gr4 - sethi.p %hi(__region_CS3_M),gr5 - setlo %lo(__region_CS3_M),gr5 - sethi.p %hi(__region_CS3_C),gr6 - setlo %lo(__region_CS3_C),gr6 - sti gr4,@(gr10,#3*0x08) - sti gr5,@(gr10,#3*0x08+0x100) - sti gr6,@(gr11,#3*0x08) - sethi.p %hi(__region_CS4),gr4 - setlo %lo(__region_CS4),gr4 - sethi.p %hi(__region_CS4_M),gr5 - setlo %lo(__region_CS4_M),gr5 - sethi.p %hi(__region_CS4_C),gr6 - setlo %lo(__region_CS4_C),gr6 - sti gr4,@(gr10,#4*0x08) - sti gr5,@(gr10,#4*0x08+0x100) - sti gr6,@(gr11,#4*0x08) - sethi.p %hi(__region_CS5),gr4 - setlo %lo(__region_CS5),gr4 - sethi.p %hi(__region_CS5_M),gr5 - setlo %lo(__region_CS5_M),gr5 - sethi.p %hi(__region_CS5_C),gr6 - setlo %lo(__region_CS5_C),gr6 - sti gr4,@(gr10,#5*0x08) - sti gr5,@(gr10,#5*0x08+0x100) - sti gr6,@(gr11,#5*0x08) - sethi.p %hi(__region_CS6),gr4 - setlo %lo(__region_CS6),gr4 - sethi.p %hi(__region_CS6_M),gr5 - setlo %lo(__region_CS6_M),gr5 - sethi.p %hi(__region_CS6_C),gr6 - setlo %lo(__region_CS6_C),gr6 - sti gr4,@(gr10,#6*0x08) - sti gr5,@(gr10,#6*0x08+0x100) - sti gr6,@(gr11,#6*0x08) - sethi.p %hi(__region_CS7),gr4 - setlo %lo(__region_CS7),gr4 - sethi.p %hi(__region_CS7_M),gr5 - setlo %lo(__region_CS7_M),gr5 - sethi.p %hi(__region_CS7_C),gr6 - setlo %lo(__region_CS7_C),gr6 - sti gr4,@(gr10,#7*0x08) - sti gr5,@(gr10,#7*0x08+0x100) - sti gr6,@(gr11,#7*0x08) - membar - bar - - # adjust LED bank address - sethi.p %hi(LED_ADDR - 0x20000000 +__region_CS2),gr30 - setlo %lo(LED_ADDR - 0x20000000 +__region_CS2),gr30 - bralr - -############################################################################### -# -# determine the total SDRAM size -# -# ENTRY: EXIT: -# GR25 - SDRAM size -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# -############################################################################### - .globl __head_fr401_survey_sdram -__head_fr401_survey_sdram: - sethi.p %hi(__400_DAM0),gr11 - setlo %lo(__400_DAM0),gr11 - sethi.p %hi(__400_DBR0),gr12 - setlo %lo(__400_DBR0),gr12 - - sethi.p %hi(0xfe000000),gr17 ; unused SDRAM DBR value - setlo %lo(0xfe000000),gr17 - setlos #0,gr25 - - ldi @(gr12,#0x00),gr4 ; DAR0 - subcc gr4,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS0 - ldi @(gr11,#0x00),gr6 ; DAM0: bits 31:20 match addr 31:20 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS0: - - ldi @(gr12,#0x08),gr4 ; DAR1 - subcc gr4,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS1 - ldi @(gr11,#0x08),gr6 ; DAM1: bits 31:20 match addr 31:20 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS1: - - # FR401/FR401A does not have DCS2/3 - movsg psr,gr3 - srli gr3,#25,gr3 - subicc gr3,#0x20>>1,gr0,icc0 - beq icc0,#0,__head_no_DCS3 - - ldi @(gr12,#0x10),gr4 ; DAR2 - subcc gr4,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS2 - ldi @(gr11,#0x10),gr6 ; DAM2: bits 31:20 match addr 31:20 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS2: - - ldi @(gr12,#0x18),gr4 ; DAR3 - subcc gr4,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS3 - ldi @(gr11,#0x18),gr6 ; DAM3: bits 31:20 match addr 31:20 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS3: - bralr - -############################################################################### -# -# set the protection map with the I/DAMPR registers -# -# ENTRY: EXIT: -# GR25 SDRAM size [saved] -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# -############################################################################### - .globl __head_fr401_set_protection -__head_fr401_set_protection: - movsg lr,gr27 - - # set the I/O region protection registers for FR401/3/5 - sethi.p %hi(__region_IO),gr5 - setlo %lo(__region_IO),gr5 - ori gr5,#xAMPRx_SS_512Mb|xAMPRx_S_KERNEL|xAMPRx_C|xAMPRx_V,gr5 - movgs gr0,iampr7 - movgs gr5,dampr7 ; General I/O tile - - # need to tile the remaining IAMPR/DAMPR registers to cover as much of the RAM as possible - # - start with the highest numbered registers - sethi.p %hi(__kernel_image_end),gr8 - setlo %lo(__kernel_image_end),gr8 - sethi.p %hi(32768),gr4 ; allow for a maximal allocator bitmap - setlo %lo(32768),gr4 - add gr8,gr4,gr8 - sethi.p %hi(1024*2048-1),gr4 ; round up to nearest 2MiB - setlo %lo(1024*2048-1),gr4 - add.p gr8,gr4,gr8 - not gr4,gr4 - and gr8,gr4,gr8 - - sethi.p %hi(__page_offset),gr9 - setlo %lo(__page_offset),gr9 - add gr9,gr25,gr9 - - # GR8 = base of uncovered RAM - # GR9 = top of uncovered RAM - -#ifdef CONFIG_MB93093_PDK - sethi.p %hi(__region_CS2),gr4 - setlo %lo(__region_CS2),gr4 - ori gr4,#xAMPRx_SS_1Mb|xAMPRx_S_KERNEL|xAMPRx_C|xAMPRx_V,gr4 - movgs gr4,dampr6 - movgs gr0,iampr6 -#else - call __head_split_region - movgs gr4,iampr6 - movgs gr5,dampr6 -#endif - call __head_split_region - movgs gr4,iampr5 - movgs gr5,dampr5 - call __head_split_region - movgs gr4,iampr4 - movgs gr5,dampr4 - call __head_split_region - movgs gr4,iampr3 - movgs gr5,dampr3 - call __head_split_region - movgs gr4,iampr2 - movgs gr5,dampr2 - call __head_split_region - movgs gr4,iampr1 - movgs gr5,dampr1 - - # cover kernel core image with kernel-only segment - sethi.p %hi(__page_offset),gr8 - setlo %lo(__page_offset),gr8 - call __head_split_region - -#ifdef CONFIG_PROTECT_KERNEL - ori.p gr4,#xAMPRx_S_KERNEL,gr4 - ori gr5,#xAMPRx_S_KERNEL,gr5 -#endif - - movgs gr4,iampr0 - movgs gr5,dampr0 - jmpl @(gr27,gr0) diff --git a/arch/frv/kernel/head-uc-fr451.S b/arch/frv/kernel/head-uc-fr451.S deleted file mode 100644 index b2a76c4a1786..000000000000 --- a/arch/frv/kernel/head-uc-fr451.S +++ /dev/null @@ -1,174 +0,0 @@ -/* head-uc-fr451.S: FR451 uc-linux specific bits of initialisation - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include "head.inc" - - -#define __400_DBR0 0xfe000e00 -#define __400_DBR1 0xfe000e08 -#define __400_DBR2 0xfe000e10 -#define __400_DBR3 0xfe000e18 -#define __400_DAM0 0xfe000f00 -#define __400_DAM1 0xfe000f08 -#define __400_DAM2 0xfe000f10 -#define __400_DAM3 0xfe000f18 -#define __400_LGCR 0xfe000010 -#define __400_LCR 0xfe000100 -#define __400_LSBR 0xfe000c00 - - __INIT - .balign 4 - -############################################################################### -# -# set the protection map with the I/DAMPR registers -# -# ENTRY: EXIT: -# GR25 SDRAM size [saved] -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# -############################################################################### - .globl __head_fr451_set_protection -__head_fr451_set_protection: - movsg lr,gr27 - - movgs gr0,dampr10 - movgs gr0,damlr10 - movgs gr0,dampr9 - movgs gr0,damlr9 - movgs gr0,dampr8 - movgs gr0,damlr8 - - # set the I/O region protection registers for FR401/3/5 - sethi.p %hi(__region_IO),gr5 - setlo %lo(__region_IO),gr5 - sethi.p %hi(0x1fffffff),gr7 - setlo %lo(0x1fffffff),gr7 - ori gr5,#xAMPRx_SS_512Mb|xAMPRx_S_KERNEL|xAMPRx_C|xAMPRx_V,gr5 - movgs gr5,dampr11 ; General I/O tile - movgs gr7,damlr11 - - # need to tile the remaining IAMPR/DAMPR registers to cover as much of the RAM as possible - # - start with the highest numbered registers - sethi.p %hi(__kernel_image_end),gr8 - setlo %lo(__kernel_image_end),gr8 - sethi.p %hi(32768),gr4 ; allow for a maximal allocator bitmap - setlo %lo(32768),gr4 - add gr8,gr4,gr8 - sethi.p %hi(1024*2048-1),gr4 ; round up to nearest 2MiB - setlo %lo(1024*2048-1),gr4 - add.p gr8,gr4,gr8 - not gr4,gr4 - and gr8,gr4,gr8 - - sethi.p %hi(__page_offset),gr9 - setlo %lo(__page_offset),gr9 - add gr9,gr25,gr9 - - sethi.p %hi(0xffffc000),gr11 - setlo %lo(0xffffc000),gr11 - - # GR8 = base of uncovered RAM - # GR9 = top of uncovered RAM - # GR11 = xAMLR mask - LEDS 0x3317 - call __head_split_region - movgs gr4,iampr7 - movgs gr6,iamlr7 - movgs gr5,dampr7 - movgs gr7,damlr7 - - LEDS 0x3316 - call __head_split_region - movgs gr4,iampr6 - movgs gr6,iamlr6 - movgs gr5,dampr6 - movgs gr7,damlr6 - - LEDS 0x3315 - call __head_split_region - movgs gr4,iampr5 - movgs gr6,iamlr5 - movgs gr5,dampr5 - movgs gr7,damlr5 - - LEDS 0x3314 - call __head_split_region - movgs gr4,iampr4 - movgs gr6,iamlr4 - movgs gr5,dampr4 - movgs gr7,damlr4 - - LEDS 0x3313 - call __head_split_region - movgs gr4,iampr3 - movgs gr6,iamlr3 - movgs gr5,dampr3 - movgs gr7,damlr3 - - LEDS 0x3312 - call __head_split_region - movgs gr4,iampr2 - movgs gr6,iamlr2 - movgs gr5,dampr2 - movgs gr7,damlr2 - - LEDS 0x3311 - call __head_split_region - movgs gr4,iampr1 - movgs gr6,iamlr1 - movgs gr5,dampr1 - movgs gr7,damlr1 - - # cover kernel core image with kernel-only segment - LEDS 0x3310 - sethi.p %hi(__page_offset),gr8 - setlo %lo(__page_offset),gr8 - call __head_split_region - -#ifdef CONFIG_PROTECT_KERNEL - ori.p gr4,#xAMPRx_S_KERNEL,gr4 - ori gr5,#xAMPRx_S_KERNEL,gr5 -#endif - - movgs gr4,iampr0 - movgs gr6,iamlr0 - movgs gr5,dampr0 - movgs gr7,damlr0 - - # start in TLB context 0 with no page tables - movgs gr0,cxnr - movgs gr0,ttbr - - # the FR451 also has an extra trap base register - movsg tbr,gr4 - movgs gr4,btbr - - # turn on the timers as appropriate - movgs gr0,timerh - movgs gr0,timerl - movgs gr0,timerd - movsg hsr0,gr4 - sethi.p %hi(HSR0_ETMI),gr5 - setlo %lo(HSR0_ETMI),gr5 - or gr4,gr5,gr4 - movgs gr4,hsr0 - - LEDS 0x3300 - jmpl @(gr27,gr0) diff --git a/arch/frv/kernel/head-uc-fr555.S b/arch/frv/kernel/head-uc-fr555.S deleted file mode 100644 index 5497aaf34f77..000000000000 --- a/arch/frv/kernel/head-uc-fr555.S +++ /dev/null @@ -1,347 +0,0 @@ -/* head-uc-fr555.S: FR555 uc-linux specific bits of initialisation - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include "head.inc" - - -#define __551_DARS0 0xfeff0100 -#define __551_DARS1 0xfeff0104 -#define __551_DARS2 0xfeff0108 -#define __551_DARS3 0xfeff010c -#define __551_DAMK0 0xfeff0110 -#define __551_DAMK1 0xfeff0114 -#define __551_DAMK2 0xfeff0118 -#define __551_DAMK3 0xfeff011c -#define __551_LCR 0xfeff1100 -#define __551_LSBR 0xfeff1c00 - - __INIT - .balign 4 - -############################################################################### -# -# describe the position and layout of the SDRAM controller registers -# -# ENTRY: EXIT: -# GR5 - cacheline size -# GR11 - displacement of 2nd SDRAM addr reg from GR14 -# GR12 - displacement of 3rd SDRAM addr reg from GR14 -# GR13 - displacement of 4th SDRAM addr reg from GR14 -# GR14 - address of 1st SDRAM addr reg -# GR15 - amount to shift address by to match SDRAM addr reg -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# CC0 - T if DARS0 is present -# CC1 - T if DARS1 is present -# CC2 - T if DARS2 is present -# CC3 - T if DARS3 is present -# -############################################################################### - .globl __head_fr555_describe_sdram -__head_fr555_describe_sdram: - sethi.p %hi(__551_DARS0),gr14 - setlo %lo(__551_DARS0),gr14 - setlos.p #__551_DARS1-__551_DARS0,gr11 - setlos #__551_DARS2-__551_DARS0,gr12 - setlos.p #__551_DARS3-__551_DARS0,gr13 - setlos #64,gr5 ; cacheline size - setlos #20,gr15 ; amount to shift addr by - setlos #0x00ff,gr4 - movgs gr4,cccr ; extant DARS/DAMK regs - bralr - -############################################################################### -# -# rearrange the bus controller registers -# -# ENTRY: EXIT: -# GR26 &__head_reference [saved] -# GR30 LED address revised LED address -# -############################################################################### - .globl __head_fr555_set_busctl -__head_fr555_set_busctl: - LEDS 0x100f - sethi.p %hi(__551_LSBR),gr10 - setlo %lo(__551_LSBR),gr10 - sethi.p %hi(__551_LCR),gr11 - setlo %lo(__551_LCR),gr11 - - # set the bus controller - sethi.p %hi(__region_CS1),gr4 - setlo %lo(__region_CS1),gr4 - sethi.p %hi(__region_CS1_M),gr5 - setlo %lo(__region_CS1_M),gr5 - sethi.p %hi(__region_CS1_C),gr6 - setlo %lo(__region_CS1_C),gr6 - sti gr4,@(gr10,#1*0x08) - sti gr5,@(gr10,#1*0x08+0x100) - sti gr6,@(gr11,#1*0x08) - sethi.p %hi(__region_CS2),gr4 - setlo %lo(__region_CS2),gr4 - sethi.p %hi(__region_CS2_M),gr5 - setlo %lo(__region_CS2_M),gr5 - sethi.p %hi(__region_CS2_C),gr6 - setlo %lo(__region_CS2_C),gr6 - sti gr4,@(gr10,#2*0x08) - sti gr5,@(gr10,#2*0x08+0x100) - sti gr6,@(gr11,#2*0x08) - sethi.p %hi(__region_CS3),gr4 - setlo %lo(__region_CS3),gr4 - sethi.p %hi(__region_CS3_M),gr5 - setlo %lo(__region_CS3_M),gr5 - sethi.p %hi(__region_CS3_C),gr6 - setlo %lo(__region_CS3_C),gr6 - sti gr4,@(gr10,#3*0x08) - sti gr5,@(gr10,#3*0x08+0x100) - sti gr6,@(gr11,#3*0x08) - sethi.p %hi(__region_CS4),gr4 - setlo %lo(__region_CS4),gr4 - sethi.p %hi(__region_CS4_M),gr5 - setlo %lo(__region_CS4_M),gr5 - sethi.p %hi(__region_CS4_C),gr6 - setlo %lo(__region_CS4_C),gr6 - sti gr4,@(gr10,#4*0x08) - sti gr5,@(gr10,#4*0x08+0x100) - sti gr6,@(gr11,#4*0x08) - sethi.p %hi(__region_CS5),gr4 - setlo %lo(__region_CS5),gr4 - sethi.p %hi(__region_CS5_M),gr5 - setlo %lo(__region_CS5_M),gr5 - sethi.p %hi(__region_CS5_C),gr6 - setlo %lo(__region_CS5_C),gr6 - sti gr4,@(gr10,#5*0x08) - sti gr5,@(gr10,#5*0x08+0x100) - sti gr6,@(gr11,#5*0x08) - sethi.p %hi(__region_CS6),gr4 - setlo %lo(__region_CS6),gr4 - sethi.p %hi(__region_CS6_M),gr5 - setlo %lo(__region_CS6_M),gr5 - sethi.p %hi(__region_CS6_C),gr6 - setlo %lo(__region_CS6_C),gr6 - sti gr4,@(gr10,#6*0x08) - sti gr5,@(gr10,#6*0x08+0x100) - sti gr6,@(gr11,#6*0x08) - sethi.p %hi(__region_CS7),gr4 - setlo %lo(__region_CS7),gr4 - sethi.p %hi(__region_CS7_M),gr5 - setlo %lo(__region_CS7_M),gr5 - sethi.p %hi(__region_CS7_C),gr6 - setlo %lo(__region_CS7_C),gr6 - sti gr4,@(gr10,#7*0x08) - sti gr5,@(gr10,#7*0x08+0x100) - sti gr6,@(gr11,#7*0x08) - membar - bar - - # adjust LED bank address -#ifdef CONFIG_MB93091_VDK - sethi.p %hi(LED_ADDR - 0x20000000 +__region_CS2),gr30 - setlo %lo(LED_ADDR - 0x20000000 +__region_CS2),gr30 -#endif - bralr - -############################################################################### -# -# determine the total SDRAM size -# -# ENTRY: EXIT: -# GR25 - SDRAM size -# GR26 &__head_reference [saved] -# GR30 LED address [saved] -# -############################################################################### - .globl __head_fr555_survey_sdram -__head_fr555_survey_sdram: - sethi.p %hi(__551_DAMK0),gr11 - setlo %lo(__551_DAMK0),gr11 - sethi.p %hi(__551_DARS0),gr12 - setlo %lo(__551_DARS0),gr12 - - sethi.p %hi(0xfff),gr17 ; unused SDRAM AMK value - setlo %lo(0xfff),gr17 - setlos #0,gr25 - - ldi @(gr11,#0x00),gr6 ; DAMK0: bits 11:0 match addr 11:0 - subcc gr6,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS0 - ldi @(gr12,#0x00),gr4 ; DARS0 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS0: - - ldi @(gr11,#0x04),gr6 ; DAMK1: bits 11:0 match addr 11:0 - subcc gr6,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS1 - ldi @(gr12,#0x04),gr4 ; DARS1 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS1: - - ldi @(gr11,#0x8),gr6 ; DAMK2: bits 11:0 match addr 11:0 - subcc gr6,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS2 - ldi @(gr12,#0x8),gr4 ; DARS2 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS2: - - ldi @(gr11,#0xc),gr6 ; DAMK3: bits 11:0 match addr 11:0 - subcc gr6,gr17,gr0,icc0 - beq icc0,#0,__head_no_DCS3 - ldi @(gr12,#0xc),gr4 ; DARS3 - add gr25,gr6,gr25 - addi gr25,#1,gr25 -__head_no_DCS3: - - slli gr25,#20,gr25 ; shift [11:0] -> [31:20] - bralr - -############################################################################### -# -# set the protection map with the I/DAMPR registers -# -# ENTRY: EXIT: -# GR25 SDRAM size saved -# GR30 LED address saved -# -############################################################################### - .globl __head_fr555_set_protection -__head_fr555_set_protection: - movsg lr,gr27 - - sethi.p %hi(0xfff00000),gr11 - setlo %lo(0xfff00000),gr11 - - # set the I/O region protection registers for FR555 - sethi.p %hi(__region_IO),gr7 - setlo %lo(__region_IO),gr7 - ori gr7,#xAMPRx_SS_512Mb|xAMPRx_S_KERNEL|xAMPRx_C|xAMPRx_V,gr5 - movgs gr0,iampr15 - movgs gr0,iamlr15 - movgs gr5,dampr15 - movgs gr7,damlr15 - - # need to tile the remaining IAMPR/DAMPR registers to cover as much of the RAM as possible - # - start with the highest numbered registers - sethi.p %hi(__kernel_image_end),gr8 - setlo %lo(__kernel_image_end),gr8 - sethi.p %hi(32768),gr4 ; allow for a maximal allocator bitmap - setlo %lo(32768),gr4 - add gr8,gr4,gr8 - sethi.p %hi(1024*2048-1),gr4 ; round up to nearest 2MiB - setlo %lo(1024*2048-1),gr4 - add.p gr8,gr4,gr8 - not gr4,gr4 - and gr8,gr4,gr8 - - sethi.p %hi(__page_offset),gr9 - setlo %lo(__page_offset),gr9 - add gr9,gr25,gr9 - - # GR8 = base of uncovered RAM - # GR9 = top of uncovered RAM - # GR11 - mask for DAMLR/IAMLR regs - # - call __head_split_region - movgs gr4,iampr14 - movgs gr6,iamlr14 - movgs gr5,dampr14 - movgs gr7,damlr14 - call __head_split_region - movgs gr4,iampr13 - movgs gr6,iamlr13 - movgs gr5,dampr13 - movgs gr7,damlr13 - call __head_split_region - movgs gr4,iampr12 - movgs gr6,iamlr12 - movgs gr5,dampr12 - movgs gr7,damlr12 - call __head_split_region - movgs gr4,iampr11 - movgs gr6,iamlr11 - movgs gr5,dampr11 - movgs gr7,damlr11 - call __head_split_region - movgs gr4,iampr10 - movgs gr6,iamlr10 - movgs gr5,dampr10 - movgs gr7,damlr10 - call __head_split_region - movgs gr4,iampr9 - movgs gr6,iamlr9 - movgs gr5,dampr9 - movgs gr7,damlr9 - call __head_split_region - movgs gr4,iampr8 - movgs gr6,iamlr8 - movgs gr5,dampr8 - movgs gr7,damlr8 - - call __head_split_region - movgs gr4,iampr7 - movgs gr6,iamlr7 - movgs gr5,dampr7 - movgs gr7,damlr7 - call __head_split_region - movgs gr4,iampr6 - movgs gr6,iamlr6 - movgs gr5,dampr6 - movgs gr7,damlr6 - call __head_split_region - movgs gr4,iampr5 - movgs gr6,iamlr5 - movgs gr5,dampr5 - movgs gr7,damlr5 - call __head_split_region - movgs gr4,iampr4 - movgs gr6,iamlr4 - movgs gr5,dampr4 - movgs gr7,damlr4 - call __head_split_region - movgs gr4,iampr3 - movgs gr6,iamlr3 - movgs gr5,dampr3 - movgs gr7,damlr3 - call __head_split_region - movgs gr4,iampr2 - movgs gr6,iamlr2 - movgs gr5,dampr2 - movgs gr7,damlr2 - call __head_split_region - movgs gr4,iampr1 - movgs gr6,iamlr1 - movgs gr5,dampr1 - movgs gr7,damlr1 - - # cover kernel core image with kernel-only segment - sethi.p %hi(__page_offset),gr8 - setlo %lo(__page_offset),gr8 - call __head_split_region - -#ifdef CONFIG_PROTECT_KERNEL - ori.p gr4,#xAMPRx_S_KERNEL,gr4 - ori gr5,#xAMPRx_S_KERNEL,gr5 -#endif - - movgs gr4,iampr0 - movgs gr6,iamlr0 - movgs gr5,dampr0 - movgs gr7,damlr0 - jmpl @(gr27,gr0) diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S deleted file mode 100644 index a7d0bea9c036..000000000000 --- a/arch/frv/kernel/head.S +++ /dev/null @@ -1,638 +0,0 @@ -/* head.S: kernel entry point for FR-V kernel - * - * Copyright (C) 2003, 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "head.inc" - -############################################################################### -# -# void _boot(unsigned long magic, char *command_line) __attribute__((noreturn)) -# -# - if magic is 0xdead1eaf, then command_line is assumed to point to the kernel -# command line string -# -############################################################################### - __HEAD - .balign 4 - - .globl _boot, __head_reference - .type _boot,@function -_boot: -__head_reference: - sethi.p %hi(LED_ADDR),gr30 - setlo %lo(LED_ADDR),gr30 - - LEDS 0x0000 - - # calculate reference address for PC-relative stuff - call 0f -0: movsg lr,gr26 - addi gr26,#__head_reference-0b,gr26 - - # invalidate and disable both of the caches and turn off the memory access checking - dcef @(gr0,gr0),1 - bar - - sethi.p %hi(~(HSR0_ICE|HSR0_DCE|HSR0_CBM|HSR0_EIMMU|HSR0_EDMMU)),gr4 - setlo %lo(~(HSR0_ICE|HSR0_DCE|HSR0_CBM|HSR0_EIMMU|HSR0_EDMMU)),gr4 - movsg hsr0,gr5 - and gr4,gr5,gr5 - movgs gr5,hsr0 - movsg hsr0,gr5 - - LEDS 0x0001 - - icei @(gr0,gr0),1 - dcei @(gr0,gr0),1 - bar - - # turn the instruction cache back on - sethi.p %hi(HSR0_ICE),gr4 - setlo %lo(HSR0_ICE),gr4 - movsg hsr0,gr5 - or gr4,gr5,gr5 - movgs gr5,hsr0 - movsg hsr0,gr5 - - bar - - LEDS 0x0002 - - # retrieve the parameters (including command line) before we overwrite them - sethi.p %hi(0xdead1eaf),gr7 - setlo %lo(0xdead1eaf),gr7 - subcc gr7,gr8,gr0,icc0 - bne icc0,#0,__head_no_parameters - - sethi.p %hi(redboot_command_line-1),gr6 - setlo %lo(redboot_command_line-1),gr6 - sethi.p %hi(__head_reference),gr4 - setlo %lo(__head_reference),gr4 - sub gr6,gr4,gr6 - add.p gr6,gr26,gr6 - subi gr9,#1,gr9 - setlos.p #511,gr4 - setlos #1,gr5 - -__head_copy_cmdline: - ldubu.p @(gr9,gr5),gr16 - subicc gr4,#1,gr4,icc0 - stbu.p gr16,@(gr6,gr5) - subicc gr16,#0,gr0,icc1 - bls icc0,#0,__head_end_cmdline - bne icc1,#1,__head_copy_cmdline -__head_end_cmdline: - stbu gr0,@(gr6,gr5) -__head_no_parameters: - -############################################################################### -# -# we need to relocate the SDRAM to 0x00000000 (linux) or 0xC0000000 (uClinux) -# - note that we're going to have to run entirely out of the icache whilst -# fiddling with the SDRAM controller registers -# -############################################################################### -#ifdef CONFIG_MMU - call __head_fr451_describe_sdram - -#else - movsg psr,gr5 - srli gr5,#28,gr5 - subicc gr5,#3,gr0,icc0 - beq icc0,#0,__head_fr551_sdram - - call __head_fr401_describe_sdram - bra __head_do_sdram - -__head_fr551_sdram: - call __head_fr555_describe_sdram - LEDS 0x000d - -__head_do_sdram: -#endif - - # preload the registers with invalid values in case any DBR/DARS are marked not present - sethi.p %hi(0xfe000000),gr17 ; unused SDRAM DBR value - setlo %lo(0xfe000000),gr17 - or.p gr17,gr0,gr20 - or gr17,gr0,gr21 - or.p gr17,gr0,gr22 - or gr17,gr0,gr23 - - # consult the SDRAM controller CS address registers - cld @(gr14,gr0 ),gr20, cc0,#1 ; DBR0 / DARS0 - cld @(gr14,gr11),gr21, cc1,#1 ; DBR1 / DARS1 - cld @(gr14,gr12),gr22, cc2,#1 ; DBR2 / DARS2 - cld.p @(gr14,gr13),gr23, cc3,#1 ; DBR3 / DARS3 - - sll gr20,gr15,gr20 ; shift values up for FR551 - sll gr21,gr15,gr21 - sll gr22,gr15,gr22 - sll gr23,gr15,gr23 - - LEDS 0x0003 - - # assume the lowest valid CS line to be the SDRAM base and get its address - subcc gr20,gr17,gr0,icc0 - subcc.p gr21,gr17,gr0,icc1 - subcc gr22,gr17,gr0,icc2 - subcc.p gr23,gr17,gr0,icc3 - ckne icc0,cc4 ; T if DBR0 != 0xfe000000 - ckne icc1,cc5 - ckne icc2,cc6 - ckne icc3,cc7 - cor gr23,gr0,gr24, cc7,#1 ; GR24 = SDRAM base - cor gr22,gr0,gr24, cc6,#1 - cor gr21,gr0,gr24, cc5,#1 - cor gr20,gr0,gr24, cc4,#1 - - # calculate the displacement required to get the SDRAM into the right place in memory - sethi.p %hi(__sdram_base),gr16 - setlo %lo(__sdram_base),gr16 - sub gr16,gr24,gr16 ; delta = __sdram_base - DBRx - - # calculate the new values to go in the controller regs - cadd.p gr20,gr16,gr20, cc4,#1 ; DCS#0 (new) = DCS#0 (old) + delta - cadd gr21,gr16,gr21, cc5,#1 - cadd.p gr22,gr16,gr22, cc6,#1 - cadd gr23,gr16,gr23, cc7,#1 - - srl gr20,gr15,gr20 ; shift values down for FR551 - srl gr21,gr15,gr21 - srl gr22,gr15,gr22 - srl gr23,gr15,gr23 - - # work out the address at which the reg updater resides and lock it into icache - # also work out the address the updater will jump to when finished - sethi.p %hi(__head_move_sdram-__head_reference),gr18 - setlo %lo(__head_move_sdram-__head_reference),gr18 - sethi.p %hi(__head_sdram_moved-__head_reference),gr19 - setlo %lo(__head_sdram_moved-__head_reference),gr19 - add.p gr18,gr26,gr18 - add gr19,gr26,gr19 - add.p gr19,gr16,gr19 ; moved = addr + (__sdram_base - DBRx) - add gr18,gr5,gr4 ; two cachelines probably required - - icpl gr18,gr0,#1 ; load and lock the cachelines - icpl gr4,gr0,#1 - LEDS 0x0004 - membar - bar - jmpl @(gr18,gr0) - - .balign L1_CACHE_BYTES -__head_move_sdram: - cst gr20,@(gr14,gr0 ), cc4,#1 - cst gr21,@(gr14,gr11), cc5,#1 - cst gr22,@(gr14,gr12), cc6,#1 - cst gr23,@(gr14,gr13), cc7,#1 - cld @(gr14,gr0 ),gr20, cc4,#1 - cld @(gr14,gr11),gr21, cc5,#1 - cld @(gr14,gr12),gr22, cc4,#1 - cld @(gr14,gr13),gr23, cc7,#1 - bar - membar - jmpl @(gr19,gr0) - - .balign L1_CACHE_BYTES -__head_sdram_moved: - icul gr18 - add gr18,gr5,gr4 - icul gr4 - icei @(gr0,gr0),1 - dcei @(gr0,gr0),1 - - LEDS 0x0005 - - # recalculate reference address - call 0f -0: movsg lr,gr26 - addi gr26,#__head_reference-0b,gr26 - - -############################################################################### -# -# move the kernel image down to the bottom of the SDRAM -# -############################################################################### - sethi.p %hi(__kernel_image_size_no_bss+15),gr4 - setlo %lo(__kernel_image_size_no_bss+15),gr4 - srli.p gr4,#4,gr4 ; count - or gr26,gr26,gr16 ; source - - sethi.p %hi(__sdram_base),gr17 ; destination - setlo %lo(__sdram_base),gr17 - - setlos #8,gr5 - sub.p gr16,gr5,gr16 ; adjust src for LDDU - sub gr17,gr5,gr17 ; adjust dst for LDDU - - sethi.p %hi(__head_move_kernel-__head_reference),gr18 - setlo %lo(__head_move_kernel-__head_reference),gr18 - sethi.p %hi(__head_kernel_moved-__head_reference+__sdram_base),gr19 - setlo %lo(__head_kernel_moved-__head_reference+__sdram_base),gr19 - add gr18,gr26,gr18 - icpl gr18,gr0,#1 - jmpl @(gr18,gr0) - - .balign 32 -__head_move_kernel: - lddu @(gr16,gr5),gr10 - lddu @(gr16,gr5),gr12 - stdu.p gr10,@(gr17,gr5) - subicc gr4,#1,gr4,icc0 - stdu.p gr12,@(gr17,gr5) - bhi icc0,#0,__head_move_kernel - jmpl @(gr19,gr0) - - .balign 32 -__head_kernel_moved: - icul gr18 - icei @(gr0,gr0),1 - dcei @(gr0,gr0),1 - - LEDS 0x0006 - - # recalculate reference address - call 0f -0: movsg lr,gr26 - addi gr26,#__head_reference-0b,gr26 - - -############################################################################### -# -# rearrange the iomem map and set the protection registers -# -############################################################################### - -#ifdef CONFIG_MMU - LEDS 0x3301 - call __head_fr451_set_busctl - LEDS 0x3303 - call __head_fr451_survey_sdram - LEDS 0x3305 - call __head_fr451_set_protection - -#else - movsg psr,gr5 - srli gr5,#PSR_IMPLE_SHIFT,gr5 - subicc gr5,#PSR_IMPLE_FR551,gr0,icc0 - beq icc0,#0,__head_fr555_memmap - subicc gr5,#PSR_IMPLE_FR451,gr0,icc0 - beq icc0,#0,__head_fr451_memmap - - LEDS 0x3101 - call __head_fr401_set_busctl - LEDS 0x3103 - call __head_fr401_survey_sdram - LEDS 0x3105 - call __head_fr401_set_protection - bra __head_done_memmap - -__head_fr451_memmap: - LEDS 0x3301 - call __head_fr401_set_busctl - LEDS 0x3303 - call __head_fr401_survey_sdram - LEDS 0x3305 - call __head_fr451_set_protection - bra __head_done_memmap - -__head_fr555_memmap: - LEDS 0x3501 - call __head_fr555_set_busctl - LEDS 0x3503 - call __head_fr555_survey_sdram - LEDS 0x3505 - call __head_fr555_set_protection - -__head_done_memmap: -#endif - LEDS 0x0007 - -############################################################################### -# -# turn the data cache and MMU on -# - for the FR451 this'll mean that the window through which the kernel is -# viewed will change -# -############################################################################### - -#ifdef CONFIG_MMU -#define MMUMODE HSR0_EIMMU|HSR0_EDMMU|HSR0_EXMMU|HSR0_EDAT|HSR0_XEDAT -#else -#define MMUMODE HSR0_EIMMU|HSR0_EDMMU -#endif - - movsg hsr0,gr5 - - sethi.p %hi(MMUMODE),gr4 - setlo %lo(MMUMODE),gr4 - or gr4,gr5,gr5 - -#if defined(CONFIG_FRV_DEFL_CACHE_WTHRU) - sethi.p %hi(HSR0_DCE|HSR0_CBM_WRITE_THRU),gr4 - setlo %lo(HSR0_DCE|HSR0_CBM_WRITE_THRU),gr4 -#elif defined(CONFIG_FRV_DEFL_CACHE_WBACK) - sethi.p %hi(HSR0_DCE|HSR0_CBM_COPY_BACK),gr4 - setlo %lo(HSR0_DCE|HSR0_CBM_COPY_BACK),gr4 -#elif defined(CONFIG_FRV_DEFL_CACHE_WBEHIND) - sethi.p %hi(HSR0_DCE|HSR0_CBM_COPY_BACK),gr4 - setlo %lo(HSR0_DCE|HSR0_CBM_COPY_BACK),gr4 - - movsg psr,gr6 - srli gr6,#24,gr6 - cmpi gr6,#0x50,icc0 // FR451 - beq icc0,#0,0f - cmpi gr6,#0x40,icc0 // FR405 - bne icc0,#0,1f -0: - # turn off write-allocate - sethi.p %hi(HSR0_NWA),gr6 - setlo %lo(HSR0_NWA),gr6 - or gr4,gr6,gr4 -1: - -#else -#error No default cache configuration set -#endif - - or gr4,gr5,gr5 - movgs gr5,hsr0 - bar - - LEDS 0x0008 - - sethi.p %hi(__head_mmu_enabled),gr19 - setlo %lo(__head_mmu_enabled),gr19 - jmpl @(gr19,gr0) - -__head_mmu_enabled: - icei @(gr0,gr0),#1 - dcei @(gr0,gr0),#1 - - LEDS 0x0009 - -#ifdef CONFIG_MMU - call __head_fr451_finalise_protection -#endif - - LEDS 0x000a - -############################################################################### -# -# set up the runtime environment -# -############################################################################### - - # clear the BSS area - sethi.p %hi(__bss_start),gr4 - setlo %lo(__bss_start),gr4 - sethi.p %hi(_end),gr5 - setlo %lo(_end),gr5 - or.p gr0,gr0,gr18 - or gr0,gr0,gr19 - -0: - stdi gr18,@(gr4,#0) - stdi gr18,@(gr4,#8) - stdi gr18,@(gr4,#16) - stdi.p gr18,@(gr4,#24) - addi gr4,#24,gr4 - subcc gr5,gr4,gr0,icc0 - bhi icc0,#2,0b - - LEDS 0x000b - - # save the SDRAM details - sethi.p %hi(__sdram_old_base),gr4 - setlo %lo(__sdram_old_base),gr4 - st gr24,@(gr4,gr0) - - sethi.p %hi(__sdram_base),gr5 - setlo %lo(__sdram_base),gr5 - sethi.p %hi(memory_start),gr4 - setlo %lo(memory_start),gr4 - st gr5,@(gr4,gr0) - - add gr25,gr5,gr25 - sethi.p %hi(memory_end),gr4 - setlo %lo(memory_end),gr4 - st gr25,@(gr4,gr0) - - # point the TBR at the kernel trap table - sethi.p %hi(__entry_kerneltrap_table),gr4 - setlo %lo(__entry_kerneltrap_table),gr4 - movgs gr4,tbr - - # set up the exception frame for init - sethi.p %hi(__kernel_frame0_ptr),gr28 - setlo %lo(__kernel_frame0_ptr),gr28 - sethi.p %hi(_gp),gr16 - setlo %lo(_gp),gr16 - sethi.p %hi(__entry_usertrap_table),gr4 - setlo %lo(__entry_usertrap_table),gr4 - - lddi @(gr28,#0),gr28 ; load __frame & current - ldi.p @(gr29,#4),gr15 ; set current_thread - - or gr0,gr0,fp - or gr28,gr0,sp - - sti.p gr4,@(gr28,REG_TBR) - setlos #ISR_EDE|ISR_DTT_DIVBYZERO|ISR_EMAM_EXCEPTION,gr5 - movgs gr5,isr - - # turn on and off various CPU services - movsg psr,gr22 - sethi.p %hi(#PSR_EM|PSR_EF|PSR_CM|PSR_NEM),gr4 - setlo %lo(#PSR_EM|PSR_EF|PSR_CM|PSR_NEM),gr4 - or gr22,gr4,gr22 - movgs gr22,psr - - andi gr22,#~(PSR_PIL|PSR_PS|PSR_S),gr22 - ori gr22,#PSR_ET,gr22 - sti gr22,@(gr28,REG_PSR) - - -############################################################################### -# -# set up the registers and jump into the kernel -# -############################################################################### - - LEDS 0x000c - - sethi.p #0xe5e5,gr3 - setlo #0xe5e5,gr3 - or.p gr3,gr0,gr4 - or gr3,gr0,gr5 - or.p gr3,gr0,gr6 - or gr3,gr0,gr7 - or.p gr3,gr0,gr8 - or gr3,gr0,gr9 - or.p gr3,gr0,gr10 - or gr3,gr0,gr11 - or.p gr3,gr0,gr12 - or gr3,gr0,gr13 - or.p gr3,gr0,gr14 - or gr3,gr0,gr17 - or.p gr3,gr0,gr18 - or gr3,gr0,gr19 - or.p gr3,gr0,gr20 - or gr3,gr0,gr21 - or.p gr3,gr0,gr23 - or gr3,gr0,gr24 - or.p gr3,gr0,gr25 - or gr3,gr0,gr26 - or.p gr3,gr0,gr27 -# or gr3,gr0,gr30 - or gr3,gr0,gr31 - movgs gr0,lr - movgs gr0,lcr - movgs gr0,ccr - movgs gr0,cccr - - # initialise the virtual interrupt handling - subcc gr0,gr0,gr0,icc2 /* set Z, clear C */ - -#ifdef CONFIG_MMU - movgs gr3,scr2 - movgs gr3,scr3 -#endif - - LEDS 0x0fff - - # invoke the debugging stub if present - # - arch/frv/kernel/debug-stub.c will shift control directly to init/main.c - # (it will not return here) - break - .globl __debug_stub_init_break -__debug_stub_init_break: - - # however, if you need to use an ICE, and don't care about using any userspace - # debugging tools (such as the ptrace syscall), you can just step over the break - # above and get to the kernel this way - # look at arch/frv/kernel/debug-stub.c: debug_stub_init() to see what you've missed - call start_kernel - - .globl __head_end -__head_end: - .size _boot, .-_boot - - # provide a point for GDB to place a break - .section .text..start,"ax" - .globl _start - .balign 4 -_start: - call _boot - - .previous -############################################################################### -# -# split a tile off of the region defined by GR8-GR9 -# -# ENTRY: EXIT: -# GR4 - IAMPR value representing tile -# GR5 - DAMPR value representing tile -# GR6 - IAMLR value representing tile -# GR7 - DAMLR value representing tile -# GR8 region base pointer [saved] -# GR9 region top pointer updated to exclude new tile -# GR11 xAMLR mask [saved] -# GR25 SDRAM size [saved] -# GR30 LED address [saved] -# -# - GR8 and GR9 should be rounded up/down to the nearest megabyte before calling -# -############################################################################### - .globl __head_split_region - .type __head_split_region,@function -__head_split_region: - subcc.p gr9,gr8,gr4,icc0 - setlos #31,gr5 - scan.p gr4,gr0,gr6 - beq icc0,#0,__head_region_empty - sub.p gr5,gr6,gr6 ; bit number of highest set bit (1MB=>20) - setlos #1,gr4 - sll.p gr4,gr6,gr4 ; size of region (1 << bitno) - subi gr6,#17,gr6 ; 1MB => 0x03 - slli.p gr6,#4,gr6 ; 1MB => 0x30 - sub gr9,gr4,gr9 ; move uncovered top down - - or gr9,gr6,gr4 - ori gr4,#xAMPRx_S_USER|xAMPRx_C_CACHED|xAMPRx_V,gr4 - or.p gr4,gr0,gr5 - - and gr4,gr11,gr6 - and.p gr5,gr11,gr7 - bralr - -__head_region_empty: - or.p gr0,gr0,gr4 - or gr0,gr0,gr5 - or.p gr0,gr0,gr6 - or gr0,gr0,gr7 - bralr - .size __head_split_region, .-__head_split_region - -############################################################################### -# -# write the 32-bit hex number in GR8 to ttyS0 -# -############################################################################### -#if 0 - .globl __head_write_to_ttyS0 - .type __head_write_to_ttyS0,@function -__head_write_to_ttyS0: - sethi.p %hi(0xfeff9c00),gr31 - setlo %lo(0xfeff9c00),gr31 - setlos #8,gr20 - -0: ldubi @(gr31,#5*8),gr21 - andi gr21,#0x60,gr21 - subicc gr21,#0x60,gr21,icc0 - bne icc0,#0,0b - -1: srli gr8,#28,gr21 - slli gr8,#4,gr8 - - addi gr21,#'0',gr21 - subicc gr21,#'9',gr0,icc0 - bls icc0,#2,2f - addi gr21,#'A'-'0'-10,gr21 -2: - stbi gr21,@(gr31,#0*8) - subicc gr20,#1,gr20,icc0 - bhi icc0,#2,1b - - setlos #'\r',gr21 - stbi gr21,@(gr31,#0*8) - - setlos #'\n',gr21 - stbi gr21,@(gr31,#0*8) - -3: ldubi @(gr31,#5*8),gr21 - andi gr21,#0x60,gr21 - subicc gr21,#0x60,gr21,icc0 - bne icc0,#0,3b - bralr - - .size __head_write_to_ttyS0, .-__head_write_to_ttyS0 -#endif diff --git a/arch/frv/kernel/head.inc b/arch/frv/kernel/head.inc deleted file mode 100644 index bff66628b99a..000000000000 --- a/arch/frv/kernel/head.inc +++ /dev/null @@ -1,50 +0,0 @@ -/* head.inc: head common definitions -*- asm -*- - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - -#if defined(CONFIG_MB93090_MB00) -#define LED_ADDR (0x21200000+4) - -.macro LEDS val - sethi.p %hi(0xFFC00030),gr3 - setlo %lo(0xFFC00030),gr3 - lduh @(gr3,gr0),gr3 - andicc gr3,#0x100,gr0,icc0 - bne icc0,0,999f - - setlos #~\val,gr3 - st gr3,@(gr30,gr0) - membar - dcf @(gr30,gr0) - 999: -.endm - -#elif defined(CONFIG_MB93093_PDK) -#define LED_ADDR (0x20000023) - -.macro LEDS val - setlos #\val,gr3 - stb gr3,@(gr30,gr0) - membar -.endm - -#else -#define LED_ADDR 0 - -.macro LEDS val -.endm -#endif - -#ifdef CONFIG_MMU -__sdram_base = 0x00000000 /* base address to which SDRAM relocated */ -#else -__sdram_base = __page_offset /* base address to which SDRAM relocated */ -#endif diff --git a/arch/frv/kernel/irq-mb93091.c b/arch/frv/kernel/irq-mb93091.c deleted file mode 100644 index 091b2839be90..000000000000 --- a/arch/frv/kernel/irq-mb93091.c +++ /dev/null @@ -1,157 +0,0 @@ -/* irq-mb93091.c: MB93091 FPGA interrupt handling - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define __reg16(ADDR) (*(volatile unsigned short *)(ADDR)) - -#define __get_IMR() ({ __reg16(0xffc00004); }) -#define __set_IMR(M) do { __reg16(0xffc00004) = (M); wmb(); } while(0) -#define __get_IFR() ({ __reg16(0xffc0000c); }) -#define __clr_IFR(M) do { __reg16(0xffc0000c) = ~(M); wmb(); } while(0) - - -/* - * on-motherboard FPGA PIC operations - */ -static void frv_fpga_mask(struct irq_data *d) -{ - uint16_t imr = __get_IMR(); - - imr |= 1 << (d->irq - IRQ_BASE_FPGA); - - __set_IMR(imr); -} - -static void frv_fpga_ack(struct irq_data *d) -{ - __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA)); -} - -static void frv_fpga_mask_ack(struct irq_data *d) -{ - uint16_t imr = __get_IMR(); - - imr |= 1 << (d->irq - IRQ_BASE_FPGA); - __set_IMR(imr); - - __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA)); -} - -static void frv_fpga_unmask(struct irq_data *d) -{ - uint16_t imr = __get_IMR(); - - imr &= ~(1 << (d->irq - IRQ_BASE_FPGA)); - - __set_IMR(imr); -} - -static struct irq_chip frv_fpga_pic = { - .name = "mb93091", - .irq_ack = frv_fpga_ack, - .irq_mask = frv_fpga_mask, - .irq_mask_ack = frv_fpga_mask_ack, - .irq_unmask = frv_fpga_unmask, -}; - -/* - * FPGA PIC interrupt handler - */ -static irqreturn_t fpga_interrupt(int irq, void *_mask) -{ - uint16_t imr, mask = (unsigned long) _mask; - - imr = __get_IMR(); - mask = mask & ~imr & __get_IFR(); - - /* poll all the triggered IRQs */ - while (mask) { - int irq; - - asm("scan %1,gr0,%0" : "=r"(irq) : "r"(mask)); - irq = 31 - irq; - mask &= ~(1 << irq); - - generic_handle_irq(IRQ_BASE_FPGA + irq); - } - - return IRQ_HANDLED; -} - -/* - * define an interrupt action for each FPGA PIC output - * - use dev_id to indicate the FPGA PIC input to output mappings - */ -static struct irqaction fpga_irq[4] = { - [0] = { - .handler = fpga_interrupt, - .flags = IRQF_SHARED, - .name = "fpga.0", - .dev_id = (void *) 0x0028UL, - }, - [1] = { - .handler = fpga_interrupt, - .flags = IRQF_SHARED, - .name = "fpga.1", - .dev_id = (void *) 0x0050UL, - }, - [2] = { - .handler = fpga_interrupt, - .flags = IRQF_SHARED, - .name = "fpga.2", - .dev_id = (void *) 0x1c00UL, - }, - [3] = { - .handler = fpga_interrupt, - .flags = IRQF_SHARED, - .name = "fpga.3", - .dev_id = (void *) 0x6386UL, - } -}; - -/* - * initialise the motherboard FPGA's PIC - */ -void __init fpga_init(void) -{ - int irq; - - /* all PIC inputs are all set to be low-level driven, apart from the - * NMI button (15) which is fixed at falling-edge - */ - __set_IMR(0x7ffe); - __clr_IFR(0x0000); - - for (irq = IRQ_BASE_FPGA + 1; irq <= IRQ_BASE_FPGA + 14; irq++) - irq_set_chip_and_handler(irq, &frv_fpga_pic, handle_level_irq); - - irq_set_chip_and_handler(IRQ_FPGA_NMI, &frv_fpga_pic, handle_edge_irq); - - /* the FPGA drives the first four external IRQ inputs on the CPU PIC */ - setup_irq(IRQ_CPU_EXTERNAL0, &fpga_irq[0]); - setup_irq(IRQ_CPU_EXTERNAL1, &fpga_irq[1]); - setup_irq(IRQ_CPU_EXTERNAL2, &fpga_irq[2]); - setup_irq(IRQ_CPU_EXTERNAL3, &fpga_irq[3]); -} diff --git a/arch/frv/kernel/irq-mb93093.c b/arch/frv/kernel/irq-mb93093.c deleted file mode 100644 index 1f3015cf80f5..000000000000 --- a/arch/frv/kernel/irq-mb93093.c +++ /dev/null @@ -1,129 +0,0 @@ -/* irq-mb93093.c: MB93093 FPGA interrupt handling - * - * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define __reg16(ADDR) (*(volatile unsigned short *)(__region_CS2 + (ADDR))) - -#define __get_IMR() ({ __reg16(0x0a); }) -#define __set_IMR(M) do { __reg16(0x0a) = (M); wmb(); } while(0) -#define __get_IFR() ({ __reg16(0x02); }) -#define __clr_IFR(M) do { __reg16(0x02) = ~(M); wmb(); } while(0) - -/* - * off-CPU FPGA PIC operations - */ -static void frv_fpga_mask(struct irq_data *d) -{ - uint16_t imr = __get_IMR(); - - imr |= 1 << (d->irq - IRQ_BASE_FPGA); - __set_IMR(imr); -} - -static void frv_fpga_ack(struct irq_data *d) -{ - __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA)); -} - -static void frv_fpga_mask_ack(struct irq_data *d) -{ - uint16_t imr = __get_IMR(); - - imr |= 1 << (d->irq - IRQ_BASE_FPGA); - __set_IMR(imr); - - __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA)); -} - -static void frv_fpga_unmask(struct irq_data *d) -{ - uint16_t imr = __get_IMR(); - - imr &= ~(1 << (d->irq - IRQ_BASE_FPGA)); - - __set_IMR(imr); -} - -static struct irq_chip frv_fpga_pic = { - .name = "mb93093", - .irq_ack = frv_fpga_ack, - .irq_mask = frv_fpga_mask, - .irq_mask_ack = frv_fpga_mask_ack, - .irq_unmask = frv_fpga_unmask, -}; - -/* - * FPGA PIC interrupt handler - */ -static irqreturn_t fpga_interrupt(int irq, void *_mask) -{ - uint16_t imr, mask = (unsigned long) _mask; - - imr = __get_IMR(); - mask = mask & ~imr & __get_IFR(); - - /* poll all the triggered IRQs */ - while (mask) { - int irq; - - asm("scan %1,gr0,%0" : "=r"(irq) : "r"(mask)); - irq = 31 - irq; - mask &= ~(1 << irq); - - generic_handle_irq(IRQ_BASE_FPGA + irq); - } - - return IRQ_HANDLED; -} - -/* - * define an interrupt action for each FPGA PIC output - * - use dev_id to indicate the FPGA PIC input to output mappings - */ -static struct irqaction fpga_irq[1] = { - [0] = { - .handler = fpga_interrupt, - .name = "fpga.0", - .dev_id = (void *) 0x0700UL, - } -}; - -/* - * initialise the motherboard FPGA's PIC - */ -void __init fpga_init(void) -{ - int irq; - - /* all PIC inputs are all set to be edge triggered */ - __set_IMR(0x0700); - __clr_IFR(0x0000); - - for (irq = IRQ_BASE_FPGA + 8; irq <= IRQ_BASE_FPGA + 10; irq++) - irq_set_chip_and_handler(irq, &frv_fpga_pic, handle_edge_irq); - - /* the FPGA drives external IRQ input #2 on the CPU PIC */ - setup_irq(IRQ_CPU_EXTERNAL2, &fpga_irq[0]); -} diff --git a/arch/frv/kernel/irq-mb93493.c b/arch/frv/kernel/irq-mb93493.c deleted file mode 100644 index 8ca5aa4ff595..000000000000 --- a/arch/frv/kernel/irq-mb93493.c +++ /dev/null @@ -1,147 +0,0 @@ -/* irq-mb93493.c: MB93493 companion chip interrupt handler - * - * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#define IRQ_ROUTE_ONE(X) (X##_ROUTE << (X - IRQ_BASE_MB93493)) - -#define IRQ_ROUTING \ - (IRQ_ROUTE_ONE(IRQ_MB93493_VDC) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_VCC) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_AUDIO_OUT) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_I2C_0) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_I2C_1) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_USB) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_LOCAL_BUS) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_PCMCIA) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_GPIO) | \ - IRQ_ROUTE_ONE(IRQ_MB93493_AUDIO_IN)) - -/* - * daughter board PIC operations - * - there is no way to ACK interrupts in the MB93493 chip - */ -static void frv_mb93493_mask(struct irq_data *d) -{ - uint32_t iqsr; - volatile void *piqsr; - - if (IRQ_ROUTING & (1 << (d->irq - IRQ_BASE_MB93493))) - piqsr = __addr_MB93493_IQSR(1); - else - piqsr = __addr_MB93493_IQSR(0); - - iqsr = readl(piqsr); - iqsr &= ~(1 << (d->irq - IRQ_BASE_MB93493 + 16)); - writel(iqsr, piqsr); -} - -static void frv_mb93493_ack(struct irq_data *d) -{ -} - -static void frv_mb93493_unmask(struct irq_data *d) -{ - uint32_t iqsr; - volatile void *piqsr; - - if (IRQ_ROUTING & (1 << (d->irq - IRQ_BASE_MB93493))) - piqsr = __addr_MB93493_IQSR(1); - else - piqsr = __addr_MB93493_IQSR(0); - - iqsr = readl(piqsr); - iqsr |= 1 << (d->irq - IRQ_BASE_MB93493 + 16); - writel(iqsr, piqsr); -} - -static struct irq_chip frv_mb93493_pic = { - .name = "mb93093", - .irq_ack = frv_mb93493_ack, - .irq_mask = frv_mb93493_mask, - .irq_mask_ack = frv_mb93493_mask, - .irq_unmask = frv_mb93493_unmask, -}; - -/* - * MB93493 PIC interrupt handler - */ -static irqreturn_t mb93493_interrupt(int irq, void *_piqsr) -{ - volatile void *piqsr = _piqsr; - uint32_t iqsr; - - iqsr = readl(piqsr); - iqsr = iqsr & (iqsr >> 16) & 0xffff; - - /* poll all the triggered IRQs */ - while (iqsr) { - int irq; - - asm("scan %1,gr0,%0" : "=r"(irq) : "r"(iqsr)); - irq = 31 - irq; - iqsr &= ~(1 << irq); - - generic_handle_irq(IRQ_BASE_MB93493 + irq); - } - - return IRQ_HANDLED; -} - -/* - * define an interrupt action for each MB93493 PIC output - * - use dev_id to indicate the MB93493 PIC input to output mappings - */ -static struct irqaction mb93493_irq[2] = { - [0] = { - .handler = mb93493_interrupt, - .flags = IRQF_SHARED, - .name = "mb93493.0", - .dev_id = (void *) __addr_MB93493_IQSR(0), - }, - [1] = { - .handler = mb93493_interrupt, - .flags = IRQF_SHARED, - .name = "mb93493.1", - .dev_id = (void *) __addr_MB93493_IQSR(1), - } -}; - -/* - * initialise the motherboard MB93493's PIC - */ -void __init mb93493_init(void) -{ - int irq; - - for (irq = IRQ_BASE_MB93493 + 0; irq <= IRQ_BASE_MB93493 + 10; irq++) - irq_set_chip_and_handler(irq, &frv_mb93493_pic, - handle_edge_irq); - - /* the MB93493 drives external IRQ inputs on the CPU PIC */ - setup_irq(IRQ_CPU_MB93493_0, &mb93493_irq[0]); - setup_irq(IRQ_CPU_MB93493_1, &mb93493_irq[1]); -} diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c deleted file mode 100644 index 93513e4ccd2b..000000000000 --- a/arch/frv/kernel/irq.c +++ /dev/null @@ -1,159 +0,0 @@ -/* irq.c: FRV IRQ handling - * - * Copyright (C) 2003, 2004, 2006 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define set_IRR(N,A,B,C,D) __set_IRR(N, (A << 28) | (B << 24) | (C << 20) | (D << 16)) - -extern void __init fpga_init(void); -#ifdef CONFIG_FUJITSU_MB93493 -extern void __init mb93493_init(void); -#endif - -#define __reg16(ADDR) (*(volatile unsigned short *)(ADDR)) - -atomic_t irq_err_count; - -int arch_show_interrupts(struct seq_file *p, int prec) -{ - seq_printf(p, "%*s: ", prec, "ERR"); - seq_printf(p, "%10u\n", atomic_read(&irq_err_count)); - return 0; -} - -/* - * on-CPU PIC operations - */ -static void frv_cpupic_ack(struct irq_data *d) -{ - __clr_RC(d->irq); - __clr_IRL(); -} - -static void frv_cpupic_mask(struct irq_data *d) -{ - __set_MASK(d->irq); -} - -static void frv_cpupic_mask_ack(struct irq_data *d) -{ - __set_MASK(d->irq); - __clr_RC(d->irq); - __clr_IRL(); -} - -static void frv_cpupic_unmask(struct irq_data *d) -{ - __clr_MASK(d->irq); -} - -static struct irq_chip frv_cpu_pic = { - .name = "cpu", - .irq_ack = frv_cpupic_ack, - .irq_mask = frv_cpupic_mask, - .irq_mask_ack = frv_cpupic_mask_ack, - .irq_unmask = frv_cpupic_unmask, -}; - -/* - * handles all normal device IRQs - * - registers are referred to by the __frame variable (GR28) - * - IRQ distribution is complicated in this arch because of the many PICs, the - * way they work and the way they cascade - */ -asmlinkage void do_IRQ(void) -{ - irq_enter(); - generic_handle_irq(__get_IRL()); - irq_exit(); -} - -/* - * handles all NMIs when not co-opted by the debugger - * - registers are referred to by the __frame variable (GR28) - */ -asmlinkage void do_NMI(void) -{ -} - -/* - * initialise the interrupt system - */ -void __init init_IRQ(void) -{ - int level; - - for (level = 1; level <= 14; level++) - irq_set_chip_and_handler(level, &frv_cpu_pic, - handle_level_irq); - - irq_set_handler(IRQ_CPU_TIMER0, handle_edge_irq); - - /* set the trigger levels for internal interrupt sources - * - timers all falling-edge - * - ERR0 is rising-edge - * - all others are high-level - */ - __set_IITMR(0, 0x003f0000); /* DMA0-3, TIMER0-2 */ - __set_IITMR(1, 0x20000000); /* ERR0-1, UART0-1, DMA4-7 */ - - /* route internal interrupts */ - set_IRR(4, IRQ_DMA3_LEVEL, IRQ_DMA2_LEVEL, IRQ_DMA1_LEVEL, - IRQ_DMA0_LEVEL); - set_IRR(5, 0, IRQ_TIMER2_LEVEL, IRQ_TIMER1_LEVEL, IRQ_TIMER0_LEVEL); - set_IRR(6, IRQ_GDBSTUB_LEVEL, IRQ_GDBSTUB_LEVEL, - IRQ_UART1_LEVEL, IRQ_UART0_LEVEL); - set_IRR(7, IRQ_DMA7_LEVEL, IRQ_DMA6_LEVEL, IRQ_DMA5_LEVEL, - IRQ_DMA4_LEVEL); - - /* route external interrupts */ - set_IRR(2, IRQ_XIRQ7_LEVEL, IRQ_XIRQ6_LEVEL, IRQ_XIRQ5_LEVEL, - IRQ_XIRQ4_LEVEL); - set_IRR(3, IRQ_XIRQ3_LEVEL, IRQ_XIRQ2_LEVEL, IRQ_XIRQ1_LEVEL, - IRQ_XIRQ0_LEVEL); - -#if defined(CONFIG_MB93091_VDK) - __set_TM1(0x55550000); /* XIRQ7-0 all active low */ -#elif defined(CONFIG_MB93093_PDK) - __set_TM1(0x15550000); /* XIRQ7 active high, 6-0 all active low */ -#else -#error dont know external IRQ trigger levels for this setup -#endif - - fpga_init(); -#ifdef CONFIG_FUJITSU_MB93493 - mb93493_init(); -#endif -} diff --git a/arch/frv/kernel/local.h b/arch/frv/kernel/local.h deleted file mode 100644 index 76606d13b1aa..000000000000 --- a/arch/frv/kernel/local.h +++ /dev/null @@ -1,59 +0,0 @@ -/* local.h: local definitions - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _FRV_LOCAL_H -#define _FRV_LOCAL_H - -#include - -#ifndef __ASSEMBLY__ - -/* dma.c */ -extern unsigned long frv_dma_inprogress; - -extern void frv_dma_pause_all(void); -extern void frv_dma_resume_all(void); - -/* sleep.S */ -extern asmlinkage void frv_cpu_suspend(unsigned long); -extern asmlinkage void frv_cpu_core_sleep(void); - -/* setup.c */ -extern unsigned long __nongprelbss pdm_suspend_mode; -extern void determine_clocks(int verbose); -extern int __nongprelbss clock_p0_current; -extern int __nongprelbss clock_cm_current; -extern int __nongprelbss clock_cmode_current; - -#ifdef CONFIG_PM -extern int __nongprelbss clock_cmodes_permitted; -extern unsigned long __nongprelbss clock_bits_settable; -#define CLOCK_BIT_CM 0x0000000f -#define CLOCK_BIT_CM_H 0x00000001 /* CLKC.CM can be set to 0 */ -#define CLOCK_BIT_CM_M 0x00000002 /* CLKC.CM can be set to 1 */ -#define CLOCK_BIT_CM_L 0x00000004 /* CLKC.CM can be set to 2 */ -#define CLOCK_BIT_P0 0x00000010 /* CLKC.P0 can be changed */ -#define CLOCK_BIT_CMODE 0x00000020 /* CLKC.CMODE can be changed */ - -extern void (*__power_switch_wake_setup)(void); -extern int (*__power_switch_wake_check)(void); -extern void (*__power_switch_wake_cleanup)(void); -#endif - -/* time.c */ -extern void time_divisor_init(void); - -/* cmode.S */ -extern asmlinkage void frv_change_cmode(int); - - -#endif /* __ASSEMBLY__ */ -#endif /* _FRV_LOCAL_H */ diff --git a/arch/frv/kernel/local64.h b/arch/frv/kernel/local64.h deleted file mode 100644 index 36c93b5cc239..000000000000 --- a/arch/frv/kernel/local64.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/frv/kernel/module.c b/arch/frv/kernel/module.c deleted file mode 100644 index 9d9835f1fe2b..000000000000 --- a/arch/frv/kernel/module.c +++ /dev/null @@ -1,27 +0,0 @@ -/* module.c: FRV specific module loading bits - * - * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from arch/i386/kernel/module.c, Copyright (C) 2001 Rusty Russell. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include -#include -#include -#include - -#if 0 -#define DEBUGP printk -#else -#define DEBUGP(fmt...) -#endif - -/* TODO: At least one of apply_relocate or apply_relocate_add must be - * implemented in order to get working module support. - */ diff --git a/arch/frv/kernel/pm-mb93093.c b/arch/frv/kernel/pm-mb93093.c deleted file mode 100644 index 8358e34a3fad..000000000000 --- a/arch/frv/kernel/pm-mb93093.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * FR-V MB93093 Power Management Routines - * - * Copyright (c) 2004 Red Hat, Inc. - * - * Written by: msalter@redhat.com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "local.h" - -static unsigned long imask; -/* - * Setup interrupt masks, etc to enable wakeup by power switch - */ -static void mb93093_power_switch_setup(void) -{ - /* mask all but FPGA interrupt sources. */ - imask = *(volatile unsigned long *)0xfeff9820; - *(volatile unsigned long *)0xfeff9820 = ~(1 << (IRQ_XIRQ2_LEVEL + 16)) & 0xfffe0000; -} - -/* - * Cleanup interrupt masks, etc after wakeup by power switch - */ -static void mb93093_power_switch_cleanup(void) -{ - *(volatile unsigned long *)0xfeff9820 = imask; -} - -/* - * Return non-zero if wakeup irq was caused by power switch - */ -static int mb93093_power_switch_check(void) -{ - return 1; -} - -/* - * Initialize power interface - */ -static int __init mb93093_pm_init(void) -{ - __power_switch_wake_setup = mb93093_power_switch_setup; - __power_switch_wake_check = mb93093_power_switch_check; - __power_switch_wake_cleanup = mb93093_power_switch_cleanup; - return 0; -} - -__initcall(mb93093_pm_init); - diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c deleted file mode 100644 index 051ccecbf7f1..000000000000 --- a/arch/frv/kernel/pm.c +++ /dev/null @@ -1,352 +0,0 @@ -/* - * FR-V Power Management Routines - * - * Copyright (c) 2004 Red Hat, Inc. - * - * Based on SA1100 version: - * Copyright (c) 2001 Cliff Brake - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "local.h" - -/* - * Debug macros - */ -#define DEBUG - -int pm_do_suspend(void) -{ - local_irq_disable(); - - __set_LEDS(0xb1); - - /* go zzz */ - frv_cpu_suspend(pdm_suspend_mode); - - __set_LEDS(0xb2); - - local_irq_enable(); - - return 0; -} - -static unsigned long __irq_mask; - -/* - * Setup interrupt masks, etc to enable wakeup by power switch - */ -static void __default_power_switch_setup(void) -{ - /* default is to mask all interrupt sources. */ - __irq_mask = *(unsigned long *)0xfeff9820; - *(unsigned long *)0xfeff9820 = 0xfffe0000; -} - -/* - * Cleanup interrupt masks, etc after wakeup by power switch - */ -static void __default_power_switch_cleanup(void) -{ - *(unsigned long *)0xfeff9820 = __irq_mask; -} - -/* - * Return non-zero if wakeup irq was caused by power switch - */ -static int __default_power_switch_check(void) -{ - return 1; -} - -void (*__power_switch_wake_setup)(void) = __default_power_switch_setup; -int (*__power_switch_wake_check)(void) = __default_power_switch_check; -void (*__power_switch_wake_cleanup)(void) = __default_power_switch_cleanup; - -int pm_do_bus_sleep(void) -{ - local_irq_disable(); - - /* - * Here is where we need some platform-dependent setup - * of the interrupt state so that appropriate wakeup - * sources are allowed and all others are masked. - */ - __power_switch_wake_setup(); - - __set_LEDS(0xa1); - - /* go zzz - * - * This is in a loop in case power switch shares an irq with other - * devices. The wake_check() tells us if we need to finish waking - * or go back to sleep. - */ - do { - frv_cpu_suspend(HSR0_PDM_BUS_SLEEP); - } while (__power_switch_wake_check && !__power_switch_wake_check()); - - __set_LEDS(0xa2); - - /* - * Here is where we need some platform-dependent restore - * of the interrupt state prior to being called. - */ - __power_switch_wake_cleanup(); - - local_irq_enable(); - - return 0; -} - -unsigned long sleep_phys_sp(void *sp) -{ - return virt_to_phys(sp); -} - -#ifdef CONFIG_SYSCTL -/* - * Use a temporary sysctl number. Horrid, but will be cleaned up in 2.6 - * when all the PM interfaces exist nicely. - */ -#define CTL_PM_SUSPEND 1 -#define CTL_PM_CMODE 2 -#define CTL_PM_P0 4 -#define CTL_PM_CM 5 - -static int user_atoi(char __user *ubuf, size_t len) -{ - char buf[16]; - unsigned long ret; - - if (len > 15) - return -EINVAL; - - if (copy_from_user(buf, ubuf, len)) - return -EFAULT; - - buf[len] = 0; - ret = simple_strtoul(buf, NULL, 0); - if (ret > INT_MAX) - return -ERANGE; - return ret; -} - -/* - * Send us to sleep. - */ -static int sysctl_pm_do_suspend(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *fpos) -{ - int mode; - - if (*lenp <= 0) - return -EIO; - - mode = user_atoi(buffer, *lenp); - switch (mode) { - case 1: - return pm_do_suspend(); - - case 5: - return pm_do_bus_sleep(); - - default: - return -EINVAL; - } -} - -static int try_set_cmode(int new_cmode) -{ - if (new_cmode > 15) - return -EINVAL; - if (!(clock_cmodes_permitted & (1< 1) - return -EINVAL; - - local_irq_save(flags); - __set_PSR(flags & ~PSR_ET); - - frv_dma_pause_all(); - - clkc = __get_CLKC(); - if (new_p0) - clkc |= CLKC_P0; - else - clkc &= ~CLKC_P0; - __set_CLKC(clkc); - - determine_clocks(0); - time_divisor_init(); - -#ifdef DEBUG - determine_clocks(1); -#endif - frv_dma_resume_all(); - local_irq_restore(flags); - return 0; -} - -static int try_set_cm(int new_cm) -{ - unsigned long flags, clkc; - - if (new_cm < 0 || new_cm > 1) - return -EINVAL; - - local_irq_save(flags); - __set_PSR(flags & ~PSR_ET); - - frv_dma_pause_all(); - - clkc = __get_CLKC(); - clkc &= ~CLKC_CM; - clkc |= new_cm; - __set_CLKC(clkc); - - determine_clocks(0); - time_divisor_init(); - -#if 1 //def DEBUG - determine_clocks(1); -#endif - - frv_dma_resume_all(); - local_irq_restore(flags); - return 0; -} - -static int p0_procctl(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *fpos) -{ - int new_p0; - - if (!write) - return proc_dointvec(ctl, write, buffer, lenp, fpos); - - new_p0 = user_atoi(buffer, *lenp); - - return try_set_p0(new_p0)?:*lenp; -} - -static int cm_procctl(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *fpos) -{ - int new_cm; - - if (!write) - return proc_dointvec(ctl, write, buffer, lenp, fpos); - - new_cm = user_atoi(buffer, *lenp); - - return try_set_cm(new_cm)?:*lenp; -} - -static struct ctl_table pm_table[] = -{ - { - .procname = "suspend", - .data = NULL, - .maxlen = 0, - .mode = 0200, - .proc_handler = sysctl_pm_do_suspend, - }, - { - .procname = "cmode", - .data = &clock_cmode_current, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = cmode_procctl, - }, - { - .procname = "p0", - .data = &clock_p0_current, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = p0_procctl, - }, - { - .procname = "cm", - .data = &clock_cm_current, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = cm_procctl, - }, - { } -}; - -static struct ctl_table pm_dir_table[] = -{ - { - .procname = "pm", - .mode = 0555, - .child = pm_table, - }, - { } -}; - -/* - * Initialize power interface - */ -static int __init pm_init(void) -{ - register_sysctl_table(pm_dir_table); - return 0; -} - -__initcall(pm_init); - -#endif diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c deleted file mode 100644 index a957b374e3a6..000000000000 --- a/arch/frv/kernel/process.c +++ /dev/null @@ -1,275 +0,0 @@ -/* process.c: FRV specific parts of process handling - * - * Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from arch/m68k/kernel/process.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "local.h" - -asmlinkage void ret_from_fork(void); -asmlinkage void ret_from_kernel_thread(void); - -#include - -void (*pm_power_off)(void); -EXPORT_SYMBOL(pm_power_off); - -static void core_sleep_idle(void) -{ -#ifdef LED_DEBUG_SLEEP - /* Show that we're sleeping... */ - __set_LEDS(0x55aa); -#endif - frv_cpu_core_sleep(); -#ifdef LED_DEBUG_SLEEP - /* ... and that we woke up */ - __set_LEDS(0); -#endif - mb(); -} - -void arch_cpu_idle(void) -{ - if (!frv_dma_inprogress) - core_sleep_idle(); - else - local_irq_enable(); -} - -void machine_restart(char * __unused) -{ - unsigned long reset_addr; -#ifdef CONFIG_GDBSTUB - gdbstub_exit(0); -#endif - - if (PSR_IMPLE(__get_PSR()) == PSR_IMPLE_FR551) - reset_addr = 0xfefff500; - else - reset_addr = 0xfeff0500; - - /* Software reset. */ - asm volatile(" dcef @(gr0,gr0),1 ! membar !" - " sti %1,@(%0,0) !" - " nop ! nop ! nop ! nop ! nop ! " - " nop ! nop ! nop ! nop ! nop ! " - " nop ! nop ! nop ! nop ! nop ! " - " nop ! nop ! nop ! nop ! nop ! " - : : "r" (reset_addr), "r" (1) ); - - for (;;) - ; -} - -void machine_halt(void) -{ -#ifdef CONFIG_GDBSTUB - gdbstub_exit(0); -#endif - - for (;;); -} - -void machine_power_off(void) -{ -#ifdef CONFIG_GDBSTUB - gdbstub_exit(0); -#endif - - for (;;); -} - -void flush_thread(void) -{ - /* nothing */ -} - -inline unsigned long user_stack(const struct pt_regs *regs) -{ - while (regs->next_frame) - regs = regs->next_frame; - return user_mode(regs) ? regs->sp : 0; -} - -/* - * set up the kernel stack and exception frames for a new process - */ -int copy_thread(unsigned long clone_flags, - unsigned long usp, unsigned long arg, - struct task_struct *p) -{ - struct pt_regs *childregs; - - childregs = (struct pt_regs *) - (task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE); - - /* set up the userspace frame (the only place that the USP is stored) */ - *childregs = *current_pt_regs(); - - p->thread.frame = childregs; - p->thread.curr = p; - p->thread.sp = (unsigned long) childregs; - p->thread.fp = 0; - p->thread.lr = 0; - p->thread.frame0 = childregs; - - if (unlikely(p->flags & PF_KTHREAD)) { - childregs->gr9 = usp; /* function */ - childregs->gr8 = arg; - p->thread.pc = (unsigned long) ret_from_kernel_thread; - save_user_regs(p->thread.user); - return 0; - } - if (usp) - childregs->sp = usp; - childregs->next_frame = NULL; - - p->thread.pc = (unsigned long) ret_from_fork; - - /* the new TLS pointer is passed in as arg #5 to sys_clone() */ - if (clone_flags & CLONE_SETTLS) - childregs->gr29 = childregs->gr12; - - save_user_regs(p->thread.user); - - return 0; -} /* end copy_thread() */ - -unsigned long get_wchan(struct task_struct *p) -{ - struct pt_regs *regs0; - unsigned long fp, pc; - unsigned long stack_limit; - int count = 0; - if (!p || p == current || p->state == TASK_RUNNING) - return 0; - - stack_limit = (unsigned long) (p + 1); - fp = p->thread.fp; - regs0 = p->thread.frame0; - - do { - if (fp < stack_limit || fp >= (unsigned long) regs0 || fp & 3) - return 0; - - pc = ((unsigned long *) fp)[2]; - - /* FIXME: This depends on the order of these functions. */ - if (!in_sched_functions(pc)) - return pc; - - fp = *(unsigned long *) fp; - } while (count++ < 16); - - return 0; -} - -int elf_check_arch(const struct elf32_hdr *hdr) -{ - unsigned long hsr0 = __get_HSR(0); - unsigned long psr = __get_PSR(); - - if (hdr->e_machine != EM_FRV) - return 0; - - switch (hdr->e_flags & EF_FRV_GPR_MASK) { - case EF_FRV_GPR64: - if ((hsr0 & HSR0_GRN) == HSR0_GRN_32) - return 0; - case EF_FRV_GPR32: - case 0: - break; - default: - return 0; - } - - switch (hdr->e_flags & EF_FRV_FPR_MASK) { - case EF_FRV_FPR64: - if ((hsr0 & HSR0_FRN) == HSR0_FRN_32) - return 0; - case EF_FRV_FPR32: - case EF_FRV_FPR_NONE: - case 0: - break; - default: - return 0; - } - - if ((hdr->e_flags & EF_FRV_MULADD) == EF_FRV_MULADD) - if (PSR_IMPLE(psr) != PSR_IMPLE_FR405 && - PSR_IMPLE(psr) != PSR_IMPLE_FR451) - return 0; - - switch (hdr->e_flags & EF_FRV_CPU_MASK) { - case EF_FRV_CPU_GENERIC: - break; - case EF_FRV_CPU_FR300: - case EF_FRV_CPU_SIMPLE: - case EF_FRV_CPU_TOMCAT: - default: - return 0; - case EF_FRV_CPU_FR400: - if (PSR_IMPLE(psr) != PSR_IMPLE_FR401 && - PSR_IMPLE(psr) != PSR_IMPLE_FR405 && - PSR_IMPLE(psr) != PSR_IMPLE_FR451 && - PSR_IMPLE(psr) != PSR_IMPLE_FR551) - return 0; - break; - case EF_FRV_CPU_FR450: - if (PSR_IMPLE(psr) != PSR_IMPLE_FR451) - return 0; - break; - case EF_FRV_CPU_FR500: - if (PSR_IMPLE(psr) != PSR_IMPLE_FR501) - return 0; - break; - case EF_FRV_CPU_FR550: - if (PSR_IMPLE(psr) != PSR_IMPLE_FR551) - return 0; - break; - } - - return 1; -} - -int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs) -{ - memcpy(fpregs, - ¤t->thread.user->f, - sizeof(current->thread.user->f)); - return 1; -} diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c deleted file mode 100644 index 49768401ce0f..000000000000 --- a/arch/frv/kernel/ptrace.c +++ /dev/null @@ -1,377 +0,0 @@ -/* ptrace.c: FRV specific parts of process tracing - * - * Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from arch/m68k/kernel/ptrace.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* - * does not yet catch signals sent when the child dies. - * in exit.c or in signal.c. - */ - -/* - * retrieve the contents of FRV userspace general registers - */ -static int genregs_get(struct task_struct *target, - const struct user_regset *regset, - unsigned int pos, unsigned int count, - void *kbuf, void __user *ubuf) -{ - const struct user_int_regs *iregs = &target->thread.user->i; - int ret; - - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, - iregs, 0, sizeof(*iregs)); - if (ret < 0) - return ret; - - return user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf, - sizeof(*iregs), -1); -} - -/* - * update the contents of the FRV userspace general registers - */ -static int genregs_set(struct task_struct *target, - const struct user_regset *regset, - unsigned int pos, unsigned int count, - const void *kbuf, const void __user *ubuf) -{ - struct user_int_regs *iregs = &target->thread.user->i; - unsigned int offs_gr0, offs_gr1; - int ret; - - /* not allowed to set PSR or __status */ - if (pos < offsetof(struct user_int_regs, psr) + sizeof(long) && - pos + count > offsetof(struct user_int_regs, psr)) - return -EIO; - - if (pos < offsetof(struct user_int_regs, __status) + sizeof(long) && - pos + count > offsetof(struct user_int_regs, __status)) - return -EIO; - - /* set the control regs */ - offs_gr0 = offsetof(struct user_int_regs, gr[0]); - offs_gr1 = offsetof(struct user_int_regs, gr[1]); - ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, - iregs, 0, offs_gr0); - if (ret < 0) - return ret; - - /* skip GR0/TBR */ - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - offs_gr0, offs_gr1); - if (ret < 0) - return ret; - - /* set the general regs */ - ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, - &iregs->gr[1], offs_gr1, sizeof(*iregs)); - if (ret < 0) - return ret; - - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - sizeof(*iregs), -1); -} - -/* - * retrieve the contents of FRV userspace FP/Media registers - */ -static int fpmregs_get(struct task_struct *target, - const struct user_regset *regset, - unsigned int pos, unsigned int count, - void *kbuf, void __user *ubuf) -{ - const struct user_fpmedia_regs *fpregs = &target->thread.user->f; - int ret; - - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, - fpregs, 0, sizeof(*fpregs)); - if (ret < 0) - return ret; - - return user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf, - sizeof(*fpregs), -1); -} - -/* - * update the contents of the FRV userspace FP/Media registers - */ -static int fpmregs_set(struct task_struct *target, - const struct user_regset *regset, - unsigned int pos, unsigned int count, - const void *kbuf, const void __user *ubuf) -{ - struct user_fpmedia_regs *fpregs = &target->thread.user->f; - int ret; - - ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, - fpregs, 0, sizeof(*fpregs)); - if (ret < 0) - return ret; - - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - sizeof(*fpregs), -1); -} - -/* - * determine if the FP/Media registers have actually been used - */ -static int fpmregs_active(struct task_struct *target, - const struct user_regset *regset) -{ - return tsk_used_math(target) ? regset->n : 0; -} - -/* - * Define the register sets available on the FRV under Linux - */ -enum frv_regset { - REGSET_GENERAL, - REGSET_FPMEDIA, -}; - -static const struct user_regset frv_regsets[] = { - /* - * General register format is: - * PSR, ISR, CCR, CCCR, LR, LCR, PC, (STATUS), SYSCALLNO, ORIG_G8 - * GNER0-1, IACC0, TBR, GR1-63 - */ - [REGSET_GENERAL] = { - .core_note_type = NT_PRSTATUS, - .n = ELF_NGREG, - .size = sizeof(long), - .align = sizeof(long), - .get = genregs_get, - .set = genregs_set, - }, - /* - * FPU/Media register format is: - * FR0-63, FNER0-1, MSR0-1, ACC0-7, ACCG0-8, FSR - */ - [REGSET_FPMEDIA] = { - .core_note_type = NT_PRFPREG, - .n = sizeof(struct user_fpmedia_regs) / sizeof(long), - .size = sizeof(long), - .align = sizeof(long), - .get = fpmregs_get, - .set = fpmregs_set, - .active = fpmregs_active, - }, -}; - -static const struct user_regset_view user_frv_native_view = { - .name = "frv", - .e_machine = EM_FRV, - .regsets = frv_regsets, - .n = ARRAY_SIZE(frv_regsets), -}; - -const struct user_regset_view *task_user_regset_view(struct task_struct *task) -{ - return &user_frv_native_view; -} - -/* - * Get contents of register REGNO in task TASK. - */ -static inline long get_reg(struct task_struct *task, int regno) -{ - struct user_context *user = task->thread.user; - - if (regno < 0 || regno >= PT__END) - return 0; - - return ((unsigned long *) user)[regno]; -} - -/* - * Write contents of register REGNO in task TASK. - */ -static inline int put_reg(struct task_struct *task, int regno, - unsigned long data) -{ - struct user_context *user = task->thread.user; - - if (regno < 0 || regno >= PT__END) - return -EIO; - - switch (regno) { - case PT_GR(0): - return 0; - case PT_PSR: - case PT__STATUS: - return -EIO; - default: - ((unsigned long *) user)[regno] = data; - return 0; - } -} - -/* - * Called by kernel/ptrace.c when detaching.. - * - * Control h/w single stepping - */ -void user_enable_single_step(struct task_struct *child) -{ - child->thread.frame0->__status |= REG__STATUS_STEP; -} - -void user_disable_single_step(struct task_struct *child) -{ - child->thread.frame0->__status &= ~REG__STATUS_STEP; -} - -void ptrace_disable(struct task_struct *child) -{ - user_disable_single_step(child); -} - -long arch_ptrace(struct task_struct *child, long request, - unsigned long addr, unsigned long data) -{ - unsigned long tmp; - int ret; - int regno = addr >> 2; - unsigned long __user *datap = (unsigned long __user *) data; - - switch (request) { - /* read the word at location addr in the USER area. */ - case PTRACE_PEEKUSR: { - tmp = 0; - ret = -EIO; - if (addr & 3) - break; - - ret = 0; - switch (regno) { - case 0 ... PT__END - 1: - tmp = get_reg(child, regno); - break; - - case PT__END + 0: - tmp = child->mm->end_code - child->mm->start_code; - break; - - case PT__END + 1: - tmp = child->mm->end_data - child->mm->start_data; - break; - - case PT__END + 2: - tmp = child->mm->start_stack - child->mm->start_brk; - break; - - case PT__END + 3: - tmp = child->mm->start_code; - break; - - case PT__END + 4: - tmp = child->mm->start_stack; - break; - - default: - ret = -EIO; - break; - } - - if (ret == 0) - ret = put_user(tmp, datap); - break; - } - - case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ - ret = -EIO; - if (addr & 3) - break; - - switch (regno) { - case 0 ... PT__END - 1: - ret = put_reg(child, regno, data); - break; - } - break; - - case PTRACE_GETREGS: /* Get all integer regs from the child. */ - return copy_regset_to_user(child, &user_frv_native_view, - REGSET_GENERAL, - 0, sizeof(child->thread.user->i), - datap); - - case PTRACE_SETREGS: /* Set all integer regs in the child. */ - return copy_regset_from_user(child, &user_frv_native_view, - REGSET_GENERAL, - 0, sizeof(child->thread.user->i), - datap); - - case PTRACE_GETFPREGS: /* Get the child FP/Media state. */ - return copy_regset_to_user(child, &user_frv_native_view, - REGSET_FPMEDIA, - 0, sizeof(child->thread.user->f), - datap); - - case PTRACE_SETFPREGS: /* Set the child FP/Media state. */ - return copy_regset_from_user(child, &user_frv_native_view, - REGSET_FPMEDIA, - 0, sizeof(child->thread.user->f), - datap); - - default: - ret = ptrace_request(child, request, addr, data); - break; - } - return ret; -} - -/* - * handle tracing of system call entry - * - return the revised system call number or ULONG_MAX to cause ENOSYS - */ -asmlinkage unsigned long syscall_trace_entry(void) -{ - __frame->__status |= REG__STATUS_SYSC_ENTRY; - if (tracehook_report_syscall_entry(__frame)) { - /* tracing decided this syscall should not happen, so - * We'll return a bogus call number to get an ENOSYS - * error, but leave the original number in - * __frame->syscallno - */ - return ULONG_MAX; - } - - return __frame->syscallno; -} - -/* - * handle tracing of system call exit - */ -asmlinkage void syscall_trace_exit(void) -{ - __frame->__status |= REG__STATUS_SYSC_EXIT; - tracehook_report_syscall_exit(__frame, 0); -} diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c deleted file mode 100644 index 9f4a9a607dbe..000000000000 --- a/arch/frv/kernel/setup.c +++ /dev/null @@ -1,1178 +0,0 @@ -/* setup.c: FRV specific setup - * - * Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from arch/m68k/kernel/setup.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif - -#include "local.h" - -#ifdef CONFIG_MB93090_MB00 -static void __init mb93090_display(void); -#endif -#ifdef CONFIG_MMU -static void __init setup_linux_memory(void); -#else -static void __init setup_uclinux_memory(void); -#endif - -#ifdef CONFIG_MB93090_MB00 -static char __initdata mb93090_banner[] = "FJ/RH FR-V Linux"; -static char __initdata mb93090_version[] = UTS_RELEASE; - -int __nongprelbss mb93090_mb00_detected; -#endif - -const char __frv_unknown_system[] = "unknown"; -const char __frv_mb93091_cb10[] = "mb93091-cb10"; -const char __frv_mb93091_cb11[] = "mb93091-cb11"; -const char __frv_mb93091_cb30[] = "mb93091-cb30"; -const char __frv_mb93091_cb41[] = "mb93091-cb41"; -const char __frv_mb93091_cb60[] = "mb93091-cb60"; -const char __frv_mb93091_cb70[] = "mb93091-cb70"; -const char __frv_mb93091_cb451[] = "mb93091-cb451"; -const char __frv_mb93090_mb00[] = "mb93090-mb00"; - -const char __frv_mb93493[] = "mb93493"; - -const char __frv_mb93093[] = "mb93093"; - -static const char *__nongprelbss cpu_series; -static const char *__nongprelbss cpu_core; -static const char *__nongprelbss cpu_silicon; -static const char *__nongprelbss cpu_mmu; -static const char *__nongprelbss cpu_system; -static const char *__nongprelbss cpu_board1; -static const char *__nongprelbss cpu_board2; - -static unsigned long __nongprelbss cpu_psr_all; -static unsigned long __nongprelbss cpu_hsr0_all; - -unsigned long __nongprelbss pdm_suspend_mode; - -unsigned long __nongprelbss rom_length; -unsigned long __nongprelbss memory_start; -unsigned long __nongprelbss memory_end; - -unsigned long __nongprelbss dma_coherent_mem_start; -unsigned long __nongprelbss dma_coherent_mem_end; - -unsigned long __initdata __sdram_old_base; -unsigned long __initdata num_mappedpages; - -char __initdata command_line[COMMAND_LINE_SIZE]; -char __initdata redboot_command_line[COMMAND_LINE_SIZE]; - -#ifdef CONFIG_PM -#define __pminit -#define __pminitdata -#define __pminitconst -#else -#define __pminit __init -#define __pminitdata __initdata -#define __pminitconst __initconst -#endif - -struct clock_cmode { - uint8_t xbus, sdram, corebus, core, dsu; -}; - -#define _frac(N,D) ((N)<<4 | (D)) -#define _x0_16 _frac(1,6) -#define _x0_25 _frac(1,4) -#define _x0_33 _frac(1,3) -#define _x0_375 _frac(3,8) -#define _x0_5 _frac(1,2) -#define _x0_66 _frac(2,3) -#define _x0_75 _frac(3,4) -#define _x1 _frac(1,1) -#define _x1_5 _frac(3,2) -#define _x2 _frac(2,1) -#define _x3 _frac(3,1) -#define _x4 _frac(4,1) -#define _x4_5 _frac(9,2) -#define _x6 _frac(6,1) -#define _x8 _frac(8,1) -#define _x9 _frac(9,1) - -int __nongprelbss clock_p0_current; -int __nongprelbss clock_cm_current; -int __nongprelbss clock_cmode_current; -#ifdef CONFIG_PM -int __nongprelbss clock_cmodes_permitted; -unsigned long __nongprelbss clock_bits_settable; -#endif - -static struct clock_cmode __pminitdata undef_clock_cmode = { _x1, _x1, _x1, _x1, _x1 }; - -static struct clock_cmode __pminitdata clock_cmodes_fr401_fr403[16] = { - [4] = { _x1, _x1, _x2, _x2, _x0_25 }, - [5] = { _x1, _x2, _x4, _x4, _x0_5 }, - [8] = { _x1, _x1, _x1, _x2, _x0_25 }, - [9] = { _x1, _x2, _x2, _x4, _x0_5 }, - [11] = { _x1, _x4, _x4, _x8, _x1 }, - [12] = { _x1, _x1, _x2, _x4, _x0_5 }, - [13] = { _x1, _x2, _x4, _x8, _x1 }, -}; - -static struct clock_cmode __pminitdata clock_cmodes_fr405[16] = { - [0] = { _x1, _x1, _x1, _x1, _x0_5 }, - [1] = { _x1, _x1, _x1, _x3, _x0_25 }, - [2] = { _x1, _x1, _x2, _x6, _x0_5 }, - [3] = { _x1, _x2, _x2, _x6, _x0_5 }, - [4] = { _x1, _x1, _x2, _x2, _x0_16 }, - [8] = { _x1, _x1, _x1, _x2, _x0_16 }, - [9] = { _x1, _x2, _x2, _x4, _x0_33 }, - [12] = { _x1, _x1, _x2, _x4, _x0_33 }, - [14] = { _x1, _x3, _x3, _x9, _x0_75 }, - [15] = { _x1, _x1_5, _x1_5, _x4_5, _x0_375 }, - -#define CLOCK_CMODES_PERMITTED_FR405 0xd31f -}; - -static struct clock_cmode __pminitdata clock_cmodes_fr555[16] = { - [0] = { _x1, _x2, _x2, _x4, _x0_33 }, - [1] = { _x1, _x3, _x3, _x6, _x0_5 }, - [2] = { _x1, _x2, _x4, _x8, _x0_66 }, - [3] = { _x1, _x1_5, _x3, _x6, _x0_5 }, - [4] = { _x1, _x3, _x3, _x9, _x0_75 }, - [5] = { _x1, _x2, _x2, _x6, _x0_5 }, - [6] = { _x1, _x1_5, _x1_5, _x4_5, _x0_375 }, -}; - -static const struct clock_cmode __pminitconst *clock_cmodes; -static int __pminitdata clock_doubled; - -static struct uart_port __pminitdata __frv_uart0 = { - .uartclk = 0, - .membase = (char *) UART0_BASE, - .irq = IRQ_CPU_UART0, - .regshift = 3, - .iotype = UPIO_MEM, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -}; - -static struct uart_port __pminitdata __frv_uart1 = { - .uartclk = 0, - .membase = (char *) UART1_BASE, - .irq = IRQ_CPU_UART1, - .regshift = 3, - .iotype = UPIO_MEM, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, -}; - -#if 0 -static void __init printk_xampr(unsigned long ampr, unsigned long amlr, char i_d, int n) -{ - unsigned long phys, virt, cxn, size; - -#ifdef CONFIG_MMU - virt = amlr & 0xffffc000; - cxn = amlr & 0x3fff; -#else - virt = ampr & 0xffffc000; - cxn = 0; -#endif - phys = ampr & xAMPRx_PPFN; - size = 1 << (((ampr & xAMPRx_SS) >> 4) + 17); - - printk("%cAMPR%d: va %08lx-%08lx [pa %08lx] %c%c%c%c [cxn:%04lx]\n", - i_d, n, - virt, virt + size - 1, - phys, - ampr & xAMPRx_S ? 'S' : '-', - ampr & xAMPRx_C ? 'C' : '-', - ampr & DAMPRx_WP ? 'W' : '-', - ampr & xAMPRx_V ? 'V' : '-', - cxn - ); -} -#endif - -/*****************************************************************************/ -/* - * dump the memory map - */ -static void __init dump_memory_map(void) -{ - -#if 0 - /* dump the protection map */ - printk_xampr(__get_IAMPR(0), __get_IAMLR(0), 'I', 0); - printk_xampr(__get_IAMPR(1), __get_IAMLR(1), 'I', 1); - printk_xampr(__get_IAMPR(2), __get_IAMLR(2), 'I', 2); - printk_xampr(__get_IAMPR(3), __get_IAMLR(3), 'I', 3); - printk_xampr(__get_IAMPR(4), __get_IAMLR(4), 'I', 4); - printk_xampr(__get_IAMPR(5), __get_IAMLR(5), 'I', 5); - printk_xampr(__get_IAMPR(6), __get_IAMLR(6), 'I', 6); - printk_xampr(__get_IAMPR(7), __get_IAMLR(7), 'I', 7); - printk_xampr(__get_IAMPR(8), __get_IAMLR(8), 'I', 8); - printk_xampr(__get_IAMPR(9), __get_IAMLR(9), 'i', 9); - printk_xampr(__get_IAMPR(10), __get_IAMLR(10), 'I', 10); - printk_xampr(__get_IAMPR(11), __get_IAMLR(11), 'I', 11); - printk_xampr(__get_IAMPR(12), __get_IAMLR(12), 'I', 12); - printk_xampr(__get_IAMPR(13), __get_IAMLR(13), 'I', 13); - printk_xampr(__get_IAMPR(14), __get_IAMLR(14), 'I', 14); - printk_xampr(__get_IAMPR(15), __get_IAMLR(15), 'I', 15); - - printk_xampr(__get_DAMPR(0), __get_DAMLR(0), 'D', 0); - printk_xampr(__get_DAMPR(1), __get_DAMLR(1), 'D', 1); - printk_xampr(__get_DAMPR(2), __get_DAMLR(2), 'D', 2); - printk_xampr(__get_DAMPR(3), __get_DAMLR(3), 'D', 3); - printk_xampr(__get_DAMPR(4), __get_DAMLR(4), 'D', 4); - printk_xampr(__get_DAMPR(5), __get_DAMLR(5), 'D', 5); - printk_xampr(__get_DAMPR(6), __get_DAMLR(6), 'D', 6); - printk_xampr(__get_DAMPR(7), __get_DAMLR(7), 'D', 7); - printk_xampr(__get_DAMPR(8), __get_DAMLR(8), 'D', 8); - printk_xampr(__get_DAMPR(9), __get_DAMLR(9), 'D', 9); - printk_xampr(__get_DAMPR(10), __get_DAMLR(10), 'D', 10); - printk_xampr(__get_DAMPR(11), __get_DAMLR(11), 'D', 11); - printk_xampr(__get_DAMPR(12), __get_DAMLR(12), 'D', 12); - printk_xampr(__get_DAMPR(13), __get_DAMLR(13), 'D', 13); - printk_xampr(__get_DAMPR(14), __get_DAMLR(14), 'D', 14); - printk_xampr(__get_DAMPR(15), __get_DAMLR(15), 'D', 15); -#endif - -#if 0 - /* dump the bus controller registers */ - printk("LGCR: %08lx\n", __get_LGCR()); - printk("Master: %08lx-%08lx CR=%08lx\n", - __get_LEMBR(), __get_LEMBR() + __get_LEMAM(), - __get_LMAICR()); - - int loop; - for (loop = 1; loop <= 7; loop++) { - unsigned long lcr = __get_LCR(loop), lsbr = __get_LSBR(loop); - printk("CS#%d: %08lx-%08lx %c%c%c%c%c%c%c%c%c\n", - loop, - lsbr, lsbr + __get_LSAM(loop), - lcr & 0x80000000 ? 'r' : '-', - lcr & 0x40000000 ? 'w' : '-', - lcr & 0x08000000 ? 'b' : '-', - lcr & 0x04000000 ? 'B' : '-', - lcr & 0x02000000 ? 'C' : '-', - lcr & 0x01000000 ? 'D' : '-', - lcr & 0x00800000 ? 'W' : '-', - lcr & 0x00400000 ? 'R' : '-', - (lcr & 0x00030000) == 0x00000000 ? '4' : - (lcr & 0x00030000) == 0x00010000 ? '2' : - (lcr & 0x00030000) == 0x00020000 ? '1' : - '-' - ); - } -#endif - -#if 0 - printk("\n"); -#endif -} /* end dump_memory_map() */ - -/*****************************************************************************/ -/* - * attempt to detect a VDK motherboard and DAV daughter board on an MB93091 system - */ -#ifdef CONFIG_MB93091_VDK -static void __init detect_mb93091(void) -{ -#ifdef CONFIG_MB93090_MB00 - /* Detect CB70 without motherboard */ - if (!(cpu_system == __frv_mb93091_cb70 && ((*(unsigned short *)0xffc00030) & 0x100))) { - cpu_board1 = __frv_mb93090_mb00; - mb93090_mb00_detected = 1; - } -#endif - -#ifdef CONFIG_FUJITSU_MB93493 - cpu_board2 = __frv_mb93493; -#endif - -} /* end detect_mb93091() */ -#endif - -/*****************************************************************************/ -/* - * determine the CPU type and set appropriate parameters - * - * Family Series CPU Core Silicon Imple Vers - * ---------------------------------------------------------- - * FR-V --+-> FR400 --+-> FR401 --+-> MB93401 02 00 [1] - * | | | - * | | +-> MB93401/A 02 01 - * | | | - * | | +-> MB93403 02 02 - * | | - * | +-> FR405 ----> MB93405 04 00 - * | - * +-> FR450 ----> FR451 ----> MB93451 05 00 - * | - * +-> FR500 ----> FR501 --+-> MB93501 01 01 [2] - * | | - * | +-> MB93501/A 01 02 - * | - * +-> FR550 --+-> FR551 ----> MB93555 03 01 - * - * [1] The MB93401 is an obsolete CPU replaced by the MB93401A - * [2] The MB93501 is an obsolete CPU replaced by the MB93501A - * - * Imple is PSR(Processor Status Register)[31:28]. - * Vers is PSR(Processor Status Register)[27:24]. - * - * A "Silicon" consists of CPU core and some on-chip peripherals. - */ -static void __init determine_cpu(void) -{ - unsigned long hsr0 = __get_HSR(0); - unsigned long psr = __get_PSR(); - - /* work out what selectable services the CPU supports */ - __set_PSR(psr | PSR_EM | PSR_EF | PSR_CM | PSR_NEM); - cpu_psr_all = __get_PSR(); - __set_PSR(psr); - - __set_HSR(0, hsr0 | HSR0_GRLE | HSR0_GRHE | HSR0_FRLE | HSR0_FRHE); - cpu_hsr0_all = __get_HSR(0); - __set_HSR(0, hsr0); - - /* derive other service specs from the CPU type */ - cpu_series = "unknown"; - cpu_core = "unknown"; - cpu_silicon = "unknown"; - cpu_mmu = "Prot"; - cpu_system = __frv_unknown_system; - clock_cmodes = NULL; - clock_doubled = 0; -#ifdef CONFIG_PM - clock_bits_settable = CLOCK_BIT_CM_H | CLOCK_BIT_CM_M | CLOCK_BIT_P0; -#endif - - switch (PSR_IMPLE(psr)) { - case PSR_IMPLE_FR401: - cpu_series = "fr400"; - cpu_core = "fr401"; - pdm_suspend_mode = HSR0_PDM_PLL_RUN; - - switch (PSR_VERSION(psr)) { - case PSR_VERSION_FR401_MB93401: - cpu_silicon = "mb93401"; - cpu_system = __frv_mb93091_cb10; - clock_cmodes = clock_cmodes_fr401_fr403; - clock_doubled = 1; - break; - case PSR_VERSION_FR401_MB93401A: - cpu_silicon = "mb93401/A"; - cpu_system = __frv_mb93091_cb11; - clock_cmodes = clock_cmodes_fr401_fr403; - break; - case PSR_VERSION_FR401_MB93403: - cpu_silicon = "mb93403"; -#ifndef CONFIG_MB93093_PDK - cpu_system = __frv_mb93091_cb30; -#else - cpu_system = __frv_mb93093; -#endif - clock_cmodes = clock_cmodes_fr401_fr403; - break; - default: - break; - } - break; - - case PSR_IMPLE_FR405: - cpu_series = "fr400"; - cpu_core = "fr405"; - pdm_suspend_mode = HSR0_PDM_PLL_STOP; - - switch (PSR_VERSION(psr)) { - case PSR_VERSION_FR405_MB93405: - cpu_silicon = "mb93405"; - cpu_system = __frv_mb93091_cb60; - clock_cmodes = clock_cmodes_fr405; -#ifdef CONFIG_PM - clock_bits_settable |= CLOCK_BIT_CMODE; - clock_cmodes_permitted = CLOCK_CMODES_PERMITTED_FR405; -#endif - - /* the FPGA on the CB70 has extra registers - * - it has 0x0046 in the VDK_ID FPGA register at 0x1a0, which is - * how we tell the difference between it and a CB60 - */ - if (*(volatile unsigned short *) 0xffc001a0 == 0x0046) - cpu_system = __frv_mb93091_cb70; - break; - default: - break; - } - break; - - case PSR_IMPLE_FR451: - cpu_series = "fr450"; - cpu_core = "fr451"; - pdm_suspend_mode = HSR0_PDM_PLL_STOP; -#ifdef CONFIG_PM - clock_bits_settable |= CLOCK_BIT_CMODE; - clock_cmodes_permitted = CLOCK_CMODES_PERMITTED_FR405; -#endif - switch (PSR_VERSION(psr)) { - case PSR_VERSION_FR451_MB93451: - cpu_silicon = "mb93451"; - cpu_mmu = "Prot, SAT, xSAT, DAT"; - cpu_system = __frv_mb93091_cb451; - clock_cmodes = clock_cmodes_fr405; - break; - default: - break; - } - break; - - case PSR_IMPLE_FR501: - cpu_series = "fr500"; - cpu_core = "fr501"; - pdm_suspend_mode = HSR0_PDM_PLL_STOP; - - switch (PSR_VERSION(psr)) { - case PSR_VERSION_FR501_MB93501: cpu_silicon = "mb93501"; break; - case PSR_VERSION_FR501_MB93501A: cpu_silicon = "mb93501/A"; break; - default: - break; - } - break; - - case PSR_IMPLE_FR551: - cpu_series = "fr550"; - cpu_core = "fr551"; - pdm_suspend_mode = HSR0_PDM_PLL_RUN; - - switch (PSR_VERSION(psr)) { - case PSR_VERSION_FR551_MB93555: - cpu_silicon = "mb93555"; - cpu_mmu = "Prot, SAT"; - cpu_system = __frv_mb93091_cb41; - clock_cmodes = clock_cmodes_fr555; - clock_doubled = 1; - break; - default: - break; - } - break; - - default: - break; - } - - printk("- Series:%s CPU:%s Silicon:%s\n", - cpu_series, cpu_core, cpu_silicon); - -#ifdef CONFIG_MB93091_VDK - detect_mb93091(); -#endif - -#if defined(CONFIG_MB93093_PDK) && defined(CONFIG_FUJITSU_MB93493) - cpu_board2 = __frv_mb93493; -#endif - -} /* end determine_cpu() */ - -/*****************************************************************************/ -/* - * calculate the bus clock speed - */ -void __pminit determine_clocks(int verbose) -{ - const struct clock_cmode *mode, *tmode; - unsigned long clkc, psr, quot; - - clkc = __get_CLKC(); - psr = __get_PSR(); - - clock_p0_current = !!(clkc & CLKC_P0); - clock_cm_current = clkc & CLKC_CM; - clock_cmode_current = (clkc & CLKC_CMODE) >> CLKC_CMODE_s; - - if (verbose) - printk("psr=%08lx hsr0=%08lx clkc=%08lx\n", psr, __get_HSR(0), clkc); - - /* the CB70 has some alternative ways of setting the clock speed through switches accessed - * through the FPGA. */ - if (cpu_system == __frv_mb93091_cb70) { - unsigned short clkswr = *(volatile unsigned short *) 0xffc00104UL & 0x1fffUL; - - if (clkswr & 0x1000) - __clkin_clock_speed_HZ = 60000000UL; - else - __clkin_clock_speed_HZ = - ((clkswr >> 8) & 0xf) * 10000000 + - ((clkswr >> 4) & 0xf) * 1000000 + - ((clkswr ) & 0xf) * 100000; - } - /* the FR451 is currently fixed at 24MHz */ - else if (cpu_system == __frv_mb93091_cb451) { - //__clkin_clock_speed_HZ = 24000000UL; // CB451-FPGA - unsigned short clkswr = *(volatile unsigned short *) 0xffc00104UL & 0x1fffUL; - - if (clkswr & 0x1000) - __clkin_clock_speed_HZ = 60000000UL; - else - __clkin_clock_speed_HZ = - ((clkswr >> 8) & 0xf) * 10000000 + - ((clkswr >> 4) & 0xf) * 1000000 + - ((clkswr ) & 0xf) * 100000; - } - /* otherwise determine the clockspeed from VDK or other registers */ - else { - __clkin_clock_speed_HZ = __get_CLKIN(); - } - - /* look up the appropriate clock relationships table entry */ - mode = &undef_clock_cmode; - if (clock_cmodes) { - tmode = &clock_cmodes[(clkc & CLKC_CMODE) >> CLKC_CMODE_s]; - if (tmode->xbus) - mode = tmode; - } - -#define CLOCK(SRC,RATIO) ((SRC) * (((RATIO) >> 4) & 0x0f) / ((RATIO) & 0x0f)) - - if (clock_doubled) - __clkin_clock_speed_HZ <<= 1; - - __ext_bus_clock_speed_HZ = CLOCK(__clkin_clock_speed_HZ, mode->xbus); - __sdram_clock_speed_HZ = CLOCK(__clkin_clock_speed_HZ, mode->sdram); - __dsu_clock_speed_HZ = CLOCK(__clkin_clock_speed_HZ, mode->dsu); - - switch (clkc & CLKC_CM) { - case 0: /* High */ - __core_bus_clock_speed_HZ = CLOCK(__clkin_clock_speed_HZ, mode->corebus); - __core_clock_speed_HZ = CLOCK(__clkin_clock_speed_HZ, mode->core); - break; - case 1: /* Medium */ - __core_bus_clock_speed_HZ = CLOCK(__clkin_clock_speed_HZ, mode->sdram); - __core_clock_speed_HZ = CLOCK(__clkin_clock_speed_HZ, mode->sdram); - break; - case 2: /* Low; not supported */ - case 3: /* UNDEF */ - printk("Unsupported CLKC CM %ld\n", clkc & CLKC_CM); - panic("Bye"); - } - - __res_bus_clock_speed_HZ = __ext_bus_clock_speed_HZ; - if (clkc & CLKC_P0) - __res_bus_clock_speed_HZ >>= 1; - - if (verbose) { - printk("CLKIN: %lu.%3.3luMHz\n", - __clkin_clock_speed_HZ / 1000000, - (__clkin_clock_speed_HZ / 1000) % 1000); - - printk("CLKS:" - " ext=%luMHz res=%luMHz sdram=%luMHz cbus=%luMHz core=%luMHz dsu=%luMHz\n", - __ext_bus_clock_speed_HZ / 1000000, - __res_bus_clock_speed_HZ / 1000000, - __sdram_clock_speed_HZ / 1000000, - __core_bus_clock_speed_HZ / 1000000, - __core_clock_speed_HZ / 1000000, - __dsu_clock_speed_HZ / 1000000 - ); - } - - /* calculate the number of __delay() loop iterations per sec (2 insn loop) */ - __delay_loops_MHz = __core_clock_speed_HZ / (1000000 * 2); - - /* set the serial prescaler */ - __serial_clock_speed_HZ = __res_bus_clock_speed_HZ; - quot = 1; - while (__serial_clock_speed_HZ / quot / 16 / 65536 > 3000) - quot += 1; - - /* double the divisor if P0 is clear, so that if/when P0 is set, it's still achievable - * - we have to be careful - dividing too much can mean we can't get 115200 baud - */ - if (__serial_clock_speed_HZ > 32000000 && !(clkc & CLKC_P0)) - quot <<= 1; - - __serial_clock_speed_HZ /= quot; - __frv_uart0.uartclk = __serial_clock_speed_HZ; - __frv_uart1.uartclk = __serial_clock_speed_HZ; - - if (verbose) - printk(" uart=%luMHz\n", __serial_clock_speed_HZ / 1000000 * quot); - - while (!(__get_UART0_LSR() & UART_LSR_TEMT)) - continue; - - while (!(__get_UART1_LSR() & UART_LSR_TEMT)) - continue; - - __set_UCPVR(quot); - __set_UCPSR(0); -} /* end determine_clocks() */ - -/*****************************************************************************/ -/* - * reserve some DMA consistent memory - */ -#ifdef CONFIG_RESERVE_DMA_COHERENT -static void __init reserve_dma_coherent(void) -{ - unsigned long ampr; - - /* find the first non-kernel memory tile and steal it */ -#define __steal_AMPR(r) \ - if (__get_DAMPR(r) & xAMPRx_V) { \ - ampr = __get_DAMPR(r); \ - __set_DAMPR(r, ampr | xAMPRx_S | xAMPRx_C); \ - __set_IAMPR(r, 0); \ - goto found; \ - } - - __steal_AMPR(1); - __steal_AMPR(2); - __steal_AMPR(3); - __steal_AMPR(4); - __steal_AMPR(5); - __steal_AMPR(6); - - if (PSR_IMPLE(__get_PSR()) == PSR_IMPLE_FR551) { - __steal_AMPR(7); - __steal_AMPR(8); - __steal_AMPR(9); - __steal_AMPR(10); - __steal_AMPR(11); - __steal_AMPR(12); - __steal_AMPR(13); - __steal_AMPR(14); - } - - /* unable to grant any DMA consistent memory */ - printk("No DMA consistent memory reserved\n"); - return; - - found: - dma_coherent_mem_start = ampr & xAMPRx_PPFN; - ampr &= xAMPRx_SS; - ampr >>= 4; - ampr = 1 << (ampr - 3 + 20); - dma_coherent_mem_end = dma_coherent_mem_start + ampr; - - printk("DMA consistent memory reserved %lx-%lx\n", - dma_coherent_mem_start, dma_coherent_mem_end); - -} /* end reserve_dma_coherent() */ -#endif - -/*****************************************************************************/ -/* - * calibrate the delay loop - */ -void calibrate_delay(void) -{ - loops_per_jiffy = __delay_loops_MHz * (1000000 / HZ); - - printk("Calibrating delay loop... %lu.%02lu BogoMIPS\n", - loops_per_jiffy / (500000 / HZ), - (loops_per_jiffy / (5000 / HZ)) % 100); - -} /* end calibrate_delay() */ - -/*****************************************************************************/ -/* - * look through the command line for some things we need to know immediately - */ -static void __init parse_cmdline_early(char *cmdline) -{ - if (!cmdline) - return; - - while (*cmdline) { - if (*cmdline == ' ') - cmdline++; - - /* "mem=XXX[kKmM]" sets SDRAM size to , overriding the value we worked - * out from the SDRAM controller mask register - */ - if (!strncmp(cmdline, "mem=", 4)) { - unsigned long long mem_size; - - mem_size = memparse(cmdline + 4, &cmdline); - memory_end = memory_start + mem_size; - } - - while (*cmdline && *cmdline != ' ') - cmdline++; - } - -} /* end parse_cmdline_early() */ - -/*****************************************************************************/ -/* - * - */ -void __init setup_arch(char **cmdline_p) -{ -#ifdef CONFIG_MMU - printk("Linux FR-V port done by Red Hat Inc \n"); -#else - printk("uClinux FR-V port done by Red Hat Inc \n"); -#endif - - memcpy(boot_command_line, redboot_command_line, COMMAND_LINE_SIZE); - - determine_cpu(); - determine_clocks(1); - - /* For printk-directly-beats-on-serial-hardware hack */ - console_set_baud(115200); -#ifdef CONFIG_GDBSTUB - gdbstub_set_baud(115200); -#endif - -#ifdef CONFIG_RESERVE_DMA_COHERENT - reserve_dma_coherent(); -#endif - dump_memory_map(); - -#ifdef CONFIG_MB93090_MB00 - if (mb93090_mb00_detected) - mb93090_display(); -#endif - - /* register those serial ports that are available */ -#ifdef CONFIG_FRV_ONCPU_SERIAL -#ifndef CONFIG_GDBSTUB_UART0 - __reg(UART0_BASE + UART_IER * 8) = 0; - early_serial_setup(&__frv_uart0); -#endif -#ifndef CONFIG_GDBSTUB_UART1 - __reg(UART1_BASE + UART_IER * 8) = 0; - early_serial_setup(&__frv_uart1); -#endif -#endif - - /* deal with the command line - RedBoot may have passed one to the kernel */ - memcpy(command_line, boot_command_line, sizeof(command_line)); - *cmdline_p = &command_line[0]; - parse_cmdline_early(command_line); - - /* set up the memory description - * - by now the stack is part of the init task */ - printk("Memory %08lx-%08lx\n", memory_start, memory_end); - - BUG_ON(memory_start == memory_end); - - init_mm.start_code = (unsigned long) _stext; - init_mm.end_code = (unsigned long) _etext; - init_mm.end_data = (unsigned long) _edata; -#if 0 /* DAVIDM - don't set brk just incase someone decides to use it */ - init_mm.brk = (unsigned long) &_end; -#else - init_mm.brk = (unsigned long) 0; -#endif - -#ifdef DEBUG - printk("KERNEL -> TEXT=0x%p-0x%p DATA=0x%p-0x%p BSS=0x%p-0x%p\n", - _stext, _etext, _sdata, _edata, __bss_start, __bss_stop); -#endif - -#ifdef CONFIG_VT -#if defined(CONFIG_VGA_CONSOLE) - conswitchp = &vga_con; -#elif defined(CONFIG_DUMMY_CONSOLE) - conswitchp = &dummy_con; -#endif -#endif - -#ifdef CONFIG_MMU - setup_linux_memory(); -#else - setup_uclinux_memory(); -#endif - - /* get kmalloc into gear */ - paging_init(); - - /* init DMA */ - frv_dma_init(); -#ifdef DEBUG - printk("Done setup_arch\n"); -#endif - - /* start the decrement timer running */ -// asm volatile("movgs %0,timerd" :: "r"(10000000)); -// __set_HSR(0, __get_HSR(0) | HSR0_ETMD); - -} /* end setup_arch() */ - -#if 0 -/*****************************************************************************/ -/* - * - */ -static int setup_arch_serial(void) -{ - /* register those serial ports that are available */ -#ifndef CONFIG_GDBSTUB_UART0 - early_serial_setup(&__frv_uart0); -#endif -#ifndef CONFIG_GDBSTUB_UART1 - early_serial_setup(&__frv_uart1); -#endif - - return 0; -} /* end setup_arch_serial() */ - -late_initcall(setup_arch_serial); -#endif - -/*****************************************************************************/ -/* - * set up the memory map for normal MMU linux - */ -#ifdef CONFIG_MMU -static void __init setup_linux_memory(void) -{ - unsigned long bootmap_size, low_top_pfn, kstart, kend, high_mem; - unsigned long physpages; - - kstart = (unsigned long) &__kernel_image_start - PAGE_OFFSET; - kend = (unsigned long) &__kernel_image_end - PAGE_OFFSET; - - kstart = kstart & PAGE_MASK; - kend = (kend + PAGE_SIZE - 1) & PAGE_MASK; - - /* give all the memory to the bootmap allocator, tell it to put the - * boot mem_map immediately following the kernel image - */ - bootmap_size = init_bootmem_node(NODE_DATA(0), - kend >> PAGE_SHIFT, /* map addr */ - memory_start >> PAGE_SHIFT, /* start of RAM */ - memory_end >> PAGE_SHIFT /* end of RAM */ - ); - - /* pass the memory that the kernel can immediately use over to the bootmem allocator */ - max_mapnr = physpages = (memory_end - memory_start) >> PAGE_SHIFT; - low_top_pfn = (KERNEL_LOWMEM_END - KERNEL_LOWMEM_START) >> PAGE_SHIFT; - high_mem = 0; - - if (physpages > low_top_pfn) { -#ifdef CONFIG_HIGHMEM - high_mem = physpages - low_top_pfn; -#else - max_mapnr = physpages = low_top_pfn; -#endif - } - else { - low_top_pfn = physpages; - } - - min_low_pfn = memory_start >> PAGE_SHIFT; - max_low_pfn = low_top_pfn; - max_pfn = memory_end >> PAGE_SHIFT; - - num_mappedpages = low_top_pfn; - - printk(KERN_NOTICE "%ldMB LOWMEM available.\n", low_top_pfn >> (20 - PAGE_SHIFT)); - - free_bootmem(memory_start, low_top_pfn << PAGE_SHIFT); - -#ifdef CONFIG_HIGHMEM - if (high_mem) - printk(KERN_NOTICE "%ldMB HIGHMEM available.\n", high_mem >> (20 - PAGE_SHIFT)); -#endif - - /* take back the memory occupied by the kernel image and the bootmem alloc map */ - reserve_bootmem(kstart, kend - kstart + bootmap_size, - BOOTMEM_DEFAULT); - - /* reserve the memory occupied by the initial ramdisk */ -#ifdef CONFIG_BLK_DEV_INITRD - if (LOADER_TYPE && INITRD_START) { - if (INITRD_START + INITRD_SIZE <= (low_top_pfn << PAGE_SHIFT)) { - reserve_bootmem(INITRD_START, INITRD_SIZE, - BOOTMEM_DEFAULT); - initrd_start = INITRD_START + PAGE_OFFSET; - initrd_end = initrd_start + INITRD_SIZE; - } - else { - printk(KERN_ERR - "initrd extends beyond end of memory (0x%08lx > 0x%08lx)\n" - "disabling initrd\n", - INITRD_START + INITRD_SIZE, - low_top_pfn << PAGE_SHIFT); - initrd_start = 0; - } - } -#endif - -} /* end setup_linux_memory() */ -#endif - -/*****************************************************************************/ -/* - * set up the memory map for uClinux - */ -#ifndef CONFIG_MMU -static void __init setup_uclinux_memory(void) -{ -#ifdef CONFIG_PROTECT_KERNEL - unsigned long dampr; -#endif - unsigned long kend; - int bootmap_size; - - kend = (unsigned long) &__kernel_image_end; - kend = (kend + PAGE_SIZE - 1) & PAGE_MASK; - - /* give all the memory to the bootmap allocator, tell it to put the - * boot mem_map immediately following the kernel image - */ - bootmap_size = init_bootmem_node(NODE_DATA(0), - kend >> PAGE_SHIFT, /* map addr */ - memory_start >> PAGE_SHIFT, /* start of RAM */ - memory_end >> PAGE_SHIFT /* end of RAM */ - ); - - /* free all the usable memory */ - free_bootmem(memory_start, memory_end - memory_start); - - high_memory = (void *) (memory_end & PAGE_MASK); - max_mapnr = ((unsigned long) high_memory - PAGE_OFFSET) >> PAGE_SHIFT; - - min_low_pfn = memory_start >> PAGE_SHIFT; - max_low_pfn = memory_end >> PAGE_SHIFT; - max_pfn = max_low_pfn; - - /* now take back the bits the core kernel is occupying */ -#ifndef CONFIG_PROTECT_KERNEL - reserve_bootmem(kend, bootmap_size, BOOTMEM_DEFAULT); - reserve_bootmem((unsigned long) &__kernel_image_start, - kend - (unsigned long) &__kernel_image_start, - BOOTMEM_DEFAULT); - -#else - dampr = __get_DAMPR(0); - dampr &= xAMPRx_SS; - dampr = (dampr >> 4) + 17; - dampr = 1 << dampr; - - reserve_bootmem(__get_DAMPR(0) & xAMPRx_PPFN, dampr, BOOTMEM_DEFAULT); -#endif - - /* reserve some memory to do uncached DMA through if requested */ -#ifdef CONFIG_RESERVE_DMA_COHERENT - if (dma_coherent_mem_start) - reserve_bootmem(dma_coherent_mem_start, - dma_coherent_mem_end - dma_coherent_mem_start, - BOOTMEM_DEFAULT); -#endif - -} /* end setup_uclinux_memory() */ -#endif - -/*****************************************************************************/ -/* - * get CPU information for use by procfs - */ -static int show_cpuinfo(struct seq_file *m, void *v) -{ - const char *gr, *fr, *fm, *fp, *cm, *nem, *ble; -#ifdef CONFIG_PM - const char *sep; -#endif - - gr = cpu_hsr0_all & HSR0_GRHE ? "gr0-63" : "gr0-31"; - fr = cpu_hsr0_all & HSR0_FRHE ? "fr0-63" : "fr0-31"; - fm = cpu_psr_all & PSR_EM ? ", Media" : ""; - fp = cpu_psr_all & PSR_EF ? ", FPU" : ""; - cm = cpu_psr_all & PSR_CM ? ", CCCR" : ""; - nem = cpu_psr_all & PSR_NEM ? ", NE" : ""; - ble = cpu_psr_all & PSR_BE ? "BE" : "LE"; - - seq_printf(m, - "CPU-Series:\t%s\n" - "CPU-Core:\t%s, %s, %s%s%s\n" - "CPU:\t\t%s\n" - "MMU:\t\t%s\n" - "FP-Media:\t%s%s%s\n" - "System:\t\t%s", - cpu_series, - cpu_core, gr, ble, cm, nem, - cpu_silicon, - cpu_mmu, - fr, fm, fp, - cpu_system); - - if (cpu_board1) - seq_printf(m, ", %s", cpu_board1); - - if (cpu_board2) - seq_printf(m, ", %s", cpu_board2); - - seq_printf(m, "\n"); - -#ifdef CONFIG_PM - seq_printf(m, "PM-Controls:"); - sep = "\t"; - - if (clock_bits_settable & CLOCK_BIT_CMODE) { - seq_printf(m, "%scmode=0x%04hx", sep, clock_cmodes_permitted); - sep = ", "; - } - - if (clock_bits_settable & CLOCK_BIT_CM) { - seq_printf(m, "%scm=0x%lx", sep, clock_bits_settable & CLOCK_BIT_CM); - sep = ", "; - } - - if (clock_bits_settable & CLOCK_BIT_P0) { - seq_printf(m, "%sp0=0x3", sep); - sep = ", "; - } - - seq_printf(m, "%ssuspend=0x22\n", sep); -#endif - - seq_printf(m, - "PM-Status:\tcmode=%d, cm=%d, p0=%d\n", - clock_cmode_current, clock_cm_current, clock_p0_current); - -#define print_clk(TAG, VAR) \ - seq_printf(m, "Clock-" TAG ":\t%lu.%2.2lu MHz\n", VAR / 1000000, (VAR / 10000) % 100) - - print_clk("In", __clkin_clock_speed_HZ); - print_clk("Core", __core_clock_speed_HZ); - print_clk("SDRAM", __sdram_clock_speed_HZ); - print_clk("CBus", __core_bus_clock_speed_HZ); - print_clk("Res", __res_bus_clock_speed_HZ); - print_clk("Ext", __ext_bus_clock_speed_HZ); - print_clk("DSU", __dsu_clock_speed_HZ); - - seq_printf(m, - "BogoMips:\t%lu.%02lu\n", - (loops_per_jiffy * HZ) / 500000, ((loops_per_jiffy * HZ) / 5000) % 100); - - return 0; -} /* end show_cpuinfo() */ - -static void *c_start(struct seq_file *m, loff_t *pos) -{ - return *pos < NR_CPUS ? (void *) 0x12345678 : NULL; -} - -static void *c_next(struct seq_file *m, void *v, loff_t *pos) -{ - ++*pos; - return c_start(m, pos); -} - -static void c_stop(struct seq_file *m, void *v) -{ -} - -const struct seq_operations cpuinfo_op = { - .start = c_start, - .next = c_next, - .stop = c_stop, - .show = show_cpuinfo, -}; - -void arch_gettod(int *year, int *mon, int *day, int *hour, - int *min, int *sec) -{ - *year = *mon = *day = *hour = *min = *sec = 0; -} - -/*****************************************************************************/ -/* - * - */ -#ifdef CONFIG_MB93090_MB00 -static void __init mb93090_sendlcdcmd(uint32_t cmd) -{ - unsigned long base = __addr_LCD(); - int loop; - - /* request reading of the busy flag */ - __set_LCD(base, LCD_CMD_READ_BUSY); - __set_LCD(base, LCD_CMD_READ_BUSY & ~LCD_E); - - /* wait for the busy flag to become clear */ - for (loop = 10000; loop > 0; loop--) - if (!(__get_LCD(base) & 0x80)) - break; - - /* send the command */ - __set_LCD(base, cmd); - __set_LCD(base, cmd & ~LCD_E); - -} /* end mb93090_sendlcdcmd() */ - -/*****************************************************************************/ -/* - * write to the MB93090 LEDs and LCD - */ -static void __init mb93090_display(void) -{ - const char *p; - - __set_LEDS(0); - - /* set up the LCD */ - mb93090_sendlcdcmd(LCD_CMD_CLEAR); - mb93090_sendlcdcmd(LCD_CMD_FUNCSET(1,1,0)); - mb93090_sendlcdcmd(LCD_CMD_ON(0,0)); - mb93090_sendlcdcmd(LCD_CMD_HOME); - - mb93090_sendlcdcmd(LCD_CMD_SET_DD_ADDR(0)); - for (p = mb93090_banner; *p; p++) - mb93090_sendlcdcmd(LCD_DATA_WRITE(*p)); - - mb93090_sendlcdcmd(LCD_CMD_SET_DD_ADDR(64)); - for (p = mb93090_version; *p; p++) - mb93090_sendlcdcmd(LCD_DATA_WRITE(*p)); - -} /* end mb93090_display() */ - -#endif // CONFIG_MB93090_MB00 diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c deleted file mode 100644 index bf6e07a7a1b1..000000000000 --- a/arch/frv/kernel/signal.c +++ /dev/null @@ -1,426 +0,0 @@ -/* signal.c: FRV specific bits of signal handling - * - * Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from arch/m68k/kernel/signal.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEBUG_SIG 0 - -struct fdpic_func_descriptor { - unsigned long text; - unsigned long GOT; -}; - -/* - * Do a signal return; undo the signal stack. - */ - -struct sigframe -{ - __sigrestore_t pretcode; - int sig; - struct sigcontext sc; - unsigned long extramask[_NSIG_WORDS-1]; - uint32_t retcode[2]; -}; - -struct rt_sigframe -{ - __sigrestore_t pretcode; - int sig; - struct siginfo __user *pinfo; - void __user *puc; - struct siginfo info; - struct ucontext uc; - uint32_t retcode[2]; -}; - -static int restore_sigcontext(struct sigcontext __user *sc, int *_gr8) -{ - struct user_context *user = current->thread.user; - unsigned long tbr, psr; - - /* Always make any pending restarted system calls return -EINTR */ - current->restart_block.fn = do_no_restart_syscall; - - tbr = user->i.tbr; - psr = user->i.psr; - if (copy_from_user(user, &sc->sc_context, sizeof(sc->sc_context))) - goto badframe; - user->i.tbr = tbr; - user->i.psr = psr; - - restore_user_regs(user); - - user->i.syscallno = -1; /* disable syscall checks */ - - *_gr8 = user->i.gr[8]; - return 0; - - badframe: - return 1; -} - -asmlinkage int sys_sigreturn(void) -{ - struct sigframe __user *frame = (struct sigframe __user *) __frame->sp; - sigset_t set; - int gr8; - - if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) - goto badframe; - if (__get_user(set.sig[0], &frame->sc.sc_oldmask)) - goto badframe; - - if (_NSIG_WORDS > 1 && - __copy_from_user(&set.sig[1], &frame->extramask, sizeof(frame->extramask))) - goto badframe; - - set_current_blocked(&set); - - if (restore_sigcontext(&frame->sc, &gr8)) - goto badframe; - return gr8; - - badframe: - force_sig(SIGSEGV, current); - return 0; -} - -asmlinkage int sys_rt_sigreturn(void) -{ - struct rt_sigframe __user *frame = (struct rt_sigframe __user *) __frame->sp; - sigset_t set; - int gr8; - - if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) - goto badframe; - if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) - goto badframe; - - set_current_blocked(&set); - - if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8)) - goto badframe; - - if (restore_altstack(&frame->uc.uc_stack)) - goto badframe; - - return gr8; - -badframe: - force_sig(SIGSEGV, current); - return 0; -} - -/* - * Set up a signal frame - */ -static int setup_sigcontext(struct sigcontext __user *sc, unsigned long mask) -{ - save_user_regs(current->thread.user); - - if (copy_to_user(&sc->sc_context, current->thread.user, sizeof(sc->sc_context)) != 0) - goto badframe; - - /* non-iBCS2 extensions.. */ - if (__put_user(mask, &sc->sc_oldmask) < 0) - goto badframe; - - return 0; - - badframe: - return 1; -} - -/*****************************************************************************/ -/* - * Determine which stack to use.. - */ -static inline void __user *get_sigframe(struct ksignal *ksig, - size_t frame_size) -{ - unsigned long sp = sigsp(__frame->sp, ksig); - - return (void __user *) ((sp - frame_size) & ~7UL); - -} /* end get_sigframe() */ - -/*****************************************************************************/ -/* - * - */ -static int setup_frame(struct ksignal *ksig, sigset_t *set) -{ - struct sigframe __user *frame; - int sig = ksig->sig; - - frame = get_sigframe(ksig, sizeof(*frame)); - - if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) - return -EFAULT; - - if (__put_user(sig, &frame->sig) < 0) - return -EFAULT; - - if (setup_sigcontext(&frame->sc, set->sig[0])) - return -EFAULT; - - if (_NSIG_WORDS > 1) { - if (__copy_to_user(frame->extramask, &set->sig[1], - sizeof(frame->extramask))) - return -EFAULT; - } - - /* Set up to return from userspace. If provided, use a stub - * already in userspace. */ - if (ksig->ka.sa.sa_flags & SA_RESTORER) { - if (__put_user(ksig->ka.sa.sa_restorer, &frame->pretcode) < 0) - return -EFAULT; - } - else { - /* Set up the following code on the stack: - * setlos #__NR_sigreturn,gr7 - * tira gr0,0 - */ - if (__put_user((__sigrestore_t)frame->retcode, &frame->pretcode) || - __put_user(0x8efc0000|__NR_sigreturn, &frame->retcode[0]) || - __put_user(0xc0700000, &frame->retcode[1])) - return -EFAULT; - - flush_icache_range((unsigned long) frame->retcode, - (unsigned long) (frame->retcode + 2)); - } - - /* Set up registers for the signal handler */ - if (current->personality & FDPIC_FUNCPTRS) { - struct fdpic_func_descriptor __user *funcptr = - (struct fdpic_func_descriptor __user *) ksig->ka.sa.sa_handler; - struct fdpic_func_descriptor desc; - if (copy_from_user(&desc, funcptr, sizeof(desc))) - return -EFAULT; - __frame->pc = desc.text; - __frame->gr15 = desc.GOT; - } else { - __frame->pc = (unsigned long) ksig->ka.sa.sa_handler; - __frame->gr15 = 0; - } - - __frame->sp = (unsigned long) frame; - __frame->lr = (unsigned long) &frame->retcode; - __frame->gr8 = sig; - -#if DEBUG_SIG - printk("SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n", - sig, current->comm, current->pid, frame, __frame->pc, - frame->pretcode); -#endif - - return 0; -} /* end setup_frame() */ - -/*****************************************************************************/ -/* - * - */ -static int setup_rt_frame(struct ksignal *ksig, sigset_t *set) -{ - struct rt_sigframe __user *frame; - int sig = ksig->sig; - - frame = get_sigframe(ksig, sizeof(*frame)); - - if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) - return -EFAULT; - - if (__put_user(sig, &frame->sig) || - __put_user(&frame->info, &frame->pinfo) || - __put_user(&frame->uc, &frame->puc)) - return -EFAULT; - - if (copy_siginfo_to_user(&frame->info, &ksig->info)) - return -EFAULT; - - /* Create the ucontext. */ - if (__put_user(0, &frame->uc.uc_flags) || - __put_user(NULL, &frame->uc.uc_link) || - __save_altstack(&frame->uc.uc_stack, __frame->sp)) - return -EFAULT; - - if (setup_sigcontext(&frame->uc.uc_mcontext, set->sig[0])) - return -EFAULT; - - if (__copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set))) - return -EFAULT; - - /* Set up to return from userspace. If provided, use a stub - * already in userspace. */ - if (ksig->ka.sa.sa_flags & SA_RESTORER) { - if (__put_user(ksig->ka.sa.sa_restorer, &frame->pretcode)) - return -EFAULT; - } - else { - /* Set up the following code on the stack: - * setlos #__NR_sigreturn,gr7 - * tira gr0,0 - */ - if (__put_user((__sigrestore_t)frame->retcode, &frame->pretcode) || - __put_user(0x8efc0000|__NR_rt_sigreturn, &frame->retcode[0]) || - __put_user(0xc0700000, &frame->retcode[1])) - return -EFAULT; - - flush_icache_range((unsigned long) frame->retcode, - (unsigned long) (frame->retcode + 2)); - } - - /* Set up registers for signal handler */ - if (current->personality & FDPIC_FUNCPTRS) { - struct fdpic_func_descriptor __user *funcptr = - (struct fdpic_func_descriptor __user *) ksig->ka.sa.sa_handler; - struct fdpic_func_descriptor desc; - if (copy_from_user(&desc, funcptr, sizeof(desc))) - return -EFAULT; - __frame->pc = desc.text; - __frame->gr15 = desc.GOT; - } else { - __frame->pc = (unsigned long) ksig->ka.sa.sa_handler; - __frame->gr15 = 0; - } - - __frame->sp = (unsigned long) frame; - __frame->lr = (unsigned long) &frame->retcode; - __frame->gr8 = sig; - __frame->gr9 = (unsigned long) &frame->info; - -#if DEBUG_SIG - printk("SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n", - sig, current->comm, current->pid, frame, __frame->pc, - frame->pretcode); -#endif - return 0; - -} /* end setup_rt_frame() */ - -/*****************************************************************************/ -/* - * OK, we're invoking a handler - */ -static void handle_signal(struct ksignal *ksig) -{ - sigset_t *oldset = sigmask_to_save(); - int ret; - - /* Are we from a system call? */ - if (__frame->syscallno != -1) { - /* If so, check system call restarting.. */ - switch (__frame->gr8) { - case -ERESTART_RESTARTBLOCK: - case -ERESTARTNOHAND: - __frame->gr8 = -EINTR; - break; - - case -ERESTARTSYS: - if (!(ksig->ka.sa.sa_flags & SA_RESTART)) { - __frame->gr8 = -EINTR; - break; - } - - /* fallthrough */ - case -ERESTARTNOINTR: - __frame->gr8 = __frame->orig_gr8; - __frame->pc -= 4; - } - __frame->syscallno = -1; - } - - /* Set up the stack frame */ - if (ksig->ka.sa.sa_flags & SA_SIGINFO) - ret = setup_rt_frame(ksig, oldset); - else - ret = setup_frame(ksig, oldset); - - signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLESTEP)); -} /* end handle_signal() */ - -/*****************************************************************************/ -/* - * Note that 'init' is a special process: it doesn't get signals it doesn't - * want to handle. Thus you cannot kill init even with a SIGKILL even by - * mistake. - */ -static void do_signal(void) -{ - struct ksignal ksig; - - if (get_signal(&ksig)) { - handle_signal(&ksig); - return; - } - - /* Did we come from a system call? */ - if (__frame->syscallno != -1) { - /* Restart the system call - no handlers present */ - switch (__frame->gr8) { - case -ERESTARTNOHAND: - case -ERESTARTSYS: - case -ERESTARTNOINTR: - __frame->gr8 = __frame->orig_gr8; - __frame->pc -= 4; - break; - - case -ERESTART_RESTARTBLOCK: - __frame->gr7 = __NR_restart_syscall; - __frame->pc -= 4; - break; - } - __frame->syscallno = -1; - } - - /* if there's no signal to deliver, we just put the saved sigmask - * back */ - restore_saved_sigmask(); -} /* end do_signal() */ - -/*****************************************************************************/ -/* - * notification of userspace execution resumption - * - triggered by the TIF_WORK_MASK flags - */ -asmlinkage void do_notify_resume(__u32 thread_info_flags) -{ - /* pending single-step? */ - if (thread_info_flags & _TIF_SINGLESTEP) - clear_thread_flag(TIF_SINGLESTEP); - - /* deal with pending signal delivery */ - if (thread_info_flags & _TIF_SIGPENDING) - do_signal(); - - /* deal with notification on about to resume userspace execution */ - if (thread_info_flags & _TIF_NOTIFY_RESUME) { - clear_thread_flag(TIF_NOTIFY_RESUME); - tracehook_notify_resume(__frame); - } - -} /* end do_notify_resume() */ diff --git a/arch/frv/kernel/sleep.S b/arch/frv/kernel/sleep.S deleted file mode 100644 index f67bf73cd2cc..000000000000 --- a/arch/frv/kernel/sleep.S +++ /dev/null @@ -1,373 +0,0 @@ -/* sleep.S: power saving mode entry - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Woodhouse (dwmw2@infradead.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define __addr_MASK 0xfeff9820 /* interrupt controller mask */ - -#define __addr_FR55X_DRCN 0xfeff0218 /* Address of DRCN register */ -#define FR55X_DSTS_OFFSET -4 /* Offset from DRCN to DSTS */ -#define FR55X_SDRAMC_DSTS_SSI 0x00000002 /* indicates that the SDRAM is in self-refresh mode */ - -#define __addr_FR4XX_DRCN 0xfe000430 /* Address of DRCN register */ -#define FR4XX_DSTS_OFFSET -8 /* Offset from DRCN to DSTS */ -#define FR4XX_SDRAMC_DSTS_SSI 0x00000001 /* indicates that the SDRAM is in self-refresh mode */ - -#define SDRAMC_DRCN_SR 0x00000001 /* transition SDRAM into self-refresh mode */ - - .section .bss - .balign 8 - .globl __sleep_save_area -__sleep_save_area: - .space 16 - - - .text - .balign 4 - -.macro li v r - sethi.p %hi(\v),\r - setlo %lo(\v),\r -.endm - -#ifdef CONFIG_PM -############################################################################### -# -# CPU suspension routine -# - void frv_cpu_suspend(unsigned long pdm_mode) -# -############################################################################### - .globl frv_cpu_suspend - .type frv_cpu_suspend,@function -frv_cpu_suspend: - - #---------------------------------------------------- - # save hsr0, psr, isr, and lr for resume code - #---------------------------------------------------- - li __sleep_save_area,gr11 - - movsg hsr0,gr4 - movsg psr,gr5 - movsg isr,gr6 - movsg lr,gr7 - stdi gr4,@(gr11,#0) - stdi gr6,@(gr11,#8) - - # store the return address from sleep in GR14, and its complement in GR13 as a check - li __ramboot_resume,gr14 -#ifdef CONFIG_MMU - # Resume via RAMBOOT# will turn MMU off, so bootloader needs a physical address. - sethi.p %hi(__page_offset),gr13 - setlo %lo(__page_offset),gr13 - sub gr14,gr13,gr14 -#endif - not gr14,gr13 - - #---------------------------------------------------- - # preload and lock into icache that code which may have to run - # when dram is in self-refresh state. - #---------------------------------------------------- - movsg hsr0, gr3 - li HSR0_ICE,gr4 - or gr3,gr4,gr3 - movgs gr3,hsr0 - or gr3,gr8,gr7 // add the sleep bits for later - - li #__icache_lock_start,gr3 - li #__icache_lock_end,gr4 -1: icpl gr3,gr0,#1 - addi gr3,#L1_CACHE_BYTES,gr3 - cmp gr4,gr3,icc0 - bhi icc0,#0,1b - - # disable exceptions - movsg psr,gr8 - andi.p gr8,#~PSR_PIL,gr8 - andi gr8,~PSR_ET,gr8 - movgs gr8,psr - ori gr8,#PSR_ET,gr8 - - srli gr8,#28,gr4 - subicc gr4,#3,gr0,icc0 - beq icc0,#0,1f - # FR4xx - li __addr_FR4XX_DRCN,gr4 - li FR4XX_SDRAMC_DSTS_SSI,gr5 - li FR4XX_DSTS_OFFSET,gr6 - bra __icache_lock_start -1: - # FR5xx - li __addr_FR55X_DRCN,gr4 - li FR55X_SDRAMC_DSTS_SSI,gr5 - li FR55X_DSTS_OFFSET,gr6 - bra __icache_lock_start - - .size frv_cpu_suspend, .-frv_cpu_suspend - -# -# the final part of the sleep sequence... -# - we want it to be be cacheline aligned so we can lock it into the icache easily -# On entry: gr7 holds desired hsr0 sleep value -# gr8 holds desired psr sleep value -# - .balign L1_CACHE_BYTES - .type __icache_lock_start,@function -__icache_lock_start: - - #---------------------------------------------------- - # put SDRAM in self-refresh mode - #---------------------------------------------------- - - # Flush all data in the cache using the DCEF instruction. - dcef @(gr0,gr0),#1 - - # Stop DMAC transfer - - # Execute dummy load from SDRAM - ldi @(gr11,#0),gr11 - - # put the SDRAM into self-refresh mode - ld @(gr4,gr0),gr11 - ori gr11,#SDRAMC_DRCN_SR,gr11 - st gr11,@(gr4,gr0) - membar - - # wait for SDRAM to reach self-refresh mode -1: ld @(gr4,gr6),gr11 - andcc gr11,gr5,gr11,icc0 - beq icc0,#0,1b - - # Set the GPIO register so that the IRQ[3:0] pins become valid, as required. - # Set the clock mode (CLKC register) as required. - # - At this time, also set the CLKC register P0 bit. - - # Set the HSR0 register PDM field. - movgs gr7,hsr0 - - # Execute NOP 32 times. - .rept 32 - nop - .endr - -#if 0 // Fujitsu recommend to skip this and will update docs. - # Release the interrupt mask setting of the MASK register of the - # interrupt controller if necessary. - sti gr10,@(gr9,#0) - membar -#endif - - # Set the PSR register ET bit to 1 to enable interrupts. - movgs gr8,psr - - ################################################### - # this is only reached if waking up via interrupt - ################################################### - - # Execute NOP 32 times. - .rept 32 - nop - .endr - - #---------------------------------------------------- - # wake SDRAM from self-refresh mode - #---------------------------------------------------- - ld @(gr4,gr0),gr11 - andi gr11,#~SDRAMC_DRCN_SR,gr11 - st gr11,@(gr4,gr0) - membar -2: - ld @(gr4,gr6),gr11 // Wait for it to come back... - andcc gr11,gr5,gr0,icc0 - bne icc0,0,2b - - # wait for the SDRAM to stabilise - li 0x0100000,gr3 -3: subicc gr3,#1,gr3,icc0 - bne icc0,#0,3b - - # now that DRAM is back, this is the end of the code which gets - # locked in icache. -__icache_lock_end: - .size __icache_lock_start, .-__icache_lock_start - - # Fall-through to the RAMBOOT# wakeup path - -############################################################################### -# -# resume from suspend re-entry point reached via RAMBOOT# and bootloader -# -############################################################################### -__ramboot_resume: - - #---------------------------------------------------- - # restore hsr0, psr, isr, and leave saved lr in gr7 - #---------------------------------------------------- - li __sleep_save_area,gr11 -#ifdef CONFIG_MMU - movsg hsr0,gr4 - sethi.p %hi(HSR0_EXMMU),gr3 - setlo %lo(HSR0_EXMMU),gr3 - andcc gr3,gr4,gr0,icc0 - bne icc0,#0,2f - - # need to use physical address - sethi.p %hi(__page_offset),gr3 - setlo %lo(__page_offset),gr3 - sub gr11,gr3,gr11 - - # flush all tlb entries - setlos #64,gr4 - setlos.p #PAGE_SIZE,gr5 - setlos #0,gr6 -1: - tlbpr gr6,gr0,#6,#0 - subicc.p gr4,#1,gr4,icc0 - add gr6,gr5,gr6 - bne icc0,#2,1b - - # need a temporary mapping for the current physical address we are - # using between time MMU is enabled and jump to virtual address is - # made. - sethi.p %hi(0x00000000),gr4 - setlo %lo(0x00000000),gr4 ; physical address - setlos #xAMPRx_L|xAMPRx_M|xAMPRx_SS_256Mb|xAMPRx_S_KERNEL|xAMPRx_V,gr5 - or gr4,gr5,gr5 - - movsg cxnr,gr13 - or gr4,gr13,gr4 - - movgs gr4,iamlr1 ; mapped from real address 0 - movgs gr5,iampr1 ; cached kernel memory at 0x00000000 -2: -#endif - - lddi @(gr11,#0),gr4 ; hsr0, psr - lddi @(gr11,#8),gr6 ; isr, lr - movgs gr4,hsr0 - bar - -#ifdef CONFIG_MMU - sethi.p %hi(1f),gr11 - setlo %lo(1f),gr11 - jmpl @(gr11,gr0) -1: - movgs gr0,iampr1 ; get rid of temporary mapping -#endif - movgs gr5,psr - movgs gr6,isr - - #---------------------------------------------------- - # unlock the icache which was locked before going to sleep - #---------------------------------------------------- - li __icache_lock_start,gr3 - li __icache_lock_end,gr4 -1: icul gr3 - addi gr3,#L1_CACHE_BYTES,gr3 - cmp gr4,gr3,icc0 - bhi icc0,#0,1b - - #---------------------------------------------------- - # back to business as usual - #---------------------------------------------------- - jmpl @(gr7,gr0) ; - -#endif /* CONFIG_PM */ - -############################################################################### -# -# CPU core sleep mode routine -# -############################################################################### - .globl frv_cpu_core_sleep - .type frv_cpu_core_sleep,@function -frv_cpu_core_sleep: - - # Preload into icache. - li #__core_sleep_icache_lock_start,gr3 - li #__core_sleep_icache_lock_end,gr4 - -1: icpl gr3,gr0,#1 - addi gr3,#L1_CACHE_BYTES,gr3 - cmp gr4,gr3,icc0 - bhi icc0,#0,1b - - bra __core_sleep_icache_lock_start - - .balign L1_CACHE_BYTES -__core_sleep_icache_lock_start: - - # (1) Set the PSR register ET bit to 0 to disable interrupts. - movsg psr,gr8 - andi.p gr8,#~(PSR_PIL),gr8 - andi gr8,#~(PSR_ET),gr4 - movgs gr4,psr - -#if 0 // Fujitsu recommend to skip this and will update docs. - # (2) Set '1' to all bits in the MASK register of the interrupt - # controller and mask interrupts. - sethi.p %hi(__addr_MASK),gr9 - setlo %lo(__addr_MASK),gr9 - sethi.p %hi(0xffff0000),gr4 - setlo %lo(0xffff0000),gr4 - ldi @(gr9,#0),gr10 - sti gr4,@(gr9,#0) -#endif - # (3) Flush all data in the cache using the DCEF instruction. - dcef @(gr0,gr0),#1 - - # (4) Execute the memory barrier instruction - membar - - # (5) Set the GPIO register so that the IRQ[3:0] pins become valid, as required. - # (6) Set the clock mode (CLKC register) as required. - # - At this time, also set the CLKC register P0 bit. - # (7) Set the HSR0 register PDM field to 001 . - movsg hsr0,gr4 - ori gr4,HSR0_PDM_CORE_SLEEP,gr4 - movgs gr4,hsr0 - - # (8) Execute NOP 32 times. - .rept 32 - nop - .endr - -#if 0 // Fujitsu recommend to skip this and will update docs. - # (9) Release the interrupt mask setting of the MASK register of the - # interrupt controller if necessary. - sti gr10,@(gr9,#0) - membar -#endif - - # (10) Set the PSR register ET bit to 1 to enable interrupts. - movgs gr8,psr - -__core_sleep_icache_lock_end: - - # Unlock from icache - li __core_sleep_icache_lock_start,gr3 - li __core_sleep_icache_lock_end,gr4 -1: icul gr3 - addi gr3,#L1_CACHE_BYTES,gr3 - cmp gr4,gr3,icc0 - bhi icc0,#0,1b - - bralr - - .size frv_cpu_core_sleep, .-frv_cpu_core_sleep diff --git a/arch/frv/kernel/switch_to.S b/arch/frv/kernel/switch_to.S deleted file mode 100644 index b06668670fcc..000000000000 --- a/arch/frv/kernel/switch_to.S +++ /dev/null @@ -1,489 +0,0 @@ -############################################################################### -# -# switch_to.S: context switch operation -# -# Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. -# Written by David Howells (dhowells@redhat.com) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version -# 2 of the License, or (at your option) any later version. -# -############################################################################### - -#include -#include -#include -#include -#include - -.macro LEDS val - setlos #~\val,gr27 - st gr27,@(gr30,gr0) - membar - dcf @(gr30,gr0) -.endm - - .section .sdata - .balign 8 - - # address of frame 0 (userspace) on current kernel stack - .globl __kernel_frame0_ptr -__kernel_frame0_ptr: - .long init_thread_union + THREAD_SIZE - FRV_FRAME0_SIZE - - # address of current task - .globl __kernel_current_task -__kernel_current_task: - .long init_task - - .section .text - .balign 4 - -############################################################################### -# -# struct task_struct *__switch_to(struct thread_struct *prev_thread, -# struct thread_struct *next_thread, -# struct task_struct *prev) -# -############################################################################### - .globl __switch_to -__switch_to: - # save outgoing process's context - sethi.p %hi(__switch_back),gr13 - setlo %lo(__switch_back),gr13 - movsg lr,gr12 - - stdi gr28,@(gr8,#__THREAD_FRAME) - sti sp ,@(gr8,#__THREAD_SP) - sti fp ,@(gr8,#__THREAD_FP) - stdi gr12,@(gr8,#__THREAD_LR) - stdi gr16,@(gr8,#__THREAD_GR(16)) - stdi gr18,@(gr8,#__THREAD_GR(18)) - stdi gr20,@(gr8,#__THREAD_GR(20)) - stdi gr22,@(gr8,#__THREAD_GR(22)) - stdi gr24,@(gr8,#__THREAD_GR(24)) - stdi.p gr26,@(gr8,#__THREAD_GR(26)) - - or gr8,gr8,gr22 - ldi.p @(gr8,#__THREAD_USER),gr8 - call save_user_regs - or gr22,gr22,gr8 - - # retrieve the new context - sethi.p %hi(__kernel_frame0_ptr),gr6 - setlo %lo(__kernel_frame0_ptr),gr6 - movsg psr,gr4 - - lddi.p @(gr9,#__THREAD_FRAME),gr10 - or gr10,gr10,gr27 ; save prev for the return value - - ldi @(gr11,#4),gr19 ; get new_current->thread_info - - lddi @(gr9,#__THREAD_SP),gr12 - ldi @(gr9,#__THREAD_LR),gr14 - ldi @(gr9,#__THREAD_PC),gr18 - ldi.p @(gr9,#__THREAD_FRAME0),gr7 - - # actually switch kernel contexts with ordinary exceptions disabled - andi gr4,#~PSR_ET,gr5 - movgs gr5,psr - - or.p gr10,gr0,gr28 ; set __frame - or gr11,gr0,gr29 ; set __current - or.p gr12,gr0,sp - or gr13,gr0,fp - or gr19,gr0,gr15 ; set __current_thread_info - - sti gr7,@(gr6,#0) ; set __kernel_frame0_ptr - sti gr29,@(gr6,#4) ; set __kernel_current_task - - movgs gr14,lr - bar - - # jump to __switch_back or ret_from_fork as appropriate - # - move prev to GR8 - movgs gr4,psr - jmpl.p @(gr18,gr0) - or gr27,gr27,gr8 - -############################################################################### -# -# restore incoming process's context -# - on entry: -# - SP, FP, LR, GR15, GR28 and GR29 will have been set up appropriately -# - GR8 will point to the outgoing task_struct -# - GR9 will point to the incoming thread_struct -# -############################################################################### -__switch_back: - lddi @(gr9,#__THREAD_GR(16)),gr16 - lddi @(gr9,#__THREAD_GR(18)),gr18 - lddi @(gr9,#__THREAD_GR(20)),gr20 - lddi @(gr9,#__THREAD_GR(22)),gr22 - lddi @(gr9,#__THREAD_GR(24)),gr24 - lddi @(gr9,#__THREAD_GR(26)),gr26 - - # fall through into restore_user_regs() - ldi.p @(gr9,#__THREAD_USER),gr8 - or gr8,gr8,gr9 - -############################################################################### -# -# restore extra general regs and FP/Media regs -# - void *restore_user_regs(const struct user_context *target, void *retval) -# - on entry: -# - GR8 will point to the user context to swap in -# - GR9 will contain the value to be returned in GR8 (prev task on context switch) -# -############################################################################### - .globl restore_user_regs -restore_user_regs: - movsg hsr0,gr6 - ori gr6,#HSR0_GRHE|HSR0_FRLE|HSR0_FRHE,gr6 - movgs gr6,hsr0 - movsg hsr0,gr6 - - movsg psr,gr7 - ori gr7,#PSR_EF|PSR_EM,gr7 - movgs gr7,psr - movsg psr,gr7 - srli gr7,#24,gr7 - bar - - lddi @(gr8,#__FPMEDIA_MSR(0)),gr4 - - movgs gr4,msr0 - movgs gr5,msr1 - - lddfi @(gr8,#__FPMEDIA_ACC(0)),fr16 - lddfi @(gr8,#__FPMEDIA_ACC(2)),fr18 - ldbfi @(gr8,#__FPMEDIA_ACCG(0)),fr20 - ldbfi @(gr8,#__FPMEDIA_ACCG(1)),fr21 - ldbfi @(gr8,#__FPMEDIA_ACCG(2)),fr22 - ldbfi @(gr8,#__FPMEDIA_ACCG(3)),fr23 - - mwtacc fr16,acc0 - mwtacc fr17,acc1 - mwtacc fr18,acc2 - mwtacc fr19,acc3 - mwtaccg fr20,accg0 - mwtaccg fr21,accg1 - mwtaccg fr22,accg2 - mwtaccg fr23,accg3 - - # some CPUs have extra ACCx and ACCGx regs and maybe FSRx regs - subicc.p gr7,#0x50,gr0,icc0 - subicc gr7,#0x31,gr0,icc1 - beq icc0,#0,__restore_acc_fr451 - beq icc1,#0,__restore_acc_fr555 -__restore_acc_cont: - - # some CPU's have GR32-GR63 - setlos #HSR0_FRHE,gr4 - andcc gr6,gr4,gr0,icc0 - beq icc0,#1,__restore_skip_gr32_gr63 - - lddi @(gr8,#__INT_GR(32)),gr32 - lddi @(gr8,#__INT_GR(34)),gr34 - lddi @(gr8,#__INT_GR(36)),gr36 - lddi @(gr8,#__INT_GR(38)),gr38 - lddi @(gr8,#__INT_GR(40)),gr40 - lddi @(gr8,#__INT_GR(42)),gr42 - lddi @(gr8,#__INT_GR(44)),gr44 - lddi @(gr8,#__INT_GR(46)),gr46 - lddi @(gr8,#__INT_GR(48)),gr48 - lddi @(gr8,#__INT_GR(50)),gr50 - lddi @(gr8,#__INT_GR(52)),gr52 - lddi @(gr8,#__INT_GR(54)),gr54 - lddi @(gr8,#__INT_GR(56)),gr56 - lddi @(gr8,#__INT_GR(58)),gr58 - lddi @(gr8,#__INT_GR(60)),gr60 - lddi @(gr8,#__INT_GR(62)),gr62 -__restore_skip_gr32_gr63: - - # all CPU's have FR0-FR31 - lddfi @(gr8,#__FPMEDIA_FR( 0)),fr0 - lddfi @(gr8,#__FPMEDIA_FR( 2)),fr2 - lddfi @(gr8,#__FPMEDIA_FR( 4)),fr4 - lddfi @(gr8,#__FPMEDIA_FR( 6)),fr6 - lddfi @(gr8,#__FPMEDIA_FR( 8)),fr8 - lddfi @(gr8,#__FPMEDIA_FR(10)),fr10 - lddfi @(gr8,#__FPMEDIA_FR(12)),fr12 - lddfi @(gr8,#__FPMEDIA_FR(14)),fr14 - lddfi @(gr8,#__FPMEDIA_FR(16)),fr16 - lddfi @(gr8,#__FPMEDIA_FR(18)),fr18 - lddfi @(gr8,#__FPMEDIA_FR(20)),fr20 - lddfi @(gr8,#__FPMEDIA_FR(22)),fr22 - lddfi @(gr8,#__FPMEDIA_FR(24)),fr24 - lddfi @(gr8,#__FPMEDIA_FR(26)),fr26 - lddfi @(gr8,#__FPMEDIA_FR(28)),fr28 - lddfi.p @(gr8,#__FPMEDIA_FR(30)),fr30 - - # some CPU's have FR32-FR63 - setlos #HSR0_FRHE,gr4 - andcc gr6,gr4,gr0,icc0 - beq icc0,#1,__restore_skip_fr32_fr63 - - lddfi @(gr8,#__FPMEDIA_FR(32)),fr32 - lddfi @(gr8,#__FPMEDIA_FR(34)),fr34 - lddfi @(gr8,#__FPMEDIA_FR(36)),fr36 - lddfi @(gr8,#__FPMEDIA_FR(38)),fr38 - lddfi @(gr8,#__FPMEDIA_FR(40)),fr40 - lddfi @(gr8,#__FPMEDIA_FR(42)),fr42 - lddfi @(gr8,#__FPMEDIA_FR(44)),fr44 - lddfi @(gr8,#__FPMEDIA_FR(46)),fr46 - lddfi @(gr8,#__FPMEDIA_FR(48)),fr48 - lddfi @(gr8,#__FPMEDIA_FR(50)),fr50 - lddfi @(gr8,#__FPMEDIA_FR(52)),fr52 - lddfi @(gr8,#__FPMEDIA_FR(54)),fr54 - lddfi @(gr8,#__FPMEDIA_FR(56)),fr56 - lddfi @(gr8,#__FPMEDIA_FR(58)),fr58 - lddfi @(gr8,#__FPMEDIA_FR(60)),fr60 - lddfi @(gr8,#__FPMEDIA_FR(62)),fr62 -__restore_skip_fr32_fr63: - - lddi @(gr8,#__FPMEDIA_FNER(0)),gr4 - movsg fner0,gr4 - movsg fner1,gr5 - or.p gr9,gr9,gr8 - bralr - - # the FR451 also has ACC8-11/ACCG8-11 regs (but not 4-7...) -__restore_acc_fr451: - lddfi @(gr8,#__FPMEDIA_ACC(4)),fr16 - lddfi @(gr8,#__FPMEDIA_ACC(6)),fr18 - ldbfi @(gr8,#__FPMEDIA_ACCG(4)),fr20 - ldbfi @(gr8,#__FPMEDIA_ACCG(5)),fr21 - ldbfi @(gr8,#__FPMEDIA_ACCG(6)),fr22 - ldbfi @(gr8,#__FPMEDIA_ACCG(7)),fr23 - - mwtacc fr16,acc8 - mwtacc fr17,acc9 - mwtacc fr18,acc10 - mwtacc fr19,acc11 - mwtaccg fr20,accg8 - mwtaccg fr21,accg9 - mwtaccg fr22,accg10 - mwtaccg fr23,accg11 - bra __restore_acc_cont - - # the FR555 also has ACC4-7/ACCG4-7 regs and an FSR0 reg -__restore_acc_fr555: - lddfi @(gr8,#__FPMEDIA_ACC(4)),fr16 - lddfi @(gr8,#__FPMEDIA_ACC(6)),fr18 - ldbfi @(gr8,#__FPMEDIA_ACCG(4)),fr20 - ldbfi @(gr8,#__FPMEDIA_ACCG(5)),fr21 - ldbfi @(gr8,#__FPMEDIA_ACCG(6)),fr22 - ldbfi @(gr8,#__FPMEDIA_ACCG(7)),fr23 - - mnop.p - mwtacc fr16,acc4 - mnop.p - mwtacc fr17,acc5 - mnop.p - mwtacc fr18,acc6 - mnop.p - mwtacc fr19,acc7 - mnop.p - mwtaccg fr20,accg4 - mnop.p - mwtaccg fr21,accg5 - mnop.p - mwtaccg fr22,accg6 - mnop.p - mwtaccg fr23,accg7 - - ldi @(gr8,#__FPMEDIA_FSR(0)),gr4 - movgs gr4,fsr0 - - bra __restore_acc_cont - - -############################################################################### -# -# save extra general regs and FP/Media regs -# - void save_user_regs(struct user_context *target) -# -############################################################################### - .globl save_user_regs -save_user_regs: - movsg hsr0,gr6 - ori gr6,#HSR0_GRHE|HSR0_FRLE|HSR0_FRHE,gr6 - movgs gr6,hsr0 - movsg hsr0,gr6 - - movsg psr,gr7 - ori gr7,#PSR_EF|PSR_EM,gr7 - movgs gr7,psr - movsg psr,gr7 - srli gr7,#24,gr7 - bar - - movsg fner0,gr4 - movsg fner1,gr5 - stdi.p gr4,@(gr8,#__FPMEDIA_FNER(0)) - - # some CPU's have GR32-GR63 - setlos #HSR0_GRHE,gr4 - andcc gr6,gr4,gr0,icc0 - beq icc0,#1,__save_skip_gr32_gr63 - - stdi gr32,@(gr8,#__INT_GR(32)) - stdi gr34,@(gr8,#__INT_GR(34)) - stdi gr36,@(gr8,#__INT_GR(36)) - stdi gr38,@(gr8,#__INT_GR(38)) - stdi gr40,@(gr8,#__INT_GR(40)) - stdi gr42,@(gr8,#__INT_GR(42)) - stdi gr44,@(gr8,#__INT_GR(44)) - stdi gr46,@(gr8,#__INT_GR(46)) - stdi gr48,@(gr8,#__INT_GR(48)) - stdi gr50,@(gr8,#__INT_GR(50)) - stdi gr52,@(gr8,#__INT_GR(52)) - stdi gr54,@(gr8,#__INT_GR(54)) - stdi gr56,@(gr8,#__INT_GR(56)) - stdi gr58,@(gr8,#__INT_GR(58)) - stdi gr60,@(gr8,#__INT_GR(60)) - stdi gr62,@(gr8,#__INT_GR(62)) -__save_skip_gr32_gr63: - - # all CPU's have FR0-FR31 - stdfi fr0 ,@(gr8,#__FPMEDIA_FR( 0)) - stdfi fr2 ,@(gr8,#__FPMEDIA_FR( 2)) - stdfi fr4 ,@(gr8,#__FPMEDIA_FR( 4)) - stdfi fr6 ,@(gr8,#__FPMEDIA_FR( 6)) - stdfi fr8 ,@(gr8,#__FPMEDIA_FR( 8)) - stdfi fr10,@(gr8,#__FPMEDIA_FR(10)) - stdfi fr12,@(gr8,#__FPMEDIA_FR(12)) - stdfi fr14,@(gr8,#__FPMEDIA_FR(14)) - stdfi fr16,@(gr8,#__FPMEDIA_FR(16)) - stdfi fr18,@(gr8,#__FPMEDIA_FR(18)) - stdfi fr20,@(gr8,#__FPMEDIA_FR(20)) - stdfi fr22,@(gr8,#__FPMEDIA_FR(22)) - stdfi fr24,@(gr8,#__FPMEDIA_FR(24)) - stdfi fr26,@(gr8,#__FPMEDIA_FR(26)) - stdfi fr28,@(gr8,#__FPMEDIA_FR(28)) - stdfi.p fr30,@(gr8,#__FPMEDIA_FR(30)) - - # some CPU's have FR32-FR63 - setlos #HSR0_FRHE,gr4 - andcc gr6,gr4,gr0,icc0 - beq icc0,#1,__save_skip_fr32_fr63 - - stdfi fr32,@(gr8,#__FPMEDIA_FR(32)) - stdfi fr34,@(gr8,#__FPMEDIA_FR(34)) - stdfi fr36,@(gr8,#__FPMEDIA_FR(36)) - stdfi fr38,@(gr8,#__FPMEDIA_FR(38)) - stdfi fr40,@(gr8,#__FPMEDIA_FR(40)) - stdfi fr42,@(gr8,#__FPMEDIA_FR(42)) - stdfi fr44,@(gr8,#__FPMEDIA_FR(44)) - stdfi fr46,@(gr8,#__FPMEDIA_FR(46)) - stdfi fr48,@(gr8,#__FPMEDIA_FR(48)) - stdfi fr50,@(gr8,#__FPMEDIA_FR(50)) - stdfi fr52,@(gr8,#__FPMEDIA_FR(52)) - stdfi fr54,@(gr8,#__FPMEDIA_FR(54)) - stdfi fr56,@(gr8,#__FPMEDIA_FR(56)) - stdfi fr58,@(gr8,#__FPMEDIA_FR(58)) - stdfi fr60,@(gr8,#__FPMEDIA_FR(60)) - stdfi fr62,@(gr8,#__FPMEDIA_FR(62)) -__save_skip_fr32_fr63: - - mrdacc acc0 ,fr4 - mrdacc acc1 ,fr5 - - stdfi.p fr4 ,@(gr8,#__FPMEDIA_ACC(0)) - - mrdacc acc2 ,fr6 - mrdacc acc3 ,fr7 - - stdfi.p fr6 ,@(gr8,#__FPMEDIA_ACC(2)) - - mrdaccg accg0,fr4 - stbfi.p fr4 ,@(gr8,#__FPMEDIA_ACCG(0)) - - mrdaccg accg1,fr5 - stbfi.p fr5 ,@(gr8,#__FPMEDIA_ACCG(1)) - - mrdaccg accg2,fr6 - stbfi.p fr6 ,@(gr8,#__FPMEDIA_ACCG(2)) - - mrdaccg accg3,fr7 - stbfi fr7 ,@(gr8,#__FPMEDIA_ACCG(3)) - - movsg msr0 ,gr4 - movsg msr1 ,gr5 - - stdi gr4 ,@(gr8,#__FPMEDIA_MSR(0)) - - # some CPUs have extra ACCx and ACCGx regs and maybe FSRx regs - subicc.p gr7,#0x50,gr0,icc0 - subicc gr7,#0x31,gr0,icc1 - beq icc0,#0,__save_acc_fr451 - beq icc1,#0,__save_acc_fr555 -__save_acc_cont: - - lddfi @(gr8,#__FPMEDIA_FR(4)),fr4 - lddfi.p @(gr8,#__FPMEDIA_FR(6)),fr6 - bralr - - # the FR451 also has ACC8-11/ACCG8-11 regs (but not 4-7...) -__save_acc_fr451: - mrdacc acc8 ,fr4 - mrdacc acc9 ,fr5 - - stdfi.p fr4 ,@(gr8,#__FPMEDIA_ACC(4)) - - mrdacc acc10,fr6 - mrdacc acc11,fr7 - - stdfi.p fr6 ,@(gr8,#__FPMEDIA_ACC(6)) - - mrdaccg accg8,fr4 - stbfi.p fr4 ,@(gr8,#__FPMEDIA_ACCG(4)) - - mrdaccg accg9,fr5 - stbfi.p fr5 ,@(gr8,#__FPMEDIA_ACCG(5)) - - mrdaccg accg10,fr6 - stbfi.p fr6 ,@(gr8,#__FPMEDIA_ACCG(6)) - - mrdaccg accg11,fr7 - stbfi fr7 ,@(gr8,#__FPMEDIA_ACCG(7)) - bra __save_acc_cont - - # the FR555 also has ACC4-7/ACCG4-7 regs and an FSR0 reg -__save_acc_fr555: - mnop.p - mrdacc acc4 ,fr4 - mnop.p - mrdacc acc5 ,fr5 - - stdfi fr4 ,@(gr8,#__FPMEDIA_ACC(4)) - - mnop.p - mrdacc acc6 ,fr6 - mnop.p - mrdacc acc7 ,fr7 - - stdfi fr6 ,@(gr8,#__FPMEDIA_ACC(6)) - - mnop.p - mrdaccg accg4,fr4 - stbfi fr4 ,@(gr8,#__FPMEDIA_ACCG(4)) - - mnop.p - mrdaccg accg5,fr5 - stbfi fr5 ,@(gr8,#__FPMEDIA_ACCG(5)) - - mnop.p - mrdaccg accg6,fr6 - stbfi fr6 ,@(gr8,#__FPMEDIA_ACCG(6)) - - mnop.p - mrdaccg accg7,fr7 - stbfi fr7 ,@(gr8,#__FPMEDIA_ACCG(7)) - - movsg fsr0 ,gr4 - sti gr4 ,@(gr8,#__FPMEDIA_FSR(0)) - bra __save_acc_cont diff --git a/arch/frv/kernel/sys_frv.c b/arch/frv/kernel/sys_frv.c deleted file mode 100644 index f80cc8b9bd45..000000000000 --- a/arch/frv/kernel/sys_frv.c +++ /dev/null @@ -1,44 +0,0 @@ -/* sys_frv.c: FRV arch-specific syscall wrappers - * - * Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from arch/m68k/kernel/sys_m68k.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long pgoff) -{ - /* As with sparc32, make sure the shift for mmap2 is constant - (12), no matter what PAGE_SIZE we have.... */ - - /* But unlike sparc32, don't just silently break if we're - trying to map something we can't */ - if (pgoff & ((1 << (PAGE_SHIFT - 12)) - 1)) - return -EINVAL; - - return sys_mmap_pgoff(addr, len, prot, flags, fd, - pgoff >> (PAGE_SHIFT - 12)); -} diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c deleted file mode 100644 index b54a64971cf1..000000000000 --- a/arch/frv/kernel/sysctl.c +++ /dev/null @@ -1,221 +0,0 @@ -/* sysctl.c: implementation of /proc/sys files relating to FRV specifically - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include - -static const char frv_cache_wback[] = "wback"; -static const char frv_cache_wthru[] = "wthru"; - -static void frv_change_dcache_mode(unsigned long newmode) -{ - unsigned long flags, hsr0; - - local_irq_save(flags); - - hsr0 = __get_HSR(0); - hsr0 &= ~HSR0_DCE; - __set_HSR(0, hsr0); - - asm volatile(" dcef @(gr0,gr0),#1 \n" - " membar \n" - : : : "memory" - ); - - hsr0 = (hsr0 & ~HSR0_CBM) | newmode; - __set_HSR(0, hsr0); - hsr0 |= HSR0_DCE; - __set_HSR(0, hsr0); - - local_irq_restore(flags); - - //printk("HSR0 now %08lx\n", hsr0); -} - -/*****************************************************************************/ -/* - * handle requests to dynamically switch the write caching mode delivered by /proc - */ -static int procctl_frv_cachemode(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, - loff_t *ppos) -{ - unsigned long hsr0; - char buff[8]; - int len; - - len = *lenp; - - if (write) { - /* potential state change */ - if (len <= 1 || len > sizeof(buff) - 1) - return -EINVAL; - - if (copy_from_user(buff, buffer, len) != 0) - return -EFAULT; - - if (buff[len - 1] == '\n') - buff[len - 1] = '\0'; - else - buff[len] = '\0'; - - if (strcmp(buff, frv_cache_wback) == 0) { - /* switch dcache into write-back mode */ - frv_change_dcache_mode(HSR0_CBM_COPY_BACK); - return 0; - } - - if (strcmp(buff, frv_cache_wthru) == 0) { - /* switch dcache into write-through mode */ - frv_change_dcache_mode(HSR0_CBM_WRITE_THRU); - return 0; - } - - return -EINVAL; - } - - /* read the state */ - if (*ppos > 0) { - *lenp = 0; - return 0; - } - - hsr0 = __get_HSR(0); - switch (hsr0 & HSR0_CBM) { - case HSR0_CBM_WRITE_THRU: - memcpy(buff, frv_cache_wthru, sizeof(frv_cache_wthru) - 1); - buff[sizeof(frv_cache_wthru) - 1] = '\n'; - len = sizeof(frv_cache_wthru); - break; - default: - memcpy(buff, frv_cache_wback, sizeof(frv_cache_wback) - 1); - buff[sizeof(frv_cache_wback) - 1] = '\n'; - len = sizeof(frv_cache_wback); - break; - } - - if (len > *lenp) - len = *lenp; - - if (copy_to_user(buffer, buff, len) != 0) - return -EFAULT; - - *lenp = len; - *ppos = len; - return 0; - -} /* end procctl_frv_cachemode() */ - -/*****************************************************************************/ -/* - * permit the mm_struct the nominated process is using have its MMU context ID pinned - */ -#ifdef CONFIG_MMU -static int procctl_frv_pin_cxnr(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, - loff_t *ppos) -{ - pid_t pid; - char buff[16], *p; - int len; - - len = *lenp; - - if (write) { - /* potential state change */ - if (len <= 1 || len > sizeof(buff) - 1) - return -EINVAL; - - if (copy_from_user(buff, buffer, len) != 0) - return -EFAULT; - - if (buff[len - 1] == '\n') - buff[len - 1] = '\0'; - else - buff[len] = '\0'; - - pid = simple_strtoul(buff, &p, 10); - if (*p) - return -EINVAL; - - return cxn_pin_by_pid(pid); - } - - /* read the currently pinned CXN */ - if (*ppos > 0) { - *lenp = 0; - return 0; - } - - len = snprintf(buff, sizeof(buff), "%d\n", cxn_pinned); - if (len > *lenp) - len = *lenp; - - if (copy_to_user(buffer, buff, len) != 0) - return -EFAULT; - - *lenp = len; - *ppos = len; - return 0; - -} /* end procctl_frv_pin_cxnr() */ -#endif - -/* - * FR-V specific sysctls - */ -static struct ctl_table frv_table[] = -{ - { - .procname = "cache-mode", - .data = NULL, - .maxlen = 0, - .mode = 0644, - .proc_handler = procctl_frv_cachemode, - }, -#ifdef CONFIG_MMU - { - .procname = "pin-cxnr", - .data = NULL, - .maxlen = 0, - .mode = 0644, - .proc_handler = procctl_frv_pin_cxnr - }, -#endif - {} -}; - -/* - * Use a temporary sysctl number. Horrid, but will be cleaned up in 2.6 - * when all the PM interfaces exist nicely. - */ -static struct ctl_table frv_dir_table[] = -{ - { - .procname = "frv", - .mode = 0555, - .child = frv_table - }, - {} -}; - -/* - * Initialize power interface - */ -static int __init frv_sysctl_init(void) -{ - register_sysctl_table(frv_dir_table); - return 0; -} - -__initcall(frv_sysctl_init); diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c deleted file mode 100644 index 332e00bf9d06..000000000000 --- a/arch/frv/kernel/time.c +++ /dev/null @@ -1,122 +0,0 @@ -/* time.c: FRV arch-specific time handling - * - * Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from arch/m68k/kernel/time.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#define TICK_SIZE (tick_nsec / 1000) - -unsigned long __nongprelbss __clkin_clock_speed_HZ; -unsigned long __nongprelbss __ext_bus_clock_speed_HZ; -unsigned long __nongprelbss __res_bus_clock_speed_HZ; -unsigned long __nongprelbss __sdram_clock_speed_HZ; -unsigned long __nongprelbss __core_bus_clock_speed_HZ; -unsigned long __nongprelbss __core_clock_speed_HZ; -unsigned long __nongprelbss __dsu_clock_speed_HZ; -unsigned long __nongprelbss __serial_clock_speed_HZ; -unsigned long __delay_loops_MHz; - -static irqreturn_t timer_interrupt(int irq, void *dummy); - -static struct irqaction timer_irq = { - .handler = timer_interrupt, - .name = "timer", -}; - -/* - * timer_interrupt() needs to keep up the real-time clock, - * as well as call the "xtime_update()" routine every clocktick - */ -static irqreturn_t timer_interrupt(int irq, void *dummy) -{ - profile_tick(CPU_PROFILING); - - xtime_update(1); - -#ifdef CONFIG_HEARTBEAT - static unsigned short n; - n++; - __set_LEDS(n); -#endif /* CONFIG_HEARTBEAT */ - - update_process_times(user_mode(get_irq_regs())); - - return IRQ_HANDLED; -} - -void time_divisor_init(void) -{ - unsigned short base, pre, prediv; - - /* set the scheduling timer going */ - pre = 1; - prediv = 4; - base = __res_bus_clock_speed_HZ / pre / HZ / (1 << prediv); - - __set_TPRV(pre); - __set_TxCKSL_DATA(0, prediv); - __set_TCTR(TCTR_SC_CTR0 | TCTR_RL_RW_LH8 | TCTR_MODE_2); - __set_TCSR_DATA(0, base & 0xff); - __set_TCSR_DATA(0, base >> 8); -} - - -void read_persistent_clock(struct timespec *ts) -{ - unsigned int year, mon, day, hour, min, sec; - - extern void arch_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec); - - /* FIX by dqg : Set to zero for platforms that don't have tod */ - /* without this time is undefined and can overflow time_t, causing */ - /* very strange errors */ - year = 1980; - mon = day = 1; - hour = min = sec = 0; - arch_gettod (&year, &mon, &day, &hour, &min, &sec); - - if ((year += 1900) < 1970) - year += 100; - ts->tv_sec = mktime(year, mon, day, hour, min, sec); - ts->tv_nsec = 0; -} - -void time_init(void) -{ - /* install scheduling interrupt handler */ - setup_irq(IRQ_CPU_TIMER0, &timer_irq); - - time_divisor_init(); -} - -/* - * Scheduler clock - returns current time in nanosec units. - */ -unsigned long long sched_clock(void) -{ - return jiffies_64 * (1000000000 / HZ); -} diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c deleted file mode 100644 index fb08ebe0dab4..000000000000 --- a/arch/frv/kernel/traps.c +++ /dev/null @@ -1,642 +0,0 @@ -/* traps.c: high-level exception handler for FR-V - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -void show_backtrace(struct pt_regs *, unsigned long); - -extern asmlinkage void __break_hijack_kernel_event(void); - -/*****************************************************************************/ -/* - * instruction access error - */ -asmlinkage void insn_access_error(unsigned long esfr1, unsigned long epcr0, unsigned long esr0) -{ - siginfo_t info; - - die_if_kernel("-- Insn Access Error --\n" - "EPCR0 : %08lx\n" - "ESR0 : %08lx\n", - epcr0, esr0); - - info.si_signo = SIGSEGV; - info.si_code = SEGV_ACCERR; - info.si_errno = 0; - info.si_addr = (void __user *) ((epcr0 & EPCR0_V) ? (epcr0 & EPCR0_PC) : __frame->pc); - - force_sig_info(info.si_signo, &info, current); -} /* end insn_access_error() */ - -/*****************************************************************************/ -/* - * handler for: - * - illegal instruction - * - privileged instruction - * - unsupported trap - * - debug exceptions - */ -asmlinkage void illegal_instruction(unsigned long esfr1, unsigned long epcr0, unsigned long esr0) -{ - siginfo_t info; - - die_if_kernel("-- Illegal Instruction --\n" - "EPCR0 : %08lx\n" - "ESR0 : %08lx\n" - "ESFR1 : %08lx\n", - epcr0, esr0, esfr1); - - info.si_errno = 0; - info.si_addr = (void __user *) ((epcr0 & EPCR0_V) ? (epcr0 & EPCR0_PC) : __frame->pc); - - switch (__frame->tbr & TBR_TT) { - case TBR_TT_ILLEGAL_INSTR: - info.si_signo = SIGILL; - info.si_code = ILL_ILLOPC; - break; - case TBR_TT_PRIV_INSTR: - info.si_signo = SIGILL; - info.si_code = ILL_PRVOPC; - break; - case TBR_TT_TRAP2 ... TBR_TT_TRAP126: - info.si_signo = SIGILL; - info.si_code = ILL_ILLTRP; - break; - /* GDB uses "tira gr0, #1" as a breakpoint instruction. */ - case TBR_TT_TRAP1: - case TBR_TT_BREAK: - info.si_signo = SIGTRAP; - info.si_code = - (__frame->__status & REG__STATUS_STEPPED) ? TRAP_TRACE : TRAP_BRKPT; - break; - } - - force_sig_info(info.si_signo, &info, current); -} /* end illegal_instruction() */ - -/*****************************************************************************/ -/* - * handle atomic operations with errors - * - arguments in gr8, gr9, gr10 - * - original memory value placed in gr5 - * - replacement memory value placed in gr9 - */ -asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0, - unsigned long esr0) -{ - static DEFINE_SPINLOCK(atomic_op_lock); - unsigned long x, y, z; - unsigned long __user *p; - mm_segment_t oldfs; - siginfo_t info; - int ret; - - y = 0; - z = 0; - - oldfs = get_fs(); - if (!user_mode(__frame)) - set_fs(KERNEL_DS); - - switch (__frame->tbr & TBR_TT) { - /* TIRA gr0,#120 - * u32 __atomic_user_cmpxchg32(u32 *ptr, u32 test, u32 new) - */ - case TBR_TT_ATOMIC_CMPXCHG32: - p = (unsigned long __user *) __frame->gr8; - x = __frame->gr9; - y = __frame->gr10; - - for (;;) { - ret = get_user(z, p); - if (ret < 0) - goto error; - - if (z != x) - goto done; - - spin_lock_irq(&atomic_op_lock); - - if (__get_user(z, p) == 0) { - if (z != x) - goto done2; - - if (__put_user(y, p) == 0) - goto done2; - goto error2; - } - - spin_unlock_irq(&atomic_op_lock); - } - - /* TIRA gr0,#121 - * u32 __atomic_kernel_xchg32(void *v, u32 new) - */ - case TBR_TT_ATOMIC_XCHG32: - p = (unsigned long __user *) __frame->gr8; - y = __frame->gr9; - - for (;;) { - ret = get_user(z, p); - if (ret < 0) - goto error; - - spin_lock_irq(&atomic_op_lock); - - if (__get_user(z, p) == 0) { - if (__put_user(y, p) == 0) - goto done2; - goto error2; - } - - spin_unlock_irq(&atomic_op_lock); - } - - /* TIRA gr0,#122 - * ulong __atomic_kernel_XOR_return(ulong i, ulong *v) - */ - case TBR_TT_ATOMIC_XOR: - p = (unsigned long __user *) __frame->gr8; - x = __frame->gr9; - - for (;;) { - ret = get_user(z, p); - if (ret < 0) - goto error; - - spin_lock_irq(&atomic_op_lock); - - if (__get_user(z, p) == 0) { - y = x ^ z; - if (__put_user(y, p) == 0) - goto done2; - goto error2; - } - - spin_unlock_irq(&atomic_op_lock); - } - - /* TIRA gr0,#123 - * ulong __atomic_kernel_OR_return(ulong i, ulong *v) - */ - case TBR_TT_ATOMIC_OR: - p = (unsigned long __user *) __frame->gr8; - x = __frame->gr9; - - for (;;) { - ret = get_user(z, p); - if (ret < 0) - goto error; - - spin_lock_irq(&atomic_op_lock); - - if (__get_user(z, p) == 0) { - y = x ^ z; - if (__put_user(y, p) == 0) - goto done2; - goto error2; - } - - spin_unlock_irq(&atomic_op_lock); - } - - /* TIRA gr0,#124 - * ulong __atomic_kernel_AND_return(ulong i, ulong *v) - */ - case TBR_TT_ATOMIC_AND: - p = (unsigned long __user *) __frame->gr8; - x = __frame->gr9; - - for (;;) { - ret = get_user(z, p); - if (ret < 0) - goto error; - - spin_lock_irq(&atomic_op_lock); - - if (__get_user(z, p) == 0) { - y = x & z; - if (__put_user(y, p) == 0) - goto done2; - goto error2; - } - - spin_unlock_irq(&atomic_op_lock); - } - - /* TIRA gr0,#125 - * int __atomic_user_sub_return(atomic_t *v, int i) - */ - case TBR_TT_ATOMIC_SUB: - p = (unsigned long __user *) __frame->gr8; - x = __frame->gr9; - - for (;;) { - ret = get_user(z, p); - if (ret < 0) - goto error; - - spin_lock_irq(&atomic_op_lock); - - if (__get_user(z, p) == 0) { - y = z - x; - if (__put_user(y, p) == 0) - goto done2; - goto error2; - } - - spin_unlock_irq(&atomic_op_lock); - } - - /* TIRA gr0,#126 - * int __atomic_user_add_return(atomic_t *v, int i) - */ - case TBR_TT_ATOMIC_ADD: - p = (unsigned long __user *) __frame->gr8; - x = __frame->gr9; - - for (;;) { - ret = get_user(z, p); - if (ret < 0) - goto error; - - spin_lock_irq(&atomic_op_lock); - - if (__get_user(z, p) == 0) { - y = z + x; - if (__put_user(y, p) == 0) - goto done2; - goto error2; - } - - spin_unlock_irq(&atomic_op_lock); - } - - default: - BUG(); - } - -done2: - spin_unlock_irq(&atomic_op_lock); -done: - if (!user_mode(__frame)) - set_fs(oldfs); - __frame->gr5 = z; - __frame->gr9 = y; - return; - -error2: - spin_unlock_irq(&atomic_op_lock); -error: - if (!user_mode(__frame)) - set_fs(oldfs); - __frame->pc -= 4; - - die_if_kernel("-- Atomic Op Error --\n"); - - info.si_signo = SIGSEGV; - info.si_code = SEGV_ACCERR; - info.si_errno = 0; - info.si_addr = (void __user *) __frame->pc; - - force_sig_info(info.si_signo, &info, current); -} - -/*****************************************************************************/ -/* - * - */ -asmlinkage void media_exception(unsigned long msr0, unsigned long msr1) -{ - siginfo_t info; - - die_if_kernel("-- Media Exception --\n" - "MSR0 : %08lx\n" - "MSR1 : %08lx\n", - msr0, msr1); - - info.si_signo = SIGFPE; - info.si_code = FPE_MDAOVF; - info.si_errno = 0; - info.si_addr = (void __user *) __frame->pc; - - force_sig_info(info.si_signo, &info, current); -} /* end media_exception() */ - -/*****************************************************************************/ -/* - * instruction or data access exception - */ -asmlinkage void memory_access_exception(unsigned long esr0, - unsigned long ear0, - unsigned long epcr0) -{ - siginfo_t info; - -#ifdef CONFIG_MMU - if (fixup_exception(__frame)) - return; -#endif - - die_if_kernel("-- Memory Access Exception --\n" - "ESR0 : %08lx\n" - "EAR0 : %08lx\n" - "EPCR0 : %08lx\n", - esr0, ear0, epcr0); - - info.si_signo = SIGSEGV; - info.si_code = SEGV_ACCERR; - info.si_errno = 0; - info.si_addr = NULL; - - if ((esr0 & (ESRx_VALID | ESR0_EAV)) == (ESRx_VALID | ESR0_EAV)) - info.si_addr = (void __user *) ear0; - - force_sig_info(info.si_signo, &info, current); - -} /* end memory_access_exception() */ - -/*****************************************************************************/ -/* - * data access error - * - double-word data load from CPU control area (0xFExxxxxx) - * - read performed on inactive or self-refreshing SDRAM - * - error notification from slave device - * - misaligned address - * - access to out of bounds memory region - * - user mode accessing privileged memory region - * - write to R/O memory region - */ -asmlinkage void data_access_error(unsigned long esfr1, unsigned long esr15, unsigned long ear15) -{ - siginfo_t info; - - die_if_kernel("-- Data Access Error --\n" - "ESR15 : %08lx\n" - "EAR15 : %08lx\n", - esr15, ear15); - - info.si_signo = SIGSEGV; - info.si_code = SEGV_ACCERR; - info.si_errno = 0; - info.si_addr = (void __user *) - (((esr15 & (ESRx_VALID|ESR15_EAV)) == (ESRx_VALID|ESR15_EAV)) ? ear15 : 0); - - force_sig_info(info.si_signo, &info, current); -} /* end data_access_error() */ - -/*****************************************************************************/ -/* - * data store error - should only happen if accessing inactive or self-refreshing SDRAM - */ -asmlinkage void data_store_error(unsigned long esfr1, unsigned long esr15) -{ - die_if_kernel("-- Data Store Error --\n" - "ESR15 : %08lx\n", - esr15); - BUG(); -} /* end data_store_error() */ - -/*****************************************************************************/ -/* - * - */ -asmlinkage void division_exception(unsigned long esfr1, unsigned long esr0, unsigned long isr) -{ - siginfo_t info; - - die_if_kernel("-- Division Exception --\n" - "ESR0 : %08lx\n" - "ISR : %08lx\n", - esr0, isr); - - info.si_signo = SIGFPE; - info.si_code = FPE_INTDIV; - info.si_errno = 0; - info.si_addr = (void __user *) __frame->pc; - - force_sig_info(info.si_signo, &info, current); -} /* end division_exception() */ - -/*****************************************************************************/ -/* - * - */ -asmlinkage void compound_exception(unsigned long esfr1, - unsigned long esr0, unsigned long esr14, unsigned long esr15, - unsigned long msr0, unsigned long msr1) -{ - die_if_kernel("-- Compound Exception --\n" - "ESR0 : %08lx\n" - "ESR15 : %08lx\n" - "ESR15 : %08lx\n" - "MSR0 : %08lx\n" - "MSR1 : %08lx\n", - esr0, esr14, esr15, msr0, msr1); - BUG(); -} /* end compound_exception() */ - -void show_stack(struct task_struct *task, unsigned long *sp) -{ -} - -void show_trace_task(struct task_struct *tsk) -{ - printk("CONTEXT: stack=0x%lx frame=0x%p LR=0x%lx RET=0x%lx\n", - tsk->thread.sp, tsk->thread.frame, tsk->thread.lr, tsk->thread.sched_lr); -} - -static const char *regnames[] = { - "PSR ", "ISR ", "CCR ", "CCCR", - "LR ", "LCR ", "PC ", "_stt", - "sys ", "GR8*", "GNE0", "GNE1", - "IACH", "IACL", - "TBR ", "SP ", "FP ", "GR3 ", - "GR4 ", "GR5 ", "GR6 ", "GR7 ", - "GR8 ", "GR9 ", "GR10", "GR11", - "GR12", "GR13", "GR14", "GR15", - "GR16", "GR17", "GR18", "GR19", - "GR20", "GR21", "GR22", "GR23", - "GR24", "GR25", "GR26", "GR27", - "EFRM", "CURR", "GR30", "BFRM" -}; - -void show_regs(struct pt_regs *regs) -{ - unsigned long *reg; - int loop; - - printk("\n"); - show_regs_print_info(KERN_DEFAULT); - - printk("Frame: @%08lx [%s]\n", - (unsigned long) regs, - regs->psr & PSR_S ? "kernel" : "user"); - - reg = (unsigned long *) regs; - for (loop = 0; loop < NR_PT_REGS; loop++) { - printk("%s %08lx", regnames[loop + 0], reg[loop + 0]); - - if (loop == NR_PT_REGS - 1 || loop % 5 == 4) - printk("\n"); - else - printk(" | "); - } -} - -void die_if_kernel(const char *str, ...) -{ - char buffer[256]; - va_list va; - - if (user_mode(__frame)) - return; - - va_start(va, str); - vsnprintf(buffer, sizeof(buffer), str, va); - va_end(va); - - console_verbose(); - printk("\n===================================\n"); - printk("%s\n", buffer); - show_backtrace(__frame, 0); - - __break_hijack_kernel_event(); - do_exit(SIGSEGV); -} - -/*****************************************************************************/ -/* - * dump the contents of an exception frame - */ -static void show_backtrace_regs(struct pt_regs *frame) -{ - unsigned long *reg; - int loop; - - /* print the registers for this frame */ - printk("<-- %s Frame: @%p -->\n", - frame->psr & PSR_S ? "Kernel Mode" : "User Mode", - frame); - - reg = (unsigned long *) frame; - for (loop = 0; loop < NR_PT_REGS; loop++) { - printk("%s %08lx", regnames[loop + 0], reg[loop + 0]); - - if (loop == NR_PT_REGS - 1 || loop % 5 == 4) - printk("\n"); - else - printk(" | "); - } - - printk("--------\n"); -} /* end show_backtrace_regs() */ - -/*****************************************************************************/ -/* - * generate a backtrace of the kernel stack - */ -void show_backtrace(struct pt_regs *frame, unsigned long sp) -{ - struct pt_regs *frame0; - unsigned long tos = 0, stop = 0, base; - int format; - - base = ((((unsigned long) frame) + 8191) & ~8191) - sizeof(struct user_context); - frame0 = (struct pt_regs *) base; - - if (sp) { - tos = sp; - stop = (unsigned long) frame; - } - - printk("\nProcess %s (pid: %d)\n\n", current->comm, current->pid); - - for (;;) { - /* dump stack segment between frames */ - //printk("%08lx -> %08lx\n", tos, stop); - format = 0; - while (tos < stop) { - if (format == 0) - printk(" %04lx :", tos & 0xffff); - - printk(" %08lx", *(unsigned long *) tos); - - tos += 4; - format++; - if (format == 8) { - printk("\n"); - format = 0; - } - } - - if (format > 0) - printk("\n"); - - /* dump frame 0 outside of the loop */ - if (frame == frame0) - break; - - tos = frame->sp; - if (((unsigned long) frame) + sizeof(*frame) != tos) { - printk("-- TOS %08lx does not follow frame %p --\n", - tos, frame); - break; - } - - show_backtrace_regs(frame); - - /* dump the stack between this frame and the next */ - stop = (unsigned long) frame->next_frame; - if (stop != base && - (stop < tos || - stop > base || - (stop < base && stop + sizeof(*frame) > base) || - stop & 3)) { - printk("-- next_frame %08lx is invalid (range %08lx-%08lx) --\n", - stop, tos, base); - break; - } - - /* move to next frame */ - frame = frame->next_frame; - } - - /* we can always dump frame 0, even if the rest of the stack is corrupt */ - show_backtrace_regs(frame0); - -} /* end show_backtrace() */ - -/*****************************************************************************/ -/* - * initialise traps - */ -void __init trap_init (void) -{ -} /* end trap_init() */ diff --git a/arch/frv/kernel/uaccess.c b/arch/frv/kernel/uaccess.c deleted file mode 100644 index 8b360b4222a5..000000000000 --- a/arch/frv/kernel/uaccess.c +++ /dev/null @@ -1,100 +0,0 @@ -/* uaccess.c: userspace access functions - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include - -/*****************************************************************************/ -/* - * copy a null terminated string from userspace - */ -long strncpy_from_user(char *dst, const char __user *src, long count) -{ - unsigned long max; - char *p, ch; - long err = -EFAULT; - - BUG_ON(count < 0); - - p = dst; - -#ifndef CONFIG_MMU - if ((unsigned long) src < memory_start) - goto error; -#endif - - if ((unsigned long) src >= get_addr_limit()) - goto error; - - max = get_addr_limit() - (unsigned long) src; - if ((unsigned long) count > max) { - memset(dst + max, 0, count - max); - count = max; - } - - err = 0; - for (; count > 0; count--, p++, src++) { - __get_user_asm(err, ch, src, "ub", "=r"); - if (err < 0) - goto error; - if (!ch) - break; - *p = ch; - } - - err = p - dst; /* return length excluding NUL */ - - error: - if (count > 0) - memset(p, 0, count); /* clear remainder of buffer [security] */ - - return err; - -} /* end strncpy_from_user() */ - -EXPORT_SYMBOL(strncpy_from_user); - -/*****************************************************************************/ -/* - * Return the size of a string (including the ending 0) - * - * Return 0 on exception, a value greater than N if too long - */ -long strnlen_user(const char __user *src, long count) -{ - const char __user *p; - long err = 0; - char ch; - - BUG_ON(count < 0); - -#ifndef CONFIG_MMU - if ((unsigned long) src < memory_start) - return 0; -#endif - - if ((unsigned long) src >= get_addr_limit()) - return 0; - - for (p = src; count > 0; count--, p++) { - __get_user_asm(err, ch, p, "ub", "=r"); - if (err < 0) - return 0; - if (!ch) - break; - } - - return p - src + 1; /* return length including NUL */ - -} /* end strnlen_user() */ - -EXPORT_SYMBOL(strnlen_user); diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S deleted file mode 100644 index 42806c512758..000000000000 --- a/arch/frv/kernel/vmlinux.lds.S +++ /dev/null @@ -1,136 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* ld script to make FRV Linux kernel - * Written by Martin Mares ; - */ -OUTPUT_FORMAT("elf32-frv", "elf32-frv", "elf32-frv") -OUTPUT_ARCH(frv) -ENTRY(_start) - -#include -#include -#include -#include -#include - -jiffies = jiffies_64 + 4; - -__page_offset = CONFIG_PAGE_OFFSET; /* start of area covered by struct pages */ -__kernel_image_start = __page_offset; /* address at which kernel image resides */ - -SECTIONS -{ - . = __kernel_image_start; - - /* discardable initialisation code and data */ - . = ALIGN(PAGE_SIZE); /* Init code and data */ - __init_begin = .; - - _sinittext = .; - .init.text : { - HEAD_TEXT -#ifndef CONFIG_DEBUG_INFO - INIT_TEXT - EXIT_TEXT - EXIT_DATA - *(.exitcall.exit) -#endif - } - _einittext = .; - - INIT_DATA_SECTION(8) - PERCPU_SECTION(L1_CACHE_BYTES) - - . = ALIGN(PAGE_SIZE); - __init_end = .; - - .trap : { - /* trap table management - read entry-table.S before modifying */ - . = ALIGN(8192); - __trap_tables = .; - *(.trap.user) - *(.trap.kernel) - . = ALIGN(4096); - *(.trap.break) - } - - /* Text and read-only data */ - . = ALIGN(4); - _text = .; - _stext = .; - .text : { - *(.text..start) - *(.text..entry) - *(.text..break) - *(.text..tlbmiss) - TEXT_TEXT - SCHED_TEXT - CPUIDLE_TEXT - LOCK_TEXT -#ifdef CONFIG_DEBUG_INFO - INIT_TEXT - EXIT_TEXT - *(.exitcall.exit) -#endif - *(.fixup) - *(.gnu.warning) - *(.exitcall.exit) - } = 0x9090 - - _etext = .; /* End of text section */ - - RODATA - - .rodata : { - *(.trap.vector) - - /* this clause must not be modified - the ordering and adjacency are imperative */ - __trap_fixup_tables = .; - *(.trap.fixup.user .trap.fixup.kernel) - - } - - EXCEPTION_TABLE(8) - - _sdata = .; - .data : { /* Data */ - INIT_TASK_DATA(THREAD_SIZE) - CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) - DATA_DATA - *(.data.*) - EXIT_DATA - CONSTRUCTORS - } - - _edata = .; /* End of data section */ - - BUG_TABLE - - /* GP section */ - . = ALIGN(L1_CACHE_BYTES); - _gp = . + 2048; - PROVIDE (gp = _gp); - - .sdata : { *(.sdata .sdata.*) } - - /* BSS */ - . = ALIGN(L1_CACHE_BYTES); - __bss_start = .; - - .sbss : { *(.sbss .sbss.*) } - .bss : { *(.bss .bss.*) } - .bss..stack : { *(.bss) } - - __bss_stop = .; - _end = . ; - . = ALIGN(PAGE_SIZE); - __kernel_image_end = .; - - STABS_DEBUG - DWARF_DEBUG - - .comment 0 : { *(.comment) } - - DISCARDS -} - -__kernel_image_size_no_bss = __bss_start - __kernel_image_start; diff --git a/arch/frv/lib/Makefile b/arch/frv/lib/Makefile deleted file mode 100644 index 970e8b4f1a02..000000000000 --- a/arch/frv/lib/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# -# Makefile for FRV-specific library files.. -# - -lib-y := \ - __ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \ - checksum.o memcpy.o memset.o atomic-ops.o atomic64-ops.o \ - outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o atomic-lib.o diff --git a/arch/frv/lib/__ashldi3.S b/arch/frv/lib/__ashldi3.S deleted file mode 100644 index db5b6dc37a11..000000000000 --- a/arch/frv/lib/__ashldi3.S +++ /dev/null @@ -1,40 +0,0 @@ -/* __ashldi3.S: 64-bit arithmetic shift left - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - .text - .p2align 4 - -############################################################################### -# -# unsigned long long __ashldi3(unsigned long long value [GR8:GR9], unsigned by [GR10]) -# -############################################################################### - .globl __ashldi3 - .type __ashldi3,@function -__ashldi3: - andicc.p gr10,#63,gr10,icc0 - setlos #32,gr5 - andicc.p gr10,#32,gr0,icc1 - beqlr icc0,#0 - ckeq icc1,cc4 ; cc4 is true if 0> M - - # deal with a shift in the range 32<=N<=63 - csll gr9,gr10,gr8 ,cc4,#0 ; MSW = LSW << (N & 31 [implicit AND]) - cor.p gr0,gr0,gr9 ,cc4,#0 ; LSW = 0 - bralr - .size __ashldi3, .-__ashldi3 diff --git a/arch/frv/lib/__ashrdi3.S b/arch/frv/lib/__ashrdi3.S deleted file mode 100644 index 5742665bfd29..000000000000 --- a/arch/frv/lib/__ashrdi3.S +++ /dev/null @@ -1,41 +0,0 @@ -/* __ashrdi3.S: 64-bit arithmetic shift right - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - .text - .p2align 4 - -############################################################################### -# -# signed long long __ashrdi3(signed long long value [GR8:GR9], unsigned by [GR10]) -# -############################################################################### - .globl __ashrdi3 - .type __ashrdi3,@function -__ashrdi3: - andicc.p gr10,#63,gr10,icc0 - setlos #32,gr5 - andicc.p gr10,#32,gr0,icc1 - beqlr icc0,#0 - setlos.p #31,gr6 - ckeq icc1,cc4 ; cc4 is true if 0>= N - csub gr5,gr10,gr5 ,cc4,#1 ; M = 32 - N - csll.p gr8,gr5,gr4 ,cc4,#1 - csra gr8,gr10,gr8 ,cc4,#1 ; MSW >>= N - cor.p gr4,gr9,gr9 ,cc4,#1 ; LSW |= MSW << M - - # deal with a shift in the range 32<=N<=63 - csra gr8,gr10,gr9 ,cc4,#0 ; LSW = MSW >> (N & 31 [implicit AND]) - csra.p gr8,gr6,gr8 ,cc4,#0 ; MSW >>= 31 - bralr - .size __ashrdi3, .-__ashrdi3 diff --git a/arch/frv/lib/__lshrdi3.S b/arch/frv/lib/__lshrdi3.S deleted file mode 100644 index 7b41f6304f04..000000000000 --- a/arch/frv/lib/__lshrdi3.S +++ /dev/null @@ -1,40 +0,0 @@ -/* __lshrdi3.S: 64-bit logical shift right - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - .text - .p2align 4 - -############################################################################### -# -# unsigned long long __lshrdi3(unsigned long long value [GR8:GR9], unsigned by [GR10]) -# -############################################################################### - .globl __lshrdi3 - .type __lshrdi3,@function -__lshrdi3: - andicc.p gr10,#63,gr10,icc0 - setlos #32,gr5 - andicc.p gr10,#32,gr0,icc1 - beqlr icc0,#0 - ckeq icc1,cc4 ; cc4 is true if 0>= N - csub gr5,gr10,gr5 ,cc4,#1 ; M = 32 - N - csll.p gr8,gr5,gr4 ,cc4,#1 - csrl gr8,gr10,gr8 ,cc4,#1 ; MSW >>= N - cor.p gr4,gr9,gr9 ,cc4,#1 ; LSW |= MSW << M - - # deal with a shift in the range 32<=N<=63 - csrl gr8,gr10,gr9 ,cc4,#0 ; LSW = MSW >> (N & 31 [implicit AND]) - cor.p gr0,gr0,gr8 ,cc4,#0 ; MSW = 0 - bralr - .size __lshrdi3, .-__lshrdi3 diff --git a/arch/frv/lib/__muldi3.S b/arch/frv/lib/__muldi3.S deleted file mode 100644 index 2703d9b79361..000000000000 --- a/arch/frv/lib/__muldi3.S +++ /dev/null @@ -1,32 +0,0 @@ -/* __muldi3.S: 64-bit multiply - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - .text - .p2align 4 - -############################################################################### -# -# unsigned long long __muldi3(unsigned long long x [GR8:GR9], -# unsigned long long y [GR10:GR11]) -# -############################################################################### - .globl __muldi3, __mulll, __umulll - .type __muldi3,@function -__muldi3: -__mulll: -__umulll: - umul gr8,gr11,gr4 ; GR4:GR5 = x.MSW * y.LSW - umul gr9,gr10,gr6 ; GR6:GR7 = x.LSW * y.MSW - umul.p gr9,gr11,gr8 ; GR8:GR9 = x.LSW * y.LSW - add gr5,gr7,gr5 - add.p gr8,gr5,gr8 ; GR8 += GR5 + GR7 - bralr - .size __muldi3, .-__muldi3 diff --git a/arch/frv/lib/__negdi2.S b/arch/frv/lib/__negdi2.S deleted file mode 100644 index d1747bf24997..000000000000 --- a/arch/frv/lib/__negdi2.S +++ /dev/null @@ -1,28 +0,0 @@ -/* __negdi2.S: 64-bit negate - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - - .text - .p2align 4 - -############################################################################### -# -# unsigned long long __negdi2(unsigned long long value [GR8:GR9]) -# -############################################################################### - .globl __negdi2 - .type __negdi2,@function -__negdi2: - subcc gr0,gr9,gr9,icc0 - subx gr0,gr8,gr8,icc0 - bralr - .size __negdi2, .-__negdi2 - diff --git a/arch/frv/lib/__ucmpdi2.S b/arch/frv/lib/__ucmpdi2.S deleted file mode 100644 index d892f16ffaa9..000000000000 --- a/arch/frv/lib/__ucmpdi2.S +++ /dev/null @@ -1,45 +0,0 @@ -/* __ucmpdi2.S: 64-bit unsigned compare - * - * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - - .text - .p2align 4 - -############################################################################### -# -# int __ucmpdi2(unsigned long long a [GR8:GR9], -# unsigned long long b [GR10:GR11]) -# -# - returns 0, 1, or 2 as a <, =, > b respectively. -# -############################################################################### - .globl __ucmpdi2 - .type __ucmpdi2,@function -__ucmpdi2: - or.p gr8,gr0,gr4 - subcc gr8,gr10,gr0,icc0 - setlos.p #0,gr8 - bclr icc0,#2 ; a.msw < b.msw - - setlos.p #2,gr8 - bhilr icc0,#0 ; a.msw > b.msw - - subcc.p gr9,gr11,gr0,icc1 - setlos #0,gr8 - setlos.p #2,gr9 - setlos #1,gr7 - cknc icc1,cc6 - cor.p gr9,gr0,gr8, cc6,#1 - cckls icc1,cc4, cc6,#1 - andcr cc6,cc4,cc4 - cor gr7,gr0,gr8, cc4,#1 - bralr - .size __ucmpdi2, .-__ucmpdi2 diff --git a/arch/frv/lib/atomic-lib.c b/arch/frv/lib/atomic-lib.c deleted file mode 100644 index 3027576f7782..000000000000 --- a/arch/frv/lib/atomic-lib.c +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include - -#define __ATOMIC_LIB__ - -#include diff --git a/arch/frv/lib/atomic-ops.S b/arch/frv/lib/atomic-ops.S deleted file mode 100644 index b7439a960b5b..000000000000 --- a/arch/frv/lib/atomic-ops.S +++ /dev/null @@ -1,62 +0,0 @@ -/* atomic-ops.S: kernel atomic operations - * - * For an explanation of how atomic ops work in this arch, see: - * Documentation/frv/atomic-ops.txt - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include - - .text - .balign 4 - -############################################################################### -# -# uint32_t __xchg_32(uint32_t i, uint32_t *v) -# -############################################################################### - .globl __xchg_32 - .type __xchg_32,@function -__xchg_32: - or.p gr8,gr8,gr10 -0: - orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */ - ckeq icc3,cc7 - ld.p @(gr9,gr0),gr8 /* LD.P/ORCR must be atomic */ - orcr cc7,cc7,cc3 /* set CC3 to true */ - cst.p gr10,@(gr9,gr0) ,cc3,#1 - corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */ - beq icc3,#0,0b - bralr - - .size __xchg_32, .-__xchg_32 - -############################################################################### -# -# uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new) -# -############################################################################### - .globl __cmpxchg_32 - .type __cmpxchg_32,@function -__cmpxchg_32: - or.p gr8,gr8,gr11 -0: - orcc gr0,gr0,gr0,icc3 - ckeq icc3,cc7 - ld.p @(gr11,gr0),gr8 - orcr cc7,cc7,cc3 - subcc gr8,gr9,gr7,icc0 - bnelr icc0,#0 - cst.p gr10,@(gr11,gr0) ,cc3,#1 - corcc gr29,gr29,gr0 ,cc3,#1 - beq icc3,#0,0b - bralr - - .size __cmpxchg_32, .-__cmpxchg_32 diff --git a/arch/frv/lib/atomic64-ops.S b/arch/frv/lib/atomic64-ops.S deleted file mode 100644 index c4c472308a33..000000000000 --- a/arch/frv/lib/atomic64-ops.S +++ /dev/null @@ -1,68 +0,0 @@ -/* kernel atomic64 operations - * - * For an explanation of how atomic ops work in this arch, see: - * Documentation/frv/atomic-ops.txt - * - * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include - - .text - .balign 4 - - -############################################################################### -# -# uint64_t __xchg_64(uint64_t i, uint64_t *v) -# -############################################################################### - .globl __xchg_64 - .type __xchg_64,@function -__xchg_64: - or.p gr8,gr8,gr4 - or gr9,gr9,gr5 -0: - orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */ - ckeq icc3,cc7 - ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */ - orcr cc7,cc7,cc3 /* set CC3 to true */ - cstd.p gr4,@(gr10,gr0) ,cc3,#1 - corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */ - beq icc3,#0,0b - bralr - - .size __xchg_64, .-__xchg_64 - -############################################################################### -# -# uint64_t __cmpxchg_64(uint64_t test, uint64_t new, uint64_t *v) -# -############################################################################### - .globl __cmpxchg_64 - .type __cmpxchg_64,@function -__cmpxchg_64: - or.p gr8,gr8,gr4 - or gr9,gr9,gr5 -0: - orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */ - ckeq icc3,cc7 - ldd.p @(gr12,gr0),gr8 /* LDD.P/ORCR must be atomic */ - orcr cc7,cc7,cc3 - subcc gr8,gr4,gr0,icc0 - subcc.p gr9,gr5,gr0,icc1 - bnelr icc0,#0 - bnelr icc1,#0 - cstd.p gr10,@(gr12,gr0) ,cc3,#1 - corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */ - beq icc3,#0,0b - bralr - - .size __cmpxchg_64, .-__cmpxchg_64 - diff --git a/arch/frv/lib/cache.S b/arch/frv/lib/cache.S deleted file mode 100644 index 0c4fb204911b..000000000000 --- a/arch/frv/lib/cache.S +++ /dev/null @@ -1,98 +0,0 @@ -/* cache.S: cache management routines - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include - - .text - .p2align 4 - -############################################################################### -# -# Write back a range of dcache -# - void frv_dcache_writeback(unsigned long start [GR8], unsigned long size [GR9]) -# -############################################################################### - .globl frv_dcache_writeback - .type frv_dcache_writeback,@function -frv_dcache_writeback: - andi gr8,~(L1_CACHE_BYTES-1),gr8 - -2: dcf @(gr8,gr0) - addi gr8,#L1_CACHE_BYTES,gr8 - cmp gr9,gr8,icc0 - bhi icc0,#2,2b - - membar - bralr - .size frv_dcache_writeback, .-frv_dcache_writeback - -############################################################################## -# -# Invalidate a range of dcache and icache -# - void frv_cache_invalidate(unsigned long start [GR8], unsigned long end [GR9]); -# -############################################################################### - .globl frv_cache_invalidate - .type frv_cache_invalidate,@function -frv_cache_invalidate: - andi gr8,~(L1_CACHE_BYTES-1),gr8 - -2: dci @(gr8,gr0) - ici @(gr8,gr0) - addi gr8,#L1_CACHE_BYTES,gr8 - cmp gr9,gr8,icc0 - bhi icc0,#2,2b - - membar - bralr - .size frv_cache_invalidate, .-frv_cache_invalidate - -############################################################################## -# -# Invalidate a range of icache -# - void frv_icache_invalidate(unsigned long start [GR8], unsigned long end [GR9]); -# -############################################################################### - .globl frv_icache_invalidate - .type frv_icache_invalidate,@function -frv_icache_invalidate: - andi gr8,~(L1_CACHE_BYTES-1),gr8 - -2: ici @(gr8,gr0) - addi gr8,#L1_CACHE_BYTES,gr8 - cmp gr9,gr8,icc0 - bhi icc0,#2,2b - - membar - bralr - .size frv_icache_invalidate, .-frv_icache_invalidate - -############################################################################### -# -# Write back and invalidate a range of dcache and icache -# - void frv_cache_wback_inv(unsigned long start [GR8], unsigned long end [GR9]) -# -############################################################################### - .globl frv_cache_wback_inv - .type frv_cache_wback_inv,@function -frv_cache_wback_inv: - andi gr8,~(L1_CACHE_BYTES-1),gr8 - -2: dcf @(gr8,gr0) - ici @(gr8,gr0) - addi gr8,#L1_CACHE_BYTES,gr8 - cmp gr9,gr8,icc0 - bhi icc0,#2,2b - - membar - bralr - .size frv_cache_wback_inv, .-frv_cache_wback_inv diff --git a/arch/frv/lib/checksum.c b/arch/frv/lib/checksum.c deleted file mode 100644 index 44e16d59bc10..000000000000 --- a/arch/frv/lib/checksum.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * INET An implementation of the TCP/IP protocol suite for the LINUX - * operating system. INET is implemented using the BSD Socket - * interface as the means of communication with the user level. - * - * IP/TCP/UDP checksumming routines - * - * Authors: Jorge Cwik, - * Arnt Gulbrandsen, - * Tom May, - * Andreas Schwab, - * Lots of code moved from tcp.c and ip.c; see those files - * for more names. - * - * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek: - * Fixed some nasty bugs, causing some horrible crashes. - * A: At some points, the sum (%0) was used as - * length-counter instead of the length counter - * (%1). Thanks to Roman Hodek for pointing this out. - * B: GCC seems to mess up if one uses too many - * data-registers to hold input values and one tries to - * specify d0 and d1 as scratch registers. Letting gcc choose these - * registers itself solves the problem. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access kills, so most - of the assembly has to go. */ - -#include -#include - -static inline unsigned short from32to16(unsigned long x) -{ - /* add up 16-bit and 16-bit for 16+c bit */ - x = (x & 0xffff) + (x >> 16); - /* add up carry.. */ - x = (x & 0xffff) + (x >> 16); - return x; -} - -static unsigned long do_csum(const unsigned char * buff, int len) -{ - int odd, count; - unsigned long result = 0; - - if (len <= 0) - goto out; - odd = 1 & (unsigned long) buff; - if (odd) { - result = *buff; - len--; - buff++; - } - count = len >> 1; /* nr of 16-bit words.. */ - if (count) { - if (2 & (unsigned long) buff) { - result += *(unsigned short *) buff; - count--; - len -= 2; - buff += 2; - } - count >>= 1; /* nr of 32-bit words.. */ - if (count) { - unsigned long carry = 0; - do { - unsigned long w = *(unsigned long *) buff; - count--; - buff += 4; - result += carry; - result += w; - carry = (w > result); - } while (count); - result += carry; - result = (result & 0xffff) + (result >> 16); - } - if (len & 2) { - result += *(unsigned short *) buff; - buff += 2; - } - } - if (len & 1) - result += (*buff << 8); - result = from32to16(result); - if (odd) - result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); -out: - return result; -} - -/* - * computes the checksum of a memory block at buff, length len, - * and adds in "sum" (32-bit) - * - * returns a 32-bit number suitable for feeding into itself - * or csum_tcpudp_magic - * - * this function must be called with even lengths, except - * for the last fragment, which may be odd - * - * it's best to have buff aligned on a 32-bit boundary - */ -__wsum csum_partial(const void *buff, int len, __wsum sum) -{ - unsigned int result = do_csum(buff, len); - - /* add in old sum, and carry.. */ - result += (__force u32)sum; - if ((__force u32)sum > result) - result += 1; - return (__force __wsum)result; -} - -EXPORT_SYMBOL(csum_partial); - -/* - * this routine is used for miscellaneous IP-like checksums, mainly - * in icmp.c - */ -__sum16 ip_compute_csum(const void *buff, int len) -{ - return (__force __sum16)~do_csum(buff, len); -} - -EXPORT_SYMBOL(ip_compute_csum); - -/* - * copy from fs while checksumming, otherwise like csum_partial - */ -__wsum -csum_partial_copy_from_user(const void __user *src, void *dst, - int len, __wsum sum, int *csum_err) -{ - int rem; - - if (csum_err) - *csum_err = 0; - - rem = copy_from_user(dst, src, len); - if (rem != 0) { - if (csum_err) - *csum_err = -EFAULT; - memset(dst + len - rem, 0, rem); - len = rem; - } - - return csum_partial(dst, len, sum); -} - -EXPORT_SYMBOL(csum_partial_copy_from_user); - -/* - * copy from ds while checksumming, otherwise like csum_partial - */ -__wsum -csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) -{ - memcpy(dst, src, len); - return csum_partial(dst, len, sum); -} - -EXPORT_SYMBOL(csum_partial_copy_nocheck); diff --git a/arch/frv/lib/insl_ns.S b/arch/frv/lib/insl_ns.S deleted file mode 100644 index d1658425a9f7..000000000000 --- a/arch/frv/lib/insl_ns.S +++ /dev/null @@ -1,52 +0,0 @@ -/* insl_ns.S: input array of 4b words from device port without byte swapping - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - - .text - .p2align 4 - -############################################################################### -# -# void __insl_ns(unsigned int port, void *buf, int n) -# -############################################################################### - .globl __insl_ns - .type __insl_ns,@function -__insl_ns: - andicc.p gr9,#3,gr0,icc0 - setlos #4,gr4 - bne icc0,#0,__insl_ns_misaligned - subi gr9,#4,gr9 -0: - ldi.p @(gr8,#0),gr5 - subicc gr10,#1,gr10,icc0 - stu.p gr5,@(gr9,gr4) - bhi icc0,#2,0b - bralr - -__insl_ns_misaligned: - subi.p gr9,#1,gr9 - setlos #1,gr4 -0: - ldi @(gr8,#0),gr5 - - srli gr5,#24,gr6 - stbu.p gr6,@(gr9,gr4) - srli gr5,#16,gr6 - stbu.p gr6,@(gr9,gr4) - srli gr5,#8,gr6 - stbu.p gr6,@(gr9,gr4) - subicc gr10,#1,gr10,icc0 - stbu.p gr5,@(gr9,gr4) - bhi icc0,#2,0b - bralr - - .size __insl_ns, .-__insl_ns diff --git a/arch/frv/lib/insl_sw.S b/arch/frv/lib/insl_sw.S deleted file mode 100644 index 9b5aa95d069b..000000000000 --- a/arch/frv/lib/insl_sw.S +++ /dev/null @@ -1,40 +0,0 @@ -/* insl_sw.S: input array of 4b words from device port with byte swapping - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - - .text - .p2align 4 - -############################################################################### -# -# void __insl_sw(unsigned int port, void *buf, int n) -# -############################################################################### - .globl __insl_sw - .type __insl_sw,@function -__insl_sw: - subi.p gr9,#1,gr9 - setlos #1,gr4 -0: - ldi.p @(gr8,#0),gr5 ; get 0xAABBCCDD - subicc gr10,#1,gr10,icc0 - - stbu.p gr5,@(gr9,gr4) ; write 0xDD - srli gr5,#8,gr5 - stbu.p gr5,@(gr9,gr4) ; write 0xCC - srli gr5,#8,gr5 - stbu.p gr5,@(gr9,gr4) ; write 0xBB - srli gr5,#8,gr5 - stbu.p gr5,@(gr9,gr4) ; write 0xAA - bhi icc0,#2,0b - bralr - - .size __insl_sw, .-__insl_sw diff --git a/arch/frv/lib/memcpy.S b/arch/frv/lib/memcpy.S deleted file mode 100644 index 9c5965273428..000000000000 --- a/arch/frv/lib/memcpy.S +++ /dev/null @@ -1,135 +0,0 @@ -/* memcpy.S: optimised assembly memcpy - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - - .text - .p2align 4 - -############################################################################### -# -# void *memcpy(void *to, const char *from, size_t count) -# -# - NOTE: must not use any stack. exception detection performs function return -# to caller's fixup routine, aborting the remainder of the copy -# -############################################################################### - .globl memcpy,__memcpy_end - .type memcpy,@function -memcpy: - or.p gr8,gr9,gr4 - orcc gr10,gr0,gr0,icc3 - or.p gr10,gr4,gr4 - beqlr icc3,#0 - - # optimise based on best common alignment for to, from & count - andicc.p gr4,#0x0f,gr0,icc0 - setlos #8,gr11 - andicc.p gr4,#0x07,gr0,icc1 - beq icc0,#0,memcpy_16 - andicc.p gr4,#0x03,gr0,icc0 - beq icc1,#0,memcpy_8 - andicc.p gr4,#0x01,gr0,icc1 - beq icc0,#0,memcpy_4 - setlos.p #1,gr11 - beq icc1,#0,memcpy_2 - - # do byte by byte copy - sub.p gr8,gr11,gr3 - sub gr9,gr11,gr9 -0: ldubu.p @(gr9,gr11),gr4 - subicc gr10,#1,gr10,icc0 - stbu.p gr4,@(gr3,gr11) - bne icc0,#2,0b - bralr - - # do halfword by halfword copy -memcpy_2: - setlos #2,gr11 - sub.p gr8,gr11,gr3 - sub gr9,gr11,gr9 -0: lduhu.p @(gr9,gr11),gr4 - subicc gr10,#2,gr10,icc0 - sthu.p gr4,@(gr3,gr11) - bne icc0,#2,0b - bralr - - # do word by word copy -memcpy_4: - setlos #4,gr11 - sub.p gr8,gr11,gr3 - sub gr9,gr11,gr9 -0: ldu.p @(gr9,gr11),gr4 - subicc gr10,#4,gr10,icc0 - stu.p gr4,@(gr3,gr11) - bne icc0,#2,0b - bralr - - # do double-word by double-word copy -memcpy_8: - sub.p gr8,gr11,gr3 - sub gr9,gr11,gr9 -0: lddu.p @(gr9,gr11),gr4 - subicc gr10,#8,gr10,icc0 - stdu.p gr4,@(gr3,gr11) - bne icc0,#2,0b - bralr - - # do quad-word by quad-word copy -memcpy_16: - sub.p gr8,gr11,gr3 - sub gr9,gr11,gr9 -0: lddu @(gr9,gr11),gr4 - lddu.p @(gr9,gr11),gr6 - subicc gr10,#16,gr10,icc0 - stdu gr4,@(gr3,gr11) - stdu.p gr6,@(gr3,gr11) - bne icc0,#2,0b - bralr -__memcpy_end: - - .size memcpy, __memcpy_end-memcpy - -############################################################################### -# -# copy to/from userspace -# - return the number of bytes that could not be copied (0 on complete success) -# -# long __memcpy_user(void *dst, const void *src, size_t count) -# -############################################################################### - .globl __memcpy_user, __memcpy_user_error_lr, __memcpy_user_error_handler - .type __memcpy_user,@function -__memcpy_user: - movsg lr,gr7 - subi.p sp,#8,sp - add gr8,gr10,gr6 ; calculate expected end address - stdi gr6,@(sp,#0) - - # abuse memcpy to do the dirty work - call memcpy -__memcpy_user_error_lr: - ldi.p @(sp,#4),gr7 - setlos #0,gr8 - jmpl.p @(gr7,gr0) - addi sp,#8,sp - - # deal any exception generated by memcpy - # GR8 - memcpy's current dest address - # GR11 - memset's step value (index register for store insns) -__memcpy_user_error_handler: - lddi.p @(sp,#0),gr4 ; load GR4 with dst+count, GR5 with ret addr - add gr11,gr3,gr7 - sub.p gr4,gr7,gr8 - - addi sp,#8,sp - jmpl @(gr5,gr0) - - .size __memcpy_user, .-__memcpy_user diff --git a/arch/frv/lib/memset.S b/arch/frv/lib/memset.S deleted file mode 100644 index 55a35263cbe3..000000000000 --- a/arch/frv/lib/memset.S +++ /dev/null @@ -1,182 +0,0 @@ -/* memset.S: optimised assembly memset - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - - .text - .p2align 4 - -############################################################################### -# -# void *memset(void *p, char ch, size_t count) -# -# - NOTE: must not use any stack. exception detection performs function return -# to caller's fixup routine, aborting the remainder of the set -# GR4, GR7, GR8, and GR11 must be managed -# -############################################################################### - .globl memset,__memset_end - .type memset,@function -memset: - orcc.p gr10,gr0,gr5,icc3 ; GR5 = count - andi gr9,#0xff,gr9 - or.p gr8,gr0,gr4 ; GR4 = address - beqlr icc3,#0 - - # conditionally write a byte to 2b-align the address - setlos.p #1,gr6 - andicc gr4,#1,gr0,icc0 - ckne icc0,cc7 - cstb.p gr9,@(gr4,gr0) ,cc7,#1 - csubcc gr5,gr6,gr5 ,cc7,#1 ; also set ICC3 - cadd.p gr4,gr6,gr4 ,cc7,#1 - beqlr icc3,#0 - - # conditionally write a word to 4b-align the address - andicc.p gr4,#2,gr0,icc0 - subicc gr5,#2,gr0,icc1 - setlos.p #2,gr6 - ckne icc0,cc7 - slli.p gr9,#8,gr12 ; need to double up the pattern - cknc icc1,cc5 - or.p gr9,gr12,gr12 - andcr cc7,cc5,cc7 - - csth.p gr12,@(gr4,gr0) ,cc7,#1 - csubcc gr5,gr6,gr5 ,cc7,#1 ; also set ICC3 - cadd.p gr4,gr6,gr4 ,cc7,#1 - beqlr icc3,#0 - - # conditionally write a dword to 8b-align the address - andicc.p gr4,#4,gr0,icc0 - subicc gr5,#4,gr0,icc1 - setlos.p #4,gr6 - ckne icc0,cc7 - slli.p gr12,#16,gr13 ; need to quadruple-up the pattern - cknc icc1,cc5 - or.p gr13,gr12,gr12 - andcr cc7,cc5,cc7 - - cst.p gr12,@(gr4,gr0) ,cc7,#1 - csubcc gr5,gr6,gr5 ,cc7,#1 ; also set ICC3 - cadd.p gr4,gr6,gr4 ,cc7,#1 - beqlr icc3,#0 - - or.p gr12,gr12,gr13 ; need to octuple-up the pattern - - # the address is now 8b-aligned - loop around writing 64b chunks - setlos #8,gr7 - subi.p gr4,#8,gr4 ; store with update index does weird stuff - setlos #64,gr6 - - subicc gr5,#64,gr0,icc0 -0: cknc icc0,cc7 - cstdu gr12,@(gr4,gr7) ,cc7,#1 - cstdu gr12,@(gr4,gr7) ,cc7,#1 - cstdu gr12,@(gr4,gr7) ,cc7,#1 - cstdu gr12,@(gr4,gr7) ,cc7,#1 - cstdu gr12,@(gr4,gr7) ,cc7,#1 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - csubcc gr5,gr6,gr5 ,cc7,#1 ; also set ICC3 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - subicc gr5,#64,gr0,icc0 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - beqlr icc3,#0 - bnc icc0,#2,0b - - # now do 32-byte remnant - subicc.p gr5,#32,gr0,icc0 - setlos #32,gr6 - cknc icc0,cc7 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - csubcc gr5,gr6,gr5 ,cc7,#1 ; also set ICC3 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - setlos #16,gr6 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - subicc gr5,#16,gr0,icc0 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - beqlr icc3,#0 - - # now do 16-byte remnant - cknc icc0,cc7 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - csubcc gr5,gr6,gr5 ,cc7,#1 ; also set ICC3 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - beqlr icc3,#0 - - # now do 8-byte remnant - subicc gr5,#8,gr0,icc1 - cknc icc1,cc7 - cstdu.p gr12,@(gr4,gr7) ,cc7,#1 - csubcc gr5,gr7,gr5 ,cc7,#1 ; also set ICC3 - setlos.p #4,gr7 - beqlr icc3,#0 - - # now do 4-byte remnant - subicc gr5,#4,gr0,icc0 - addi.p gr4,#4,gr4 - cknc icc0,cc7 - cstu.p gr12,@(gr4,gr7) ,cc7,#1 - csubcc gr5,gr7,gr5 ,cc7,#1 ; also set ICC3 - subicc.p gr5,#2,gr0,icc1 - beqlr icc3,#0 - - # now do 2-byte remnant - setlos #2,gr7 - addi.p gr4,#2,gr4 - cknc icc1,cc7 - csthu.p gr12,@(gr4,gr7) ,cc7,#1 - csubcc gr5,gr7,gr5 ,cc7,#1 ; also set ICC3 - subicc.p gr5,#1,gr0,icc0 - beqlr icc3,#0 - - # now do 1-byte remnant - setlos #0,gr7 - addi.p gr4,#2,gr4 - cknc icc0,cc7 - cstb.p gr12,@(gr4,gr0) ,cc7,#1 - bralr -__memset_end: - - .size memset, __memset_end-memset - -############################################################################### -# -# clear memory in userspace -# - return the number of bytes that could not be cleared (0 on complete success) -# -# long __memset_user(void *p, size_t count) -# -############################################################################### - .globl __memset_user, __memset_user_error_lr, __memset_user_error_handler - .type __memset_user,@function -__memset_user: - movsg lr,gr11 - - # abuse memset to do the dirty work - or.p gr9,gr9,gr10 - setlos #0,gr9 - call memset -__memset_user_error_lr: - jmpl.p @(gr11,gr0) - setlos #0,gr8 - - # deal any exception generated by memset - # GR4 - memset's address tracking pointer - # GR7 - memset's step value (index register for store insns) - # GR8 - memset's original start address - # GR10 - memset's original count -__memset_user_error_handler: - add.p gr4,gr7,gr4 - add gr8,gr10,gr8 - jmpl.p @(gr11,gr0) - sub gr8,gr4,gr8 ; we return the amount left uncleared - - .size __memset_user, .-__memset_user diff --git a/arch/frv/lib/outsl_ns.S b/arch/frv/lib/outsl_ns.S deleted file mode 100644 index 4cd4c46a6966..000000000000 --- a/arch/frv/lib/outsl_ns.S +++ /dev/null @@ -1,59 +0,0 @@ -/* outsl_ns.S: output array of 4b words to device without byte swapping - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - - .text - .p2align 4 - -############################################################################### -# -# void __outsl_ns(unsigned int port, const void *buf, int n) -# -############################################################################### - .globl __outsl_ns - .type __outsl_ns,@function -__outsl_ns: - andicc.p gr9,#3,gr0,icc0 - setlos #4,gr4 - bne icc0,#0,__outsl_ns_misaligned - subi gr9,#4,gr9 -0: - ldu.p @(gr9,gr4),gr5 - subicc gr10,#1,gr10,icc0 - sti.p gr5,@(gr8,#0) - bhi icc0,#2,0b - - membar - bralr - -__outsl_ns_misaligned: - subi.p gr9,#1,gr9 - setlos #1,gr4 -0: - ldubu @(gr9,gr4),gr5 - ldubu.p @(gr9,gr4),gr6 - slli gr5,#8,gr5 - ldubu.p @(gr9,gr4),gr7 - or gr5,gr6,gr5 - ldubu.p @(gr9,gr4),gr6 - slli gr5,#16,gr5 - slli.p gr7,#8,gr7 - or gr5,gr6,gr5 - subicc.p gr10,#1,gr10,icc0 - or gr5,gr7,gr5 - - sti.p gr5,@(gr8,#0) - bhi icc0,#2,0b - - membar - bralr - - .size __outsl_ns, .-__outsl_ns diff --git a/arch/frv/lib/outsl_sw.S b/arch/frv/lib/outsl_sw.S deleted file mode 100644 index 7eb56d35a956..000000000000 --- a/arch/frv/lib/outsl_sw.S +++ /dev/null @@ -1,45 +0,0 @@ -/* outsl_ns.S: output array of 4b words to device with byte swapping - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - - - .text - .p2align 4 - -############################################################################### -# -# void __outsl_sw(unsigned int port, const void *buf, int n) -# -############################################################################### - .globl __outsl_sw - .type __outsl_sw,@function -__outsl_sw: - subi.p gr9,#1,gr9 - setlos #1,gr4 -0: - ldubu @(gr9,gr4),gr5 - ldubu @(gr9,gr4),gr6 - slli gr6,#8,gr6 - ldubu.p @(gr9,gr4),gr7 - or gr5,gr6,gr5 - ldubu.p @(gr9,gr4),gr6 - slli gr7,#16,gr7 - slli.p gr6,#24,gr6 - or gr5,gr7,gr5 - subicc.p gr10,#1,gr10,icc0 - or gr5,gr6,gr5 - - sti.p gr5,@(gr8,#0) - bhi icc0,#2,0b - - membar - bralr - - .size __outsl_sw, .-__outsl_sw diff --git a/arch/frv/mb93090-mb00/Makefile b/arch/frv/mb93090-mb00/Makefile deleted file mode 100644 index bcb03ebb3583..000000000000 --- a/arch/frv/mb93090-mb00/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Makefile for the MB93090-MB00 motherboard stuff -# - -ifeq "$(CONFIG_PCI)" "y" -obj-y := pci-frv.o pci-irq.o pci-vdk.o - -ifeq "$(CONFIG_MMU)" "y" -obj-y += pci-dma.o -else -obj-y += pci-dma-nommu.o -endif -endif - -obj-$(CONFIG_MTD) += flash.o diff --git a/arch/frv/mb93090-mb00/flash.c b/arch/frv/mb93090-mb00/flash.c deleted file mode 100644 index e1cf802d1639..000000000000 --- a/arch/frv/mb93090-mb00/flash.c +++ /dev/null @@ -1,90 +0,0 @@ -/* Flash mappings for the MB93090-MB00 motherboard - * - * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public Licence - * as published by the Free Software Foundation; either version - * 2 of the Licence, or (at your option) any later version. - */ - -#include -#include -#include -#include - -#define MB93090_BOOTROM_ADDR 0xFF000000 /* Boot ROM */ -#define MB93090_BOOTROM_SIZE (2 * 1024 * 1024) -#define MB93090_USERROM_ADDR 0xFF200000 /* User ROM */ -#define MB93090_USERROM_SIZE (2 * 1024 * 1024) - -/* - * default MTD partition table for both main flash devices, expected to be - * overridden by RedBoot - */ -static struct mtd_partition mb93090_partitions[] = { - { - .name = "Filesystem", - .size = MTDPART_SIZ_FULL, - .offset = 0, - } -}; - -/* - * Definition of the MB93090 Boot ROM (on the CPU card) - */ -static struct physmap_flash_data mb93090_bootrom_data = { - .width = 2, - .nr_parts = 2, - .parts = mb93090_partitions, -}; - -static struct resource mb93090_bootrom_resource = { - .start = MB93090_BOOTROM_ADDR, - .end = MB93090_BOOTROM_ADDR + MB93090_BOOTROM_SIZE - 1, - .flags = IORESOURCE_MEM, -}; - -static struct platform_device mb93090_bootrom = { - .name = "physmap-flash", - .id = 0, - .dev.platform_data = &mb93090_bootrom_data, - .num_resources = 1, - .resource = &mb93090_bootrom_resource, -}; - -/* - * Definition of the MB93090 User ROM definition (on the motherboard) - */ -static struct physmap_flash_data mb93090_userrom_data = { - .width = 2, - .nr_parts = 2, - .parts = mb93090_partitions, -}; - -static struct resource mb93090_userrom_resource = { - .start = MB93090_USERROM_ADDR, - .end = MB93090_USERROM_ADDR + MB93090_USERROM_SIZE - 1, - .flags = IORESOURCE_MEM, -}; - -static struct platform_device mb93090_userrom = { - .name = "physmap-flash", - .id = 1, - .dev.platform_data = &mb93090_userrom_data, - .num_resources = 1, - .resource = &mb93090_userrom_resource, -}; - -/* - * register the MB93090 flashes - */ -static int __init mb93090_mtd_init(void) -{ - platform_device_register(&mb93090_bootrom); - platform_device_register(&mb93090_userrom); - return 0; -} - -module_init(mb93090_mtd_init); diff --git a/arch/frv/mb93090-mb00/pci-dma-nommu.c b/arch/frv/mb93090-mb00/pci-dma-nommu.c deleted file mode 100644 index 4a96de7f0af4..000000000000 --- a/arch/frv/mb93090-mb00/pci-dma-nommu.c +++ /dev/null @@ -1,176 +0,0 @@ -/* pci-dma-nommu.c: Dynamic DMA mapping support for the FRV - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Woodhouse (dwmw2@infradead.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include - -#if 1 -#define DMA_SRAM_START dma_coherent_mem_start -#define DMA_SRAM_END dma_coherent_mem_end -#else // Use video RAM on Matrox -#define DMA_SRAM_START 0xe8900000 -#define DMA_SRAM_END 0xe8a00000 -#endif - -struct dma_alloc_record { - struct list_head list; - unsigned long ofs; - unsigned long len; -}; - -static DEFINE_SPINLOCK(dma_alloc_lock); -static LIST_HEAD(dma_alloc_list); - -static void *frv_dma_alloc(struct device *hwdev, size_t size, dma_addr_t *dma_handle, - gfp_t gfp, unsigned long attrs) -{ - struct dma_alloc_record *new; - struct list_head *this = &dma_alloc_list; - unsigned long flags; - unsigned long start = DMA_SRAM_START; - unsigned long end; - - if (!DMA_SRAM_START) { - printk("%s called without any DMA area reserved!\n", __func__); - return NULL; - } - - new = kmalloc(sizeof (*new), GFP_ATOMIC); - if (!new) - return NULL; - - /* Round up to a reasonable alignment */ - new->len = (size + 31) & ~31; - - spin_lock_irqsave(&dma_alloc_lock, flags); - - list_for_each (this, &dma_alloc_list) { - struct dma_alloc_record *this_r = list_entry(this, struct dma_alloc_record, list); - end = this_r->ofs; - - if (end - start >= size) - goto gotone; - - start = this_r->ofs + this_r->len; - } - /* Reached end of list. */ - end = DMA_SRAM_END; - this = &dma_alloc_list; - - if (end - start >= size) { - gotone: - new->ofs = start; - list_add_tail(&new->list, this); - spin_unlock_irqrestore(&dma_alloc_lock, flags); - - *dma_handle = start; - return (void *)start; - } - - kfree(new); - spin_unlock_irqrestore(&dma_alloc_lock, flags); - return NULL; -} - -static void frv_dma_free(struct device *hwdev, size_t size, void *vaddr, - dma_addr_t dma_handle, unsigned long attrs) -{ - struct dma_alloc_record *rec; - unsigned long flags; - - spin_lock_irqsave(&dma_alloc_lock, flags); - - list_for_each_entry(rec, &dma_alloc_list, list) { - if (rec->ofs == dma_handle) { - list_del(&rec->list); - kfree(rec); - spin_unlock_irqrestore(&dma_alloc_lock, flags); - return; - } - } - spin_unlock_irqrestore(&dma_alloc_lock, flags); - BUG(); -} - -static int frv_dma_map_sg(struct device *dev, struct scatterlist *sglist, - int nents, enum dma_data_direction direction, - unsigned long attrs) -{ - struct scatterlist *sg; - int i; - - BUG_ON(direction == DMA_NONE); - - if (attrs & DMA_ATTR_SKIP_CPU_SYNC) - return nents; - - for_each_sg(sglist, sg, nents, i) { - frv_cache_wback_inv(sg_dma_address(sg), - sg_dma_address(sg) + sg_dma_len(sg)); - } - - return nents; -} - -static dma_addr_t frv_dma_map_page(struct device *dev, struct page *page, - unsigned long offset, size_t size, - enum dma_data_direction direction, unsigned long attrs) -{ - BUG_ON(direction == DMA_NONE); - - if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC)) - flush_dcache_page(page); - - return (dma_addr_t) page_to_phys(page) + offset; -} - -static void frv_dma_sync_single_for_device(struct device *dev, - dma_addr_t dma_handle, size_t size, - enum dma_data_direction direction) -{ - flush_write_buffers(); -} - -static void frv_dma_sync_sg_for_device(struct device *dev, - struct scatterlist *sg, int nelems, - enum dma_data_direction direction) -{ - flush_write_buffers(); -} - - -static int frv_dma_supported(struct device *dev, u64 mask) -{ - /* - * we fall back to GFP_DMA when the mask isn't all 1s, - * so we can't guarantee allocations that must be - * within a tighter range than GFP_DMA.. - */ - if (mask < 0x00ffffff) - return 0; - return 1; -} - -const struct dma_map_ops frv_dma_ops = { - .alloc = frv_dma_alloc, - .free = frv_dma_free, - .map_page = frv_dma_map_page, - .map_sg = frv_dma_map_sg, - .sync_single_for_device = frv_dma_sync_single_for_device, - .sync_sg_for_device = frv_dma_sync_sg_for_device, - .dma_supported = frv_dma_supported, -}; -EXPORT_SYMBOL(frv_dma_ops); diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c deleted file mode 100644 index e7130abc0dae..000000000000 --- a/arch/frv/mb93090-mb00/pci-dma.c +++ /dev/null @@ -1,118 +0,0 @@ -/* pci-dma.c: Dynamic DMA mapping support for the FRV CPUs that have MMUs - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -static void *frv_dma_alloc(struct device *hwdev, size_t size, - dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs) -{ - void *ret; - - ret = consistent_alloc(gfp, size, dma_handle); - if (ret) - memset(ret, 0, size); - - return ret; -} - -static void frv_dma_free(struct device *hwdev, size_t size, void *vaddr, - dma_addr_t dma_handle, unsigned long attrs) -{ - consistent_free(vaddr); -} - -static int frv_dma_map_sg(struct device *dev, struct scatterlist *sglist, - int nents, enum dma_data_direction direction, - unsigned long attrs) -{ - struct scatterlist *sg; - unsigned long dampr2; - void *vaddr; - int i; - - BUG_ON(direction == DMA_NONE); - - if (attrs & DMA_ATTR_SKIP_CPU_SYNC) - return nents; - - dampr2 = __get_DAMPR(2); - - for_each_sg(sglist, sg, nents, i) { - vaddr = kmap_atomic_primary(sg_page(sg)); - - frv_dcache_writeback((unsigned long) vaddr, - (unsigned long) vaddr + PAGE_SIZE); - - } - - kunmap_atomic_primary(vaddr); - if (dampr2) { - __set_DAMPR(2, dampr2); - __set_IAMPR(2, dampr2); - } - - return nents; -} - -static dma_addr_t frv_dma_map_page(struct device *dev, struct page *page, - unsigned long offset, size_t size, - enum dma_data_direction direction, unsigned long attrs) -{ - if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC)) - flush_dcache_page(page); - - return (dma_addr_t) page_to_phys(page) + offset; -} - -static void frv_dma_sync_single_for_device(struct device *dev, - dma_addr_t dma_handle, size_t size, - enum dma_data_direction direction) -{ - flush_write_buffers(); -} - -static void frv_dma_sync_sg_for_device(struct device *dev, - struct scatterlist *sg, int nelems, - enum dma_data_direction direction) -{ - flush_write_buffers(); -} - - -static int frv_dma_supported(struct device *dev, u64 mask) -{ - /* - * we fall back to GFP_DMA when the mask isn't all 1s, - * so we can't guarantee allocations that must be - * within a tighter range than GFP_DMA.. - */ - if (mask < 0x00ffffff) - return 0; - return 1; -} - -const struct dma_map_ops frv_dma_ops = { - .alloc = frv_dma_alloc, - .free = frv_dma_free, - .map_page = frv_dma_map_page, - .map_sg = frv_dma_map_sg, - .sync_single_for_device = frv_dma_sync_single_for_device, - .sync_sg_for_device = frv_dma_sync_sg_for_device, - .dma_supported = frv_dma_supported, -}; -EXPORT_SYMBOL(frv_dma_ops); diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c deleted file mode 100644 index c452ddb5620f..000000000000 --- a/arch/frv/mb93090-mb00/pci-frv.c +++ /dev/null @@ -1,193 +0,0 @@ -/* pci-frv.c: low-level PCI access routines - * - * Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from the i386 equivalent stuff - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include - -#include "pci-frv.h" - -/* - * We need to avoid collisions with `mirrored' VGA ports - * and other strange ISA hardware, so we always want the - * addresses to be allocated in the 0x000-0x0ff region - * modulo 0x400. - * - * Why? Because some silly external IO cards only decode - * the low 10 bits of the IO address. The 0x00-0xff region - * is reserved for motherboard devices that decode all 16 - * bits, so it's ok to allocate at, say, 0x2800-0x28ff, - * but we want to try to avoid allocating at 0x2900-0x2bff - * which might have be mirrored at 0x0100-0x03ff.. - */ -resource_size_t -pcibios_align_resource(void *data, const struct resource *res, - resource_size_t size, resource_size_t align) -{ - resource_size_t start = res->start; - - if ((res->flags & IORESOURCE_IO) && (start & 0x300)) - start = (start + 0x3ff) & ~0x3ff; - - return start; -} - - -/* - * Handle resources of PCI devices. If the world were perfect, we could - * just allocate all the resource regions and do nothing more. It isn't. - * On the other hand, we cannot just re-allocate all devices, as it would - * require us to know lots of host bridge internals. So we attempt to - * keep as much of the original configuration as possible, but tweak it - * when it's found to be wrong. - * - * Known BIOS problems we have to work around: - * - I/O or memory regions not configured - * - regions configured, but not enabled in the command register - * - bogus I/O addresses above 64K used - * - expansion ROMs left enabled (this may sound harmless, but given - * the fact the PCI specs explicitly allow address decoders to be - * shared between expansion ROMs and other resource regions, it's - * at least dangerous) - * - * Our solution: - * (1) Allocate resources for all buses behind PCI-to-PCI bridges. - * This gives us fixed barriers on where we can allocate. - * (2) Allocate resources for all enabled devices. If there is - * a collision, just mark the resource as unallocated. Also - * disable expansion ROMs during this step. - * (3) Try to allocate resources for disabled devices. If the - * resources were assigned correctly, everything goes well, - * if they weren't, they won't disturb allocation of other - * resources. - * (4) Assign new addresses to resources which were either - * not configured at all or misconfigured. If explicitly - * requested by the user, configure expansion ROM address - * as well. - */ - -static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) -{ - struct list_head *ln; - struct pci_bus *bus; - struct pci_dev *dev; - int idx; - struct resource *r; - - /* Depth-First Search on bus tree */ - for (ln=bus_list->next; ln != bus_list; ln=ln->next) { - bus = list_entry(ln, struct pci_bus, node); - if ((dev = bus->self)) { - for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { - r = &dev->resource[idx]; - if (!r->start) - continue; - pci_claim_bridge_resource(dev, idx); - } - } - pcibios_allocate_bus_resources(&bus->children); - } -} - -static void __init pcibios_allocate_resources(int pass) -{ - struct pci_dev *dev = NULL; - int idx, disabled; - u16 command; - struct resource *r; - - for_each_pci_dev(dev) { - pci_read_config_word(dev, PCI_COMMAND, &command); - for(idx = 0; idx < 6; idx++) { - r = &dev->resource[idx]; - if (r->parent) /* Already allocated */ - continue; - if (!r->start) /* Address not assigned at all */ - continue; - if (r->flags & IORESOURCE_IO) - disabled = !(command & PCI_COMMAND_IO); - else - disabled = !(command & PCI_COMMAND_MEMORY); - if (pass == disabled) { - DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n", - r->start, r->end, r->flags, disabled, pass); - if (pci_claim_resource(dev, idx) < 0) { - /* We'll assign a new address later */ - r->end -= r->start; - r->start = 0; - } - } - } - if (!pass) { - r = &dev->resource[PCI_ROM_RESOURCE]; - if (r->flags & IORESOURCE_ROM_ENABLE) { - /* Turn the ROM off, leave the resource region, but keep it unregistered. */ - u32 reg; - DBG("PCI: Switching off ROM of %s\n", pci_name(dev)); - r->flags &= ~IORESOURCE_ROM_ENABLE; - pci_read_config_dword(dev, dev->rom_base_reg, ®); - pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE); - } - } - } -} - -static void __init pcibios_assign_resources(void) -{ - struct pci_dev *dev = NULL; - int idx, err; - struct resource *r; - - for_each_pci_dev(dev) { - int class = dev->class >> 8; - - /* Don't touch classless devices and host bridges */ - if (!class || class == PCI_CLASS_BRIDGE_HOST) - continue; - - for(idx=0; idx<6; idx++) { - r = &dev->resource[idx]; - - /* - * Don't touch IDE controllers and I/O ports of video cards! - */ - if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) || - (class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO))) - continue; - - /* - * We shall assign a new address to this resource, either because - * the BIOS forgot to do so or because we have decided the old - * address was unusable for some reason. - */ - if (!r->start && r->end) { - err = pci_assign_resource(dev, idx); - if (err) - dev_err(&dev->dev, - "Failed to assign new address to %d\n", - idx); - } - } - } -} - -void __init pcibios_resource_survey(void) -{ - DBG("PCI: Allocating resources\n"); - pcibios_allocate_bus_resources(&pci_root_buses); - pcibios_allocate_resources(0); - pcibios_allocate_resources(1); - pcibios_assign_resources(); -} diff --git a/arch/frv/mb93090-mb00/pci-frv.h b/arch/frv/mb93090-mb00/pci-frv.h deleted file mode 100644 index 41fbb6bae558..000000000000 --- a/arch/frv/mb93090-mb00/pci-frv.h +++ /dev/null @@ -1,33 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Low-Level PCI Access for FRV machines. - * - * (c) 1999 Martin Mares - */ - -#include - -#undef DEBUG - -#ifdef DEBUG -#define DBG(x...) printk(x) -#else -#define DBG(x...) -#endif - -extern unsigned int __nongpreldata pci_probe; - -/* pci-frv.c */ - -void pcibios_resource_survey(void); - -/* pci-vdk.c */ - -extern struct pci_ops *__nongpreldata pci_root_ops; - -/* pci-irq.c */ -extern unsigned int pcibios_irq_mask; - -void pcibios_irq_init(void); -void pcibios_fixup_irqs(void); -void pcibios_enable_irq(struct pci_dev *dev); diff --git a/arch/frv/mb93090-mb00/pci-irq.c b/arch/frv/mb93090-mb00/pci-irq.c deleted file mode 100644 index a40aa8663056..000000000000 --- a/arch/frv/mb93090-mb00/pci-irq.c +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* pci-irq.c: PCI IRQ routing on the FRV motherboard - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * derived from: arch/i386/kernel/pci-irq.c: (c) 1999--2000 Martin Mares - */ - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "pci-frv.h" - -/* - * DEVICE DEVNO INT#A INT#B INT#C INT#D - * ======= ======= ======= ======= ======= ======= - * MB86943 0 fpga.10 - - - - * RTL8029 16 fpga.12 - - - - * SLOT 1 19 fpga.6 fpga.5 fpga.4 fpga.3 - * SLOT 2 18 fpga.5 fpga.4 fpga.3 fpga.6 - * SLOT 3 17 fpga.4 fpga.3 fpga.6 fpga.5 - * - */ - -static const uint8_t __initconst pci_bus0_irq_routing[32][4] = { - [0 ] = { IRQ_FPGA_MB86943_PCI_INTA }, - [16] = { IRQ_FPGA_RTL8029_INTA }, - [17] = { IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB }, - [18] = { IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA }, - [19] = { IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD }, -}; - -void __init pcibios_irq_init(void) -{ -} - -void __init pcibios_fixup_irqs(void) -{ - struct pci_dev *dev = NULL; - uint8_t line, pin; - - for_each_pci_dev(dev) { - pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); - if (pin) { - dev->irq = pci_bus0_irq_routing[PCI_SLOT(dev->devfn)][pin - 1]; - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); - } - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line); - } -} - -void pcibios_enable_irq(struct pci_dev *dev) -{ - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); -} diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c deleted file mode 100644 index f211839e2cae..000000000000 --- a/arch/frv/mb93090-mb00/pci-vdk.c +++ /dev/null @@ -1,419 +0,0 @@ -/* pci-vdk.c: MB93090-MB00 (VDK) PCI support - * - * Copyright (C) 2003, 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include "pci-frv.h" - -unsigned int __nongpreldata pci_probe = 1; - -struct pci_ops *__nongpreldata pci_root_ops; - -/* - * The accessible PCI window does not cover the entire CPU address space, but - * there are devices we want to access outside of that window, so we need to - * insert specific PCI bus resources instead of using the platform-level bus - * resources directly for the PCI root bus. - * - * These are configured and inserted by pcibios_init() and are attached to the - * root bus by pcibios_fixup_bus(). - */ -static struct resource pci_ioport_resource = { - .name = "PCI IO", - .start = 0, - .end = IO_SPACE_LIMIT, - .flags = IORESOURCE_IO, -}; - -static struct resource pci_iomem_resource = { - .name = "PCI mem", - .start = 0, - .end = -1, - .flags = IORESOURCE_MEM, -}; - -/* - * Functions for accessing PCI configuration space - */ - -#define CONFIG_CMD(bus, dev, where) \ - (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3)) - -#define __set_PciCfgAddr(A) writel((A), (volatile void __iomem *) __region_CS1 + 0x80) - -#define __get_PciCfgDataB(A) readb((volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 3)) -#define __get_PciCfgDataW(A) readw((volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 2)) -#define __get_PciCfgDataL(A) readl((volatile void __iomem *) __region_CS1 + 0x88) - -#define __set_PciCfgDataB(A,V) \ - writeb((V), (volatile void __iomem *) __region_CS1 + 0x88 + (3 - ((A) & 3))) - -#define __set_PciCfgDataW(A,V) \ - writew((V), (volatile void __iomem *) __region_CS1 + 0x88 + (2 - ((A) & 2))) - -#define __set_PciCfgDataL(A,V) \ - writel((V), (volatile void __iomem *) __region_CS1 + 0x88) - -#define __get_PciBridgeDataB(A) readb((volatile void __iomem *) __region_CS1 + 0x800 + (A)) -#define __get_PciBridgeDataW(A) readw((volatile void __iomem *) __region_CS1 + 0x800 + (A)) -#define __get_PciBridgeDataL(A) readl((volatile void __iomem *) __region_CS1 + 0x800 + (A)) - -#define __set_PciBridgeDataB(A,V) writeb((V), (volatile void __iomem *) __region_CS1 + 0x800 + (A)) -#define __set_PciBridgeDataW(A,V) writew((V), (volatile void __iomem *) __region_CS1 + 0x800 + (A)) -#define __set_PciBridgeDataL(A,V) writel((V), (volatile void __iomem *) __region_CS1 + 0x800 + (A)) - -static inline int __query(const struct pci_dev *dev) -{ -// return dev->bus->number==0 && (dev->devfn==PCI_DEVFN(0,0)); -// return dev->bus->number==1; -// return dev->bus->number==0 && -// (dev->devfn==PCI_DEVFN(2,0) || dev->devfn==PCI_DEVFN(3,0)); - return 0; -} - -/*****************************************************************************/ -/* - * - */ -static int pci_frv_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, - u32 *val) -{ - u32 _value; - - if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { - _value = __get_PciBridgeDataL(where & ~3); - } - else { - __set_PciCfgAddr(CONFIG_CMD(bus, devfn, where)); - _value = __get_PciCfgDataL(where & ~3); - } - - switch (size) { - case 1: - _value = _value >> ((where & 3) * 8); - break; - - case 2: - _value = _value >> ((where & 2) * 8); - break; - - case 4: - break; - - default: - BUG(); - } - - *val = _value; - return PCIBIOS_SUCCESSFUL; -} - -static int pci_frv_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, - u32 value) -{ - switch (size) { - case 1: - if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { - __set_PciBridgeDataB(where, value); - } - else { - __set_PciCfgAddr(CONFIG_CMD(bus, devfn, where)); - __set_PciCfgDataB(where, value); - } - break; - - case 2: - if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { - __set_PciBridgeDataW(where, value); - } - else { - __set_PciCfgAddr(CONFIG_CMD(bus, devfn, where)); - __set_PciCfgDataW(where, value); - } - break; - - case 4: - if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { - __set_PciBridgeDataL(where, value); - } - else { - __set_PciCfgAddr(CONFIG_CMD(bus, devfn, where)); - __set_PciCfgDataL(where, value); - } - break; - - default: - BUG(); - } - - return PCIBIOS_SUCCESSFUL; -} - -static struct pci_ops pci_direct_frv = { - .read = pci_frv_read_config, - .write = pci_frv_write_config, -}; - -/* - * Before we decide to use direct hardware access mechanisms, we try to do some - * trivial checks to ensure it at least _seems_ to be working -- we just test - * whether bus 00 contains a host bridge (this is similar to checking - * techniques used in XFree86, but ours should be more reliable since we - * attempt to make use of direct access hints provided by the PCI BIOS). - * - * This should be close to trivial, but it isn't, because there are buggy - * chipsets (yes, you guessed it, by Intel and Compaq) that have no class ID. - */ -static int __init pci_sanity_check(struct pci_ops *o) -{ - struct pci_bus bus; /* Fake bus and device */ - u32 id; - - bus.number = 0; - - if (o->read(&bus, 0, PCI_VENDOR_ID, 4, &id) == PCIBIOS_SUCCESSFUL) { - printk("PCI: VDK Bridge device:vendor: %08x\n", id); - if (id == 0x200e10cf) - return 1; - } - - printk("PCI: VDK Bridge: Sanity check failed\n"); - return 0; -} - -static struct pci_ops * __init pci_check_direct(void) -{ - unsigned long flags; - - local_irq_save(flags); - - /* check if access works */ - if (pci_sanity_check(&pci_direct_frv)) { - local_irq_restore(flags); - printk("PCI: Using configuration frv\n"); -// request_mem_region(0xBE040000, 256, "FRV bridge"); -// request_mem_region(0xBFFFFFF4, 12, "PCI frv"); - return &pci_direct_frv; - } - - local_irq_restore(flags); - return NULL; -} - -/* - * Exceptions for specific devices. Usually work-arounds for fatal design flaws. - */ - -static void __init pci_fixup_umc_ide(struct pci_dev *d) -{ - /* - * UM8886BF IDE controller sets region type bits incorrectly, - * therefore they look like memory despite of them being I/O. - */ - int i; - - printk("PCI: Fixing base address flags for device %s\n", pci_name(d)); - for(i=0; i<4; i++) - d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO; -} - -static void pci_fixup_ide_bases(struct pci_dev *d) -{ - int i; - - /* - * PCI IDE controllers use non-standard I/O port decoding, respect it. - */ - if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE) - return; - printk("PCI: IDE base address fixup for %s\n", pci_name(d)); - for(i=0; i<4; i++) { - struct resource *r = &d->resource[i]; - if ((r->start & ~0x80) == 0x374) { - r->start |= 2; - r->end = r->start; - } - } -} - -static void pci_fixup_ide_trash(struct pci_dev *d) -{ - int i; - - /* - * There exist PCI IDE controllers which have utter garbage - * in first four base registers. Ignore that. - */ - printk("PCI: IDE base address trash cleared for %s\n", pci_name(d)); - for(i=0; i<4; i++) - d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0; -} - -static void pci_fixup_latency(struct pci_dev *d) -{ - /* - * SiS 5597 and 5598 chipsets require latency timer set to - * at most 32 to avoid lockups. - */ - DBG("PCI: Setting max latency to 32\n"); - pcibios_max_latency = 32; -} - -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, pci_fixup_ide_trash); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, pci_fixup_latency); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5598, pci_fixup_latency); -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases); - -/* - * Called after each bus is probed, but before its children - * are examined. - */ - -void pcibios_fixup_bus(struct pci_bus *bus) -{ -#if 0 - printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number); -#endif - - pci_read_bridge_bases(bus); - - if (bus->number == 0) { - struct pci_dev *dev; - list_for_each_entry(dev, &bus->devices, bus_list) { - if (dev->devfn == 0) { - dev->resource[0].start = 0; - dev->resource[0].end = 0; - } - } - } -} - -/* - * Initialization. Try all known PCI access methods. Note that we support - * using both PCI BIOS and direct access: in such cases, we use I/O ports - * to access config space, but we still keep BIOS order of cards to be - * compatible with 2.0.X. This should go away some day. - */ - -int __init pcibios_init(void) -{ - struct pci_bus *bus; - struct pci_ops *dir = NULL; - LIST_HEAD(resources); - - if (!mb93090_mb00_detected) - return -ENXIO; - - __reg_MB86943_sl_ctl |= MB86943_SL_CTL_DRCT_MASTER_SWAP | MB86943_SL_CTL_DRCT_SLAVE_SWAP; - - __reg_MB86943_ecs_base(1) = ((__region_CS2 + 0x01000000) >> 9) | 0x08000000; - __reg_MB86943_ecs_base(2) = ((__region_CS2 + 0x00000000) >> 9) | 0x08000000; - - *(volatile uint32_t *) (__region_CS1 + 0x848) = 0xe0000000; - *(volatile uint32_t *) (__region_CS1 + 0x8b8) = 0x00000000; - - __reg_MB86943_sl_pci_io_base = (__region_CS2 + 0x04000000) >> 9; - __reg_MB86943_sl_pci_mem_base = (__region_CS2 + 0x08000000) >> 9; - __reg_MB86943_pci_sl_io_base = __region_CS2 + 0x04000000; - __reg_MB86943_pci_sl_mem_base = __region_CS2 + 0x08000000; - mb(); - - /* enable PCI arbitration */ - __reg_MB86943_pci_arbiter = MB86943_PCIARB_EN; - - pci_ioport_resource.start = (__reg_MB86943_sl_pci_io_base << 9) & 0xfffffc00; - pci_ioport_resource.end = (__reg_MB86943_sl_pci_io_range << 9) | 0x3ff; - pci_ioport_resource.end += pci_ioport_resource.start; - - printk("PCI IO window: %08llx-%08llx\n", - (unsigned long long) pci_ioport_resource.start, - (unsigned long long) pci_ioport_resource.end); - - pci_iomem_resource.start = (__reg_MB86943_sl_pci_mem_base << 9) & 0xfffffc00; - pci_iomem_resource.end = (__reg_MB86943_sl_pci_mem_range << 9) | 0x3ff; - pci_iomem_resource.end += pci_iomem_resource.start; - - /* Reserve somewhere to write to flush posted writes. This is used by - * __flush_PCI_writes() from asm/io.h to force the write FIFO in the - * CPU-PCI bridge to flush as this doesn't happen automatically when a - * read is performed on the MB93090 development kit motherboard. - */ - pci_iomem_resource.start += 0x400; - - printk("PCI MEM window: %08llx-%08llx\n", - (unsigned long long) pci_iomem_resource.start, - (unsigned long long) pci_iomem_resource.end); - printk("PCI DMA memory: %08lx-%08lx\n", - dma_coherent_mem_start, dma_coherent_mem_end); - - if (insert_resource(&iomem_resource, &pci_iomem_resource) < 0) - panic("Unable to insert PCI IOMEM resource\n"); - if (insert_resource(&ioport_resource, &pci_ioport_resource) < 0) - panic("Unable to insert PCI IOPORT resource\n"); - - if (!pci_probe) - return -ENXIO; - - dir = pci_check_direct(); - if (dir) - pci_root_ops = dir; - else { - printk("PCI: No PCI bus detected\n"); - return -ENXIO; - } - - printk("PCI: Probing PCI hardware\n"); - pci_add_resource(&resources, &pci_ioport_resource); - pci_add_resource(&resources, &pci_iomem_resource); - bus = pci_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources); - - pcibios_irq_init(); - pcibios_fixup_irqs(); - pcibios_resource_survey(); - if (!bus) - return 0; - - pci_bus_add_devices(bus); - return 0; -} - -arch_initcall(pcibios_init); - -char * __init pcibios_setup(char *str) -{ - if (!strcmp(str, "off")) { - pci_probe = 0; - return NULL; - } - return str; -} - -int pcibios_enable_device(struct pci_dev *dev, int mask) -{ - int err; - - if ((err = pci_enable_resources(dev, mask)) < 0) - return err; - if (!dev->msi_enabled) - pcibios_enable_irq(dev); - return 0; -} diff --git a/arch/frv/mm/Makefile b/arch/frv/mm/Makefile deleted file mode 100644 index 1bca5ab8a6ab..000000000000 --- a/arch/frv/mm/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# -# Makefile for the arch-specific parts of the memory manager. -# - -obj-y := init.o kmap.o - -obj-$(CONFIG_MMU) += \ - pgalloc.o highmem.o fault.o extable.o cache-page.o tlb-flush.o tlb-miss.o \ - mmu-context.o dma-alloc.o elf-fdpic.o diff --git a/arch/frv/mm/cache-page.c b/arch/frv/mm/cache-page.c deleted file mode 100644 index 8e09dae0ec3f..000000000000 --- a/arch/frv/mm/cache-page.c +++ /dev/null @@ -1,71 +0,0 @@ -/* cache-page.c: whole-page cache wrangling functions for MMU linux - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include -#include -#include - -/*****************************************************************************/ -/* - * DCF takes a virtual address and the page may not currently have one - * - temporarily hijack a kmap_atomic() slot and attach the page to it - */ -void flush_dcache_page(struct page *page) -{ - unsigned long dampr2; - void *vaddr; - - dampr2 = __get_DAMPR(2); - - vaddr = kmap_atomic_primary(page); - - frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE); - - kunmap_atomic_primary(vaddr); - - if (dampr2) { - __set_DAMPR(2, dampr2); - __set_IAMPR(2, dampr2); - } - -} /* end flush_dcache_page() */ - -EXPORT_SYMBOL(flush_dcache_page); - -/*****************************************************************************/ -/* - * ICI takes a virtual address and the page may not currently have one - * - so we temporarily attach the page to a bit of virtual space so that is can be flushed - */ -void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, - unsigned long start, unsigned long len) -{ - unsigned long dampr2; - void *vaddr; - - dampr2 = __get_DAMPR(2); - - vaddr = kmap_atomic_primary(page); - - start = (start & ~PAGE_MASK) | (unsigned long) vaddr; - frv_cache_wback_inv(start, start + len); - - kunmap_atomic_primary(vaddr); - - if (dampr2) { - __set_DAMPR(2, dampr2); - __set_IAMPR(2, dampr2); - } - -} /* end flush_icache_user_range() */ - -EXPORT_SYMBOL(flush_icache_user_range); diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c deleted file mode 100644 index e701aa9e6a14..000000000000 --- a/arch/frv/mm/dma-alloc.c +++ /dev/null @@ -1,183 +0,0 @@ -/* dma-alloc.c: consistent DMA memory allocation - * - * Derived from arch/ppc/mm/cachemap.c - * - * PowerPC version derived from arch/arm/mm/consistent.c - * Copyright (C) 2001 Dan Malek (dmalek@jlc.net) - * - * linux/arch/arm/mm/consistent.c - * - * Copyright (C) 2000 Russell King - * - * Consistent memory allocators. Used for DMA devices that want to - * share uncached memory with the processor core. The function return - * is the virtual address and 'dma_handle' is the physical address. - * Mostly stolen from the ARM port, with some changes for PowerPC. - * -- Dan - * Modified for 36-bit support. -Matt - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static int map_page(unsigned long va, unsigned long pa, pgprot_t prot) -{ - pgd_t *pge; - pud_t *pue; - pmd_t *pme; - pte_t *pte; - int err = -ENOMEM; - - /* Use upper 10 bits of VA to index the first level map */ - pge = pgd_offset_k(va); - pue = pud_offset(pge, va); - pme = pmd_offset(pue, va); - - /* Use middle 10 bits of VA to index the second-level map */ - pte = pte_alloc_kernel(pme, va); - if (pte != 0) { - err = 0; - set_pte(pte, mk_pte_phys(pa & PAGE_MASK, prot)); - } - - return err; -} - -/* - * This function will allocate the requested contiguous pages and - * map them into the kernel's vmalloc() space. This is done so we - * get unique mapping for these pages, outside of the kernel's 1:1 - * virtual:physical mapping. This is necessary so we can cover large - * portions of the kernel with single large page TLB entries, and - * still get unique uncached pages for consistent DMA. - */ -void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle) -{ - struct vm_struct *area; - unsigned long page, va, pa; - void *ret; - int order, err, i; - - if (in_interrupt()) - BUG(); - - /* only allocate page size areas */ - size = PAGE_ALIGN(size); - order = get_order(size); - - page = __get_free_pages(gfp, order); - if (!page) { - BUG(); - return NULL; - } - - /* allocate some common virtual space to map the new pages */ - area = get_vm_area(size, VM_ALLOC); - if (area == 0) { - free_pages(page, order); - return NULL; - } - va = VMALLOC_VMADDR(area->addr); - ret = (void *) va; - - /* this gives us the real physical address of the first page */ - *dma_handle = pa = virt_to_bus((void *) page); - - /* set refcount=1 on all pages in an order>0 allocation so that vfree() will actually free - * all pages that were allocated. - */ - if (order > 0) { - struct page *rpage = virt_to_page(page); - split_page(rpage, order); - } - - err = 0; - for (i = 0; i < size && err == 0; i += PAGE_SIZE) - err = map_page(va + i, pa + i, PAGE_KERNEL_NOCACHE); - - if (err) { - vfree((void *) va); - return NULL; - } - - /* we need to ensure that there are no cachelines in use, or worse dirty in this area - * - can't do until after virtual address mappings are created - */ - frv_cache_invalidate(va, va + size); - - return ret; -} - -/* - * free page(s) as defined by the above mapping. - */ -void consistent_free(void *vaddr) -{ - if (in_interrupt()) - BUG(); - vfree(vaddr); -} - -/* - * make an area consistent. - */ -void consistent_sync(void *vaddr, size_t size, int direction) -{ - unsigned long start = (unsigned long) vaddr; - unsigned long end = start + size; - - switch (direction) { - case PCI_DMA_NONE: - BUG(); - case PCI_DMA_FROMDEVICE: /* invalidate only */ - frv_cache_invalidate(start, end); - break; - case PCI_DMA_TODEVICE: /* writeback only */ - frv_dcache_writeback(start, end); - break; - case PCI_DMA_BIDIRECTIONAL: /* writeback and invalidate */ - frv_dcache_writeback(start, end); - break; - } -} - -/* - * consistent_sync_page make a page are consistent. identical - * to consistent_sync, but takes a struct page instead of a virtual address - */ - -void consistent_sync_page(struct page *page, unsigned long offset, - size_t size, int direction) -{ - void *start; - - start = page_address(page) + offset; - consistent_sync(start, size, direction); -} diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c deleted file mode 100644 index 46aa289c5102..000000000000 --- a/arch/frv/mm/elf-fdpic.c +++ /dev/null @@ -1,114 +0,0 @@ -/* elf-fdpic.c: ELF FDPIC memory layout management - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include - -/*****************************************************************************/ -/* - * lay out the userspace VM according to our grand design - */ -#ifdef CONFIG_MMU -void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params, - struct elf_fdpic_params *interp_params, - unsigned long *start_stack, - unsigned long *start_brk) -{ - *start_stack = 0x02200000UL; - - /* if the only executable is a shared object, assume that it is an interpreter rather than - * a true executable, and map it such that "ld.so --list" comes out right - */ - if (!(interp_params->flags & ELF_FDPIC_FLAG_PRESENT) && - exec_params->hdr.e_type != ET_EXEC - ) { - exec_params->load_addr = PAGE_SIZE; - - *start_brk = 0x80000000UL; - } - else { - exec_params->load_addr = 0x02200000UL; - - if ((exec_params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) == - ELF_FDPIC_FLAG_INDEPENDENT - ) { - exec_params->flags &= ~ELF_FDPIC_FLAG_ARRANGEMENT; - exec_params->flags |= ELF_FDPIC_FLAG_CONSTDISP; - } - } - -} /* end elf_fdpic_arch_lay_out_mm() */ -#endif - -/*****************************************************************************/ -/* - * place non-fixed mmaps firstly in the bottom part of memory, working up, and then in the top part - * of memory, working down - */ -unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, - unsigned long pgoff, unsigned long flags) -{ - struct vm_area_struct *vma; - struct vm_unmapped_area_info info; - - if (len > TASK_SIZE) - return -ENOMEM; - - /* handle MAP_FIXED */ - if (flags & MAP_FIXED) - return addr; - - /* only honour a hint if we're not going to clobber something doing so */ - if (addr) { - addr = PAGE_ALIGN(addr); - vma = find_vma(current->mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vm_start_gap(vma))) - goto success; - } - - /* search between the bottom of user VM and the stack grow area */ - info.flags = 0; - info.length = len; - info.low_limit = PAGE_SIZE; - info.high_limit = (current->mm->start_stack - 0x00200000); - info.align_mask = 0; - info.align_offset = 0; - addr = vm_unmapped_area(&info); - if (!(addr & ~PAGE_MASK)) - goto success; - VM_BUG_ON(addr != -ENOMEM); - - /* search from just above the WorkRAM area to the top of memory */ - info.low_limit = PAGE_ALIGN(0x80000000); - info.high_limit = TASK_SIZE; - addr = vm_unmapped_area(&info); - if (!(addr & ~PAGE_MASK)) - goto success; - VM_BUG_ON(addr != -ENOMEM); - -#if 0 - printk("[area] l=%lx (ENOMEM) f='%s'\n", - len, filp ? filp->f_path.dentry->d_name.name : ""); -#endif - return -ENOMEM; - - success: -#if 0 - printk("[area] l=%lx ad=%lx f='%s'\n", - len, addr, filp ? filp->f_path.dentry->d_name.name : ""); -#endif - return addr; -} /* end arch_get_unmapped_area() */ diff --git a/arch/frv/mm/extable.c b/arch/frv/mm/extable.c deleted file mode 100644 index 77c0c5ba88bc..000000000000 --- a/arch/frv/mm/extable.c +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/frv/mm/extable.c - */ - -#include -#include -#include - -extern const void __memset_end, __memset_user_error_lr, __memset_user_error_handler; -extern const void __memcpy_end, __memcpy_user_error_lr, __memcpy_user_error_handler; -extern spinlock_t modlist_lock; - -int fixup_exception(struct pt_regs *regs) -{ - const struct exception_table_entry *extab; - unsigned long pc = regs->pc; - - /* determine if the fault lay during a memcpy_user or a memset_user */ - if (regs->lr == (unsigned long) &__memset_user_error_lr && - (unsigned long) &memset <= pc && pc < (unsigned long) &__memset_end - ) { - /* the fault occurred in a protected memset - * - we search for the return address (in LR) instead of the program counter - * - it was probably during a clear_user() - */ - regs->pc = (unsigned long) &__memset_user_error_handler; - return 1; - } - - if (regs->lr == (unsigned long) &__memcpy_user_error_lr && - (unsigned long) &memcpy <= pc && pc < (unsigned long) &__memcpy_end - ) { - /* the fault occurred in a protected memset - * - we search for the return address (in LR) instead of the program counter - * - it was probably during a copy_to/from_user() - */ - regs->pc = (unsigned long) &__memcpy_user_error_handler; - return 1; - } - - extab = search_exception_tables(pc); - if (extab) { - regs->pc = extab->fixup; - return 1; - } - - return 0; -} diff --git a/arch/frv/mm/fault.c b/arch/frv/mm/fault.c deleted file mode 100644 index cbe7aec863e3..000000000000 --- a/arch/frv/mm/fault.c +++ /dev/null @@ -1,328 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/frv/mm/fault.c - * - * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. - * - Written by David Howells (dhowells@redhat.com) - * - Derived from arch/m68knommu/mm/fault.c - * - Copyright (C) 1998 D. Jeff Dionne , - * - Copyright (C) 2000 Lineo, Inc. (www.lineo.com) - * - * Based on: - * - * linux/arch/m68k/mm/fault.c - * - * Copyright (C) 1995 Hamish Macdonald - */ - -#include -#include -#include -#include -#include -#include - -#include -#include - -/*****************************************************************************/ -/* - * This routine handles page faults. It determines the problem, and - * then passes it off to one of the appropriate routines. - */ -asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long ear0) -{ - struct vm_area_struct *vma; - struct mm_struct *mm; - unsigned long _pme, lrai, lrad; - unsigned long flags = 0; - siginfo_t info; - pgd_t *pge; - pud_t *pue; - pte_t *pte; - int fault; - -#if 0 - const char *atxc[16] = { - [0x0] = "mmu-miss", [0x8] = "multi-dat", [0x9] = "multi-sat", - [0xa] = "tlb-miss", [0xc] = "privilege", [0xd] = "write-prot", - }; - - printk("do_page_fault(%d,%lx [%s],%lx)\n", - datammu, esr0, atxc[esr0 >> 20 & 0xf], ear0); -#endif - - mm = current->mm; - - /* - * We fault-in kernel-space virtual memory on-demand. The - * 'reference' page table is init_mm.pgd. - * - * NOTE! We MUST NOT take any locks for this case. We may - * be in an interrupt or a critical region, and should - * only copy the information from the master page table, - * nothing more. - * - * This verifies that the fault happens in kernel space - * and that the fault was a page not present (invalid) error - */ - if (!user_mode(__frame) && (esr0 & ESR0_ATXC) == ESR0_ATXC_AMRTLB_MISS) { - if (ear0 >= VMALLOC_START && ear0 < VMALLOC_END) - goto kernel_pte_fault; - if (ear0 >= PKMAP_BASE && ear0 < PKMAP_END) - goto kernel_pte_fault; - } - - info.si_code = SEGV_MAPERR; - - /* - * If we're in an interrupt or have no user - * context, we must not take the fault.. - */ - if (faulthandler_disabled() || !mm) - goto no_context; - - if (user_mode(__frame)) - flags |= FAULT_FLAG_USER; - - down_read(&mm->mmap_sem); - - vma = find_vma(mm, ear0); - if (!vma) - goto bad_area; - if (vma->vm_start <= ear0) - goto good_area; - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; - - if (user_mode(__frame)) { - /* - * accessing the stack below %esp is always a bug. - * The "+ 32" is there due to some instructions (like - * pusha) doing post-decrement on the stack and that - * doesn't show up until later.. - */ - if ((ear0 & PAGE_MASK) + 2 * PAGE_SIZE < __frame->sp) { -#if 0 - printk("[%d] ### Access below stack @%lx (sp=%lx)\n", - current->pid, ear0, __frame->sp); - show_registers(__frame); - printk("[%d] ### Code: [%08lx] %02x %02x %02x %02x %02x %02x %02x %02x\n", - current->pid, - __frame->pc, - ((u8*)__frame->pc)[0], - ((u8*)__frame->pc)[1], - ((u8*)__frame->pc)[2], - ((u8*)__frame->pc)[3], - ((u8*)__frame->pc)[4], - ((u8*)__frame->pc)[5], - ((u8*)__frame->pc)[6], - ((u8*)__frame->pc)[7] - ); -#endif - goto bad_area; - } - } - - if (expand_stack(vma, ear0)) - goto bad_area; - -/* - * Ok, we have a good vm_area for this memory access, so - * we can handle it.. - */ - good_area: - info.si_code = SEGV_ACCERR; - switch (esr0 & ESR0_ATXC) { - default: - /* handle write to write protected page */ - case ESR0_ATXC_WP_EXCEP: -#ifdef TEST_VERIFY_AREA - if (!(user_mode(__frame))) - printk("WP fault at %08lx\n", __frame->pc); -#endif - if (!(vma->vm_flags & VM_WRITE)) - goto bad_area; - flags |= FAULT_FLAG_WRITE; - break; - - /* handle read from protected page */ - case ESR0_ATXC_PRIV_EXCEP: - goto bad_area; - - /* handle read, write or exec on absent page - * - can't support write without permitting read - * - don't support execute without permitting read and vice-versa - */ - case ESR0_ATXC_AMRTLB_MISS: - if (!(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC))) - goto bad_area; - break; - } - - /* - * If for any reason at all we couldn't handle the fault, - * make sure we exit gracefully rather than endlessly redo - * the fault. - */ - fault = handle_mm_fault(vma, ear0, flags); - if (unlikely(fault & VM_FAULT_ERROR)) { - if (fault & VM_FAULT_OOM) - goto out_of_memory; - else if (fault & VM_FAULT_SIGSEGV) - goto bad_area; - else if (fault & VM_FAULT_SIGBUS) - goto do_sigbus; - BUG(); - } - if (fault & VM_FAULT_MAJOR) - current->maj_flt++; - else - current->min_flt++; - - up_read(&mm->mmap_sem); - return; - -/* - * Something tried to access memory that isn't in our memory map.. - * Fix it, but check if it's kernel or user first.. - */ - bad_area: - up_read(&mm->mmap_sem); - - /* User mode accesses just cause a SIGSEGV */ - if (user_mode(__frame)) { - info.si_signo = SIGSEGV; - info.si_errno = 0; - /* info.si_code has been set above */ - info.si_addr = (void *) ear0; - force_sig_info(SIGSEGV, &info, current); - return; - } - - no_context: - /* are we prepared to handle this kernel fault? */ - if (fixup_exception(__frame)) - return; - -/* - * Oops. The kernel tried to access some bad page. We'll have to - * terminate things with extreme prejudice. - */ - - bust_spinlocks(1); - - if (ear0 < PAGE_SIZE) - printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); - else - printk(KERN_ALERT "Unable to handle kernel paging request"); - printk(" at virtual addr %08lx\n", ear0); - printk(" PC : %08lx\n", __frame->pc); - printk(" EXC : esr0=%08lx ear0=%08lx\n", esr0, ear0); - - asm("lrai %1,%0,#1,#0,#0" : "=&r"(lrai) : "r"(ear0)); - asm("lrad %1,%0,#1,#0,#0" : "=&r"(lrad) : "r"(ear0)); - - printk(KERN_ALERT " LRAI: %08lx\n", lrai); - printk(KERN_ALERT " LRAD: %08lx\n", lrad); - - __break_hijack_kernel_event(); - - pge = pgd_offset(current->mm, ear0); - pue = pud_offset(pge, ear0); - _pme = pue->pue[0].ste[0]; - - printk(KERN_ALERT " PGE : %8p { PME %08lx }\n", pge, _pme); - - if (_pme & xAMPRx_V) { - unsigned long dampr, damlr, val; - - asm volatile("movsg dampr2,%0 ! movgs %2,dampr2 ! movsg damlr2,%1" - : "=&r"(dampr), "=r"(damlr) - : "r" (_pme | xAMPRx_L|xAMPRx_SS_16Kb|xAMPRx_S|xAMPRx_C|xAMPRx_V) - ); - - pte = (pte_t *) damlr + __pte_index(ear0); - val = pte_val(*pte); - - asm volatile("movgs %0,dampr2" :: "r" (dampr)); - - printk(KERN_ALERT " PTE : %8p { %08lx }\n", pte, val); - } - - die_if_kernel("Oops\n"); - do_exit(SIGKILL); - -/* - * We ran out of memory, or some other thing happened to us that made - * us unable to handle the page fault gracefully. - */ - out_of_memory: - up_read(&mm->mmap_sem); - if (!user_mode(__frame)) - goto no_context; - pagefault_out_of_memory(); - return; - - do_sigbus: - up_read(&mm->mmap_sem); - - /* - * Send a sigbus, regardless of whether we were in kernel - * or user mode. - */ - info.si_signo = SIGBUS; - info.si_errno = 0; - info.si_code = BUS_ADRERR; - info.si_addr = (void *) ear0; - force_sig_info(SIGBUS, &info, current); - - /* Kernel mode? Handle exceptions or die */ - if (!user_mode(__frame)) - goto no_context; - return; - -/* - * The fault was caused by a kernel PTE (such as installed by vmalloc or kmap) - */ - kernel_pte_fault: - { - /* - * Synchronize this task's top level page-table - * with the 'reference' page table. - * - * Do _not_ use "tsk" here. We might be inside - * an interrupt in the middle of a task switch.. - */ - int index = pgd_index(ear0); - pgd_t *pgd, *pgd_k; - pud_t *pud, *pud_k; - pmd_t *pmd, *pmd_k; - pte_t *pte_k; - - pgd = (pgd_t *) __get_TTBR(); - pgd = (pgd_t *)__va(pgd) + index; - pgd_k = ((pgd_t *)(init_mm.pgd)) + index; - - if (!pgd_present(*pgd_k)) - goto no_context; - //set_pgd(pgd, *pgd_k); /////// gcc ICE's on this line - - pud_k = pud_offset(pgd_k, ear0); - if (!pud_present(*pud_k)) - goto no_context; - - pmd_k = pmd_offset(pud_k, ear0); - if (!pmd_present(*pmd_k)) - goto no_context; - - pud = pud_offset(pgd, ear0); - pmd = pmd_offset(pud, ear0); - set_pmd(pmd, *pmd_k); - - pte_k = pte_offset_kernel(pmd_k, ear0); - if (!pte_present(*pte_k)) - goto no_context; - return; - } -} /* end do_page_fault() */ diff --git a/arch/frv/mm/highmem.c b/arch/frv/mm/highmem.c deleted file mode 100644 index 45750fb65c49..000000000000 --- a/arch/frv/mm/highmem.c +++ /dev/null @@ -1,86 +0,0 @@ -/* highmem.c: arch-specific highmem stuff - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include - -void *kmap(struct page *page) -{ - might_sleep(); - if (!PageHighMem(page)) - return page_address(page); - return kmap_high(page); -} - -EXPORT_SYMBOL(kmap); - -void kunmap(struct page *page) -{ - if (in_interrupt()) - BUG(); - if (!PageHighMem(page)) - return; - kunmap_high(page); -} - -EXPORT_SYMBOL(kunmap); - -void *kmap_atomic(struct page *page) -{ - unsigned long paddr; - int type; - - preempt_disable(); - pagefault_disable(); - type = kmap_atomic_idx_push(); - paddr = page_to_phys(page); - - switch (type) { - /* - * The first 4 primary maps are reserved for architecture code - */ - case 0: return __kmap_atomic_primary(0, paddr, 6); - case 1: return __kmap_atomic_primary(0, paddr, 7); - case 2: return __kmap_atomic_primary(0, paddr, 8); - case 3: return __kmap_atomic_primary(0, paddr, 9); - case 4: return __kmap_atomic_primary(0, paddr, 10); - - case 5 ... 5 + NR_TLB_LINES - 1: - return __kmap_atomic_secondary(type - 5, paddr); - - default: - BUG(); - return NULL; - } -} -EXPORT_SYMBOL(kmap_atomic); - -void __kunmap_atomic(void *kvaddr) -{ - int type = kmap_atomic_idx(); - switch (type) { - case 0: __kunmap_atomic_primary(0, 6); break; - case 1: __kunmap_atomic_primary(0, 7); break; - case 2: __kunmap_atomic_primary(0, 8); break; - case 3: __kunmap_atomic_primary(0, 9); break; - case 4: __kunmap_atomic_primary(0, 10); break; - - case 5 ... 5 + NR_TLB_LINES - 1: - __kunmap_atomic_secondary(type - 5, kvaddr); - break; - - default: - BUG(); - } - kmap_atomic_idx_pop(); - pagefault_enable(); - preempt_enable(); -} -EXPORT_SYMBOL(__kunmap_atomic); diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c deleted file mode 100644 index cf464100e838..000000000000 --- a/arch/frv/mm/init.c +++ /dev/null @@ -1,144 +0,0 @@ -/* init.c: memory initialisation for FRV - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Derived from: - * - linux/arch/m68knommu/mm/init.c - * - Copyright (C) 1998 D. Jeff Dionne , Kenneth Albanowski , - * - Copyright (C) 2000 Lineo, Inc. (www.lineo.com) - * - linux/arch/m68k/mm/init.c - * - Copyright (C) 1995 Hamish Macdonald - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#undef DEBUG - -/* - * ZERO_PAGE is a special page that is used for zero-initialized - * data and COW. - */ -unsigned long empty_zero_page; -EXPORT_SYMBOL(empty_zero_page); - -/*****************************************************************************/ -/* - * paging_init() continues the virtual memory environment setup which - * was begun by the code in arch/head.S. - * The parameters are pointers to where to stick the starting and ending - * addresses of available kernel virtual memory. - */ -void __init paging_init(void) -{ - unsigned long zones_size[MAX_NR_ZONES] = {0, }; - - /* allocate some pages for kernel housekeeping tasks */ - empty_zero_page = (unsigned long) alloc_bootmem_pages(PAGE_SIZE); - - memset((void *) empty_zero_page, 0, PAGE_SIZE); - -#ifdef CONFIG_HIGHMEM - if (get_num_physpages() - num_mappedpages) { - pgd_t *pge; - pud_t *pue; - pmd_t *pme; - - pkmap_page_table = alloc_bootmem_pages(PAGE_SIZE); - - pge = swapper_pg_dir + pgd_index_k(PKMAP_BASE); - pue = pud_offset(pge, PKMAP_BASE); - pme = pmd_offset(pue, PKMAP_BASE); - __set_pmd(pme, virt_to_phys(pkmap_page_table) | _PAGE_TABLE); - } -#endif - - /* distribute the allocatable pages across the various zones and pass them to the allocator - */ - zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn; -#ifdef CONFIG_HIGHMEM - zones_size[ZONE_HIGHMEM] = get_num_physpages() - num_mappedpages; -#endif - - free_area_init(zones_size); - -#ifdef CONFIG_MMU - /* initialise init's MMU context */ - init_new_context(&init_task, &init_mm); -#endif - -} /* end paging_init() */ - -/*****************************************************************************/ -/* - * - */ -void __init mem_init(void) -{ - unsigned long code_size = _etext - _stext; - - /* this will put all low memory onto the freelists */ - free_all_bootmem(); -#if defined(CONFIG_MMU) && defined(CONFIG_HIGHMEM) - { - unsigned long pfn; - - for (pfn = get_num_physpages() - 1; - pfn >= num_mappedpages; pfn--) - free_highmem_page(&mem_map[pfn]); - } -#endif - - mem_init_print_info(NULL); - if (rom_length > 0 && rom_length >= code_size) - printk("Memory available: %luKiB/%luKiB ROM\n", - (rom_length - code_size) >> 10, rom_length >> 10); -} /* end mem_init() */ - -/*****************************************************************************/ -/* - * free the memory that was only required for initialisation - */ -void free_initmem(void) -{ -#if defined(CONFIG_RAMKERNEL) && !defined(CONFIG_PROTECT_KERNEL) - free_initmem_default(-1); -#endif -} /* end free_initmem() */ - -/*****************************************************************************/ -/* - * free the initial ramdisk memory - */ -#ifdef CONFIG_BLK_DEV_INITRD -void __init free_initrd_mem(unsigned long start, unsigned long end) -{ - free_reserved_area((void *)start, (void *)end, -1, "initrd"); -} /* end free_initrd_mem() */ -#endif diff --git a/arch/frv/mm/kmap.c b/arch/frv/mm/kmap.c deleted file mode 100644 index e9217e605aa8..000000000000 --- a/arch/frv/mm/kmap.c +++ /dev/null @@ -1,51 +0,0 @@ -/* kmap.c: ioremapping handlers - * - * Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - Derived from arch/m68k/mm/kmap.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#undef DEBUG - -/*****************************************************************************/ -/* - * Map some physical address range into the kernel address space. - */ - -void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) -{ - return (void __iomem *)physaddr; -} - -/* - * Unmap a ioremap()ed region again - */ -void iounmap(void volatile __iomem *addr) -{ -} - -/* - * Set new cache mode for some kernel address space. - * The caller must push data for that range itself, if such data may already - * be in the cache. - */ -void kernel_set_cachemode(void *addr, unsigned long size, int cmode) -{ -} diff --git a/arch/frv/mm/mmu-context.c b/arch/frv/mm/mmu-context.c deleted file mode 100644 index 16946a58f64d..000000000000 --- a/arch/frv/mm/mmu-context.c +++ /dev/null @@ -1,210 +0,0 @@ -/* mmu-context.c: MMU context allocation and management - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include - -#define NR_CXN 4096 - -static unsigned long cxn_bitmap[NR_CXN / (sizeof(unsigned long) * 8)]; -static LIST_HEAD(cxn_owners_lru); -static DEFINE_SPINLOCK(cxn_owners_lock); - -int __nongpreldata cxn_pinned = -1; - - -/*****************************************************************************/ -/* - * initialise a new context - */ -int init_new_context(struct task_struct *tsk, struct mm_struct *mm) -{ - memset(&mm->context, 0, sizeof(mm->context)); - INIT_LIST_HEAD(&mm->context.id_link); - mm->context.itlb_cached_pge = 0xffffffffUL; - mm->context.dtlb_cached_pge = 0xffffffffUL; - - return 0; -} /* end init_new_context() */ - -/*****************************************************************************/ -/* - * make sure a kernel MMU context has a CPU context number - * - call with cxn_owners_lock held - */ -static unsigned get_cxn(mm_context_t *ctx) -{ - struct list_head *_p; - mm_context_t *p; - unsigned cxn; - - if (!list_empty(&ctx->id_link)) { - list_move_tail(&ctx->id_link, &cxn_owners_lru); - } - else { - /* find the first unallocated context number - * - 0 is reserved for the kernel - */ - cxn = find_next_zero_bit(cxn_bitmap, NR_CXN, 1); - if (cxn < NR_CXN) { - set_bit(cxn, cxn_bitmap); - } - else { - /* none remaining - need to steal someone else's cxn */ - p = NULL; - list_for_each(_p, &cxn_owners_lru) { - p = list_entry(_p, mm_context_t, id_link); - if (!p->id_busy && p->id != cxn_pinned) - break; - } - - BUG_ON(_p == &cxn_owners_lru); - - cxn = p->id; - p->id = 0; - list_del_init(&p->id_link); - __flush_tlb_mm(cxn); - } - - ctx->id = cxn; - list_add_tail(&ctx->id_link, &cxn_owners_lru); - } - - return ctx->id; -} /* end get_cxn() */ - -/*****************************************************************************/ -/* - * restore the current TLB miss handler mapped page tables into the MMU context and set up a - * mapping for the page directory - */ -void change_mm_context(mm_context_t *old, mm_context_t *ctx, pgd_t *pgd) -{ - unsigned long _pgd; - - _pgd = virt_to_phys(pgd); - - /* save the state of the outgoing MMU context */ - old->id_busy = 0; - - asm volatile("movsg scr0,%0" : "=r"(old->itlb_cached_pge)); - asm volatile("movsg dampr4,%0" : "=r"(old->itlb_ptd_mapping)); - asm volatile("movsg scr1,%0" : "=r"(old->dtlb_cached_pge)); - asm volatile("movsg dampr5,%0" : "=r"(old->dtlb_ptd_mapping)); - - /* select an MMU context number */ - spin_lock(&cxn_owners_lock); - get_cxn(ctx); - ctx->id_busy = 1; - spin_unlock(&cxn_owners_lock); - - asm volatile("movgs %0,cxnr" : : "r"(ctx->id)); - - /* restore the state of the incoming MMU context */ - asm volatile("movgs %0,scr0" : : "r"(ctx->itlb_cached_pge)); - asm volatile("movgs %0,dampr4" : : "r"(ctx->itlb_ptd_mapping)); - asm volatile("movgs %0,scr1" : : "r"(ctx->dtlb_cached_pge)); - asm volatile("movgs %0,dampr5" : : "r"(ctx->dtlb_ptd_mapping)); - - /* map the PGD into uncached virtual memory */ - asm volatile("movgs %0,ttbr" : : "r"(_pgd)); - asm volatile("movgs %0,dampr3" - :: "r"(_pgd | xAMPRx_L | xAMPRx_M | xAMPRx_SS_16Kb | - xAMPRx_S | xAMPRx_C | xAMPRx_V)); - -} /* end change_mm_context() */ - -/*****************************************************************************/ -/* - * finished with an MMU context number - */ -void destroy_context(struct mm_struct *mm) -{ - mm_context_t *ctx = &mm->context; - - spin_lock(&cxn_owners_lock); - - if (!list_empty(&ctx->id_link)) { - if (ctx->id == cxn_pinned) - cxn_pinned = -1; - - list_del_init(&ctx->id_link); - clear_bit(ctx->id, cxn_bitmap); - __flush_tlb_mm(ctx->id); - ctx->id = 0; - } - - spin_unlock(&cxn_owners_lock); -} /* end destroy_context() */ - -/*****************************************************************************/ -/* - * display the MMU context currently a process is currently using - */ -#ifdef CONFIG_PROC_FS -char *proc_pid_status_frv_cxnr(struct mm_struct *mm, char *buffer) -{ - spin_lock(&cxn_owners_lock); - buffer += sprintf(buffer, "CXNR: %u\n", mm->context.id); - spin_unlock(&cxn_owners_lock); - - return buffer; -} /* end proc_pid_status_frv_cxnr() */ -#endif - -/*****************************************************************************/ -/* - * (un)pin a process's mm_struct's MMU context ID - */ -int cxn_pin_by_pid(pid_t pid) -{ - struct task_struct *tsk; - struct mm_struct *mm = NULL; - int ret; - - /* unpin if pid is zero */ - if (pid == 0) { - cxn_pinned = -1; - return 0; - } - - ret = -ESRCH; - - /* get a handle on the mm_struct */ - read_lock(&tasklist_lock); - tsk = find_task_by_vpid(pid); - if (tsk) { - ret = -EINVAL; - - task_lock(tsk); - if (tsk->mm) { - mm = tsk->mm; - mmget(mm); - ret = 0; - } - task_unlock(tsk); - } - read_unlock(&tasklist_lock); - - if (ret < 0) - return ret; - - /* make sure it has a CXN and pin it */ - spin_lock(&cxn_owners_lock); - cxn_pinned = get_cxn(&mm->context); - spin_unlock(&cxn_owners_lock); - - mmput(mm); - return 0; -} /* end cxn_pin_by_pid() */ diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c deleted file mode 100644 index c9ed14f6c67d..000000000000 --- a/arch/frv/mm/pgalloc.c +++ /dev/null @@ -1,157 +0,0 @@ -/* pgalloc.c: page directory & page table allocation - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE))); - -pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) -{ - pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); - return pte; -} - -pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) -{ - struct page *page; - -#ifdef CONFIG_HIGHPTE - page = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM, 0); -#else - page = alloc_pages(GFP_KERNEL, 0); -#endif - if (!page) - return NULL; - - clear_highpage(page); - if (!pgtable_page_ctor(page)) { - __free_page(page); - return NULL; - } - flush_dcache_page(page); - return page; -} - -void __set_pmd(pmd_t *pmdptr, unsigned long pmd) -{ - unsigned long *__ste_p = pmdptr->ste; - int loop; - - if (!pmd) { - memset(__ste_p, 0, PME_SIZE); - } - else { - BUG_ON(pmd & (0x3f00 | xAMPRx_SS | 0xe)); - - for (loop = PME_SIZE; loop > 0; loop -= 4) { - *__ste_p++ = pmd; - pmd += __frv_PT_SIZE; - } - } - - frv_dcache_writeback((unsigned long) pmdptr, (unsigned long) (pmdptr + 1)); -} - -/* - * List of all pgd's needed for non-PAE so it can invalidate entries - * in both cached and uncached pgd's; not needed for PAE since the - * kernel pmd is shared. If PAE were not to share the pmd a similar - * tactic would be needed. This is essentially codepath-based locking - * against pageattr.c; it is the unique case in which a valid change - * of kernel pagetables can't be lazily synchronized by vmalloc faults. - * vmalloc faults work because attached pagetables are never freed. - * If the locking proves to be non-performant, a ticketing scheme with - * checks at dup_mmap(), exec(), and other mmlist addition points - * could be used. The locking scheme was chosen on the basis of - * manfred's recommendations and having no core impact whatsoever. - * -- nyc - */ -DEFINE_SPINLOCK(pgd_lock); -struct page *pgd_list; - -static inline void pgd_list_add(pgd_t *pgd) -{ - struct page *page = virt_to_page(pgd); - page->index = (unsigned long) pgd_list; - if (pgd_list) - set_page_private(pgd_list, (unsigned long) &page->index); - pgd_list = page; - set_page_private(page, (unsigned long)&pgd_list); -} - -static inline void pgd_list_del(pgd_t *pgd) -{ - struct page *next, **pprev, *page = virt_to_page(pgd); - next = (struct page *) page->index; - pprev = (struct page **) page_private(page); - *pprev = next; - if (next) - set_page_private(next, (unsigned long) pprev); -} - -void pgd_ctor(void *pgd) -{ - unsigned long flags; - - if (PTRS_PER_PMD == 1) - spin_lock_irqsave(&pgd_lock, flags); - - memcpy((pgd_t *) pgd + USER_PGDS_IN_LAST_PML4, - swapper_pg_dir + USER_PGDS_IN_LAST_PML4, - (PTRS_PER_PGD - USER_PGDS_IN_LAST_PML4) * sizeof(pgd_t)); - - if (PTRS_PER_PMD > 1) - return; - - pgd_list_add(pgd); - spin_unlock_irqrestore(&pgd_lock, flags); - memset(pgd, 0, USER_PGDS_IN_LAST_PML4 * sizeof(pgd_t)); -} - -/* never called when PTRS_PER_PMD > 1 */ -void pgd_dtor(void *pgd) -{ - unsigned long flags; /* can be called from interrupt context */ - - spin_lock_irqsave(&pgd_lock, flags); - pgd_list_del(pgd); - spin_unlock_irqrestore(&pgd_lock, flags); -} - -pgd_t *pgd_alloc(struct mm_struct *mm) -{ - return quicklist_alloc(0, GFP_KERNEL, pgd_ctor); -} - -void pgd_free(struct mm_struct *mm, pgd_t *pgd) -{ - /* in the non-PAE case, clear_page_tables() clears user pgd entries */ - quicklist_free(0, pgd_dtor, pgd); -} - -void __init pgtable_cache_init(void) -{ -} - -void check_pgt_cache(void) -{ - quicklist_trim(0, pgd_dtor, 25, 16); -} - diff --git a/arch/frv/mm/tlb-flush.S b/arch/frv/mm/tlb-flush.S deleted file mode 100644 index 79b3c70910ac..000000000000 --- a/arch/frv/mm/tlb-flush.S +++ /dev/null @@ -1,184 +0,0 @@ -/* tlb-flush.S: TLB flushing routines - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include - -.macro DEBUG ch -# sethi.p %hi(0xfeff9c00),gr4 -# setlo %lo(0xfeff9c00),gr4 -# setlos #\ch,gr5 -# stbi gr5,@(gr4,#0) -# membar -.endm - - .section .rodata - - # sizes corresponding to TPXR.LMAX - .balign 1 -__tlb_lmax_sizes: - .byte 0, 64, 0, 0 - .byte 0, 0, 0, 0 - .byte 0, 0, 0, 0 - .byte 0, 0, 0, 0 - - .section .text - .balign 4 - -############################################################################### -# -# flush everything -# - void __flush_tlb_all(void) -# -############################################################################### - .globl __flush_tlb_all - .type __flush_tlb_all,@function -__flush_tlb_all: - DEBUG 'A' - - # kill cached PGE value - setlos #0xffffffff,gr4 - movgs gr4,scr0 - movgs gr4,scr1 - - # kill AMPR-cached TLB values - movgs gr0,iamlr1 - movgs gr0,iampr1 - movgs gr0,damlr1 - movgs gr0,dampr1 - - # find out how many lines there are - movsg tpxr,gr5 - sethi.p %hi(__tlb_lmax_sizes),gr4 - srli gr5,#TPXR_LMAX_SHIFT,gr5 - setlo.p %lo(__tlb_lmax_sizes),gr4 - andi gr5,#TPXR_LMAX_SMASK,gr5 - ldub @(gr4,gr5),gr4 - - # now, we assume that the TLB line step is page size in size - setlos.p #PAGE_SIZE,gr5 - setlos #0,gr6 -1: - tlbpr gr6,gr0,#6,#0 - subicc.p gr4,#1,gr4,icc0 - add gr6,gr5,gr6 - bne icc0,#2,1b - - DEBUG 'B' - bralr - - .size __flush_tlb_all, .-__flush_tlb_all - -############################################################################### -# -# flush everything to do with one context -# - void __flush_tlb_mm(unsigned long contextid [GR8]) -# -############################################################################### - .globl __flush_tlb_mm - .type __flush_tlb_mm,@function -__flush_tlb_mm: - DEBUG 'M' - - # kill cached PGE value - setlos #0xffffffff,gr4 - movgs gr4,scr0 - movgs gr4,scr1 - - # specify the context we want to flush - movgs gr8,tplr - - # find out how many lines there are - movsg tpxr,gr5 - sethi.p %hi(__tlb_lmax_sizes),gr4 - srli gr5,#TPXR_LMAX_SHIFT,gr5 - setlo.p %lo(__tlb_lmax_sizes),gr4 - andi gr5,#TPXR_LMAX_SMASK,gr5 - ldub @(gr4,gr5),gr4 - - # now, we assume that the TLB line step is page size in size - setlos.p #PAGE_SIZE,gr5 - setlos #0,gr6 -0: - tlbpr gr6,gr0,#5,#0 - subicc.p gr4,#1,gr4,icc0 - add gr6,gr5,gr6 - bne icc0,#2,0b - - DEBUG 'N' - bralr - - .size __flush_tlb_mm, .-__flush_tlb_mm - -############################################################################### -# -# flush a range of addresses from the TLB -# - void __flush_tlb_page(unsigned long contextid [GR8], -# unsigned long start [GR9]) -# -############################################################################### - .globl __flush_tlb_page - .type __flush_tlb_page,@function -__flush_tlb_page: - # kill cached PGE value - setlos #0xffffffff,gr4 - movgs gr4,scr0 - movgs gr4,scr1 - - # specify the context we want to flush - movgs gr8,tplr - - # zap the matching TLB line and AMR values - setlos #~(PAGE_SIZE-1),gr5 - and gr9,gr5,gr9 - tlbpr gr9,gr0,#5,#0 - - bralr - - .size __flush_tlb_page, .-__flush_tlb_page - -############################################################################### -# -# flush a range of addresses from the TLB -# - void __flush_tlb_range(unsigned long contextid [GR8], -# unsigned long start [GR9], -# unsigned long end [GR10]) -# -############################################################################### - .globl __flush_tlb_range - .type __flush_tlb_range,@function -__flush_tlb_range: - # kill cached PGE value - setlos #0xffffffff,gr4 - movgs gr4,scr0 - movgs gr4,scr1 - - # specify the context we want to flush - movgs gr8,tplr - - # round the start down to beginning of TLB line and end up to beginning of next TLB line - setlos.p #~(PAGE_SIZE-1),gr5 - setlos #PAGE_SIZE,gr6 - subi.p gr10,#1,gr10 - and gr9,gr5,gr9 - and gr10,gr5,gr10 -2: - tlbpr gr9,gr0,#5,#0 - subcc.p gr9,gr10,gr0,icc0 - add gr9,gr6,gr9 - bne icc0,#0,2b ; most likely a 1-page flush - - bralr - - .size __flush_tlb_range, .-__flush_tlb_range diff --git a/arch/frv/mm/tlb-miss.S b/arch/frv/mm/tlb-miss.S deleted file mode 100644 index f3ac019bb18b..000000000000 --- a/arch/frv/mm/tlb-miss.S +++ /dev/null @@ -1,629 +0,0 @@ -/* tlb-miss.S: TLB miss handlers - * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include - - .section .text..tlbmiss - .balign 4 - - .globl __entry_insn_mmu_miss -__entry_insn_mmu_miss: - break - nop - - .globl __entry_insn_mmu_exception -__entry_insn_mmu_exception: - break - nop - - .globl __entry_data_mmu_miss -__entry_data_mmu_miss: - break - nop - - .globl __entry_data_mmu_exception -__entry_data_mmu_exception: - break - nop - -############################################################################### -# -# handle a lookup failure of one sort or another in a kernel TLB handler -# On entry: -# GR29 - faulting address -# SCR2 - saved CCR -# -############################################################################### - .type __tlb_kernel_fault,@function -__tlb_kernel_fault: - # see if we're supposed to re-enable single-step mode upon return - sethi.p %hi(__break_tlb_miss_return_break),gr30 - setlo %lo(__break_tlb_miss_return_break),gr30 - movsg pcsr,gr31 - - subcc gr31,gr30,gr0,icc0 - beq icc0,#0,__tlb_kernel_fault_sstep - - movsg scr2,gr30 - movgs gr30,ccr - movgs gr29,scr2 /* save EAR0 value */ - sethi.p %hi(__kernel_current_task),gr29 - setlo %lo(__kernel_current_task),gr29 - ldi.p @(gr29,#0),gr29 /* restore GR29 */ - - bra __entry_kernel_handle_mmu_fault - - # we've got to re-enable single-stepping -__tlb_kernel_fault_sstep: - sethi.p %hi(__break_tlb_miss_real_return_info),gr30 - setlo %lo(__break_tlb_miss_real_return_info),gr30 - lddi @(gr30,0),gr30 - movgs gr30,pcsr - movgs gr31,psr - - movsg scr2,gr30 - movgs gr30,ccr - movgs gr29,scr2 /* save EAR0 value */ - sethi.p %hi(__kernel_current_task),gr29 - setlo %lo(__kernel_current_task),gr29 - ldi.p @(gr29,#0),gr29 /* restore GR29 */ - bra __entry_kernel_handle_mmu_fault_sstep - - .size __tlb_kernel_fault, .-__tlb_kernel_fault - -############################################################################### -# -# handle a lookup failure of one sort or another in a user TLB handler -# On entry: -# GR28 - faulting address -# SCR2 - saved CCR -# -############################################################################### - .type __tlb_user_fault,@function -__tlb_user_fault: - # see if we're supposed to re-enable single-step mode upon return - sethi.p %hi(__break_tlb_miss_return_break),gr30 - setlo %lo(__break_tlb_miss_return_break),gr30 - movsg pcsr,gr31 - subcc gr31,gr30,gr0,icc0 - beq icc0,#0,__tlb_user_fault_sstep - - movsg scr2,gr30 - movgs gr30,ccr - bra __entry_uspace_handle_mmu_fault - - # we've got to re-enable single-stepping -__tlb_user_fault_sstep: - sethi.p %hi(__break_tlb_miss_real_return_info),gr30 - setlo %lo(__break_tlb_miss_real_return_info),gr30 - lddi @(gr30,0),gr30 - movgs gr30,pcsr - movgs gr31,psr - movsg scr2,gr30 - movgs gr30,ccr - bra __entry_uspace_handle_mmu_fault_sstep - - .size __tlb_user_fault, .-__tlb_user_fault - -############################################################################### -# -# Kernel instruction TLB miss handler -# On entry: -# GR1 - kernel stack pointer -# GR28 - saved exception frame pointer -# GR29 - faulting address -# GR31 - EAR0 ^ SCR0 -# SCR0 - base of virtual range covered by cached PGE from last ITLB miss (or 0xffffffff) -# DAMR3 - mapped page directory -# DAMR4 - mapped page table as matched by SCR0 -# -############################################################################### - .globl __entry_kernel_insn_tlb_miss - .type __entry_kernel_insn_tlb_miss,@function -__entry_kernel_insn_tlb_miss: -#if 0 - sethi.p %hi(0xe1200004),gr30 - setlo %lo(0xe1200004),gr30 - st gr0,@(gr30,gr0) - sethi.p %hi(0xffc00100),gr30 - setlo %lo(0xffc00100),gr30 - sth gr30,@(gr30,gr0) - membar -#endif - - movsg ccr,gr30 /* save CCR */ - movgs gr30,scr2 - - # see if the cached page table mapping is appropriate - srlicc.p gr31,#26,gr0,icc0 - setlos 0x3ffc,gr30 - srli.p gr29,#12,gr31 /* use EAR0[25:14] as PTE index */ - bne icc0,#0,__itlb_k_PTD_miss - -__itlb_k_PTD_mapped: - # access the PTD with EAR0[25:14] - # - DAMLR4 points to the virtual address of the appropriate page table - # - the PTD holds 4096 PTEs - # - the PTD must be accessed uncached - # - the PTE must be marked accessed if it was valid - # - and gr31,gr30,gr31 - movsg damlr4,gr30 - add gr30,gr31,gr31 - ldi @(gr31,#0),gr30 /* fetch the PTE */ - andicc gr30,#_PAGE_PRESENT,gr0,icc0 - ori.p gr30,#_PAGE_ACCESSED,gr30 - beq icc0,#0,__tlb_kernel_fault /* jump if PTE invalid */ - sti.p gr30,@(gr31,#0) /* update the PTE */ - andi gr30,#~_PAGE_ACCESSED,gr30 - - # we're using IAMR1 as an extra TLB entry - # - punt the entry here (if valid) to the real TLB and then replace with the new PTE - # - need to check DAMR1 lest we cause an multiple-DAT-hit exception - # - IAMPR1 has no WP bit, and we mustn't lose WP information - movsg iampr1,gr31 - andicc gr31,#xAMPRx_V,gr0,icc0 - setlos.p 0xfffff000,gr31 - beq icc0,#0,__itlb_k_nopunt /* punt not required */ - - movsg iamlr1,gr31 - movgs gr31,tplr /* set TPLR.CXN */ - tlbpr gr31,gr0,#4,#0 /* delete matches from TLB, IAMR1, DAMR1 */ - - movsg dampr1,gr31 - ori gr31,#xAMPRx_V,gr31 /* entry was invalidated by tlbpr #4 */ - movgs gr31,tppr - movsg iamlr1,gr31 /* set TPLR.CXN */ - movgs gr31,tplr - tlbpr gr31,gr0,#2,#0 /* save to the TLB */ - movsg tpxr,gr31 /* check the TLB write error flag */ - andicc.p gr31,#TPXR_E,gr0,icc0 - setlos #0xfffff000,gr31 - bne icc0,#0,__tlb_kernel_fault - -__itlb_k_nopunt: - - # assemble the new TLB entry - and gr29,gr31,gr29 - movsg cxnr,gr31 - or gr29,gr31,gr29 - movgs gr29,iamlr1 /* xAMLR = address | context number */ - movgs gr30,iampr1 - movgs gr29,damlr1 - movgs gr30,dampr1 - - # return, restoring registers - movsg scr2,gr30 - movgs gr30,ccr - sethi.p %hi(__kernel_current_task),gr29 - setlo %lo(__kernel_current_task),gr29 - ldi @(gr29,#0),gr29 - rett #0 - beq icc0,#3,0 /* prevent icache prefetch */ - - # the PTE we want wasn't in the PTD we have mapped, so we need to go looking for a more - # appropriate page table and map that instead - # - access the PGD with EAR0[31:26] - # - DAMLR3 points to the virtual address of the page directory - # - the PGD holds 64 PGEs and each PGE/PME points to a set of page tables -__itlb_k_PTD_miss: - srli gr29,#26,gr31 /* calculate PGE offset */ - slli gr31,#8,gr31 /* and clear bottom bits */ - - movsg damlr3,gr30 - ld @(gr31,gr30),gr30 /* access the PGE */ - - andicc.p gr30,#_PAGE_PRESENT,gr0,icc0 - andicc gr30,#xAMPRx_SS,gr0,icc1 - - # map this PTD instead and record coverage address - ori.p gr30,#xAMPRx_L|xAMPRx_SS_16Kb|xAMPRx_S|xAMPRx_C|xAMPRx_V,gr30 - beq icc0,#0,__tlb_kernel_fault /* jump if PGE not present */ - slli.p gr31,#18,gr31 - bne icc1,#0,__itlb_k_bigpage - movgs gr30,dampr4 - movgs gr31,scr0 - - # we can now resume normal service - setlos 0x3ffc,gr30 - srli.p gr29,#12,gr31 /* use EAR0[25:14] as PTE index */ - bra __itlb_k_PTD_mapped - -__itlb_k_bigpage: - break - nop - - .size __entry_kernel_insn_tlb_miss, .-__entry_kernel_insn_tlb_miss - -############################################################################### -# -# Kernel data TLB miss handler -# On entry: -# GR1 - kernel stack pointer -# GR28 - saved exception frame pointer -# GR29 - faulting address -# GR31 - EAR0 ^ SCR1 -# SCR1 - base of virtual range covered by cached PGE from last DTLB miss (or 0xffffffff) -# DAMR3 - mapped page directory -# DAMR5 - mapped page table as matched by SCR1 -# -############################################################################### - .globl __entry_kernel_data_tlb_miss - .type __entry_kernel_data_tlb_miss,@function -__entry_kernel_data_tlb_miss: -#if 0 - sethi.p %hi(0xe1200004),gr30 - setlo %lo(0xe1200004),gr30 - st gr0,@(gr30,gr0) - sethi.p %hi(0xffc00100),gr30 - setlo %lo(0xffc00100),gr30 - sth gr30,@(gr30,gr0) - membar -#endif - - movsg ccr,gr30 /* save CCR */ - movgs gr30,scr2 - - # see if the cached page table mapping is appropriate - srlicc.p gr31,#26,gr0,icc0 - setlos 0x3ffc,gr30 - srli.p gr29,#12,gr31 /* use EAR0[25:14] as PTE index */ - bne icc0,#0,__dtlb_k_PTD_miss - -__dtlb_k_PTD_mapped: - # access the PTD with EAR0[25:14] - # - DAMLR5 points to the virtual address of the appropriate page table - # - the PTD holds 4096 PTEs - # - the PTD must be accessed uncached - # - the PTE must be marked accessed if it was valid - # - and gr31,gr30,gr31 - movsg damlr5,gr30 - add gr30,gr31,gr31 - ldi @(gr31,#0),gr30 /* fetch the PTE */ - andicc gr30,#_PAGE_PRESENT,gr0,icc0 - ori.p gr30,#_PAGE_ACCESSED,gr30 - beq icc0,#0,__tlb_kernel_fault /* jump if PTE invalid */ - sti.p gr30,@(gr31,#0) /* update the PTE */ - andi gr30,#~_PAGE_ACCESSED,gr30 - - # we're using DAMR1 as an extra TLB entry - # - punt the entry here (if valid) to the real TLB and then replace with the new PTE - # - need to check IAMR1 lest we cause an multiple-DAT-hit exception - movsg dampr1,gr31 - andicc gr31,#xAMPRx_V,gr0,icc0 - setlos.p 0xfffff000,gr31 - beq icc0,#0,__dtlb_k_nopunt /* punt not required */ - - movsg damlr1,gr31 - movgs gr31,tplr /* set TPLR.CXN */ - tlbpr gr31,gr0,#4,#0 /* delete matches from TLB, IAMR1, DAMR1 */ - - movsg dampr1,gr31 - ori gr31,#xAMPRx_V,gr31 /* entry was invalidated by tlbpr #4 */ - movgs gr31,tppr - movsg damlr1,gr31 /* set TPLR.CXN */ - movgs gr31,tplr - tlbpr gr31,gr0,#2,#0 /* save to the TLB */ - movsg tpxr,gr31 /* check the TLB write error flag */ - andicc.p gr31,#TPXR_E,gr0,icc0 - setlos #0xfffff000,gr31 - bne icc0,#0,__tlb_kernel_fault - -__dtlb_k_nopunt: - - # assemble the new TLB entry - and gr29,gr31,gr29 - movsg cxnr,gr31 - or gr29,gr31,gr29 - movgs gr29,iamlr1 /* xAMLR = address | context number */ - movgs gr30,iampr1 - movgs gr29,damlr1 - movgs gr30,dampr1 - - # return, restoring registers - movsg scr2,gr30 - movgs gr30,ccr - sethi.p %hi(__kernel_current_task),gr29 - setlo %lo(__kernel_current_task),gr29 - ldi @(gr29,#0),gr29 - rett #0 - beq icc0,#3,0 /* prevent icache prefetch */ - - # the PTE we want wasn't in the PTD we have mapped, so we need to go looking for a more - # appropriate page table and map that instead - # - access the PGD with EAR0[31:26] - # - DAMLR3 points to the virtual address of the page directory - # - the PGD holds 64 PGEs and each PGE/PME points to a set of page tables -__dtlb_k_PTD_miss: - srli gr29,#26,gr31 /* calculate PGE offset */ - slli gr31,#8,gr31 /* and clear bottom bits */ - - movsg damlr3,gr30 - ld @(gr31,gr30),gr30 /* access the PGE */ - - andicc.p gr30,#_PAGE_PRESENT,gr0,icc0 - andicc gr30,#xAMPRx_SS,gr0,icc1 - - # map this PTD instead and record coverage address - ori.p gr30,#xAMPRx_L|xAMPRx_SS_16Kb|xAMPRx_S|xAMPRx_C|xAMPRx_V,gr30 - beq icc0,#0,__tlb_kernel_fault /* jump if PGE not present */ - slli.p gr31,#18,gr31 - bne icc1,#0,__dtlb_k_bigpage - movgs gr30,dampr5 - movgs gr31,scr1 - - # we can now resume normal service - setlos 0x3ffc,gr30 - srli.p gr29,#12,gr31 /* use EAR0[25:14] as PTE index */ - bra __dtlb_k_PTD_mapped - -__dtlb_k_bigpage: - break - nop - - .size __entry_kernel_data_tlb_miss, .-__entry_kernel_data_tlb_miss - -############################################################################### -# -# Userspace instruction TLB miss handler (with PGE prediction) -# On entry: -# GR28 - faulting address -# GR31 - EAR0 ^ SCR0 -# SCR0 - base of virtual range covered by cached PGE from last ITLB miss (or 0xffffffff) -# DAMR3 - mapped page directory -# DAMR4 - mapped page table as matched by SCR0 -# -############################################################################### - .globl __entry_user_insn_tlb_miss - .type __entry_user_insn_tlb_miss,@function -__entry_user_insn_tlb_miss: -#if 0 - sethi.p %hi(0xe1200004),gr30 - setlo %lo(0xe1200004),gr30 - st gr0,@(gr30,gr0) - sethi.p %hi(0xffc00100),gr30 - setlo %lo(0xffc00100),gr30 - sth gr30,@(gr30,gr0) - membar -#endif - - movsg ccr,gr30 /* save CCR */ - movgs gr30,scr2 - - # see if the cached page table mapping is appropriate - srlicc.p gr31,#26,gr0,icc0 - setlos 0x3ffc,gr30 - srli.p gr28,#12,gr31 /* use EAR0[25:14] as PTE index */ - bne icc0,#0,__itlb_u_PTD_miss - -__itlb_u_PTD_mapped: - # access the PTD with EAR0[25:14] - # - DAMLR4 points to the virtual address of the appropriate page table - # - the PTD holds 4096 PTEs - # - the PTD must be accessed uncached - # - the PTE must be marked accessed if it was valid - # - and gr31,gr30,gr31 - movsg damlr4,gr30 - add gr30,gr31,gr31 - ldi @(gr31,#0),gr30 /* fetch the PTE */ - andicc gr30,#_PAGE_PRESENT,gr0,icc0 - ori.p gr30,#_PAGE_ACCESSED,gr30 - beq icc0,#0,__tlb_user_fault /* jump if PTE invalid */ - sti.p gr30,@(gr31,#0) /* update the PTE */ - andi gr30,#~_PAGE_ACCESSED,gr30 - - # we're using IAMR1/DAMR1 as an extra TLB entry - # - punt the entry here (if valid) to the real TLB and then replace with the new PTE - movsg dampr1,gr31 - andicc gr31,#xAMPRx_V,gr0,icc0 - setlos.p 0xfffff000,gr31 - beq icc0,#0,__itlb_u_nopunt /* punt not required */ - - movsg dampr1,gr31 - movgs gr31,tppr - movsg damlr1,gr31 /* set TPLR.CXN */ - movgs gr31,tplr - tlbpr gr31,gr0,#2,#0 /* save to the TLB */ - movsg tpxr,gr31 /* check the TLB write error flag */ - andicc.p gr31,#TPXR_E,gr0,icc0 - setlos #0xfffff000,gr31 - bne icc0,#0,__tlb_user_fault - -__itlb_u_nopunt: - - # assemble the new TLB entry - and gr28,gr31,gr28 - movsg cxnr,gr31 - or gr28,gr31,gr28 - movgs gr28,iamlr1 /* xAMLR = address | context number */ - movgs gr30,iampr1 - movgs gr28,damlr1 - movgs gr30,dampr1 - - # return, restoring registers - movsg scr2,gr30 - movgs gr30,ccr - rett #0 - beq icc0,#3,0 /* prevent icache prefetch */ - - # the PTE we want wasn't in the PTD we have mapped, so we need to go looking for a more - # appropriate page table and map that instead - # - access the PGD with EAR0[31:26] - # - DAMLR3 points to the virtual address of the page directory - # - the PGD holds 64 PGEs and each PGE/PME points to a set of page tables -__itlb_u_PTD_miss: - srli gr28,#26,gr31 /* calculate PGE offset */ - slli gr31,#8,gr31 /* and clear bottom bits */ - - movsg damlr3,gr30 - ld @(gr31,gr30),gr30 /* access the PGE */ - - andicc.p gr30,#_PAGE_PRESENT,gr0,icc0 - andicc gr30,#xAMPRx_SS,gr0,icc1 - - # map this PTD instead and record coverage address - ori.p gr30,#xAMPRx_L|xAMPRx_SS_16Kb|xAMPRx_S|xAMPRx_C|xAMPRx_V,gr30 - beq icc0,#0,__tlb_user_fault /* jump if PGE not present */ - slli.p gr31,#18,gr31 - bne icc1,#0,__itlb_u_bigpage - movgs gr30,dampr4 - movgs gr31,scr0 - - # we can now resume normal service - setlos 0x3ffc,gr30 - srli.p gr28,#12,gr31 /* use EAR0[25:14] as PTE index */ - bra __itlb_u_PTD_mapped - -__itlb_u_bigpage: - break - nop - - .size __entry_user_insn_tlb_miss, .-__entry_user_insn_tlb_miss - -############################################################################### -# -# Userspace data TLB miss handler -# On entry: -# GR28 - faulting address -# GR31 - EAR0 ^ SCR1 -# SCR1 - base of virtual range covered by cached PGE from last DTLB miss (or 0xffffffff) -# DAMR3 - mapped page directory -# DAMR5 - mapped page table as matched by SCR1 -# -############################################################################### - .globl __entry_user_data_tlb_miss - .type __entry_user_data_tlb_miss,@function -__entry_user_data_tlb_miss: -#if 0 - sethi.p %hi(0xe1200004),gr30 - setlo %lo(0xe1200004),gr30 - st gr0,@(gr30,gr0) - sethi.p %hi(0xffc00100),gr30 - setlo %lo(0xffc00100),gr30 - sth gr30,@(gr30,gr0) - membar -#endif - - movsg ccr,gr30 /* save CCR */ - movgs gr30,scr2 - - # see if the cached page table mapping is appropriate - srlicc.p gr31,#26,gr0,icc0 - setlos 0x3ffc,gr30 - srli.p gr28,#12,gr31 /* use EAR0[25:14] as PTE index */ - bne icc0,#0,__dtlb_u_PTD_miss - -__dtlb_u_PTD_mapped: - # access the PTD with EAR0[25:14] - # - DAMLR5 points to the virtual address of the appropriate page table - # - the PTD holds 4096 PTEs - # - the PTD must be accessed uncached - # - the PTE must be marked accessed if it was valid - # - and gr31,gr30,gr31 - movsg damlr5,gr30 - -__dtlb_u_using_iPTD: - add gr30,gr31,gr31 - ldi @(gr31,#0),gr30 /* fetch the PTE */ - andicc gr30,#_PAGE_PRESENT,gr0,icc0 - ori.p gr30,#_PAGE_ACCESSED,gr30 - beq icc0,#0,__tlb_user_fault /* jump if PTE invalid */ - sti.p gr30,@(gr31,#0) /* update the PTE */ - andi gr30,#~_PAGE_ACCESSED,gr30 - - # we're using DAMR1 as an extra TLB entry - # - punt the entry here (if valid) to the real TLB and then replace with the new PTE - movsg dampr1,gr31 - andicc gr31,#xAMPRx_V,gr0,icc0 - setlos.p 0xfffff000,gr31 - beq icc0,#0,__dtlb_u_nopunt /* punt not required */ - - movsg dampr1,gr31 - movgs gr31,tppr - movsg damlr1,gr31 /* set TPLR.CXN */ - movgs gr31,tplr - tlbpr gr31,gr0,#2,#0 /* save to the TLB */ - movsg tpxr,gr31 /* check the TLB write error flag */ - andicc.p gr31,#TPXR_E,gr0,icc0 - setlos #0xfffff000,gr31 - bne icc0,#0,__tlb_user_fault - -__dtlb_u_nopunt: - - # assemble the new TLB entry - and gr28,gr31,gr28 - movsg cxnr,gr31 - or gr28,gr31,gr28 - movgs gr28,iamlr1 /* xAMLR = address | context number */ - movgs gr30,iampr1 - movgs gr28,damlr1 - movgs gr30,dampr1 - - # return, restoring registers - movsg scr2,gr30 - movgs gr30,ccr - rett #0 - beq icc0,#3,0 /* prevent icache prefetch */ - - # the PTE we want wasn't in the PTD we have mapped, so we need to go looking for a more - # appropriate page table and map that instead - # - first of all, check the insn PGE cache - we may well get a hit there - # - access the PGD with EAR0[31:26] - # - DAMLR3 points to the virtual address of the page directory - # - the PGD holds 64 PGEs and each PGE/PME points to a set of page tables -__dtlb_u_PTD_miss: - movsg scr0,gr31 /* consult the insn-PGE-cache key */ - xor gr28,gr31,gr31 - srlicc gr31,#26,gr0,icc0 - srli gr28,#12,gr31 /* use EAR0[25:14] as PTE index */ - bne icc0,#0,__dtlb_u_iPGE_miss - - # what we're looking for is covered by the insn-PGE-cache - setlos 0x3ffc,gr30 - and gr31,gr30,gr31 - movsg damlr4,gr30 - bra __dtlb_u_using_iPTD - -__dtlb_u_iPGE_miss: - srli gr28,#26,gr31 /* calculate PGE offset */ - slli gr31,#8,gr31 /* and clear bottom bits */ - - movsg damlr3,gr30 - ld @(gr31,gr30),gr30 /* access the PGE */ - - andicc.p gr30,#_PAGE_PRESENT,gr0,icc0 - andicc gr30,#xAMPRx_SS,gr0,icc1 - - # map this PTD instead and record coverage address - ori.p gr30,#xAMPRx_L|xAMPRx_SS_16Kb|xAMPRx_S|xAMPRx_C|xAMPRx_V,gr30 - beq icc0,#0,__tlb_user_fault /* jump if PGE not present */ - slli.p gr31,#18,gr31 - bne icc1,#0,__dtlb_u_bigpage - movgs gr30,dampr5 - movgs gr31,scr1 - - # we can now resume normal service - setlos 0x3ffc,gr30 - srli.p gr28,#12,gr31 /* use EAR0[25:14] as PTE index */ - bra __dtlb_u_PTD_mapped - -__dtlb_u_bigpage: - break - nop - - .size __entry_user_data_tlb_miss, .-__entry_user_data_tlb_miss diff --git a/tools/arch/frv/include/uapi/asm/bitsperlong.h b/tools/arch/frv/include/uapi/asm/bitsperlong.h deleted file mode 100644 index 76da34b10f59..000000000000 --- a/tools/arch/frv/include/uapi/asm/bitsperlong.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/tools/arch/frv/include/uapi/asm/mman.h b/tools/arch/frv/include/uapi/asm/mman.h deleted file mode 100644 index 5bc900b0bc78..000000000000 --- a/tools/arch/frv/include/uapi/asm/mman.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H -#define TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H -#include -/* MAP_32BIT is undefined on frv, fix it for perf */ -#define MAP_32BIT 0 -#endif -- cgit 1.4.1 From 553b085c2075f6a4a2591108554f830fa61e881f Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 7 Mar 2018 21:36:19 +0100 Subject: arch: remove m32r port The Mitsubishi/Renesas m32r architecture has been around for many years, but the Linux port has been obsolete for a very long time as well, with the last significant updates done for linux-2.6.14. While some m32r microcontrollers are still being marketed by Renesas, those are apparently no longer possible to support, mainly due to the lack of an external memory interface. Hirokazu Takata was the maintainer until the architecture got marked Orphaned in 2014. Link: http://www.linux-m32r.org/ Link: https://www.renesas.com/en-eu/products/microcontrollers-microprocessors/m32r.html Cc: Hirokazu Takata Signed-off-by: Arnd Bergmann --- MAINTAINERS | 5 - arch/m32r/Kconfig | 419 ----------- arch/m32r/Kconfig.debug | 22 - arch/m32r/Makefile | 63 -- arch/m32r/boot/Makefile | 19 - arch/m32r/boot/compressed/Makefile | 51 -- arch/m32r/boot/compressed/boot.h | 60 -- arch/m32r/boot/compressed/head.S | 177 ----- arch/m32r/boot/compressed/install.sh | 57 -- arch/m32r/boot/compressed/m32r_sio.c | 77 -- arch/m32r/boot/compressed/misc.c | 93 --- arch/m32r/boot/compressed/vmlinux.lds.S | 31 - arch/m32r/boot/compressed/vmlinux.scr | 9 - arch/m32r/boot/setup.S | 185 ----- arch/m32r/configs/m32104ut_defconfig | 144 ---- arch/m32r/configs/m32700ut.smp_defconfig | 85 --- arch/m32r/configs/m32700ut.up_defconfig | 84 --- arch/m32r/configs/mappi.nommu_defconfig | 46 -- arch/m32r/configs/mappi.smp_defconfig | 62 -- arch/m32r/configs/mappi.up_defconfig | 60 -- arch/m32r/configs/mappi2.opsp_defconfig | 65 -- arch/m32r/configs/mappi2.vdec2_defconfig | 64 -- arch/m32r/configs/mappi3.smp_defconfig | 62 -- arch/m32r/configs/oaks32r_defconfig | 43 -- arch/m32r/configs/opsput_defconfig | 63 -- arch/m32r/configs/usrv_defconfig | 78 -- arch/m32r/include/asm/Kbuild | 13 - arch/m32r/include/asm/addrspace.h | 57 -- arch/m32r/include/asm/asm-offsets.h | 1 - arch/m32r/include/asm/assembler.h | 231 ------ arch/m32r/include/asm/atomic.h | 275 ------- arch/m32r/include/asm/barrier.h | 16 - arch/m32r/include/asm/bitops.h | 274 ------- arch/m32r/include/asm/bug.h | 5 - arch/m32r/include/asm/bugs.h | 20 - arch/m32r/include/asm/cache.h | 9 - arch/m32r/include/asm/cachectl.h | 27 - arch/m32r/include/asm/cacheflush.h | 73 -- arch/m32r/include/asm/checksum.h | 202 ----- arch/m32r/include/asm/cmpxchg.h | 225 ------ arch/m32r/include/asm/dcache_clear.h | 29 - arch/m32r/include/asm/delay.h | 1 - arch/m32r/include/asm/device.h | 10 - arch/m32r/include/asm/div64.h | 1 - arch/m32r/include/asm/dma.h | 13 - arch/m32r/include/asm/elf.h | 132 ---- arch/m32r/include/asm/emergency-restart.h | 7 - arch/m32r/include/asm/fb.h | 20 - arch/m32r/include/asm/flat.h | 143 ---- arch/m32r/include/asm/ftrace.h | 1 - arch/m32r/include/asm/futex.h | 6 - arch/m32r/include/asm/hardirq.h | 10 - arch/m32r/include/asm/hw_irq.h | 4 - arch/m32r/include/asm/io.h | 225 ------ arch/m32r/include/asm/irq.h | 91 --- arch/m32r/include/asm/irq_regs.h | 1 - arch/m32r/include/asm/irqflags.h | 104 --- arch/m32r/include/asm/kdebug.h | 1 - arch/m32r/include/asm/kmap_types.h | 13 - arch/m32r/include/asm/linkage.h | 8 - arch/m32r/include/asm/local.h | 341 --------- arch/m32r/include/asm/local64.h | 1 - arch/m32r/include/asm/m32102.h | 315 -------- arch/m32r/include/asm/m32104ut/m32104ut_pld.h | 161 ---- arch/m32r/include/asm/m32700ut/m32700ut_lan.h | 103 --- arch/m32r/include/asm/m32700ut/m32700ut_lcd.h | 55 -- arch/m32r/include/asm/m32700ut/m32700ut_pld.h | 259 ------- arch/m32r/include/asm/m32r.h | 161 ---- arch/m32r/include/asm/m32r_mp_fpga.h | 314 -------- arch/m32r/include/asm/mappi2/mappi2_pld.h | 150 ---- arch/m32r/include/asm/mappi3/mappi3_pld.h | 142 ---- arch/m32r/include/asm/mc146818rtc.h | 30 - arch/m32r/include/asm/mmu.h | 22 - arch/m32r/include/asm/mmu_context.h | 167 ---- arch/m32r/include/asm/mmzone.h | 54 -- arch/m32r/include/asm/opsput/opsput_lan.h | 52 -- arch/m32r/include/asm/opsput/opsput_lcd.h | 55 -- arch/m32r/include/asm/opsput/opsput_pld.h | 255 ------- arch/m32r/include/asm/page.h | 90 --- arch/m32r/include/asm/pci.h | 7 - arch/m32r/include/asm/percpu.h | 7 - arch/m32r/include/asm/pgalloc.h | 82 -- arch/m32r/include/asm/pgtable-2level.h | 76 -- arch/m32r/include/asm/pgtable.h | 348 --------- arch/m32r/include/asm/processor.h | 127 ---- arch/m32r/include/asm/ptrace.h | 44 -- arch/m32r/include/asm/rtc.h | 66 -- arch/m32r/include/asm/s1d13806.h | 200 ----- arch/m32r/include/asm/segment.h | 11 - arch/m32r/include/asm/serial.h | 10 - arch/m32r/include/asm/setup.h | 32 - arch/m32r/include/asm/shmparam.h | 7 - arch/m32r/include/asm/signal.h | 25 - arch/m32r/include/asm/smp.h | 113 --- arch/m32r/include/asm/spinlock.h | 308 -------- arch/m32r/include/asm/spinlock_types.h | 24 - arch/m32r/include/asm/string.h | 14 - arch/m32r/include/asm/switch_to.h | 51 -- arch/m32r/include/asm/syscall.h | 9 - arch/m32r/include/asm/termios.h | 52 -- arch/m32r/include/asm/thread_info.h | 126 ---- arch/m32r/include/asm/timex.h | 28 - arch/m32r/include/asm/tlb.h | 21 - arch/m32r/include/asm/tlbflush.h | 98 --- arch/m32r/include/asm/topology.h | 7 - arch/m32r/include/asm/types.h | 13 - arch/m32r/include/asm/uaccess.h | 515 ------------- arch/m32r/include/asm/ucontext.h | 13 - arch/m32r/include/asm/unaligned.h | 19 - arch/m32r/include/asm/unistd.h | 51 -- arch/m32r/include/asm/user.h | 53 -- arch/m32r/include/asm/vga.h | 21 - arch/m32r/include/asm/xor.h | 7 - arch/m32r/include/uapi/asm/Kbuild | 7 - arch/m32r/include/uapi/asm/auxvec.h | 4 - arch/m32r/include/uapi/asm/bitsperlong.h | 2 - arch/m32r/include/uapi/asm/byteorder.h | 11 - arch/m32r/include/uapi/asm/errno.h | 7 - arch/m32r/include/uapi/asm/fcntl.h | 2 - arch/m32r/include/uapi/asm/ioctl.h | 2 - arch/m32r/include/uapi/asm/ioctls.h | 7 - arch/m32r/include/uapi/asm/ipcbuf.h | 2 - arch/m32r/include/uapi/asm/mman.h | 1 - arch/m32r/include/uapi/asm/msgbuf.h | 32 - arch/m32r/include/uapi/asm/param.h | 8 - arch/m32r/include/uapi/asm/posix_types.h | 26 - arch/m32r/include/uapi/asm/ptrace.h | 118 --- arch/m32r/include/uapi/asm/resource.h | 7 - arch/m32r/include/uapi/asm/sembuf.h | 26 - arch/m32r/include/uapi/asm/setup.h | 12 - arch/m32r/include/uapi/asm/shmbuf.h | 43 -- arch/m32r/include/uapi/asm/sigcontext.h | 40 - arch/m32r/include/uapi/asm/signal.h | 118 --- arch/m32r/include/uapi/asm/socket.h | 108 --- arch/m32r/include/uapi/asm/sockios.h | 14 - arch/m32r/include/uapi/asm/stat.h | 88 --- arch/m32r/include/uapi/asm/statfs.h | 7 - arch/m32r/include/uapi/asm/swab.h | 11 - arch/m32r/include/uapi/asm/termbits.h | 201 ----- arch/m32r/include/uapi/asm/termios.h | 44 -- arch/m32r/include/uapi/asm/types.h | 1 - arch/m32r/include/uapi/asm/unistd.h | 336 --------- arch/m32r/kernel/.gitignore | 1 - arch/m32r/kernel/Makefile | 12 - arch/m32r/kernel/align.c | 585 -------------- arch/m32r/kernel/asm-offsets.c | 15 - arch/m32r/kernel/entry.S | 553 -------------- arch/m32r/kernel/head.S | 284 ------- arch/m32r/kernel/irq.c | 44 -- arch/m32r/kernel/m32r_ksyms.c | 89 --- arch/m32r/kernel/module.c | 203 ----- arch/m32r/kernel/process.c | 154 ---- arch/m32r/kernel/ptrace.c | 708 ----------------- arch/m32r/kernel/setup.c | 424 ----------- arch/m32r/kernel/signal.c | 336 --------- arch/m32r/kernel/smp.c | 836 --------------------- arch/m32r/kernel/smpboot.c | 627 ---------------- arch/m32r/kernel/sys_m32r.c | 91 --- arch/m32r/kernel/syscall_table.S | 328 -------- arch/m32r/kernel/time.c | 199 ----- arch/m32r/kernel/traps.c | 324 -------- arch/m32r/kernel/vmlinux.lds.S | 79 -- arch/m32r/lib/Makefile | 7 - arch/m32r/lib/ashxdi3.S | 294 -------- arch/m32r/lib/checksum.S | 320 -------- arch/m32r/lib/csum_partial_copy.c | 59 -- arch/m32r/lib/delay.c | 130 ---- arch/m32r/lib/libgcc.h | 24 - arch/m32r/lib/memcpy.S | 93 --- arch/m32r/lib/memset.S | 179 ----- arch/m32r/lib/strlen.S | 118 --- arch/m32r/lib/ucmpdi2.c | 18 - arch/m32r/lib/usercopy.c | 362 --------- arch/m32r/mm/Makefile | 13 - arch/m32r/mm/cache.c | 89 --- arch/m32r/mm/discontig.c | 163 ---- arch/m32r/mm/extable.c | 20 - arch/m32r/mm/fault-nommu.c | 134 ---- arch/m32r/mm/fault.c | 550 -------------- arch/m32r/mm/init.c | 152 ---- arch/m32r/mm/ioremap-nommu.c | 52 -- arch/m32r/mm/ioremap.c | 111 --- arch/m32r/mm/mmu.S | 355 --------- arch/m32r/mm/page.S | 82 -- arch/m32r/oprofile/Makefile | 10 - arch/m32r/oprofile/init.c | 22 - arch/m32r/platforms/Makefile | 10 - arch/m32r/platforms/m32104ut/Makefile | 1 - arch/m32r/platforms/m32104ut/io.c | 298 -------- arch/m32r/platforms/m32104ut/setup.c | 139 ---- arch/m32r/platforms/m32700ut/Makefile | 1 - .../platforms/m32700ut/dot.gdbinit_200MHz_16MB | 249 ------ .../platforms/m32700ut/dot.gdbinit_300MHz_32MB | 249 ------ .../platforms/m32700ut/dot.gdbinit_400MHz_32MB | 249 ------ arch/m32r/platforms/m32700ut/io.c | 395 ---------- arch/m32r/platforms/m32700ut/setup.c | 451 ----------- arch/m32r/platforms/mappi/Makefile | 1 - arch/m32r/platforms/mappi/dot.gdbinit | 242 ------ arch/m32r/platforms/mappi/dot.gdbinit.nommu | 245 ------ arch/m32r/platforms/mappi/dot.gdbinit.smp | 344 --------- arch/m32r/platforms/mappi/io.c | 326 -------- arch/m32r/platforms/mappi/setup.c | 175 ----- arch/m32r/platforms/mappi2/Makefile | 1 - arch/m32r/platforms/mappi2/dot.gdbinit.vdec2 | 233 ------ arch/m32r/platforms/mappi2/io.c | 384 ---------- arch/m32r/platforms/mappi2/setup.c | 172 ----- arch/m32r/platforms/mappi3/Makefile | 1 - arch/m32r/platforms/mappi3/dot.gdbinit | 224 ------ arch/m32r/platforms/mappi3/io.c | 406 ---------- arch/m32r/platforms/mappi3/setup.c | 221 ------ arch/m32r/platforms/oaks32r/Makefile | 1 - arch/m32r/platforms/oaks32r/dot.gdbinit.nommu | 154 ---- arch/m32r/platforms/oaks32r/io.c | 229 ------ arch/m32r/platforms/oaks32r/setup.c | 114 --- arch/m32r/platforms/opsput/Makefile | 1 - arch/m32r/platforms/opsput/dot.gdbinit | 218 ------ arch/m32r/platforms/opsput/io.c | 395 ---------- arch/m32r/platforms/opsput/setup.c | 448 ----------- arch/m32r/platforms/usrv/Makefile | 1 - arch/m32r/platforms/usrv/io.c | 225 ------ arch/m32r/platforms/usrv/setup.c | 213 ------ tools/arch/m32r/include/uapi/asm/bitsperlong.h | 2 - tools/arch/m32r/include/uapi/asm/mman.h | 7 - 223 files changed, 27243 deletions(-) delete mode 100644 arch/m32r/Kconfig delete mode 100644 arch/m32r/Kconfig.debug delete mode 100644 arch/m32r/Makefile delete mode 100644 arch/m32r/boot/Makefile delete mode 100644 arch/m32r/boot/compressed/Makefile delete mode 100644 arch/m32r/boot/compressed/boot.h delete mode 100644 arch/m32r/boot/compressed/head.S delete mode 100644 arch/m32r/boot/compressed/install.sh delete mode 100644 arch/m32r/boot/compressed/m32r_sio.c delete mode 100644 arch/m32r/boot/compressed/misc.c delete mode 100644 arch/m32r/boot/compressed/vmlinux.lds.S delete mode 100644 arch/m32r/boot/compressed/vmlinux.scr delete mode 100644 arch/m32r/boot/setup.S delete mode 100644 arch/m32r/configs/m32104ut_defconfig delete mode 100644 arch/m32r/configs/m32700ut.smp_defconfig delete mode 100644 arch/m32r/configs/m32700ut.up_defconfig delete mode 100644 arch/m32r/configs/mappi.nommu_defconfig delete mode 100644 arch/m32r/configs/mappi.smp_defconfig delete mode 100644 arch/m32r/configs/mappi.up_defconfig delete mode 100644 arch/m32r/configs/mappi2.opsp_defconfig delete mode 100644 arch/m32r/configs/mappi2.vdec2_defconfig delete mode 100644 arch/m32r/configs/mappi3.smp_defconfig delete mode 100644 arch/m32r/configs/oaks32r_defconfig delete mode 100644 arch/m32r/configs/opsput_defconfig delete mode 100644 arch/m32r/configs/usrv_defconfig delete mode 100644 arch/m32r/include/asm/Kbuild delete mode 100644 arch/m32r/include/asm/addrspace.h delete mode 100644 arch/m32r/include/asm/asm-offsets.h delete mode 100644 arch/m32r/include/asm/assembler.h delete mode 100644 arch/m32r/include/asm/atomic.h delete mode 100644 arch/m32r/include/asm/barrier.h delete mode 100644 arch/m32r/include/asm/bitops.h delete mode 100644 arch/m32r/include/asm/bug.h delete mode 100644 arch/m32r/include/asm/bugs.h delete mode 100644 arch/m32r/include/asm/cache.h delete mode 100644 arch/m32r/include/asm/cachectl.h delete mode 100644 arch/m32r/include/asm/cacheflush.h delete mode 100644 arch/m32r/include/asm/checksum.h delete mode 100644 arch/m32r/include/asm/cmpxchg.h delete mode 100644 arch/m32r/include/asm/dcache_clear.h delete mode 100644 arch/m32r/include/asm/delay.h delete mode 100644 arch/m32r/include/asm/device.h delete mode 100644 arch/m32r/include/asm/div64.h delete mode 100644 arch/m32r/include/asm/dma.h delete mode 100644 arch/m32r/include/asm/elf.h delete mode 100644 arch/m32r/include/asm/emergency-restart.h delete mode 100644 arch/m32r/include/asm/fb.h delete mode 100644 arch/m32r/include/asm/flat.h delete mode 100644 arch/m32r/include/asm/ftrace.h delete mode 100644 arch/m32r/include/asm/futex.h delete mode 100644 arch/m32r/include/asm/hardirq.h delete mode 100644 arch/m32r/include/asm/hw_irq.h delete mode 100644 arch/m32r/include/asm/io.h delete mode 100644 arch/m32r/include/asm/irq.h delete mode 100644 arch/m32r/include/asm/irq_regs.h delete mode 100644 arch/m32r/include/asm/irqflags.h delete mode 100644 arch/m32r/include/asm/kdebug.h delete mode 100644 arch/m32r/include/asm/kmap_types.h delete mode 100644 arch/m32r/include/asm/linkage.h delete mode 100644 arch/m32r/include/asm/local.h delete mode 100644 arch/m32r/include/asm/local64.h delete mode 100644 arch/m32r/include/asm/m32102.h delete mode 100644 arch/m32r/include/asm/m32104ut/m32104ut_pld.h delete mode 100644 arch/m32r/include/asm/m32700ut/m32700ut_lan.h delete mode 100644 arch/m32r/include/asm/m32700ut/m32700ut_lcd.h delete mode 100644 arch/m32r/include/asm/m32700ut/m32700ut_pld.h delete mode 100644 arch/m32r/include/asm/m32r.h delete mode 100644 arch/m32r/include/asm/m32r_mp_fpga.h delete mode 100644 arch/m32r/include/asm/mappi2/mappi2_pld.h delete mode 100644 arch/m32r/include/asm/mappi3/mappi3_pld.h delete mode 100644 arch/m32r/include/asm/mc146818rtc.h delete mode 100644 arch/m32r/include/asm/mmu.h delete mode 100644 arch/m32r/include/asm/mmu_context.h delete mode 100644 arch/m32r/include/asm/mmzone.h delete mode 100644 arch/m32r/include/asm/opsput/opsput_lan.h delete mode 100644 arch/m32r/include/asm/opsput/opsput_lcd.h delete mode 100644 arch/m32r/include/asm/opsput/opsput_pld.h delete mode 100644 arch/m32r/include/asm/page.h delete mode 100644 arch/m32r/include/asm/pci.h delete mode 100644 arch/m32r/include/asm/percpu.h delete mode 100644 arch/m32r/include/asm/pgalloc.h delete mode 100644 arch/m32r/include/asm/pgtable-2level.h delete mode 100644 arch/m32r/include/asm/pgtable.h delete mode 100644 arch/m32r/include/asm/processor.h delete mode 100644 arch/m32r/include/asm/ptrace.h delete mode 100644 arch/m32r/include/asm/rtc.h delete mode 100644 arch/m32r/include/asm/s1d13806.h delete mode 100644 arch/m32r/include/asm/segment.h delete mode 100644 arch/m32r/include/asm/serial.h delete mode 100644 arch/m32r/include/asm/setup.h delete mode 100644 arch/m32r/include/asm/shmparam.h delete mode 100644 arch/m32r/include/asm/signal.h delete mode 100644 arch/m32r/include/asm/smp.h delete mode 100644 arch/m32r/include/asm/spinlock.h delete mode 100644 arch/m32r/include/asm/spinlock_types.h delete mode 100644 arch/m32r/include/asm/string.h delete mode 100644 arch/m32r/include/asm/switch_to.h delete mode 100644 arch/m32r/include/asm/syscall.h delete mode 100644 arch/m32r/include/asm/termios.h delete mode 100644 arch/m32r/include/asm/thread_info.h delete mode 100644 arch/m32r/include/asm/timex.h delete mode 100644 arch/m32r/include/asm/tlb.h delete mode 100644 arch/m32r/include/asm/tlbflush.h delete mode 100644 arch/m32r/include/asm/topology.h delete mode 100644 arch/m32r/include/asm/types.h delete mode 100644 arch/m32r/include/asm/uaccess.h delete mode 100644 arch/m32r/include/asm/ucontext.h delete mode 100644 arch/m32r/include/asm/unaligned.h delete mode 100644 arch/m32r/include/asm/unistd.h delete mode 100644 arch/m32r/include/asm/user.h delete mode 100644 arch/m32r/include/asm/vga.h delete mode 100644 arch/m32r/include/asm/xor.h delete mode 100644 arch/m32r/include/uapi/asm/Kbuild delete mode 100644 arch/m32r/include/uapi/asm/auxvec.h delete mode 100644 arch/m32r/include/uapi/asm/bitsperlong.h delete mode 100644 arch/m32r/include/uapi/asm/byteorder.h delete mode 100644 arch/m32r/include/uapi/asm/errno.h delete mode 100644 arch/m32r/include/uapi/asm/fcntl.h delete mode 100644 arch/m32r/include/uapi/asm/ioctl.h delete mode 100644 arch/m32r/include/uapi/asm/ioctls.h delete mode 100644 arch/m32r/include/uapi/asm/ipcbuf.h delete mode 100644 arch/m32r/include/uapi/asm/mman.h delete mode 100644 arch/m32r/include/uapi/asm/msgbuf.h delete mode 100644 arch/m32r/include/uapi/asm/param.h delete mode 100644 arch/m32r/include/uapi/asm/posix_types.h delete mode 100644 arch/m32r/include/uapi/asm/ptrace.h delete mode 100644 arch/m32r/include/uapi/asm/resource.h delete mode 100644 arch/m32r/include/uapi/asm/sembuf.h delete mode 100644 arch/m32r/include/uapi/asm/setup.h delete mode 100644 arch/m32r/include/uapi/asm/shmbuf.h delete mode 100644 arch/m32r/include/uapi/asm/sigcontext.h delete mode 100644 arch/m32r/include/uapi/asm/signal.h delete mode 100644 arch/m32r/include/uapi/asm/socket.h delete mode 100644 arch/m32r/include/uapi/asm/sockios.h delete mode 100644 arch/m32r/include/uapi/asm/stat.h delete mode 100644 arch/m32r/include/uapi/asm/statfs.h delete mode 100644 arch/m32r/include/uapi/asm/swab.h delete mode 100644 arch/m32r/include/uapi/asm/termbits.h delete mode 100644 arch/m32r/include/uapi/asm/termios.h delete mode 100644 arch/m32r/include/uapi/asm/types.h delete mode 100644 arch/m32r/include/uapi/asm/unistd.h delete mode 100644 arch/m32r/kernel/.gitignore delete mode 100644 arch/m32r/kernel/Makefile delete mode 100644 arch/m32r/kernel/align.c delete mode 100644 arch/m32r/kernel/asm-offsets.c delete mode 100644 arch/m32r/kernel/entry.S delete mode 100644 arch/m32r/kernel/head.S delete mode 100644 arch/m32r/kernel/irq.c delete mode 100644 arch/m32r/kernel/m32r_ksyms.c delete mode 100644 arch/m32r/kernel/module.c delete mode 100644 arch/m32r/kernel/process.c delete mode 100644 arch/m32r/kernel/ptrace.c delete mode 100644 arch/m32r/kernel/setup.c delete mode 100644 arch/m32r/kernel/signal.c delete mode 100644 arch/m32r/kernel/smp.c delete mode 100644 arch/m32r/kernel/smpboot.c delete mode 100644 arch/m32r/kernel/sys_m32r.c delete mode 100644 arch/m32r/kernel/syscall_table.S delete mode 100644 arch/m32r/kernel/time.c delete mode 100644 arch/m32r/kernel/traps.c delete mode 100644 arch/m32r/kernel/vmlinux.lds.S delete mode 100644 arch/m32r/lib/Makefile delete mode 100644 arch/m32r/lib/ashxdi3.S delete mode 100644 arch/m32r/lib/checksum.S delete mode 100644 arch/m32r/lib/csum_partial_copy.c delete mode 100644 arch/m32r/lib/delay.c delete mode 100644 arch/m32r/lib/libgcc.h delete mode 100644 arch/m32r/lib/memcpy.S delete mode 100644 arch/m32r/lib/memset.S delete mode 100644 arch/m32r/lib/strlen.S delete mode 100644 arch/m32r/lib/ucmpdi2.c delete mode 100644 arch/m32r/lib/usercopy.c delete mode 100644 arch/m32r/mm/Makefile delete mode 100644 arch/m32r/mm/cache.c delete mode 100644 arch/m32r/mm/discontig.c delete mode 100644 arch/m32r/mm/extable.c delete mode 100644 arch/m32r/mm/fault-nommu.c delete mode 100644 arch/m32r/mm/fault.c delete mode 100644 arch/m32r/mm/init.c delete mode 100644 arch/m32r/mm/ioremap-nommu.c delete mode 100644 arch/m32r/mm/ioremap.c delete mode 100644 arch/m32r/mm/mmu.S delete mode 100644 arch/m32r/mm/page.S delete mode 100644 arch/m32r/oprofile/Makefile delete mode 100644 arch/m32r/oprofile/init.c delete mode 100644 arch/m32r/platforms/Makefile delete mode 100644 arch/m32r/platforms/m32104ut/Makefile delete mode 100644 arch/m32r/platforms/m32104ut/io.c delete mode 100644 arch/m32r/platforms/m32104ut/setup.c delete mode 100644 arch/m32r/platforms/m32700ut/Makefile delete mode 100644 arch/m32r/platforms/m32700ut/dot.gdbinit_200MHz_16MB delete mode 100644 arch/m32r/platforms/m32700ut/dot.gdbinit_300MHz_32MB delete mode 100644 arch/m32r/platforms/m32700ut/dot.gdbinit_400MHz_32MB delete mode 100644 arch/m32r/platforms/m32700ut/io.c delete mode 100644 arch/m32r/platforms/m32700ut/setup.c delete mode 100644 arch/m32r/platforms/mappi/Makefile delete mode 100644 arch/m32r/platforms/mappi/dot.gdbinit delete mode 100644 arch/m32r/platforms/mappi/dot.gdbinit.nommu delete mode 100644 arch/m32r/platforms/mappi/dot.gdbinit.smp delete mode 100644 arch/m32r/platforms/mappi/io.c delete mode 100644 arch/m32r/platforms/mappi/setup.c delete mode 100644 arch/m32r/platforms/mappi2/Makefile delete mode 100644 arch/m32r/platforms/mappi2/dot.gdbinit.vdec2 delete mode 100644 arch/m32r/platforms/mappi2/io.c delete mode 100644 arch/m32r/platforms/mappi2/setup.c delete mode 100644 arch/m32r/platforms/mappi3/Makefile delete mode 100644 arch/m32r/platforms/mappi3/dot.gdbinit delete mode 100644 arch/m32r/platforms/mappi3/io.c delete mode 100644 arch/m32r/platforms/mappi3/setup.c delete mode 100644 arch/m32r/platforms/oaks32r/Makefile delete mode 100644 arch/m32r/platforms/oaks32r/dot.gdbinit.nommu delete mode 100644 arch/m32r/platforms/oaks32r/io.c delete mode 100644 arch/m32r/platforms/oaks32r/setup.c delete mode 100644 arch/m32r/platforms/opsput/Makefile delete mode 100644 arch/m32r/platforms/opsput/dot.gdbinit delete mode 100644 arch/m32r/platforms/opsput/io.c delete mode 100644 arch/m32r/platforms/opsput/setup.c delete mode 100644 arch/m32r/platforms/usrv/Makefile delete mode 100644 arch/m32r/platforms/usrv/io.c delete mode 100644 arch/m32r/platforms/usrv/setup.c delete mode 100644 tools/arch/m32r/include/uapi/asm/bitsperlong.h delete mode 100644 tools/arch/m32r/include/uapi/asm/mman.h (limited to 'tools/arch') diff --git a/MAINTAINERS b/MAINTAINERS index 3655d284af20..f48790625e3f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8308,11 +8308,6 @@ W: http://linux-test-project.github.io/ T: git git://github.com/linux-test-project/ltp.git S: Maintained -M32R ARCHITECTURE -W: http://www.linux-m32r.org/ -S: Orphan -F: arch/m32r/ - M68K ARCHITECTURE M: Geert Uytterhoeven L: linux-m68k@lists.linux-m68k.org diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig deleted file mode 100644 index dd84ee194579..000000000000 --- a/arch/m32r/Kconfig +++ /dev/null @@ -1,419 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -config M32R - bool - default y - select HAVE_IDE - select HAVE_OPROFILE - select INIT_ALL_POSSIBLE - select HAVE_KERNEL_GZIP - select HAVE_KERNEL_BZIP2 - select HAVE_KERNEL_LZMA - select ARCH_WANT_IPC_PARSE_VERSION - select HAVE_DEBUG_BUGVERBOSE - select VIRT_TO_BUS - select GENERIC_IRQ_PROBE - select GENERIC_IRQ_SHOW - select GENERIC_ATOMIC64 - select ARCH_HAS_DEVMEM_IS_ALLOWED - select ARCH_USES_GETTIMEOFFSET - select MODULES_USE_ELF_RELA - select HAVE_DEBUG_STACKOVERFLOW - select CPU_NO_EFFICIENT_FFS - select DMA_DIRECT_OPS - select ARCH_NO_COHERENT_DMA_MMAP if !MMU - -config SBUS - bool - -config GENERIC_ISA_DMA - bool - default y - -config ZONE_DMA - bool - default y - -config NO_IOPORT_MAP - def_bool y - -config NO_DMA - def_bool n - -config HZ - int - default 100 - -source "init/Kconfig" - -source "kernel/Kconfig.freezer" - - -menu "Processor type and features" - -choice - prompt "Platform Type" - default PLAT_MAPPI - -config PLAT_MAPPI - bool "Mappi-I" - help - The Mappi-I is an FPGA board for SOC (System-On-a-Chip) prototyping. - You can operate a Linux system on this board by using an M32R - softmacro core, which is a fully-synthesizable functional model - described in Verilog-HDL. - - The Mappi-I board was the first platform, which had been used - to port and develop a Linux system for the M32R processor. - Currently, the Mappi-II, an heir to the Mappi-I, is available. - -config PLAT_USRV - bool "uServer" - select PLAT_HAS_INT1ICU - -config PLAT_M32700UT - bool "M32700UT" - select PLAT_HAS_INT0ICU - select PLAT_HAS_INT1ICU - select PLAT_HAS_INT2ICU - help - The M3T-M32700UT is an evaluation board based on uT-Engine - specification. This board has an M32700 (Chaos) evaluation chip. - You can say Y for SMP, because the M32700 is a single chip - multiprocessor. - -config PLAT_OPSPUT - bool "OPSPUT" - select PLAT_HAS_INT0ICU - select PLAT_HAS_INT1ICU - select PLAT_HAS_INT2ICU - help - The OPSPUT is an evaluation board based on uT-Engine - specification. This board has a OPSP-REP chip. - -config PLAT_OAKS32R - bool "OAKS32R" - help - The OAKS32R is a tiny, inexpensive evaluation board. - Please note that if you say Y here and choose chip "M32102", - say N for MMU and select a no-MMU version kernel, otherwise - a kernel with MMU support will not work, because the M32102 - is a microcontroller for embedded systems and it has no MMU. - -config PLAT_MAPPI2 - bool "Mappi-II(M3A-ZA36/M3A-ZA52)" - -config PLAT_MAPPI3 - bool "Mappi-III(M3A-2170)" - -config PLAT_M32104UT - bool "M32104UT" - select PLAT_HAS_INT1ICU - help - The M3T-M32104UT is an reference board based on uT-Engine - specification. This board has a M32104 chip. - -endchoice - -choice - prompt "Processor family" - default CHIP_M32700 - -config CHIP_M32700 - bool "M32700 (Chaos)" - -config CHIP_M32102 - bool "M32102" - -config CHIP_M32104 - bool "M32104" - depends on PLAT_M32104UT - -config CHIP_VDEC2 - bool "VDEC2" - -config CHIP_OPSP - bool "OPSP" - -endchoice - -config MMU - bool "Support for memory management hardware" - depends on CHIP_M32700 || CHIP_VDEC2 || CHIP_OPSP - default y - -config TLB_ENTRIES - int "TLB Entries" - depends on CHIP_M32700 || CHIP_VDEC2 || CHIP_OPSP - default 32 if CHIP_M32700 || CHIP_OPSP - default 16 if CHIP_VDEC2 - - -config ISA_M32R - bool - depends on CHIP_M32102 || CHIP_M32104 - default y - -config ISA_M32R2 - bool - depends on CHIP_M32700 || CHIP_VDEC2 || CHIP_OPSP - default y - -config ISA_DSP_LEVEL2 - bool - depends on CHIP_M32700 || CHIP_OPSP - default y - -config ISA_DUAL_ISSUE - bool - depends on CHIP_M32700 || CHIP_OPSP - default y - -config PLAT_HAS_INT0ICU - bool - default n - -config PLAT_HAS_INT1ICU - bool - default n - -config PLAT_HAS_INT2ICU - bool - default n - -config BUS_CLOCK - int "Bus Clock [Hz] (integer)" - default "70000000" if PLAT_MAPPI - default "25000000" if PLAT_USRV - default "50000000" if PLAT_MAPPI3 - default "50000000" if PLAT_M32700UT - default "50000000" if PLAT_OPSPUT - default "54000000" if PLAT_M32104UT - default "33333333" if PLAT_OAKS32R - default "20000000" if PLAT_MAPPI2 - -config TIMER_DIVIDE - int "Timer divider (integer)" - default "128" - -config CPU_BIG_ENDIAN - bool - default !CPU_LITTLE_ENDIAN - -config CPU_LITTLE_ENDIAN - bool "Generate little endian code" - default n - -config MEMORY_START - hex "Physical memory start address (hex)" - default "08000000" if PLAT_MAPPI || PLAT_MAPPI2 || PLAT_MAPPI3 - default "08000000" if PLAT_USRV - default "08000000" if PLAT_M32700UT - default "08000000" if PLAT_OPSPUT - default "04000000" if PLAT_M32104UT - default "01000000" if PLAT_OAKS32R - -config MEMORY_SIZE - hex "Physical memory size (hex)" - default "08000000" if PLAT_MAPPI3 - default "04000000" if PLAT_MAPPI || PLAT_MAPPI2 - default "02000000" if PLAT_USRV - default "01000000" if PLAT_M32700UT - default "01000000" if PLAT_OPSPUT - default "01000000" if PLAT_M32104UT - default "00800000" if PLAT_OAKS32R - -config ARCH_DISCONTIGMEM_ENABLE - bool "Internal RAM Support" - depends on CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104 - default y - -source "mm/Kconfig" - -config IRAM_START - hex "Internal memory start address (hex)" - default "00f00000" if !CHIP_M32104 - default "00700000" if CHIP_M32104 - depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104) && DISCONTIGMEM - -config IRAM_SIZE - hex "Internal memory size (hex)" - depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104) && DISCONTIGMEM - default "00080000" if CHIP_M32700 - default "00010000" if CHIP_M32102 || CHIP_OPSP || CHIP_M32104 - default "00008000" if CHIP_VDEC2 - -# -# Define implied options from the CPU selection here -# - -config GENERIC_LOCKBREAK - bool - default y - depends on SMP && PREEMPT - -config RWSEM_GENERIC_SPINLOCK - bool - depends on M32R - default y - -config RWSEM_XCHGADD_ALGORITHM - bool - default n - -config ARCH_HAS_ILOG2_U32 - bool - default n - -config ARCH_HAS_ILOG2_U64 - bool - default n - -config GENERIC_HWEIGHT - bool - default y - -config GENERIC_CALIBRATE_DELAY - bool - default y - -config SCHED_OMIT_FRAME_POINTER - bool - default y - -source "kernel/Kconfig.preempt" - -config SMP - bool "Symmetric multi-processing support" - depends on MMU - ---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. The "Advanced Power - Management" code will be disabled if you say Y here. - - See also the SMP-HOWTO available at - . - - If you don't know what to do here, say N. - -config CHIP_M32700_TS1 - bool "Workaround code for the M32700 TS1 chip's bug" - depends on (CHIP_M32700 && SMP) - default n - -config NR_CPUS - int "Maximum number of CPUs (2-32)" - range 2 32 - depends on SMP - 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. - -# Common NUMA Features -config NUMA - bool "Numa Memory Allocation Support" - depends on SMP && BROKEN - default n - -config NODES_SHIFT - int - default "1" - depends on NEED_MULTIPLE_NODES - -endmenu - - -menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)" - -config PCI - bool "PCI support" - depends on BROKEN - default n - help - Find out whether you have a PCI motherboard. PCI is the name of a - bus system, i.e. the way the CPU talks to the other stuff inside - your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or - VESA. If you have PCI, say Y, otherwise N. - -choice - prompt "PCI access mode" - depends on PCI - default PCI_GOANY - -config PCI_GOBIOS - bool "BIOS" - ---help--- - On PCI systems, the BIOS can be used to detect the PCI devices and - determine their configuration. However, some old PCI motherboards - have BIOS bugs and may crash if this is done. Also, some embedded - PCI-based systems don't have any BIOS at all. Linux can also try to - detect the PCI hardware directly without using the BIOS. - - With this option, you can specify how Linux should detect the PCI - devices. If you choose "BIOS", the BIOS will be used, if you choose - "Direct", the BIOS won't be used, and if you choose "Any", the - kernel will try the direct access method and falls back to the BIOS - if that doesn't work. If unsure, go with the default, which is - "Any". - -config PCI_GODIRECT - bool "Direct" - -config PCI_GOANY - bool "Any" - -endchoice - -config PCI_BIOS - bool - depends on PCI && (PCI_GOBIOS || PCI_GOANY) - default y - -config PCI_DIRECT - bool - depends on PCI && (PCI_GODIRECT || PCI_GOANY) - default y - -source "drivers/pci/Kconfig" - -config ISA - bool - -source "drivers/pcmcia/Kconfig" - -endmenu - - -menu "Executable file formats" - -source "fs/Kconfig.binfmt" - -endmenu - -source "net/Kconfig" - -source "drivers/Kconfig" - -source "fs/Kconfig" - -source "arch/m32r/Kconfig.debug" - -source "security/Kconfig" - -source "crypto/Kconfig" - -source "lib/Kconfig" diff --git a/arch/m32r/Kconfig.debug b/arch/m32r/Kconfig.debug deleted file mode 100644 index ffca1e194f91..000000000000 --- a/arch/m32r/Kconfig.debug +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -menu "Kernel hacking" - -source "lib/Kconfig.debug" - -config DEBUG_PAGEALLOC - bool "Debug page memory allocations" - depends on DEBUG_KERNEL && BROKEN - help - Unmap pages from the kernel linear mapping after free_pages(). - This results in a large slowdown, but helps to find certain types - of memory corruptions. - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - -endmenu diff --git a/arch/m32r/Makefile b/arch/m32r/Makefile deleted file mode 100644 index d73b58c847a6..000000000000 --- a/arch/m32r/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# m32r/Makefile -# -# This file is included by the global makefile so that you can add your own -# architecture-specific flags and dependencies. -# - -KBUILD_DEFCONFIG := m32700ut.smp_defconfig - -LDFLAGS := -OBJCOPYFLAGS := -O binary -R .note -R .comment -S -LDFLAGS_vmlinux := - -KBUILD_CFLAGS += -pipe -fno-schedule-insns -KBUILD_CFLAGS_KERNEL += -mmodel=medium -KBUILD_CFLAGS_MODULE += -mmodel=large - -ifdef CONFIG_CHIP_VDEC2 -cflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -Wa,-bitinst -aflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -O2 -Wa,-bitinst -Wa,-no-parallel -else -cflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -m32r2 -aflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -m32r2 -O2 -endif - -cflags-$(CONFIG_ISA_M32R) += -DNO_FPU -aflags-$(CONFIG_ISA_M32R) += -DNO_FPU -O2 -Wa,-no-bitinst - -KBUILD_CFLAGS += $(cflags-y) -KBUILD_AFLAGS += $(aflags-y) - -CHECKFLAGS += -D__m32r__ -D__BIG_ENDIAN__=1 - -head-y := arch/m32r/kernel/head.o - -LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) - -libs-y += arch/m32r/lib/ $(LIBGCC) -core-y += arch/m32r/kernel/ \ - arch/m32r/mm/ \ - arch/m32r/boot/ \ - arch/m32r/platforms/ - -drivers-$(CONFIG_OPROFILE) += arch/m32r/oprofile/ - -boot := arch/m32r/boot - -PHONY += zImage - -all: zImage - -zImage: vmlinux - $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ - -compressed: zImage - -archclean: - $(Q)$(MAKE) $(clean)=$(boot) - -define archhelp - echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' -endef diff --git a/arch/m32r/boot/Makefile b/arch/m32r/boot/Makefile deleted file mode 100644 index af2cef475d98..000000000000 --- a/arch/m32r/boot/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# arch/m32r/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. - -targets := zImage -subdir- := compressed - -obj-y := setup.o - -$(obj)/zImage: $(obj)/compressed/vmlinux FORCE - $(call if_changed,objcopy) - @echo 'Kernel: $@ is ready' - -$(obj)/compressed/vmlinux: FORCE - $(Q)$(MAKE) $(build)=$(obj)/compressed $@ - diff --git a/arch/m32r/boot/compressed/Makefile b/arch/m32r/boot/compressed/Makefile deleted file mode 100644 index abd3c75ebd32..000000000000 --- a/arch/m32r/boot/compressed/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# linux/arch/m32r/boot/compressed/Makefile -# -# create a compressed vmlinux image from the original vmlinux -# - -targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \ - vmlinux.bin.lzma head.o misc.o piggy.o vmlinux.lds - -OBJECTS = $(obj)/head.o $(obj)/misc.o - -# -# IMAGE_OFFSET is the load offset of the compression loader -# -#IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+0x2000]) -#IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+0x00400000]) - -LDFLAGS_vmlinux := -T - -$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(obj)/piggy.o 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) - -$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE - $(call if_changed,lzma) - -CFLAGS_misc.o += -fpic - -ifdef CONFIG_MMU -LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r-linux -T -else -LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r -T -endif - -OBJCOPYFLAGS += -R .empty_zero_page - -suffix-$(CONFIG_KERNEL_GZIP) = gz -suffix-$(CONFIG_KERNEL_BZIP2) = bz2 -suffix-$(CONFIG_KERNEL_LZMA) = lzma - -$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE - $(call if_changed,ld) diff --git a/arch/m32r/boot/compressed/boot.h b/arch/m32r/boot/compressed/boot.h deleted file mode 100644 index 7fce713e8aac..000000000000 --- a/arch/m32r/boot/compressed/boot.h +++ /dev/null @@ -1,60 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * 1. load vmlinuz - * - * CONFIG_MEMORY_START +-----------------------+ - * | vmlinuz | - * +-----------------------+ - * 2. decompressed - * - * CONFIG_MEMORY_START +-----------------------+ - * | vmlinuz | - * +-----------------------+ - * | | - * BOOT_RELOC_ADDR +-----------------------+ - * | | - * KERNEL_DECOMPRESS_ADDR +-----------------------+ - * | vmlinux | - * +-----------------------+ - * - * 3. relocate copy & jump code - * - * CONFIG_MEMORY_START +-----------------------+ - * | vmlinuz | - * +-----------------------+ - * | | - * BOOT_RELOC_ADDR +-----------------------+ - * | boot(copy&jump) | - * KERNEL_DECOMPRESS_ADDR +-----------------------+ - * | vmlinux | - * +-----------------------+ - * - * 4. relocate decompressed kernel - * - * CONFIG_MEMORY_START +-----------------------+ - * | vmlinux | - * +-----------------------+ - * | | - * BOOT_RELOC_ADDR +-----------------------+ - * | boot(copy&jump) | - * KERNEL_DECOMPRESS_ADDR +-----------------------+ - * | | - * +-----------------------+ - * - */ -#ifdef __ASSEMBLY__ -#define __val(x) x -#else -#define __val(x) (x) -#endif - -#define DECOMPRESS_OFFSET_BASE __val(0x00900000) -#define BOOT_RELOC_SIZE __val(0x00001000) - -#define KERNEL_EXEC_ADDR __val(CONFIG_MEMORY_START) -#define KERNEL_DECOMPRESS_ADDR __val(CONFIG_MEMORY_START + \ - DECOMPRESS_OFFSET_BASE + BOOT_RELOC_SIZE) -#define KERNEL_ENTRY __val(CONFIG_MEMORY_START + 0x1000) - -#define BOOT_EXEC_ADDR __val(CONFIG_MEMORY_START) -#define BOOT_RELOC_ADDR __val(CONFIG_MEMORY_START + DECOMPRESS_OFFSET_BASE) diff --git a/arch/m32r/boot/compressed/head.S b/arch/m32r/boot/compressed/head.S deleted file mode 100644 index 39b693640375..000000000000 --- a/arch/m32r/boot/compressed/head.S +++ /dev/null @@ -1,177 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/boot/compressed/head.S - * - * Copyright (c) 2001-2003 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto, Takeo Takahashi - * Copyright (c) 2004 Hirokazu Takata - */ - - .text -#include -#include -#include -#include - - /* - * This code can be loaded anywhere, as long as output will not - * overlap it. - * - * NOTE: This head.S should *NOT* be compiled with -fpic. - * - */ - - .global startup - .global __bss_start, _ebss, end, zimage_data, zimage_len - __ALIGN -startup: - ldi r0, #0x0000 /* SPI, disable EI */ - mvtc r0, psw - - ldi r12, #-8 - bl 1f - .fillinsn -1: - seth r1, #high(CONFIG_MEMORY_START + 0x00400000) /* Start address */ - add r12, r14 /* Real address */ - sub r12, r1 /* difference */ - - .global got_len - seth r3, #high(_GLOBAL_OFFSET_TABLE_+8) - or3 r3, r3, #low(_GLOBAL_OFFSET_TABLE_+12) - add r3, r14 - - /* Update the contents of global offset table */ - ldi r1, #low(got_len) - srli r1, #2 - beqz r1, 2f - .fillinsn -1: - ld r2, @r3 - add r2, r12 - st r2, @r3 - addi r3, #4 - addi r1, #-1 - bnez r1, 1b - .fillinsn -2: - /* XXX: resolve plt */ - -/* - * Clear BSS first so that there are no surprises... - */ -#ifdef CONFIG_ISA_DUAL_ISSUE - seth r2, #high(__bss_start) - or3 r2, r2, #low(__bss_start) - add r2, r12 - seth r3, #high(_ebss) - or3 r3, r3, #low(_ebss) - add r3, r12 - sub r3, r2 - - ; R4 = BSS size in longwords (rounded down) - mv r4, r3 || ldi r1, #0 - srli r4, #4 || addi r2, #-4 - beqz r4, .Lendloop1 -.Lloop1: -#ifndef CONFIG_CHIP_M32310 - ; Touch memory for the no-write-allocating cache. - ld r0, @(4,r2) -#endif - st r1, @+r2 || addi r4, #-1 - st r1, @+r2 - st r1, @+r2 - st r1, @+r2 || cmpeq r1, r4 ; R4 = 0? - bnc .Lloop1 -.Lendloop1: - and3 r4, r3, #15 - addi r2, #4 - beqz r4, .Lendloop2 -.Lloop2: - stb r1, @r2 || addi r4, #-1 - addi r2, #1 - bnez r4, .Lloop2 -.Lendloop2: - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - seth r2, #high(__bss_start) - or3 r2, r2, #low(__bss_start) - add r2, r12 - seth r3, #high(_ebss) - or3 r3, r3, #low(_ebss) - add r3, r12 - sub r3, r2 - mv r4, r3 - srli r4, #2 ; R4 = BSS size in longwords (rounded down) - ldi r1, #0 ; clear R1 for longwords store - addi r2, #-4 ; account for pre-inc store - beqz r4, .Lendloop1 ; any more to go? -.Lloop1: - st r1, @+r2 ; yep, zero out another longword - addi r4, #-1 ; decrement count - bnez r4, .Lloop1 ; go do some more -.Lendloop1: - -#endif /* not CONFIG_ISA_DUAL_ISSUE */ - - seth r1, #high(end) - or3 r1, r1, #low(end) - add r1, r12 - mv sp, r1 - -/* - * decompress the kernel - */ - mv r0, sp - srli r0, 31 /* MMU is ON or OFF */ - seth r1, #high(zimage_data) - or3 r1, r1, #low(zimage_data) - add r1, r12 - seth r2, #high(zimage_len) - or3 r2, r2, #low(zimage_len) - mv r3, sp - - bl decompress_kernel - -#if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_VDEC2) - /* Cache flush */ - ldi r0, -1 - ldi r1, 0xd0 ; invalidate i-cache, copy back d-cache - stb r1, @r0 -#elif defined(CONFIG_CHIP_M32102) - /* Cache flush */ - ldi r0, -2 - ldi r1, 0x0100 ; invalidate - stb r1, @r0 -#elif defined(CONFIG_CHIP_M32104) - /* Cache flush */ - ldi r0, -2 - ldi r1, 0x0700 ; invalidate i-cache, copy back d-cache - sth r1, @r0 -#else -#error "put your cache flush function, please" -#endif - - mv r0, sp - srli r0, 31 /* MMU is ON or OFF */ - slli r0, 31 - or3 r0, r0, #0x2000 - seth r1, #high(CONFIG_MEMORY_START) - or r0, r1 - jmp r0 - - .balign 512 -fake_headers_as_bzImage: - .short 0 - .ascii "HdrS" - .short 0x0202 - .short 0 - .short 0 - .byte 0x00, 0x10 - .short 0 - .byte 0 - .byte 1 - .byte 0x00, 0x80 - .long 0 - .long 0 - diff --git a/arch/m32r/boot/compressed/install.sh b/arch/m32r/boot/compressed/install.sh deleted file mode 100644 index 16e5a0a13437..000000000000 --- a/arch/m32r/boot/compressed/install.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# arch/sh/boot/install.sh -# -# 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) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# Adapted from code in arch/i386/boot/install.sh by Russell King -# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy -# Adapted from code in arch/sh/boot/install.sh by Takeo Takahashi -# -# "make install" script for sh architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -# User may have a custom install script - -if [ -x /sbin/${INSTALLKERNEL} ]; then - exec /sbin/${INSTALLKERNEL} "$@" -fi - -if [ "$2" = "zImage" ]; then -# Compressed install - echo "Installing compressed kernel" - if [ -f $4/vmlinuz-$1 ]; then - mv $4/vmlinuz-$1 $4/vmlinuz.old - fi - - if [ -f $4/System.map-$1 ]; then - mv $4/System.map-$1 $4/System.old - fi - - cat $2 > $4/vmlinuz-$1 - cp $3 $4/System.map-$1 -else -# Normal install - echo "Installing normal kernel" - if [ -f $4/vmlinux-$1 ]; then - mv $4/vmlinux-$1 $4/vmlinux.old - fi - - if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old - fi - - cat $2 > $4/vmlinux-$1 - cp $3 $4/System.map -fi diff --git a/arch/m32r/boot/compressed/m32r_sio.c b/arch/m32r/boot/compressed/m32r_sio.c deleted file mode 100644 index 9d34bd063c31..000000000000 --- a/arch/m32r/boot/compressed/m32r_sio.c +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/m32r/boot/compressed/m32r_sio.c - * - * 2003-02-12: Takeo Takahashi - * 2006-11-30: OPSPUT support by Kazuhiro Inaoka - * - */ - -#include - -static void m32r_putc(char c); - -static int puts(const char *s) -{ - char c; - while ((c = *s++)) - m32r_putc(c); - return 0; -} - -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT) -#include -#include - -#define USE_FPGA_MAP 0 - -#if USE_FPGA_MAP -/* - * fpga configuration program uses MMU, and define map as same as - * M32104 uT-Engine board. - */ -#define BOOT_SIO0STS (volatile unsigned short *)(0x02c00000 + 0x20006) -#define BOOT_SIO0TXB (volatile unsigned short *)(0x02c00000 + 0x2000c) -#else -#undef PLD_BASE -#if defined(CONFIG_PLAT_OPSPUT) -#define PLD_BASE 0x1cc00000 -#else -#define PLD_BASE 0xa4c00000 -#endif -#define BOOT_SIO0STS PLD_ESIO0STS -#define BOOT_SIO0TXB PLD_ESIO0TXB -#endif - -static void m32r_putc(char c) -{ - while ((*BOOT_SIO0STS & 0x3) != 0x3) - cpu_relax(); - if (c == '\n') { - *BOOT_SIO0TXB = '\r'; - while ((*BOOT_SIO0STS & 0x3) != 0x3) - cpu_relax(); - } - *BOOT_SIO0TXB = c; -} -#else /* !(CONFIG_PLAT_M32700UT) */ -#if defined(CONFIG_PLAT_MAPPI2) -#define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14) -#define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30) -#else -#define SIO0STS (volatile unsigned short *)(0x00efd000 + 14) -#define SIO0TXB (volatile unsigned short *)(0x00efd000 + 30) -#endif - -static void m32r_putc(char c) -{ - while ((*SIO0STS & 0x1) == 0) - cpu_relax(); - if (c == '\n') { - *SIO0TXB = '\r'; - while ((*SIO0STS & 0x1) == 0) - cpu_relax(); - } - *SIO0TXB = c; -} -#endif diff --git a/arch/m32r/boot/compressed/misc.c b/arch/m32r/boot/compressed/misc.c deleted file mode 100644 index 43e367055669..000000000000 --- a/arch/m32r/boot/compressed/misc.c +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * arch/m32r/boot/compressed/misc.c - * - * This is a collection of several routines from gzip-1.0.3 - * adapted for Linux. - * - * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 - * - * Adapted for SH by Stuart Menefy, Aug 1999 - * - * 2003-02-12: Support M32R by Takeo Takahashi - */ - -/* - * gzip declarations - */ -#define STATIC static - -#undef memset -#undef memcpy -#define memzero(s, n) memset ((s), 0, (n)) - -static void error(char *m); - -#include "m32r_sio.c" - -static unsigned long free_mem_ptr; -static unsigned long free_mem_end_ptr; - -#ifdef CONFIG_KERNEL_BZIP2 -void *memset(void *s, int c, size_t n) -{ - char *ss = s; - - while (n--) - *ss++ = c; - return s; -} -#endif - -#ifdef CONFIG_KERNEL_GZIP -void *memcpy(void *dest, const void *src, size_t n) -{ - char *d = dest; - const char *s = src; - while (n--) - *d++ = *s++; - - return dest; -} - -#define BOOT_HEAP_SIZE 0x10000 -#include "../../../../lib/decompress_inflate.c" -#endif - -#ifdef CONFIG_KERNEL_BZIP2 -#define BOOT_HEAP_SIZE 0x400000 -#include "../../../../lib/decompress_bunzip2.c" -#endif - -#ifdef CONFIG_KERNEL_LZMA -#define BOOT_HEAP_SIZE 0x10000 -#include "../../../../lib/decompress_unlzma.c" -#endif - -static void error(char *x) -{ - puts("\n\n"); - puts(x); - puts("\n\n -- System halted"); - - while(1); /* Halt */ -} - -void -decompress_kernel(int mmu_on, unsigned char *zimage_data, - unsigned int zimage_len, unsigned long heap) -{ - unsigned char *input_data = zimage_data; - int input_len = zimage_len; - unsigned char *output_data; - - output_data = (unsigned char *)CONFIG_MEMORY_START + 0x2000 - + (mmu_on ? 0x80000000 : 0); - free_mem_ptr = heap; - free_mem_end_ptr = free_mem_ptr + BOOT_HEAP_SIZE; - - puts("\nDecompressing Linux... "); - __decompress(input_data, input_len, NULL, NULL, output_data, 0, - NULL, error); - puts("done.\nBooting the kernel.\n"); -} diff --git a/arch/m32r/boot/compressed/vmlinux.lds.S b/arch/m32r/boot/compressed/vmlinux.lds.S deleted file mode 100644 index c393eb559c4c..000000000000 --- a/arch/m32r/boot/compressed/vmlinux.lds.S +++ /dev/null @@ -1,31 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -OUTPUT_ARCH(m32r) -ENTRY(startup) -SECTIONS -{ - . = CONFIG_MEMORY_START + 0x00400000; - - _text = .; - .text : { *(.text) } = 0 - .rodata : { *(.rodata) *(.rodata.*) } - _etext = .; - - . = ALIGN(32 / 8); - .data : { *(.data) } - . = ALIGN(32 / 8); - _got = .; - .got : { *(.got) _egot = .; *(.got.*) } - _edata = .; - - . = ALIGN(32 / 8); - __bss_start = .; - .bss : { *(.bss) *(.sbss) } - . = ALIGN(32 / 8); - _ebss = .; - . = ALIGN(4096); - . += 4096; - end = . ; - - got_len = (_egot - _got); -} diff --git a/arch/m32r/boot/compressed/vmlinux.scr b/arch/m32r/boot/compressed/vmlinux.scr deleted file mode 100644 index 924c7992c55b..000000000000 --- a/arch/m32r/boot/compressed/vmlinux.scr +++ /dev/null @@ -1,9 +0,0 @@ -SECTIONS -{ - .data : { - zimage_data = .; - *(.data) - zimage_data_end = .; - } - zimage_len = zimage_data_end - zimage_data; -} diff --git a/arch/m32r/boot/setup.S b/arch/m32r/boot/setup.S deleted file mode 100644 index 5909a825e2ed..000000000000 --- a/arch/m32r/boot/setup.S +++ /dev/null @@ -1,185 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/boot/setup.S -- A setup code. - * - * Copyright (C) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto, Hayato Fujiwara - * - */ - -#include -#include -#include -#include - -#include -#include -#include - -/* - * References to members of the boot_cpu_data structure. - */ - -#define CPU_PARAMS boot_cpu_data -#define M32R_MCICAR 0xfffffff0 -#define M32R_MCDCAR 0xfffffff4 -#define M32R_MCCR 0xfffffffc -#define M32R_BSCR0 0xffffffd2 - -;BSEL -#define BSEL0CR0 0x00ef5000 -#define BSEL0CR1 0x00ef5004 -#define BSEL1CR0 0x00ef5100 -#define BSEL1CR1 0x00ef5104 -#define BSEL0CR0_VAL 0x00000000 -#define BSEL0CR1_VAL 0x01200100 -#define BSEL1CR0_VAL 0x01018000 -#define BSEL1CR1_VAL 0x00200001 - -;SDRAMC -#define SDRAMC_SDRF0 0x00ef6000 -#define SDRAMC_SDRF1 0x00ef6004 -#define SDRAMC_SDIR0 0x00ef6008 -#define SDRAMC_SDIR1 0x00ef600c -#define SDRAMC_SD0ADR 0x00ef6020 -#define SDRAMC_SD0ER 0x00ef6024 -#define SDRAMC_SD0TR 0x00ef6028 -#define SDRAMC_SD0MOD 0x00ef602c -#define SDRAMC_SD1ADR 0x00ef6040 -#define SDRAMC_SD1ER 0x00ef6044 -#define SDRAMC_SD1TR 0x00ef6048 -#define SDRAMC_SD1MOD 0x00ef604c -#define SDRAM0 0x18000000 -#define SDRAM1 0x1c000000 - -/*------------------------------------------------------------------------ - * start up - */ - -/*------------------------------------------------------------------------ - * Kernel entry - */ - .section .boot, "ax" -ENTRY(boot) - -/* Set cache mode */ -#if defined(CONFIG_CHIP_XNUX2) - ldi r0, #-2 ;LDIMM (r0, M32R_MCCR) - ldi r1, #0x0101 ; cache on (with invalidation) -; ldi r1, #0x00 ; cache off - sth r1, @r0 -#elif defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_VDEC2) \ - || defined(CONFIG_CHIP_OPSP) - ldi r0, #-4 ;LDIMM (r0, M32R_MCCR) - ldi r1, #0x73 ; cache on (with invalidation) -; ldi r1, #0x00 ; cache off - st r1, @r0 -#elif defined(CONFIG_CHIP_M32102) - ldi r0, #-4 ;LDIMM (r0, M32R_MCCR) - ldi r1, #0x101 ; cache on (with invalidation) -; ldi r1, #0x00 ; cache off - st r1, @r0 -#elif defined(CONFIG_CHIP_M32104) - ldi r0, #-96 ; DNCR0 - seth r1, #0x0060 ; from 0x00600000 - or3 r1, r1, #0x0005 ; size 2MB - st r1, @r0 - seth r1, #0x0100 ; from 0x01000000 - or3 r1, r1, #0x0003 ; size 16MB - st r1, @+r0 - seth r1, #0x0200 ; from 0x02000000 - or3 r1, r1, #0x0002 ; size 32MB - st r1, @+r0 - ldi r0, #-4 ;LDIMM (r0, M32R_MCCR) - ldi r1, #0x703 ; cache on (with invalidation) - st r1, @r0 -#else -#error unknown chip configuration -#endif - -#ifdef CONFIG_SMP - ;; if not BSP (CPU#0) goto AP_loop - seth r5, #shigh(M32R_CPUID_PORTL) - ld r5, @(low(M32R_CPUID_PORTL), r5) - bnez r5, AP_loop -#if !defined(CONFIG_PLAT_USRV) - ;; boot AP - ld24 r5, #0xeff2f8 ; IPICR7 - ldi r6, #0x2 ; IPI to CPU1 - st r6, @r5 -#endif -#endif - -/* - * Now, Jump to stext - * if with MMU, TLB on. - * if with no MMU, only jump. - */ - .global eit_vector -mmu_on: - LDIMM (r13, stext) -#ifdef CONFIG_MMU - bl init_tlb - LDIMM (r2, eit_vector) ; set EVB(cr5) - mvtc r2, cr5 - seth r0, #high(MMU_REG_BASE) ; Set MMU_REG_BASE higher - or3 r0, r0, #low(MMU_REG_BASE) ; Set MMU_REG_BASE lower - ldi r1, #0x01 - st r1, @(MATM_offset,r0) ; Set MATM (T bit ON) - ld r0, @(MATM_offset,r0) ; Check -#else -#if defined(CONFIG_CHIP_M32700) - seth r0,#high(M32R_MCDCAR) - or3 r0,r0,#low(M32R_MCDCAR) - ld24 r1,#0x8080 - st r1,@r0 -#elif defined(CONFIG_CHIP_M32104) - LDIMM (r2, eit_vector) ; set EVB(cr5) - mvtc r2, cr5 -#endif -#endif /* CONFIG_MMU */ - jmp r13 - nop - nop - -#ifdef CONFIG_SMP -/* - * AP wait loop - */ -ENTRY(AP_loop) - ;; disable interrupt - clrpsw #0x40 - ;; reset EVB - LDIMM (r4, _AP_RE) - seth r5, #high(__PAGE_OFFSET) - or3 r5, r5, #low(__PAGE_OFFSET) - not r5, r5 - and r4, r5 - mvtc r4, cr5 - ;; disable maskable interrupt - seth r4, #high(M32R_ICU_IMASK_PORTL) - or3 r4, r4, #low(M32R_ICU_IMASK_PORTL) - ldi r5, #0 - st r5, @r4 - ld r5, @r4 - ;; enable only IPI - setpsw #0x40 - ;; LOOOOOOOOOOOOOOP!!! - .fillinsn -2: - nop - nop - bra 2b - nop - nop - -#ifdef CONFIG_CHIP_M32700_TS1 - .global dcache_dummy - .balign 16, 0 -dcache_dummy: - .byte 16 -#endif /* CONFIG_CHIP_M32700_TS1 */ -#endif /* CONFIG_SMP */ - - .end - diff --git a/arch/m32r/configs/m32104ut_defconfig b/arch/m32r/configs/m32104ut_defconfig deleted file mode 100644 index 4aa42acbd512..000000000000 --- a/arch/m32r/configs/m32104ut_defconfig +++ /dev/null @@ -1,144 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=14 -CONFIG_SLAB=y -CONFIG_PROFILING=y -CONFIG_OPROFILE=m -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -CONFIG_MODULE_FORCE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PLAT_M32104UT=y -CONFIG_CHIP_M32104=y -CONFIG_MEMORY_START=0x04000000 -CONFIG_MEMORY_SIZE=0x01000000 -CONFIG_IRAM_START=0x00700000 -CONFIG_IRAM_SIZE=0x00010000 -CONFIG_PREEMPT=y -CONFIG_BINFMT_MISC=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -# CONFIG_IPV6 is not set -CONFIG_NETFILTER=y -CONFIG_NETFILTER_NETLINK_QUEUE=m -CONFIG_NETFILTER_NETLINK_LOG=m -CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m -CONFIG_NETFILTER_XT_TARGET_MARK=m -CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m -CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m -CONFIG_NETFILTER_XT_MATCH_LENGTH=m -CONFIG_NETFILTER_XT_MATCH_LIMIT=m -CONFIG_NETFILTER_XT_MATCH_MAC=m -CONFIG_NETFILTER_XT_MATCH_MARK=m -CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m -CONFIG_NETFILTER_XT_MATCH_REALM=m -CONFIG_NETFILTER_XT_MATCH_SCTP=m -CONFIG_NETFILTER_XT_MATCH_STRING=m -CONFIG_NETFILTER_XT_MATCH_TCPMSS=m -CONFIG_IP_NF_IPTABLES=m -CONFIG_IP_NF_MATCH_ADDRTYPE=m -CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_TTL=m -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_TARGET_REJECT=m -CONFIG_IP_NF_TARGET_LOG=m -CONFIG_IP_NF_MANGLE=m -CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_TTL=m -CONFIG_IP_NF_RAW=m -CONFIG_IP_NF_ARPTABLES=m -CONFIG_IP_NF_ARPFILTER=m -CONFIG_IP_NF_ARP_MANGLE=m -CONFIG_PARPORT=m -CONFIG_PARPORT_1284=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=m -CONFIG_CDROM_PKTCDVD=m -CONFIG_CDROM_PKTCDVD_WCACHE=y -CONFIG_IDE=y -CONFIG_BLK_DEV_IDECD=y -CONFIG_IDE_GENERIC=y -CONFIG_SCSI=y -CONFIG_BLK_DEV_SD=y -CONFIG_CHR_DEV_ST=m -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_SCSI_MULTI_LUN=y -CONFIG_SCSI_CONSTANTS=y -CONFIG_SCSI_SPI_ATTRS=y -CONFIG_MD=y -CONFIG_BLK_DEV_MD=y -CONFIG_MD_RAID1=y -CONFIG_BLK_DEV_DM=m -CONFIG_DM_CRYPT=m -CONFIG_DM_SNAPSHOT=m -CONFIG_NETDEVICES=y -CONFIG_DUMMY=m -CONFIG_NET_ETHERNET=y -CONFIG_MII=y -CONFIG_NE2000=m -CONFIG_SERIAL_8250=m -# CONFIG_HW_RANDOM is not set -CONFIG_I2C=m -CONFIG_I2C_CHARDEV=m -CONFIG_SENSORS_ADM1021=m -CONFIG_SENSORS_ADM1025=m -CONFIG_SENSORS_ADM1031=m -CONFIG_SENSORS_DS1621=m -CONFIG_SENSORS_GL518SM=m -CONFIG_SENSORS_IT87=m -CONFIG_SENSORS_LM75=m -CONFIG_SENSORS_LM77=m -CONFIG_SENSORS_LM78=m -CONFIG_SENSORS_LM80=m -CONFIG_SENSORS_LM83=m -CONFIG_SENSORS_LM85=m -CONFIG_SENSORS_LM90=m -CONFIG_SENSORS_MAX1619=m -CONFIG_SENSORS_SMSC47M1=m -CONFIG_SENSORS_W83781D=m -CONFIG_SENSORS_W83L785TS=m -CONFIG_SENSORS_W83627HF=m -CONFIG_EXT2_FS=y -CONFIG_EXT2_FS_XATTR=y -CONFIG_EXT2_FS_POSIX_ACL=y -CONFIG_EXT2_FS_SECURITY=y -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_POSIX_ACL=y -CONFIG_EXT3_FS_SECURITY=y -CONFIG_ISO9660_FS=y -CONFIG_JOLIET=y -CONFIG_UDF_FS=m -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -CONFIG_CONFIGFS_FS=m -CONFIG_ROMFS_FS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_NFSD=m -CONFIG_NFSD_V3=y -CONFIG_NLS_DEFAULT="cp437" -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_CODEPAGE_932=y -CONFIG_NLS_ISO8859_1=y -CONFIG_CRYPTO_NULL=m -CONFIG_CRYPTO_ECB=m -CONFIG_CRYPTO_PCBC=m -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_MD4=m -CONFIG_CRYPTO_MD5=m -CONFIG_CRYPTO_SHA1=m -CONFIG_CRYPTO_SHA256=m -CONFIG_CRYPTO_SHA512=m -CONFIG_CRYPTO_WP512=m -CONFIG_CRYPTO_BLOWFISH=m -CONFIG_CRYPTO_DES=m -CONFIG_CRYPTO_SERPENT=m -CONFIG_CRYPTO_TWOFISH=m -CONFIG_CRC_CCITT=m -CONFIG_CRC16=m -CONFIG_LIBCRC32C=m diff --git a/arch/m32r/configs/m32700ut.smp_defconfig b/arch/m32r/configs/m32700ut.smp_defconfig deleted file mode 100644 index 41a0495b65df..000000000000 --- a/arch/m32r/configs/m32700ut.smp_defconfig +++ /dev/null @@ -1,85 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=15 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_PROFILING=y -CONFIG_OPROFILE=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PLAT_M32700UT=y -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x01000000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00080000 -CONFIG_PREEMPT=y -CONFIG_SMP=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -CONFIG_MTD=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_BLOCK=y -CONFIG_MTD_CFI=m -CONFIG_MTD_JEDECPROBE=m -CONFIG_MTD_CFI_ADV_OPTIONS=y -CONFIG_MTD_CFI_BE_BYTE_SWAP=y -CONFIG_MTD_CFI_GEOMETRY=y -# CONFIG_MTD_CFI_I2 is not set -CONFIG_MTD_CFI_AMDSTD=m -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=y -CONFIG_BLK_DEV_RAM=y -CONFIG_ATA_OVER_ETH=m -CONFIG_IDE=y -CONFIG_BLK_DEV_IDECD=m -CONFIG_IDE_GENERIC=y -CONFIG_SCSI=m -CONFIG_BLK_DEV_SD=m -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_SCSI_MULTI_LUN=y -CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y -CONFIG_SMC91X=y -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_SERIAL_M32R_PLDSIO=y -CONFIG_HW_RANDOM=y -CONFIG_DS1302=y -CONFIG_FB=y -CONFIG_FIRMWARE_EDID=y -CONFIG_FB_S1D13XXX=y -# CONFIG_VGA_CONSOLE is not set -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_LOGO=y -CONFIG_MMC=y -CONFIG_MMC_DEBUG=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_REISERFS_FS=m -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -CONFIG_UDF_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/m32700ut.up_defconfig b/arch/m32r/configs/m32700ut.up_defconfig deleted file mode 100644 index 20078a866f45..000000000000 --- a/arch/m32r/configs/m32700ut.up_defconfig +++ /dev/null @@ -1,84 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_PROFILING=y -CONFIG_OPROFILE=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PLAT_M32700UT=y -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x01000000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00080000 -CONFIG_PREEMPT=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -CONFIG_MTD=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_BLOCK=y -CONFIG_MTD_CFI=m -CONFIG_MTD_JEDECPROBE=m -CONFIG_MTD_CFI_ADV_OPTIONS=y -CONFIG_MTD_CFI_BE_BYTE_SWAP=y -CONFIG_MTD_CFI_GEOMETRY=y -# CONFIG_MTD_CFI_I2 is not set -CONFIG_MTD_CFI_AMDSTD=m -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=y -CONFIG_BLK_DEV_RAM=y -CONFIG_ATA_OVER_ETH=m -CONFIG_IDE=y -CONFIG_BLK_DEV_IDECD=m -CONFIG_IDE_GENERIC=y -CONFIG_SCSI=m -CONFIG_BLK_DEV_SD=m -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_SCSI_MULTI_LUN=y -CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y -CONFIG_SMC91X=y -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_SERIAL_M32R_PLDSIO=y -CONFIG_HW_RANDOM=y -CONFIG_DS1302=y -CONFIG_FB=y -CONFIG_FIRMWARE_EDID=y -CONFIG_FB_S1D13XXX=y -# CONFIG_VGA_CONSOLE is not set -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_LOGO=y -CONFIG_MMC=y -CONFIG_MMC_DEBUG=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_REISERFS_FS=m -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -CONFIG_UDF_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/mappi.nommu_defconfig b/arch/m32r/configs/mappi.nommu_defconfig deleted file mode 100644 index 4bf3820e054a..000000000000 --- a/arch/m32r/configs/mappi.nommu_defconfig +++ /dev/null @@ -1,46 +0,0 @@ -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_IKCONFIG=y -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_MMU is not set -CONFIG_BUS_CLOCK=50000000 -CONFIG_MEMORY_START=0x00000000 -CONFIG_MEMORY_SIZE=0x00E00000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00080000 -CONFIG_PREEMPT=y -CONFIG_PCCARD=y -CONFIG_M32R_PCC=y -CONFIG_BINFMT_FLAT=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=y -CONFIG_BLK_DEV_RAM=y -CONFIG_NETDEVICES=y -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -# CONFIG_VT is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/mappi.smp_defconfig b/arch/m32r/configs/mappi.smp_defconfig deleted file mode 100644 index f9ed7bdbf4de..000000000000 --- a/arch/m32r/configs/mappi.smp_defconfig +++ /dev/null @@ -1,62 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=15 -CONFIG_BLK_DEV_INITRD=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_BUS_CLOCK=10000000 -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x04000000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00080000 -CONFIG_PREEMPT=y -CONFIG_SMP=y -CONFIG_CHIP_M32700_TS1=y -CONFIG_PCCARD=y -CONFIG_M32R_PCC=y -CONFIG_NET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -# CONFIG_STANDALONE is not set -CONFIG_MTD=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_BLOCK=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=m -CONFIG_BLK_DEV_RAM=y -CONFIG_IDE=m -CONFIG_BLK_DEV_IDECS=m -CONFIG_BLK_DEV_IDECD=m -CONFIG_IDE_GENERIC=m -CONFIG_NETDEVICES=y -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -# CONFIG_SERIO_SERPORT is not set -# CONFIG_VT is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_ISO9660_FS=y -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_JFFS2_FS=y -CONFIG_ROMFS_FS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/mappi.up_defconfig b/arch/m32r/configs/mappi.up_defconfig deleted file mode 100644 index 289ae7421e12..000000000000 --- a/arch/m32r/configs/mappi.up_defconfig +++ /dev/null @@ -1,60 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=14 -CONFIG_BLK_DEV_INITRD=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_BUS_CLOCK=10000000 -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x04000000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00080000 -CONFIG_PREEMPT=y -CONFIG_PCCARD=y -CONFIG_M32R_PCC=y -CONFIG_NET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -# CONFIG_STANDALONE is not set -CONFIG_MTD=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_BLOCK=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=m -CONFIG_BLK_DEV_RAM=y -CONFIG_IDE=m -CONFIG_BLK_DEV_IDECS=m -CONFIG_BLK_DEV_IDECD=m -CONFIG_IDE_GENERIC=m -CONFIG_NETDEVICES=y -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -# CONFIG_SERIO_SERPORT is not set -# CONFIG_VT is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_ISO9660_FS=y -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_JFFS2_FS=y -CONFIG_ROMFS_FS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/mappi2.opsp_defconfig b/arch/m32r/configs/mappi2.opsp_defconfig deleted file mode 100644 index 2852f6e7e246..000000000000 --- a/arch/m32r/configs/mappi2.opsp_defconfig +++ /dev/null @@ -1,65 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_IKCONFIG=y -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PLAT_MAPPI2=y -CONFIG_CHIP_OPSP=y -CONFIG_TLB_ENTRIES=16 -CONFIG_BUS_CLOCK=50000000 -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x01000000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00008000 -CONFIG_PREEMPT=y -CONFIG_PCCARD=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=y -CONFIG_BLK_DEV_RAM=y -CONFIG_IDE=y -CONFIG_BLK_DEV_IDECS=y -CONFIG_BLK_DEV_IDECD=m -CONFIG_IDE_GENERIC=y -CONFIG_SCSI=m -CONFIG_BLK_DEV_SD=m -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_SCSI_MULTI_LUN=y -CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y -CONFIG_SMC91X=y -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_HW_RANDOM=y -# CONFIG_VGA_CONSOLE is not set -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -CONFIG_UDF_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/mappi2.vdec2_defconfig b/arch/m32r/configs/mappi2.vdec2_defconfig deleted file mode 100644 index 8da4dbad8510..000000000000 --- a/arch/m32r/configs/mappi2.vdec2_defconfig +++ /dev/null @@ -1,64 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_IKCONFIG=y -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PLAT_MAPPI2=y -CONFIG_CHIP_VDEC2=y -CONFIG_BUS_CLOCK=50000000 -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x01000000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00008000 -CONFIG_PREEMPT=y -CONFIG_PCCARD=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=y -CONFIG_BLK_DEV_RAM=y -CONFIG_IDE=y -CONFIG_BLK_DEV_IDECS=y -CONFIG_BLK_DEV_IDECD=m -CONFIG_IDE_GENERIC=y -CONFIG_SCSI=m -CONFIG_BLK_DEV_SD=m -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_SCSI_MULTI_LUN=y -CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y -CONFIG_SMC91X=y -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_HW_RANDOM=y -# CONFIG_VGA_CONSOLE is not set -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -CONFIG_UDF_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/mappi3.smp_defconfig b/arch/m32r/configs/mappi3.smp_defconfig deleted file mode 100644 index 5605b23e2faf..000000000000 --- a/arch/m32r/configs/mappi3.smp_defconfig +++ /dev/null @@ -1,62 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=15 -CONFIG_BLK_DEV_INITRD=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PLAT_MAPPI3=y -CONFIG_BUS_CLOCK=10000000 -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x08000000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00080000 -CONFIG_PREEMPT=y -CONFIG_SMP=y -CONFIG_PCCARD=y -CONFIG_NET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -CONFIG_MTD=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_BLOCK=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=m -CONFIG_BLK_DEV_RAM=y -CONFIG_IDE=y -CONFIG_BLK_DEV_IDECS=m -CONFIG_BLK_DEV_IDECD=m -CONFIG_IDE_GENERIC=y -CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y -CONFIG_SMC91X=y -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -# CONFIG_SERIO_SERPORT is not set -# CONFIG_VT is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_ISO9660_FS=y -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_JFFS2_FS=y -CONFIG_ROMFS_FS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/oaks32r_defconfig b/arch/m32r/configs/oaks32r_defconfig deleted file mode 100644 index 5ccab127f6ad..000000000000 --- a/arch/m32r/configs/oaks32r_defconfig +++ /dev/null @@ -1,43 +0,0 @@ -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PLAT_OAKS32R=y -CONFIG_CHIP_M32102=y -CONFIG_MEMORY_START=0x01000000 -CONFIG_MEMORY_SIZE=0x00800000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00010000 -CONFIG_PREEMPT=y -CONFIG_BINFMT_FLAT=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -# CONFIG_FW_LOADER is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=y -CONFIG_BLK_DEV_RAM=y -CONFIG_NETDEVICES=y -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -# CONFIG_VT is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_EXT2_FS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y diff --git a/arch/m32r/configs/opsput_defconfig b/arch/m32r/configs/opsput_defconfig deleted file mode 100644 index 3ce1d08355e5..000000000000 --- a/arch/m32r/configs/opsput_defconfig +++ /dev/null @@ -1,63 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_IKCONFIG=y -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -# CONFIG_KALLSYMS is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PLAT_OPSPUT=y -CONFIG_CHIP_OPSP=y -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x01000000 -CONFIG_IRAM_START=0x00f00000 -CONFIG_IRAM_SIZE=0x00010000 -CONFIG_PCCARD=y -CONFIG_M32R_CFC=y -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IPV6 is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_RAM=y -CONFIG_SCSI=m -CONFIG_BLK_DEV_SD=m -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_SCSI_MULTI_LUN=y -CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y -CONFIG_SMC91X=y -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO_I8042 is not set -# CONFIG_VT is not set -CONFIG_SERIAL_M32R_SIO_CONSOLE=y -CONFIG_SERIAL_M32R_PLDSIO=y -CONFIG_HW_RANDOM=y -CONFIG_DS1302=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -CONFIG_UDF_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_NLS=y -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_BUGVERBOSE is not set -CONFIG_DEBUG_INFO=y diff --git a/arch/m32r/configs/usrv_defconfig b/arch/m32r/configs/usrv_defconfig deleted file mode 100644 index cb8c051c3d46..000000000000 --- a/arch/m32r/configs/usrv_defconfig +++ /dev/null @@ -1,78 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_POSIX_MQUEUE=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_LOG_BUF_SHIFT=15 -CONFIG_BLK_DEV_INITRD=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y -CONFIG_KALLSYMS_EXTRA_PASS=y -CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_IOSCHED_DEADLINE is not set -# CONFIG_IOSCHED_CFQ is not set -CONFIG_PLAT_USRV=y -CONFIG_BUS_CLOCK=50000000 -CONFIG_MEMORY_START=0x08000000 -CONFIG_MEMORY_SIZE=0x02000000 -# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set -CONFIG_SMP=y -CONFIG_PCCARD=y -CONFIG_M32R_CFC=y -CONFIG_M32R_CFC_NUM=2 -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_XFRM_USER=y -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_PNP=y -CONFIG_INET_AH=y -CONFIG_INET_ESP=y -CONFIG_INET_IPCOMP=y -# CONFIG_IPV6 is not set -CONFIG_MTD=y -CONFIG_MTD_BLOCK=y -CONFIG_MTD_CFI=y -CONFIG_MTD_CFI_ADV_OPTIONS=y -CONFIG_MTD_CFI_BE_BYTE_SWAP=y -CONFIG_MTD_CFI_GEOMETRY=y -# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set -# CONFIG_MTD_CFI_I2 is not set -CONFIG_MTD_CFI_AMDSTD=y -CONFIG_MTD_RAM=y -CONFIG_MTD_ROM=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_RAM=y -CONFIG_IDE=y -CONFIG_BLK_DEV_IDECS=y -CONFIG_NETDEVICES=y -CONFIG_NET_PCMCIA=y -CONFIG_PCMCIA_PCNET=y -# CONFIG_INPUT is not set -# CONFIG_SERIO is not set -# CONFIG_VT is not set -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_M32R_SIO is not set -# CONFIG_HWMON is not set -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -# CONFIG_EXT3_FS_XATTR is not set -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_JFFS2_FS=y -CONFIG_CRAMFS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -CONFIG_ROOT_NFS=y -CONFIG_DEBUG_KERNEL=y -CONFIG_DEBUG_INFO=y -CONFIG_FRAME_POINTER=y -CONFIG_CRYPTO_ECB=y -CONFIG_CRYPTO_PCBC=m -CONFIG_CRYPTO_MICHAEL_MIC=y -CONFIG_CRYPTO_AES=y -CONFIG_CRYPTO_ARC4=y diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild deleted file mode 100644 index 985ef1d9f556..000000000000 --- a/arch/m32r/include/asm/Kbuild +++ /dev/null @@ -1,13 +0,0 @@ -generic-y += current.h -generic-y += dma-mapping.h -generic-y += exec.h -generic-y += extable.h -generic-y += irq_work.h -generic-y += kprobes.h -generic-y += mcs_spinlock.h -generic-y += mm-arch-hooks.h -generic-y += module.h -generic-y += preempt.h -generic-y += sections.h -generic-y += trace_clock.h -generic-y += word-at-a-time.h diff --git a/arch/m32r/include/asm/addrspace.h b/arch/m32r/include/asm/addrspace.h deleted file mode 100644 index 81782c122da4..000000000000 --- a/arch/m32r/include/asm/addrspace.h +++ /dev/null @@ -1,57 +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. - * - * Copyright (C) 2001 by Hiroyuki Kondo - * - * Defitions for the address spaces of the M32R CPUs. - */ -#ifndef __ASM_M32R_ADDRSPACE_H -#define __ASM_M32R_ADDRSPACE_H - -/* - * Memory segments (32bit kernel mode addresses) - */ -#define KUSEG 0x00000000 -#define KSEG0 0x80000000 -#define KSEG1 0xa0000000 -#define KSEG2 0xc0000000 -#define KSEG3 0xe0000000 - -#define K0BASE KSEG0 - -/* - * Returns the kernel segment base of a given address - */ -#ifndef __ASSEMBLY__ -#define KSEGX(a) (((unsigned long)(a)) & 0xe0000000) -#else -#define KSEGX(a) ((a) & 0xe0000000) -#endif - -/* - * Returns the physical address of a KSEG0/KSEG1 address - */ -#ifndef __ASSEMBLY__ -#define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff) -#else -#define PHYSADDR(a) ((a) & 0x1fffffff) -#endif - -/* - * Map an address to a certain kernel segment - */ -#ifndef __ASSEMBLY__ -#define KSEG0ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG0)) -#define KSEG1ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG1)) -#define KSEG2ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG2)) -#define KSEG3ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG3)) -#else -#define KSEG0ADDR(a) (((a) & 0x1fffffff) | KSEG0) -#define KSEG1ADDR(a) (((a) & 0x1fffffff) | KSEG1) -#define KSEG2ADDR(a) (((a) & 0x1fffffff) | KSEG2) -#define KSEG3ADDR(a) (((a) & 0x1fffffff) | KSEG3) -#endif - -#endif /* __ASM_M32R_ADDRSPACE_H */ diff --git a/arch/m32r/include/asm/asm-offsets.h b/arch/m32r/include/asm/asm-offsets.h deleted file mode 100644 index d370ee36a182..000000000000 --- a/arch/m32r/include/asm/asm-offsets.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/m32r/include/asm/assembler.h b/arch/m32r/include/asm/assembler.h deleted file mode 100644 index ed90d894f285..000000000000 --- a/arch/m32r/include/asm/assembler.h +++ /dev/null @@ -1,231 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_ASSEMBLER_H -#define _ASM_M32R_ASSEMBLER_H - -/* - * linux/asm-m32r/assembler.h - * - * Copyright (C) 2004 Hirokazu Takata - * - * This file contains M32R architecture specific macro definitions. - */ - -#include - -#undef __STR - -#ifdef __ASSEMBLY__ -#define __STR(x) x -#else -#define __STR(x) __stringify(x) -#endif - -#ifdef CONFIG_SMP -#define M32R_LOCK __STR(lock) -#define M32R_UNLOCK __STR(unlock) -#else -#define M32R_LOCK __STR(ld) -#define M32R_UNLOCK __STR(st) -#endif - -#ifdef __ASSEMBLY__ -#undef ENTRY -#define ENTRY(name) ENTRY_M name - .macro ENTRY_M name - .global \name - ALIGN -\name: - .endm -#endif - - -/** - * LDIMM - load immediate value - * STI - enable interruption - * CLI - disable interruption - */ - -#ifdef __ASSEMBLY__ - -#define LDIMM(reg,x) LDIMM reg x - .macro LDIMM reg x - seth \reg, #high(\x) - or3 \reg, \reg, #low(\x) - .endm - -#if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104)) -#define ENABLE_INTERRUPTS(reg) ENABLE_INTERRUPTS reg - .macro ENABLE_INTERRUPTS reg - setpsw #0x40 -> nop - ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1). - .endm - -#define DISABLE_INTERRUPTS(reg) DISABLE_INTERRUPTS reg - .macro DISABLE_INTERRUPTS reg - clrpsw #0x40 -> nop - ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1). - .endm -#else /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */ -#define ENABLE_INTERRUPTS(reg) ENABLE_INTERRUPTS reg - .macro ENABLE_INTERRUPTS reg - mvfc \reg, psw - or3 \reg, \reg, #0x0040 - mvtc \reg, psw - .endm - -#define DISABLE_INTERRUPTS(reg) DISABLE_INTERRUPTS reg - .macro DISABLE_INTERRUPTS reg - mvfc \reg, psw - and3 \reg, \reg, #0xffbf - mvtc \reg, psw - .endm -#endif /* CONFIG_CHIP_M32102 */ - - .macro SAVE_ALL - push r0 ; orig_r0 - push sp ; spi (r15) - push lr ; r14 - push r13 - mvfc r13, cr3 ; spu - push r13 - mvfc r13, bbpc - push r13 - mvfc r13, bbpsw - push r13 - mvfc r13, bpc - push r13 - mvfc r13, psw - push r13 -#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) - mvfaclo r13, a1 - push r13 - mvfachi r13, a1 - push r13 - mvfaclo r13, a0 - push r13 - mvfachi r13, a0 - push r13 -#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) - mvfaclo r13 - push r13 - mvfachi r13 - push r13 - ldi r13, #0 - push r13 ; dummy push acc1h - push r13 ; dummy push acc1l -#else -#error unknown isa configuration -#endif - ldi r13, #-1 - push r13 ; syscall_nr (default: -1) - push r12 - push r11 - push r10 - push r9 - push r8 - push r7 - push r3 - push r2 - push r1 - push r0 - addi sp, #-4 ; room for implicit pt_regs parameter - push r6 - push r5 - push r4 - .endm - - .macro RESTORE_ALL - pop r4 - pop r5 - pop r6 - addi sp, #4 - pop r0 - pop r1 - pop r2 - pop r3 - pop r7 - pop r8 - pop r9 - pop r10 - pop r11 - pop r12 - addi r15, #4 ; Skip syscall number -#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) - pop r13 - mvtachi r13, a0 - pop r13 - mvtaclo r13, a0 - pop r13 - mvtachi r13, a1 - pop r13 - mvtaclo r13, a1 -#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) - pop r13 ; dummy pop acc1h - pop r13 ; dummy pop acc1l - pop r13 - mvtachi r13 - pop r13 - mvtaclo r13 -#else -#error unknown isa configuration -#endif - pop r14 - mvtc r14, psw - pop r14 - mvtc r14, bpc - addi sp, #8 ; Skip bbpsw, bbpc - pop r14 - mvtc r14, cr3 ; spu - pop r13 - pop lr ; r14 - pop sp ; spi (r15) - addi sp, #4 ; Skip orig_r0 - .fillinsn -1: rte - .section .fixup,"ax" -2: bl do_exit - .previous - .section __ex_table,"a" - ALIGN - .long 1b, 2b - .previous - .endm - -#define GET_CURRENT(reg) get_current reg - .macro get_current reg - ldi \reg, #-8192 - and \reg, sp - .endm - -#if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104)) - .macro SWITCH_TO_KERNEL_STACK - ; switch to kernel stack (spi) - clrpsw #0x80 -> nop - .endm -#else /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */ - .macro SWITCH_TO_KERNEL_STACK - push r0 ; save r0 for working - mvfc r0, psw - and3 r0, r0, #0x00ff7f - mvtc r0, psw - slli r0, #16 - bltz r0, 1f ; check BSM-bit -; - ;; called from kernel context: previous stack = spi - pop r0 ; retrieve r0 - bra 2f - .fillinsn -1: - ;; called from user context: previous stack = spu - mvfc r0, cr3 ; spu - addi r0, #4 - mvtc r0, cr3 ; spu - ld r0, @(-4,r0) ; retrieve r0 - .fillinsn -2: - .endm -#endif /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */ - -#endif /* __ASSEMBLY__ */ - -#endif /* _ASM_M32R_ASSEMBLER_H */ diff --git a/arch/m32r/include/asm/atomic.h b/arch/m32r/include/asm/atomic.h deleted file mode 100644 index 8bf67e55ff54..000000000000 --- a/arch/m32r/include/asm/atomic.h +++ /dev/null @@ -1,275 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_ATOMIC_H -#define _ASM_M32R_ATOMIC_H - -/* - * linux/include/asm-m32r/atomic.h - * - * M32R version: - * Copyright (C) 2001, 2002 Hitoshi Yamamoto - * Copyright (C) 2004 Hirokazu Takata - */ - -#include -#include -#include -#include -#include - -/* - * Atomic operations that C can't guarantee us. Useful for - * resource counting etc.. - */ - -#define ATOMIC_INIT(i) { (i) } - -/** - * atomic_read - read atomic variable - * @v: pointer of type atomic_t - * - * Atomically reads the value of @v. - */ -#define atomic_read(v) READ_ONCE((v)->counter) - -/** - * atomic_set - set atomic variable - * @v: pointer of type atomic_t - * @i: required value - * - * Atomically sets the value of @v to @i. - */ -#define atomic_set(v,i) WRITE_ONCE(((v)->counter), (i)) - -#ifdef CONFIG_CHIP_M32700_TS1 -#define __ATOMIC_CLOBBER , "r4" -#else -#define __ATOMIC_CLOBBER -#endif - -#define ATOMIC_OP(op) \ -static __inline__ void atomic_##op(int i, atomic_t *v) \ -{ \ - unsigned long flags; \ - int result; \ - \ - local_irq_save(flags); \ - __asm__ __volatile__ ( \ - "# atomic_" #op " \n\t" \ - DCACHE_CLEAR("%0", "r4", "%1") \ - M32R_LOCK" %0, @%1; \n\t" \ - #op " %0, %2; \n\t" \ - M32R_UNLOCK" %0, @%1; \n\t" \ - : "=&r" (result) \ - : "r" (&v->counter), "r" (i) \ - : "memory" \ - __ATOMIC_CLOBBER \ - ); \ - local_irq_restore(flags); \ -} \ - -#define ATOMIC_OP_RETURN(op) \ -static __inline__ int atomic_##op##_return(int i, atomic_t *v) \ -{ \ - unsigned long flags; \ - int result; \ - \ - local_irq_save(flags); \ - __asm__ __volatile__ ( \ - "# atomic_" #op "_return \n\t" \ - DCACHE_CLEAR("%0", "r4", "%1") \ - M32R_LOCK" %0, @%1; \n\t" \ - #op " %0, %2; \n\t" \ - M32R_UNLOCK" %0, @%1; \n\t" \ - : "=&r" (result) \ - : "r" (&v->counter), "r" (i) \ - : "memory" \ - __ATOMIC_CLOBBER \ - ); \ - local_irq_restore(flags); \ - \ - return result; \ -} - -#define ATOMIC_FETCH_OP(op) \ -static __inline__ int atomic_fetch_##op(int i, atomic_t *v) \ -{ \ - unsigned long flags; \ - int result, val; \ - \ - local_irq_save(flags); \ - __asm__ __volatile__ ( \ - "# atomic_fetch_" #op " \n\t" \ - DCACHE_CLEAR("%0", "r4", "%2") \ - M32R_LOCK" %1, @%2; \n\t" \ - "mv %0, %1 \n\t" \ - #op " %1, %3; \n\t" \ - M32R_UNLOCK" %1, @%2; \n\t" \ - : "=&r" (result), "=&r" (val) \ - : "r" (&v->counter), "r" (i) \ - : "memory" \ - __ATOMIC_CLOBBER \ - ); \ - local_irq_restore(flags); \ - \ - return result; \ -} - -#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op) - -ATOMIC_OPS(add) -ATOMIC_OPS(sub) - -#undef ATOMIC_OPS -#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op) - -ATOMIC_OPS(and) -ATOMIC_OPS(or) -ATOMIC_OPS(xor) - -#undef ATOMIC_OPS -#undef ATOMIC_FETCH_OP -#undef ATOMIC_OP_RETURN -#undef ATOMIC_OP - -/** - * atomic_sub_and_test - subtract value from variable and test result - * @i: integer value to subtract - * @v: pointer of type atomic_t - * - * Atomically subtracts @i from @v and returns - * true if the result is zero, or false for all - * other cases. - */ -#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) - -/** - * atomic_inc_return - increment atomic variable and return it - * @v: pointer of type atomic_t - * - * Atomically increments @v by 1 and returns the result. - */ -static __inline__ int atomic_inc_return(atomic_t *v) -{ - unsigned long flags; - int result; - - local_irq_save(flags); - __asm__ __volatile__ ( - "# atomic_inc_return \n\t" - DCACHE_CLEAR("%0", "r4", "%1") - M32R_LOCK" %0, @%1; \n\t" - "addi %0, #1; \n\t" - M32R_UNLOCK" %0, @%1; \n\t" - : "=&r" (result) - : "r" (&v->counter) - : "memory" - __ATOMIC_CLOBBER - ); - local_irq_restore(flags); - - return result; -} - -/** - * atomic_dec_return - decrement atomic variable and return it - * @v: pointer of type atomic_t - * - * Atomically decrements @v by 1 and returns the result. - */ -static __inline__ int atomic_dec_return(atomic_t *v) -{ - unsigned long flags; - int result; - - local_irq_save(flags); - __asm__ __volatile__ ( - "# atomic_dec_return \n\t" - DCACHE_CLEAR("%0", "r4", "%1") - M32R_LOCK" %0, @%1; \n\t" - "addi %0, #-1; \n\t" - M32R_UNLOCK" %0, @%1; \n\t" - : "=&r" (result) - : "r" (&v->counter) - : "memory" - __ATOMIC_CLOBBER - ); - local_irq_restore(flags); - - return result; -} - -/** - * atomic_inc - increment atomic variable - * @v: pointer of type atomic_t - * - * Atomically increments @v by 1. - */ -#define atomic_inc(v) ((void)atomic_inc_return(v)) - -/** - * atomic_dec - decrement atomic variable - * @v: pointer of type atomic_t - * - * Atomically decrements @v by 1. - */ -#define atomic_dec(v) ((void)atomic_dec_return(v)) - -/** - * atomic_inc_and_test - increment and test - * @v: pointer of type atomic_t - * - * Atomically increments @v by 1 - * and returns true if the result is zero, or false for all - * other cases. - */ -#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) - -/** - * atomic_dec_and_test - decrement and test - * @v: pointer of type atomic_t - * - * Atomically decrements @v by 1 and - * returns true if the result is 0, or false for all - * other cases. - */ -#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) - -/** - * atomic_add_negative - add and test if negative - * @v: pointer of type atomic_t - * @i: integer value to add - * - * Atomically adds @i to @v and returns true - * if the result is negative, or false when - * result is greater than or equal to zero. - */ -#define atomic_add_negative(i,v) (atomic_add_return((i), (v)) < 0) - -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) -#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) - -/** - * __atomic_add_unless - add unless the number is a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as it was not @u. - * Returns the old value of @v. - */ -static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) -{ - int c, old; - c = atomic_read(v); - for (;;) { - if (unlikely(c == (u))) - break; - old = atomic_cmpxchg((v), c, c + (a)); - if (likely(old == c)) - break; - c = old; - } - return c; -} - -#endif /* _ASM_M32R_ATOMIC_H */ diff --git a/arch/m32r/include/asm/barrier.h b/arch/m32r/include/asm/barrier.h deleted file mode 100644 index 1a40265e8d88..000000000000 --- a/arch/m32r/include/asm/barrier.h +++ /dev/null @@ -1,16 +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. - * - * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto - * Copyright (C) 2004, 2006 Hirokazu Takata - */ -#ifndef _ASM_M32R_BARRIER_H -#define _ASM_M32R_BARRIER_H - -#define nop() __asm__ __volatile__ ("nop" : : ) - -#include - -#endif /* _ASM_M32R_BARRIER_H */ diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h deleted file mode 100644 index 64e70e57c154..000000000000 --- a/arch/m32r/include/asm/bitops.h +++ /dev/null @@ -1,274 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_BITOPS_H -#define _ASM_M32R_BITOPS_H - -/* - * linux/include/asm-m32r/bitops.h - * - * Copyright 1992, Linus Torvalds. - * - * M32R version: - * Copyright (C) 2001, 2002 Hitoshi Yamamoto - * Copyright (C) 2004 Hirokazu Takata - */ - -#ifndef _LINUX_BITOPS_H -#error only can be included directly -#endif - -#include -#include -#include -#include -#include -#include -#include - -/* - * These have to be done with inline assembly: that way the bit-setting - * is guaranteed to be atomic. All bit operations return 0 if the bit - * was cleared before the operation and != 0 if it was not. - * - * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). - */ - -/** - * set_bit - Atomically set a bit in memory - * @nr: the bit to set - * @addr: the address to start counting from - * - * This function is atomic and may not be reordered. See __set_bit() - * if you do not require the atomic guarantees. - * Note that @nr may be almost arbitrarily large; this function is not - * restricted to acting on a single-word quantity. - */ -static __inline__ void set_bit(int nr, volatile void * addr) -{ - __u32 mask; - volatile __u32 *a = addr; - unsigned long flags; - unsigned long tmp; - - a += (nr >> 5); - mask = (1 << (nr & 0x1F)); - - local_irq_save(flags); - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r6", "%1") - M32R_LOCK" %0, @%1; \n\t" - "or %0, %2; \n\t" - M32R_UNLOCK" %0, @%1; \n\t" - : "=&r" (tmp) - : "r" (a), "r" (mask) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r6" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); -} - -/** - * clear_bit - Clears a bit in memory - * @nr: Bit to clear - * @addr: Address to start counting from - * - * clear_bit() is atomic and may not be reordered. However, it does - * not contain a memory barrier, so if it is used for locking purposes, - * you should call smp_mb__before_atomic() and/or smp_mb__after_atomic() - * in order to ensure changes are visible on other processors. - */ -static __inline__ void clear_bit(int nr, volatile void * addr) -{ - __u32 mask; - volatile __u32 *a = addr; - unsigned long flags; - unsigned long tmp; - - a += (nr >> 5); - mask = (1 << (nr & 0x1F)); - - local_irq_save(flags); - - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r6", "%1") - M32R_LOCK" %0, @%1; \n\t" - "and %0, %2; \n\t" - M32R_UNLOCK" %0, @%1; \n\t" - : "=&r" (tmp) - : "r" (a), "r" (~mask) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r6" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); -} - -/** - * change_bit - Toggle a bit in memory - * @nr: Bit to clear - * @addr: Address to start counting from - * - * change_bit() is atomic and may not be reordered. - * Note that @nr may be almost arbitrarily large; this function is not - * restricted to acting on a single-word quantity. - */ -static __inline__ void change_bit(int nr, volatile void * addr) -{ - __u32 mask; - volatile __u32 *a = addr; - unsigned long flags; - unsigned long tmp; - - a += (nr >> 5); - mask = (1 << (nr & 0x1F)); - - local_irq_save(flags); - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r6", "%1") - M32R_LOCK" %0, @%1; \n\t" - "xor %0, %2; \n\t" - M32R_UNLOCK" %0, @%1; \n\t" - : "=&r" (tmp) - : "r" (a), "r" (mask) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r6" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); -} - -/** - * test_and_set_bit - Set a bit and return its old value - * @nr: Bit to set - * @addr: Address to count from - * - * This operation is atomic and cannot be reordered. - * It also implies a memory barrier. - */ -static __inline__ int test_and_set_bit(int nr, volatile void * addr) -{ - __u32 mask, oldbit; - volatile __u32 *a = addr; - unsigned long flags; - unsigned long tmp; - - a += (nr >> 5); - mask = (1 << (nr & 0x1F)); - - local_irq_save(flags); - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "%1", "%2") - M32R_LOCK" %0, @%2; \n\t" - "mv %1, %0; \n\t" - "and %0, %3; \n\t" - "or %1, %3; \n\t" - M32R_UNLOCK" %1, @%2; \n\t" - : "=&r" (oldbit), "=&r" (tmp) - : "r" (a), "r" (mask) - : "memory" - ); - local_irq_restore(flags); - - return (oldbit != 0); -} - -/** - * test_and_clear_bit - Clear a bit and return its old value - * @nr: Bit to set - * @addr: Address to count from - * - * This operation is atomic and cannot be reordered. - * It also implies a memory barrier. - */ -static __inline__ int test_and_clear_bit(int nr, volatile void * addr) -{ - __u32 mask, oldbit; - volatile __u32 *a = addr; - unsigned long flags; - unsigned long tmp; - - a += (nr >> 5); - mask = (1 << (nr & 0x1F)); - - local_irq_save(flags); - - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "%1", "%3") - M32R_LOCK" %0, @%3; \n\t" - "mv %1, %0; \n\t" - "and %0, %2; \n\t" - "not %2, %2; \n\t" - "and %1, %2; \n\t" - M32R_UNLOCK" %1, @%3; \n\t" - : "=&r" (oldbit), "=&r" (tmp), "+r" (mask) - : "r" (a) - : "memory" - ); - local_irq_restore(flags); - - return (oldbit != 0); -} - -/** - * test_and_change_bit - Change a bit and return its old value - * @nr: Bit to set - * @addr: Address to count from - * - * This operation is atomic and cannot be reordered. - * It also implies a memory barrier. - */ -static __inline__ int test_and_change_bit(int nr, volatile void * addr) -{ - __u32 mask, oldbit; - volatile __u32 *a = addr; - unsigned long flags; - unsigned long tmp; - - a += (nr >> 5); - mask = (1 << (nr & 0x1F)); - - local_irq_save(flags); - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "%1", "%2") - M32R_LOCK" %0, @%2; \n\t" - "mv %1, %0; \n\t" - "and %0, %3; \n\t" - "xor %1, %3; \n\t" - M32R_UNLOCK" %1, @%2; \n\t" - : "=&r" (oldbit), "=&r" (tmp) - : "r" (a), "r" (mask) - : "memory" - ); - local_irq_restore(flags); - - return (oldbit != 0); -} - -#include -#include -#include -#include -#include -#include - -#ifdef __KERNEL__ - -#include -#include -#include -#include -#include - -#endif /* __KERNEL__ */ - -#ifdef __KERNEL__ - -#include -#include - -#endif /* __KERNEL__ */ - -#endif /* _ASM_M32R_BITOPS_H */ diff --git a/arch/m32r/include/asm/bug.h b/arch/m32r/include/asm/bug.h deleted file mode 100644 index 7197688254da..000000000000 --- a/arch/m32r/include/asm/bug.h +++ /dev/null @@ -1,5 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _M32R_BUG_H -#define _M32R_BUG_H -#include -#endif diff --git a/arch/m32r/include/asm/bugs.h b/arch/m32r/include/asm/bugs.h deleted file mode 100644 index 74a6d428aebe..000000000000 --- a/arch/m32r/include/asm/bugs.h +++ /dev/null @@ -1,20 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_BUGS_H -#define _ASM_M32R_BUGS_H - -/* - * This is included by init/main.c to check for architecture-dependent bugs. - * - * Needs: - * void check_bugs(void); - */ -#include - -static void __init check_bugs(void) -{ - extern unsigned long loops_per_jiffy; - - current_cpu_data.loops_per_jiffy = loops_per_jiffy; -} - -#endif /* _ASM_M32R_BUGS_H */ diff --git a/arch/m32r/include/asm/cache.h b/arch/m32r/include/asm/cache.h deleted file mode 100644 index 47a766a258f8..000000000000 --- a/arch/m32r/include/asm/cache.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_CACHE_H -#define _ASM_M32R_CACHE_H - -/* L1 cache line size */ -#define L1_CACHE_SHIFT 4 -#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) - -#endif /* _ASM_M32R_CACHE_H */ diff --git a/arch/m32r/include/asm/cachectl.h b/arch/m32r/include/asm/cachectl.h deleted file mode 100644 index 12f73f6c1759..000000000000 --- a/arch/m32r/include/asm/cachectl.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * cachectl.h -- defines for M32R cache control system calls - * - * Copyright (C) 2003 by Kazuhiro Inaoka - */ -#ifndef __ASM_M32R_CACHECTL -#define __ASM_M32R_CACHECTL - -/* - * Options for cacheflush system call - * - * cacheflush() is currently fluch_cache_all(). - */ -#define ICACHE (1<<0) /* flush instruction cache */ -#define DCACHE (1<<1) /* writeback and flush data cache */ -#define BCACHE (ICACHE|DCACHE) /* flush both caches */ - -/* - * Caching modes for the cachectl(2) call - * - * cachectl(2) is currently not supported and returns ENOSYS. - */ -#define CACHEABLE 0 /* make pages cacheable */ -#define UNCACHEABLE 1 /* make pages uncacheable */ - -#endif /* __ASM_M32R_CACHECTL */ diff --git a/arch/m32r/include/asm/cacheflush.h b/arch/m32r/include/asm/cacheflush.h deleted file mode 100644 index 5ad2a3045483..000000000000 --- a/arch/m32r/include/asm/cacheflush.h +++ /dev/null @@ -1,73 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_CACHEFLUSH_H -#define _ASM_M32R_CACHEFLUSH_H - -#include - -extern void _flush_cache_all(void); -extern void _flush_cache_copyback_all(void); - -#if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) -#define flush_cache_all() do { } while (0) -#define flush_cache_mm(mm) do { } while (0) -#define flush_cache_dup_mm(mm) do { } while (0) -#define flush_cache_range(vma, start, end) do { } while (0) -#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) -#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 -#define flush_dcache_page(page) do { } while (0) -#define flush_dcache_mmap_lock(mapping) do { } while (0) -#define flush_dcache_mmap_unlock(mapping) do { } while (0) -#ifndef CONFIG_SMP -#define flush_icache_range(start, end) _flush_cache_copyback_all() -#define flush_icache_page(vma,pg) _flush_cache_copyback_all() -#define flush_icache_user_range(vma,pg,adr,len) _flush_cache_copyback_all() -#define flush_cache_sigtramp(addr) _flush_cache_copyback_all() -#else /* CONFIG_SMP */ -extern void smp_flush_cache_all(void); -#define flush_icache_range(start, end) smp_flush_cache_all() -#define flush_icache_page(vma,pg) smp_flush_cache_all() -#define flush_icache_user_range(vma,pg,adr,len) smp_flush_cache_all() -#define flush_cache_sigtramp(addr) _flush_cache_copyback_all() -#endif /* CONFIG_SMP */ -#elif defined(CONFIG_CHIP_M32102) -#define flush_cache_all() do { } while (0) -#define flush_cache_mm(mm) do { } while (0) -#define flush_cache_dup_mm(mm) do { } while (0) -#define flush_cache_range(vma, start, end) do { } while (0) -#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) -#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 -#define flush_dcache_page(page) do { } while (0) -#define flush_dcache_mmap_lock(mapping) do { } while (0) -#define flush_dcache_mmap_unlock(mapping) do { } while (0) -#define flush_icache_range(start, end) _flush_cache_all() -#define flush_icache_page(vma,pg) _flush_cache_all() -#define flush_icache_user_range(vma,pg,adr,len) _flush_cache_all() -#define flush_cache_sigtramp(addr) _flush_cache_all() -#else -#define flush_cache_all() do { } while (0) -#define flush_cache_mm(mm) do { } while (0) -#define flush_cache_dup_mm(mm) do { } while (0) -#define flush_cache_range(vma, start, end) do { } while (0) -#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) -#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 -#define flush_dcache_page(page) do { } while (0) -#define flush_dcache_mmap_lock(mapping) do { } while (0) -#define flush_dcache_mmap_unlock(mapping) do { } while (0) -#define flush_icache_range(start, end) do { } while (0) -#define flush_icache_page(vma,pg) do { } while (0) -#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -#define flush_cache_sigtramp(addr) do { } while (0) -#endif /* CONFIG_CHIP_* */ - -#define flush_cache_vmap(start, end) do { } while (0) -#define flush_cache_vunmap(start, end) do { } while (0) - -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ -do { \ - memcpy(dst, src, len); \ - flush_icache_user_range(vma, page, vaddr, len); \ -} while (0) -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ - memcpy(dst, src, len) - -#endif /* _ASM_M32R_CACHEFLUSH_H */ diff --git a/arch/m32r/include/asm/checksum.h b/arch/m32r/include/asm/checksum.h deleted file mode 100644 index d68e93c9bd62..000000000000 --- a/arch/m32r/include/asm/checksum.h +++ /dev/null @@ -1,202 +0,0 @@ -#ifdef __KERNEL__ -#ifndef _ASM_M32R_CHECKSUM_H -#define _ASM_M32R_CHECKSUM_H - -/* - * include/asm-m32r/checksum.h - * - * IP/TCP/UDP checksum routines - * - * 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. - * - * Some code taken from mips and parisc architecture. - * - * Copyright (C) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata - * Copyright (C) 2004 Hirokazu Takata - */ - -#include - -/* - * computes the checksum of a memory block at buff, length len, - * and adds in "sum" (32-bit) - * - * returns a 32-bit number suitable for feeding into itself - * or csum_tcpudp_magic - * - * this function must be called with even lengths, except - * for the last fragment, which may be odd - * - * it's best to have buff aligned on a 32-bit boundary - */ -asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); - -/* - * The same as csum_partial, but copies from src while it checksums. - * - * Here even more important to align src and dst on a 32-bit (or even - * better 64-bit) boundary - */ -extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, - int len, __wsum sum); - -/* - * This is a new version of the above that records errors it finds in *errp, - * but continues and zeros thre rest of the buffer. - */ -extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, - int len, __wsum sum, - int *err_ptr); - -/* - * Fold a partial checksum - */ - -static inline __sum16 csum_fold(__wsum sum) -{ - unsigned long tmpreg; - __asm__( - " sll3 %1, %0, #16 \n" - " cmp %0, %0 \n" - " addx %0, %1 \n" - " ldi %1, #0 \n" - " srli %0, #16 \n" - " addx %0, %1 \n" - " xor3 %0, %0, #0x0000ffff \n" - : "=r" (sum), "=&r" (tmpreg) - : "0" (sum) - : "cbit" - ); - return (__force __sum16)sum; -} - -/* - * This is a version of ip_compute_csum() optimized for IP headers, - * which always checksum on 4 octet boundaries. - */ -static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) -{ - unsigned long tmpreg0, tmpreg1; - __wsum sum; - - __asm__ __volatile__( - " ld %0, @%1+ \n" - " addi %2, #-4 \n" - "# bgez %2, 2f \n" - " cmp %0, %0 \n" - " ld %3, @%1+ \n" - " ld %4, @%1+ \n" - " addx %0, %3 \n" - " ld %3, @%1+ \n" - " addx %0, %4 \n" - " addx %0, %3 \n" - " .fillinsn\n" - "1: \n" - " ld %4, @%1+ \n" - " addi %2, #-1 \n" - " addx %0, %4 \n" - " bgtz %2, 1b \n" - "\n" - " ldi %3, #0 \n" - " addx %0, %3 \n" - " .fillinsn\n" - "2: \n" - /* Since the input registers which are loaded with iph and ihl - are modified, we must also specify them as outputs, or gcc - will assume they contain their original values. */ - : "=&r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmpreg0), "=&r" (tmpreg1) - : "1" (iph), "2" (ihl) - : "cbit", "memory"); - - return csum_fold(sum); -} - -static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, - __u32 len, __u8 proto, - __wsum sum) -{ -#if defined(__LITTLE_ENDIAN) - unsigned long len_proto = (proto + len) << 8; -#else - unsigned long len_proto = proto + len; -#endif - unsigned long tmpreg; - - __asm__( - " cmp %0, %0 \n" - " addx %0, %2 \n" - " addx %0, %3 \n" - " addx %0, %4 \n" - " ldi %1, #0 \n" - " addx %0, %1 \n" - : "=r" (sum), "=&r" (tmpreg) - : "r" (daddr), "r" (saddr), "r" (len_proto), "0" (sum) - : "cbit" - ); - - return sum; -} - -/* - * computes the checksum of the TCP/UDP pseudo-header - * returns a 16-bit checksum, already complemented - */ -static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, - __u32 len, __u8 proto, - __wsum sum) -{ - return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); -} - -/* - * this routine is used for miscellaneous IP-like checksums, mainly - * in icmp.c - */ - -static inline __sum16 ip_compute_csum(const void *buff, int len) -{ - return csum_fold (csum_partial(buff, len, 0)); -} - -#define _HAVE_ARCH_IPV6_CSUM -static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, - const struct in6_addr *daddr, - __u32 len, unsigned short proto, - __wsum sum) -{ - unsigned long tmpreg0, tmpreg1, tmpreg2, tmpreg3; - __asm__( - " ld %1, @(%5) \n" - " ld %2, @(4,%5) \n" - " ld %3, @(8,%5) \n" - " ld %4, @(12,%5) \n" - " add %0, %1 \n" - " addx %0, %2 \n" - " addx %0, %3 \n" - " addx %0, %4 \n" - " ld %1, @(%6) \n" - " ld %2, @(4,%6) \n" - " ld %3, @(8,%6) \n" - " ld %4, @(12,%6) \n" - " addx %0, %1 \n" - " addx %0, %2 \n" - " addx %0, %3 \n" - " addx %0, %4 \n" - " addx %0, %7 \n" - " addx %0, %8 \n" - " ldi %1, #0 \n" - " addx %0, %1 \n" - : "=&r" (sum), "=&r" (tmpreg0), "=&r" (tmpreg1), - "=&r" (tmpreg2), "=&r" (tmpreg3) - : "r" (saddr), "r" (daddr), - "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) - : "cbit" - ); - - return csum_fold(sum); -} - -#endif /* _ASM_M32R_CHECKSUM_H */ -#endif /* __KERNEL__ */ diff --git a/arch/m32r/include/asm/cmpxchg.h b/arch/m32r/include/asm/cmpxchg.h deleted file mode 100644 index 1ccdce5ff0ac..000000000000 --- a/arch/m32r/include/asm/cmpxchg.h +++ /dev/null @@ -1,225 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_CMPXCHG_H -#define _ASM_M32R_CMPXCHG_H - -/* - * M32R version: - * Copyright (C) 2001, 2002 Hitoshi Yamamoto - * Copyright (C) 2004 Hirokazu Takata - */ - -#include -#include -#include - -extern void __xchg_called_with_bad_pointer(void); - -static __always_inline unsigned long -__xchg(unsigned long x, volatile void *ptr, int size) -{ - unsigned long flags; - unsigned long tmp = 0; - - local_irq_save(flags); - - switch (size) { -#ifndef CONFIG_SMP - case 1: - __asm__ __volatile__ ( - "ldb %0, @%2 \n\t" - "stb %1, @%2 \n\t" - : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); - break; - case 2: - __asm__ __volatile__ ( - "ldh %0, @%2 \n\t" - "sth %1, @%2 \n\t" - : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); - break; - case 4: - __asm__ __volatile__ ( - "ld %0, @%2 \n\t" - "st %1, @%2 \n\t" - : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); - break; -#else /* CONFIG_SMP */ - case 4: - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r4", "%2") - "lock %0, @%2; \n\t" - "unlock %1, @%2; \n\t" - : "=&r" (tmp) : "r" (x), "r" (ptr) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - break; -#endif /* CONFIG_SMP */ - default: - __xchg_called_with_bad_pointer(); - } - - local_irq_restore(flags); - - return (tmp); -} - -#define xchg(ptr, x) ({ \ - ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), \ - sizeof(*(ptr)))); \ -}) - -static __always_inline unsigned long -__xchg_local(unsigned long x, volatile void *ptr, int size) -{ - unsigned long flags; - unsigned long tmp = 0; - - local_irq_save(flags); - - switch (size) { - case 1: - __asm__ __volatile__ ( - "ldb %0, @%2 \n\t" - "stb %1, @%2 \n\t" - : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); - break; - case 2: - __asm__ __volatile__ ( - "ldh %0, @%2 \n\t" - "sth %1, @%2 \n\t" - : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); - break; - case 4: - __asm__ __volatile__ ( - "ld %0, @%2 \n\t" - "st %1, @%2 \n\t" - : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); - break; - default: - __xchg_called_with_bad_pointer(); - } - - local_irq_restore(flags); - - return (tmp); -} - -#define xchg_local(ptr, x) \ - ((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr), \ - sizeof(*(ptr)))) - -static inline unsigned long -__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) -{ - unsigned long flags; - unsigned int retval; - - local_irq_save(flags); - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r4", "%1") - M32R_LOCK" %0, @%1; \n" - " bne %0, %2, 1f; \n" - M32R_UNLOCK" %3, @%1; \n" - " bra 2f; \n" - " .fillinsn \n" - "1:" - M32R_UNLOCK" %0, @%1; \n" - " .fillinsn \n" - "2:" - : "=&r" (retval) - : "r" (p), "r" (old), "r" (new) - : "cbit", "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); - - return retval; -} - -static inline unsigned long -__cmpxchg_local_u32(volatile unsigned int *p, unsigned int old, - unsigned int new) -{ - unsigned long flags; - unsigned int retval; - - local_irq_save(flags); - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r4", "%1") - "ld %0, @%1; \n" - " bne %0, %2, 1f; \n" - "st %3, @%1; \n" - " bra 2f; \n" - " .fillinsn \n" - "1:" - "st %0, @%1; \n" - " .fillinsn \n" - "2:" - : "=&r" (retval) - : "r" (p), "r" (old), "r" (new) - : "cbit", "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); - - return retval; -} - -/* This function doesn't exist, so you'll get a linker error - if something tries to do an invalid cmpxchg(). */ -extern void __cmpxchg_called_with_bad_pointer(void); - -static inline unsigned long -__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) -{ - switch (size) { - case 4: - return __cmpxchg_u32(ptr, old, new); -#if 0 /* we don't have __cmpxchg_u64 */ - case 8: - return __cmpxchg_u64(ptr, old, new); -#endif /* 0 */ - } - __cmpxchg_called_with_bad_pointer(); - return old; -} - -#define cmpxchg(ptr, o, n) ({ \ - ((__typeof__(*(ptr))) \ - __cmpxchg((ptr), (unsigned long)(o), \ - (unsigned long)(n), \ - sizeof(*(ptr)))); \ -}) - -#include - -static inline unsigned long __cmpxchg_local(volatile void *ptr, - unsigned long old, - unsigned long new, int size) -{ - switch (size) { - case 4: - return __cmpxchg_local_u32(ptr, old, new); - default: - return __cmpxchg_local_generic(ptr, old, new, size); - } - - return old; -} - -/* - * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make - * them available. - */ -#define cmpxchg_local(ptr, o, n) \ - ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ - (unsigned long)(n), sizeof(*(ptr)))) -#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) - -#endif /* _ASM_M32R_CMPXCHG_H */ diff --git a/arch/m32r/include/asm/dcache_clear.h b/arch/m32r/include/asm/dcache_clear.h deleted file mode 100644 index a0ae06c2e9e7..000000000000 --- a/arch/m32r/include/asm/dcache_clear.h +++ /dev/null @@ -1,29 +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. - * - * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto - * Copyright (C) 2004, 2006 Hirokazu Takata - */ -#ifndef _ASM_M32R_DCACHE_CLEAR_H -#define _ASM_M32R_DCACHE_CLEAR_H - -#ifdef CONFIG_CHIP_M32700_TS1 -#define DCACHE_CLEAR(reg0, reg1, addr) \ - "seth "reg1", #high(dcache_dummy); \n\t" \ - "or3 "reg1", "reg1", #low(dcache_dummy); \n\t" \ - "lock "reg0", @"reg1"; \n\t" \ - "add3 "reg0", "addr", #0x1000; \n\t" \ - "ld "reg0", @"reg0"; \n\t" \ - "add3 "reg0", "addr", #0x2000; \n\t" \ - "ld "reg0", @"reg0"; \n\t" \ - "unlock "reg0", @"reg1"; \n\t" - /* FIXME: This workaround code cannot handle kernel modules - * correctly under SMP environment. - */ -#else /* CONFIG_CHIP_M32700_TS1 */ -#define DCACHE_CLEAR(reg0, reg1, addr) -#endif /* CONFIG_CHIP_M32700_TS1 */ - -#endif /* _ASM_M32R_DCACHE_CLEAR_H */ diff --git a/arch/m32r/include/asm/delay.h b/arch/m32r/include/asm/delay.h deleted file mode 100644 index 9670e127b7b2..000000000000 --- a/arch/m32r/include/asm/delay.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/m32r/include/asm/device.h b/arch/m32r/include/asm/device.h deleted file mode 100644 index 5203fc87f080..000000000000 --- a/arch/m32r/include/asm/device.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Arch specific extensions to struct device - * - * This file is released under the GPLv2 - */ -struct dev_archdata { -}; - -struct pdev_archdata { -}; diff --git a/arch/m32r/include/asm/div64.h b/arch/m32r/include/asm/div64.h deleted file mode 100644 index 6cd978cefb28..000000000000 --- a/arch/m32r/include/asm/div64.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/m32r/include/asm/dma.h b/arch/m32r/include/asm/dma.h deleted file mode 100644 index 661bc3b343ed..000000000000 --- a/arch/m32r/include/asm/dma.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_DMA_H -#define _ASM_M32R_DMA_H - -#include - -/* - * The maximum address that we can perform a DMA transfer - * to on this platform - */ -#define MAX_DMA_ADDRESS (PAGE_OFFSET+0x20000000) - -#endif /* _ASM_M32R_DMA_H */ diff --git a/arch/m32r/include/asm/elf.h b/arch/m32r/include/asm/elf.h deleted file mode 100644 index 576b2ff57957..000000000000 --- a/arch/m32r/include/asm/elf.h +++ /dev/null @@ -1,132 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R__ELF_H -#define _ASM_M32R__ELF_H - -/* - * ELF-specific definitions. - * - * Copyright (C) 1999-2004, Renesas Technology Corp. - * Hirokazu Takata - */ - -#include -#include -#include - -/* M32R relocation types */ -#define R_M32R_NONE 0 -#define R_M32R_16 1 -#define R_M32R_32 2 -#define R_M32R_24 3 -#define R_M32R_10_PCREL 4 -#define R_M32R_18_PCREL 5 -#define R_M32R_26_PCREL 6 -#define R_M32R_HI16_ULO 7 -#define R_M32R_HI16_SLO 8 -#define R_M32R_LO16 9 -#define R_M32R_SDA16 10 -#define R_M32R_GNU_VTINHERIT 11 -#define R_M32R_GNU_VTENTRY 12 - -#define R_M32R_16_RELA 33 -#define R_M32R_32_RELA 34 -#define R_M32R_24_RELA 35 -#define R_M32R_10_PCREL_RELA 36 -#define R_M32R_18_PCREL_RELA 37 -#define R_M32R_26_PCREL_RELA 38 -#define R_M32R_HI16_ULO_RELA 39 -#define R_M32R_HI16_SLO_RELA 40 -#define R_M32R_LO16_RELA 41 -#define R_M32R_SDA16_RELA 42 -#define R_M32R_RELA_GNU_VTINHERIT 43 -#define R_M32R_RELA_GNU_VTENTRY 44 - -#define R_M32R_GOT24 48 -#define R_M32R_26_PLTREL 49 -#define R_M32R_COPY 50 -#define R_M32R_GLOB_DAT 51 -#define R_M32R_JMP_SLOT 52 -#define R_M32R_RELATIVE 53 -#define R_M32R_GOTOFF 54 -#define R_M32R_GOTPC24 55 -#define R_M32R_GOT16_HI_ULO 56 -#define R_M32R_GOT16_HI_SLO 57 -#define R_M32R_GOT16_LO 58 -#define R_M32R_GOTPC_HI_ULO 59 -#define R_M32R_GOTPC_HI_SLO 60 -#define R_M32R_GOTPC_LO 61 -#define R_M32R_GOTOFF_HI_ULO 62 -#define R_M32R_GOTOFF_HI_SLO 63 -#define R_M32R_GOTOFF_LO 64 - -#define R_M32R_NUM 256 - -/* - * ELF register definitions.. - */ -#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) - -typedef unsigned long elf_greg_t; -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; - -/* We have no FP mumumu. */ -typedef double elf_fpreg_t; -typedef elf_fpreg_t elf_fpregset_t; - -/* - * This is used to ensure we don't load something for the wrong architecture. - */ -#define elf_check_arch(x) \ - (((x)->e_machine == EM_M32R) || ((x)->e_machine == EM_CYGNUS_M32R)) - -/* - * These are used to set parameters in the core dumps. - */ -#define ELF_CLASS ELFCLASS32 -#if defined(__LITTLE_ENDIAN__) -#define ELF_DATA ELFDATA2LSB -#elif defined(__BIG_ENDIAN__) -#define ELF_DATA ELFDATA2MSB -#else -#error no endian defined -#endif -#define ELF_ARCH EM_M32R - -/* r0 is set by ld.so to a pointer to a function which might be - * registered using 'atexit'. This provides a mean for the dynamic - * linker to call DT_FINI functions for shared libraries that have - * been loaded before the code runs. - * - * So that we can use the same startup file with static executables, - * we start programs with a value of 0 to indicate that there is no - * such function. - */ -#define ELF_PLAT_INIT(_r, load_addr) (_r)->r0 = 0 - -#define ELF_EXEC_PAGESIZE PAGE_SIZE - -/* - * This is the location that an ET_DYN program is loaded if exec'ed. - * Typical use of this is to invoke "./ld.so someprog" to test out a - * new version of the loader. We need to make sure that it is out of - * the way of the program that it will "exec", and that there is - * sufficient room for the brk. - */ -#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) - -/* regs is struct pt_regs, pr_reg is elf_gregset_t (which is - now struct_user_regs, they are different) */ - -#define ELF_CORE_COPY_REGS(pr_reg, regs) \ - memcpy((char *)pr_reg, (char *)regs, sizeof (struct pt_regs)); - -/* This yields a mask that user programs can use to figure out what - instruction set this CPU supports. */ -#define ELF_HWCAP (0) - -/* This yields a string that ld.so will use to load implementation - specific libraries for optimization. This is more specific in - intent than poking at uname or /proc/cpuinfo. */ -#define ELF_PLATFORM (NULL) - -#endif /* _ASM_M32R__ELF_H */ diff --git a/arch/m32r/include/asm/emergency-restart.h b/arch/m32r/include/asm/emergency-restart.h deleted file mode 100644 index cca44d5ae264..000000000000 --- a/arch/m32r/include/asm/emergency-restart.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_EMERGENCY_RESTART_H -#define _ASM_EMERGENCY_RESTART_H - -#include - -#endif /* _ASM_EMERGENCY_RESTART_H */ diff --git a/arch/m32r/include/asm/fb.h b/arch/m32r/include/asm/fb.h deleted file mode 100644 index 9a0bca2686fd..000000000000 --- a/arch/m32r/include/asm/fb.h +++ /dev/null @@ -1,20 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_FB_H_ -#define _ASM_FB_H_ - -#include -#include -#include - -static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, - unsigned long off) -{ - vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); -} - -static inline int fb_is_primary_device(struct fb_info *info) -{ - return 0; -} - -#endif /* _ASM_FB_H_ */ diff --git a/arch/m32r/include/asm/flat.h b/arch/m32r/include/asm/flat.h deleted file mode 100644 index dfcb0e4eb256..000000000000 --- a/arch/m32r/include/asm/flat.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * include/asm-m32r/flat.h - * - * uClinux flat-format executables - * - * Copyright (C) 2004 Kazuhiro Inaoka - * - * 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. - */ -#ifndef __ASM_M32R_FLAT_H -#define __ASM_M32R_FLAT_H - -#define flat_argvp_envp_on_stack() 0 -#define flat_old_ram_flag(flags) (flags) -#define flat_set_persistent(relval, p) 0 -#define flat_reloc_valid(reloc, size) \ - (((reloc) - textlen_for_m32r_lo16_data) <= (size)) - -/* Convert a relocation entry into an address. */ -static inline unsigned long -flat_get_relocate_addr (unsigned long relval) -{ - return relval & 0x00ffffff; /* Mask out top 8-bits */ -} - -#define flat_m32r_get_reloc_type(relval) ((relval) >> 24) - -#define M32R_SETH_OPCODE 0xd0c00000 /* SETH instruction code */ - -#define FLAT_M32R_32 0x00 /* 32bits reloc */ -#define FLAT_M32R_24 0x01 /* unsigned 24bits reloc */ -#define FLAT_M32R_16 0x02 /* 16bits reloc */ -#define FLAT_M32R_LO16 0x03 /* signed low 16bits reloc (low()) */ -#define FLAT_M32R_LO16_DATA 0x04 /* signed low 16bits reloc (low()) - for a symbol in .data section */ - /* High 16bits of an address used - when the lower 16bbits are treated - as unsigned. - To create SETH instruction only. - 0x1X: X means a number of register. - 0x10 - 0x3F are reserved. */ -#define FLAT_M32R_HI16_ULO 0x10 /* reloc for SETH Rn,#high(imm16) */ - /* High 16bits of an address used - when the lower 16bbits are treated - as signed. - To create SETH instruction only. - 0x2X: X means a number of register. - 0x20 - 0x4F are reserved. */ -#define FLAT_M32R_HI16_SLO 0x20 /* reloc for SETH Rn,#shigh(imm16) */ - -static unsigned long textlen_for_m32r_lo16_data = 0; - -static inline unsigned long m32r_flat_get_addr_from_rp (u32 *rp, - u32 relval, - u32 textlen) -{ - unsigned int reloc = flat_m32r_get_reloc_type (relval); - textlen_for_m32r_lo16_data = 0; - if (reloc & 0xf0) { - unsigned long addr = htonl(*rp); - switch (reloc & 0xf0) - { - case FLAT_M32R_HI16_ULO: - case FLAT_M32R_HI16_SLO: - if (addr == 0) { - /* put "seth Rn,#0x0" instead of 0 (addr). */ - *rp = (M32R_SETH_OPCODE | ((reloc & 0x0f)<<24)); - } - return addr; - default: - break; - } - } else { - switch (reloc) - { - case FLAT_M32R_LO16: - return htonl(*rp) & 0xFFFF; - case FLAT_M32R_LO16_DATA: - /* FIXME: The return value will decrease by textlen - at m32r_flat_put_addr_at_rp () */ - textlen_for_m32r_lo16_data = textlen; - return (htonl(*rp) & 0xFFFF) + textlen; - case FLAT_M32R_16: - return htons(*(unsigned short *)rp) & 0xFFFF; - case FLAT_M32R_24: - return htonl(*rp) & 0xFFFFFF; - case FLAT_M32R_32: - return htonl(*rp); - default: - break; - } - } - return ~0; /* bogus value */ -} - -static inline int flat_put_addr_at_rp(u32 *rp, u32 addr, u32 relval) -{ - unsigned int reloc = flat_m32r_get_reloc_type (relval); - if (reloc & 0xf0) { - unsigned long Rn = reloc & 0x0f; /* get a number of register */ - Rn <<= 24; /* 0x0R000000 */ - reloc &= 0xf0; - switch (reloc) - { - case FLAT_M32R_HI16_ULO: /* To create SETH Rn,#high(imm16) */ - *rp = (M32R_SETH_OPCODE | Rn - | ((addr >> 16) & 0xFFFF)); - break; - case FLAT_M32R_HI16_SLO: /* To create SETH Rn,#shigh(imm16) */ - *rp = (M32R_SETH_OPCODE | Rn - | (((addr >> 16) + ((addr & 0x8000) ? 1 : 0)) - & 0xFFFF)); - break; - } - } else { - switch (reloc) { - case FLAT_M32R_LO16_DATA: - addr -= textlen_for_m32r_lo16_data; - textlen_for_m32r_lo16_data = 0; - case FLAT_M32R_LO16: - *rp = (htonl(*rp) & 0xFFFF0000) | (addr & 0xFFFF); - break; - case FLAT_M32R_16: - *(unsigned short *)rp = addr & 0xFFFF; - break; - case FLAT_M32R_24: - *rp = (htonl(*rp) & 0xFF000000) | (addr & 0xFFFFFF); - break; - case FLAT_M32R_32: - *rp = addr; - break; - } - } - return 0; -} - -// kludge - text_len is a local variable in the only user. -#define flat_get_addr_from_rp(rp, relval, flags, addr, persistent) \ - (m32r_flat_get_addr_from_rp(rp, relval, text_len), 0) - -#endif /* __ASM_M32R_FLAT_H */ diff --git a/arch/m32r/include/asm/ftrace.h b/arch/m32r/include/asm/ftrace.h deleted file mode 100644 index 40a8c178f10d..000000000000 --- a/arch/m32r/include/asm/ftrace.h +++ /dev/null @@ -1 +0,0 @@ -/* empty */ diff --git a/arch/m32r/include/asm/futex.h b/arch/m32r/include/asm/futex.h deleted file mode 100644 index 6a332a9f099c..000000000000 --- a/arch/m32r/include/asm/futex.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_FUTEX_H -#define _ASM_FUTEX_H - -#include - -#endif diff --git a/arch/m32r/include/asm/hardirq.h b/arch/m32r/include/asm/hardirq.h deleted file mode 100644 index 10c23de02b3a..000000000000 --- a/arch/m32r/include/asm/hardirq.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifdef __KERNEL__ -#ifndef __ASM_HARDIRQ_H -#define __ASM_HARDIRQ_H - -#include -#include - -#endif /* __ASM_HARDIRQ_H */ -#endif /* __KERNEL__ */ diff --git a/arch/m32r/include/asm/hw_irq.h b/arch/m32r/include/asm/hw_irq.h deleted file mode 100644 index 7138537cda03..000000000000 --- a/arch/m32r/include/asm/hw_irq.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _ASM_M32R_HW_IRQ_H -#define _ASM_M32R_HW_IRQ_H - -#endif /* _ASM_M32R_HW_IRQ_H */ diff --git a/arch/m32r/include/asm/io.h b/arch/m32r/include/asm/io.h deleted file mode 100644 index a4272d8f0d9c..000000000000 --- a/arch/m32r/include/asm/io.h +++ /dev/null @@ -1,225 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_IO_H -#define _ASM_M32R_IO_H - -#include -#include -#include /* __va */ - -#ifdef __KERNEL__ - -#define IO_SPACE_LIMIT 0xFFFFFFFF - -/** - * virt_to_phys - map virtual addresses to physical - * @address: address to remap - * - * The returned physical address is the physical (CPU) mapping for - * the memory address given. It is only valid to use this function on - * addresses directly mapped or allocated via kmalloc. - * - * This function does not give bus mappings for DMA transfers. In - * almost all conceivable cases a device driver should not be using - * this function - */ - -static inline unsigned long virt_to_phys(volatile void * address) -{ - return __pa(address); -} - -/** - * phys_to_virt - map physical address to virtual - * @address: address to remap - * - * The returned virtual address is a current CPU mapping for - * the memory address given. It is only valid to use this function on - * addresses that have a kernel mapping - * - * This function does not handle bus mappings for DMA transfers. In - * almost all conceivable cases a device driver should not be using - * this function - */ - -static inline void *phys_to_virt(unsigned long address) -{ - return __va(address); -} - -extern void __iomem * -__ioremap(unsigned long offset, unsigned long size, unsigned long flags); - -/** - * ioremap - map bus memory into CPU space - * @offset: bus address of the memory - * @size: size of the resource to map - * - * ioremap performs a platform specific sequence of operations to - * make bus memory CPU accessible via the readb/readw/readl/writeb/ - * writew/writel functions and the other mmio helpers. The returned - * address is not guaranteed to be usable directly as a virtual - * address. - */ - -static inline void __iomem *ioremap(unsigned long offset, unsigned long size) -{ - return __ioremap(offset, size, 0); -} - -extern void iounmap(volatile void __iomem *addr); -#define ioremap_nocache(off,size) ioremap(off,size) -#define ioremap_wc ioremap_nocache -#define ioremap_wt ioremap_nocache -#define ioremap_uc ioremap_nocache - -/* - * IO bus memory addresses are also 1:1 with the physical address - */ -#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) -#define page_to_bus page_to_phys -#define virt_to_bus virt_to_phys - -extern unsigned char _inb(unsigned long); -extern unsigned short _inw(unsigned long); -extern unsigned long _inl(unsigned long); -extern unsigned char _inb_p(unsigned long); -extern unsigned short _inw_p(unsigned long); -extern unsigned long _inl_p(unsigned long); -extern void _outb(unsigned char, unsigned long); -extern void _outw(unsigned short, unsigned long); -extern void _outl(unsigned long, unsigned long); -extern void _outb_p(unsigned char, unsigned long); -extern void _outw_p(unsigned short, unsigned long); -extern void _outl_p(unsigned long, unsigned long); -extern void _insb(unsigned int, void *, unsigned long); -extern void _insw(unsigned int, void *, unsigned long); -extern void _insl(unsigned int, void *, unsigned long); -extern void _outsb(unsigned int, const void *, unsigned long); -extern void _outsw(unsigned int, const void *, unsigned long); -extern void _outsl(unsigned int, const void *, unsigned long); - -static inline unsigned char _readb(unsigned long addr) -{ - return *(volatile unsigned char __force *)addr; -} - -static inline unsigned short _readw(unsigned long addr) -{ - return *(volatile unsigned short __force *)addr; -} - -static inline unsigned long _readl(unsigned long addr) -{ - return *(volatile unsigned long __force *)addr; -} - -static inline void _writeb(unsigned char b, unsigned long addr) -{ - *(volatile unsigned char __force *)addr = b; -} - -static inline void _writew(unsigned short w, unsigned long addr) -{ - *(volatile unsigned short __force *)addr = w; -} - -static inline void _writel(unsigned long l, unsigned long addr) -{ - *(volatile unsigned long __force *)addr = l; -} - -#define inb _inb -#define inw _inw -#define inl _inl -#define outb _outb -#define outw _outw -#define outl _outl - -#define inb_p _inb_p -#define inw_p _inw_p -#define inl_p _inl_p -#define outb_p _outb_p -#define outw_p _outw_p -#define outl_p _outl_p - -#define insb _insb -#define insw _insw -#define insl _insl -#define outsb _outsb -#define outsw _outsw -#define outsl _outsl - -#define readb(addr) _readb((unsigned long)(addr)) -#define readw(addr) _readw((unsigned long)(addr)) -#define readl(addr) _readl((unsigned long)(addr)) -#define __raw_readb readb -#define __raw_readw readw -#define __raw_readl readl -#define readb_relaxed readb -#define readw_relaxed readw -#define readl_relaxed readl - -#define writeb(val, addr) _writeb((val), (unsigned long)(addr)) -#define writew(val, addr) _writew((val), (unsigned long)(addr)) -#define writel(val, addr) _writel((val), (unsigned long)(addr)) -#define __raw_writeb writeb -#define __raw_writew writew -#define __raw_writel writel -#define writeb_relaxed writeb -#define writew_relaxed writew -#define writel_relaxed writel - -#define ioread8 readb -#define ioread16 readw -#define ioread32 readl -#define iowrite8 writeb -#define iowrite16 writew -#define iowrite32 writel - -#define ioread8_rep(p, dst, count) insb((unsigned long)(p), (dst), (count)) -#define ioread16_rep(p, dst, count) insw((unsigned long)(p), (dst), (count)) -#define ioread32_rep(p, dst, count) insl((unsigned long)(p), (dst), (count)) - -#define iowrite8_rep(p, src, count) outsb((unsigned long)(p), (src), (count)) -#define iowrite16_rep(p, src, count) outsw((unsigned long)(p), (src), (count)) -#define iowrite32_rep(p, src, count) outsl((unsigned long)(p), (src), (count)) - -#define ioread16be(addr) be16_to_cpu(readw(addr)) -#define ioread32be(addr) be32_to_cpu(readl(addr)) -#define iowrite16be(v, addr) writew(cpu_to_be16(v), (addr)) -#define iowrite32be(v, addr) writel(cpu_to_be32(v), (addr)) - -#define mmiowb() - -static inline void -memset_io(volatile void __iomem *addr, unsigned char val, int count) -{ - memset((void __force *) addr, val, count); -} - -static inline void -memcpy_fromio(void *dst, volatile void __iomem *src, int count) -{ - memcpy(dst, (void __force *) src, count); -} - -static inline void -memcpy_toio(volatile void __iomem *dst, const void *src, int count) -{ - memcpy((void __force *) dst, src, count); -} - -/* - * Convert a physical pointer to a virtual kernel pointer for /dev/mem - * access - */ -#define xlate_dev_mem_ptr(p) __va(p) - -/* - * Convert a virtual cached pointer to an uncached pointer - */ -#define xlate_dev_kmem_ptr(p) p - -#endif /* __KERNEL__ */ - -#endif /* _ASM_M32R_IO_H */ diff --git a/arch/m32r/include/asm/irq.h b/arch/m32r/include/asm/irq.h deleted file mode 100644 index 85b475fff90e..000000000000 --- a/arch/m32r/include/asm/irq.h +++ /dev/null @@ -1,91 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifdef __KERNEL__ -#ifndef _ASM_M32R_IRQ_H -#define _ASM_M32R_IRQ_H - - -#if defined(CONFIG_PLAT_USRV) -/* - * IRQ definitions for M32700UT - * M32700 Chip: 64 interrupts - * ICU of M32700UT-on-board PLD: 32 interrupts cascaded to INT1# chip pin - */ -#define M32700UT_NUM_CPU_IRQ (64) -#define M32700UT_NUM_PLD_IRQ (32) -#define M32700UT_IRQ_BASE 0 -#define M32700UT_CPU_IRQ_BASE M32700UT_IRQ_BASE -#define M32700UT_PLD_IRQ_BASE (M32700UT_CPU_IRQ_BASE + M32700UT_NUM_CPU_IRQ) - -#define NR_IRQS (M32700UT_NUM_CPU_IRQ + M32700UT_NUM_PLD_IRQ) -#elif defined(CONFIG_PLAT_M32700UT) -/* - * IRQ definitions for M32700UT(Rev.C) + M32R-LAN - * M32700 Chip: 64 interrupts - * ICU of M32700UT-on-board PLD: 32 interrupts cascaded to INT1# chip pin - * ICU of M32R-LCD-on-board PLD: 32 interrupts cascaded to INT2# chip pin - * ICU of M32R-LAN-on-board PLD: 32 interrupts cascaded to INT0# chip pin - */ -#define M32700UT_NUM_CPU_IRQ (64) -#define M32700UT_NUM_PLD_IRQ (32) -#define M32700UT_NUM_LCD_PLD_IRQ (32) -#define M32700UT_NUM_LAN_PLD_IRQ (32) -#define M32700UT_IRQ_BASE 0 -#define M32700UT_CPU_IRQ_BASE (M32700UT_IRQ_BASE) -#define M32700UT_PLD_IRQ_BASE \ - (M32700UT_CPU_IRQ_BASE + M32700UT_NUM_CPU_IRQ) -#define M32700UT_LCD_PLD_IRQ_BASE \ - (M32700UT_PLD_IRQ_BASE + M32700UT_NUM_PLD_IRQ) -#define M32700UT_LAN_PLD_IRQ_BASE \ - (M32700UT_LCD_PLD_IRQ_BASE + M32700UT_NUM_LCD_PLD_IRQ) - -#define NR_IRQS \ - (M32700UT_NUM_CPU_IRQ + M32700UT_NUM_PLD_IRQ \ - + M32700UT_NUM_LCD_PLD_IRQ + M32700UT_NUM_LAN_PLD_IRQ) -#elif defined(CONFIG_PLAT_OPSPUT) -/* - * IRQ definitions for OPSPUT + M32R-LAN - * OPSP Chip: 64 interrupts - * ICU of OPSPUT-on-board PLD: 32 interrupts cascaded to INT1# chip pin - * ICU of M32R-LCD-on-board PLD: 32 interrupts cascaded to INT2# chip pin - * ICU of M32R-LAN-on-board PLD: 32 interrupts cascaded to INT0# chip pin - */ -#define OPSPUT_NUM_CPU_IRQ (64) -#define OPSPUT_NUM_PLD_IRQ (32) -#define OPSPUT_NUM_LCD_PLD_IRQ (32) -#define OPSPUT_NUM_LAN_PLD_IRQ (32) -#define OPSPUT_IRQ_BASE 0 -#define OPSPUT_CPU_IRQ_BASE (OPSPUT_IRQ_BASE) -#define OPSPUT_PLD_IRQ_BASE \ - (OPSPUT_CPU_IRQ_BASE + OPSPUT_NUM_CPU_IRQ) -#define OPSPUT_LCD_PLD_IRQ_BASE \ - (OPSPUT_PLD_IRQ_BASE + OPSPUT_NUM_PLD_IRQ) -#define OPSPUT_LAN_PLD_IRQ_BASE \ - (OPSPUT_LCD_PLD_IRQ_BASE + OPSPUT_NUM_LCD_PLD_IRQ) - -#define NR_IRQS \ - (OPSPUT_NUM_CPU_IRQ + OPSPUT_NUM_PLD_IRQ \ - + OPSPUT_NUM_LCD_PLD_IRQ + OPSPUT_NUM_LAN_PLD_IRQ) - -#elif defined(CONFIG_PLAT_M32104UT) -/* - * IRQ definitions for M32104UT - * M32104 Chip: 64 interrupts - * ICU of M32104UT-on-board PLD: 32 interrupts cascaded to INT1# chip pin - */ -#define M32104UT_NUM_CPU_IRQ (64) -#define M32104UT_NUM_PLD_IRQ (32) -#define M32104UT_IRQ_BASE 0 -#define M32104UT_CPU_IRQ_BASE M32104UT_IRQ_BASE -#define M32104UT_PLD_IRQ_BASE (M32104UT_CPU_IRQ_BASE + M32104UT_NUM_CPU_IRQ) - -#define NR_IRQS \ - (M32104UT_NUM_CPU_IRQ + M32104UT_NUM_PLD_IRQ) - -#else -#define NR_IRQS 64 -#endif - -#define irq_canonicalize(irq) (irq) - -#endif /* _ASM_M32R_IRQ_H */ -#endif /* __KERNEL__ */ diff --git a/arch/m32r/include/asm/irq_regs.h b/arch/m32r/include/asm/irq_regs.h deleted file mode 100644 index 3dd9c0b70270..000000000000 --- a/arch/m32r/include/asm/irq_regs.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/m32r/include/asm/irqflags.h b/arch/m32r/include/asm/irqflags.h deleted file mode 100644 index 1f92d29982ae..000000000000 --- a/arch/m32r/include/asm/irqflags.h +++ /dev/null @@ -1,104 +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. - * - * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto - * Copyright (C) 2004, 2006 Hirokazu Takata - */ - -#ifndef _ASM_M32R_IRQFLAGS_H -#define _ASM_M32R_IRQFLAGS_H - -#include - -static inline unsigned long arch_local_save_flags(void) -{ - unsigned long flags; - asm volatile("mvfc %0,psw" : "=r"(flags)); - return flags; -} - -static inline void arch_local_irq_disable(void) -{ -#if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104) - asm volatile ( - "clrpsw #0x40 -> nop" - : : : "memory"); -#else - unsigned long tmpreg0, tmpreg1; - asm volatile ( - "ld24 %0, #0 ; Use 32-bit insn. \n\t" - "mvfc %1, psw ; No interrupt can be accepted here. \n\t" - "mvtc %0, psw \n\t" - "and3 %0, %1, #0xffbf \n\t" - "mvtc %0, psw \n\t" - : "=&r" (tmpreg0), "=&r" (tmpreg1) - : - : "cbit", "memory"); -#endif -} - -static inline void arch_local_irq_enable(void) -{ -#if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104) - asm volatile ( - "setpsw #0x40 -> nop" - : : : "memory"); -#else - unsigned long tmpreg; - asm volatile ( - "mvfc %0, psw; \n\t" - "or3 %0, %0, #0x0040; \n\t" - "mvtc %0, psw; \n\t" - : "=&r" (tmpreg) - : - : "cbit", "memory"); -#endif -} - -static inline unsigned long arch_local_irq_save(void) -{ - unsigned long flags; - -#if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104)) - asm volatile ( - "mvfc %0, psw; \n\t" - "clrpsw #0x40 -> nop; \n\t" - : "=r" (flags) - : - : "memory"); -#else - unsigned long tmpreg; - asm volatile ( - "ld24 %1, #0 \n\t" - "mvfc %0, psw \n\t" - "mvtc %1, psw \n\t" - "and3 %1, %0, #0xffbf \n\t" - "mvtc %1, psw \n\t" - : "=r" (flags), "=&r" (tmpreg) - : - : "cbit", "memory"); -#endif - return flags; -} - -static inline void arch_local_irq_restore(unsigned long flags) -{ - asm volatile("mvtc %0,psw" - : - : "r" (flags) - : "cbit", "memory"); -} - -static inline bool arch_irqs_disabled_flags(unsigned long flags) -{ - return !(flags & 0x40); -} - -static inline bool arch_irqs_disabled(void) -{ - return arch_irqs_disabled_flags(arch_local_save_flags()); -} - -#endif /* _ASM_M32R_IRQFLAGS_H */ diff --git a/arch/m32r/include/asm/kdebug.h b/arch/m32r/include/asm/kdebug.h deleted file mode 100644 index 6ece1b037665..000000000000 --- a/arch/m32r/include/asm/kdebug.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/m32r/include/asm/kmap_types.h b/arch/m32r/include/asm/kmap_types.h deleted file mode 100644 index 3dcba0d17d40..000000000000 --- a/arch/m32r/include/asm/kmap_types.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __M32R_KMAP_TYPES_H -#define __M32R_KMAP_TYPES_H - -#ifdef CONFIG_DEBUG_HIGHMEM -#define __WITH_KM_FENCE -#endif - -#include - -#undef __WITH_KM_FENCE - -#endif /* __M32R_KMAP_TYPES_H */ diff --git a/arch/m32r/include/asm/linkage.h b/arch/m32r/include/asm/linkage.h deleted file mode 100644 index f1aee6ec5bc3..000000000000 --- a/arch/m32r/include/asm/linkage.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_LINKAGE_H -#define __ASM_LINKAGE_H - -#define __ALIGN .balign 4 -#define __ALIGN_STR ".balign 4" - -#endif /* __ASM_LINKAGE_H */ diff --git a/arch/m32r/include/asm/local.h b/arch/m32r/include/asm/local.h deleted file mode 100644 index 6780680c185d..000000000000 --- a/arch/m32r/include/asm/local.h +++ /dev/null @@ -1,341 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __M32R_LOCAL_H -#define __M32R_LOCAL_H - -/* - * linux/include/asm-m32r/local.h - * - * M32R version: - * Copyright (C) 2001, 2002 Hitoshi Yamamoto - * Copyright (C) 2004 Hirokazu Takata - * Copyright (C) 2007 Mathieu Desnoyers - */ - -#include -#include -#include - -/* - * Atomic operations that C can't guarantee us. Useful for - * resource counting etc.. - */ - -/* - * Make sure gcc doesn't try to be clever and move things around - * on us. We need to use _exactly_ the address the user gave us, - * not some alias that contains the same information. - */ -typedef struct { volatile int counter; } local_t; - -#define LOCAL_INIT(i) { (i) } - -/** - * local_read - read local variable - * @l: pointer of type local_t - * - * Atomically reads the value of @l. - */ -#define local_read(l) ((l)->counter) - -/** - * local_set - set local variable - * @l: pointer of type local_t - * @i: required value - * - * Atomically sets the value of @l to @i. - */ -#define local_set(l, i) (((l)->counter) = (i)) - -/** - * local_add_return - add long to local variable and return it - * @i: long value to add - * @l: pointer of type local_t - * - * Atomically adds @i to @l and return (@i + @l). - */ -static inline long local_add_return(long i, local_t *l) -{ - unsigned long flags; - long result; - - local_irq_save(flags); - __asm__ __volatile__ ( - "# local_add_return \n\t" - DCACHE_CLEAR("%0", "r4", "%1") - "ld %0, @%1; \n\t" - "add %0, %2; \n\t" - "st %0, @%1; \n\t" - : "=&r" (result) - : "r" (&l->counter), "r" (i) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); - - return result; -} - -/** - * local_sub_return - subtract long from local variable and return it - * @i: long value to subtract - * @l: pointer of type local_t - * - * Atomically subtracts @i from @l and return (@l - @i). - */ -static inline long local_sub_return(long i, local_t *l) -{ - unsigned long flags; - long result; - - local_irq_save(flags); - __asm__ __volatile__ ( - "# local_sub_return \n\t" - DCACHE_CLEAR("%0", "r4", "%1") - "ld %0, @%1; \n\t" - "sub %0, %2; \n\t" - "st %0, @%1; \n\t" - : "=&r" (result) - : "r" (&l->counter), "r" (i) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); - - return result; -} - -/** - * local_add - add long to local variable - * @i: long value to add - * @l: pointer of type local_t - * - * Atomically adds @i to @l. - */ -#define local_add(i, l) ((void) local_add_return((i), (l))) - -/** - * local_sub - subtract the local variable - * @i: long value to subtract - * @l: pointer of type local_t - * - * Atomically subtracts @i from @l. - */ -#define local_sub(i, l) ((void) local_sub_return((i), (l))) - -/** - * local_sub_and_test - subtract value from variable and test result - * @i: integer value to subtract - * @l: pointer of type local_t - * - * Atomically subtracts @i from @l and returns - * true if the result is zero, or false for all - * other cases. - */ -#define local_sub_and_test(i, l) (local_sub_return((i), (l)) == 0) - -/** - * local_inc_return - increment local variable and return it - * @l: pointer of type local_t - * - * Atomically increments @l by 1 and returns the result. - */ -static inline long local_inc_return(local_t *l) -{ - unsigned long flags; - long result; - - local_irq_save(flags); - __asm__ __volatile__ ( - "# local_inc_return \n\t" - DCACHE_CLEAR("%0", "r4", "%1") - "ld %0, @%1; \n\t" - "addi %0, #1; \n\t" - "st %0, @%1; \n\t" - : "=&r" (result) - : "r" (&l->counter) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); - - return result; -} - -/** - * local_dec_return - decrement local variable and return it - * @l: pointer of type local_t - * - * Atomically decrements @l by 1 and returns the result. - */ -static inline long local_dec_return(local_t *l) -{ - unsigned long flags; - long result; - - local_irq_save(flags); - __asm__ __volatile__ ( - "# local_dec_return \n\t" - DCACHE_CLEAR("%0", "r4", "%1") - "ld %0, @%1; \n\t" - "addi %0, #-1; \n\t" - "st %0, @%1; \n\t" - : "=&r" (result) - : "r" (&l->counter) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); - - return result; -} - -/** - * local_inc - increment local variable - * @l: pointer of type local_t - * - * Atomically increments @l by 1. - */ -#define local_inc(l) ((void)local_inc_return(l)) - -/** - * local_dec - decrement local variable - * @l: pointer of type local_t - * - * Atomically decrements @l by 1. - */ -#define local_dec(l) ((void)local_dec_return(l)) - -/** - * local_inc_and_test - increment and test - * @l: pointer of type local_t - * - * Atomically increments @l by 1 - * and returns true if the result is zero, or false for all - * other cases. - */ -#define local_inc_and_test(l) (local_inc_return(l) == 0) - -/** - * local_dec_and_test - decrement and test - * @l: pointer of type local_t - * - * Atomically decrements @l by 1 and - * returns true if the result is 0, or false for all - * other cases. - */ -#define local_dec_and_test(l) (local_dec_return(l) == 0) - -/** - * local_add_negative - add and test if negative - * @l: pointer of type local_t - * @i: integer value to add - * - * Atomically adds @i to @l and returns true - * if the result is negative, or false when - * result is greater than or equal to zero. - */ -#define local_add_negative(i, l) (local_add_return((i), (l)) < 0) - -#define local_cmpxchg(l, o, n) (cmpxchg_local(&((l)->counter), (o), (n))) -#define local_xchg(v, new) (xchg_local(&((l)->counter), new)) - -/** - * local_add_unless - add unless the number is a given value - * @l: pointer of type local_t - * @a: the amount to add to l... - * @u: ...unless l is equal to u. - * - * Atomically adds @a to @l, so long as it was not @u. - * Returns non-zero if @l was not @u, and zero otherwise. - */ -static inline int local_add_unless(local_t *l, long a, long u) -{ - long c, old; - c = local_read(l); - for (;;) { - if (unlikely(c == (u))) - break; - old = local_cmpxchg((l), c, c + (a)); - if (likely(old == c)) - break; - c = old; - } - return c != (u); -} - -#define local_inc_not_zero(l) local_add_unless((l), 1, 0) - -static inline void local_clear_mask(unsigned long mask, local_t *addr) -{ - unsigned long flags; - unsigned long tmp; - - local_irq_save(flags); - __asm__ __volatile__ ( - "# local_clear_mask \n\t" - DCACHE_CLEAR("%0", "r5", "%1") - "ld %0, @%1; \n\t" - "and %0, %2; \n\t" - "st %0, @%1; \n\t" - : "=&r" (tmp) - : "r" (addr), "r" (~mask) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r5" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); -} - -static inline void local_set_mask(unsigned long mask, local_t *addr) -{ - unsigned long flags; - unsigned long tmp; - - local_irq_save(flags); - __asm__ __volatile__ ( - "# local_set_mask \n\t" - DCACHE_CLEAR("%0", "r5", "%1") - "ld %0, @%1; \n\t" - "or %0, %2; \n\t" - "st %0, @%1; \n\t" - : "=&r" (tmp) - : "r" (addr), "r" (mask) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r5" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); -} - -/* Atomic operations are already serializing on m32r */ -#define smp_mb__before_local_dec() barrier() -#define smp_mb__after_local_dec() barrier() -#define smp_mb__before_local_inc() barrier() -#define smp_mb__after_local_inc() barrier() - -/* Use these for per-cpu local_t variables: on some archs they are - * much more efficient than these naive implementations. Note they take - * a variable, not an address. - */ - -#define __local_inc(l) ((l)->a.counter++) -#define __local_dec(l) ((l)->a.counter++) -#define __local_add(i, l) ((l)->a.counter += (i)) -#define __local_sub(i, l) ((l)->a.counter -= (i)) - -/* Use these for per-cpu local_t variables: on some archs they are - * much more efficient than these naive implementations. Note they take - * a variable, not an address. - */ - -#endif /* __M32R_LOCAL_H */ diff --git a/arch/m32r/include/asm/local64.h b/arch/m32r/include/asm/local64.h deleted file mode 100644 index 36c93b5cc239..000000000000 --- a/arch/m32r/include/asm/local64.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/m32r/include/asm/m32102.h b/arch/m32r/include/asm/m32102.h deleted file mode 100644 index f0a986fece65..000000000000 --- a/arch/m32r/include/asm/m32102.h +++ /dev/null @@ -1,315 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _M32102_H_ -#define _M32102_H_ - -/* - * Renesas M32R 32102 group - * - * Copyright (c) 2001 Hitoshi Yamamoto - * Copyright (c) 2003, 2004 Renesas Technology Corp. - */ - -/*======================================================================* - * Special Function Register - *======================================================================*/ -#if !defined(CONFIG_CHIP_M32104) -#define M32R_SFR_OFFSET (0x00E00000) /* 0x00E00000-0x00EFFFFF 1[MB] */ -#else -#define M32R_SFR_OFFSET (0x00700000) /* 0x00700000-0x007FFFFF 1[MB] */ -#endif - -/* - * Clock and Power Management registers. - */ -#define M32R_CPM_OFFSET (0x000F4000+M32R_SFR_OFFSET) - -#define M32R_CPM_CPUCLKCR_PORTL (0x00+M32R_CPM_OFFSET) -#define M32R_CPM_CLKMOD_PORTL (0x04+M32R_CPM_OFFSET) -#define M32R_CPM_PLLCR_PORTL (0x08+M32R_CPM_OFFSET) - -/* - * DMA Controller registers. - */ -#define M32R_DMA_OFFSET (0x000F8000+M32R_SFR_OFFSET) - -#define M32R_DMAEN_PORTL (0x000+M32R_DMA_OFFSET) -#define M32R_DMAISTS_PORTL (0x004+M32R_DMA_OFFSET) -#define M32R_DMAEDET_PORTL (0x008+M32R_DMA_OFFSET) -#define M32R_DMAASTS_PORTL (0x00c+M32R_DMA_OFFSET) - -#define M32R_DMA0CR0_PORTL (0x100+M32R_DMA_OFFSET) -#define M32R_DMA0CR1_PORTL (0x104+M32R_DMA_OFFSET) -#define M32R_DMA0CSA_PORTL (0x108+M32R_DMA_OFFSET) -#define M32R_DMA0RSA_PORTL (0x10c+M32R_DMA_OFFSET) -#define M32R_DMA0CDA_PORTL (0x110+M32R_DMA_OFFSET) -#define M32R_DMA0RDA_PORTL (0x114+M32R_DMA_OFFSET) -#define M32R_DMA0CBCUT_PORTL (0x118+M32R_DMA_OFFSET) -#define M32R_DMA0RBCUT_PORTL (0x11c+M32R_DMA_OFFSET) - -#define M32R_DMA1CR0_PORTL (0x200+M32R_DMA_OFFSET) -#define M32R_DMA1CR1_PORTL (0x204+M32R_DMA_OFFSET) -#define M32R_DMA1CSA_PORTL (0x208+M32R_DMA_OFFSET) -#define M32R_DMA1RSA_PORTL (0x20c+M32R_DMA_OFFSET) -#define M32R_DMA1CDA_PORTL (0x210+M32R_DMA_OFFSET) -#define M32R_DMA1RDA_PORTL (0x214+M32R_DMA_OFFSET) -#define M32R_DMA1CBCUT_PORTL (0x218+M32R_DMA_OFFSET) -#define M32R_DMA1RBCUT_PORTL (0x21c+M32R_DMA_OFFSET) - -/* - * Multi Function Timer registers. - */ -#define M32R_MFT_OFFSET (0x000FC000+M32R_SFR_OFFSET) - -#define M32R_MFTCR_PORTL (0x000+M32R_MFT_OFFSET) /* MFT control */ -#define M32R_MFTRPR_PORTL (0x004+M32R_MFT_OFFSET) /* MFT real port */ - -#define M32R_MFT0_OFFSET (0x100+M32R_MFT_OFFSET) -#define M32R_MFT0MOD_PORTL (0x00+M32R_MFT0_OFFSET) /* MFT0 mode */ -#define M32R_MFT0BOS_PORTL (0x04+M32R_MFT0_OFFSET) /* MFT0 b-port output status */ -#define M32R_MFT0CUT_PORTL (0x08+M32R_MFT0_OFFSET) /* MFT0 count */ -#define M32R_MFT0RLD_PORTL (0x0C+M32R_MFT0_OFFSET) /* MFT0 reload */ -#define M32R_MFT0CMPRLD_PORTL (0x10+M32R_MFT0_OFFSET) /* MFT0 compare reload */ - -#define M32R_MFT1_OFFSET (0x200+M32R_MFT_OFFSET) -#define M32R_MFT1MOD_PORTL (0x00+M32R_MFT1_OFFSET) /* MFT1 mode */ -#define M32R_MFT1BOS_PORTL (0x04+M32R_MFT1_OFFSET) /* MFT1 b-port output status */ -#define M32R_MFT1CUT_PORTL (0x08+M32R_MFT1_OFFSET) /* MFT1 count */ -#define M32R_MFT1RLD_PORTL (0x0C+M32R_MFT1_OFFSET) /* MFT1 reload */ -#define M32R_MFT1CMPRLD_PORTL (0x10+M32R_MFT1_OFFSET) /* MFT1 compare reload */ - -#define M32R_MFT2_OFFSET (0x300+M32R_MFT_OFFSET) -#define M32R_MFT2MOD_PORTL (0x00+M32R_MFT2_OFFSET) /* MFT2 mode */ -#define M32R_MFT2BOS_PORTL (0x04+M32R_MFT2_OFFSET) /* MFT2 b-port output status */ -#define M32R_MFT2CUT_PORTL (0x08+M32R_MFT2_OFFSET) /* MFT2 count */ -#define M32R_MFT2RLD_PORTL (0x0C+M32R_MFT2_OFFSET) /* MFT2 reload */ -#define M32R_MFT2CMPRLD_PORTL (0x10+M32R_MFT2_OFFSET) /* MFT2 compare reload */ - -#define M32R_MFT3_OFFSET (0x400+M32R_MFT_OFFSET) -#define M32R_MFT3MOD_PORTL (0x00+M32R_MFT3_OFFSET) /* MFT3 mode */ -#define M32R_MFT3BOS_PORTL (0x04+M32R_MFT3_OFFSET) /* MFT3 b-port output status */ -#define M32R_MFT3CUT_PORTL (0x08+M32R_MFT3_OFFSET) /* MFT3 count */ -#define M32R_MFT3RLD_PORTL (0x0C+M32R_MFT3_OFFSET) /* MFT3 reload */ -#define M32R_MFT3CMPRLD_PORTL (0x10+M32R_MFT3_OFFSET) /* MFT3 compare reload */ - -#define M32R_MFT4_OFFSET (0x500+M32R_MFT_OFFSET) -#define M32R_MFT4MOD_PORTL (0x00+M32R_MFT4_OFFSET) /* MFT4 mode */ -#define M32R_MFT4BOS_PORTL (0x04+M32R_MFT4_OFFSET) /* MFT4 b-port output status */ -#define M32R_MFT4CUT_PORTL (0x08+M32R_MFT4_OFFSET) /* MFT4 count */ -#define M32R_MFT4RLD_PORTL (0x0C+M32R_MFT4_OFFSET) /* MFT4 reload */ -#define M32R_MFT4CMPRLD_PORTL (0x10+M32R_MFT4_OFFSET) /* MFT4 compare reload */ - -#define M32R_MFT5_OFFSET (0x600+M32R_MFT_OFFSET) -#define M32R_MFT5MOD_PORTL (0x00+M32R_MFT5_OFFSET) /* MFT4 mode */ -#define M32R_MFT5BOS_PORTL (0x04+M32R_MFT5_OFFSET) /* MFT4 b-port output status */ -#define M32R_MFT5CUT_PORTL (0x08+M32R_MFT5_OFFSET) /* MFT4 count */ -#define M32R_MFT5RLD_PORTL (0x0C+M32R_MFT5_OFFSET) /* MFT4 reload */ -#define M32R_MFT5CMPRLD_PORTL (0x10+M32R_MFT5_OFFSET) /* MFT4 compare reload */ - -#if (defined(CONFIG_CHIP_M32700) && !defined(CONFIG_PLAT_MAPPI2)) \ - || defined(CONFIG_CHIP_M32104) -#define M32R_MFTCR_MFT0MSK (1UL<<31) /* b0 */ -#define M32R_MFTCR_MFT1MSK (1UL<<30) /* b1 */ -#define M32R_MFTCR_MFT2MSK (1UL<<29) /* b2 */ -#define M32R_MFTCR_MFT3MSK (1UL<<28) /* b3 */ -#define M32R_MFTCR_MFT4MSK (1UL<<27) /* b4 */ -#define M32R_MFTCR_MFT5MSK (1UL<<26) /* b5 */ -#define M32R_MFTCR_MFT0EN (1UL<<23) /* b8 */ -#define M32R_MFTCR_MFT1EN (1UL<<22) /* b9 */ -#define M32R_MFTCR_MFT2EN (1UL<<21) /* b10 */ -#define M32R_MFTCR_MFT3EN (1UL<<20) /* b11 */ -#define M32R_MFTCR_MFT4EN (1UL<<19) /* b12 */ -#define M32R_MFTCR_MFT5EN (1UL<<18) /* b13 */ -#else -#define M32R_MFTCR_MFT0MSK (1UL<<15) /* b16 */ -#define M32R_MFTCR_MFT1MSK (1UL<<14) /* b17 */ -#define M32R_MFTCR_MFT2MSK (1UL<<13) /* b18 */ -#define M32R_MFTCR_MFT3MSK (1UL<<12) /* b19 */ -#define M32R_MFTCR_MFT4MSK (1UL<<11) /* b20 */ -#define M32R_MFTCR_MFT5MSK (1UL<<10) /* b21 */ -#define M32R_MFTCR_MFT0EN (1UL<<7) /* b24 */ -#define M32R_MFTCR_MFT1EN (1UL<<6) /* b25 */ -#define M32R_MFTCR_MFT2EN (1UL<<5) /* b26 */ -#define M32R_MFTCR_MFT3EN (1UL<<4) /* b27 */ -#define M32R_MFTCR_MFT4EN (1UL<<3) /* b28 */ -#define M32R_MFTCR_MFT5EN (1UL<<2) /* b29 */ -#endif - -#define M32R_MFTMOD_CC_MASK (1UL<<15) /* b16 */ -#define M32R_MFTMOD_TCCR (1UL<<13) /* b18 */ -#define M32R_MFTMOD_GTSEL000 (0UL<<8) /* b21-23 : 000 */ -#define M32R_MFTMOD_GTSEL001 (1UL<<8) /* b21-23 : 001 */ -#define M32R_MFTMOD_GTSEL010 (2UL<<8) /* b21-23 : 010 */ -#define M32R_MFTMOD_GTSEL011 (3UL<<8) /* b21-23 : 011 */ -#define M32R_MFTMOD_GTSEL110 (6UL<<8) /* b21-23 : 110 */ -#define M32R_MFTMOD_GTSEL111 (7UL<<8) /* b21-23 : 111 */ -#define M32R_MFTMOD_CMSEL (1UL<<3) /* b28 */ -#define M32R_MFTMOD_CSSEL000 (0UL<<0) /* b29-b31 : 000 */ -#define M32R_MFTMOD_CSSEL001 (1UL<<0) /* b29-b31 : 001 */ -#define M32R_MFTMOD_CSSEL010 (2UL<<0) /* b29-b31 : 010 */ -#define M32R_MFTMOD_CSSEL011 (3UL<<0) /* b29-b31 : 011 */ -#define M32R_MFTMOD_CSSEL100 (4UL<<0) /* b29-b31 : 100 */ -#define M32R_MFTMOD_CSSEL110 (6UL<<0) /* b29-b31 : 110 */ - -/* - * Serial I/O registers. - */ -#define M32R_SIO_OFFSET (0x000FD000+M32R_SFR_OFFSET) - -#define M32R_SIO0_CR_PORTL (0x000+M32R_SIO_OFFSET) -#define M32R_SIO0_MOD0_PORTL (0x004+M32R_SIO_OFFSET) -#define M32R_SIO0_MOD1_PORTL (0x008+M32R_SIO_OFFSET) -#define M32R_SIO0_STS_PORTL (0x00C+M32R_SIO_OFFSET) -#define M32R_SIO0_TRCR_PORTL (0x010+M32R_SIO_OFFSET) -#define M32R_SIO0_BAUR_PORTL (0x014+M32R_SIO_OFFSET) -#define M32R_SIO0_RBAUR_PORTL (0x018+M32R_SIO_OFFSET) -#define M32R_SIO0_TXB_PORTL (0x01C+M32R_SIO_OFFSET) -#define M32R_SIO0_RXB_PORTL (0x020+M32R_SIO_OFFSET) - -/* - * Interrupt Control Unit registers. - */ -#define M32R_ICU_OFFSET (0x000FF000+M32R_SFR_OFFSET) -#define M32R_ICU_ISTS_PORTL (0x004+M32R_ICU_OFFSET) -#define M32R_ICU_IREQ0_PORTL (0x008+M32R_ICU_OFFSET) -#define M32R_ICU_IREQ1_PORTL (0x00C+M32R_ICU_OFFSET) -#define M32R_ICU_SBICR_PORTL (0x018+M32R_ICU_OFFSET) -#define M32R_ICU_IMASK_PORTL (0x01C+M32R_ICU_OFFSET) -#define M32R_ICU_CR1_PORTL (0x200+M32R_ICU_OFFSET) /* INT0 */ -#define M32R_ICU_CR2_PORTL (0x204+M32R_ICU_OFFSET) /* INT1 */ -#define M32R_ICU_CR3_PORTL (0x208+M32R_ICU_OFFSET) /* INT2 */ -#define M32R_ICU_CR4_PORTL (0x20C+M32R_ICU_OFFSET) /* INT3 */ -#define M32R_ICU_CR5_PORTL (0x210+M32R_ICU_OFFSET) /* INT4 */ -#define M32R_ICU_CR6_PORTL (0x214+M32R_ICU_OFFSET) /* INT5 */ -#define M32R_ICU_CR7_PORTL (0x218+M32R_ICU_OFFSET) /* INT6 */ -#define M32R_ICU_CR8_PORTL (0x219+M32R_ICU_OFFSET) /* INT7 */ -#define M32R_ICU_CR16_PORTL (0x23C+M32R_ICU_OFFSET) /* MFT0 */ -#define M32R_ICU_CR17_PORTL (0x240+M32R_ICU_OFFSET) /* MFT1 */ -#define M32R_ICU_CR18_PORTL (0x244+M32R_ICU_OFFSET) /* MFT2 */ -#define M32R_ICU_CR19_PORTL (0x248+M32R_ICU_OFFSET) /* MFT3 */ -#define M32R_ICU_CR20_PORTL (0x24C+M32R_ICU_OFFSET) /* MFT4 */ -#define M32R_ICU_CR21_PORTL (0x250+M32R_ICU_OFFSET) /* MFT5 */ -#define M32R_ICU_CR32_PORTL (0x27C+M32R_ICU_OFFSET) /* DMA0 */ -#define M32R_ICU_CR33_PORTL (0x280+M32R_ICU_OFFSET) /* DMA1 */ -#define M32R_ICU_CR48_PORTL (0x2BC+M32R_ICU_OFFSET) /* SIO0 */ -#define M32R_ICU_CR49_PORTL (0x2C0+M32R_ICU_OFFSET) /* SIO0 */ -#define M32R_ICU_CR50_PORTL (0x2C4+M32R_ICU_OFFSET) /* SIO1 */ -#define M32R_ICU_CR51_PORTL (0x2C8+M32R_ICU_OFFSET) /* SIO1 */ -#define M32R_ICU_CR52_PORTL (0x2CC+M32R_ICU_OFFSET) /* SIO2 */ -#define M32R_ICU_CR53_PORTL (0x2D0+M32R_ICU_OFFSET) /* SIO2 */ -#define M32R_ICU_CR54_PORTL (0x2D4+M32R_ICU_OFFSET) /* SIO3 */ -#define M32R_ICU_CR55_PORTL (0x2D8+M32R_ICU_OFFSET) /* SIO3 */ -#define M32R_ICU_CR56_PORTL (0x2DC+M32R_ICU_OFFSET) /* SIO4 */ -#define M32R_ICU_CR57_PORTL (0x2E0+M32R_ICU_OFFSET) /* SIO4 */ - -#ifdef CONFIG_SMP -#define M32R_ICU_IPICR0_PORTL (0x2dc+M32R_ICU_OFFSET) /* IPI0 */ -#define M32R_ICU_IPICR1_PORTL (0x2e0+M32R_ICU_OFFSET) /* IPI1 */ -#define M32R_ICU_IPICR2_PORTL (0x2e4+M32R_ICU_OFFSET) /* IPI2 */ -#define M32R_ICU_IPICR3_PORTL (0x2e8+M32R_ICU_OFFSET) /* IPI3 */ -#define M32R_ICU_IPICR4_PORTL (0x2ec+M32R_ICU_OFFSET) /* IPI4 */ -#define M32R_ICU_IPICR5_PORTL (0x2f0+M32R_ICU_OFFSET) /* IPI5 */ -#define M32R_ICU_IPICR6_PORTL (0x2f4+M32R_ICU_OFFSET) /* IPI6 */ -#define M32R_ICU_IPICR7_PORTL (0x2f8+M32R_ICU_OFFSET) /* IPI7 */ -#endif /* CONFIG_SMP */ - -#define M32R_ICUIMASK_IMSK0 (0UL<<16) /* b13-b15: Disable interrupt */ -#define M32R_ICUIMASK_IMSK1 (1UL<<16) /* b13-b15: Enable level 0 interrupt */ -#define M32R_ICUIMASK_IMSK2 (2UL<<16) /* b13-b15: Enable level 0,1 interrupt */ -#define M32R_ICUIMASK_IMSK3 (3UL<<16) /* b13-b15: Enable level 0-2 interrupt */ -#define M32R_ICUIMASK_IMSK4 (4UL<<16) /* b13-b15: Enable level 0-3 interrupt */ -#define M32R_ICUIMASK_IMSK5 (5UL<<16) /* b13-b15: Enable level 0-4 interrupt */ -#define M32R_ICUIMASK_IMSK6 (6UL<<16) /* b13-b15: Enable level 0-5 interrupt */ -#define M32R_ICUIMASK_IMSK7 (7UL<<16) /* b13-b15: Enable level 0-6 interrupt */ - -#define M32R_ICUCR_IEN (1UL<<12) /* b19: Interrupt enable */ -#define M32R_ICUCR_IRQ (1UL<<8) /* b23: Interrupt request */ -#define M32R_ICUCR_ISMOD00 (0UL<<4) /* b26-b27: Interrupt sense mode Edge HtoL */ -#define M32R_ICUCR_ISMOD01 (1UL<<4) /* b26-b27: Interrupt sense mode Level L */ -#define M32R_ICUCR_ISMOD10 (2UL<<4) /* b26-b27: Interrupt sense mode Edge LtoH*/ -#define M32R_ICUCR_ISMOD11 (3UL<<4) /* b26-b27: Interrupt sense mode Level H */ -#define M32R_ICUCR_ILEVEL0 (0UL<<0) /* b29-b31: Interrupt priority level 0 */ -#define M32R_ICUCR_ILEVEL1 (1UL<<0) /* b29-b31: Interrupt priority level 1 */ -#define M32R_ICUCR_ILEVEL2 (2UL<<0) /* b29-b31: Interrupt priority level 2 */ -#define M32R_ICUCR_ILEVEL3 (3UL<<0) /* b29-b31: Interrupt priority level 3 */ -#define M32R_ICUCR_ILEVEL4 (4UL<<0) /* b29-b31: Interrupt priority level 4 */ -#define M32R_ICUCR_ILEVEL5 (5UL<<0) /* b29-b31: Interrupt priority level 5 */ -#define M32R_ICUCR_ILEVEL6 (6UL<<0) /* b29-b31: Interrupt priority level 6 */ -#define M32R_ICUCR_ILEVEL7 (7UL<<0) /* b29-b31: Disable interrupt */ - -#define M32R_IRQ_INT0 (1) /* INT0 */ -#define M32R_IRQ_INT1 (2) /* INT1 */ -#define M32R_IRQ_INT2 (3) /* INT2 */ -#define M32R_IRQ_INT3 (4) /* INT3 */ -#define M32R_IRQ_INT4 (5) /* INT4 */ -#define M32R_IRQ_INT5 (6) /* INT5 */ -#define M32R_IRQ_INT6 (7) /* INT6 */ -#define M32R_IRQ_MFT0 (16) /* MFT0 */ -#define M32R_IRQ_MFT1 (17) /* MFT1 */ -#define M32R_IRQ_MFT2 (18) /* MFT2 */ -#define M32R_IRQ_MFT3 (19) /* MFT3 */ -#ifdef CONFIG_CHIP_M32104 -#define M32R_IRQ_MFTX0 (24) /* MFTX0 */ -#define M32R_IRQ_MFTX1 (25) /* MFTX1 */ -#define M32R_IRQ_DMA0 (32) /* DMA0 */ -#define M32R_IRQ_DMA1 (33) /* DMA1 */ -#define M32R_IRQ_DMA2 (34) /* DMA2 */ -#define M32R_IRQ_DMA3 (35) /* DMA3 */ -#define M32R_IRQ_SIO0_R (40) /* SIO0 send */ -#define M32R_IRQ_SIO0_S (41) /* SIO0 receive */ -#define M32R_IRQ_SIO1_R (42) /* SIO1 send */ -#define M32R_IRQ_SIO1_S (43) /* SIO1 receive */ -#define M32R_IRQ_SIO2_R (44) /* SIO2 send */ -#define M32R_IRQ_SIO2_S (45) /* SIO2 receive */ -#define M32R_IRQ_SIO3_R (46) /* SIO3 send */ -#define M32R_IRQ_SIO3_S (47) /* SIO3 receive */ -#define M32R_IRQ_ADC (56) /* ADC */ -#define M32R_IRQ_PC (57) /* PC */ -#else /* ! M32104 */ -#define M32R_IRQ_DMA0 (32) /* DMA0 */ -#define M32R_IRQ_DMA1 (33) /* DMA1 */ -#define M32R_IRQ_SIO0_R (48) /* SIO0 send */ -#define M32R_IRQ_SIO0_S (49) /* SIO0 receive */ -#define M32R_IRQ_SIO1_R (50) /* SIO1 send */ -#define M32R_IRQ_SIO1_S (51) /* SIO1 receive */ -#define M32R_IRQ_SIO2_R (52) /* SIO2 send */ -#define M32R_IRQ_SIO2_S (53) /* SIO2 receive */ -#define M32R_IRQ_SIO3_R (54) /* SIO3 send */ -#define M32R_IRQ_SIO3_S (55) /* SIO3 receive */ -#define M32R_IRQ_SIO4_R (56) /* SIO4 send */ -#define M32R_IRQ_SIO4_S (57) /* SIO4 receive */ -#endif /* ! M32104 */ - -#ifdef CONFIG_SMP -#define M32R_IRQ_IPI0 (56) -#define M32R_IRQ_IPI1 (57) -#define M32R_IRQ_IPI2 (58) -#define M32R_IRQ_IPI3 (59) -#define M32R_IRQ_IPI4 (60) -#define M32R_IRQ_IPI5 (61) -#define M32R_IRQ_IPI6 (62) -#define M32R_IRQ_IPI7 (63) -#define M32R_CPUID_PORTL (0xffffffe0) - -#define M32R_FPGA_TOP (0x000F0000+M32R_SFR_OFFSET) - -#define M32R_FPGA_NUM_OF_CPUS_PORTL (0x00+M32R_FPGA_TOP) -#define M32R_FPGA_CPU_NAME0_PORTL (0x10+M32R_FPGA_TOP) -#define M32R_FPGA_CPU_NAME1_PORTL (0x14+M32R_FPGA_TOP) -#define M32R_FPGA_CPU_NAME2_PORTL (0x18+M32R_FPGA_TOP) -#define M32R_FPGA_CPU_NAME3_PORTL (0x1c+M32R_FPGA_TOP) -#define M32R_FPGA_MODEL_ID0_PORTL (0x20+M32R_FPGA_TOP) -#define M32R_FPGA_MODEL_ID1_PORTL (0x24+M32R_FPGA_TOP) -#define M32R_FPGA_MODEL_ID2_PORTL (0x28+M32R_FPGA_TOP) -#define M32R_FPGA_MODEL_ID3_PORTL (0x2c+M32R_FPGA_TOP) -#define M32R_FPGA_VERSION0_PORTL (0x30+M32R_FPGA_TOP) -#define M32R_FPGA_VERSION1_PORTL (0x34+M32R_FPGA_TOP) - -#endif /* CONFIG_SMP */ - -#ifndef __ASSEMBLY__ -typedef struct { - unsigned long icucr; /* ICU Control Register */ -} icu_data_t; -#endif - -#endif /* _M32102_H_ */ diff --git a/arch/m32r/include/asm/m32104ut/m32104ut_pld.h b/arch/m32r/include/asm/m32104ut/m32104ut_pld.h deleted file mode 100644 index 1feae9709f24..000000000000 --- a/arch/m32r/include/asm/m32104ut/m32104ut_pld.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef _M32104UT_M32104UT_PLD_H -#define _M32104UT_M32104UT_PLD_H - -/* - * include/asm-m32r/m32104ut/m32104ut_pld.h - * - * Definitions for Programmable Logic Device(PLD) on M32104UT board. - * Based on m32700ut_pld.h - * - * Copyright (c) 2002 Takeo Takahashi - * Copyright (c) 2005 Naoto Sugai - * - * 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. - */ - -#if defined(CONFIG_PLAT_M32104UT) -#define PLD_PLAT_BASE 0x02c00000 -#else -#error "no platform configuration" -#endif - -#ifndef __ASSEMBLY__ -/* - * C functions use non-cache address. - */ -#define PLD_BASE (PLD_PLAT_BASE /* + NONCACHE_OFFSET */) -#define __reg8 (volatile unsigned char *) -#define __reg16 (volatile unsigned short *) -#define __reg32 (volatile unsigned int *) -#else -#define PLD_BASE (PLD_PLAT_BASE + NONCACHE_OFFSET) -#define __reg8 -#define __reg16 -#define __reg32 -#endif /* __ASSEMBLY__ */ - -/* CFC */ -#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) -#define PLD_CFSTS __reg16(PLD_BASE + 0x0002) -#define PLD_CFIMASK __reg16(PLD_BASE + 0x0004) -#define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006) - -/* MMC */ -#define PLD_MMCCR __reg16(PLD_BASE + 0x4000) -#define PLD_MMCMOD __reg16(PLD_BASE + 0x4002) -#define PLD_MMCSTS __reg16(PLD_BASE + 0x4006) -#define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a) -#define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c) -#define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e) -#define PLD_MMCDET __reg16(PLD_BASE + 0x4010) -#define PLD_MMCWP __reg16(PLD_BASE + 0x4012) -#define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000) -#define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000) -#define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000) -#define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006) - -/* ICU - * ICUISTS: status register - * ICUIREQ0: request register - * ICUIREQ1: request register - * ICUCR3: control register for CFIREQ# interrupt - * ICUCR4: control register for CFC Card insert interrupt - * ICUCR5: control register for CFC Card eject interrupt - * ICUCR6: control register for external interrupt - * ICUCR11: control register for MMC Card insert/eject interrupt - * ICUCR13: control register for SC error interrupt - * ICUCR14: control register for SC receive interrupt - * ICUCR15: control register for SC send interrupt - */ - -#define PLD_IRQ_INT0 (M32104UT_PLD_IRQ_BASE + 0) /* None */ -#define PLD_IRQ_CFIREQ (M32104UT_PLD_IRQ_BASE + 3) /* CF IREQ */ -#define PLD_IRQ_CFC_INSERT (M32104UT_PLD_IRQ_BASE + 4) /* CF Insert */ -#define PLD_IRQ_CFC_EJECT (M32104UT_PLD_IRQ_BASE + 5) /* CF Eject */ -#define PLD_IRQ_EXINT (M32104UT_PLD_IRQ_BASE + 6) /* EXINT */ -#define PLD_IRQ_MMCCARD (M32104UT_PLD_IRQ_BASE + 11) /* MMC Insert/Eject */ -#define PLD_IRQ_SC_ERROR (M32104UT_PLD_IRQ_BASE + 13) /* SC error */ -#define PLD_IRQ_SC_RCV (M32104UT_PLD_IRQ_BASE + 14) /* SC receive */ -#define PLD_IRQ_SC_SND (M32104UT_PLD_IRQ_BASE + 15) /* SC send */ - -#define PLD_ICUISTS __reg16(PLD_BASE + 0x8002) -#define PLD_ICUISTS_VECB_MASK (0xf000) -#define PLD_ICUISTS_VECB(x) ((x) & PLD_ICUISTS_VECB_MASK) -#define PLD_ICUISTS_ISN_MASK (0x07c0) -#define PLD_ICUISTS_ISN(x) ((x) & PLD_ICUISTS_ISN_MASK) -#define PLD_ICUCR3 __reg16(PLD_BASE + 0x8104) -#define PLD_ICUCR4 __reg16(PLD_BASE + 0x8106) -#define PLD_ICUCR5 __reg16(PLD_BASE + 0x8108) -#define PLD_ICUCR6 __reg16(PLD_BASE + 0x810a) -#define PLD_ICUCR11 __reg16(PLD_BASE + 0x8114) -#define PLD_ICUCR13 __reg16(PLD_BASE + 0x8118) -#define PLD_ICUCR14 __reg16(PLD_BASE + 0x811a) -#define PLD_ICUCR15 __reg16(PLD_BASE + 0x811c) -#define PLD_ICUCR_IEN (0x1000) -#define PLD_ICUCR_IREQ (0x0100) -#define PLD_ICUCR_ISMOD00 (0x0000) /* Low edge */ -#define PLD_ICUCR_ISMOD01 (0x0010) /* Low level */ -#define PLD_ICUCR_ISMOD02 (0x0020) /* High edge */ -#define PLD_ICUCR_ISMOD03 (0x0030) /* High level */ -#define PLD_ICUCR_ILEVEL0 (0x0000) -#define PLD_ICUCR_ILEVEL1 (0x0001) -#define PLD_ICUCR_ILEVEL2 (0x0002) -#define PLD_ICUCR_ILEVEL3 (0x0003) -#define PLD_ICUCR_ILEVEL4 (0x0004) -#define PLD_ICUCR_ILEVEL5 (0x0005) -#define PLD_ICUCR_ILEVEL6 (0x0006) -#define PLD_ICUCR_ILEVEL7 (0x0007) - -/* Power Control of MMC and CF */ -#define PLD_CPCR __reg16(PLD_BASE + 0x14000) -#define PLD_CPCR_CDP 0x0001 - -/* LED Control - * - * 1: DIP swich side - * 2: Reset switch side - */ -#define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002) -#define PLD_IOLED_1_ON 0x001 -#define PLD_IOLED_1_OFF 0x000 -#define PLD_IOLED_2_ON 0x002 -#define PLD_IOLED_2_OFF 0x000 - -/* DIP Switch - * 0: Write-protect of Flash Memory (0:protected, 1:non-protected) - * 1: - - * 2: - - * 3: - - */ -#define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004) -#define PLD_IOSWSTS_IOSW2 0x0200 -#define PLD_IOSWSTS_IOSW1 0x0100 -#define PLD_IOSWSTS_IOWP0 0x0001 - -/* CRC */ -#define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000) -#define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002) -#define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004) -#define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006) -#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) -#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) - -/* RTC */ -#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) -#define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002) -#define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004) -#define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006) -#define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008) - -/* SIM Card */ -#define PLD_SCCR __reg16(PLD_BASE + 0x38000) -#define PLD_SCMOD __reg16(PLD_BASE + 0x38004) -#define PLD_SCSTS __reg16(PLD_BASE + 0x38006) -#define PLD_SCINTCR __reg16(PLD_BASE + 0x38008) -#define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a) -#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) -#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) - -#endif /* _M32104UT_M32104UT_PLD_H */ diff --git a/arch/m32r/include/asm/m32700ut/m32700ut_lan.h b/arch/m32r/include/asm/m32700ut/m32700ut_lan.h deleted file mode 100644 index aae810a4fb2c..000000000000 --- a/arch/m32r/include/asm/m32700ut/m32700ut_lan.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef _M32700UT_M32700UT_LAN_H -#define _M32700UT_M32700UT_LAN_H - -/* - * include/asm-m32r/m32700ut/m32700ut_lan.h - * - * M32700UT-LAN board - * - * Copyright (c) 2002 Takeo Takahashi - * - * 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. - */ - -#ifndef __ASSEMBLY__ -/* - * C functions use non-cache address. - */ -#define M32700UT_LAN_BASE (0x10000000 /* + NONCACHE_OFFSET */) -#else -#define M32700UT_LAN_BASE (0x10000000 + NONCACHE_OFFSET) -#endif /* __ASSEMBLY__ */ - -/* ICU - * ICUISTS: status register - * ICUIREQ0: request register - * ICUIREQ1: request register - * ICUCR3: control register for CFIREQ# interrupt - * ICUCR4: control register for CFC Card insert interrupt - * ICUCR5: control register for CFC Card eject interrupt - * ICUCR6: control register for external interrupt - * ICUCR11: control register for MMC Card insert/eject interrupt - * ICUCR13: control register for SC error interrupt - * ICUCR14: control register for SC receive interrupt - * ICUCR15: control register for SC send interrupt - * ICUCR16: control register for SIO0 receive interrupt - * ICUCR17: control register for SIO0 send interrupt - */ -#define M32700UT_LAN_IRQ_LAN (M32700UT_LAN_PLD_IRQ_BASE + 1) /* LAN */ -#define M32700UT_LAN_IRQ_I2C (M32700UT_LAN_PLD_IRQ_BASE + 3) /* I2C */ - -#define M32700UT_LAN_ICUISTS __reg16(M32700UT_LAN_BASE + 0xc0002) -#define M32700UT_LAN_ICUISTS_VECB_MASK (0xf000) -#define M32700UT_LAN_VECB(x) ((x) & M32700UT_LAN_ICUISTS_VECB_MASK) -#define M32700UT_LAN_ICUISTS_ISN_MASK (0x07c0) -#define M32700UT_LAN_ICUISTS_ISN(x) ((x) & M32700UT_LAN_ICUISTS_ISN_MASK) -#define M32700UT_LAN_ICUIREQ0 __reg16(M32700UT_LAN_BASE + 0xc0004) -#define M32700UT_LAN_ICUCR1 __reg16(M32700UT_LAN_BASE + 0xc0010) -#define M32700UT_LAN_ICUCR3 __reg16(M32700UT_LAN_BASE + 0xc0014) - -/* - * AR register on PLD - */ -#define ARVCR0 __reg32(M32700UT_LAN_BASE + 0x40000) -#define ARVCR0_VDS 0x00080000 -#define ARVCR0_RST 0x00010000 -#define ARVCR1 __reg32(M32700UT_LAN_BASE + 0x40004) -#define ARVCR1_QVGA 0x02000000 -#define ARVCR1_NORMAL 0x01000000 -#define ARVCR1_HIEN 0x00010000 -#define ARVHCOUNT __reg32(M32700UT_LAN_BASE + 0x40008) -#define ARDATA __reg32(M32700UT_LAN_BASE + 0x40010) -#define ARINTSEL __reg32(M32700UT_LAN_BASE + 0x40014) -#define ARINTSEL_INT3 0x10000000 /* CPU INT3 */ -#define ARDATA32 __reg32(M32700UT_LAN_BASE + 0x04040010) // Block 5 -/* -#define ARINTSEL_SEL2 0x00002000 -#define ARINTSEL_SEL3 0x00001000 -#define ARINTSEL_SEL6 0x00000200 -#define ARINTSEL_SEL7 0x00000100 -#define ARINTSEL_SEL9 0x00000040 -#define ARINTSEL_SEL10 0x00000020 -#define ARINTSEL_SEL11 0x00000010 -#define ARINTSEL_SEL12 0x00000008 -*/ - -/* - * I2C register on PLD - */ -#define PLDI2CCR __reg32(M32700UT_LAN_BASE + 0x40040) -#define PLDI2CCR_ES0 0x00000001 /* enable I2C interface */ -#define PLDI2CMOD __reg32(M32700UT_LAN_BASE + 0x40044) -#define PLDI2CMOD_ACKCLK 0x00000200 -#define PLDI2CMOD_DTWD 0x00000100 -#define PLDI2CMOD_10BT 0x00000004 -#define PLDI2CMOD_ATM_NORMAL 0x00000000 -#define PLDI2CMOD_ATM_AUTO 0x00000003 -#define PLDI2CACK __reg32(M32700UT_LAN_BASE + 0x40048) -#define PLDI2CACK_ACK 0x00000001 -#define PLDI2CFREQ __reg32(M32700UT_LAN_BASE + 0x4004c) -#define PLDI2CCND __reg32(M32700UT_LAN_BASE + 0x40050) -#define PLDI2CCND_START 0x00000001 -#define PLDI2CCND_STOP 0x00000002 -#define PLDI2CSTEN __reg32(M32700UT_LAN_BASE + 0x40054) -#define PLDI2CSTEN_STEN 0x00000001 -#define PLDI2CDATA __reg32(M32700UT_LAN_BASE + 0x40060) -#define PLDI2CSTS __reg32(M32700UT_LAN_BASE + 0x40064) -#define PLDI2CSTS_TRX 0x00000020 -#define PLDI2CSTS_BB 0x00000010 -#define PLDI2CSTS_NOACK 0x00000001 /* 0:ack, 1:noack */ - -#endif /* _M32700UT_M32700UT_LAN_H */ diff --git a/arch/m32r/include/asm/m32700ut/m32700ut_lcd.h b/arch/m32r/include/asm/m32700ut/m32700ut_lcd.h deleted file mode 100644 index 4c2489079788..000000000000 --- a/arch/m32r/include/asm/m32700ut/m32700ut_lcd.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _M32700UT_M32700UT_LCD_H -#define _M32700UT_M32700UT_LCD_H - -/* - * include/asm-m32r/m32700ut/m32700ut_lcd.h - * - * M32700UT-LCD board - * - * Copyright (c) 2002 Takeo Takahashi - * - * 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. - */ - -#ifndef __ASSEMBLY__ -/* - * C functions use non-cache address. - */ -#define M32700UT_LCD_BASE (0x10000000 /* + NONCACHE_OFFSET */) -#else -#define M32700UT_LCD_BASE (0x10000000 + NONCACHE_OFFSET) -#endif /* __ASSEMBLY__ */ - -/* - * ICU - */ -#define M32700UT_LCD_IRQ_BAT_INT (M32700UT_LCD_PLD_IRQ_BASE + 1) -#define M32700UT_LCD_IRQ_USB_INT1 (M32700UT_LCD_PLD_IRQ_BASE + 2) -#define M32700UT_LCD_IRQ_AUDT0 (M32700UT_LCD_PLD_IRQ_BASE + 3) -#define M32700UT_LCD_IRQ_AUDT2 (M32700UT_LCD_PLD_IRQ_BASE + 4) -#define M32700UT_LCD_IRQ_BATSIO_RCV (M32700UT_LCD_PLD_IRQ_BASE + 16) -#define M32700UT_LCD_IRQ_BATSIO_SND (M32700UT_LCD_PLD_IRQ_BASE + 17) -#define M32700UT_LCD_IRQ_ASNDSIO_RCV (M32700UT_LCD_PLD_IRQ_BASE + 18) -#define M32700UT_LCD_IRQ_ASNDSIO_SND (M32700UT_LCD_PLD_IRQ_BASE + 19) -#define M32700UT_LCD_IRQ_ACNLSIO_SND (M32700UT_LCD_PLD_IRQ_BASE + 21) - -#define M32700UT_LCD_ICUISTS __reg16(M32700UT_LCD_BASE + 0x300002) -#define M32700UT_LCD_ICUISTS_VECB_MASK (0xf000) -#define M32700UT_LCD_VECB(x) ((x) & M32700UT_LCD_ICUISTS_VECB_MASK) -#define M32700UT_LCD_ICUISTS_ISN_MASK (0x07c0) -#define M32700UT_LCD_ICUISTS_ISN(x) ((x) & M32700UT_LCD_ICUISTS_ISN_MASK) -#define M32700UT_LCD_ICUIREQ0 __reg16(M32700UT_LCD_BASE + 0x300004) -#define M32700UT_LCD_ICUIREQ1 __reg16(M32700UT_LCD_BASE + 0x300006) -#define M32700UT_LCD_ICUCR1 __reg16(M32700UT_LCD_BASE + 0x300020) -#define M32700UT_LCD_ICUCR2 __reg16(M32700UT_LCD_BASE + 0x300022) -#define M32700UT_LCD_ICUCR3 __reg16(M32700UT_LCD_BASE + 0x300024) -#define M32700UT_LCD_ICUCR4 __reg16(M32700UT_LCD_BASE + 0x300026) -#define M32700UT_LCD_ICUCR16 __reg16(M32700UT_LCD_BASE + 0x300030) -#define M32700UT_LCD_ICUCR17 __reg16(M32700UT_LCD_BASE + 0x300032) -#define M32700UT_LCD_ICUCR18 __reg16(M32700UT_LCD_BASE + 0x300034) -#define M32700UT_LCD_ICUCR19 __reg16(M32700UT_LCD_BASE + 0x300036) -#define M32700UT_LCD_ICUCR21 __reg16(M32700UT_LCD_BASE + 0x30003a) - -#endif /* _M32700UT_M32700UT_LCD_H */ diff --git a/arch/m32r/include/asm/m32700ut/m32700ut_pld.h b/arch/m32r/include/asm/m32700ut/m32700ut_pld.h deleted file mode 100644 index 35294670b187..000000000000 --- a/arch/m32r/include/asm/m32700ut/m32700ut_pld.h +++ /dev/null @@ -1,259 +0,0 @@ -#ifndef _M32700UT_M32700UT_PLD_H -#define _M32700UT_M32700UT_PLD_H - -/* - * include/asm-m32r/m32700ut/m32700ut_pld.h - * - * Definitions for Programmable Logic Device(PLD) on M32700UT board. - * - * Copyright (c) 2002 Takeo Takahashi - * - * 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. - */ - -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) -#define PLD_PLAT_BASE 0x04c00000 -#else -#error "no platform configuration" -#endif - -#ifndef __ASSEMBLY__ -/* - * C functions use non-cache address. - */ -#define PLD_BASE (PLD_PLAT_BASE /* + NONCACHE_OFFSET */) -#define __reg8 (volatile unsigned char *) -#define __reg16 (volatile unsigned short *) -#define __reg32 (volatile unsigned int *) -#else -#define PLD_BASE (PLD_PLAT_BASE + NONCACHE_OFFSET) -#define __reg8 -#define __reg16 -#define __reg32 -#endif /* __ASSEMBLY__ */ - -/* CFC */ -#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) -#define PLD_CFSTS __reg16(PLD_BASE + 0x0002) -#define PLD_CFIMASK __reg16(PLD_BASE + 0x0004) -#define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006) -#define PLD_CFVENCR __reg16(PLD_BASE + 0x0008) -#define PLD_CFCR0 __reg16(PLD_BASE + 0x000a) -#define PLD_CFCR1 __reg16(PLD_BASE + 0x000c) -#define PLD_IDERSTCR __reg16(PLD_BASE + 0x0010) - -/* MMC */ -#define PLD_MMCCR __reg16(PLD_BASE + 0x4000) -#define PLD_MMCMOD __reg16(PLD_BASE + 0x4002) -#define PLD_MMCSTS __reg16(PLD_BASE + 0x4006) -#define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a) -#define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c) -#define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e) -#define PLD_MMCDET __reg16(PLD_BASE + 0x4010) -#define PLD_MMCWP __reg16(PLD_BASE + 0x4012) -#define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000) -#define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000) -#define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000) -#define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006) - -/* ICU - * ICUISTS: status register - * ICUIREQ0: request register - * ICUIREQ1: request register - * ICUCR3: control register for CFIREQ# interrupt - * ICUCR4: control register for CFC Card insert interrupt - * ICUCR5: control register for CFC Card eject interrupt - * ICUCR6: control register for external interrupt - * ICUCR11: control register for MMC Card insert/eject interrupt - * ICUCR13: control register for SC error interrupt - * ICUCR14: control register for SC receive interrupt - * ICUCR15: control register for SC send interrupt - * ICUCR16: control register for SIO0 receive interrupt - * ICUCR17: control register for SIO0 send interrupt - */ -#if !defined(CONFIG_PLAT_USRV) -#define PLD_IRQ_INT0 (M32700UT_PLD_IRQ_BASE + 0) /* None */ -#define PLD_IRQ_INT1 (M32700UT_PLD_IRQ_BASE + 1) /* reserved */ -#define PLD_IRQ_INT2 (M32700UT_PLD_IRQ_BASE + 2) /* reserved */ -#define PLD_IRQ_CFIREQ (M32700UT_PLD_IRQ_BASE + 3) /* CF IREQ */ -#define PLD_IRQ_CFC_INSERT (M32700UT_PLD_IRQ_BASE + 4) /* CF Insert */ -#define PLD_IRQ_CFC_EJECT (M32700UT_PLD_IRQ_BASE + 5) /* CF Eject */ -#define PLD_IRQ_EXINT (M32700UT_PLD_IRQ_BASE + 6) /* EXINT */ -#define PLD_IRQ_INT7 (M32700UT_PLD_IRQ_BASE + 7) /* reserved */ -#define PLD_IRQ_INT8 (M32700UT_PLD_IRQ_BASE + 8) /* reserved */ -#define PLD_IRQ_INT9 (M32700UT_PLD_IRQ_BASE + 9) /* reserved */ -#define PLD_IRQ_INT10 (M32700UT_PLD_IRQ_BASE + 10) /* reserved */ -#define PLD_IRQ_MMCCARD (M32700UT_PLD_IRQ_BASE + 11) /* MMC Insert/Eject */ -#define PLD_IRQ_INT12 (M32700UT_PLD_IRQ_BASE + 12) /* reserved */ -#define PLD_IRQ_SC_ERROR (M32700UT_PLD_IRQ_BASE + 13) /* SC error */ -#define PLD_IRQ_SC_RCV (M32700UT_PLD_IRQ_BASE + 14) /* SC receive */ -#define PLD_IRQ_SC_SND (M32700UT_PLD_IRQ_BASE + 15) /* SC send */ -#define PLD_IRQ_SIO0_RCV (M32700UT_PLD_IRQ_BASE + 16) /* SIO receive */ -#define PLD_IRQ_SIO0_SND (M32700UT_PLD_IRQ_BASE + 17) /* SIO send */ -#define PLD_IRQ_INT18 (M32700UT_PLD_IRQ_BASE + 18) /* reserved */ -#define PLD_IRQ_INT19 (M32700UT_PLD_IRQ_BASE + 19) /* reserved */ -#define PLD_IRQ_INT20 (M32700UT_PLD_IRQ_BASE + 20) /* reserved */ -#define PLD_IRQ_INT21 (M32700UT_PLD_IRQ_BASE + 21) /* reserved */ -#define PLD_IRQ_INT22 (M32700UT_PLD_IRQ_BASE + 22) /* reserved */ -#define PLD_IRQ_INT23 (M32700UT_PLD_IRQ_BASE + 23) /* reserved */ -#define PLD_IRQ_INT24 (M32700UT_PLD_IRQ_BASE + 24) /* reserved */ -#define PLD_IRQ_INT25 (M32700UT_PLD_IRQ_BASE + 25) /* reserved */ -#define PLD_IRQ_INT26 (M32700UT_PLD_IRQ_BASE + 26) /* reserved */ -#define PLD_IRQ_INT27 (M32700UT_PLD_IRQ_BASE + 27) /* reserved */ -#define PLD_IRQ_INT28 (M32700UT_PLD_IRQ_BASE + 28) /* reserved */ -#define PLD_IRQ_INT29 (M32700UT_PLD_IRQ_BASE + 29) /* reserved */ -#define PLD_IRQ_INT30 (M32700UT_PLD_IRQ_BASE + 30) /* reserved */ -#define PLD_IRQ_INT31 (M32700UT_PLD_IRQ_BASE + 31) /* reserved */ - -#else /* CONFIG_PLAT_USRV */ - -#define PLD_IRQ_INT0 (M32700UT_PLD_IRQ_BASE + 0) /* None */ -#define PLD_IRQ_INT1 (M32700UT_PLD_IRQ_BASE + 1) /* reserved */ -#define PLD_IRQ_INT2 (M32700UT_PLD_IRQ_BASE + 2) /* reserved */ -#define PLD_IRQ_CF0 (M32700UT_PLD_IRQ_BASE + 3) /* CF0# */ -#define PLD_IRQ_CF1 (M32700UT_PLD_IRQ_BASE + 4) /* CF1# */ -#define PLD_IRQ_CF2 (M32700UT_PLD_IRQ_BASE + 5) /* CF2# */ -#define PLD_IRQ_CF3 (M32700UT_PLD_IRQ_BASE + 6) /* CF3# */ -#define PLD_IRQ_CF4 (M32700UT_PLD_IRQ_BASE + 7) /* CF4# */ -#define PLD_IRQ_INT8 (M32700UT_PLD_IRQ_BASE + 8) /* reserved */ -#define PLD_IRQ_INT9 (M32700UT_PLD_IRQ_BASE + 9) /* reserved */ -#define PLD_IRQ_INT10 (M32700UT_PLD_IRQ_BASE + 10) /* reserved */ -#define PLD_IRQ_INT11 (M32700UT_PLD_IRQ_BASE + 11) /* reserved */ -#define PLD_IRQ_UART0 (M32700UT_PLD_IRQ_BASE + 12) /* UARTIRQ0 */ -#define PLD_IRQ_UART1 (M32700UT_PLD_IRQ_BASE + 13) /* UARTIRQ1 */ -#define PLD_IRQ_INT14 (M32700UT_PLD_IRQ_BASE + 14) /* reserved */ -#define PLD_IRQ_INT15 (M32700UT_PLD_IRQ_BASE + 15) /* reserved */ -#define PLD_IRQ_SNDINT (M32700UT_PLD_IRQ_BASE + 16) /* SNDINT# */ -#define PLD_IRQ_INT17 (M32700UT_PLD_IRQ_BASE + 17) /* reserved */ -#define PLD_IRQ_INT18 (M32700UT_PLD_IRQ_BASE + 18) /* reserved */ -#define PLD_IRQ_INT19 (M32700UT_PLD_IRQ_BASE + 19) /* reserved */ -#define PLD_IRQ_INT20 (M32700UT_PLD_IRQ_BASE + 20) /* reserved */ -#define PLD_IRQ_INT21 (M32700UT_PLD_IRQ_BASE + 21) /* reserved */ -#define PLD_IRQ_INT22 (M32700UT_PLD_IRQ_BASE + 22) /* reserved */ -#define PLD_IRQ_INT23 (M32700UT_PLD_IRQ_BASE + 23) /* reserved */ -#define PLD_IRQ_INT24 (M32700UT_PLD_IRQ_BASE + 24) /* reserved */ -#define PLD_IRQ_INT25 (M32700UT_PLD_IRQ_BASE + 25) /* reserved */ -#define PLD_IRQ_INT26 (M32700UT_PLD_IRQ_BASE + 26) /* reserved */ -#define PLD_IRQ_INT27 (M32700UT_PLD_IRQ_BASE + 27) /* reserved */ -#define PLD_IRQ_INT28 (M32700UT_PLD_IRQ_BASE + 28) /* reserved */ -#define PLD_IRQ_INT29 (M32700UT_PLD_IRQ_BASE + 29) /* reserved */ -#define PLD_IRQ_INT30 (M32700UT_PLD_IRQ_BASE + 30) /* reserved */ - -#endif /* CONFIG_PLAT_USRV */ - -#define PLD_ICUISTS __reg16(PLD_BASE + 0x8002) -#define PLD_ICUISTS_VECB_MASK (0xf000) -#define PLD_ICUISTS_VECB(x) ((x) & PLD_ICUISTS_VECB_MASK) -#define PLD_ICUISTS_ISN_MASK (0x07c0) -#define PLD_ICUISTS_ISN(x) ((x) & PLD_ICUISTS_ISN_MASK) -#define PLD_ICUIREQ0 __reg16(PLD_BASE + 0x8004) -#define PLD_ICUIREQ1 __reg16(PLD_BASE + 0x8006) -#define PLD_ICUCR1 __reg16(PLD_BASE + 0x8100) -#define PLD_ICUCR2 __reg16(PLD_BASE + 0x8102) -#define PLD_ICUCR3 __reg16(PLD_BASE + 0x8104) -#define PLD_ICUCR4 __reg16(PLD_BASE + 0x8106) -#define PLD_ICUCR5 __reg16(PLD_BASE + 0x8108) -#define PLD_ICUCR6 __reg16(PLD_BASE + 0x810a) -#define PLD_ICUCR7 __reg16(PLD_BASE + 0x810c) -#define PLD_ICUCR8 __reg16(PLD_BASE + 0x810e) -#define PLD_ICUCR9 __reg16(PLD_BASE + 0x8110) -#define PLD_ICUCR10 __reg16(PLD_BASE + 0x8112) -#define PLD_ICUCR11 __reg16(PLD_BASE + 0x8114) -#define PLD_ICUCR12 __reg16(PLD_BASE + 0x8116) -#define PLD_ICUCR13 __reg16(PLD_BASE + 0x8118) -#define PLD_ICUCR14 __reg16(PLD_BASE + 0x811a) -#define PLD_ICUCR15 __reg16(PLD_BASE + 0x811c) -#define PLD_ICUCR16 __reg16(PLD_BASE + 0x811e) -#define PLD_ICUCR17 __reg16(PLD_BASE + 0x8120) -#define PLD_ICUCR_IEN (0x1000) -#define PLD_ICUCR_IREQ (0x0100) -#define PLD_ICUCR_ISMOD00 (0x0000) /* Low edge */ -#define PLD_ICUCR_ISMOD01 (0x0010) /* Low level */ -#define PLD_ICUCR_ISMOD02 (0x0020) /* High edge */ -#define PLD_ICUCR_ISMOD03 (0x0030) /* High level */ -#define PLD_ICUCR_ILEVEL0 (0x0000) -#define PLD_ICUCR_ILEVEL1 (0x0001) -#define PLD_ICUCR_ILEVEL2 (0x0002) -#define PLD_ICUCR_ILEVEL3 (0x0003) -#define PLD_ICUCR_ILEVEL4 (0x0004) -#define PLD_ICUCR_ILEVEL5 (0x0005) -#define PLD_ICUCR_ILEVEL6 (0x0006) -#define PLD_ICUCR_ILEVEL7 (0x0007) - -/* Power Control of MMC and CF */ -#define PLD_CPCR __reg16(PLD_BASE + 0x14000) -#define PLD_CPCR_CF 0x0001 -#define PLD_CPCR_MMC 0x0002 - -/* LED Control - * - * 1: DIP swich side - * 2: Reset switch side - */ -#define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002) -#define PLD_IOLED_1_ON 0x001 -#define PLD_IOLED_1_OFF 0x000 -#define PLD_IOLED_2_ON 0x002 -#define PLD_IOLED_2_OFF 0x000 - -/* DIP Switch - * 0: Write-protect of Flash Memory (0:protected, 1:non-protected) - * 1: - - * 2: - - * 3: - - */ -#define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004) -#define PLD_IOSWSTS_IOSW2 0x0200 -#define PLD_IOSWSTS_IOSW1 0x0100 -#define PLD_IOSWSTS_IOWP0 0x0001 - -/* CRC */ -#define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000) -#define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002) -#define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004) -#define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006) -#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) -#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) - -/* RTC */ -#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) -#define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002) -#define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004) -#define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006) -#define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008) - -/* SIO0 */ -#define PLD_ESIO0CR __reg16(PLD_BASE + 0x20000) -#define PLD_ESIO0CR_TXEN 0x0001 -#define PLD_ESIO0CR_RXEN 0x0002 -#define PLD_ESIO0MOD0 __reg16(PLD_BASE + 0x20002) -#define PLD_ESIO0MOD0_CTSS 0x0040 -#define PLD_ESIO0MOD0_RTSS 0x0080 -#define PLD_ESIO0MOD1 __reg16(PLD_BASE + 0x20004) -#define PLD_ESIO0MOD1_LMFS 0x0010 -#define PLD_ESIO0STS __reg16(PLD_BASE + 0x20006) -#define PLD_ESIO0STS_TEMP 0x0001 -#define PLD_ESIO0STS_TXCP 0x0002 -#define PLD_ESIO0STS_RXCP 0x0004 -#define PLD_ESIO0STS_TXSC 0x0100 -#define PLD_ESIO0STS_RXSC 0x0200 -#define PLD_ESIO0STS_TXREADY (PLD_ESIO0STS_TXCP | PLD_ESIO0STS_TEMP) -#define PLD_ESIO0INTCR __reg16(PLD_BASE + 0x20008) -#define PLD_ESIO0INTCR_TXIEN 0x0002 -#define PLD_ESIO0INTCR_RXCEN 0x0004 -#define PLD_ESIO0BAUR __reg16(PLD_BASE + 0x2000a) -#define PLD_ESIO0TXB __reg16(PLD_BASE + 0x2000c) -#define PLD_ESIO0RXB __reg16(PLD_BASE + 0x2000e) - -/* SIM Card */ -#define PLD_SCCR __reg16(PLD_BASE + 0x38000) -#define PLD_SCMOD __reg16(PLD_BASE + 0x38004) -#define PLD_SCSTS __reg16(PLD_BASE + 0x38006) -#define PLD_SCINTCR __reg16(PLD_BASE + 0x38008) -#define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a) -#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) -#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) - -#endif /* _M32700UT_M32700UT_PLD.H */ diff --git a/arch/m32r/include/asm/m32r.h b/arch/m32r/include/asm/m32r.h deleted file mode 100644 index d27f056d92f3..000000000000 --- a/arch/m32r/include/asm/m32r.h +++ /dev/null @@ -1,161 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_M32R_H_ -#define _ASM_M32R_M32R_H_ - -/* - * Renesas M32R processor - * - * Copyright (C) 2003, 2004 Renesas Technology Corp. - */ - - -/* Chip type */ -#if defined(CONFIG_CHIP_XNUX_MP) || defined(CONFIG_CHIP_XNUX2_MP) -#include -#elif defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_XNUX2) \ - || defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32102) \ - || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) -#include -#endif - -/* Platform type */ -#if defined(CONFIG_PLAT_M32700UT) -#include -#include -#include -/* for ei_handler:linux/arch/m32r/kernel/entry.S */ -#define M32R_INT1ICU_ISTS PLD_ICUISTS -#define M32R_INT1ICU_IRQ_BASE M32700UT_PLD_IRQ_BASE -#define M32R_INT0ICU_ISTS M32700UT_LAN_ICUISTS -#define M32R_INT0ICU_IRQ_BASE M32700UT_LAN_PLD_IRQ_BASE -#define M32R_INT2ICU_ISTS M32700UT_LCD_ICUISTS -#define M32R_INT2ICU_IRQ_BASE M32700UT_LCD_PLD_IRQ_BASE -#endif /* CONFIG_PLAT_M32700UT */ - -#if defined(CONFIG_PLAT_OPSPUT) -#include -#include -#include -/* for ei_handler:linux/arch/m32r/kernel/entry.S */ -#define M32R_INT1ICU_ISTS PLD_ICUISTS -#define M32R_INT1ICU_IRQ_BASE OPSPUT_PLD_IRQ_BASE -#define M32R_INT0ICU_ISTS OPSPUT_LAN_ICUISTS -#define M32R_INT0ICU_IRQ_BASE OPSPUT_LAN_PLD_IRQ_BASE -#define M32R_INT2ICU_ISTS OPSPUT_LCD_ICUISTS -#define M32R_INT2ICU_IRQ_BASE OPSPUT_LCD_PLD_IRQ_BASE -#endif /* CONFIG_PLAT_OPSPUT */ - -#if defined(CONFIG_PLAT_MAPPI2) -#include -#endif /* CONFIG_PLAT_MAPPI2 */ - -#if defined(CONFIG_PLAT_MAPPI3) -#include -#endif /* CONFIG_PLAT_MAPPI3 */ - -#if defined(CONFIG_PLAT_USRV) -#include -/* for ei_handler:linux/arch/m32r/kernel/entry.S */ -#define M32R_INT1ICU_ISTS PLD_ICUISTS -#define M32R_INT1ICU_IRQ_BASE M32700UT_PLD_IRQ_BASE -#endif - -#if defined(CONFIG_PLAT_M32104UT) -#include -/* for ei_handler:linux/arch/m32r/kernel/entry.S */ -#define M32R_INT1ICU_ISTS PLD_ICUISTS -#define M32R_INT1ICU_IRQ_BASE M32104UT_PLD_IRQ_BASE -#endif /* CONFIG_PLAT_M32104 */ - -/* - * M32R Register - */ - -/* - * MMU Register - */ - -#define MMU_REG_BASE (0xffff0000) -#define ITLB_BASE (0xfe000000) -#define DTLB_BASE (0xfe000800) - -#define NR_TLB_ENTRIES CONFIG_TLB_ENTRIES - -#define MATM MMU_REG_BASE /* MMU Address Translation Mode - Register */ -#define MPSZ (0x04 + MMU_REG_BASE) /* MMU Page Size Designation Register */ -#define MASID (0x08 + MMU_REG_BASE) /* MMU Address Space ID Register */ -#define MESTS (0x0c + MMU_REG_BASE) /* MMU Exception Status Register */ -#define MDEVA (0x10 + MMU_REG_BASE) /* MMU Operand Exception Virtual - Address Register */ -#define MDEVP (0x14 + MMU_REG_BASE) /* MMU Operand Exception Virtual Page - Number Register */ -#define MPTB (0x18 + MMU_REG_BASE) /* MMU Page Table Base Register */ -#define MSVA (0x20 + MMU_REG_BASE) /* MMU Search Virtual Address - Register */ -#define MTOP (0x24 + MMU_REG_BASE) /* MMU TLB Operation Register */ -#define MIDXI (0x28 + MMU_REG_BASE) /* MMU Index Register for - Instruciton */ -#define MIDXD (0x2c + MMU_REG_BASE) /* MMU Index Register for Operand */ - -#define MATM_offset (MATM - MMU_REG_BASE) -#define MPSZ_offset (MPSZ - MMU_REG_BASE) -#define MASID_offset (MASID - MMU_REG_BASE) -#define MESTS_offset (MESTS - MMU_REG_BASE) -#define MDEVA_offset (MDEVA - MMU_REG_BASE) -#define MDEVP_offset (MDEVP - MMU_REG_BASE) -#define MPTB_offset (MPTB - MMU_REG_BASE) -#define MSVA_offset (MSVA - MMU_REG_BASE) -#define MTOP_offset (MTOP - MMU_REG_BASE) -#define MIDXI_offset (MIDXI - MMU_REG_BASE) -#define MIDXD_offset (MIDXD - MMU_REG_BASE) - -#define MESTS_IT (1 << 0) /* Instruction TLB miss */ -#define MESTS_IA (1 << 1) /* Instruction Access Exception */ -#define MESTS_DT (1 << 4) /* Operand TLB miss */ -#define MESTS_DA (1 << 5) /* Operand Access Exception */ -#define MESTS_DRW (1 << 6) /* Operand Write Exception Flag */ - -/* - * PSW (Processor Status Word) - */ - -/* PSW bit */ -#define M32R_PSW_BIT_SM (7) /* Stack Mode */ -#define M32R_PSW_BIT_IE (6) /* Interrupt Enable */ -#define M32R_PSW_BIT_PM (3) /* Processor Mode [0:Supervisor,1:User] */ -#define M32R_PSW_BIT_C (0) /* Condition */ -#define M32R_PSW_BIT_BSM (7+8) /* Backup Stack Mode */ -#define M32R_PSW_BIT_BIE (6+8) /* Backup Interrupt Enable */ -#define M32R_PSW_BIT_BPM (3+8) /* Backup Processor Mode */ -#define M32R_PSW_BIT_BC (0+8) /* Backup Condition */ - -/* PSW bit map */ -#define M32R_PSW_SM (1UL<< M32R_PSW_BIT_SM) /* Stack Mode */ -#define M32R_PSW_IE (1UL<< M32R_PSW_BIT_IE) /* Interrupt Enable */ -#define M32R_PSW_PM (1UL<< M32R_PSW_BIT_PM) /* Processor Mode */ -#define M32R_PSW_C (1UL<< M32R_PSW_BIT_C) /* Condition */ -#define M32R_PSW_BSM (1UL<< M32R_PSW_BIT_BSM) /* Backup Stack Mode */ -#define M32R_PSW_BIE (1UL<< M32R_PSW_BIT_BIE) /* Backup Interrupt Enable */ -#define M32R_PSW_BPM (1UL<< M32R_PSW_BIT_BPM) /* Backup Processor Mode */ -#define M32R_PSW_BC (1UL<< M32R_PSW_BIT_BC) /* Backup Condition */ - -/* - * Direct address to SFR - */ - -#include -#ifdef CONFIG_MMU -#define NONCACHE_OFFSET (__PAGE_OFFSET + 0x20000000) -#else -#define NONCACHE_OFFSET __PAGE_OFFSET -#endif /* CONFIG_MMU */ - -#define M32R_ICU_ISTS_ADDR M32R_ICU_ISTS_PORTL+NONCACHE_OFFSET -#define M32R_ICU_IPICR_ADDR M32R_ICU_IPICR0_PORTL+NONCACHE_OFFSET -#define M32R_ICU_IMASK_ADDR M32R_ICU_IMASK_PORTL+NONCACHE_OFFSET -#define M32R_FPGA_CPU_NAME_ADDR M32R_FPGA_CPU_NAME0_PORTL+NONCACHE_OFFSET -#define M32R_FPGA_MODEL_ID_ADDR M32R_FPGA_MODEL_ID0_PORTL+NONCACHE_OFFSET -#define M32R_FPGA_VERSION_ADDR M32R_FPGA_VERSION0_PORTL+NONCACHE_OFFSET - -#endif /* _ASM_M32R_M32R_H_ */ diff --git a/arch/m32r/include/asm/m32r_mp_fpga.h b/arch/m32r/include/asm/m32r_mp_fpga.h deleted file mode 100644 index 8eeaa9a420c5..000000000000 --- a/arch/m32r/include/asm/m32r_mp_fpga.h +++ /dev/null @@ -1,314 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_M32R_MP_FPGA_ -#define _ASM_M32R_M32R_MP_FPGA_ - -/* - * Renesas M32R-MP-FPGA - * - * Copyright (c) 2002 Hitoshi Yamamoto - * Copyright (c) 2003, 2004 Renesas Technology Corp. - */ - -/* - * ======================================================== - * M32R-MP-FPGA Memory Map - * ======================================================== - * 0x00000000 : Block#0 : 64[MB] - * 0x03E00000 : SFR - * 0x03E00000 : reserved - * 0x03EF0000 : FPGA - * 0x03EF1000 : reserved - * 0x03EF4000 : CKM - * 0x03EF4000 : BSELC - * 0x03EF5000 : reserved - * 0x03EFC000 : MFT - * 0x03EFD000 : SIO - * 0x03EFE000 : reserved - * 0x03EFF000 : ICU - * 0x03F00000 : Internal SRAM 64[KB] - * 0x03F10000 : reserved - * -------------------------------------------------------- - * 0x04000000 : Block#1 : 64[MB] - * 0x04000000 : Debug board SRAM 4[MB] - * 0x04400000 : reserved - * -------------------------------------------------------- - * 0x08000000 : Block#2 : 64[MB] - * -------------------------------------------------------- - * 0x0C000000 : Block#3 : 64[MB] - * -------------------------------------------------------- - * 0x10000000 : Block#4 : 64[MB] - * -------------------------------------------------------- - * 0x14000000 : Block#5 : 64[MB] - * -------------------------------------------------------- - * 0x18000000 : Block#6 : 64[MB] - * -------------------------------------------------------- - * 0x1C000000 : Block#7 : 64[MB] - * -------------------------------------------------------- - * 0xFE000000 : TLB - * 0xFE000000 : ITLB - * 0xFE000080 : reserved - * 0xFE000800 : DTLB - * 0xFE000880 : reserved - * -------------------------------------------------------- - * 0xFF000000 : System area - * 0xFFFF0000 : MMU - * 0xFFFF0030 : reserved - * 0xFFFF8000 : Debug function - * 0xFFFFA000 : reserved - * 0xFFFFC000 : CPU control - * 0xFFFFFFFF - * ======================================================== - */ - -/*======================================================================* - * Special Function Register - *======================================================================*/ -#define M32R_SFR_OFFSET (0x00E00000) /* 0x03E00000-0x03EFFFFF 1[MB] */ - -/* - * FPGA registers. - */ -#define M32R_FPGA_TOP (0x000F0000+M32R_SFR_OFFSET) - -#define M32R_FPGA_NUM_OF_CPUS_PORTL (0x00+M32R_FPGA_TOP) -#define M32R_FPGA_CPU_NAME0_PORTL (0x10+M32R_FPGA_TOP) -#define M32R_FPGA_CPU_NAME1_PORTL (0x14+M32R_FPGA_TOP) -#define M32R_FPGA_CPU_NAME2_PORTL (0x18+M32R_FPGA_TOP) -#define M32R_FPGA_CPU_NAME3_PORTL (0x1C+M32R_FPGA_TOP) -#define M32R_FPGA_MODEL_ID0_PORTL (0x20+M32R_FPGA_TOP) -#define M32R_FPGA_MODEL_ID1_PORTL (0x24+M32R_FPGA_TOP) -#define M32R_FPGA_MODEL_ID2_PORTL (0x28+M32R_FPGA_TOP) -#define M32R_FPGA_MODEL_ID3_PORTL (0x2C+M32R_FPGA_TOP) -#define M32R_FPGA_VERSION0_PORTL (0x30+M32R_FPGA_TOP) -#define M32R_FPGA_VERSION1_PORTL (0x34+M32R_FPGA_TOP) - -/* - * Clock and Power Manager registers. - */ -#define M32R_CPM_OFFSET (0x000F4000+M32R_SFR_OFFSET) - -#define M32R_CPM_CPUCLKCR_PORTL (0x00+M32R_CPM_OFFSET) -#define M32R_CPM_CLKMOD_PORTL (0x04+M32R_CPM_OFFSET) -#define M32R_CPM_PLLCR_PORTL (0x08+M32R_CPM_OFFSET) - -/* - * Block SELect Controller registers. - */ -#define M32R_BSELC_OFFSET (0x000F5000+M32R_SFR_OFFSET) - -#define M32R_BSEL0_CR0_PORTL (0x000+M32R_BSELC_OFFSET) -#define M32R_BSEL0_CR1_PORTL (0x004+M32R_BSELC_OFFSET) -#define M32R_BSEL1_CR0_PORTL (0x100+M32R_BSELC_OFFSET) -#define M32R_BSEL1_CR1_PORTL (0x104+M32R_BSELC_OFFSET) -#define M32R_BSEL2_CR0_PORTL (0x200+M32R_BSELC_OFFSET) -#define M32R_BSEL2_CR1_PORTL (0x204+M32R_BSELC_OFFSET) -#define M32R_BSEL3_CR0_PORTL (0x300+M32R_BSELC_OFFSET) -#define M32R_BSEL3_CR1_PORTL (0x304+M32R_BSELC_OFFSET) -#define M32R_BSEL4_CR0_PORTL (0x400+M32R_BSELC_OFFSET) -#define M32R_BSEL4_CR1_PORTL (0x404+M32R_BSELC_OFFSET) -#define M32R_BSEL5_CR0_PORTL (0x500+M32R_BSELC_OFFSET) -#define M32R_BSEL5_CR1_PORTL (0x504+M32R_BSELC_OFFSET) -#define M32R_BSEL6_CR0_PORTL (0x600+M32R_BSELC_OFFSET) -#define M32R_BSEL6_CR1_PORTL (0x604+M32R_BSELC_OFFSET) -#define M32R_BSEL7_CR0_PORTL (0x700+M32R_BSELC_OFFSET) -#define M32R_BSEL7_CR1_PORTL (0x704+M32R_BSELC_OFFSET) - -/* - * Multi Function Timer registers. - */ -#define M32R_MFT_OFFSET (0x000FC000+M32R_SFR_OFFSET) - -#define M32R_MFTCR_PORTL (0x000+M32R_MFT_OFFSET) /* MFT control */ -#define M32R_MFTRPR_PORTL (0x004+M32R_MFT_OFFSET) /* MFT real port */ - -#define M32R_MFT0_OFFSET (0x100+M32R_MFT_OFFSET) -#define M32R_MFT0MOD_PORTL (0x00+M32R_MFT0_OFFSET) /* MFT0 mode */ -#define M32R_MFT0BOS_PORTL (0x04+M32R_MFT0_OFFSET) /* MFT0 b-port output status */ -#define M32R_MFT0CUT_PORTL (0x08+M32R_MFT0_OFFSET) /* MFT0 count */ -#define M32R_MFT0RLD_PORTL (0x0C+M32R_MFT0_OFFSET) /* MFT0 reload */ -#define M32R_MFT0CMPRLD_PORTL (0x10+M32R_MFT0_OFFSET) /* MFT0 compare reload */ - -#define M32R_MFT1_OFFSET (0x200+M32R_MFT_OFFSET) -#define M32R_MFT1MOD_PORTL (0x00+M32R_MFT1_OFFSET) /* MFT1 mode */ -#define M32R_MFT1BOS_PORTL (0x04+M32R_MFT1_OFFSET) /* MFT1 b-port output status */ -#define M32R_MFT1CUT_PORTL (0x08+M32R_MFT1_OFFSET) /* MFT1 count */ -#define M32R_MFT1RLD_PORTL (0x0C+M32R_MFT1_OFFSET) /* MFT1 reload */ -#define M32R_MFT1CMPRLD_PORTL (0x10+M32R_MFT1_OFFSET) /* MFT1 compare reload */ - -#define M32R_MFT2_OFFSET (0x300+M32R_MFT_OFFSET) -#define M32R_MFT2MOD_PORTL (0x00+M32R_MFT2_OFFSET) /* MFT2 mode */ -#define M32R_MFT2BOS_PORTL (0x04+M32R_MFT2_OFFSET) /* MFT2 b-port output status */ -#define M32R_MFT2CUT_PORTL (0x08+M32R_MFT2_OFFSET) /* MFT2 count */ -#define M32R_MFT2RLD_PORTL (0x0C+M32R_MFT2_OFFSET) /* MFT2 reload */ -#define M32R_MFT2CMPRLD_PORTL (0x10+M32R_MFT2_OFFSET) /* MFT2 compare reload */ - -#define M32R_MFT3_OFFSET (0x400+M32R_MFT_OFFSET) -#define M32R_MFT3MOD_PORTL (0x00+M32R_MFT3_OFFSET) /* MFT3 mode */ -#define M32R_MFT3BOS_PORTL (0x04+M32R_MFT3_OFFSET) /* MFT3 b-port output status */ -#define M32R_MFT3CUT_PORTL (0x08+M32R_MFT3_OFFSET) /* MFT3 count */ -#define M32R_MFT3RLD_PORTL (0x0C+M32R_MFT3_OFFSET) /* MFT3 reload */ -#define M32R_MFT3CMPRLD_PORTL (0x10+M32R_MFT3_OFFSET) /* MFT3 compare reload */ - -#define M32R_MFT4_OFFSET (0x500+M32R_MFT_OFFSET) -#define M32R_MFT4MOD_PORTL (0x00+M32R_MFT4_OFFSET) /* MFT4 mode */ -#define M32R_MFT4BOS_PORTL (0x04+M32R_MFT4_OFFSET) /* MFT4 b-port output status */ -#define M32R_MFT4CUT_PORTL (0x08+M32R_MFT4_OFFSET) /* MFT4 count */ -#define M32R_MFT4RLD_PORTL (0x0C+M32R_MFT4_OFFSET) /* MFT4 reload */ -#define M32R_MFT4CMPRLD_PORTL (0x10+M32R_MFT4_OFFSET) /* MFT4 compare reload */ - -#define M32R_MFT5_OFFSET (0x600+M32R_MFT_OFFSET) -#define M32R_MFT5MOD_PORTL (0x00+M32R_MFT5_OFFSET) /* MFT4 mode */ -#define M32R_MFT5BOS_PORTL (0x04+M32R_MFT5_OFFSET) /* MFT4 b-port output status */ -#define M32R_MFT5CUT_PORTL (0x08+M32R_MFT5_OFFSET) /* MFT4 count */ -#define M32R_MFT5RLD_PORTL (0x0C+M32R_MFT5_OFFSET) /* MFT4 reload */ -#define M32R_MFT5CMPRLD_PORTL (0x10+M32R_MFT5_OFFSET) /* MFT4 compare reload */ - -#define M32R_MFTCR_MFT0MSK (1UL<<15) /* b16 */ -#define M32R_MFTCR_MFT1MSK (1UL<<14) /* b17 */ -#define M32R_MFTCR_MFT2MSK (1UL<<13) /* b18 */ -#define M32R_MFTCR_MFT3MSK (1UL<<12) /* b19 */ -#define M32R_MFTCR_MFT4MSK (1UL<<11) /* b20 */ -#define M32R_MFTCR_MFT5MSK (1UL<<10) /* b21 */ -#define M32R_MFTCR_MFT0EN (1UL<<7) /* b24 */ -#define M32R_MFTCR_MFT1EN (1UL<<6) /* b25 */ -#define M32R_MFTCR_MFT2EN (1UL<<5) /* b26 */ -#define M32R_MFTCR_MFT3EN (1UL<<4) /* b27 */ -#define M32R_MFTCR_MFT4EN (1UL<<3) /* b28 */ -#define M32R_MFTCR_MFT5EN (1UL<<2) /* b29 */ - -#define M32R_MFTMOD_CC_MASK (1UL<<15) /* b16 */ -#define M32R_MFTMOD_TCCR (1UL<<13) /* b18 */ -#define M32R_MFTMOD_GTSEL000 (0UL<<8) /* b21-23 : 000 */ -#define M32R_MFTMOD_GTSEL001 (1UL<<8) /* b21-23 : 001 */ -#define M32R_MFTMOD_GTSEL010 (2UL<<8) /* b21-23 : 010 */ -#define M32R_MFTMOD_GTSEL011 (3UL<<8) /* b21-23 : 011 */ -#define M32R_MFTMOD_GTSEL110 (6UL<<8) /* b21-23 : 110 */ -#define M32R_MFTMOD_GTSEL111 (7UL<<8) /* b21-23 : 111 */ -#define M32R_MFTMOD_CMSEL (1UL<<3) /* b28 */ -#define M32R_MFTMOD_CSSEL000 (0UL<<0) /* b29-b31 : 000 */ -#define M32R_MFTMOD_CSSEL001 (1UL<<0) /* b29-b31 : 001 */ -#define M32R_MFTMOD_CSSEL010 (2UL<<0) /* b29-b31 : 010 */ -#define M32R_MFTMOD_CSSEL011 (3UL<<0) /* b29-b31 : 011 */ -#define M32R_MFTMOD_CSSEL100 (4UL<<0) /* b29-b31 : 100 */ -#define M32R_MFTMOD_CSSEL110 (6UL<<0) /* b29-b31 : 110 */ - -/* - * Serial I/O registers. - */ -#define M32R_SIO_OFFSET (0x000FD000+M32R_SFR_OFFSET) - -#define M32R_SIO0_CR_PORTL (0x000+M32R_SIO_OFFSET) -#define M32R_SIO0_MOD0_PORTL (0x004+M32R_SIO_OFFSET) -#define M32R_SIO0_MOD1_PORTL (0x008+M32R_SIO_OFFSET) -#define M32R_SIO0_STS_PORTL (0x00C+M32R_SIO_OFFSET) -#define M32R_SIO0_TRCR_PORTL (0x010+M32R_SIO_OFFSET) -#define M32R_SIO0_BAUR_PORTL (0x014+M32R_SIO_OFFSET) -#define M32R_SIO0_RBAUR_PORTL (0x018+M32R_SIO_OFFSET) -#define M32R_SIO0_TXB_PORTL (0x01C+M32R_SIO_OFFSET) -#define M32R_SIO0_RXB_PORTL (0x020+M32R_SIO_OFFSET) - -/* - * Interrupt Control Unit registers. - */ -#define M32R_ICU_OFFSET (0x000FF000+M32R_SFR_OFFSET) - -#define M32R_ICU_ISTS_PORTL (0x004+M32R_ICU_OFFSET) -#define M32R_ICU_IREQ0_PORTL (0x008+M32R_ICU_OFFSET) -#define M32R_ICU_IREQ1_PORTL (0x00C+M32R_ICU_OFFSET) -#define M32R_ICU_SBICR_PORTL (0x018+M32R_ICU_OFFSET) -#define M32R_ICU_IMASK_PORTL (0x01C+M32R_ICU_OFFSET) -#define M32R_ICU_CR1_PORTL (0x200+M32R_ICU_OFFSET) /* INT0 */ -#define M32R_ICU_CR2_PORTL (0x204+M32R_ICU_OFFSET) /* INT1 */ -#define M32R_ICU_CR3_PORTL (0x208+M32R_ICU_OFFSET) /* INT2 */ -#define M32R_ICU_CR4_PORTL (0x20C+M32R_ICU_OFFSET) /* INT3 */ -#define M32R_ICU_CR5_PORTL (0x210+M32R_ICU_OFFSET) /* INT4 */ -#define M32R_ICU_CR6_PORTL (0x214+M32R_ICU_OFFSET) /* INT5 */ -#define M32R_ICU_CR7_PORTL (0x218+M32R_ICU_OFFSET) /* INT6 */ -#define M32R_ICU_CR8_PORTL (0x218+M32R_ICU_OFFSET) /* INT7 */ -#define M32R_ICU_CR32_PORTL (0x27C+M32R_ICU_OFFSET) /* SIO0 RX */ -#define M32R_ICU_CR33_PORTL (0x280+M32R_ICU_OFFSET) /* SIO0 TX */ -#define M32R_ICU_CR40_PORTL (0x29C+M32R_ICU_OFFSET) /* DMAC0 */ -#define M32R_ICU_CR41_PORTL (0x2A0+M32R_ICU_OFFSET) /* DMAC1 */ -#define M32R_ICU_CR48_PORTL (0x2BC+M32R_ICU_OFFSET) /* MFT0 */ -#define M32R_ICU_CR49_PORTL (0x2C0+M32R_ICU_OFFSET) /* MFT1 */ -#define M32R_ICU_CR50_PORTL (0x2C4+M32R_ICU_OFFSET) /* MFT2 */ -#define M32R_ICU_CR51_PORTL (0x2C8+M32R_ICU_OFFSET) /* MFT3 */ -#define M32R_ICU_CR52_PORTL (0x2CC+M32R_ICU_OFFSET) /* MFT4 */ -#define M32R_ICU_CR53_PORTL (0x2D0+M32R_ICU_OFFSET) /* MFT5 */ -#define M32R_ICU_IPICR0_PORTL (0x2DC+M32R_ICU_OFFSET) /* IPI0 */ -#define M32R_ICU_IPICR1_PORTL (0x2E0+M32R_ICU_OFFSET) /* IPI1 */ -#define M32R_ICU_IPICR2_PORTL (0x2E4+M32R_ICU_OFFSET) /* IPI2 */ -#define M32R_ICU_IPICR3_PORTL (0x2E8+M32R_ICU_OFFSET) /* IPI3 */ -#define M32R_ICU_IPICR4_PORTL (0x2EC+M32R_ICU_OFFSET) /* IPI4 */ -#define M32R_ICU_IPICR5_PORTL (0x2F0+M32R_ICU_OFFSET) /* IPI5 */ -#define M32R_ICU_IPICR6_PORTL (0x2F4+M32R_ICU_OFFSET) /* IPI6 */ -#define M32R_ICU_IPICR7_PORTL (0x2FC+M32R_ICU_OFFSET) /* IPI7 */ - -#define M32R_ICUISTS_VECB(val) ((val>>28) & 0xF) -#define M32R_ICUISTS_ISN(val) ((val>>22) & 0x3F) -#define M32R_ICUISTS_PIML(val) ((val>>16) & 0x7) - -#define M32R_ICUIMASK_IMSK0 (0UL<<16) /* b13-b15: Disable interrupt */ -#define M32R_ICUIMASK_IMSK1 (1UL<<16) /* b13-b15: Enable level 0 interrupt */ -#define M32R_ICUIMASK_IMSK2 (2UL<<16) /* b13-b15: Enable level 0,1 interrupt */ -#define M32R_ICUIMASK_IMSK3 (3UL<<16) /* b13-b15: Enable level 0-2 interrupt */ -#define M32R_ICUIMASK_IMSK4 (4UL<<16) /* b13-b15: Enable level 0-3 interrupt */ -#define M32R_ICUIMASK_IMSK5 (5UL<<16) /* b13-b15: Enable level 0-4 interrupt */ -#define M32R_ICUIMASK_IMSK6 (6UL<<16) /* b13-b15: Enable level 0-5 interrupt */ -#define M32R_ICUIMASK_IMSK7 (7UL<<16) /* b13-b15: Enable level 0-6 interrupt */ - -#define M32R_ICUCR_IEN (1UL<<12) /* b19: Interrupt enable */ -#define M32R_ICUCR_IRQ (1UL<<8) /* b23: Interrupt request */ -#define M32R_ICUCR_ISMOD00 (0UL<<4) /* b26-b27: Interrupt sense mode Edge HtoL */ -#define M32R_ICUCR_ISMOD01 (1UL<<4) /* b26-b27: Interrupt sense mode Level L */ -#define M32R_ICUCR_ISMOD10 (2UL<<4) /* b26-b27: Interrupt sense mode Edge LtoH*/ -#define M32R_ICUCR_ISMOD11 (3UL<<4) /* b26-b27: Interrupt sense mode Level H */ -#define M32R_ICUCR_ILEVEL0 (0UL<<0) /* b29-b31: Interrupt priority level 0 */ -#define M32R_ICUCR_ILEVEL1 (1UL<<0) /* b29-b31: Interrupt priority level 1 */ -#define M32R_ICUCR_ILEVEL2 (2UL<<0) /* b29-b31: Interrupt priority level 2 */ -#define M32R_ICUCR_ILEVEL3 (3UL<<0) /* b29-b31: Interrupt priority level 3 */ -#define M32R_ICUCR_ILEVEL4 (4UL<<0) /* b29-b31: Interrupt priority level 4 */ -#define M32R_ICUCR_ILEVEL5 (5UL<<0) /* b29-b31: Interrupt priority level 5 */ -#define M32R_ICUCR_ILEVEL6 (6UL<<0) /* b29-b31: Interrupt priority level 6 */ -#define M32R_ICUCR_ILEVEL7 (7UL<<0) /* b29-b31: Disable interrupt */ -#define M32R_ICUCR_ILEVEL_MASK (7UL) - -#define M32R_IRQ_INT0 (1) /* INT0 */ -#define M32R_IRQ_INT1 (2) /* INT1 */ -#define M32R_IRQ_INT2 (3) /* INT2 */ -#define M32R_IRQ_INT3 (4) /* INT3 */ -#define M32R_IRQ_INT4 (5) /* INT4 */ -#define M32R_IRQ_INT5 (6) /* INT5 */ -#define M32R_IRQ_INT6 (7) /* INT6 */ -#define M32R_IRQ_INT7 (8) /* INT7 */ -#define M32R_IRQ_MFT0 (16) /* MFT0 */ -#define M32R_IRQ_MFT1 (17) /* MFT1 */ -#define M32R_IRQ_MFT2 (18) /* MFT2 */ -#define M32R_IRQ_MFT3 (19) /* MFT3 */ -#define M32R_IRQ_MFT4 (20) /* MFT4 */ -#define M32R_IRQ_MFT5 (21) /* MFT5 */ -#define M32R_IRQ_DMAC0 (32) /* DMAC0 */ -#define M32R_IRQ_DMAC1 (33) /* DMAC1 */ -#define M32R_IRQ_SIO0_R (48) /* SIO0 receive */ -#define M32R_IRQ_SIO0_S (49) /* SIO0 send */ -#define M32R_IRQ_SIO1_R (50) /* SIO1 send */ -#define M32R_IRQ_SIO1_S (51) /* SIO1 receive */ -#define M32R_IRQ_IPI0 (56) /* IPI0 */ -#define M32R_IRQ_IPI1 (57) /* IPI1 */ -#define M32R_IRQ_IPI2 (58) /* IPI2 */ -#define M32R_IRQ_IPI3 (59) /* IPI3 */ -#define M32R_IRQ_IPI4 (60) /* IPI4 */ -#define M32R_IRQ_IPI5 (61) /* IPI5 */ -#define M32R_IRQ_IPI6 (62) /* IPI6 */ -#define M32R_IRQ_IPI7 (63) /* IPI7 */ - -/*======================================================================* - * CPU - *======================================================================*/ - -#define M32R_CPUID_PORTL (0xFFFFFFE0) -#define M32R_MCICAR_PORTL (0xFFFFFFF0) -#define M32R_MCDCAR_PORTL (0xFFFFFFF4) -#define M32R_MCCR_PORTL (0xFFFFFFFC) - -#endif /* _ASM_M32R_M32R_MP_FPGA_ */ diff --git a/arch/m32r/include/asm/mappi2/mappi2_pld.h b/arch/m32r/include/asm/mappi2/mappi2_pld.h deleted file mode 100644 index 2624c9db7255..000000000000 --- a/arch/m32r/include/asm/mappi2/mappi2_pld.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef _MAPPI2_PLD_H -#define _MAPPI2_PLD_H - -/* - * include/asm-m32r/mappi2/mappi2_pld.h - * - * Definitions for Extended IO Logic on MAPPI2 board. - * based on m32700ut_pld.h - * - * 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. - */ - -#ifndef __ASSEMBLY__ -/* FIXME: - * Some C functions use non-cache address, so can't define non-cache address. - */ -#define PLD_BASE (0x10c00000 /* + NONCACHE_OFFSET */) -#define __reg8 (volatile unsigned char *) -#define __reg16 (volatile unsigned short *) -#define __reg32 (volatile unsigned int *) -#else -#define PLD_BASE (0x10c00000 + NONCACHE_OFFSET) -#define __reg8 -#define __reg16 -#define __reg32 -#endif /* __ASSEMBLY__ */ - -/* CFC */ -#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) -#define PLD_CFSTS __reg16(PLD_BASE + 0x0002) -#define PLD_CFIMASK __reg16(PLD_BASE + 0x0004) -#define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006) -#define PLD_CFCR0 __reg16(PLD_BASE + 0x000a) -#define PLD_CFCR1 __reg16(PLD_BASE + 0x000c) - -/* MMC */ -#define PLD_MMCCR __reg16(PLD_BASE + 0x4000) -#define PLD_MMCMOD __reg16(PLD_BASE + 0x4002) -#define PLD_MMCSTS __reg16(PLD_BASE + 0x4006) -#define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a) -#define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c) -#define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e) -#define PLD_MMCDET __reg16(PLD_BASE + 0x4010) -#define PLD_MMCWP __reg16(PLD_BASE + 0x4012) -#define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000) -#define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000) -#define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000) -#define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006) - -/* Power Control of MMC and CF */ -#define PLD_CPCR __reg16(PLD_BASE + 0x14000) - - -/*==== ICU ====*/ -#define M32R_IRQ_PC104 (5) /* INT4(PC/104) */ -#define M32R_IRQ_I2C (28) /* I2C-BUS */ -#if 1 -#define PLD_IRQ_CFIREQ (40) /* CFC Card Interrupt */ -#define PLD_IRQ_CFC_INSERT (41) /* CFC Card Insert */ -#define PLD_IRQ_CFC_EJECT (42) /* CFC Card Eject */ -#define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ -#define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */ -#else -#define PLD_IRQ_CFIREQ (34) /* CFC Card Interrupt */ -#define PLD_IRQ_CFC_INSERT (35) /* CFC Card Insert */ -#define PLD_IRQ_CFC_EJECT (36) /* CFC Card Eject */ -#define PLD_IRQ_MMCCARD (37) /* MMC Card Insert */ -#define PLD_IRQ_MMCIRQ (38) /* MMC Transfer Done */ -#endif - - -#if 0 -/* LED Control - * - * 1: DIP swich side - * 2: Reset switch side - */ -#define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002) -#define PLD_IOLED_1_ON 0x001 -#define PLD_IOLED_1_OFF 0x000 -#define PLD_IOLED_2_ON 0x002 -#define PLD_IOLED_2_OFF 0x000 - -/* DIP Switch - * 0: Write-protect of Flash Memory (0:protected, 1:non-protected) - * 1: - - * 2: - - * 3: - - */ -#define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004) -#define PLD_IOSWSTS_IOSW2 0x0200 -#define PLD_IOSWSTS_IOSW1 0x0100 -#define PLD_IOSWSTS_IOWP0 0x0001 - -#endif - -/* CRC */ -#define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000) -#define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002) -#define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004) -#define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006) -#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) -#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) - - -#if 0 -/* RTC */ -#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) -#define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002) -#define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004) -#define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006) -#define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008) - -/* SIO0 */ -#define PLD_ESIO0CR __reg16(PLD_BASE + 0x20000) -#define PLD_ESIO0CR_TXEN 0x0001 -#define PLD_ESIO0CR_RXEN 0x0002 -#define PLD_ESIO0MOD0 __reg16(PLD_BASE + 0x20002) -#define PLD_ESIO0MOD0_CTSS 0x0040 -#define PLD_ESIO0MOD0_RTSS 0x0080 -#define PLD_ESIO0MOD1 __reg16(PLD_BASE + 0x20004) -#define PLD_ESIO0MOD1_LMFS 0x0010 -#define PLD_ESIO0STS __reg16(PLD_BASE + 0x20006) -#define PLD_ESIO0STS_TEMP 0x0001 -#define PLD_ESIO0STS_TXCP 0x0002 -#define PLD_ESIO0STS_RXCP 0x0004 -#define PLD_ESIO0STS_TXSC 0x0100 -#define PLD_ESIO0STS_RXSC 0x0200 -#define PLD_ESIO0STS_TXREADY (PLD_ESIO0STS_TXCP | PLD_ESIO0STS_TEMP) -#define PLD_ESIO0INTCR __reg16(PLD_BASE + 0x20008) -#define PLD_ESIO0INTCR_TXIEN 0x0002 -#define PLD_ESIO0INTCR_RXCEN 0x0004 -#define PLD_ESIO0BAUR __reg16(PLD_BASE + 0x2000a) -#define PLD_ESIO0TXB __reg16(PLD_BASE + 0x2000c) -#define PLD_ESIO0RXB __reg16(PLD_BASE + 0x2000e) - -/* SIM Card */ -#define PLD_SCCR __reg16(PLD_BASE + 0x38000) -#define PLD_SCMOD __reg16(PLD_BASE + 0x38004) -#define PLD_SCSTS __reg16(PLD_BASE + 0x38006) -#define PLD_SCINTCR __reg16(PLD_BASE + 0x38008) -#define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a) -#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) -#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) - -#endif - -#endif /* _MAPPI2_PLD.H */ diff --git a/arch/m32r/include/asm/mappi3/mappi3_pld.h b/arch/m32r/include/asm/mappi3/mappi3_pld.h deleted file mode 100644 index 451c40ee70af..000000000000 --- a/arch/m32r/include/asm/mappi3/mappi3_pld.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef _MAPPI3_PLD_H -#define _MAPPI3_PLD_H - -/* - * include/asm-m32r/mappi3/mappi3_pld.h - * - * Definitions for Extended IO Logic on MAPPI3 board. - * based on m32700ut_pld.h - * - * 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. - */ - -#ifndef __ASSEMBLY__ -/* FIXME: - * Some C functions use non-cache address, so can't define non-cache address. - */ -#define PLD_BASE (0x1c000000 /* + NONCACHE_OFFSET */) -#define __reg8 (volatile unsigned char *) -#define __reg16 (volatile unsigned short *) -#define __reg32 (volatile unsigned int *) -#else -#define PLD_BASE (0x1c000000 + NONCACHE_OFFSET) -#define __reg8 -#define __reg16 -#define __reg32 -#endif /* __ASSEMBLY__ */ - -/* CFC */ -#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) -#define PLD_CFSTS __reg16(PLD_BASE + 0x0002) -#define PLD_CFIMASK __reg16(PLD_BASE + 0x0004) -#define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006) -#define PLD_CFCR0 __reg16(PLD_BASE + 0x000a) -#define PLD_CFCR1 __reg16(PLD_BASE + 0x000c) - -/* MMC */ -#define PLD_MMCCR __reg16(PLD_BASE + 0x4000) -#define PLD_MMCMOD __reg16(PLD_BASE + 0x4002) -#define PLD_MMCSTS __reg16(PLD_BASE + 0x4006) -#define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a) -#define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c) -#define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e) -#define PLD_MMCDET __reg16(PLD_BASE + 0x4010) -#define PLD_MMCWP __reg16(PLD_BASE + 0x4012) -#define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000) -#define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000) -#define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000) -#define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006) - -/* Power Control of MMC and CF */ -#define PLD_CPCR __reg16(PLD_BASE + 0x14000) - -/* ICU */ -#define M32R_IRQ_PC104 (5) /* INT4(PC/104) */ -#define M32R_IRQ_I2C (28) /* I2C-BUS */ -#define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */ -#define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert & Eject */ -#define PLD_IRQ_IDEIREQ (8) /* INT7 IDE Interrupt */ -#define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ -#define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */ - -#if 0 -/* LED Control - * - * 1: DIP swich side - * 2: Reset switch side - */ -#define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002) -#define PLD_IOLED_1_ON 0x001 -#define PLD_IOLED_1_OFF 0x000 -#define PLD_IOLED_2_ON 0x002 -#define PLD_IOLED_2_OFF 0x000 - -/* DIP Switch - * 0: Write-protect of Flash Memory (0:protected, 1:non-protected) - * 1: - - * 2: - - * 3: - - */ -#define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004) -#define PLD_IOSWSTS_IOSW2 0x0200 -#define PLD_IOSWSTS_IOSW1 0x0100 -#define PLD_IOSWSTS_IOWP0 0x0001 - -#endif - -/* CRC */ -#define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000) -#define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002) -#define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004) -#define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006) -#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) -#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) - -#if 0 -/* RTC */ -#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) -#define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002) -#define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004) -#define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006) -#define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008) - -/* SIO0 */ -#define PLD_ESIO0CR __reg16(PLD_BASE + 0x20000) -#define PLD_ESIO0CR_TXEN 0x0001 -#define PLD_ESIO0CR_RXEN 0x0002 -#define PLD_ESIO0MOD0 __reg16(PLD_BASE + 0x20002) -#define PLD_ESIO0MOD0_CTSS 0x0040 -#define PLD_ESIO0MOD0_RTSS 0x0080 -#define PLD_ESIO0MOD1 __reg16(PLD_BASE + 0x20004) -#define PLD_ESIO0MOD1_LMFS 0x0010 -#define PLD_ESIO0STS __reg16(PLD_BASE + 0x20006) -#define PLD_ESIO0STS_TEMP 0x0001 -#define PLD_ESIO0STS_TXCP 0x0002 -#define PLD_ESIO0STS_RXCP 0x0004 -#define PLD_ESIO0STS_TXSC 0x0100 -#define PLD_ESIO0STS_RXSC 0x0200 -#define PLD_ESIO0STS_TXREADY (PLD_ESIO0STS_TXCP | PLD_ESIO0STS_TEMP) -#define PLD_ESIO0INTCR __reg16(PLD_BASE + 0x20008) -#define PLD_ESIO0INTCR_TXIEN 0x0002 -#define PLD_ESIO0INTCR_RXCEN 0x0004 -#define PLD_ESIO0BAUR __reg16(PLD_BASE + 0x2000a) -#define PLD_ESIO0TXB __reg16(PLD_BASE + 0x2000c) -#define PLD_ESIO0RXB __reg16(PLD_BASE + 0x2000e) - -/* SIM Card */ -#define PLD_SCCR __reg16(PLD_BASE + 0x38000) -#define PLD_SCMOD __reg16(PLD_BASE + 0x38004) -#define PLD_SCSTS __reg16(PLD_BASE + 0x38006) -#define PLD_SCINTCR __reg16(PLD_BASE + 0x38008) -#define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a) -#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) -#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) - -#endif - -/* Reset Control */ -#define PLD_REBOOT __reg16(PLD_BASE + 0x38000) - -#endif /* _MAPPI3_PLD.H */ diff --git a/arch/m32r/include/asm/mc146818rtc.h b/arch/m32r/include/asm/mc146818rtc.h deleted file mode 100644 index 4effa4704347..000000000000 --- a/arch/m32r/include/asm/mc146818rtc.h +++ /dev/null @@ -1,30 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Machine dependent access functions for RTC registers. - */ -#ifndef _ASM_MC146818RTC_H -#define _ASM_MC146818RTC_H - -#include - -#ifndef RTC_PORT -#define RTC_PORT(x) ((x)) -#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */ -#endif - -/* - * The yet supported machines all access the RTC index register via - * an ISA port access but the way to access the date register differs ... - */ -#define CMOS_READ(addr) ({ \ -outb_p((addr),RTC_PORT(0)); \ -inb_p(RTC_PORT(1)); \ -}) -#define CMOS_WRITE(val, addr) ({ \ -outb_p((addr),RTC_PORT(0)); \ -outb_p((val),RTC_PORT(1)); \ -}) - -#define RTC_IRQ 8 - -#endif /* _ASM_MC146818RTC_H */ diff --git a/arch/m32r/include/asm/mmu.h b/arch/m32r/include/asm/mmu.h deleted file mode 100644 index 34bcccd8007d..000000000000 --- a/arch/m32r/include/asm/mmu.h +++ /dev/null @@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_MMU_H -#define _ASM_M32R_MMU_H - -#if !defined(CONFIG_MMU) - -typedef struct { - unsigned long end_brk; -} mm_context_t; - -#else /* CONFIG_MMU */ - -/* Default "unsigned long" context */ -#ifndef CONFIG_SMP -typedef unsigned long mm_context_t; -#else -typedef unsigned long mm_context_t[NR_CPUS]; -#endif - -#endif /* CONFIG_MMU */ - -#endif /* _ASM_M32R_MMU_H */ diff --git a/arch/m32r/include/asm/mmu_context.h b/arch/m32r/include/asm/mmu_context.h deleted file mode 100644 index 8a499d0fb3a2..000000000000 --- a/arch/m32r/include/asm/mmu_context.h +++ /dev/null @@ -1,167 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_MMU_CONTEXT_H -#define _ASM_M32R_MMU_CONTEXT_H -#ifdef __KERNEL__ - -#include - -#define MMU_CONTEXT_ASID_MASK (0x000000FF) -#define MMU_CONTEXT_VERSION_MASK (0xFFFFFF00) -#define MMU_CONTEXT_FIRST_VERSION (0x00000100) -#define NO_CONTEXT (0x00000000) - -#ifndef __ASSEMBLY__ - -#include -#include - -#include -#include -#include -#include - -/* - * Cache of MMU context last used. - */ -#ifndef CONFIG_SMP -extern unsigned long mmu_context_cache_dat; -#define mmu_context_cache mmu_context_cache_dat -#define mm_context(mm) mm->context -#else /* not CONFIG_SMP */ -extern unsigned long mmu_context_cache_dat[]; -#define mmu_context_cache mmu_context_cache_dat[smp_processor_id()] -#define mm_context(mm) mm->context[smp_processor_id()] -#endif /* not CONFIG_SMP */ - -#define set_tlb_tag(entry, tag) (*entry = (tag & PAGE_MASK)|get_asid()) -#define set_tlb_data(entry, data) (*entry = (data | _PAGE_PRESENT)) - -#ifdef CONFIG_MMU -#define enter_lazy_tlb(mm, tsk) do { } while (0) - -static inline void get_new_mmu_context(struct mm_struct *mm) -{ - unsigned long mc = ++mmu_context_cache; - - if (!(mc & MMU_CONTEXT_ASID_MASK)) { - /* We exhaust ASID of this version. - Flush all TLB and start new cycle. */ - local_flush_tlb_all(); - /* Fix version if needed. - Note that we avoid version #0 to distinguish NO_CONTEXT. */ - if (!mc) - mmu_context_cache = mc = MMU_CONTEXT_FIRST_VERSION; - } - mm_context(mm) = mc; -} - -/* - * Get MMU context if needed. - */ -static inline void get_mmu_context(struct mm_struct *mm) -{ - if (mm) { - unsigned long mc = mmu_context_cache; - - /* Check if we have old version of context. - If it's old, we need to get new context with new version. */ - if ((mm_context(mm) ^ mc) & MMU_CONTEXT_VERSION_MASK) - get_new_mmu_context(mm); - } -} - -/* - * Initialize the context related info for a new mm_struct - * instance. - */ -static inline int init_new_context(struct task_struct *tsk, - struct mm_struct *mm) -{ -#ifndef CONFIG_SMP - mm->context = NO_CONTEXT; -#else /* CONFIG_SMP */ - int num_cpus = num_online_cpus(); - int i; - - for (i = 0 ; i < num_cpus ; i++) - mm->context[i] = NO_CONTEXT; -#endif /* CONFIG_SMP */ - - return 0; -} - -/* - * Destroy context related info for an mm_struct that is about - * to be put to rest. - */ -#define destroy_context(mm) do { } while (0) - -static inline void set_asid(unsigned long asid) -{ - *(volatile unsigned long *)MASID = (asid & MMU_CONTEXT_ASID_MASK); -} - -static inline unsigned long get_asid(void) -{ - unsigned long asid; - - asid = *(volatile long *)MASID; - asid &= MMU_CONTEXT_ASID_MASK; - - return asid; -} - -/* - * After we have set current->mm to a new value, this activates - * the context for the new mm so we see the new mappings. - */ -static inline void activate_context(struct mm_struct *mm) -{ - get_mmu_context(mm); - set_asid(mm_context(mm) & MMU_CONTEXT_ASID_MASK); -} - -static inline void switch_mm(struct mm_struct *prev, - struct mm_struct *next, struct task_struct *tsk) -{ -#ifdef CONFIG_SMP - int cpu = smp_processor_id(); -#endif /* CONFIG_SMP */ - - if (prev != next) { -#ifdef CONFIG_SMP - cpumask_set_cpu(cpu, mm_cpumask(next)); -#endif /* CONFIG_SMP */ - /* Set MPTB = next->pgd */ - *(volatile unsigned long *)MPTB = (unsigned long)next->pgd; - activate_context(next); - } -#ifdef CONFIG_SMP - else - if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next))) - activate_context(next); -#endif /* CONFIG_SMP */ -} - -#define deactivate_mm(tsk, mm) do { } while (0) - -#define activate_mm(prev, next) \ - switch_mm((prev), (next), NULL) - -#else /* not CONFIG_MMU */ -#define get_mmu_context(mm) do { } while (0) -#define init_new_context(tsk,mm) (0) -#define destroy_context(mm) do { } while (0) -#define set_asid(asid) do { } while (0) -#define get_asid() (0) -#define activate_context(mm) do { } while (0) -#define switch_mm(prev,next,tsk) do { } while (0) -#define deactivate_mm(mm,tsk) do { } while (0) -#define activate_mm(prev,next) do { } while (0) -#define enter_lazy_tlb(mm,tsk) do { } while (0) -#endif /* not CONFIG_MMU */ - -#endif /* not __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ -#endif /* _ASM_M32R_MMU_CONTEXT_H */ diff --git a/arch/m32r/include/asm/mmzone.h b/arch/m32r/include/asm/mmzone.h deleted file mode 100644 index 568946c13ba6..000000000000 --- a/arch/m32r/include/asm/mmzone.h +++ /dev/null @@ -1,54 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Written by Pat Gaughen (gone@us.ibm.com) Mar 2002 - * - */ - -#ifndef _ASM_MMZONE_H_ -#define _ASM_MMZONE_H_ - -#include - -#ifdef CONFIG_DISCONTIGMEM - -extern struct pglist_data *node_data[]; -#define NODE_DATA(nid) (node_data[nid]) - -#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) - -#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) -/* - * pfn_valid should be made as fast as possible, and the current definition - * is valid for machines that are NUMA, but still contiguous, which is what - * is currently supported. A more generalised, but slower definition would - * be something like this - mbligh: - * ( pfn_to_pgdat(pfn) && ((pfn) < node_end_pfn(pfn_to_nid(pfn))) ) - */ -#if 1 /* M32R_FIXME */ -#define pfn_valid(pfn) (1) -#else -#define pfn_valid(pfn) ((pfn) < num_physpages) -#endif - -/* - * generic node memory support, the following assumptions apply: - */ - -static __inline__ int pfn_to_nid(unsigned long pfn) -{ - int node; - - for (node = 0 ; node < MAX_NUMNODES ; node++) - if (pfn >= node_start_pfn(node) && pfn < node_end_pfn(node)) - break; - - return node; -} - -static __inline__ struct pglist_data *pfn_to_pgdat(unsigned long pfn) -{ - return(NODE_DATA(pfn_to_nid(pfn))); -} - -#endif /* CONFIG_DISCONTIGMEM */ -#endif /* _ASM_MMZONE_H_ */ diff --git a/arch/m32r/include/asm/opsput/opsput_lan.h b/arch/m32r/include/asm/opsput/opsput_lan.h deleted file mode 100644 index a5f18dd1ab20..000000000000 --- a/arch/m32r/include/asm/opsput/opsput_lan.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _OPSPUT_OPSPUT_LAN_H -#define _OPSPUT_OPSPUT_LAN_H - -/* - * include/asm-m32r/opsput/opsput_lan.h - * - * OPSPUT-LAN board - * - * Copyright (c) 2002-2004 Takeo Takahashi, Mamoru Sakugawa - * - * 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. - */ - -#ifndef __ASSEMBLY__ -/* - * C functions use non-cache address. - */ -#define OPSPUT_LAN_BASE (0x10000000 /* + NONCACHE_OFFSET */) -#else -#define OPSPUT_LAN_BASE (0x10000000 + NONCACHE_OFFSET) -#endif /* __ASSEMBLY__ */ - -/* ICU - * ICUISTS: status register - * ICUIREQ0: request register - * ICUIREQ1: request register - * ICUCR3: control register for CFIREQ# interrupt - * ICUCR4: control register for CFC Card insert interrupt - * ICUCR5: control register for CFC Card eject interrupt - * ICUCR6: control register for external interrupt - * ICUCR11: control register for MMC Card insert/eject interrupt - * ICUCR13: control register for SC error interrupt - * ICUCR14: control register for SC receive interrupt - * ICUCR15: control register for SC send interrupt - * ICUCR16: control register for SIO0 receive interrupt - * ICUCR17: control register for SIO0 send interrupt - */ -#define OPSPUT_LAN_IRQ_LAN (OPSPUT_LAN_PLD_IRQ_BASE + 1) /* LAN */ -#define OPSPUT_LAN_IRQ_I2C (OPSPUT_LAN_PLD_IRQ_BASE + 3) /* I2C */ - -#define OPSPUT_LAN_ICUISTS __reg16(OPSPUT_LAN_BASE + 0xc0002) -#define OPSPUT_LAN_ICUISTS_VECB_MASK (0xf000) -#define OPSPUT_LAN_VECB(x) ((x) & OPSPUT_LAN_ICUISTS_VECB_MASK) -#define OPSPUT_LAN_ICUISTS_ISN_MASK (0x07c0) -#define OPSPUT_LAN_ICUISTS_ISN(x) ((x) & OPSPUT_LAN_ICUISTS_ISN_MASK) -#define OPSPUT_LAN_ICUIREQ0 __reg16(OPSPUT_LAN_BASE + 0xc0004) -#define OPSPUT_LAN_ICUCR1 __reg16(OPSPUT_LAN_BASE + 0xc0010) -#define OPSPUT_LAN_ICUCR3 __reg16(OPSPUT_LAN_BASE + 0xc0014) - -#endif /* _OPSPUT_OPSPUT_LAN_H */ diff --git a/arch/m32r/include/asm/opsput/opsput_lcd.h b/arch/m32r/include/asm/opsput/opsput_lcd.h deleted file mode 100644 index 369c9f0832a6..000000000000 --- a/arch/m32r/include/asm/opsput/opsput_lcd.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _OPSPUT_OPSPUT_LCD_H -#define _OPSPUT_OPSPUT_LCD_H - -/* - * include/asm-m32r/opsput/opsput_lcd.h - * - * OPSPUT-LCD board - * - * Copyright (c) 2002 Takeo Takahashi - * - * 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. - */ - -#ifndef __ASSEMBLY__ -/* - * C functions use non-cache address. - */ -#define OPSPUT_LCD_BASE (0x10000000 /* + NONCACHE_OFFSET */) -#else -#define OPSPUT_LCD_BASE (0x10000000 + NONCACHE_OFFSET) -#endif /* __ASSEMBLY__ */ - -/* - * ICU - */ -#define OPSPUT_LCD_IRQ_BAT_INT (OPSPUT_LCD_PLD_IRQ_BASE + 1) -#define OPSPUT_LCD_IRQ_USB_INT1 (OPSPUT_LCD_PLD_IRQ_BASE + 2) -#define OPSPUT_LCD_IRQ_AUDT0 (OPSPUT_LCD_PLD_IRQ_BASE + 3) -#define OPSPUT_LCD_IRQ_AUDT2 (OPSPUT_LCD_PLD_IRQ_BASE + 4) -#define OPSPUT_LCD_IRQ_BATSIO_RCV (OPSPUT_LCD_PLD_IRQ_BASE + 16) -#define OPSPUT_LCD_IRQ_BATSIO_SND (OPSPUT_LCD_PLD_IRQ_BASE + 17) -#define OPSPUT_LCD_IRQ_ASNDSIO_RCV (OPSPUT_LCD_PLD_IRQ_BASE + 18) -#define OPSPUT_LCD_IRQ_ASNDSIO_SND (OPSPUT_LCD_PLD_IRQ_BASE + 19) -#define OPSPUT_LCD_IRQ_ACNLSIO_SND (OPSPUT_LCD_PLD_IRQ_BASE + 21) - -#define OPSPUT_LCD_ICUISTS __reg16(OPSPUT_LCD_BASE + 0x300002) -#define OPSPUT_LCD_ICUISTS_VECB_MASK (0xf000) -#define OPSPUT_LCD_VECB(x) ((x) & OPSPUT_LCD_ICUISTS_VECB_MASK) -#define OPSPUT_LCD_ICUISTS_ISN_MASK (0x07c0) -#define OPSPUT_LCD_ICUISTS_ISN(x) ((x) & OPSPUT_LCD_ICUISTS_ISN_MASK) -#define OPSPUT_LCD_ICUIREQ0 __reg16(OPSPUT_LCD_BASE + 0x300004) -#define OPSPUT_LCD_ICUIREQ1 __reg16(OPSPUT_LCD_BASE + 0x300006) -#define OPSPUT_LCD_ICUCR1 __reg16(OPSPUT_LCD_BASE + 0x300020) -#define OPSPUT_LCD_ICUCR2 __reg16(OPSPUT_LCD_BASE + 0x300022) -#define OPSPUT_LCD_ICUCR3 __reg16(OPSPUT_LCD_BASE + 0x300024) -#define OPSPUT_LCD_ICUCR4 __reg16(OPSPUT_LCD_BASE + 0x300026) -#define OPSPUT_LCD_ICUCR16 __reg16(OPSPUT_LCD_BASE + 0x300030) -#define OPSPUT_LCD_ICUCR17 __reg16(OPSPUT_LCD_BASE + 0x300032) -#define OPSPUT_LCD_ICUCR18 __reg16(OPSPUT_LCD_BASE + 0x300034) -#define OPSPUT_LCD_ICUCR19 __reg16(OPSPUT_LCD_BASE + 0x300036) -#define OPSPUT_LCD_ICUCR21 __reg16(OPSPUT_LCD_BASE + 0x30003a) - -#endif /* _OPSPUT_OPSPUT_LCD_H */ diff --git a/arch/m32r/include/asm/opsput/opsput_pld.h b/arch/m32r/include/asm/opsput/opsput_pld.h deleted file mode 100644 index 6901401fe9eb..000000000000 --- a/arch/m32r/include/asm/opsput/opsput_pld.h +++ /dev/null @@ -1,255 +0,0 @@ -#ifndef _OPSPUT_OPSPUT_PLD_H -#define _OPSPUT_OPSPUT_PLD_H - -/* - * include/asm-m32r/opsput/opsput_pld.h - * - * Definitions for Programmable Logic Device(PLD) on OPSPUT board. - * - * Copyright (c) 2002 Takeo Takahashi - * - * 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. - */ - -#define PLD_PLAT_BASE 0x1cc00000 - -#ifndef __ASSEMBLY__ -/* - * C functions use non-cache address. - */ -#define PLD_BASE (PLD_PLAT_BASE /* + NONCACHE_OFFSET */) -#define __reg8 (volatile unsigned char *) -#define __reg16 (volatile unsigned short *) -#define __reg32 (volatile unsigned int *) -#else -#define PLD_BASE (PLD_PLAT_BASE + NONCACHE_OFFSET) -#define __reg8 -#define __reg16 -#define __reg32 -#endif /* __ASSEMBLY__ */ - -/* CFC */ -#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) -#define PLD_CFSTS __reg16(PLD_BASE + 0x0002) -#define PLD_CFIMASK __reg16(PLD_BASE + 0x0004) -#define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006) -#define PLD_CFVENCR __reg16(PLD_BASE + 0x0008) -#define PLD_CFCR0 __reg16(PLD_BASE + 0x000a) -#define PLD_CFCR1 __reg16(PLD_BASE + 0x000c) -#define PLD_IDERSTCR __reg16(PLD_BASE + 0x0010) - -/* MMC */ -#define PLD_MMCCR __reg16(PLD_BASE + 0x4000) -#define PLD_MMCMOD __reg16(PLD_BASE + 0x4002) -#define PLD_MMCSTS __reg16(PLD_BASE + 0x4006) -#define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a) -#define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c) -#define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e) -#define PLD_MMCDET __reg16(PLD_BASE + 0x4010) -#define PLD_MMCWP __reg16(PLD_BASE + 0x4012) -#define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000) -#define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000) -#define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000) -#define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006) - -/* ICU - * ICUISTS: status register - * ICUIREQ0: request register - * ICUIREQ1: request register - * ICUCR3: control register for CFIREQ# interrupt - * ICUCR4: control register for CFC Card insert interrupt - * ICUCR5: control register for CFC Card eject interrupt - * ICUCR6: control register for external interrupt - * ICUCR11: control register for MMC Card insert/eject interrupt - * ICUCR13: control register for SC error interrupt - * ICUCR14: control register for SC receive interrupt - * ICUCR15: control register for SC send interrupt - * ICUCR16: control register for SIO0 receive interrupt - * ICUCR17: control register for SIO0 send interrupt - */ -#if !defined(CONFIG_PLAT_USRV) -#define PLD_IRQ_INT0 (OPSPUT_PLD_IRQ_BASE + 0) /* None */ -#define PLD_IRQ_INT1 (OPSPUT_PLD_IRQ_BASE + 1) /* reserved */ -#define PLD_IRQ_INT2 (OPSPUT_PLD_IRQ_BASE + 2) /* reserved */ -#define PLD_IRQ_CFIREQ (OPSPUT_PLD_IRQ_BASE + 3) /* CF IREQ */ -#define PLD_IRQ_CFC_INSERT (OPSPUT_PLD_IRQ_BASE + 4) /* CF Insert */ -#define PLD_IRQ_CFC_EJECT (OPSPUT_PLD_IRQ_BASE + 5) /* CF Eject */ -#define PLD_IRQ_EXINT (OPSPUT_PLD_IRQ_BASE + 6) /* EXINT */ -#define PLD_IRQ_INT7 (OPSPUT_PLD_IRQ_BASE + 7) /* reserved */ -#define PLD_IRQ_INT8 (OPSPUT_PLD_IRQ_BASE + 8) /* reserved */ -#define PLD_IRQ_INT9 (OPSPUT_PLD_IRQ_BASE + 9) /* reserved */ -#define PLD_IRQ_INT10 (OPSPUT_PLD_IRQ_BASE + 10) /* reserved */ -#define PLD_IRQ_MMCCARD (OPSPUT_PLD_IRQ_BASE + 11) /* MMC Insert/Eject */ -#define PLD_IRQ_INT12 (OPSPUT_PLD_IRQ_BASE + 12) /* reserved */ -#define PLD_IRQ_SC_ERROR (OPSPUT_PLD_IRQ_BASE + 13) /* SC error */ -#define PLD_IRQ_SC_RCV (OPSPUT_PLD_IRQ_BASE + 14) /* SC receive */ -#define PLD_IRQ_SC_SND (OPSPUT_PLD_IRQ_BASE + 15) /* SC send */ -#define PLD_IRQ_SIO0_RCV (OPSPUT_PLD_IRQ_BASE + 16) /* SIO receive */ -#define PLD_IRQ_SIO0_SND (OPSPUT_PLD_IRQ_BASE + 17) /* SIO send */ -#define PLD_IRQ_INT18 (OPSPUT_PLD_IRQ_BASE + 18) /* reserved */ -#define PLD_IRQ_INT19 (OPSPUT_PLD_IRQ_BASE + 19) /* reserved */ -#define PLD_IRQ_INT20 (OPSPUT_PLD_IRQ_BASE + 20) /* reserved */ -#define PLD_IRQ_INT21 (OPSPUT_PLD_IRQ_BASE + 21) /* reserved */ -#define PLD_IRQ_INT22 (OPSPUT_PLD_IRQ_BASE + 22) /* reserved */ -#define PLD_IRQ_INT23 (OPSPUT_PLD_IRQ_BASE + 23) /* reserved */ -#define PLD_IRQ_INT24 (OPSPUT_PLD_IRQ_BASE + 24) /* reserved */ -#define PLD_IRQ_INT25 (OPSPUT_PLD_IRQ_BASE + 25) /* reserved */ -#define PLD_IRQ_INT26 (OPSPUT_PLD_IRQ_BASE + 26) /* reserved */ -#define PLD_IRQ_INT27 (OPSPUT_PLD_IRQ_BASE + 27) /* reserved */ -#define PLD_IRQ_INT28 (OPSPUT_PLD_IRQ_BASE + 28) /* reserved */ -#define PLD_IRQ_INT29 (OPSPUT_PLD_IRQ_BASE + 29) /* reserved */ -#define PLD_IRQ_INT30 (OPSPUT_PLD_IRQ_BASE + 30) /* reserved */ -#define PLD_IRQ_INT31 (OPSPUT_PLD_IRQ_BASE + 31) /* reserved */ - -#else /* CONFIG_PLAT_USRV */ - -#define PLD_IRQ_INT0 (OPSPUT_PLD_IRQ_BASE + 0) /* None */ -#define PLD_IRQ_INT1 (OPSPUT_PLD_IRQ_BASE + 1) /* reserved */ -#define PLD_IRQ_INT2 (OPSPUT_PLD_IRQ_BASE + 2) /* reserved */ -#define PLD_IRQ_CF0 (OPSPUT_PLD_IRQ_BASE + 3) /* CF0# */ -#define PLD_IRQ_CF1 (OPSPUT_PLD_IRQ_BASE + 4) /* CF1# */ -#define PLD_IRQ_CF2 (OPSPUT_PLD_IRQ_BASE + 5) /* CF2# */ -#define PLD_IRQ_CF3 (OPSPUT_PLD_IRQ_BASE + 6) /* CF3# */ -#define PLD_IRQ_CF4 (OPSPUT_PLD_IRQ_BASE + 7) /* CF4# */ -#define PLD_IRQ_INT8 (OPSPUT_PLD_IRQ_BASE + 8) /* reserved */ -#define PLD_IRQ_INT9 (OPSPUT_PLD_IRQ_BASE + 9) /* reserved */ -#define PLD_IRQ_INT10 (OPSPUT_PLD_IRQ_BASE + 10) /* reserved */ -#define PLD_IRQ_INT11 (OPSPUT_PLD_IRQ_BASE + 11) /* reserved */ -#define PLD_IRQ_UART0 (OPSPUT_PLD_IRQ_BASE + 12) /* UARTIRQ0 */ -#define PLD_IRQ_UART1 (OPSPUT_PLD_IRQ_BASE + 13) /* UARTIRQ1 */ -#define PLD_IRQ_INT14 (OPSPUT_PLD_IRQ_BASE + 14) /* reserved */ -#define PLD_IRQ_INT15 (OPSPUT_PLD_IRQ_BASE + 15) /* reserved */ -#define PLD_IRQ_SNDINT (OPSPUT_PLD_IRQ_BASE + 16) /* SNDINT# */ -#define PLD_IRQ_INT17 (OPSPUT_PLD_IRQ_BASE + 17) /* reserved */ -#define PLD_IRQ_INT18 (OPSPUT_PLD_IRQ_BASE + 18) /* reserved */ -#define PLD_IRQ_INT19 (OPSPUT_PLD_IRQ_BASE + 19) /* reserved */ -#define PLD_IRQ_INT20 (OPSPUT_PLD_IRQ_BASE + 20) /* reserved */ -#define PLD_IRQ_INT21 (OPSPUT_PLD_IRQ_BASE + 21) /* reserved */ -#define PLD_IRQ_INT22 (OPSPUT_PLD_IRQ_BASE + 22) /* reserved */ -#define PLD_IRQ_INT23 (OPSPUT_PLD_IRQ_BASE + 23) /* reserved */ -#define PLD_IRQ_INT24 (OPSPUT_PLD_IRQ_BASE + 24) /* reserved */ -#define PLD_IRQ_INT25 (OPSPUT_PLD_IRQ_BASE + 25) /* reserved */ -#define PLD_IRQ_INT26 (OPSPUT_PLD_IRQ_BASE + 26) /* reserved */ -#define PLD_IRQ_INT27 (OPSPUT_PLD_IRQ_BASE + 27) /* reserved */ -#define PLD_IRQ_INT28 (OPSPUT_PLD_IRQ_BASE + 28) /* reserved */ -#define PLD_IRQ_INT29 (OPSPUT_PLD_IRQ_BASE + 29) /* reserved */ -#define PLD_IRQ_INT30 (OPSPUT_PLD_IRQ_BASE + 30) /* reserved */ - -#endif /* CONFIG_PLAT_USRV */ - -#define PLD_ICUISTS __reg16(PLD_BASE + 0x8002) -#define PLD_ICUISTS_VECB_MASK (0xf000) -#define PLD_ICUISTS_VECB(x) ((x) & PLD_ICUISTS_VECB_MASK) -#define PLD_ICUISTS_ISN_MASK (0x07c0) -#define PLD_ICUISTS_ISN(x) ((x) & PLD_ICUISTS_ISN_MASK) -#define PLD_ICUIREQ0 __reg16(PLD_BASE + 0x8004) -#define PLD_ICUIREQ1 __reg16(PLD_BASE + 0x8006) -#define PLD_ICUCR1 __reg16(PLD_BASE + 0x8100) -#define PLD_ICUCR2 __reg16(PLD_BASE + 0x8102) -#define PLD_ICUCR3 __reg16(PLD_BASE + 0x8104) -#define PLD_ICUCR4 __reg16(PLD_BASE + 0x8106) -#define PLD_ICUCR5 __reg16(PLD_BASE + 0x8108) -#define PLD_ICUCR6 __reg16(PLD_BASE + 0x810a) -#define PLD_ICUCR7 __reg16(PLD_BASE + 0x810c) -#define PLD_ICUCR8 __reg16(PLD_BASE + 0x810e) -#define PLD_ICUCR9 __reg16(PLD_BASE + 0x8110) -#define PLD_ICUCR10 __reg16(PLD_BASE + 0x8112) -#define PLD_ICUCR11 __reg16(PLD_BASE + 0x8114) -#define PLD_ICUCR12 __reg16(PLD_BASE + 0x8116) -#define PLD_ICUCR13 __reg16(PLD_BASE + 0x8118) -#define PLD_ICUCR14 __reg16(PLD_BASE + 0x811a) -#define PLD_ICUCR15 __reg16(PLD_BASE + 0x811c) -#define PLD_ICUCR16 __reg16(PLD_BASE + 0x811e) -#define PLD_ICUCR17 __reg16(PLD_BASE + 0x8120) -#define PLD_ICUCR_IEN (0x1000) -#define PLD_ICUCR_IREQ (0x0100) -#define PLD_ICUCR_ISMOD00 (0x0000) /* Low edge */ -#define PLD_ICUCR_ISMOD01 (0x0010) /* Low level */ -#define PLD_ICUCR_ISMOD02 (0x0020) /* High edge */ -#define PLD_ICUCR_ISMOD03 (0x0030) /* High level */ -#define PLD_ICUCR_ILEVEL0 (0x0000) -#define PLD_ICUCR_ILEVEL1 (0x0001) -#define PLD_ICUCR_ILEVEL2 (0x0002) -#define PLD_ICUCR_ILEVEL3 (0x0003) -#define PLD_ICUCR_ILEVEL4 (0x0004) -#define PLD_ICUCR_ILEVEL5 (0x0005) -#define PLD_ICUCR_ILEVEL6 (0x0006) -#define PLD_ICUCR_ILEVEL7 (0x0007) - -/* Power Control of MMC and CF */ -#define PLD_CPCR __reg16(PLD_BASE + 0x14000) -#define PLD_CPCR_CF 0x0001 -#define PLD_CPCR_MMC 0x0002 - -/* LED Control - * - * 1: DIP swich side - * 2: Reset switch side - */ -#define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002) -#define PLD_IOLED_1_ON 0x001 -#define PLD_IOLED_1_OFF 0x000 -#define PLD_IOLED_2_ON 0x002 -#define PLD_IOLED_2_OFF 0x000 - -/* DIP Switch - * 0: Write-protect of Flash Memory (0:protected, 1:non-protected) - * 1: - - * 2: - - * 3: - - */ -#define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004) -#define PLD_IOSWSTS_IOSW2 0x0200 -#define PLD_IOSWSTS_IOSW1 0x0100 -#define PLD_IOSWSTS_IOWP0 0x0001 - -/* CRC */ -#define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000) -#define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002) -#define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004) -#define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006) -#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) -#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) - -/* RTC */ -#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) -#define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002) -#define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004) -#define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006) -#define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008) - -/* SIO0 */ -#define PLD_ESIO0CR __reg16(PLD_BASE + 0x20000) -#define PLD_ESIO0CR_TXEN 0x0001 -#define PLD_ESIO0CR_RXEN 0x0002 -#define PLD_ESIO0MOD0 __reg16(PLD_BASE + 0x20002) -#define PLD_ESIO0MOD0_CTSS 0x0040 -#define PLD_ESIO0MOD0_RTSS 0x0080 -#define PLD_ESIO0MOD1 __reg16(PLD_BASE + 0x20004) -#define PLD_ESIO0MOD1_LMFS 0x0010 -#define PLD_ESIO0STS __reg16(PLD_BASE + 0x20006) -#define PLD_ESIO0STS_TEMP 0x0001 -#define PLD_ESIO0STS_TXCP 0x0002 -#define PLD_ESIO0STS_RXCP 0x0004 -#define PLD_ESIO0STS_TXSC 0x0100 -#define PLD_ESIO0STS_RXSC 0x0200 -#define PLD_ESIO0STS_TXREADY (PLD_ESIO0STS_TXCP | PLD_ESIO0STS_TEMP) -#define PLD_ESIO0INTCR __reg16(PLD_BASE + 0x20008) -#define PLD_ESIO0INTCR_TXIEN 0x0002 -#define PLD_ESIO0INTCR_RXCEN 0x0004 -#define PLD_ESIO0BAUR __reg16(PLD_BASE + 0x2000a) -#define PLD_ESIO0TXB __reg16(PLD_BASE + 0x2000c) -#define PLD_ESIO0RXB __reg16(PLD_BASE + 0x2000e) - -/* SIM Card */ -#define PLD_SCCR __reg16(PLD_BASE + 0x38000) -#define PLD_SCMOD __reg16(PLD_BASE + 0x38004) -#define PLD_SCSTS __reg16(PLD_BASE + 0x38006) -#define PLD_SCINTCR __reg16(PLD_BASE + 0x38008) -#define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a) -#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) -#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) - -#endif /* _OPSPUT_OPSPUT_PLD.H */ diff --git a/arch/m32r/include/asm/page.h b/arch/m32r/include/asm/page.h deleted file mode 100644 index fe4e38b394d3..000000000000 --- a/arch/m32r/include/asm/page.h +++ /dev/null @@ -1,90 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_PAGE_H -#define _ASM_M32R_PAGE_H - -#include - -/* PAGE_SHIFT determines the page size */ -#define PAGE_SHIFT 12 -#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) - -#ifndef __ASSEMBLY__ - -extern void clear_page(void *to); -extern void copy_page(void *to, void *from); - -#define clear_user_page(page, vaddr, pg) clear_page(page) -#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) - -#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ - alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) -#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE - -/* - * These are used to make use of C type-checking.. - */ -typedef struct { unsigned long pte; } pte_t; -typedef struct { unsigned long pmd; } pmd_t; -typedef struct { unsigned long pgd; } pgd_t; -#define pte_val(x) ((x).pte) -#define PTE_MASK PAGE_MASK - -typedef struct { unsigned long pgprot; } pgprot_t; -typedef struct page *pgtable_t; - -#define pmd_val(x) ((x).pmd) -#define pgd_val(x) ((x).pgd) -#define pgprot_val(x) ((x).pgprot) - -#define __pte(x) ((pte_t) { (x) } ) -#define __pmd(x) ((pmd_t) { (x) } ) -#define __pgd(x) ((pgd_t) { (x) } ) -#define __pgprot(x) ((pgprot_t) { (x) } ) - -#endif /* !__ASSEMBLY__ */ - -/* - * This handles the memory map.. We could make this a config - * option, but too many people screw it up, and too few need - * it. - * - * A __PAGE_OFFSET of 0xC0000000 means that the kernel has - * a virtual address space of one gigabyte, which limits the - * amount of physical memory you can use to about 950MB. - * - * If you want more physical memory than this then see the CONFIG_HIGHMEM4G - * and CONFIG_HIGHMEM64G options in the kernel configuration. - */ - -#define __MEMORY_START CONFIG_MEMORY_START -#define __MEMORY_SIZE CONFIG_MEMORY_SIZE - -#ifdef CONFIG_MMU -#define __PAGE_OFFSET (0x80000000) -#else -#define __PAGE_OFFSET (0x00000000) -#endif - -#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) -#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) -#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) - -#ifndef CONFIG_DISCONTIGMEM -#define PFN_BASE (CONFIG_MEMORY_START >> PAGE_SHIFT) -#define ARCH_PFN_OFFSET PFN_BASE -#define pfn_valid(pfn) (((pfn) - PFN_BASE) < max_mapnr) -#endif /* !CONFIG_DISCONTIGMEM */ - -#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) - -#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ - VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC ) - -#define devmem_is_allowed(x) 1 - -#include -#include - -#endif /* _ASM_M32R_PAGE_H */ diff --git a/arch/m32r/include/asm/pci.h b/arch/m32r/include/asm/pci.h deleted file mode 100644 index cbcb28b5f6ff..000000000000 --- a/arch/m32r/include/asm/pci.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_PCI_H -#define _ASM_M32R_PCI_H - -#include - -#endif /* _ASM_M32R_PCI_H */ diff --git a/arch/m32r/include/asm/percpu.h b/arch/m32r/include/asm/percpu.h deleted file mode 100644 index 41e1680d1117..000000000000 --- a/arch/m32r/include/asm/percpu.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ARCH_M32R_PERCPU__ -#define __ARCH_M32R_PERCPU__ - -#include - -#endif /* __ARCH_M32R_PERCPU__ */ diff --git a/arch/m32r/include/asm/pgalloc.h b/arch/m32r/include/asm/pgalloc.h deleted file mode 100644 index eed2cad57d68..000000000000 --- a/arch/m32r/include/asm/pgalloc.h +++ /dev/null @@ -1,82 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_PGALLOC_H -#define _ASM_M32R_PGALLOC_H - -#include - -#include - -#define pmd_populate_kernel(mm, pmd, pte) \ - set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))) - -static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd, - pgtable_t pte) -{ - set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte))); -} -#define pmd_pgtable(pmd) pmd_page(pmd) - -/* - * Allocate and free page tables. - */ -static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) -{ - pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); - - return pgd; -} - -static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) -{ - free_page((unsigned long)pgd); -} - -static __inline__ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, - unsigned long address) -{ - pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); - - return pte; -} - -static __inline__ pgtable_t pte_alloc_one(struct mm_struct *mm, - unsigned long address) -{ - struct page *pte = alloc_page(GFP_KERNEL|__GFP_ZERO); - - if (!pte) - return NULL; - if (!pgtable_page_ctor(pte)) { - __free_page(pte); - return NULL; - } - return pte; -} - -static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) -{ - free_page((unsigned long)pte); -} - -static inline void pte_free(struct mm_struct *mm, pgtable_t pte) -{ - pgtable_page_dtor(pte); - __free_page(pte); -} - -#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte)) - -/* - * allocating and freeing a pmd is trivial: the 1-entry pmd is - * inside the pgd, so has no extra memory associated with it. - * (In the PAE case we free the pmds as part of the pgd.) - */ - -#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) -#define pmd_free(mm, x) do { } while (0) -#define __pmd_free_tlb(tlb, x, addr) do { } while (0) -#define pgd_populate(mm, pmd, pte) BUG() - -#define check_pgt_cache() do { } while (0) - -#endif /* _ASM_M32R_PGALLOC_H */ diff --git a/arch/m32r/include/asm/pgtable-2level.h b/arch/m32r/include/asm/pgtable-2level.h deleted file mode 100644 index d7ab1e94e3cb..000000000000 --- a/arch/m32r/include/asm/pgtable-2level.h +++ /dev/null @@ -1,76 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_PGTABLE_2LEVEL_H -#define _ASM_M32R_PGTABLE_2LEVEL_H -#ifdef __KERNEL__ - -/* - * traditional M32R two-level paging structure: - */ - -#define PGDIR_SHIFT 22 -#define PTRS_PER_PGD 1024 - -/* - * the M32R is two-level, so we don't really have any - * PMD directory physically. - */ -#define __PAGETABLE_PMD_FOLDED -#define PMD_SHIFT 22 -#define PTRS_PER_PMD 1 - -#define PTRS_PER_PTE 1024 - -#define pte_ERROR(e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) -#define pmd_ERROR(e) \ - printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) -#define pgd_ERROR(e) \ - printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) - -/* - * The "pgd_xxx()" functions here are trivial for a folded two-level - * setup: the pgd is never bad, and a pmd always exists (as it's folded - * into the pgd entry) - */ -static inline int pgd_none(pgd_t pgd) { return 0; } -static inline int pgd_bad(pgd_t pgd) { return 0; } -static inline int pgd_present(pgd_t pgd) { return 1; } -#define pgd_clear(xp) do { } while (0) - -/* - * Certain architectures need to do special things when PTEs - * within a page table are directly modified. Thus, the following - * hook is made available. - */ -#define set_pte(pteptr, pteval) (*(pteptr) = pteval) -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) - -/* - * (pmds are folded into pgds so this doesn't get actually called, - * but the define is needed for a generic inline function.) - */ -#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) -#define set_pgd(pgdptr, pgdval) (*(pgdptr) = pgdval) - -#define pgd_page_vaddr(pgd) \ -((unsigned long) __va(pgd_val(pgd) & PAGE_MASK)) - -#ifndef CONFIG_DISCONTIGMEM -#define pgd_page(pgd) (mem_map + ((pgd_val(pgd) >> PAGE_SHIFT) - PFN_BASE)) -#endif /* !CONFIG_DISCONTIGMEM */ - -static inline pmd_t *pmd_offset(pgd_t * dir, unsigned long address) -{ - return (pmd_t *) dir; -} - -#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0)) -#define pte_same(a, b) (pte_val(a) == pte_val(b)) -#define pte_page(x) pfn_to_page(pte_pfn(x)) -#define pte_none(x) (!pte_val(x)) -#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) -#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) -#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) - -#endif /* __KERNEL__ */ -#endif /* _ASM_M32R_PGTABLE_2LEVEL_H */ diff --git a/arch/m32r/include/asm/pgtable.h b/arch/m32r/include/asm/pgtable.h deleted file mode 100644 index eb7f9050c8d6..000000000000 --- a/arch/m32r/include/asm/pgtable.h +++ /dev/null @@ -1,348 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_PGTABLE_H -#define _ASM_M32R_PGTABLE_H - -#include - -#ifdef __KERNEL__ -/* - * The Linux memory management assumes a three-level page table setup. On - * the M32R, we use that, but "fold" the mid level into the top-level page - * table, so that we physically have the same two-level page table as the - * M32R mmu expects. - * - * This file contains the functions and defines necessary to modify and use - * the M32R page table tree. - */ - -/* CAUTION!: If you change macro definitions in this file, you might have to - * change arch/m32r/mmu.S manually. - */ - -#ifndef __ASSEMBLY__ - -#include -#include -#include -#include -#include - -struct mm_struct; -struct vm_area_struct; - -extern pgd_t swapper_pg_dir[1024]; -extern void paging_init(void); - -/* - * ZERO_PAGE is a global shared page that is always zero: used - * for zero-mapped memory areas etc.. - */ -extern unsigned long empty_zero_page[1024]; -#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) - -#endif /* !__ASSEMBLY__ */ - -#ifndef __ASSEMBLY__ -#include -#endif - -#define pgtable_cache_init() do { } while (0) - -#define PMD_SIZE (1UL << PMD_SHIFT) -#define PMD_MASK (~(PMD_SIZE - 1)) -#define PGDIR_SIZE (1UL << PGDIR_SHIFT) -#define PGDIR_MASK (~(PGDIR_SIZE - 1)) - -#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) -#define FIRST_USER_ADDRESS 0UL - -#ifndef __ASSEMBLY__ -/* Just any arbitrary offset to the start of the vmalloc VM area: the - * current 8MB value just means that there will be a 8MB "hole" after the - * physical memory until the kernel virtual memory starts. That means that - * any out-of-bounds memory accesses will hopefully be caught. - * The vmalloc() routines leaves a hole of 4kB between each vmalloced - * area for the same reason. ;) - */ -#define VMALLOC_START KSEG2 -#define VMALLOC_END KSEG3 - -/* - * M32R TLB format - * - * [0] [1:19] [20:23] [24:31] - * +-----------------------+----+-------------+ - * | VPN |0000| ASID | - * +-----------------------+----+-------------+ - * +-+---------------------+----+-+---+-+-+-+-+ - * |0 PPN |0000|N|AC |L|G|V| | - * +-+---------------------+----+-+---+-+-+-+-+ - * RWX - */ - -#define _PAGE_BIT_DIRTY 0 /* software: page changed */ -#define _PAGE_BIT_PRESENT 1 /* Valid: page is valid */ -#define _PAGE_BIT_GLOBAL 2 /* Global */ -#define _PAGE_BIT_LARGE 3 /* Large */ -#define _PAGE_BIT_EXEC 4 /* Execute */ -#define _PAGE_BIT_WRITE 5 /* Write */ -#define _PAGE_BIT_READ 6 /* Read */ -#define _PAGE_BIT_NONCACHABLE 7 /* Non cachable */ -#define _PAGE_BIT_ACCESSED 8 /* software: page referenced */ -#define _PAGE_BIT_PROTNONE 9 /* software: if not present */ - -#define _PAGE_DIRTY (1UL << _PAGE_BIT_DIRTY) -#define _PAGE_PRESENT (1UL << _PAGE_BIT_PRESENT) -#define _PAGE_GLOBAL (1UL << _PAGE_BIT_GLOBAL) -#define _PAGE_LARGE (1UL << _PAGE_BIT_LARGE) -#define _PAGE_EXEC (1UL << _PAGE_BIT_EXEC) -#define _PAGE_WRITE (1UL << _PAGE_BIT_WRITE) -#define _PAGE_READ (1UL << _PAGE_BIT_READ) -#define _PAGE_NONCACHABLE (1UL << _PAGE_BIT_NONCACHABLE) -#define _PAGE_ACCESSED (1UL << _PAGE_BIT_ACCESSED) -#define _PAGE_PROTNONE (1UL << _PAGE_BIT_PROTNONE) - -#define _PAGE_TABLE \ - ( _PAGE_PRESENT | _PAGE_WRITE | _PAGE_READ | _PAGE_ACCESSED \ - | _PAGE_DIRTY ) -#define _KERNPG_TABLE \ - ( _PAGE_PRESENT | _PAGE_WRITE | _PAGE_READ | _PAGE_ACCESSED \ - | _PAGE_DIRTY ) -#define _PAGE_CHG_MASK \ - ( PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY ) - -#ifdef CONFIG_MMU -#define PAGE_NONE \ - __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED) -#define PAGE_SHARED \ - __pgprot(_PAGE_PRESENT | _PAGE_WRITE | _PAGE_READ | _PAGE_ACCESSED) -#define PAGE_SHARED_EXEC \ - __pgprot(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_WRITE | _PAGE_READ \ - | _PAGE_ACCESSED) -#define PAGE_COPY \ - __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_ACCESSED) -#define PAGE_COPY_EXEC \ - __pgprot(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_READ | _PAGE_ACCESSED) -#define PAGE_READONLY \ - __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_ACCESSED) -#define PAGE_READONLY_EXEC \ - __pgprot(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_READ | _PAGE_ACCESSED) - -#define __PAGE_KERNEL \ - ( _PAGE_PRESENT | _PAGE_EXEC | _PAGE_WRITE | _PAGE_READ | _PAGE_DIRTY \ - | _PAGE_ACCESSED ) -#define __PAGE_KERNEL_RO ( __PAGE_KERNEL & ~_PAGE_WRITE ) -#define __PAGE_KERNEL_NOCACHE ( __PAGE_KERNEL | _PAGE_NONCACHABLE) - -#define MAKE_GLOBAL(x) __pgprot((x) | _PAGE_GLOBAL) - -#define PAGE_KERNEL MAKE_GLOBAL(__PAGE_KERNEL) -#define PAGE_KERNEL_RO MAKE_GLOBAL(__PAGE_KERNEL_RO) -#define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE) - -#else -#define PAGE_NONE __pgprot(0) -#define PAGE_SHARED __pgprot(0) -#define PAGE_SHARED_EXEC __pgprot(0) -#define PAGE_COPY __pgprot(0) -#define PAGE_COPY_EXEC __pgprot(0) -#define PAGE_READONLY __pgprot(0) -#define PAGE_READONLY_EXEC __pgprot(0) - -#define PAGE_KERNEL __pgprot(0) -#define PAGE_KERNEL_RO __pgprot(0) -#define PAGE_KERNEL_NOCACHE __pgprot(0) -#endif /* CONFIG_MMU */ - - /* xwr */ -#define __P000 PAGE_NONE -#define __P001 PAGE_READONLY -#define __P010 PAGE_COPY -#define __P011 PAGE_COPY -#define __P100 PAGE_READONLY_EXEC -#define __P101 PAGE_READONLY_EXEC -#define __P110 PAGE_COPY_EXEC -#define __P111 PAGE_COPY_EXEC - -#define __S000 PAGE_NONE -#define __S001 PAGE_READONLY -#define __S010 PAGE_SHARED -#define __S011 PAGE_SHARED -#define __S100 PAGE_READONLY_EXEC -#define __S101 PAGE_READONLY_EXEC -#define __S110 PAGE_SHARED_EXEC -#define __S111 PAGE_SHARED_EXEC - -/* page table for 0-4MB for everybody */ - -#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE)) -#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) - -#define pmd_none(x) (!pmd_val(x)) -#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) -#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) -#define pmd_bad(x) ((pmd_val(x) & ~PAGE_MASK) != _KERNPG_TABLE) - -#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) - -/* - * The following only work if pte_present() is true. - * Undefined behaviour if not.. - */ -static inline int pte_dirty(pte_t pte) -{ - return pte_val(pte) & _PAGE_DIRTY; -} - -static inline int pte_young(pte_t pte) -{ - return pte_val(pte) & _PAGE_ACCESSED; -} - -static inline int pte_write(pte_t pte) -{ - return pte_val(pte) & _PAGE_WRITE; -} - -static inline int pte_special(pte_t pte) -{ - return 0; -} - -static inline pte_t pte_mkclean(pte_t pte) -{ - pte_val(pte) &= ~_PAGE_DIRTY; - return pte; -} - -static inline pte_t pte_mkold(pte_t pte) -{ - pte_val(pte) &= ~_PAGE_ACCESSED; - return pte; -} - -static inline pte_t pte_wrprotect(pte_t pte) -{ - pte_val(pte) &= ~_PAGE_WRITE; - return pte; -} - -static inline pte_t pte_mkdirty(pte_t pte) -{ - pte_val(pte) |= _PAGE_DIRTY; - return pte; -} - -static inline pte_t pte_mkyoung(pte_t pte) -{ - pte_val(pte) |= _PAGE_ACCESSED; - return pte; -} - -static inline pte_t pte_mkwrite(pte_t pte) -{ - pte_val(pte) |= _PAGE_WRITE; - return pte; -} - -static inline pte_t pte_mkspecial(pte_t pte) -{ - return pte; -} - -static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) -{ - return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); -} - -static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) -{ - clear_bit(_PAGE_BIT_WRITE, ptep); -} - -/* - * Macro and implementation to make a page protection as uncachable. - */ -static inline pgprot_t pgprot_noncached(pgprot_t _prot) -{ - unsigned long prot = pgprot_val(_prot); - - prot |= _PAGE_NONCACHABLE; - return __pgprot(prot); -} - -#define pgprot_writecombine(prot) pgprot_noncached(prot) - -/* - * Conversion functions: convert a page and protection to a page entry, - * and a page entry and page directory to the page they refer to. - */ -#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), pgprot) - -static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) -{ - set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) \ - | pgprot_val(newprot))); - - return pte; -} - -/* - * Conversion functions: convert a page and protection to a page entry, - * and a page entry and page directory to the page they refer to. - */ - -static inline void pmd_set(pmd_t * pmdp, pte_t * ptep) -{ - pmd_val(*pmdp) = (((unsigned long) ptep) & PAGE_MASK); -} - -#define pmd_page_vaddr(pmd) \ - ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) - -#ifndef CONFIG_DISCONTIGMEM -#define pmd_page(pmd) (mem_map + ((pmd_val(pmd) >> PAGE_SHIFT) - PFN_BASE)) -#endif /* !CONFIG_DISCONTIGMEM */ - -/* to find an entry in a page-table-directory. */ -#define pgd_index(address) \ - (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) - -#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) - -/* to find an entry in a kernel page-table-directory */ -#define pgd_offset_k(address) pgd_offset(&init_mm, address) - -#define pmd_index(address) \ - (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) - -#define pte_index(address) \ - (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) -#define pte_offset_kernel(dir, address) \ - ((pte_t *)pmd_page_vaddr(*(dir)) + pte_index(address)) -#define pte_offset_map(dir, address) \ - ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address)) -#define pte_unmap(pte) do { } while (0) - -/* Encode and de-code a swap entry */ -#define __swp_type(x) (((x).val >> 2) & 0x1f) -#define __swp_offset(x) ((x).val >> 10) -#define __swp_entry(type, offset) \ - ((swp_entry_t) { ((type) << 2) | ((offset) << 10) }) -#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) -#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) - -#endif /* !__ASSEMBLY__ */ - -/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ -#define kern_addr_valid(addr) (1) - -#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG -#define __HAVE_ARCH_PTEP_GET_AND_CLEAR -#define __HAVE_ARCH_PTEP_SET_WRPROTECT -#define __HAVE_ARCH_PTE_SAME -#include - -#endif /* __KERNEL__ */ - -#endif /* _ASM_M32R_PGTABLE_H */ diff --git a/arch/m32r/include/asm/processor.h b/arch/m32r/include/asm/processor.h deleted file mode 100644 index c70fa9ac7169..000000000000 --- a/arch/m32r/include/asm/processor.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef _ASM_M32R_PROCESSOR_H -#define _ASM_M32R_PROCESSOR_H - -/* - * include/asm-m32r/processor.h - * - * 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) 1994 Linus Torvalds - * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto - * Copyright (C) 2004 Hirokazu Takata - */ - -#include -#include -#include /* pt_regs */ - -/* - * Default implementation of macro that returns current - * instruction pointer ("program counter"). - */ -#define current_text_addr() ({ __label__ _l; _l: &&_l; }) - -/* - * CPU type and hardware bug flags. Kept separately for each CPU. - * Members of this structure are referenced in head.S, so think twice - * before touching them. [mj] - */ - -struct cpuinfo_m32r { - unsigned long pgtable_cache_sz; - unsigned long cpu_clock; - unsigned long bus_clock; - unsigned long timer_divide; - unsigned long loops_per_jiffy; -}; - -/* - * capabilities of CPUs - */ - -extern struct cpuinfo_m32r boot_cpu_data; - -#ifdef CONFIG_SMP -extern struct cpuinfo_m32r cpu_data[]; -#define current_cpu_data cpu_data[smp_processor_id()] -#else -#define cpu_data (&boot_cpu_data) -#define current_cpu_data boot_cpu_data -#endif - -/* - * User space process size: 2GB (default). - */ -#ifdef CONFIG_MMU -#define TASK_SIZE (0x80000000UL) -#else -#define TASK_SIZE (0x00400000UL) -#endif - -#ifdef __KERNEL__ -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP -#endif - -/* This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE / 3) - -typedef struct { - unsigned long seg; -} mm_segment_t; - -#define MAX_TRAPS 10 - -struct debug_trap { - int nr_trap; - unsigned long addr[MAX_TRAPS]; - unsigned long insn[MAX_TRAPS]; -}; - -struct thread_struct { - unsigned long address; - unsigned long trap_no; /* Trap number */ - unsigned long error_code; /* Error code of trap */ - unsigned long lr; /* saved pc */ - unsigned long sp; /* user stack pointer */ - struct debug_trap debug_trap; -}; - -#define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) - -#define INIT_THREAD { \ - .sp = INIT_SP, \ -} - -/* - * Do necessary setup to start up a newly executed thread. - */ - -/* User process Backup PSW */ -#define USERPS_BPSW (M32R_PSW_BSM|M32R_PSW_BIE|M32R_PSW_BPM) - -#define start_thread(regs, new_pc, new_spu) \ - do { \ - regs->psw = (regs->psw | USERPS_BPSW) & 0x0000FFFFUL; \ - regs->bpc = new_pc; \ - regs->spu = new_spu; \ - } while (0) - -/* Forward declaration, a strange C thing */ -struct task_struct; -struct mm_struct; - -/* Free all resources held by a thread. */ -extern void release_thread(struct task_struct *); - -unsigned long get_wchan(struct task_struct *p); -#define KSTK_EIP(tsk) ((tsk)->thread.lr) -#define KSTK_ESP(tsk) ((tsk)->thread.sp) - -#define cpu_relax() barrier() - -#endif /* _ASM_M32R_PROCESSOR_H */ diff --git a/arch/m32r/include/asm/ptrace.h b/arch/m32r/include/asm/ptrace.h deleted file mode 100644 index fa58ccfff865..000000000000 --- a/arch/m32r/include/asm/ptrace.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * linux/include/asm-m32r/ptrace.h - * - * 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. - * - * M32R version: - * Copyright (C) 2001-2002, 2004 Hirokazu Takata - */ -#ifndef _ASM_M32R_PTRACE_H -#define _ASM_M32R_PTRACE_H - - -#include /* M32R_PSW_BSM, M32R_PSW_BPM */ -#include - -#define arch_has_single_step() (1) - -struct task_struct; -extern void init_debug_traps(struct task_struct *); -#define arch_ptrace_attach(child) \ - init_debug_traps(child) - -#if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) -#define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0) -#elif defined(CONFIG_ISA_M32R) -#define user_mode(regs) ((M32R_PSW_BSM & (regs)->psw) != 0) -#else -#error unknown isa configuration -#endif - -#define instruction_pointer(regs) ((regs)->bpc) -#define profile_pc(regs) instruction_pointer(regs) -#define user_stack_pointer(regs) ((regs)->spu) - -extern void withdraw_debug_trap(struct pt_regs *regs); - -#define task_pt_regs(task) \ - ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1) -#define current_pt_regs() ((struct pt_regs *) \ - ((unsigned long)current_thread_info() + THREAD_SIZE) - 1) - -#endif /* _ASM_M32R_PTRACE_H */ diff --git a/arch/m32r/include/asm/rtc.h b/arch/m32r/include/asm/rtc.h deleted file mode 100644 index a94cf1edc60f..000000000000 --- a/arch/m32r/include/asm/rtc.h +++ /dev/null @@ -1,66 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RTC_H__ -#define __RTC_H__ - - /* Dallas DS1302 clock/calendar register numbers. */ -# define RTC_SECONDS 0 -# define RTC_MINUTES 1 -# define RTC_HOURS 2 -# define RTC_DAY_OF_MONTH 3 -# define RTC_MONTH 4 -# define RTC_WEEKDAY 5 -# define RTC_YEAR 6 -# define RTC_CONTROL 7 - - /* Bits in CONTROL register. */ -# define RTC_CONTROL_WRITEPROTECT 0x80 -# define RTC_TRICKLECHARGER 8 - - /* Bits in TRICKLECHARGER register TCS TCS TCS TCS DS DS RS RS. */ -# define RTC_TCR_PATTERN 0xA0 /* 1010xxxx */ -# define RTC_TCR_1DIOD 0x04 /* xxxx01xx */ -# define RTC_TCR_2DIOD 0x08 /* xxxx10xx */ -# define RTC_TCR_DISABLED 0x00 /* xxxxxx00 Disabled */ -# define RTC_TCR_2KOHM 0x01 /* xxxxxx01 2KOhm */ -# define RTC_TCR_4KOHM 0x02 /* xxxxxx10 4kOhm */ -# define RTC_TCR_8KOHM 0x03 /* xxxxxx11 8kOhm */ - -#ifdef CONFIG_DS1302 -extern unsigned char ds1302_readreg(int reg); -extern void ds1302_writereg(int reg, unsigned char val); -extern int ds1302_init(void); -# define CMOS_READ(x) ds1302_readreg(x) -# define CMOS_WRITE(val,reg) ds1302_writereg(reg,val) -# define RTC_INIT() ds1302_init() -#else - /* No RTC configured so we shouldn't try to access any. */ -# define CMOS_READ(x) 42 -# define CMOS_WRITE(x,y) -# define RTC_INIT() (-1) -#endif - -/* - * The struct used to pass data via the following ioctl. Similar to the - * struct tm in , but it needs to be here so that the kernel - * source is self contained, allowing cross-compiles, etc. etc. - */ -struct rtc_time { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; -}; - -/* ioctl() calls that are permitted to the /dev/rtc interface. */ -#define RTC_MAGIC 'p' -#define RTC_RD_TIME _IOR(RTC_MAGIC, 0x09, struct rtc_time) /* Read RTC time. */ -#define RTC_SET_TIME _IOW(RTC_MAGIC, 0x0a, struct rtc_time) /* Set RTC time. */ -#define RTC_SET_CHARGE _IOW(RTC_MAGIC, 0x0b, int) -#define RTC_MAX_IOCTL 0x0b - -#endif /* __RTC_H__ */ diff --git a/arch/m32r/include/asm/s1d13806.h b/arch/m32r/include/asm/s1d13806.h deleted file mode 100644 index 79e98a259ebe..000000000000 --- a/arch/m32r/include/asm/s1d13806.h +++ /dev/null @@ -1,200 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -//---------------------------------------------------------------------------- -// -// File generated by S1D13806CFG.EXE -// -// Copyright (c) 2000,2001 Epson Research and Development, Inc. -// All rights reserved. -// -//---------------------------------------------------------------------------- - -// Panel: (active) 640x480 77Hz STN Single 8-bit (PCLK=CLKI=25.175MHz) -// Memory: Embedded SDRAM (MCLK=CLKI3=50.000MHz) (BUSCLK=33.333MHz) - -#define SWIVEL_VIEW 0 /* 0:none, 1:90 not completed */ - -static struct s1d13xxxfb_regval s1d13xxxfb_initregs[] = { - - {0x0001,0x00}, // Miscellaneous Register - {0x01FC,0x00}, // Display Mode Register -#if defined(CONFIG_PLAT_MAPPI) - {0x0004,0x00}, // General IO Pins Configuration Register 0 - {0x0005,0x00}, // General IO Pins Configuration Register 1 - {0x0008,0x00}, // General IO Pins Control Register 0 - {0x0009,0x00}, // General IO Pins Control Register 1 - {0x0010,0x00}, // Memory Clock Configuration Register - {0x0014,0x00}, // LCD Pixel Clock Configuration Register - {0x0018,0x00}, // CRT/TV Pixel Clock Configuration Register - {0x001C,0x00}, // MediaPlug Clock Configuration Register -/* - * .. 10MHz: 0x00 - * .. 30MHz: 0x01 - * 30MHz ..: 0x02 - */ - {0x001E,0x02}, // CPU To Memory Wait State Select Register - {0x0021,0x02}, // DRAM Refresh Rate Register - {0x002A,0x11}, // DRAM Timings Control Register 0 - {0x002B,0x13}, // DRAM Timings Control Register 1 - {0x0020,0x80}, // Memory Configuration Register - {0x0030,0x25}, // Panel Type Register - {0x0031,0x00}, // MOD Rate Register - {0x0032,0x4F}, // LCD Horizontal Display Width Register - {0x0034,0x12}, // LCD Horizontal Non-Display Period Register - {0x0035,0x01}, // TFT FPLINE Start Position Register - {0x0036,0x0B}, // TFT FPLINE Pulse Width Register - {0x0038,0xDF}, // LCD Vertical Display Height Register 0 - {0x0039,0x01}, // LCD Vertical Display Height Register 1 - {0x003A,0x2C}, // LCD Vertical Non-Display Period Register - {0x003B,0x0A}, // TFT FPFRAME Start Position Register - {0x003C,0x01}, // TFT FPFRAME Pulse Width Register - - {0x0041,0x00}, // LCD Miscellaneous Register - {0x0042,0x00}, // LCD Display Start Address Register 0 - {0x0043,0x00}, // LCD Display Start Address Register 1 - {0x0044,0x00}, // LCD Display Start Address Register 2 - -#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT) || defined(CONFIG_PLAT_MAPPI3) - {0x0004,0x07}, // GPIO[0:7] direction - {0x0005,0x00}, // GPIO[8:12] direction - {0x0008,0x00}, // GPIO[0:7] data - {0x0009,0x00}, // GPIO[8:12] data - {0x0008,0x04}, // LCD panel Vcc on - {0x0008,0x05}, // LCD panel reset - {0x0010,0x01}, // Memory Clock Configuration Register - {0x0014,0x30}, // LCD Pixel Clock Configuration Register (CLKI 22MHz/4) - {0x0018,0x00}, // CRT/TV Pixel Clock Configuration Register - {0x001C,0x00}, // MediaPlug Clock Configuration Register(10MHz) - {0x001E,0x00}, // CPU To Memory Wait State Select Register - {0x0020,0x80}, // Memory Configuration Register - {0x0021,0x03}, // DRAM Refresh Rate Register - {0x002A,0x00}, // DRAM Timings Control Register 0 - {0x002B,0x01}, // DRAM Timings Control Register 1 - {0x0030,0x25}, // Panel Type Register - {0x0031,0x00}, // MOD Rate Register - {0x0032,0x1d}, // LCD Horizontal Display Width Register - {0x0034,0x05}, // LCD Horizontal Non-Display Period Register - {0x0035,0x01}, // TFT FPLINE Start Position Register - {0x0036,0x01}, // TFT FPLINE Pulse Width Register - {0x0038,0x3F}, // LCD Vertical Display Height Register 0 - {0x0039,0x01}, // LCD Vertical Display Height Register 1 - {0x003A,0x0b}, // LCD Vertical Non-Display Period Register - {0x003B,0x07}, // TFT FPFRAME Start Position Register - {0x003C,0x02}, // TFT FPFRAME Pulse Width Register - - {0x0041,0x00}, // LCD Miscellaneous Register -#if (SWIVEL_VIEW == 0) - {0x0042,0x00}, // LCD Display Start Address Register 0 - {0x0043,0x00}, // LCD Display Start Address Register 1 - {0x0044,0x00}, // LCD Display Start Address Register 2 - -#elif (SWIVEL_VIEW == 1) - // 1024 - W(320) = 0x2C0 - {0x0042,0xC0}, // LCD Display Start Address Register 0 - {0x0043,0x02}, // LCD Display Start Address Register 1 - {0x0044,0x00}, // LCD Display Start Address Register 2 - // 1024 - {0x0046,0x00}, // LCD Memory Address Offset Register 0 - {0x0047,0x02}, // LCD Memory Address Offset Register 1 -#else -#error unsupported SWIVEL_VIEW mode -#endif -#else -#error no platform configuration -#endif /* CONFIG_PLAT_XXX */ - - {0x0048,0x00}, // LCD Pixel Panning Register - {0x004A,0x00}, // LCD Display FIFO High Threshold Control Register - {0x004B,0x00}, // LCD Display FIFO Low Threshold Control Register - {0x0050,0x4F}, // CRT/TV Horizontal Display Width Register - {0x0052,0x13}, // CRT/TV Horizontal Non-Display Period Register - {0x0053,0x01}, // CRT/TV HRTC Start Position Register - {0x0054,0x0B}, // CRT/TV HRTC Pulse Width Register - {0x0056,0xDF}, // CRT/TV Vertical Display Height Register 0 - {0x0057,0x01}, // CRT/TV Vertical Display Height Register 1 - {0x0058,0x2B}, // CRT/TV Vertical Non-Display Period Register - {0x0059,0x09}, // CRT/TV VRTC Start Position Register - {0x005A,0x01}, // CRT/TV VRTC Pulse Width Register - {0x005B,0x10}, // TV Output Control Register - - {0x0062,0x00}, // CRT/TV Display Start Address Register 0 - {0x0063,0x00}, // CRT/TV Display Start Address Register 1 - {0x0064,0x00}, // CRT/TV Display Start Address Register 2 - - {0x0068,0x00}, // CRT/TV Pixel Panning Register - {0x006A,0x00}, // CRT/TV Display FIFO High Threshold Control Register - {0x006B,0x00}, // CRT/TV Display FIFO Low Threshold Control Register - {0x0070,0x00}, // LCD Ink/Cursor Control Register - {0x0071,0x01}, // LCD Ink/Cursor Start Address Register - {0x0072,0x00}, // LCD Cursor X Position Register 0 - {0x0073,0x00}, // LCD Cursor X Position Register 1 - {0x0074,0x00}, // LCD Cursor Y Position Register 0 - {0x0075,0x00}, // LCD Cursor Y Position Register 1 - {0x0076,0x00}, // LCD Ink/Cursor Blue Color 0 Register - {0x0077,0x00}, // LCD Ink/Cursor Green Color 0 Register - {0x0078,0x00}, // LCD Ink/Cursor Red Color 0 Register - {0x007A,0x1F}, // LCD Ink/Cursor Blue Color 1 Register - {0x007B,0x3F}, // LCD Ink/Cursor Green Color 1 Register - {0x007C,0x1F}, // LCD Ink/Cursor Red Color 1 Register - {0x007E,0x00}, // LCD Ink/Cursor FIFO Threshold Register - {0x0080,0x00}, // CRT/TV Ink/Cursor Control Register - {0x0081,0x01}, // CRT/TV Ink/Cursor Start Address Register - {0x0082,0x00}, // CRT/TV Cursor X Position Register 0 - {0x0083,0x00}, // CRT/TV Cursor X Position Register 1 - {0x0084,0x00}, // CRT/TV Cursor Y Position Register 0 - {0x0085,0x00}, // CRT/TV Cursor Y Position Register 1 - {0x0086,0x00}, // CRT/TV Ink/Cursor Blue Color 0 Register - {0x0087,0x00}, // CRT/TV Ink/Cursor Green Color 0 Register - {0x0088,0x00}, // CRT/TV Ink/Cursor Red Color 0 Register - {0x008A,0x1F}, // CRT/TV Ink/Cursor Blue Color 1 Register - {0x008B,0x3F}, // CRT/TV Ink/Cursor Green Color 1 Register - {0x008C,0x1F}, // CRT/TV Ink/Cursor Red Color 1 Register - {0x008E,0x00}, // CRT/TV Ink/Cursor FIFO Threshold Register - {0x0100,0x00}, // BitBlt Control Register 0 - {0x0101,0x00}, // BitBlt Control Register 1 - {0x0102,0x00}, // BitBlt ROP Code/Color Expansion Register - {0x0103,0x00}, // BitBlt Operation Register - {0x0104,0x00}, // BitBlt Source Start Address Register 0 - {0x0105,0x00}, // BitBlt Source Start Address Register 1 - {0x0106,0x00}, // BitBlt Source Start Address Register 2 - {0x0108,0x00}, // BitBlt Destination Start Address Register 0 - {0x0109,0x00}, // BitBlt Destination Start Address Register 1 - {0x010A,0x00}, // BitBlt Destination Start Address Register 2 - {0x010C,0x00}, // BitBlt Memory Address Offset Register 0 - {0x010D,0x00}, // BitBlt Memory Address Offset Register 1 - {0x0110,0x00}, // BitBlt Width Register 0 - {0x0111,0x00}, // BitBlt Width Register 1 - {0x0112,0x00}, // BitBlt Height Register 0 - {0x0113,0x00}, // BitBlt Height Register 1 - {0x0114,0x00}, // BitBlt Background Color Register 0 - {0x0115,0x00}, // BitBlt Background Color Register 1 - {0x0118,0x00}, // BitBlt Foreground Color Register 0 - {0x0119,0x00}, // BitBlt Foreground Color Register 1 - {0x01E0,0x00}, // Look-Up Table Mode Register - {0x01E2,0x00}, // Look-Up Table Address Register - {0x01F0,0x10}, // Power Save Configuration Register - {0x01F1,0x00}, // Power Save Status Register - {0x01F4,0x00}, // CPU-to-Memory Access Watchdog Timer Register -#if (SWIVEL_VIEW == 0) - {0x01FC,0x01}, // Display Mode Register(0x01:LCD, 0x02:CRT, 0x03:LCD&CRT) -#elif (SWIVEL_VIEW == 1) - {0x01FC,0x41}, // Display Mode Register(0x01:LCD, 0x02:CRT, 0x03:LCD&CRT) -#else -#error unsupported SWIVEL_VIEW mode -#endif /* SWIVEL_VIEW */ - -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT) || defined(CONFIG_PLAT_MAPPI3) - {0x0008,0x07}, // LCD panel Vdd & Vg on -#endif - - {0x0040,0x05}, // LCD Display Mode Register (2:4bpp,3:8bpp,5:16bpp) -#if defined(CONFIG_PLAT_MAPPI) - {0x0046,0x80}, // LCD Memory Address Offset Register 0 - {0x0047,0x02}, // LCD Memory Address Offset Register 1 -#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT) || defined(CONFIG_PLAT_MAPPI3) - {0x0046,0xf0}, // LCD Memory Address Offset Register 0 - {0x0047,0x00}, // LCD Memory Address Offset Register 1 -#endif - {0x0060,0x05}, // CRT/TV Display Mode Register (2:4bpp,3:8bpp,5:16bpp) - {0x0066,0x80}, // CRT/TV Memory Address Offset Register 0 // takeo - {0x0067,0x02}, // CRT/TV Memory Address Offset Register 1 -}; diff --git a/arch/m32r/include/asm/segment.h b/arch/m32r/include/asm/segment.h deleted file mode 100644 index 4095f14728e5..000000000000 --- a/arch/m32r/include/asm/segment.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SEGMENT_H -#define _ASM_M32R_SEGMENT_H - -#define __KERNEL_CS 0x10 -#define __KERNEL_DS 0x18 - -#define __USER_CS 0x23 -#define __USER_DS 0x2B - -#endif /* _ASM_M32R_SEGMENT_H */ diff --git a/arch/m32r/include/asm/serial.h b/arch/m32r/include/asm/serial.h deleted file mode 100644 index b1375c841b4d..000000000000 --- a/arch/m32r/include/asm/serial.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SERIAL_H -#define _ASM_M32R_SERIAL_H - -/* include/asm-m32r/serial.h */ - - -#define BASE_BAUD 115200 - -#endif /* _ASM_M32R_SERIAL_H */ diff --git a/arch/m32r/include/asm/setup.h b/arch/m32r/include/asm/setup.h deleted file mode 100644 index 71b4d6514078..000000000000 --- a/arch/m32r/include/asm/setup.h +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SETUP_H -#define _ASM_M32R_SETUP_H - -#include - - -#define PARAM ((unsigned char *)empty_zero_page) - -#define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000)) -#define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004)) -#define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008)) -#define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c)) -#define INITRD_START (*(unsigned long *) (PARAM+0x010)) -#define INITRD_SIZE (*(unsigned long *) (PARAM+0x014)) - -#define M32R_CPUCLK (*(unsigned long *) (PARAM+0x018)) -#define M32R_BUSCLK (*(unsigned long *) (PARAM+0x01c)) -#define M32R_TIMER_DIVIDE (*(unsigned long *) (PARAM+0x020)) - -#define COMMAND_LINE ((char *) (PARAM+0x100)) - -#define SCREEN_INFO (*(struct screen_info *) (PARAM+0x200)) - -#define RAMDISK_IMAGE_START_MASK (0x07FF) -#define RAMDISK_PROMPT_FLAG (0x8000) -#define RAMDISK_LOAD_FLAG (0x4000) - -extern unsigned long memory_start; -extern unsigned long memory_end; - -#endif /* _ASM_M32R_SETUP_H */ diff --git a/arch/m32r/include/asm/shmparam.h b/arch/m32r/include/asm/shmparam.h deleted file mode 100644 index 1af73d92c96d..000000000000 --- a/arch/m32r/include/asm/shmparam.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SHMPARAM_H -#define _ASM_M32R_SHMPARAM_H - -#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ - -#endif /* _ASM_M32R_SHMPARAM_H */ diff --git a/arch/m32r/include/asm/signal.h b/arch/m32r/include/asm/signal.h deleted file mode 100644 index 8bf57950d21e..000000000000 --- a/arch/m32r/include/asm/signal.h +++ /dev/null @@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SIGNAL_H -#define _ASM_M32R_SIGNAL_H - -#include - -/* Most things should be clean enough to redefine this at will, if care - is taken to make libc match. */ - -#define _NSIG 64 -#define _NSIG_BPW 32 -#define _NSIG_WORDS (_NSIG / _NSIG_BPW) - -typedef unsigned long old_sigset_t; /* at least 32 bits */ - -typedef struct { - unsigned long sig[_NSIG_WORDS]; -} sigset_t; - -#define __ARCH_HAS_SA_RESTORER -#include - -#undef __HAVE_ARCH_SIG_BITOPS - -#endif /* _ASM_M32R_SIGNAL_H */ diff --git a/arch/m32r/include/asm/smp.h b/arch/m32r/include/asm/smp.h deleted file mode 100644 index 763f22700ce6..000000000000 --- a/arch/m32r/include/asm/smp.h +++ /dev/null @@ -1,113 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SMP_H -#define _ASM_M32R_SMP_H - -#ifdef CONFIG_SMP -#ifndef __ASSEMBLY__ - -#include -#include -#include -#include - -#define PHYSID_ARRAY_SIZE 1 - -struct physid_mask -{ - unsigned long mask[PHYSID_ARRAY_SIZE]; -}; - -typedef struct physid_mask physid_mask_t; - -#define physid_set(physid, map) set_bit(physid, (map).mask) -#define physid_clear(physid, map) clear_bit(physid, (map).mask) -#define physid_isset(physid, map) test_bit(physid, (map).mask) -#define physid_test_and_set(physid, map) test_and_set_bit(physid, (map).mask) - -#define physids_and(dst, src1, src2) bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS) -#define physids_or(dst, src1, src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS) -#define physids_clear(map) bitmap_zero((map).mask, MAX_APICS) -#define physids_complement(dst, src) bitmap_complement((dst).mask,(src).mask, MAX_APICS) -#define physids_empty(map) bitmap_empty((map).mask, MAX_APICS) -#define physids_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, MAX_APICS) -#define physids_weight(map) bitmap_weight((map).mask, MAX_APICS) -#define physids_shift_right(d, s, n) bitmap_shift_right((d).mask, (s).mask, n, MAX_APICS) -#define physids_shift_left(d, s, n) bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS) -#define physids_coerce(map) ((map).mask[0]) - -#define physids_promote(physids) \ - ({ \ - physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ - __physid_mask.mask[0] = physids; \ - __physid_mask; \ - }) - -#define physid_mask_of_physid(physid) \ - ({ \ - physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ - physid_set(physid, __physid_mask); \ - __physid_mask; \ - }) - -#define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} } -#define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} } - -extern physid_mask_t phys_cpu_present_map; - -/* - * Some lowlevel functions might want to know about - * the real CPU ID <-> CPU # mapping. - */ -extern volatile int cpu_2_physid[NR_CPUS]; -#define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id] - -#define raw_smp_processor_id() (current_thread_info()->cpu) - -extern cpumask_t cpu_callout_map; - -static __inline__ int hard_smp_processor_id(void) -{ - return (int)*(volatile long *)M32R_CPUID_PORTL; -} - -static __inline__ int cpu_logical_map(int cpu) -{ - return cpu; -} - -static __inline__ int cpu_number_map(int cpu) -{ - return cpu; -} - -extern void smp_send_timer(void); -extern unsigned long send_IPI_mask_phys(const cpumask_t*, int, int); - -extern void arch_send_call_function_single_ipi(int cpu); -extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); - -#endif /* not __ASSEMBLY__ */ - -#define NO_PROC_ID (0xff) /* No processor magic marker */ - -/* - * M32R-mp IPI - */ -#define RESCHEDULE_IPI (M32R_IRQ_IPI0-M32R_IRQ_IPI0) -#define INVALIDATE_TLB_IPI (M32R_IRQ_IPI1-M32R_IRQ_IPI0) -#define CALL_FUNCTION_IPI (M32R_IRQ_IPI2-M32R_IRQ_IPI0) -#define LOCAL_TIMER_IPI (M32R_IRQ_IPI3-M32R_IRQ_IPI0) -#define INVALIDATE_CACHE_IPI (M32R_IRQ_IPI4-M32R_IRQ_IPI0) -#define CPU_BOOT_IPI (M32R_IRQ_IPI5-M32R_IRQ_IPI0) -#define CALL_FUNC_SINGLE_IPI (M32R_IRQ_IPI6-M32R_IRQ_IPI0) - -#define IPI_SHIFT (0) -#define NR_IPIS (8) - -#else /* CONFIG_SMP */ - -#define hard_smp_processor_id() 0 - -#endif /* CONFIG_SMP */ - -#endif /* _ASM_M32R_SMP_H */ diff --git a/arch/m32r/include/asm/spinlock.h b/arch/m32r/include/asm/spinlock.h deleted file mode 100644 index 0189f410f8f5..000000000000 --- a/arch/m32r/include/asm/spinlock.h +++ /dev/null @@ -1,308 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SPINLOCK_H -#define _ASM_M32R_SPINLOCK_H - -/* - * linux/include/asm-m32r/spinlock.h - * - * M32R version: - * Copyright (C) 2001, 2002 Hitoshi Yamamoto - * Copyright (C) 2004 Hirokazu Takata - */ - -#include -#include -#include -#include -#include -#include - -/* - * Your basic SMP spinlocks, allowing only a single CPU anywhere - * - * (the type definitions are in asm/spinlock_types.h) - * - * Simple spin lock operations. There are two variants, one clears IRQ's - * on the local processor, one does not. - * - * We make no fairness assumptions. They have a cost. - */ - -#define arch_spin_is_locked(x) (*(volatile int *)(&(x)->slock) <= 0) - -/** - * arch_spin_trylock - Try spin lock and return a result - * @lock: Pointer to the lock variable - * - * arch_spin_trylock() tries to get the lock and returns a result. - * On the m32r, the result value is 1 (= Success) or 0 (= Failure). - */ -static inline int arch_spin_trylock(arch_spinlock_t *lock) -{ - int oldval; - unsigned long tmp1, tmp2; - - /* - * lock->slock : =1 : unlock - * : <=0 : lock - * { - * oldval = lock->slock; <--+ need atomic operation - * lock->slock = 0; <--+ - * } - */ - __asm__ __volatile__ ( - "# arch_spin_trylock \n\t" - "ldi %1, #0; \n\t" - "mvfc %2, psw; \n\t" - "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r6", "%3") - "lock %0, @%3; \n\t" - "unlock %1, @%3; \n\t" - "mvtc %2, psw; \n\t" - : "=&r" (oldval), "=&r" (tmp1), "=&r" (tmp2) - : "r" (&lock->slock) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r6" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - - return (oldval > 0); -} - -static inline void arch_spin_lock(arch_spinlock_t *lock) -{ - unsigned long tmp0, tmp1; - - /* - * lock->slock : =1 : unlock - * : <=0 : lock - * - * for ( ; ; ) { - * lock->slock -= 1; <-- need atomic operation - * if (lock->slock == 0) break; - * for ( ; lock->slock <= 0 ; ); - * } - */ - __asm__ __volatile__ ( - "# arch_spin_lock \n\t" - ".fillinsn \n" - "1: \n\t" - "mvfc %1, psw; \n\t" - "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r6", "%2") - "lock %0, @%2; \n\t" - "addi %0, #-1; \n\t" - "unlock %0, @%2; \n\t" - "mvtc %1, psw; \n\t" - "bltz %0, 2f; \n\t" - LOCK_SECTION_START(".balign 4 \n\t") - ".fillinsn \n" - "2: \n\t" - "ld %0, @%2; \n\t" - "bgtz %0, 1b; \n\t" - "bra 2b; \n\t" - LOCK_SECTION_END - : "=&r" (tmp0), "=&r" (tmp1) - : "r" (&lock->slock) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r6" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); -} - -static inline void arch_spin_unlock(arch_spinlock_t *lock) -{ - mb(); - lock->slock = 1; -} - -/* - * Read-write spinlocks, allowing multiple readers - * but only one writer. - * - * NOTE! it is quite common to have readers in interrupts - * but no interrupt writers. For those circumstances we - * can "mix" irq-safe locks - any writer needs to get a - * irq-safe write-lock, but readers can get non-irqsafe - * read-locks. - * - * On x86, we implement read-write locks as a 32-bit counter - * with the high bit (sign) being the "contended" bit. - * - * The inline assembly is non-obvious. Think about it. - * - * Changed to use the same technique as rw semaphores. See - * semaphore.h for details. -ben - */ - -static inline void arch_read_lock(arch_rwlock_t *rw) -{ - unsigned long tmp0, tmp1; - - /* - * rw->lock : >0 : unlock - * : <=0 : lock - * - * for ( ; ; ) { - * rw->lock -= 1; <-- need atomic operation - * if (rw->lock >= 0) break; - * rw->lock += 1; <-- need atomic operation - * for ( ; rw->lock <= 0 ; ); - * } - */ - __asm__ __volatile__ ( - "# read_lock \n\t" - ".fillinsn \n" - "1: \n\t" - "mvfc %1, psw; \n\t" - "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r6", "%2") - "lock %0, @%2; \n\t" - "addi %0, #-1; \n\t" - "unlock %0, @%2; \n\t" - "mvtc %1, psw; \n\t" - "bltz %0, 2f; \n\t" - LOCK_SECTION_START(".balign 4 \n\t") - ".fillinsn \n" - "2: \n\t" - "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r6", "%2") - "lock %0, @%2; \n\t" - "addi %0, #1; \n\t" - "unlock %0, @%2; \n\t" - "mvtc %1, psw; \n\t" - ".fillinsn \n" - "3: \n\t" - "ld %0, @%2; \n\t" - "bgtz %0, 1b; \n\t" - "bra 3b; \n\t" - LOCK_SECTION_END - : "=&r" (tmp0), "=&r" (tmp1) - : "r" (&rw->lock) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r6" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); -} - -static inline void arch_write_lock(arch_rwlock_t *rw) -{ - unsigned long tmp0, tmp1, tmp2; - - /* - * rw->lock : =RW_LOCK_BIAS_STR : unlock - * : !=RW_LOCK_BIAS_STR : lock - * - * for ( ; ; ) { - * rw->lock -= RW_LOCK_BIAS_STR; <-- need atomic operation - * if (rw->lock == 0) break; - * rw->lock += RW_LOCK_BIAS_STR; <-- need atomic operation - * for ( ; rw->lock != RW_LOCK_BIAS_STR ; ) ; - * } - */ - __asm__ __volatile__ ( - "# write_lock \n\t" - "seth %1, #high(" RW_LOCK_BIAS_STR "); \n\t" - "or3 %1, %1, #low(" RW_LOCK_BIAS_STR "); \n\t" - ".fillinsn \n" - "1: \n\t" - "mvfc %2, psw; \n\t" - "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r7", "%3") - "lock %0, @%3; \n\t" - "sub %0, %1; \n\t" - "unlock %0, @%3; \n\t" - "mvtc %2, psw; \n\t" - "bnez %0, 2f; \n\t" - LOCK_SECTION_START(".balign 4 \n\t") - ".fillinsn \n" - "2: \n\t" - "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r7", "%3") - "lock %0, @%3; \n\t" - "add %0, %1; \n\t" - "unlock %0, @%3; \n\t" - "mvtc %2, psw; \n\t" - ".fillinsn \n" - "3: \n\t" - "ld %0, @%3; \n\t" - "beq %0, %1, 1b; \n\t" - "bra 3b; \n\t" - LOCK_SECTION_END - : "=&r" (tmp0), "=&r" (tmp1), "=&r" (tmp2) - : "r" (&rw->lock) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r7" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); -} - -static inline void arch_read_unlock(arch_rwlock_t *rw) -{ - unsigned long tmp0, tmp1; - - __asm__ __volatile__ ( - "# read_unlock \n\t" - "mvfc %1, psw; \n\t" - "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r6", "%2") - "lock %0, @%2; \n\t" - "addi %0, #1; \n\t" - "unlock %0, @%2; \n\t" - "mvtc %1, psw; \n\t" - : "=&r" (tmp0), "=&r" (tmp1) - : "r" (&rw->lock) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r6" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); -} - -static inline void arch_write_unlock(arch_rwlock_t *rw) -{ - unsigned long tmp0, tmp1, tmp2; - - __asm__ __volatile__ ( - "# write_unlock \n\t" - "seth %1, #high(" RW_LOCK_BIAS_STR "); \n\t" - "or3 %1, %1, #low(" RW_LOCK_BIAS_STR "); \n\t" - "mvfc %2, psw; \n\t" - "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r7", "%3") - "lock %0, @%3; \n\t" - "add %0, %1; \n\t" - "unlock %0, @%3; \n\t" - "mvtc %2, psw; \n\t" - : "=&r" (tmp0), "=&r" (tmp1), "=&r" (tmp2) - : "r" (&rw->lock) - : "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r7" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); -} - -static inline int arch_read_trylock(arch_rwlock_t *lock) -{ - atomic_t *count = (atomic_t*)lock; - if (atomic_dec_return(count) >= 0) - return 1; - atomic_inc(count); - return 0; -} - -static inline int arch_write_trylock(arch_rwlock_t *lock) -{ - atomic_t *count = (atomic_t *)lock; - if (atomic_sub_and_test(RW_LOCK_BIAS, count)) - return 1; - atomic_add(RW_LOCK_BIAS, count); - return 0; -} - -#endif /* _ASM_M32R_SPINLOCK_H */ diff --git a/arch/m32r/include/asm/spinlock_types.h b/arch/m32r/include/asm/spinlock_types.h deleted file mode 100644 index bb0d17b64198..000000000000 --- a/arch/m32r/include/asm/spinlock_types.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SPINLOCK_TYPES_H -#define _ASM_M32R_SPINLOCK_TYPES_H - -#ifndef __LINUX_SPINLOCK_TYPES_H -# error "please don't include this file directly" -#endif - -typedef struct { - volatile int slock; -} arch_spinlock_t; - -#define __ARCH_SPIN_LOCK_UNLOCKED { 1 } - -typedef struct { - volatile int lock; -} arch_rwlock_t; - -#define RW_LOCK_BIAS 0x01000000 -#define RW_LOCK_BIAS_STR "0x01000000" - -#define __ARCH_RW_LOCK_UNLOCKED { RW_LOCK_BIAS } - -#endif /* _ASM_M32R_SPINLOCK_TYPES_H */ diff --git a/arch/m32r/include/asm/string.h b/arch/m32r/include/asm/string.h deleted file mode 100644 index a9ea3b6c3e5a..000000000000 --- a/arch/m32r/include/asm/string.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_STRING_H -#define _ASM_M32R_STRING_H - -#define __HAVE_ARCH_STRLEN -extern size_t strlen(const char * s); - -#define __HAVE_ARCH_MEMCPY -extern void *memcpy(void *__to, __const__ void *__from, size_t __n); - -#define __HAVE_ARCH_MEMSET -extern void *memset(void *__s, int __c, size_t __count); - -#endif /* _ASM_M32R_STRING_H */ diff --git a/arch/m32r/include/asm/switch_to.h b/arch/m32r/include/asm/switch_to.h deleted file mode 100644 index 4b262f7a8fe9..000000000000 --- a/arch/m32r/include/asm/switch_to.h +++ /dev/null @@ -1,51 +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. - * - * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto - * Copyright (C) 2004, 2006 Hirokazu Takata - */ -#ifndef _ASM_M32R_SWITCH_TO_H -#define _ASM_M32R_SWITCH_TO_H - -/* - * switch_to(prev, next) should switch from task `prev' to `next' - * `prev' will never be the same as `next'. - * - * `next' and `prev' should be struct task_struct, but it isn't always defined - */ - -#if defined(CONFIG_FRAME_POINTER) || \ - !defined(CONFIG_SCHED_OMIT_FRAME_POINTER) -#define M32R_PUSH_FP " push fp\n" -#define M32R_POP_FP " pop fp\n" -#else -#define M32R_PUSH_FP "" -#define M32R_POP_FP "" -#endif - -#define switch_to(prev, next, last) do { \ - __asm__ __volatile__ ( \ - " seth lr, #high(1f) \n" \ - " or3 lr, lr, #low(1f) \n" \ - " st lr, @%4 ; store old LR \n" \ - " ld lr, @%5 ; load new LR \n" \ - M32R_PUSH_FP \ - " st sp, @%2 ; store old SP \n" \ - " ld sp, @%3 ; load new SP \n" \ - " push %1 ; store `prev' on new stack \n" \ - " jmp lr \n" \ - " .fillinsn \n" \ - "1: \n" \ - " pop %0 ; restore `__last' from new stack \n" \ - M32R_POP_FP \ - : "=r" (last) \ - : "0" (prev), \ - "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \ - "r" (&(prev->thread.lr)), "r" (&(next->thread.lr)) \ - : "memory", "lr" \ - ); \ -} while(0) - -#endif /* _ASM_M32R_SWITCH_TO_H */ diff --git a/arch/m32r/include/asm/syscall.h b/arch/m32r/include/asm/syscall.h deleted file mode 100644 index 22c8516d3c18..000000000000 --- a/arch/m32r/include/asm/syscall.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_SYSCALL_H -#define _ASM_M32R_SYSCALL_H - -/* Definitions for the system call vector. */ -#define SYSCALL_VECTOR "2" -#define SYSCALL_VECTOR_ADDRESS "0xa0" - -#endif /* _ASM_M32R_SYSCALL_H */ diff --git a/arch/m32r/include/asm/termios.h b/arch/m32r/include/asm/termios.h deleted file mode 100644 index 40274b89cea5..000000000000 --- a/arch/m32r/include/asm/termios.h +++ /dev/null @@ -1,52 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _M32R_TERMIOS_H -#define _M32R_TERMIOS_H - -#include -#include - -/* intr=^C quit=^\ erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -/* - * Translate a "termio" structure into a "termios". Ugh. - */ -#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ - unsigned short __tmp; \ - get_user(__tmp,&(termio)->x); \ - *(unsigned short *) &(termios)->x = __tmp; \ -} - -#define user_termio_to_kernel_termios(termios, termio) \ -({ \ - SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ - copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -}) - -/* - * Translate a "termios" structure into a "termio". Ugh. - */ -#define kernel_termios_to_user_termio(termio, termios) \ -({ \ - put_user((termios)->c_iflag, &(termio)->c_iflag); \ - put_user((termios)->c_oflag, &(termio)->c_oflag); \ - put_user((termios)->c_cflag, &(termio)->c_cflag); \ - put_user((termios)->c_lflag, &(termio)->c_lflag); \ - put_user((termios)->c_line, &(termio)->c_line); \ - copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -}) - -#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) -#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) -#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) -#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) - -#endif /* _M32R_TERMIOS_H */ diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h deleted file mode 100644 index ba00f1032587..000000000000 --- a/arch/m32r/include/asm/thread_info.h +++ /dev/null @@ -1,126 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_THREAD_INFO_H -#define _ASM_M32R_THREAD_INFO_H - -/* thread_info.h: m32r low-level thread information - * - * Copyright (C) 2002 David Howells (dhowells@redhat.com) - * - Incorporating suggestions made by Linus Torvalds and Dave Miller - * Copyright (C) 2004 Hirokazu Takata - */ - -#ifdef __KERNEL__ - -#ifndef __ASSEMBLY__ -#include -#endif - -/* - * low level task data that entry.S needs immediate access to - * - this struct should fit entirely inside of one cache line - * - this struct shares the supervisor stack pages - * - if the contents of this structure are changed, the assembly constants must also be changed - */ -#ifndef __ASSEMBLY__ - -struct thread_info { - struct task_struct *task; /* main task structure */ - unsigned long flags; /* low level flags */ - unsigned long status; /* thread-synchronous flags */ - __u32 cpu; /* current CPU */ - int preempt_count; /* 0 => preemptable, <0 => BUG */ - - mm_segment_t addr_limit; /* thread address space: - 0-0xBFFFFFFF for user-thread - 0-0xFFFFFFFF for kernel-thread - */ - - __u8 supervisor_stack[0]; -}; - -#endif /* !__ASSEMBLY__ */ - -#define THREAD_SIZE (PAGE_SIZE << 1) -#define THREAD_SIZE_ORDER 1 -/* - * macros/functions for gaining access to the thread information structure - */ -#ifndef __ASSEMBLY__ - -#define INIT_THREAD_INFO(tsk) \ -{ \ - .task = &tsk, \ - .flags = 0, \ - .cpu = 0, \ - .preempt_count = INIT_PREEMPT_COUNT, \ - .addr_limit = KERNEL_DS, \ -} - -/* how to get the thread information struct from C */ -static inline struct thread_info *current_thread_info(void) -{ - struct thread_info *ti; - - __asm__ __volatile__ ( - "ldi %0, #%1 \n\t" - "and %0, sp \n\t" - : "=r" (ti) : "i" (~(THREAD_SIZE - 1)) - ); - - return ti; -} - -#define TI_FLAG_FAULT_CODE_SHIFT 28 - -static inline void set_thread_fault_code(unsigned int val) -{ - struct thread_info *ti = current_thread_info(); - ti->flags = (ti->flags & (~0 >> (32 - TI_FLAG_FAULT_CODE_SHIFT))) - | (val << TI_FLAG_FAULT_CODE_SHIFT); -} - -static inline unsigned int get_thread_fault_code(void) -{ - struct thread_info *ti = current_thread_info(); - return ti->flags >> TI_FLAG_FAULT_CODE_SHIFT; -} - -#endif - -/* - * thread information flags - * - these are process state flags that various assembly files may need to access - * - pending work-to-be-done flags are in LSW - * - other flags in MSW - */ -#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ -#define TIF_SIGPENDING 1 /* signal pending */ -#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ -#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */ -#define TIF_NOTIFY_RESUME 5 /* callback before returning to user */ -#define TIF_RESTORE_SIGMASK 8 /* restore signal mask in do_signal() */ -#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ -#define TIF_MEMDIE 18 /* is terminating due to OOM killer */ - -#define _TIF_SYSCALL_TRACE (1<mm) - -#include - -#endif /* _M32R_TLB_H */ diff --git a/arch/m32r/include/asm/tlbflush.h b/arch/m32r/include/asm/tlbflush.h deleted file mode 100644 index f6c7237316d0..000000000000 --- a/arch/m32r/include/asm/tlbflush.h +++ /dev/null @@ -1,98 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_TLBFLUSH_H -#define _ASM_M32R_TLBFLUSH_H - -#include - -/* - * TLB flushing: - * - * - flush_tlb() flushes the current mm struct TLBs - * - flush_tlb_all() flushes all processes TLBs - * - flush_tlb_mm(mm) flushes the specified mm context TLB's - * - flush_tlb_page(vma, vmaddr) flushes one page - * - flush_tlb_range(vma, start, end) flushes a range of pages - * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages - */ - -extern void local_flush_tlb_all(void); -extern void local_flush_tlb_mm(struct mm_struct *); -extern void local_flush_tlb_page(struct vm_area_struct *, unsigned long); -extern void local_flush_tlb_range(struct vm_area_struct *, unsigned long, - unsigned long); - -#ifndef CONFIG_SMP -#ifdef CONFIG_MMU -#define flush_tlb_all() local_flush_tlb_all() -#define flush_tlb_mm(mm) local_flush_tlb_mm(mm) -#define flush_tlb_page(vma, page) local_flush_tlb_page(vma, page) -#define flush_tlb_range(vma, start, end) \ - local_flush_tlb_range(vma, start, end) -#define flush_tlb_kernel_range(start, end) local_flush_tlb_all() -#else /* CONFIG_MMU */ -#define flush_tlb_all() do { } while (0) -#define flush_tlb_mm(mm) do { } while (0) -#define flush_tlb_page(vma, vmaddr) do { } while (0) -#define flush_tlb_range(vma, start, end) do { } while (0) -#endif /* CONFIG_MMU */ -#else /* CONFIG_SMP */ -extern void smp_flush_tlb_all(void); -extern void smp_flush_tlb_mm(struct mm_struct *); -extern void smp_flush_tlb_page(struct vm_area_struct *, unsigned long); -extern void smp_flush_tlb_range(struct vm_area_struct *, unsigned long, - unsigned long); - -#define flush_tlb_all() smp_flush_tlb_all() -#define flush_tlb_mm(mm) smp_flush_tlb_mm(mm) -#define flush_tlb_page(vma, page) smp_flush_tlb_page(vma, page) -#define flush_tlb_range(vma, start, end) \ - smp_flush_tlb_range(vma, start, end) -#define flush_tlb_kernel_range(start, end) smp_flush_tlb_all() -#endif /* CONFIG_SMP */ - -static __inline__ void __flush_tlb_page(unsigned long page) -{ - unsigned int tmpreg0, tmpreg1, tmpreg2; - - __asm__ __volatile__ ( - "seth %0, #high(%4) \n\t" - "st %3, @(%5, %0) \n\t" - "ldi %1, #1 \n\t" - "st %1, @(%6, %0) \n\t" - "add3 %1, %0, %7 \n\t" - ".fillinsn \n" - "1: \n\t" - "ld %2, @(%6, %0) \n\t" - "bnez %2, 1b \n\t" - "ld %0, @%1+ \n\t" - "ld %1, @%1 \n\t" - "st %2, @+%0 \n\t" - "st %2, @+%1 \n\t" - : "=&r" (tmpreg0), "=&r" (tmpreg1), "=&r" (tmpreg2) - : "r" (page), "i" (MMU_REG_BASE), "i" (MSVA_offset), - "i" (MTOP_offset), "i" (MIDXI_offset) - : "memory" - ); -} - -static __inline__ void __flush_tlb_all(void) -{ - unsigned int tmpreg0, tmpreg1; - - __asm__ __volatile__ ( - "seth %0, #high(%2) \n\t" - "or3 %0, %0, #low(%2) \n\t" - "ldi %1, #0xc \n\t" - "st %1, @%0 \n\t" - ".fillinsn \n" - "1: \n\t" - "ld %1, @%0 \n\t" - "bnez %1, 1b \n\t" - : "=&r" (tmpreg0), "=&r" (tmpreg1) - : "i" (MTOP) : "memory" - ); -} - -extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *); - -#endif /* _ASM_M32R_TLBFLUSH_H */ diff --git a/arch/m32r/include/asm/topology.h b/arch/m32r/include/asm/topology.h deleted file mode 100644 index ee79404e8878..000000000000 --- a/arch/m32r/include/asm/topology.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_TOPOLOGY_H -#define _ASM_M32R_TOPOLOGY_H - -#include - -#endif /* _ASM_M32R_TOPOLOGY_H */ diff --git a/arch/m32r/include/asm/types.h b/arch/m32r/include/asm/types.h deleted file mode 100644 index fce0bf60536c..000000000000 --- a/arch/m32r/include/asm/types.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_TYPES_H -#define _ASM_M32R_TYPES_H - -#include - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ - -#define BITS_PER_LONG 32 - -#endif /* _ASM_M32R_TYPES_H */ diff --git a/arch/m32r/include/asm/uaccess.h b/arch/m32r/include/asm/uaccess.h deleted file mode 100644 index 9d89bc3d8181..000000000000 --- a/arch/m32r/include/asm/uaccess.h +++ /dev/null @@ -1,515 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_UACCESS_H -#define _ASM_M32R_UACCESS_H - -/* - * linux/include/asm-m32r/uaccess.h - * - * M32R version. - * Copyright (C) 2004, 2006 Hirokazu Takata - */ - -/* - * User space memory access functions - */ -#include -#include -#include - -/* - * The fs value determines whether argument validity checking should be - * performed or not. If get_fs() == USER_DS, checking is performed, with - * get_fs() == KERNEL_DS, checking is bypassed. - * - * For historical reasons, these macros are grossly misnamed. - */ - -#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) - -#ifdef CONFIG_MMU - -#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) -#define USER_DS MAKE_MM_SEG(PAGE_OFFSET) -#define get_ds() (KERNEL_DS) -#define get_fs() (current_thread_info()->addr_limit) -#define set_fs(x) (current_thread_info()->addr_limit = (x)) - -#else /* not CONFIG_MMU */ - -#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) -#define USER_DS MAKE_MM_SEG(0xFFFFFFFF) -#define get_ds() (KERNEL_DS) - -static inline mm_segment_t get_fs(void) -{ - return USER_DS; -} - -static inline void set_fs(mm_segment_t s) -{ -} - -#endif /* not CONFIG_MMU */ - -#define segment_eq(a, b) ((a).seg == (b).seg) - -#define __addr_ok(addr) \ - ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg)) - -/* - * Test whether a block of memory is a valid user space address. - * Returns 0 if the range is valid, nonzero otherwise. - * - * This is equivalent to the following test: - * (u33)addr + (u33)size >= (u33)current->addr_limit.seg - * - * This needs 33-bit arithmetic. We have a carry... - */ -#define __range_ok(addr, size) ({ \ - unsigned long flag, roksum; \ - __chk_user_ptr(addr); \ - asm ( \ - " cmpu %1, %1 ; clear cbit\n" \ - " addx %1, %3 ; set cbit if overflow\n" \ - " subx %0, %0\n" \ - " cmpu %4, %1\n" \ - " subx %0, %5\n" \ - : "=&r" (flag), "=r" (roksum) \ - : "1" (addr), "r" ((int)(size)), \ - "r" (current_thread_info()->addr_limit.seg), "r" (0) \ - : "cbit" ); \ - flag; }) - -/** - * access_ok: - Checks if a user space pointer is valid - * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE. Note that - * %VERIFY_WRITE is a superset of %VERIFY_READ - if it is safe - * to write to a block, it is always safe to read from it. - * @addr: User space pointer to start of block to check - * @size: Size of block to check - * - * Context: User context only. This function may sleep if pagefaults are - * enabled. - * - * Checks if a pointer to a block of memory in user space is valid. - * - * Returns true (nonzero) if the memory block may be valid, false (zero) - * if it is definitely invalid. - * - * Note that, depending on architecture, this function probably just - * checks that the pointer is in the user space range - after calling - * this function, memory access functions may still return -EFAULT. - */ -#ifdef CONFIG_MMU -#define access_ok(type, addr, size) (likely(__range_ok(addr, size) == 0)) -#else -static inline int access_ok(int type, const void *addr, unsigned long size) -{ - unsigned long val = (unsigned long)addr; - - return ((val >= memory_start) && ((val + size) < memory_end)); -} -#endif /* CONFIG_MMU */ - -#include - -/* - * These are the main single-value transfer routines. They automatically - * use the right size if we just have the right pointer type. - * - * This gets kind of ugly. We want to return _two_ values in "get_user()" - * and yet we don't want to do any pointers, because that is too much - * of a performance impact. Thus we have a few rather ugly macros here, - * and hide all the uglyness from the user. - * - * The "__xxx" versions of the user access functions are versions that - * do not verify the address space, that must have been done previously - * with a separate "access_ok()" call (this is used when we do multiple - * accesses to the same area of user memory). - */ - -/* Careful: we have to cast the result to the type of the pointer for sign - reasons */ -/** - * get_user: - Get a simple variable from user space. - * @x: Variable to store result. - * @ptr: Source address, in user space. - * - * Context: User context only. This function may sleep if pagefaults are - * enabled. - * - * This macro copies a single simple variable from user space to kernel - * space. It supports simple types like char and int, but not larger - * data types like structures or arrays. - * - * @ptr must have pointer-to-simple-variable type, and the result of - * dereferencing @ptr must be assignable to @x without a cast. - * - * Returns zero on success, or -EFAULT on error. - * On error, the variable @x is set to zero. - */ -#define get_user(x, ptr) \ - __get_user_check((x), (ptr), sizeof(*(ptr))) - -/** - * put_user: - Write a simple value into user space. - * @x: Value to copy to user space. - * @ptr: Destination address, in user space. - * - * Context: User context only. This function may sleep if pagefaults are - * enabled. - * - * This macro copies a single simple value from kernel space to user - * space. It supports simple types like char and int, but not larger - * data types like structures or arrays. - * - * @ptr must have pointer-to-simple-variable type, and @x must be assignable - * to the result of dereferencing @ptr. - * - * Returns zero on success, or -EFAULT on error. - */ -#define put_user(x, ptr) \ - __put_user_check((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr))) - -/** - * __get_user: - Get a simple variable from user space, with less checking. - * @x: Variable to store result. - * @ptr: Source address, in user space. - * - * Context: User context only. This function may sleep if pagefaults are - * enabled. - * - * This macro copies a single simple variable from user space to kernel - * space. It supports simple types like char and int, but not larger - * data types like structures or arrays. - * - * @ptr must have pointer-to-simple-variable type, and the result of - * dereferencing @ptr must be assignable to @x without a cast. - * - * Caller must check the pointer with access_ok() before calling this - * function. - * - * Returns zero on success, or -EFAULT on error. - * On error, the variable @x is set to zero. - */ -#define __get_user(x, ptr) \ - __get_user_nocheck((x), (ptr), sizeof(*(ptr))) - -#define __get_user_nocheck(x, ptr, size) \ -({ \ - long __gu_err = 0; \ - unsigned long __gu_val = 0; \ - might_fault(); \ - __get_user_size(__gu_val, (ptr), (size), __gu_err); \ - (x) = (__force __typeof__(*(ptr)))__gu_val; \ - __gu_err; \ -}) - -#define __get_user_check(x, ptr, size) \ -({ \ - long __gu_err = -EFAULT; \ - unsigned long __gu_val = 0; \ - const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ - might_fault(); \ - if (access_ok(VERIFY_READ, __gu_addr, size)) \ - __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ - (x) = (__force __typeof__(*(ptr)))__gu_val; \ - __gu_err; \ -}) - -extern long __get_user_bad(void); - -#define __get_user_size(x, ptr, size, retval) \ -do { \ - retval = 0; \ - __chk_user_ptr(ptr); \ - switch (size) { \ - case 1: __get_user_asm(x, ptr, retval, "ub"); break; \ - case 2: __get_user_asm(x, ptr, retval, "uh"); break; \ - case 4: __get_user_asm(x, ptr, retval, ""); break; \ - default: (x) = __get_user_bad(); \ - } \ -} while (0) - -#define __get_user_asm(x, addr, err, itype) \ - __asm__ __volatile__( \ - " .fillinsn\n" \ - "1: ld"itype" %1,@%2\n" \ - " .fillinsn\n" \ - "2:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "3: ldi %0,%3\n" \ - " seth r14,#high(2b)\n" \ - " or3 r14,r14,#low(2b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 1b,3b\n" \ - ".previous" \ - : "=&r" (err), "=&r" (x) \ - : "r" (addr), "i" (-EFAULT), "0" (err) \ - : "r14", "memory") - -/** - * __put_user: - Write a simple value into user space, with less checking. - * @x: Value to copy to user space. - * @ptr: Destination address, in user space. - * - * Context: User context only. This function may sleep if pagefaults are - * enabled. - * - * This macro copies a single simple value from kernel space to user - * space. It supports simple types like char and int, but not larger - * data types like structures or arrays. - * - * @ptr must have pointer-to-simple-variable type, and @x must be assignable - * to the result of dereferencing @ptr. - * - * Caller must check the pointer with access_ok() before calling this - * function. - * - * Returns zero on success, or -EFAULT on error. - */ -#define __put_user(x, ptr) \ - __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr))) - - -#define __put_user_nocheck(x, ptr, size) \ -({ \ - long __pu_err; \ - might_fault(); \ - __put_user_size((x), (ptr), (size), __pu_err); \ - __pu_err; \ -}) - - -#define __put_user_check(x, ptr, size) \ -({ \ - long __pu_err = -EFAULT; \ - __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ - might_fault(); \ - if (access_ok(VERIFY_WRITE, __pu_addr, size)) \ - __put_user_size((x), __pu_addr, (size), __pu_err); \ - __pu_err; \ -}) - -#if defined(__LITTLE_ENDIAN__) -#define __put_user_u64(x, addr, err) \ - __asm__ __volatile__( \ - " .fillinsn\n" \ - "1: st %L1,@%2\n" \ - " .fillinsn\n" \ - "2: st %H1,@(4,%2)\n" \ - " .fillinsn\n" \ - "3:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "4: ldi %0,%3\n" \ - " seth r14,#high(3b)\n" \ - " or3 r14,r14,#low(3b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 1b,4b\n" \ - " .long 2b,4b\n" \ - ".previous" \ - : "=&r" (err) \ - : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ - : "r14", "memory") - -#elif defined(__BIG_ENDIAN__) -#define __put_user_u64(x, addr, err) \ - __asm__ __volatile__( \ - " .fillinsn\n" \ - "1: st %H1,@%2\n" \ - " .fillinsn\n" \ - "2: st %L1,@(4,%2)\n" \ - " .fillinsn\n" \ - "3:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "4: ldi %0,%3\n" \ - " seth r14,#high(3b)\n" \ - " or3 r14,r14,#low(3b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 1b,4b\n" \ - " .long 2b,4b\n" \ - ".previous" \ - : "=&r" (err) \ - : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ - : "r14", "memory") -#else -#error no endian defined -#endif - -extern void __put_user_bad(void); - -#define __put_user_size(x, ptr, size, retval) \ -do { \ - retval = 0; \ - __chk_user_ptr(ptr); \ - switch (size) { \ - case 1: __put_user_asm(x, ptr, retval, "b"); break; \ - case 2: __put_user_asm(x, ptr, retval, "h"); break; \ - case 4: __put_user_asm(x, ptr, retval, ""); break; \ - case 8: __put_user_u64((__typeof__(*ptr))(x), ptr, retval); break;\ - default: __put_user_bad(); \ - } \ -} while (0) - -struct __large_struct { unsigned long buf[100]; }; -#define __m(x) (*(struct __large_struct *)(x)) - -/* - * Tell gcc we read from memory instead of writing: this is because - * we do not write to any memory gcc knows about, so there are no - * aliasing issues. - */ -#define __put_user_asm(x, addr, err, itype) \ - __asm__ __volatile__( \ - " .fillinsn\n" \ - "1: st"itype" %1,@%2\n" \ - " .fillinsn\n" \ - "2:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "3: ldi %0,%3\n" \ - " seth r14,#high(2b)\n" \ - " or3 r14,r14,#low(2b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 1b,3b\n" \ - ".previous" \ - : "=&r" (err) \ - : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ - : "r14", "memory") - -/* - * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault - * we return the initial request size (1, 2 or 4), as copy_*_user should do. - * If a store crosses a page boundary and gets a fault, the m32r will not write - * anything, so this is accurate. - */ - -/* - * Copy To/From Userspace - */ - -/* Generic arbitrary sized copy. */ -/* Return the number of bytes NOT copied. */ -#define __copy_user(to, from, size) \ -do { \ - unsigned long __dst, __src, __c; \ - __asm__ __volatile__ ( \ - " mv r14, %0\n" \ - " or r14, %1\n" \ - " beq %0, %1, 9f\n" \ - " beqz %2, 9f\n" \ - " and3 r14, r14, #3\n" \ - " bnez r14, 2f\n" \ - " and3 %2, %2, #3\n" \ - " beqz %3, 2f\n" \ - " addi %0, #-4 ; word_copy \n" \ - " .fillinsn\n" \ - "0: ld r14, @%1+\n" \ - " addi %3, #-1\n" \ - " .fillinsn\n" \ - "1: st r14, @+%0\n" \ - " bnez %3, 0b\n" \ - " beqz %2, 9f\n" \ - " addi %0, #4\n" \ - " .fillinsn\n" \ - "2: ldb r14, @%1 ; byte_copy \n" \ - " .fillinsn\n" \ - "3: stb r14, @%0\n" \ - " addi %1, #1\n" \ - " addi %2, #-1\n" \ - " addi %0, #1\n" \ - " bnez %2, 2b\n" \ - " .fillinsn\n" \ - "9:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "5: addi %3, #1\n" \ - " addi %1, #-4\n" \ - " .fillinsn\n" \ - "6: slli %3, #2\n" \ - " add %2, %3\n" \ - " addi %0, #4\n" \ - " .fillinsn\n" \ - "7: seth r14, #high(9b)\n" \ - " or3 r14, r14, #low(9b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 0b,6b\n" \ - " .long 1b,5b\n" \ - " .long 2b,9b\n" \ - " .long 3b,9b\n" \ - ".previous\n" \ - : "=&r" (__dst), "=&r" (__src), "=&r" (size), \ - "=&r" (__c) \ - : "0" (to), "1" (from), "2" (size), "3" (size / 4) \ - : "r14", "memory"); \ -} while (0) - -/* We let the __ versions of copy_from/to_user inline, because they're often - * used in fast paths and have only a small space overhead. - */ -static inline unsigned long -raw_copy_from_user(void *to, const void __user *from, unsigned long n) -{ - prefetchw(to); - __copy_user(to, from, n); - return n; -} - -static inline unsigned long -raw_copy_to_user(void __user *to, const void *from, unsigned long n) -{ - prefetch(from); - __copy_user(to, from, n); - return n; -} - -long __must_check strncpy_from_user(char *dst, const char __user *src, - long count); - -/** - * __clear_user: - Zero a block of memory in user space, with less checking. - * @to: Destination address, in user space. - * @n: Number of bytes to zero. - * - * Zero a block of memory in user space. Caller must check - * the specified block with access_ok() before calling this function. - * - * Returns number of bytes that could not be cleared. - * On success, this will be zero. - */ -unsigned long __clear_user(void __user *mem, unsigned long len); - -/** - * clear_user: - Zero a block of memory in user space. - * @to: Destination address, in user space. - * @n: Number of bytes to zero. - * - * Zero a block of memory in user space. Caller must check - * the specified block with access_ok() before calling this function. - * - * Returns number of bytes that could not be cleared. - * On success, this will be zero. - */ -unsigned long clear_user(void __user *mem, unsigned long len); - -long strnlen_user(const char __user *str, long n); - -#endif /* _ASM_M32R_UACCESS_H */ diff --git a/arch/m32r/include/asm/ucontext.h b/arch/m32r/include/asm/ucontext.h deleted file mode 100644 index 5f9de3736624..000000000000 --- a/arch/m32r/include/asm/ucontext.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_UCONTEXT_H -#define _ASM_M32R_UCONTEXT_H - -struct ucontext { - unsigned long uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - struct sigcontext uc_mcontext; - sigset_t uc_sigmask; /* mask last for extensibility */ -}; - -#endif /* _ASM_M32R_UCONTEXT_H */ diff --git a/arch/m32r/include/asm/unaligned.h b/arch/m32r/include/asm/unaligned.h deleted file mode 100644 index 5981361672f9..000000000000 --- a/arch/m32r/include/asm/unaligned.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_UNALIGNED_H -#define _ASM_M32R_UNALIGNED_H - -#if defined(__LITTLE_ENDIAN__) -# include -# include -# include -# define get_unaligned __get_unaligned_le -# define put_unaligned __put_unaligned_le -#else -# include -# include -# include -# define get_unaligned __get_unaligned_be -# define put_unaligned __put_unaligned_be -#endif - -#endif /* _ASM_M32R_UNALIGNED_H */ diff --git a/arch/m32r/include/asm/unistd.h b/arch/m32r/include/asm/unistd.h deleted file mode 100644 index dee4c196972e..000000000000 --- a/arch/m32r/include/asm/unistd.h +++ /dev/null @@ -1,51 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_UNISTD_H -#define _ASM_M32R_UNISTD_H - -#include - - -#define NR_syscalls 326 - -#define __ARCH_WANT_STAT64 -#define __ARCH_WANT_SYS_ALARM -#define __ARCH_WANT_SYS_GETHOSTNAME -#define __ARCH_WANT_SYS_IPC -#define __ARCH_WANT_SYS_PAUSE -#define __ARCH_WANT_SYS_TIME -#define __ARCH_WANT_SYS_UTIME -#define __ARCH_WANT_SYS_WAITPID -#define __ARCH_WANT_SYS_SOCKETCALL -#define __ARCH_WANT_SYS_FADVISE64 -#define __ARCH_WANT_SYS_GETPGRP -#define __ARCH_WANT_SYS_LLSEEK -#define __ARCH_WANT_SYS_OLDUMOUNT -#define __ARCH_WANT_SYS_CLONE -#define __ARCH_WANT_SYS_FORK -#define __ARCH_WANT_SYS_VFORK - -#define __IGNORE_lchown -#define __IGNORE_setuid -#define __IGNORE_getuid -#define __IGNORE_setgid -#define __IGNORE_getgid -#define __IGNORE_geteuid -#define __IGNORE_getegid -#define __IGNORE_fcntl -#define __IGNORE_setreuid -#define __IGNORE_setregid -#define __IGNORE_getrlimit -#define __IGNORE_getgroups -#define __IGNORE_setgroups -#define __IGNORE_select -#define __IGNORE_mmap -#define __IGNORE_fchown -#define __IGNORE_setfsuid -#define __IGNORE_setfsgid -#define __IGNORE_setresuid -#define __IGNORE_getresuid -#define __IGNORE_setresgid -#define __IGNORE_getresgid -#define __IGNORE_chown - -#endif /* _ASM_M32R_UNISTD_H */ diff --git a/arch/m32r/include/asm/user.h b/arch/m32r/include/asm/user.h deleted file mode 100644 index 489b60d4aec2..000000000000 --- a/arch/m32r/include/asm/user.h +++ /dev/null @@ -1,53 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_USER_H -#define _ASM_M32R_USER_H - -#include -#include -#include - -/* - * Core file format: The core file is written in such a way that gdb - * can understand it and provide useful information to the user (under - * linux we use the `trad-core' bfd). - * - * The actual file contents are as follows: - * UPAGE: 1 page consisting of a user struct that tells gdb - * what is present in the file. Directly after this is a - * copy of the task_struct, which is currently not used by gdb, - * but it may come in handy at some point. All of the registers - * are stored as part of the upage. The upage should always be - * only one page. - * DATA: The data area is stored. We use current->end_text to - * current->brk to pick up all of the user variables, plus any memory - * that may have been sbrk'ed. No attempt is made to determine if a - * page is demand-zero or if a page is totally unused, we just cover - * the entire range. All of the addresses are rounded in such a way - * that an integral number of pages is written. - * STACK: We need the stack information in order to get a meaningful - * backtrace. We need to write the data from usp to - * current->start_stack, so we round each of these off in order to be - * able to write an integer number of pages. - */ - -struct user { - struct pt_regs regs; /* entire machine state */ - size_t u_tsize; /* text size (pages) */ - size_t u_dsize; /* data size (pages) */ - size_t u_ssize; /* stack size (pages) */ - unsigned long start_code; /* text starting address */ - unsigned long start_data; /* data starting address */ - unsigned long start_stack; /* stack starting address */ - long int signal; /* signal causing core dump */ - unsigned long u_ar0; /* help gdb find registers */ - unsigned long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ -}; - -#define NBPG PAGE_SIZE -#define UPAGES 1 -#define HOST_TEXT_START_ADDR (u.start_code) -#define HOST_DATA_START_ADDR (u.start_data) -#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) - -#endif /* _ASM_M32R_USER_H */ diff --git a/arch/m32r/include/asm/vga.h b/arch/m32r/include/asm/vga.h deleted file mode 100644 index 783d5bf779c2..000000000000 --- a/arch/m32r/include/asm/vga.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_VGA_H -#define _ASM_M32R_VGA_H - -/* - * Access to VGA videoram - * - * (c) 1998 Martin Mares - */ - -/* - * On the PC, we can just recalculate addresses and then - * access the videoram directly without any black magic. - */ - -#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x) - -#define vga_readb(x) (*(x)) -#define vga_writeb(x,y) (*(y) = (x)) - -#endif /* _ASM_M32R_VGA_H */ diff --git a/arch/m32r/include/asm/xor.h b/arch/m32r/include/asm/xor.h deleted file mode 100644 index a4d546752c77..000000000000 --- a/arch/m32r/include/asm/xor.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M32R_XOR_H -#define _ASM_M32R_XOR_H - -#include - -#endif /* _ASM_M32R_XOR_H */ diff --git a/arch/m32r/include/uapi/asm/Kbuild b/arch/m32r/include/uapi/asm/Kbuild deleted file mode 100644 index c3df55aeefe7..000000000000 --- a/arch/m32r/include/uapi/asm/Kbuild +++ /dev/null @@ -1,7 +0,0 @@ -# UAPI Header export list -include include/uapi/asm-generic/Kbuild.asm - -generic-y += bpf_perf_event.h -generic-y += kvm_para.h -generic-y += poll.h -generic-y += siginfo.h diff --git a/arch/m32r/include/uapi/asm/auxvec.h b/arch/m32r/include/uapi/asm/auxvec.h deleted file mode 100644 index f76dcc860fae..000000000000 --- a/arch/m32r/include/uapi/asm/auxvec.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _ASM_M32R__AUXVEC_H -#define _ASM_M32R__AUXVEC_H - -#endif /* _ASM_M32R__AUXVEC_H */ diff --git a/arch/m32r/include/uapi/asm/bitsperlong.h b/arch/m32r/include/uapi/asm/bitsperlong.h deleted file mode 100644 index 76da34b10f59..000000000000 --- a/arch/m32r/include/uapi/asm/bitsperlong.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/m32r/include/uapi/asm/byteorder.h b/arch/m32r/include/uapi/asm/byteorder.h deleted file mode 100644 index 9b4a8ba483cd..000000000000 --- a/arch/m32r/include/uapi/asm/byteorder.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_BYTEORDER_H -#define _ASM_M32R_BYTEORDER_H - -#if defined(__LITTLE_ENDIAN__) -# include -#else -# include -#endif - -#endif /* _ASM_M32R_BYTEORDER_H */ diff --git a/arch/m32r/include/uapi/asm/errno.h b/arch/m32r/include/uapi/asm/errno.h deleted file mode 100644 index ab38ef607882..000000000000 --- a/arch/m32r/include/uapi/asm/errno.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_ERRNO_H -#define _ASM_M32R_ERRNO_H - -#include - -#endif /* _ASM_M32R_ERRNO_H */ diff --git a/arch/m32r/include/uapi/asm/fcntl.h b/arch/m32r/include/uapi/asm/fcntl.h deleted file mode 100644 index a77648c505d1..000000000000 --- a/arch/m32r/include/uapi/asm/fcntl.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/m32r/include/uapi/asm/ioctl.h b/arch/m32r/include/uapi/asm/ioctl.h deleted file mode 100644 index b809c4566e5f..000000000000 --- a/arch/m32r/include/uapi/asm/ioctl.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/m32r/include/uapi/asm/ioctls.h b/arch/m32r/include/uapi/asm/ioctls.h deleted file mode 100644 index 31da4c3bab94..000000000000 --- a/arch/m32r/include/uapi/asm/ioctls.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef __ARCH_M32R_IOCTLS_H__ -#define __ARCH_M32R_IOCTLS_H__ - -#include - -#endif /* __ARCH_M32R_IOCTLS_H__ */ diff --git a/arch/m32r/include/uapi/asm/ipcbuf.h b/arch/m32r/include/uapi/asm/ipcbuf.h deleted file mode 100644 index 90d6445a14df..000000000000 --- a/arch/m32r/include/uapi/asm/ipcbuf.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/m32r/include/uapi/asm/mman.h b/arch/m32r/include/uapi/asm/mman.h deleted file mode 100644 index 8eebf89f5ab1..000000000000 --- a/arch/m32r/include/uapi/asm/mman.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/m32r/include/uapi/asm/msgbuf.h b/arch/m32r/include/uapi/asm/msgbuf.h deleted file mode 100644 index 4386ff2735ba..000000000000 --- a/arch/m32r/include/uapi/asm/msgbuf.h +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_MSGBUF_H -#define _ASM_M32R_MSGBUF_H - -/* - * The msqid64_ds structure for m32r architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct msqid64_ds { - struct ipc64_perm msg_perm; - __kernel_time_t msg_stime; /* last msgsnd time */ - unsigned long __unused1; - __kernel_time_t msg_rtime; /* last msgrcv time */ - unsigned long __unused2; - __kernel_time_t msg_ctime; /* last change time */ - unsigned long __unused3; - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused4; - unsigned long __unused5; -}; - -#endif /* _ASM_M32R_MSGBUF_H */ diff --git a/arch/m32r/include/uapi/asm/param.h b/arch/m32r/include/uapi/asm/param.h deleted file mode 100644 index 0bff6d6133f5..000000000000 --- a/arch/m32r/include/uapi/asm/param.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_PARAM_H -#define _ASM_M32R_PARAM_H - -#include - -#endif /* _ASM_M32R_PARAM_H */ - diff --git a/arch/m32r/include/uapi/asm/posix_types.h b/arch/m32r/include/uapi/asm/posix_types.h deleted file mode 100644 index 63316fcb1b57..000000000000 --- a/arch/m32r/include/uapi/asm/posix_types.h +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_POSIX_TYPES_H -#define _ASM_M32R_POSIX_TYPES_H - -/* - * This file is generally used by user-level software, so you need to - * be a little careful about namespace pollution etc. Also, we cannot - * assume GCC is being used. - */ - -typedef unsigned short __kernel_mode_t; -#define __kernel_mode_t __kernel_mode_t - -typedef unsigned short __kernel_ipc_pid_t; -#define __kernel_ipc_pid_t __kernel_ipc_pid_t - -typedef unsigned short __kernel_uid_t; -typedef unsigned short __kernel_gid_t; -#define __kernel_uid_t __kernel_uid_t - -typedef unsigned short __kernel_old_dev_t; -#define __kernel_old_dev_t __kernel_old_dev_t - -#include - -#endif /* _ASM_M32R_POSIX_TYPES_H */ diff --git a/arch/m32r/include/uapi/asm/ptrace.h b/arch/m32r/include/uapi/asm/ptrace.h deleted file mode 100644 index 99aec86cf5c0..000000000000 --- a/arch/m32r/include/uapi/asm/ptrace.h +++ /dev/null @@ -1,118 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -/* - * linux/include/asm-m32r/ptrace.h - * - * 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. - * - * M32R version: - * Copyright (C) 2001-2002, 2004 Hirokazu Takata - */ -#ifndef _UAPI_ASM_M32R_PTRACE_H -#define _UAPI_ASM_M32R_PTRACE_H - - -/* 0 - 13 are integer registers (general purpose registers). */ -#define PT_R4 0 -#define PT_R5 1 -#define PT_R6 2 -#define PT_REGS 3 -#define PT_R0 4 -#define PT_R1 5 -#define PT_R2 6 -#define PT_R3 7 -#define PT_R7 8 -#define PT_R8 9 -#define PT_R9 10 -#define PT_R10 11 -#define PT_R11 12 -#define PT_R12 13 -#define PT_SYSCNR 14 -#define PT_R13 PT_FP -#define PT_R14 PT_LR -#define PT_R15 PT_SP - -/* processor status and miscellaneous context registers. */ -#define PT_ACC0H 15 -#define PT_ACC0L 16 -#define PT_ACC1H 17 /* ISA_DSP_LEVEL2 only */ -#define PT_ACC1L 18 /* ISA_DSP_LEVEL2 only */ -#define PT_PSW 19 -#define PT_BPC 20 -#define PT_BBPSW 21 -#define PT_BBPC 22 -#define PT_SPU 23 -#define PT_FP 24 -#define PT_LR 25 -#define PT_SPI 26 -#define PT_ORIGR0 27 - -/* virtual pt_reg entry for gdb */ -#define PT_PC 30 -#define PT_CBR 31 -#define PT_EVB 32 - - -/* Control registers. */ -#define SPR_CR0 PT_PSW -#define SPR_CR1 PT_CBR /* read only */ -#define SPR_CR2 PT_SPI -#define SPR_CR3 PT_SPU -#define SPR_CR4 -#define SPR_CR5 PT_EVB /* part of M32R/E, M32R/I core only */ -#define SPR_CR6 PT_BPC -#define SPR_CR7 -#define SPR_CR8 PT_BBPSW -#define SPR_CR9 -#define SPR_CR10 -#define SPR_CR11 -#define SPR_CR12 -#define SPR_CR13 PT_WR -#define SPR_CR14 PT_BBPC -#define SPR_CR15 - -/* this struct defines the way the registers are stored on the - stack during a system call. */ -struct pt_regs { - /* Saved main processor registers. */ - unsigned long r4; - unsigned long r5; - unsigned long r6; - struct pt_regs *pt_regs; - unsigned long r0; - unsigned long r1; - unsigned long r2; - unsigned long r3; - unsigned long r7; - unsigned long r8; - unsigned long r9; - unsigned long r10; - unsigned long r11; - unsigned long r12; - long syscall_nr; - - /* Saved main processor status and miscellaneous context registers. */ - unsigned long acc0h; - unsigned long acc0l; - unsigned long acc1h; /* ISA_DSP_LEVEL2 only */ - unsigned long acc1l; /* ISA_DSP_LEVEL2 only */ - unsigned long psw; - unsigned long bpc; /* saved PC for TRAP syscalls */ - unsigned long bbpsw; - unsigned long bbpc; - unsigned long spu; /* saved user stack */ - unsigned long fp; - unsigned long lr; /* saved PC for JL syscalls */ - unsigned long spi; /* saved kernel stack */ - unsigned long orig_r0; -}; - -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -#define PTRACE_GETREGS 12 -#define PTRACE_SETREGS 13 - -#define PTRACE_OLDSETOPTIONS 21 - - -#endif /* _UAPI_ASM_M32R_PTRACE_H */ diff --git a/arch/m32r/include/uapi/asm/resource.h b/arch/m32r/include/uapi/asm/resource.h deleted file mode 100644 index 3282f3c4a5ca..000000000000 --- a/arch/m32r/include/uapi/asm/resource.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_RESOURCE_H -#define _ASM_M32R_RESOURCE_H - -#include - -#endif /* _ASM_M32R_RESOURCE_H */ diff --git a/arch/m32r/include/uapi/asm/sembuf.h b/arch/m32r/include/uapi/asm/sembuf.h deleted file mode 100644 index de34664d8cd7..000000000000 --- a/arch/m32r/include/uapi/asm/sembuf.h +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_SEMBUF_H -#define _ASM_M32R_SEMBUF_H - -/* - * The semid64_ds structure for m32r architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - unsigned long __unused1; - __kernel_time_t sem_ctime; /* last change time */ - unsigned long __unused2; - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _ASM_M32R_SEMBUF_H */ diff --git a/arch/m32r/include/uapi/asm/setup.h b/arch/m32r/include/uapi/asm/setup.h deleted file mode 100644 index d936a64bbafd..000000000000 --- a/arch/m32r/include/uapi/asm/setup.h +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _UAPI_ASM_M32R_SETUP_H -#define _UAPI_ASM_M32R_SETUP_H - -/* - * This is set up by the setup-routine at boot-time - */ - -#define COMMAND_LINE_SIZE 512 - - -#endif /* _UAPI_ASM_M32R_SETUP_H */ diff --git a/arch/m32r/include/uapi/asm/shmbuf.h b/arch/m32r/include/uapi/asm/shmbuf.h deleted file mode 100644 index 44c2ea924829..000000000000 --- a/arch/m32r/include/uapi/asm/shmbuf.h +++ /dev/null @@ -1,43 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_SHMBUF_H -#define _ASM_M32R_SHMBUF_H - -/* - * The shmid64_ds structure for M32R architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - unsigned long __unused1; - __kernel_time_t shm_dtime; /* last detach time */ - unsigned long __unused2; - __kernel_time_t shm_ctime; /* last change time */ - unsigned long __unused3; - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused4; - unsigned long __unused5; -}; - -struct shminfo64 { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _ASM_M32R_SHMBUF_H */ diff --git a/arch/m32r/include/uapi/asm/sigcontext.h b/arch/m32r/include/uapi/asm/sigcontext.h deleted file mode 100644 index cc9ee73525ff..000000000000 --- a/arch/m32r/include/uapi/asm/sigcontext.h +++ /dev/null @@ -1,40 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_SIGCONTEXT_H -#define _ASM_M32R_SIGCONTEXT_H - -struct sigcontext { - /* CPU registers */ - /* Saved main processor registers. */ - unsigned long sc_r4; - unsigned long sc_r5; - unsigned long sc_r6; - struct pt_regs *sc_pt_regs; - unsigned long sc_r0; - unsigned long sc_r1; - unsigned long sc_r2; - unsigned long sc_r3; - unsigned long sc_r7; - unsigned long sc_r8; - unsigned long sc_r9; - unsigned long sc_r10; - unsigned long sc_r11; - unsigned long sc_r12; - - /* Saved main processor status and miscellaneous context registers. */ - unsigned long sc_acc0h; - unsigned long sc_acc0l; - unsigned long sc_acc1h; /* ISA_DSP_LEVEL2 only */ - unsigned long sc_acc1l; /* ISA_DSP_LEVEL2 only */ - unsigned long sc_psw; - unsigned long sc_bpc; /* saved PC for TRAP syscalls */ - unsigned long sc_bbpsw; - unsigned long sc_bbpc; - unsigned long sc_spu; /* saved user stack */ - unsigned long sc_fp; - unsigned long sc_lr; /* saved PC for JL syscalls */ - unsigned long sc_spi; /* saved kernel stack */ - - unsigned long oldmask; -}; - -#endif /* _ASM_M32R_SIGCONTEXT_H */ diff --git a/arch/m32r/include/uapi/asm/signal.h b/arch/m32r/include/uapi/asm/signal.h deleted file mode 100644 index c2ac3417fb98..000000000000 --- a/arch/m32r/include/uapi/asm/signal.h +++ /dev/null @@ -1,118 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _UAPI_ASM_M32R_SIGNAL_H -#define _UAPI_ASM_M32R_SIGNAL_H - -#include -#include -#include - -/* Avoid too many header ordering problems. */ -struct siginfo; - -#ifndef __KERNEL__ -/* Here we must cater to libcs that poke about in kernel headers. */ - -#define NSIG 32 -typedef unsigned long sigset_t; - -#endif /* __KERNEL__ */ - -#define SIGHUP 1 -#define SIGINT 2 -#define SIGQUIT 3 -#define SIGILL 4 -#define SIGTRAP 5 -#define SIGABRT 6 -#define SIGIOT 6 -#define SIGBUS 7 -#define SIGFPE 8 -#define SIGKILL 9 -#define SIGUSR1 10 -#define SIGSEGV 11 -#define SIGUSR2 12 -#define SIGPIPE 13 -#define SIGALRM 14 -#define SIGTERM 15 -#define SIGSTKFLT 16 -#define SIGCHLD 17 -#define SIGCONT 18 -#define SIGSTOP 19 -#define SIGTSTP 20 -#define SIGTTIN 21 -#define SIGTTOU 22 -#define SIGURG 23 -#define SIGXCPU 24 -#define SIGXFSZ 25 -#define SIGVTALRM 26 -#define SIGPROF 27 -#define SIGWINCH 28 -#define SIGIO 29 -#define SIGPOLL SIGIO -/* -#define SIGLOST 29 -*/ -#define SIGPWR 30 -#define SIGSYS 31 -#define SIGUNUSED 31 - -/* These should not be considered constants from userland. */ -#define SIGRTMIN 32 -#define SIGRTMAX _NSIG - -/* - * SA_FLAGS values: - * - * SA_ONSTACK indicates that a registered stack_t will be used. - * SA_RESTART flag to get restarting signals (which were the default long ago) - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. - * SA_RESETHAND clears the handler when the signal is delivered. - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. - * SA_NODEFER prevents the current signal from being masked in the handler. - * - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single - * Unix names RESETHAND and NODEFER respectively. - */ -#define SA_NOCLDSTOP 0x00000001u -#define SA_NOCLDWAIT 0x00000002u -#define SA_SIGINFO 0x00000004u -#define SA_ONSTACK 0x08000000u -#define SA_RESTART 0x10000000u -#define SA_NODEFER 0x40000000u -#define SA_RESETHAND 0x80000000u - -#define SA_NOMASK SA_NODEFER -#define SA_ONESHOT SA_RESETHAND - -#define SA_RESTORER 0x04000000 - -#define MINSIGSTKSZ 2048 -#define SIGSTKSZ 8192 - -#include - -#ifndef __KERNEL__ -/* Here we must cater to libcs that poke about in kernel headers. */ - -struct sigaction { - union { - __sighandler_t _sa_handler; - void (*_sa_sigaction)(int, struct siginfo *, void *); - } _u; - sigset_t sa_mask; - unsigned long sa_flags; - void (*sa_restorer)(void); -}; - -#define sa_handler _u._sa_handler -#define sa_sigaction _u._sa_sigaction - -#endif /* __KERNEL__ */ - -typedef struct sigaltstack { - void __user *ss_sp; - int ss_flags; - size_t ss_size; -} stack_t; - - -#endif /* _UAPI_ASM_M32R_SIGNAL_H */ diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h deleted file mode 100644 index cf5018e82c3d..000000000000 --- a/arch/m32r/include/uapi/asm/socket.h +++ /dev/null @@ -1,108 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_SOCKET_H -#define _ASM_M32R_SOCKET_H - -#include - -/* For setsockoptions(2) */ -#define SOL_SOCKET 1 - -#define SO_DEBUG 1 -#define SO_REUSEADDR 2 -#define SO_TYPE 3 -#define SO_ERROR 4 -#define SO_DONTROUTE 5 -#define SO_BROADCAST 6 -#define SO_SNDBUF 7 -#define SO_RCVBUF 8 -#define SO_SNDBUFFORCE 32 -#define SO_RCVBUFFORCE 33 -#define SO_KEEPALIVE 9 -#define SO_OOBINLINE 10 -#define SO_NO_CHECK 11 -#define SO_PRIORITY 12 -#define SO_LINGER 13 -#define SO_BSDCOMPAT 14 -#define SO_REUSEPORT 15 -#define SO_PASSCRED 16 -#define SO_PEERCRED 17 -#define SO_RCVLOWAT 18 -#define SO_SNDLOWAT 19 -#define SO_RCVTIMEO 20 -#define SO_SNDTIMEO 21 - -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define SO_SECURITY_AUTHENTICATION 22 -#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 -#define SO_SECURITY_ENCRYPTION_NETWORK 24 - -#define SO_BINDTODEVICE 25 - -/* Socket filtering */ -#define SO_ATTACH_FILTER 26 -#define SO_DETACH_FILTER 27 -#define SO_GET_FILTER SO_ATTACH_FILTER - -#define SO_PEERNAME 28 -#define SO_TIMESTAMP 29 -#define SCM_TIMESTAMP SO_TIMESTAMP - -#define SO_ACCEPTCONN 30 - -#define SO_PEERSEC 31 -#define SO_PASSSEC 34 -#define SO_TIMESTAMPNS 35 -#define SCM_TIMESTAMPNS SO_TIMESTAMPNS - -#define SO_MARK 36 - -#define SO_TIMESTAMPING 37 -#define SCM_TIMESTAMPING SO_TIMESTAMPING - -#define SO_PROTOCOL 38 -#define SO_DOMAIN 39 - -#define SO_RXQ_OVFL 40 - -#define SO_WIFI_STATUS 41 -#define SCM_WIFI_STATUS SO_WIFI_STATUS -#define SO_PEEK_OFF 42 - -/* Instruct lower device to use last 4-bytes of skb data as FCS */ -#define SO_NOFCS 43 - -#define SO_LOCK_FILTER 44 - -#define SO_SELECT_ERR_QUEUE 45 - -#define SO_BUSY_POLL 46 - -#define SO_MAX_PACING_RATE 47 - -#define SO_BPF_EXTENSIONS 48 - -#define SO_INCOMING_CPU 49 - -#define SO_ATTACH_BPF 50 -#define SO_DETACH_BPF SO_DETACH_FILTER - -#define SO_ATTACH_REUSEPORT_CBPF 51 -#define SO_ATTACH_REUSEPORT_EBPF 52 - -#define SO_CNX_ADVICE 53 - -#define SCM_TIMESTAMPING_OPT_STATS 54 - -#define SO_MEMINFO 55 - -#define SO_INCOMING_NAPI_ID 56 - -#define SO_COOKIE 57 - -#define SCM_TIMESTAMPING_PKTINFO 58 - -#define SO_PEERGROUPS 59 - -#define SO_ZEROCOPY 60 - -#endif /* _ASM_M32R_SOCKET_H */ diff --git a/arch/m32r/include/uapi/asm/sockios.h b/arch/m32r/include/uapi/asm/sockios.h deleted file mode 100644 index 948229e474c5..000000000000 --- a/arch/m32r/include/uapi/asm/sockios.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_SOCKIOS_H -#define _ASM_M32R_SOCKIOS_H - -/* Socket-level I/O control calls. */ -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ -#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ - -#endif /* _ASM_M32R_SOCKIOS_H */ diff --git a/arch/m32r/include/uapi/asm/stat.h b/arch/m32r/include/uapi/asm/stat.h deleted file mode 100644 index 0fe9f96ce8f0..000000000000 --- a/arch/m32r/include/uapi/asm/stat.h +++ /dev/null @@ -1,88 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_STAT_H -#define _ASM_M32R_STAT_H - -#include - -struct __old_kernel_stat { - unsigned short st_dev; - unsigned short st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned long st_size; - unsigned long st_atime; - unsigned long st_mtime; - unsigned long st_ctime; -}; - -#define STAT_HAVE_NSEC 1 - -struct stat { - unsigned short st_dev; - unsigned short __pad1; - unsigned long st_ino; - unsigned short st_mode; - unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned short st_rdev; - unsigned short __pad2; - unsigned long st_size; - unsigned long st_blksize; - unsigned long st_blocks; - unsigned long st_atime; - unsigned long st_atime_nsec; - unsigned long st_mtime; - unsigned long st_mtime_nsec; - unsigned long st_ctime; - unsigned long st_ctime_nsec; - unsigned long __unused4; - unsigned long __unused5; -}; - -/* This matches struct stat64 in glibc2.1, hence the absolutely - * insane amounts of padding around dev_t's. - */ -struct stat64 { - unsigned long long st_dev; - unsigned char __pad0[4]; -#define STAT64_HAS_BROKEN_ST_INO - unsigned long __st_ino; - - unsigned int st_mode; - unsigned int st_nlink; - - unsigned long st_uid; - unsigned long st_gid; - - unsigned long long st_rdev; - unsigned char __pad3[4]; - - long long st_size; - unsigned long st_blksize; - -#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN) - unsigned long __pad4; /* future possible st_blocks high bits */ - unsigned long st_blocks; /* Number 512-byte blocks allocated. */ -#elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) - unsigned long st_blocks; /* Number 512-byte blocks allocated. */ - unsigned long __pad4; /* future possible st_blocks high bits */ -#else -#error no endian defined -#endif - unsigned long st_atime; - unsigned long st_atime_nsec; - - unsigned long st_mtime; - unsigned long st_mtime_nsec; - - unsigned long st_ctime; - unsigned long st_ctime_nsec; - - unsigned long long st_ino; -}; - -#endif /* _ASM_M32R_STAT_H */ diff --git a/arch/m32r/include/uapi/asm/statfs.h b/arch/m32r/include/uapi/asm/statfs.h deleted file mode 100644 index d42ae20dbb2b..000000000000 --- a/arch/m32r/include/uapi/asm/statfs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_STATFS_H -#define _ASM_M32R_STATFS_H - -#include - -#endif /* _ASM_M32R_STATFS_H */ diff --git a/arch/m32r/include/uapi/asm/swab.h b/arch/m32r/include/uapi/asm/swab.h deleted file mode 100644 index 18dce47d2841..000000000000 --- a/arch/m32r/include/uapi/asm/swab.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_SWAB_H -#define _ASM_M32R_SWAB_H - -#include - -#if !defined(__STRICT_ANSI__) || defined(__KERNEL__) -# define __SWAB_64_THRU_32__ -#endif - -#endif /* _ASM_M32R_SWAB_H */ diff --git a/arch/m32r/include/uapi/asm/termbits.h b/arch/m32r/include/uapi/asm/termbits.h deleted file mode 100644 index 6cbbae9695b4..000000000000 --- a/arch/m32r/include/uapi/asm/termbits.h +++ /dev/null @@ -1,201 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_M32R_TERMBITS_H -#define _ASM_M32R_TERMBITS_H - -#include - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#define NCCS 19 -struct termios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ -}; - -struct termios2 { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define XTABS 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -/* c_cflag bit meaning */ -#define CBAUD 0010017 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 -#define CBAUDEX 0010000 -#define BOTHER 0010000 -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define CIBAUD 002003600000 /** input baud rate */ -#define CTVB 004000000000 /* VisioBraille Terminal flow control */ -#define CMSPAR 010000000000 /* mark or space (stick) parity */ -#define CRTSCTS 020000000000 /* flow control */ - -#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ - -/* c_lflag bits */ -#define ISIG 0000001 -#define ICANON 0000002 -#define XCASE 0000004 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 -#define IEXTEN 0100000 -#define EXTPROC 0200000 - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#endif /* _ASM_M32R_TERMBITS_H */ diff --git a/arch/m32r/include/uapi/asm/termios.h b/arch/m32r/include/uapi/asm/termios.h deleted file mode 100644 index 9b80a85e83ac..000000000000 --- a/arch/m32r/include/uapi/asm/termios.h +++ /dev/null @@ -1,44 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _UAPI_M32R_TERMIOS_H -#define _UAPI_M32R_TERMIOS_H - -#include -#include - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - -/* modem lines */ -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - - -#endif /* _UAPI_M32R_TERMIOS_H */ diff --git a/arch/m32r/include/uapi/asm/types.h b/arch/m32r/include/uapi/asm/types.h deleted file mode 100644 index 9ec9d4c5ac4d..000000000000 --- a/arch/m32r/include/uapi/asm/types.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/m32r/include/uapi/asm/unistd.h b/arch/m32r/include/uapi/asm/unistd.h deleted file mode 100644 index adf8666a68ef..000000000000 --- a/arch/m32r/include/uapi/asm/unistd.h +++ /dev/null @@ -1,336 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _UAPI_ASM_M32R_UNISTD_H -#define _UAPI_ASM_M32R_UNISTD_H - -/* - * This file contains the system call numbers. - */ - -#define __NR_restart_syscall 0 -#define __NR_exit 1 -#define __NR_fork 2 -#define __NR_read 3 -#define __NR_write 4 -#define __NR_open 5 -#define __NR_close 6 -#define __NR_waitpid 7 -#define __NR_creat 8 -#define __NR_link 9 -#define __NR_unlink 10 -#define __NR_execve 11 -#define __NR_chdir 12 -#define __NR_time 13 -#define __NR_mknod 14 -#define __NR_chmod 15 -/* 16 is unused */ -/* 17 is unused */ -/* 18 is unused */ -#define __NR_lseek 19 -#define __NR_getpid 20 -#define __NR_mount 21 -#define __NR_umount 22 -/* 23 is unused */ -/* 24 is unused */ -#define __NR_stime 25 -#define __NR_ptrace 26 -#define __NR_alarm 27 -/* 28 is unused */ -#define __NR_pause 29 -#define __NR_utime 30 -/* 31 is unused */ -#define __NR_cachectl 32 /* old #define __NR_gtty 32*/ -#define __NR_access 33 -/* 34 is unused */ -/* 35 is unused */ -#define __NR_sync 36 -#define __NR_kill 37 -#define __NR_rename 38 -#define __NR_mkdir 39 -#define __NR_rmdir 40 -#define __NR_dup 41 -#define __NR_pipe 42 -#define __NR_times 43 -/* 44 is unused */ -#define __NR_brk 45 -/* 46 is unused */ -/* 47 is unused (getgid16) */ -/* 48 is unused */ -/* 49 is unused */ -/* 50 is unused */ -#define __NR_acct 51 -#define __NR_umount2 52 -/* 53 is unused */ -#define __NR_ioctl 54 -/* 55 is unused (fcntl) */ -/* 56 is unused */ -#define __NR_setpgid 57 -/* 58 is unused */ -/* 59 is unused */ -#define __NR_umask 60 -#define __NR_chroot 61 -#define __NR_ustat 62 -#define __NR_dup2 63 -#define __NR_getppid 64 -#define __NR_getpgrp 65 -#define __NR_setsid 66 -/* 67 is unused */ -/* 68 is unused*/ -/* 69 is unused*/ -/* 70 is unused */ -/* 71 is unused */ -/* 72 is unused */ -/* 73 is unused */ -#define __NR_sethostname 74 -#define __NR_setrlimit 75 -/* 76 is unused (old getrlimit) */ -#define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 -/* 80 is unused */ -/* 81 is unused */ -/* 82 is unused */ -#define __NR_symlink 83 -/* 84 is unused */ -#define __NR_readlink 85 -#define __NR_uselib 86 -#define __NR_swapon 87 -#define __NR_reboot 88 -/* 89 is unused */ -/* 90 is unused */ -#define __NR_munmap 91 -#define __NR_truncate 92 -#define __NR_ftruncate 93 -#define __NR_fchmod 94 -/* 95 is unused */ -#define __NR_getpriority 96 -#define __NR_setpriority 97 -/* 98 is unused */ -#define __NR_statfs 99 -#define __NR_fstatfs 100 -/* 101 is unused */ -#define __NR_socketcall 102 -#define __NR_syslog 103 -#define __NR_setitimer 104 -#define __NR_getitimer 105 -#define __NR_stat 106 -#define __NR_lstat 107 -#define __NR_fstat 108 -/* 109 is unused */ -/* 110 is unused */ -#define __NR_vhangup 111 -/* 112 is unused */ -/* 113 is unused */ -#define __NR_wait4 114 -#define __NR_swapoff 115 -#define __NR_sysinfo 116 -#define __NR_ipc 117 -#define __NR_fsync 118 -/* 119 is unused */ -#define __NR_clone 120 -#define __NR_setdomainname 121 -#define __NR_uname 122 -/* 123 is unused */ -#define __NR_adjtimex 124 -#define __NR_mprotect 125 -/* 126 is unused */ -/* 127 is unused */ -#define __NR_init_module 128 -#define __NR_delete_module 129 -/* 130 is unused */ -#define __NR_quotactl 131 -#define __NR_getpgid 132 -#define __NR_fchdir 133 -#define __NR_bdflush 134 -#define __NR_sysfs 135 -#define __NR_personality 136 -/* 137 is unused */ -/* 138 is unused */ -/* 139 is unused */ -#define __NR__llseek 140 -#define __NR_getdents 141 -#define __NR__newselect 142 -#define __NR_flock 143 -#define __NR_msync 144 -#define __NR_readv 145 -#define __NR_writev 146 -#define __NR_getsid 147 -#define __NR_fdatasync 148 -#define __NR__sysctl 149 -#define __NR_mlock 150 -#define __NR_munlock 151 -#define __NR_mlockall 152 -#define __NR_munlockall 153 -#define __NR_sched_setparam 154 -#define __NR_sched_getparam 155 -#define __NR_sched_setscheduler 156 -#define __NR_sched_getscheduler 157 -#define __NR_sched_yield 158 -#define __NR_sched_get_priority_max 159 -#define __NR_sched_get_priority_min 160 -#define __NR_sched_rr_get_interval 161 -#define __NR_nanosleep 162 -#define __NR_mremap 163 -/* 164 is unused */ -/* 165 is unused */ -#define __NR_tas 166 -/* 167 is unused */ -#define __NR_poll 168 -#define __NR_nfsservctl 169 -/* 170 is unused */ -/* 171 is unused */ -#define __NR_prctl 172 -#define __NR_rt_sigreturn 173 -#define __NR_rt_sigaction 174 -#define __NR_rt_sigprocmask 175 -#define __NR_rt_sigpending 176 -#define __NR_rt_sigtimedwait 177 -#define __NR_rt_sigqueueinfo 178 -#define __NR_rt_sigsuspend 179 -#define __NR_pread64 180 -#define __NR_pwrite64 181 -/* 182 is unused */ -#define __NR_getcwd 183 -#define __NR_capget 184 -#define __NR_capset 185 -#define __NR_sigaltstack 186 -#define __NR_sendfile 187 -/* 188 is unused */ -/* 189 is unused */ -#define __NR_vfork 190 -#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ -#define __NR_mmap2 192 -#define __NR_truncate64 193 -#define __NR_ftruncate64 194 -#define __NR_stat64 195 -#define __NR_lstat64 196 -#define __NR_fstat64 197 -#define __NR_lchown32 198 -#define __NR_getuid32 199 -#define __NR_getgid32 200 -#define __NR_geteuid32 201 -#define __NR_getegid32 202 -#define __NR_setreuid32 203 -#define __NR_setregid32 204 -#define __NR_getgroups32 205 -#define __NR_setgroups32 206 -#define __NR_fchown32 207 -#define __NR_setresuid32 208 -#define __NR_getresuid32 209 -#define __NR_setresgid32 210 -#define __NR_getresgid32 211 -#define __NR_chown32 212 -#define __NR_setuid32 213 -#define __NR_setgid32 214 -#define __NR_setfsuid32 215 -#define __NR_setfsgid32 216 -#define __NR_pivot_root 217 -#define __NR_mincore 218 -#define __NR_madvise 219 -#define __NR_getdents64 220 -#define __NR_fcntl64 221 -/* 222 is unused */ -/* 223 is unused */ -#define __NR_gettid 224 -#define __NR_readahead 225 -#define __NR_setxattr 226 -#define __NR_lsetxattr 227 -#define __NR_fsetxattr 228 -#define __NR_getxattr 229 -#define __NR_lgetxattr 230 -#define __NR_fgetxattr 231 -#define __NR_listxattr 232 -#define __NR_llistxattr 233 -#define __NR_flistxattr 234 -#define __NR_removexattr 235 -#define __NR_lremovexattr 236 -#define __NR_fremovexattr 237 -#define __NR_tkill 238 -#define __NR_sendfile64 239 -#define __NR_futex 240 -#define __NR_sched_setaffinity 241 -#define __NR_sched_getaffinity 242 -#define __NR_set_thread_area 243 -#define __NR_get_thread_area 244 -#define __NR_io_setup 245 -#define __NR_io_destroy 246 -#define __NR_io_getevents 247 -#define __NR_io_submit 248 -#define __NR_io_cancel 249 -#define __NR_fadvise64 250 -/* 251 is unused */ -#define __NR_exit_group 252 -#define __NR_lookup_dcookie 253 -#define __NR_epoll_create 254 -#define __NR_epoll_ctl 255 -#define __NR_epoll_wait 256 -#define __NR_remap_file_pages 257 -#define __NR_set_tid_address 258 -#define __NR_timer_create 259 -#define __NR_timer_settime (__NR_timer_create+1) -#define __NR_timer_gettime (__NR_timer_create+2) -#define __NR_timer_getoverrun (__NR_timer_create+3) -#define __NR_timer_delete (__NR_timer_create+4) -#define __NR_clock_settime (__NR_timer_create+5) -#define __NR_clock_gettime (__NR_timer_create+6) -#define __NR_clock_getres (__NR_timer_create+7) -#define __NR_clock_nanosleep (__NR_timer_create+8) -#define __NR_statfs64 268 -#define __NR_fstatfs64 269 -#define __NR_tgkill 270 -#define __NR_utimes 271 -#define __NR_fadvise64_64 272 -#define __NR_vserver 273 -#define __NR_mbind 274 -#define __NR_get_mempolicy 275 -#define __NR_set_mempolicy 276 -#define __NR_mq_open 277 -#define __NR_mq_unlink (__NR_mq_open+1) -#define __NR_mq_timedsend (__NR_mq_open+2) -#define __NR_mq_timedreceive (__NR_mq_open+3) -#define __NR_mq_notify (__NR_mq_open+4) -#define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_kexec_load 283 -#define __NR_waitid 284 -/* 285 is unused */ -#define __NR_add_key 286 -#define __NR_request_key 287 -#define __NR_keyctl 288 -#define __NR_ioprio_set 289 -#define __NR_ioprio_get 290 -#define __NR_inotify_init 291 -#define __NR_inotify_add_watch 292 -#define __NR_inotify_rm_watch 293 -#define __NR_migrate_pages 294 -#define __NR_openat 295 -#define __NR_mkdirat 296 -#define __NR_mknodat 297 -#define __NR_fchownat 298 -#define __NR_futimesat 299 -#define __NR_fstatat64 300 -#define __NR_unlinkat 301 -#define __NR_renameat 302 -#define __NR_linkat 303 -#define __NR_symlinkat 304 -#define __NR_readlinkat 305 -#define __NR_fchmodat 306 -#define __NR_faccessat 307 -#define __NR_pselect6 308 -#define __NR_ppoll 309 -#define __NR_unshare 310 -#define __NR_set_robust_list 311 -#define __NR_get_robust_list 312 -#define __NR_splice 313 -#define __NR_sync_file_range 314 -#define __NR_tee 315 -#define __NR_vmsplice 316 -#define __NR_move_pages 317 -#define __NR_getcpu 318 -#define __NR_epoll_pwait 319 -#define __NR_utimensat 320 -#define __NR_signalfd 321 -/* #define __NR_timerfd 322 removed */ -#define __NR_eventfd 323 -#define __NR_fallocate 324 -#define __NR_setns 325 - -#endif /* _UAPI_ASM_M32R_UNISTD_H */ diff --git a/arch/m32r/kernel/.gitignore b/arch/m32r/kernel/.gitignore deleted file mode 100644 index c5f676c3c224..000000000000 --- a/arch/m32r/kernel/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vmlinux.lds diff --git a/arch/m32r/kernel/Makefile b/arch/m32r/kernel/Makefile deleted file mode 100644 index bd94dca51596..000000000000 --- a/arch/m32r/kernel/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Makefile for the Linux/M32R kernel. -# - -extra-y := head.o vmlinux.lds - -obj-y := process.o entry.o traps.o align.o irq.o setup.o time.o \ - m32r_ksyms.o sys_m32r.o signal.o ptrace.o - -obj-$(CONFIG_SMP) += smp.o smpboot.o -obj-$(CONFIG_MODULES) += module.o diff --git a/arch/m32r/kernel/align.c b/arch/m32r/kernel/align.c deleted file mode 100644 index 2919a6647aff..000000000000 --- a/arch/m32r/kernel/align.c +++ /dev/null @@ -1,585 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * align.c - address exception handler for M32R - * - * Copyright (c) 2003 Hitoshi Yamamoto - */ - -#include -#include - -static int get_reg(struct pt_regs *regs, int nr) -{ - int val; - - if (nr < 4) - val = *(unsigned long *)(®s->r0 + nr); - else if (nr < 7) - val = *(unsigned long *)(®s->r4 + (nr - 4)); - else if (nr < 13) - val = *(unsigned long *)(®s->r7 + (nr - 7)); - else - val = *(unsigned long *)(®s->fp + (nr - 13)); - - return val; -} - -static void set_reg(struct pt_regs *regs, int nr, int val) -{ - if (nr < 4) - *(unsigned long *)(®s->r0 + nr) = val; - else if (nr < 7) - *(unsigned long *)(®s->r4 + (nr - 4)) = val; - else if (nr < 13) - *(unsigned long *)(®s->r7 + (nr - 7)) = val; - else - *(unsigned long *)(®s->fp + (nr - 13)) = val; -} - -#define REG1(insn) (((insn) & 0x0f00) >> 8) -#define REG2(insn) ((insn) & 0x000f) -#define PSW_BC 0x100 - -/* O- instruction */ -#define ISA_LD1 0x20c0 /* ld Rdest, @Rsrc */ -#define ISA_LD2 0x20e0 /* ld Rdest, @Rsrc+ */ -#define ISA_LDH 0x20a0 /* ldh Rdest, @Rsrc */ -#define ISA_LDUH 0x20b0 /* lduh Rdest, @Rsrc */ -#define ISA_ST1 0x2040 /* st Rsrc1, @Rsrc2 */ -#define ISA_ST2 0x2060 /* st Rsrc1, @+Rsrc2 */ -#define ISA_ST3 0x2070 /* st Rsrc1, @-Rsrc2 */ -#define ISA_STH1 0x2020 /* sth Rsrc1, @Rsrc2 */ -#define ISA_STH2 0x2030 /* sth Rsrc1, @Rsrc2+ */ - -#ifdef CONFIG_ISA_DUAL_ISSUE - -/* OS instruction */ -#define ISA_ADD 0x00a0 /* add Rdest, Rsrc */ -#define ISA_ADDI 0x4000 /* addi Rdest, #imm8 */ -#define ISA_ADDX 0x0090 /* addx Rdest, Rsrc */ -#define ISA_AND 0x00c0 /* and Rdest, Rsrc */ -#define ISA_CMP 0x0040 /* cmp Rsrc1, Rsrc2 */ -#define ISA_CMPEQ 0x0060 /* cmpeq Rsrc1, Rsrc2 */ -#define ISA_CMPU 0x0050 /* cmpu Rsrc1, Rsrc2 */ -#define ISA_CMPZ 0x0070 /* cmpz Rsrc */ -#define ISA_LDI 0x6000 /* ldi Rdest, #imm8 */ -#define ISA_MV 0x1080 /* mv Rdest, Rsrc */ -#define ISA_NEG 0x0030 /* neg Rdest, Rsrc */ -#define ISA_NOP 0x7000 /* nop */ -#define ISA_NOT 0x00b0 /* not Rdest, Rsrc */ -#define ISA_OR 0x00e0 /* or Rdest, Rsrc */ -#define ISA_SUB 0x0020 /* sub Rdest, Rsrc */ -#define ISA_SUBX 0x0010 /* subx Rdest, Rsrc */ -#define ISA_XOR 0x00d0 /* xor Rdest, Rsrc */ - -/* -S instruction */ -#define ISA_MUL 0x1060 /* mul Rdest, Rsrc */ -#define ISA_MULLO_A0 0x3010 /* mullo Rsrc1, Rsrc2, A0 */ -#define ISA_MULLO_A1 0x3090 /* mullo Rsrc1, Rsrc2, A1 */ -#define ISA_MVFACMI_A0 0x50f2 /* mvfacmi Rdest, A0 */ -#define ISA_MVFACMI_A1 0x50f6 /* mvfacmi Rdest, A1 */ - -static int emu_addi(unsigned short insn, struct pt_regs *regs) -{ - char imm = (char)(insn & 0xff); - int dest = REG1(insn); - int val; - - val = get_reg(regs, dest); - val += imm; - set_reg(regs, dest, val); - - return 0; -} - -static int emu_ldi(unsigned short insn, struct pt_regs *regs) -{ - char imm = (char)(insn & 0xff); - - set_reg(regs, REG1(insn), (int)imm); - - return 0; -} - -static int emu_add(unsigned short insn, struct pt_regs *regs) -{ - int dest = REG1(insn); - int src = REG2(insn); - int val; - - val = get_reg(regs, dest); - val += get_reg(regs, src); - set_reg(regs, dest, val); - - return 0; -} - -static int emu_addx(unsigned short insn, struct pt_regs *regs) -{ - int dest = REG1(insn); - unsigned int val, tmp; - - val = regs->psw & PSW_BC ? 1 : 0; - tmp = get_reg(regs, dest); - val += tmp; - val += (unsigned int)get_reg(regs, REG2(insn)); - set_reg(regs, dest, val); - - /* C bit set */ - if (val < tmp) - regs->psw |= PSW_BC; - else - regs->psw &= ~(PSW_BC); - - return 0; -} - -static int emu_and(unsigned short insn, struct pt_regs *regs) -{ - int dest = REG1(insn); - int val; - - val = get_reg(regs, dest); - val &= get_reg(regs, REG2(insn)); - set_reg(regs, dest, val); - - return 0; -} - -static int emu_cmp(unsigned short insn, struct pt_regs *regs) -{ - if (get_reg(regs, REG1(insn)) < get_reg(regs, REG2(insn))) - regs->psw |= PSW_BC; - else - regs->psw &= ~(PSW_BC); - - return 0; -} - -static int emu_cmpeq(unsigned short insn, struct pt_regs *regs) -{ - if (get_reg(regs, REG1(insn)) == get_reg(regs, REG2(insn))) - regs->psw |= PSW_BC; - else - regs->psw &= ~(PSW_BC); - - return 0; -} - -static int emu_cmpu(unsigned short insn, struct pt_regs *regs) -{ - if ((unsigned int)get_reg(regs, REG1(insn)) - < (unsigned int)get_reg(regs, REG2(insn))) - regs->psw |= PSW_BC; - else - regs->psw &= ~(PSW_BC); - - return 0; -} - -static int emu_cmpz(unsigned short insn, struct pt_regs *regs) -{ - if (!get_reg(regs, REG2(insn))) - regs->psw |= PSW_BC; - else - regs->psw &= ~(PSW_BC); - - return 0; -} - -static int emu_mv(unsigned short insn, struct pt_regs *regs) -{ - int val; - - val = get_reg(regs, REG2(insn)); - set_reg(regs, REG1(insn), val); - - return 0; -} - -static int emu_neg(unsigned short insn, struct pt_regs *regs) -{ - int val; - - val = get_reg(regs, REG2(insn)); - set_reg(regs, REG1(insn), 0 - val); - - return 0; -} - -static int emu_not(unsigned short insn, struct pt_regs *regs) -{ - int val; - - val = get_reg(regs, REG2(insn)); - set_reg(regs, REG1(insn), ~val); - - return 0; -} - -static int emu_or(unsigned short insn, struct pt_regs *regs) -{ - int dest = REG1(insn); - int val; - - val = get_reg(regs, dest); - val |= get_reg(regs, REG2(insn)); - set_reg(regs, dest, val); - - return 0; -} - -static int emu_sub(unsigned short insn, struct pt_regs *regs) -{ - int dest = REG1(insn); - int val; - - val = get_reg(regs, dest); - val -= get_reg(regs, REG2(insn)); - set_reg(regs, dest, val); - - return 0; -} - -static int emu_subx(unsigned short insn, struct pt_regs *regs) -{ - int dest = REG1(insn); - unsigned int val, tmp; - - val = tmp = get_reg(regs, dest); - val -= (unsigned int)get_reg(regs, REG2(insn)); - val -= regs->psw & PSW_BC ? 1 : 0; - set_reg(regs, dest, val); - - /* C bit set */ - if (val > tmp) - regs->psw |= PSW_BC; - else - regs->psw &= ~(PSW_BC); - - return 0; -} - -static int emu_xor(unsigned short insn, struct pt_regs *regs) -{ - int dest = REG1(insn); - unsigned int val; - - val = (unsigned int)get_reg(regs, dest); - val ^= (unsigned int)get_reg(regs, REG2(insn)); - set_reg(regs, dest, val); - - return 0; -} - -static int emu_mul(unsigned short insn, struct pt_regs *regs) -{ - int dest = REG1(insn); - int reg1, reg2; - - reg1 = get_reg(regs, dest); - reg2 = get_reg(regs, REG2(insn)); - - __asm__ __volatile__ ( - "mul %0, %1; \n\t" - : "+r" (reg1) : "r" (reg2) - ); - - set_reg(regs, dest, reg1); - - return 0; -} - -static int emu_mullo_a0(unsigned short insn, struct pt_regs *regs) -{ - int reg1, reg2; - - reg1 = get_reg(regs, REG1(insn)); - reg2 = get_reg(regs, REG2(insn)); - - __asm__ __volatile__ ( - "mullo %0, %1, a0; \n\t" - "mvfachi %0, a0; \n\t" - "mvfaclo %1, a0; \n\t" - : "+r" (reg1), "+r" (reg2) - ); - - regs->acc0h = reg1; - regs->acc0l = reg2; - - return 0; -} - -static int emu_mullo_a1(unsigned short insn, struct pt_regs *regs) -{ - int reg1, reg2; - - reg1 = get_reg(regs, REG1(insn)); - reg2 = get_reg(regs, REG2(insn)); - - __asm__ __volatile__ ( - "mullo %0, %1, a0; \n\t" - "mvfachi %0, a0; \n\t" - "mvfaclo %1, a0; \n\t" - : "+r" (reg1), "+r" (reg2) - ); - - regs->acc1h = reg1; - regs->acc1l = reg2; - - return 0; -} - -static int emu_mvfacmi_a0(unsigned short insn, struct pt_regs *regs) -{ - unsigned long val; - - val = (regs->acc0h << 16) | (regs->acc0l >> 16); - set_reg(regs, REG1(insn), (int)val); - - return 0; -} - -static int emu_mvfacmi_a1(unsigned short insn, struct pt_regs *regs) -{ - unsigned long val; - - val = (regs->acc1h << 16) | (regs->acc1l >> 16); - set_reg(regs, REG1(insn), (int)val); - - return 0; -} - -static int emu_m32r2(unsigned short insn, struct pt_regs *regs) -{ - int res = -1; - - if ((insn & 0x7fff) == ISA_NOP) /* nop */ - return 0; - - switch(insn & 0x7000) { - case ISA_ADDI: /* addi Rdest, #imm8 */ - res = emu_addi(insn, regs); - break; - case ISA_LDI: /* ldi Rdest, #imm8 */ - res = emu_ldi(insn, regs); - break; - default: - break; - } - - if (!res) - return 0; - - switch(insn & 0x70f0) { - case ISA_ADD: /* add Rdest, Rsrc */ - res = emu_add(insn, regs); - break; - case ISA_ADDX: /* addx Rdest, Rsrc */ - res = emu_addx(insn, regs); - break; - case ISA_AND: /* and Rdest, Rsrc */ - res = emu_and(insn, regs); - break; - case ISA_CMP: /* cmp Rsrc1, Rsrc2 */ - res = emu_cmp(insn, regs); - break; - case ISA_CMPEQ: /* cmpeq Rsrc1, Rsrc2 */ - res = emu_cmpeq(insn, regs); - break; - case ISA_CMPU: /* cmpu Rsrc1, Rsrc2 */ - res = emu_cmpu(insn, regs); - break; - case ISA_CMPZ: /* cmpz Rsrc */ - res = emu_cmpz(insn, regs); - break; - case ISA_MV: /* mv Rdest, Rsrc */ - res = emu_mv(insn, regs); - break; - case ISA_NEG: /* neg Rdest, Rsrc */ - res = emu_neg(insn, regs); - break; - case ISA_NOT: /* not Rdest, Rsrc */ - res = emu_not(insn, regs); - break; - case ISA_OR: /* or Rdest, Rsrc */ - res = emu_or(insn, regs); - break; - case ISA_SUB: /* sub Rdest, Rsrc */ - res = emu_sub(insn, regs); - break; - case ISA_SUBX: /* subx Rdest, Rsrc */ - res = emu_subx(insn, regs); - break; - case ISA_XOR: /* xor Rdest, Rsrc */ - res = emu_xor(insn, regs); - break; - case ISA_MUL: /* mul Rdest, Rsrc */ - res = emu_mul(insn, regs); - break; - case ISA_MULLO_A0: /* mullo Rsrc1, Rsrc2 */ - res = emu_mullo_a0(insn, regs); - break; - case ISA_MULLO_A1: /* mullo Rsrc1, Rsrc2 */ - res = emu_mullo_a1(insn, regs); - break; - default: - break; - } - - if (!res) - return 0; - - switch(insn & 0x70ff) { - case ISA_MVFACMI_A0: /* mvfacmi Rdest */ - res = emu_mvfacmi_a0(insn, regs); - break; - case ISA_MVFACMI_A1: /* mvfacmi Rdest */ - res = emu_mvfacmi_a1(insn, regs); - break; - default: - break; - } - - return res; -} - -#endif /* CONFIG_ISA_DUAL_ISSUE */ - -/* - * ld : ?010 dest 1100 src - * 0010 dest 1110 src : ld Rdest, @Rsrc+ - * ldh : ?010 dest 1010 src - * lduh : ?010 dest 1011 src - * st : ?010 src1 0100 src2 - * 0010 src1 0110 src2 : st Rsrc1, @+Rsrc2 - * 0010 src1 0111 src2 : st Rsrc1, @-Rsrc2 - * sth : ?010 src1 0010 src2 - */ - -static int insn_check(unsigned long insn, struct pt_regs *regs, - unsigned char **ucp) -{ - int res = 0; - - /* - * 32bit insn - * ld Rdest, @(disp16, Rsrc) - * st Rdest, @(disp16, Rsrc) - */ - if (insn & 0x80000000) { /* 32bit insn */ - *ucp += (short)(insn & 0x0000ffff); - regs->bpc += 4; - } else { /* 16bit insn */ -#ifdef CONFIG_ISA_DUAL_ISSUE - /* parallel exec check */ - if (!(regs->bpc & 0x2) && insn & 0x8000) { - res = emu_m32r2((unsigned short)insn, regs); - regs->bpc += 4; - } else -#endif /* CONFIG_ISA_DUAL_ISSUE */ - regs->bpc += 2; - } - - return res; -} - -static int emu_ld(unsigned long insn32, struct pt_regs *regs) -{ - unsigned char *ucp; - unsigned long val; - unsigned short insn16; - int size, src; - - insn16 = insn32 >> 16; - src = REG2(insn16); - ucp = (unsigned char *)get_reg(regs, src); - - if (insn_check(insn32, regs, &ucp)) - return -1; - - size = insn16 & 0x0040 ? 4 : 2; - if (copy_from_user(&val, ucp, size)) - return -1; - - if (size == 2) - val >>= 16; - - /* ldh sign check */ - if ((insn16 & 0x00f0) == 0x00a0 && (val & 0x8000)) - val |= 0xffff0000; - - set_reg(regs, REG1(insn16), val); - - /* ld increment check */ - if ((insn16 & 0xf0f0) == ISA_LD2) /* ld Rdest, @Rsrc+ */ - set_reg(regs, src, (unsigned long)(ucp + 4)); - - return 0; -} - -static int emu_st(unsigned long insn32, struct pt_regs *regs) -{ - unsigned char *ucp; - unsigned long val; - unsigned short insn16; - int size, src2; - - insn16 = insn32 >> 16; - src2 = REG2(insn16); - - ucp = (unsigned char *)get_reg(regs, src2); - - if (insn_check(insn32, regs, &ucp)) - return -1; - - size = insn16 & 0x0040 ? 4 : 2; - val = get_reg(regs, REG1(insn16)); - if (size == 2) - val <<= 16; - - /* st inc/dec check */ - if ((insn16 & 0xf0e0) == 0x2060) { - if (insn16 & 0x0010) - ucp -= 4; - else - ucp += 4; - - set_reg(regs, src2, (unsigned long)ucp); - } - - if (copy_to_user(ucp, &val, size)) - return -1; - - /* sth inc check */ - if ((insn16 & 0xf0f0) == ISA_STH2) { - ucp += 2; - set_reg(regs, src2, (unsigned long)ucp); - } - - return 0; -} - -int handle_unaligned_access(unsigned long insn32, struct pt_regs *regs) -{ - unsigned short insn16; - int res; - - insn16 = insn32 >> 16; - - /* ld or st check */ - if ((insn16 & 0x7000) != 0x2000) - return -1; - - /* insn alignment check */ - if ((insn16 & 0x8000) && (regs->bpc & 3)) - return -1; - - if (insn16 & 0x0080) /* ld */ - res = emu_ld(insn32, regs); - else /* st */ - res = emu_st(insn32, regs); - - return res; -} - diff --git a/arch/m32r/kernel/asm-offsets.c b/arch/m32r/kernel/asm-offsets.c deleted file mode 100644 index 7cb90b459e07..000000000000 --- a/arch/m32r/kernel/asm-offsets.c +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include - -int foo(void) -{ - OFFSET(TI_TASK, thread_info, task); - OFFSET(TI_FLAGS, thread_info, flags); - OFFSET(TI_STATUS, thread_info, status); - OFFSET(TI_CPU, thread_info, cpu); - OFFSET(TI_PRE_COUNT, thread_info, preempt_count); - OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); - - return 0; -} diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S deleted file mode 100644 index bbf48f2aa2a7..000000000000 --- a/arch/m32r/kernel/entry.S +++ /dev/null @@ -1,553 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/kernel/entry.S - * - * Copyright (c) 2001, 2002 Hirokazu Takata, Hitoshi Yamamoto, H. Kondo - * Copyright (c) 2003 Hitoshi Yamamoto - * Copyright (c) 2004 Hirokazu Takata - * - * Taken from i386 version. - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -/* - * entry.S contains the system-call and fault low-level handling routines. - * This also contains the timer-interrupt handler, as well as all interrupts - * and faults that can result in a task-switch. - * - * NOTE: This code handles signal-recognition, which happens every time - * after a timer-interrupt and after each system call. - * - * Stack layout in 'ret_from_system_call': - * ptrace needs to have all regs on the stack. - * if the order here is changed, it needs to be - * updated in fork.c:copy_thread, signal.c:do_signal, - * ptrace.c and ptrace.h - * - * M32R/M32Rx/M32R2 - * @(sp) - r4 - * @(0x04,sp) - r5 - * @(0x08,sp) - r6 - * @(0x0c,sp) - *pt_regs - * @(0x10,sp) - r0 - * @(0x14,sp) - r1 - * @(0x18,sp) - r2 - * @(0x1c,sp) - r3 - * @(0x20,sp) - r7 - * @(0x24,sp) - r8 - * @(0x28,sp) - r9 - * @(0x2c,sp) - r10 - * @(0x30,sp) - r11 - * @(0x34,sp) - r12 - * @(0x38,sp) - syscall_nr - * @(0x3c,sp) - acc0h - * @(0x40,sp) - acc0l - * @(0x44,sp) - acc1h ; ISA_DSP_LEVEL2 only - * @(0x48,sp) - acc1l ; ISA_DSP_LEVEL2 only - * @(0x4c,sp) - psw - * @(0x50,sp) - bpc - * @(0x54,sp) - bbpsw - * @(0x58,sp) - bbpc - * @(0x5c,sp) - spu (cr3) - * @(0x60,sp) - fp (r13) - * @(0x64,sp) - lr (r14) - * @(0x68,sp) - spi (cr2) - * @(0x6c,sp) - orig_r0 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if !defined(CONFIG_MMU) -#define sys_madvise sys_ni_syscall -#define sys_readahead sys_ni_syscall -#define sys_mprotect sys_ni_syscall -#define sys_msync sys_ni_syscall -#define sys_mlock sys_ni_syscall -#define sys_munlock sys_ni_syscall -#define sys_mlockall sys_ni_syscall -#define sys_munlockall sys_ni_syscall -#define sys_mremap sys_ni_syscall -#define sys_mincore sys_ni_syscall -#define sys_remap_file_pages sys_ni_syscall -#endif /* CONFIG_MMU */ - -#define R4(reg) @reg -#define R5(reg) @(0x04,reg) -#define R6(reg) @(0x08,reg) -#define PTREGS(reg) @(0x0C,reg) -#define R0(reg) @(0x10,reg) -#define R1(reg) @(0x14,reg) -#define R2(reg) @(0x18,reg) -#define R3(reg) @(0x1C,reg) -#define R7(reg) @(0x20,reg) -#define R8(reg) @(0x24,reg) -#define R9(reg) @(0x28,reg) -#define R10(reg) @(0x2C,reg) -#define R11(reg) @(0x30,reg) -#define R12(reg) @(0x34,reg) -#define SYSCALL_NR(reg) @(0x38,reg) -#define ACC0H(reg) @(0x3C,reg) -#define ACC0L(reg) @(0x40,reg) -#define ACC1H(reg) @(0x44,reg) -#define ACC1L(reg) @(0x48,reg) -#define PSW(reg) @(0x4C,reg) -#define BPC(reg) @(0x50,reg) -#define BBPSW(reg) @(0x54,reg) -#define BBPC(reg) @(0x58,reg) -#define SPU(reg) @(0x5C,reg) -#define FP(reg) @(0x60,reg) /* FP = R13 */ -#define LR(reg) @(0x64,reg) -#define SP(reg) @(0x68,reg) -#define ORIG_R0(reg) @(0x6C,reg) - -#define nr_syscalls ((syscall_table_size)/4) - -#ifdef CONFIG_PREEMPT -#define preempt_stop(x) DISABLE_INTERRUPTS(x) -#else -#define preempt_stop(x) -#define resume_kernel restore_all -#endif - -/* how to get the thread information struct from ASM */ -#define GET_THREAD_INFO(reg) GET_THREAD_INFO reg - .macro GET_THREAD_INFO reg - ldi \reg, #-THREAD_SIZE - and \reg, sp - .endm - -ENTRY(ret_from_kernel_thread) - pop r0 - bl schedule_tail - GET_THREAD_INFO(r8) - ld r0, R0(r8) - ld r1, R1(r8) - jl r1 - bra syscall_exit - -ENTRY(ret_from_fork) - pop r0 - bl schedule_tail - GET_THREAD_INFO(r8) - bra syscall_exit - -/* - * Return to user mode is not as complex as all this looks, - * but we want the default path for a system call return to - * go as quickly as possible which is why some of this is - * less clear than it otherwise should be. - */ - - ; userspace resumption stub bypassing syscall exit tracing - ALIGN -ret_from_exception: - preempt_stop(r4) -ret_from_intr: - ld r4, PSW(sp) -#ifdef CONFIG_ISA_M32R2 - and3 r4, r4, #0x8800 ; check BSM and BPM bits -#else - and3 r4, r4, #0x8000 ; check BSM bit -#endif - beqz r4, resume_kernel -resume_userspace: - DISABLE_INTERRUPTS(r4) ; make sure we don't miss an interrupt - ; setting need_resched or sigpending - ; between sampling and the iret - GET_THREAD_INFO(r8) - ld r9, @(TI_FLAGS, r8) - and3 r4, r9, #_TIF_WORK_MASK ; is there any work to be done on - ; int/exception return? - bnez r4, work_pending - bra restore_all - -#ifdef CONFIG_PREEMPT -ENTRY(resume_kernel) - GET_THREAD_INFO(r8) - ld r9, @(TI_PRE_COUNT, r8) ; non-zero preempt_count ? - bnez r9, restore_all -need_resched: - ld r9, @(TI_FLAGS, r8) ; need_resched set ? - and3 r4, r9, #_TIF_NEED_RESCHED - beqz r4, restore_all - ld r4, PSW(sp) ; interrupts off (exception path) ? - and3 r4, r4, #0x4000 - beqz r4, restore_all - bl preempt_schedule_irq - bra need_resched -#endif - - ; system call handler stub -ENTRY(system_call) - SWITCH_TO_KERNEL_STACK - SAVE_ALL - ENABLE_INTERRUPTS(r4) ; Enable interrupt - st sp, PTREGS(sp) ; implicit pt_regs parameter - cmpui r7, #NR_syscalls - bnc syscall_badsys - st r7, SYSCALL_NR(sp) ; syscall_nr - ; system call tracing in operation - GET_THREAD_INFO(r8) - ld r9, @(TI_FLAGS, r8) - and3 r4, r9, #_TIF_SYSCALL_TRACE - bnez r4, syscall_trace_entry -syscall_call: - slli r7, #2 ; table jump for the system call - LDIMM (r4, sys_call_table) - add r7, r4 - ld r7, @r7 - jl r7 ; execute system call - st r0, R0(sp) ; save the return value -syscall_exit: - DISABLE_INTERRUPTS(r4) ; make sure we don't miss an interrupt - ; setting need_resched or sigpending - ; between sampling and the iret - ld r9, @(TI_FLAGS, r8) - and3 r4, r9, #_TIF_ALLWORK_MASK ; current->work - bnez r4, syscall_exit_work -restore_all: - RESTORE_ALL - - # perform work that needs to be done immediately before resumption - # r9 : flags - ALIGN -work_pending: - and3 r4, r9, #_TIF_NEED_RESCHED - beqz r4, work_notifysig -work_resched: - bl schedule - DISABLE_INTERRUPTS(r4) ; make sure we don't miss an interrupt - ; setting need_resched or sigpending - ; between sampling and the iret - ld r9, @(TI_FLAGS, r8) - and3 r4, r9, #_TIF_WORK_MASK ; is there any work to be done other - ; than syscall tracing? - beqz r4, restore_all - and3 r4, r4, #_TIF_NEED_RESCHED - bnez r4, work_resched - -work_notifysig: ; deal with pending signals and - ; notify-resume requests - mv r0, sp ; arg1 : struct pt_regs *regs - mv r1, r9 ; arg2 : __u32 thread_info_flags - bl do_notify_resume - bra resume_userspace - - ; perform syscall exit tracing - ALIGN -syscall_trace_entry: - ldi r4, #-ENOSYS - st r4, R0(sp) - bl do_syscall_trace - ld r0, ORIG_R0(sp) - ld r1, R1(sp) - ld r2, R2(sp) - ld r3, R3(sp) - ld r4, R4(sp) - ld r5, R5(sp) - ld r6, R6(sp) - ld r7, SYSCALL_NR(sp) - cmpui r7, #NR_syscalls - bc syscall_call - bra syscall_exit - - ; perform syscall exit tracing - ALIGN -syscall_exit_work: - ld r9, @(TI_FLAGS, r8) - and3 r4, r9, #_TIF_SYSCALL_TRACE - beqz r4, work_pending - ENABLE_INTERRUPTS(r4) ; could let do_syscall_trace() call - ; schedule() instead - bl do_syscall_trace - bra resume_userspace - - ALIGN -syscall_fault: - SAVE_ALL - GET_THREAD_INFO(r8) - ldi r4, #-EFAULT - st r4, R0(sp) - bra resume_userspace - - ALIGN -syscall_badsys: - ldi r4, #-ENOSYS - st r4, R0(sp) - bra resume_userspace - - .global eit_vector - - .equ ei_vec_table, eit_vector + 0x0200 - -/* - * EI handler routine - */ -ENTRY(ei_handler) -#if defined(CONFIG_CHIP_M32700) - ; WORKAROUND: force to clear SM bit and use the kernel stack (SPI). - SWITCH_TO_KERNEL_STACK -#endif - SAVE_ALL - mv r1, sp ; arg1(regs) - ; get ICU status - seth r0, #shigh(M32R_ICU_ISTS_ADDR) - ld r0, @(low(M32R_ICU_ISTS_ADDR),r0) - push r0 -#if defined(CONFIG_SMP) - /* - * If IRQ == 0 --> Nothing to do, Not write IMASK - * If IRQ == IPI --> Do IPI handler, Not write IMASK - * If IRQ != 0, IPI --> Do do_IRQ(), Write IMASK - */ - slli r0, #4 - srli r0, #24 ; r0(irq_num<<2) - ;; IRQ exist check -#if defined(CONFIG_CHIP_M32700) - /* WORKAROUND: IMASK bug M32700-TS1, TS2 chip. */ - bnez r0, 0f - ld24 r14, #0x00070000 - seth r0, #shigh(M32R_ICU_IMASK_ADDR) - st r14, @(low(M32R_ICU_IMASK_ADDR),r0) - bra 1f - .fillinsn -0: -#endif /* CONFIG_CHIP_M32700 */ - beqz r0, 1f ; if (!irq_num) goto exit - ;; IPI check - cmpi r0, #(M32R_IRQ_IPI0<<2) ; ISN < IPI0 check - bc 2f - cmpi r0, #((M32R_IRQ_IPI7+1)<<2) ; ISN > IPI7 check - bnc 2f - LDIMM (r2, ei_vec_table) - add r2, r0 - ld r2, @r2 - beqz r2, 1f ; if (no IPI handler) goto exit - mv r0, r1 ; arg0(regs) - jl r2 - .fillinsn -1: - addi sp, #4 - bra restore_all - .fillinsn -2: - srli r0, #2 -#else /* not CONFIG_SMP */ - srli r0, #22 ; r0(irq) -#endif /* not CONFIG_SMP */ - -#if defined(CONFIG_PLAT_HAS_INT1ICU) - add3 r2, r0, #-(M32R_IRQ_INT1) ; INT1# interrupt - bnez r2, 3f - seth r0, #shigh(M32R_INT1ICU_ISTS) - lduh r0, @(low(M32R_INT1ICU_ISTS),r0) ; bit10-6 : ISN - slli r0, #21 - srli r0, #27 ; ISN - addi r0, #(M32R_INT1ICU_IRQ_BASE) - bra check_end - .fillinsn -3: -#endif /* CONFIG_PLAT_HAS_INT1ICU */ -#if defined(CONFIG_PLAT_HAS_INT0ICU) - add3 r2, r0, #-(M32R_IRQ_INT0) ; INT0# interrupt - bnez r2, 4f - seth r0, #shigh(M32R_INT0ICU_ISTS) - lduh r0, @(low(M32R_INT0ICU_ISTS),r0) ; bit10-6 : ISN - slli r0, #21 - srli r0, #27 ; ISN - add3 r0, r0, #(M32R_INT0ICU_IRQ_BASE) - bra check_end - .fillinsn -4: -#endif /* CONFIG_PLAT_HAS_INT0ICU */ -#if defined(CONFIG_PLAT_HAS_INT2ICU) - add3 r2, r0, #-(M32R_IRQ_INT2) ; INT2# interrupt - bnez r2, 5f - seth r0, #shigh(M32R_INT2ICU_ISTS) - lduh r0, @(low(M32R_INT2ICU_ISTS),r0) ; bit10-6 : ISN - slli r0, #21 - srli r0, #27 ; ISN - add3 r0, r0, #(M32R_INT2ICU_IRQ_BASE) - ; bra check_end - .fillinsn -5: -#endif /* CONFIG_PLAT_HAS_INT2ICU */ - -check_end: - bl do_IRQ - pop r14 - seth r0, #shigh(M32R_ICU_IMASK_ADDR) - st r14, @(low(M32R_ICU_IMASK_ADDR),r0) - bra ret_from_intr - -/* - * Default EIT handler - */ - ALIGN -int_msg: - .asciz "Unknown interrupt\n" - .byte 0 - -ENTRY(default_eit_handler) - push r0 - mvfc r0, psw - push r1 - push r2 - push r3 - push r0 - LDIMM (r0, __KERNEL_DS) - mv r0, r1 - mv r0, r2 - LDIMM (r0, int_msg) - bl printk - pop r0 - pop r3 - pop r2 - pop r1 - mvtc r0, psw - pop r0 -infinit: - bra infinit - -#ifdef CONFIG_MMU -/* - * Access Exception handler - */ -ENTRY(ace_handler) - SWITCH_TO_KERNEL_STACK - SAVE_ALL - - seth r2, #shigh(MMU_REG_BASE) /* Check status register */ - ld r4, @(low(MESTS_offset),r2) - st r4, @(low(MESTS_offset),r2) - srl3 r1, r4, #4 -#ifdef CONFIG_CHIP_M32700 - and3 r1, r1, #0x0000ffff - ; WORKAROUND: ignore TME bit for the M32700(TS1). -#endif /* CONFIG_CHIP_M32700 */ - beqz r1, inst -oprand: - ld r2, @(low(MDEVA_offset),r2) ; set address - srli r1, #1 - bra 1f -inst: - and3 r1, r4, #2 - srli r1, #1 - or3 r1, r1, #8 - mvfc r2, bpc ; set address - .fillinsn -1: - mvfc r3, psw - mv r0, sp - and3 r3, r3, 0x800 - srli r3, #9 - or r1, r3 - /* - * do_page_fault(): - * r0 : struct pt_regs *regs - * r1 : unsigned long error-code - * r2 : unsigned long address - * error-code: - * +------+------+------+------+ - * | bit3 | bit2 | bit1 | bit0 | - * +------+------+------+------+ - * bit 3 == 0:means data, 1:means instruction - * bit 2 == 0:means kernel, 1:means user-mode - * bit 1 == 0:means read, 1:means write - * bit 0 == 0:means no page found 1:means protection fault - * - */ - bl do_page_fault - bra ret_from_intr -#endif /* CONFIG_MMU */ - - -ENTRY(alignment_check) - /* void alignment_check(int error_code) */ - SWITCH_TO_KERNEL_STACK - SAVE_ALL - ldi r1, #0x30 ; error_code - mv r0, sp ; pt_regs - bl do_alignment_check -error_code: - bra ret_from_exception - -ENTRY(rie_handler) - /* void rie_handler(int error_code) */ - SWITCH_TO_KERNEL_STACK - SAVE_ALL - ldi r1, #0x20 ; error_code - mv r0, sp ; pt_regs - bl do_rie_handler - bra error_code - -ENTRY(pie_handler) - /* void pie_handler(int error_code) */ - SWITCH_TO_KERNEL_STACK - SAVE_ALL - ldi r1, #0 ; error_code ; FIXME - mv r0, sp ; pt_regs - bl do_pie_handler - bra error_code - -ENTRY(debug_trap) - /* void debug_trap(void) */ - .global withdraw_debug_trap - SWITCH_TO_KERNEL_STACK - SAVE_ALL - mv r0, sp ; pt_regs - bl withdraw_debug_trap - ldi r1, #0 ; error_code - mv r0, sp ; pt_regs - bl do_debug_trap - bra error_code - -ENTRY(ill_trap) - /* void ill_trap(void) */ - SWITCH_TO_KERNEL_STACK - SAVE_ALL - ldi r1, #0 ; error_code ; FIXME - mv r0, sp ; pt_regs - bl do_ill_trap - bra error_code - -ENTRY(cache_flushing_handler) - /* void _flush_cache_all(void); */ - .global _flush_cache_all - SWITCH_TO_KERNEL_STACK - push r0 - push r1 - push r2 - push r3 - push r4 - push r5 - push r6 - push r7 - push lr - bl _flush_cache_all - pop lr - pop r7 - pop r6 - pop r5 - pop r4 - pop r3 - pop r2 - pop r1 - pop r0 - rte - - .section .rodata,"a" -#include "syscall_table.S" - -syscall_table_size=(.-sys_call_table) diff --git a/arch/m32r/kernel/head.S b/arch/m32r/kernel/head.S deleted file mode 100644 index 1f040973df1c..000000000000 --- a/arch/m32r/kernel/head.S +++ /dev/null @@ -1,284 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/kernel/head.S - * - * M32R startup code. - * - * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto - */ - -#include -__INIT -__INITDATA - - .text -#include -#include -#include -#include -#include -#include -#include - -/* - * References to members of the boot_cpu_data structure. - */ -__HEAD - .global start_kernel - .global __bss_start - .global _end -ENTRY(stext) -ENTRY(_stext) - /* Setup up the stack pointer */ - LDIMM (r0, spi_stack_top) - LDIMM (r1, spu_stack_top) - mvtc r0, spi - mvtc r1, spu - - /* Initilalize PSW */ - ldi r0, #0x0000 /* use SPI, disable EI */ - mvtc r0, psw - - /* Set up the stack pointer */ - LDIMM (r0, stack_start) - ld r0, @r0 - mvtc r0, spi - -/* - * Clear BSS first so that there are no surprises... - */ -#ifdef CONFIG_ISA_DUAL_ISSUE - - LDIMM (r2, __bss_start) - LDIMM (r3, _end) - sub r3, r2 ; BSS size in bytes - ; R4 = BSS size in longwords (rounded down) - mv r4, r3 || ldi r1, #0 - srli r4, #4 || addi r2, #-4 - beqz r4, .Lendloop1 -.Lloop1: -#ifndef CONFIG_CHIP_M32310 - ; Touch memory for the no-write-allocating cache. - ld r0, @(4,r2) -#endif - st r1, @+r2 || addi r4, #-1 - st r1, @+r2 - st r1, @+r2 - st r1, @+r2 || cmpeq r1, r4 ; R4 = 0? - bnc .Lloop1 -.Lendloop1: - and3 r4, r3, #15 - addi r2, #4 - beqz r4, .Lendloop2 -.Lloop2: - stb r1, @r2 || addi r4, #-1 - addi r2, #1 - bnez r4, .Lloop2 -.Lendloop2: - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - - LDIMM (r2, __bss_start) - LDIMM (r3, _end) - sub r3, r2 ; BSS size in bytes - mv r4, r3 - srli r4, #2 ; R4 = BSS size in longwords (rounded down) - ldi r1, #0 ; clear R1 for longwords store - addi r2, #-4 ; account for pre-inc store - beqz r4, .Lendloop1 ; any more to go? -.Lloop1: - st r1, @+r2 ; yep, zero out another longword - addi r4, #-1 ; decrement count - bnez r4, .Lloop1 ; go do some more -.Lendloop1: - and3 r4, r3, #3 ; get no. of remaining BSS bytes to clear - addi r2, #4 ; account for pre-inc store - beqz r4, .Lendloop2 ; any more to go? -.Lloop2: - stb r1, @r2 ; yep, zero out another byte - addi r2, #1 ; bump address - addi r4, #-1 ; decrement count - bnez r4, .Lloop2 ; go do some more -.Lendloop2: - -#endif /* not CONFIG_ISA_DUAL_ISSUE */ - -#if 0 /* M32R_FIXME */ -/* - * Copy data segment from ROM to RAM. - */ - .global ROM_D, TOP_DATA, END_DATA - - LDIMM (r1, ROM_D) - LDIMM (r2, TOP_DATA) - LDIMM (r3, END_DATA) - addi r2, #-4 - addi r3, #-4 -loop1: - ld r0, @r1+ - st r0, @+r2 - cmp r2, r3 - bc loop1 -#endif /* 0 */ - -/* Jump to kernel */ - LDIMM (r2, start_kernel) - jl r2 - .fillinsn -1: - bra 1b ; main should never return here, but - ; just in case, we know what happens. - -#ifdef CONFIG_SMP -/* - * AP startup routine - */ - .global eit_vector -ENTRY(startup_AP) -;; setup EVB - LDIMM (r4, eit_vector) - mvtc r4, cr5 - -;; enable MMU - LDIMM (r2, init_tlb) - jl r2 - seth r4, #high(MATM) - or3 r4, r4, #low(MATM) - ldi r5, #0x01 - st r5, @r4 ; Set MATM Reg(T bit ON) - ld r6, @r4 ; MATM Check - LDIMM (r5, 1f) - jmp r5 ; enable MMU - nop - .fillinsn -1: -;; ISN check - ld r6, @r4 ; MATM Check - seth r4, #high(M32R_ICU_ISTS_ADDR) - or3 r4, r4, #low(M32R_ICU_ISTS_ADDR) - ld r5, @r4 ; Read ISTSi reg. - mv r6, r5 - slli r5, #13 ; PIML check - srli r5, #13 ; - seth r4, #high(M32R_ICU_IMASK_ADDR) - or3 r4, r4, #low(M32R_ICU_IMASK_ADDR) - st r5, @r4 ; Write IMASKi reg. - slli r6, #4 ; ISN check - srli r6, #26 ; - seth r4, #high(M32R_IRQ_IPI5) - or3 r4, r4, #low(M32R_IRQ_IPI5) - bne r4, r6, 2f ; if (ISN != CPU_BOOT_IPI) goto sleep; - -;; check cpu_bootout_map and set cpu_bootin_map - LDIMM (r4, cpu_bootout_map) - ld r4, @r4 - seth r5, #high(M32R_CPUID_PORTL) - or3 r5, r5, #low(M32R_CPUID_PORTL) - ld r5, @r5 - ldi r6, #1 - sll r6, r5 - and r4, r6 - beqz r4, 2f - LDIMM (r4, cpu_bootin_map) - ld r5, @r4 - or r5, r6 - st r6, @r4 - -;; clear PSW - ldi r4, #0 - mvtc r4, psw - -;; setup SPI - LDIMM (r4, stack_start) - ld r4, @r4 - mvtc r4, spi - -;; setup BPC (start_secondary) - LDIMM (r4, start_secondary) - mvtc r4, bpc - - rte ; goto startup_secondary - nop - nop - - .fillinsn -2: - ;; disable MMU - seth r4, #high(MATM) - or3 r4, r4, #low(MATM) - ldi r5, #0 - st r5, @r4 ; Set MATM Reg(T bit OFF) - ld r6, @r4 ; MATM Check - LDIMM (r4, 3f) - seth r5, #high(__PAGE_OFFSET) - or3 r5, r5, #low(__PAGE_OFFSET) - not r5, r5 - and r4, r5 - jmp r4 ; disable MMU - nop - .fillinsn -3: - ;; SLEEP and wait IPI - LDIMM (r4, AP_loop) - seth r5, #high(__PAGE_OFFSET) - or3 r5, r5, #low(__PAGE_OFFSET) - not r5, r5 - and r4, r5 - jmp r4 - nop - nop -#endif /* CONFIG_SMP */ - - .text -ENTRY(stack_start) - .long init_thread_union+8192 - .long __KERNEL_DS - -/* - * This is initialized to create a identity-mapping at 0-4M (for bootup - * purposes) and another mapping of the 0-4M area at virtual address - * PAGE_OFFSET. - */ - .text - -#define MOUNT_ROOT_RDONLY 1 -#define RAMDISK_FLAGS 0 ; 1024KB -#define ORIG_ROOT_DEV 0x0100 ; /dev/ram0 (major:01, minor:00) -#define LOADER_TYPE 1 ; (??? - non-zero value seems - ; to be needed to boot from initrd) - -#define COMMAND_LINE "" - - .section .empty_zero_page, "aw" -ENTRY(empty_zero_page) - .long MOUNT_ROOT_RDONLY /* offset: +0x00 */ - .long RAMDISK_FLAGS - .long ORIG_ROOT_DEV - .long LOADER_TYPE - .long 0 /* INITRD_START */ /* +0x10 */ - .long 0 /* INITRD_SIZE */ - .long 0 /* CPU_CLOCK */ - .long 0 /* BUS_CLOCK */ - .long 0 /* TIMER_DIVIDE */ /* +0x20 */ - .balign 256,0 - .asciz COMMAND_LINE - .byte 0 - .balign 4096,0,4096 - -/*------------------------------------------------------------------------ - * Stack area - */ - .section .init.data, "aw" - ALIGN - .global spi_stack_top - .zero 1024 -spi_stack_top: - - .section .init.data, "aw" - ALIGN - .global spu_stack_top - .zero 1024 -spu_stack_top: - - .end diff --git a/arch/m32r/kernel/irq.c b/arch/m32r/kernel/irq.c deleted file mode 100644 index 83b5032f176c..000000000000 --- a/arch/m32r/kernel/irq.c +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/kernel/irq.c - * - * Copyright (c) 2003, 2004 Hitoshi Yamamoto - * Copyright (c) 2004 Hirokazu Takata - */ - -/* - * linux/arch/i386/kernel/irq.c - * - * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar - * - * This file contains the lowest level m32r-specific interrupt - * entry and irq statistics code. All the remaining irq logic is - * done by the generic kernel/irq/ code and in the - * m32r-specific irq controller code. - */ - -#include -#include -#include -#include - -/* - * do_IRQ handles all normal device IRQs (the special - * SMP cross-CPU interrupts have their own specific - * handlers). - */ -asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs) -{ - struct pt_regs *old_regs; - old_regs = set_irq_regs(regs); - irq_enter(); - -#ifdef CONFIG_DEBUG_STACKOVERFLOW - /* FIXME M32R */ -#endif - generic_handle_irq(irq); - irq_exit(); - set_irq_regs(old_regs); - - return 1; -} diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c deleted file mode 100644 index 46ebe071e4d6..000000000000 --- a/arch/m32r/kernel/m32r_ksyms.c +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/* platform dependent support */ -EXPORT_SYMBOL(boot_cpu_data); -EXPORT_SYMBOL(dump_fpu); -EXPORT_SYMBOL(__ioremap); -EXPORT_SYMBOL(iounmap); - -EXPORT_SYMBOL(strncpy_from_user); -EXPORT_SYMBOL(clear_user); -EXPORT_SYMBOL(__clear_user); -EXPORT_SYMBOL(strnlen_user); - -#ifdef CONFIG_SMP -#ifdef CONFIG_CHIP_M32700_TS1 -extern void *dcache_dummy; -EXPORT_SYMBOL(dcache_dummy); -#endif -EXPORT_SYMBOL(cpu_data); - -/* TLB flushing */ -EXPORT_SYMBOL(smp_flush_tlb_page); -#endif - -extern int __ucmpdi2(unsigned long long a, unsigned long long b); -EXPORT_SYMBOL(__ucmpdi2); - -/* compiler generated symbol */ -extern void __ashldi3(void); -extern void __ashrdi3(void); -extern void __lshldi3(void); -extern void __lshrdi3(void); -extern void __muldi3(void); -EXPORT_SYMBOL(__ashldi3); -EXPORT_SYMBOL(__ashrdi3); -EXPORT_SYMBOL(__lshldi3); -EXPORT_SYMBOL(__lshrdi3); -EXPORT_SYMBOL(__muldi3); - -/* memory and string operations */ -EXPORT_SYMBOL(memcpy); -EXPORT_SYMBOL(memset); -EXPORT_SYMBOL(copy_page); -EXPORT_SYMBOL(clear_page); -EXPORT_SYMBOL(strlen); -EXPORT_SYMBOL(empty_zero_page); - -EXPORT_SYMBOL(_inb); -EXPORT_SYMBOL(_inw); -EXPORT_SYMBOL(_inl); -EXPORT_SYMBOL(_outb); -EXPORT_SYMBOL(_outw); -EXPORT_SYMBOL(_outl); -EXPORT_SYMBOL(_inb_p); -EXPORT_SYMBOL(_inw_p); -EXPORT_SYMBOL(_inl_p); -EXPORT_SYMBOL(_outb_p); -EXPORT_SYMBOL(_outw_p); -EXPORT_SYMBOL(_outl_p); -EXPORT_SYMBOL(_insb); -EXPORT_SYMBOL(_insw); -EXPORT_SYMBOL(_insl); -EXPORT_SYMBOL(_outsb); -EXPORT_SYMBOL(_outsw); -EXPORT_SYMBOL(_outsl); -EXPORT_SYMBOL(_readb); -EXPORT_SYMBOL(_readw); -EXPORT_SYMBOL(_readl); -EXPORT_SYMBOL(_writeb); -EXPORT_SYMBOL(_writew); -EXPORT_SYMBOL(_writel); - diff --git a/arch/m32r/kernel/module.c b/arch/m32r/kernel/module.c deleted file mode 100644 index 38233b6596b6..000000000000 --- a/arch/m32r/kernel/module.c +++ /dev/null @@ -1,203 +0,0 @@ -/* Kernel module help for M32R. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include -#include -#include -#include -#include -#include - -#if 0 -#define DEBUGP printk -#else -#define DEBUGP(fmt...) -#endif - -#define COPY_UNALIGNED_WORD(sw, tw, align) \ -{ \ - void *__s = &(sw), *__t = &(tw); \ - unsigned short *__s2 = __s, *__t2 =__t; \ - unsigned char *__s1 = __s, *__t1 =__t; \ - switch ((align)) \ - { \ - case 0: \ - *(unsigned long *) __t = *(unsigned long *) __s; \ - break; \ - case 2: \ - *__t2++ = *__s2++; \ - *__t2 = *__s2; \ - break; \ - default: \ - *__t1++ = *__s1++; \ - *__t1++ = *__s1++; \ - *__t1++ = *__s1++; \ - *__t1 = *__s1; \ - break; \ - } \ -} - -#define COPY_UNALIGNED_HWORD(sw, tw, align) \ - { \ - void *__s = &(sw), *__t = &(tw); \ - unsigned short *__s2 = __s, *__t2 =__t; \ - unsigned char *__s1 = __s, *__t1 =__t; \ - switch ((align)) \ - { \ - case 0: \ - *__t2 = *__s2; \ - break; \ - default: \ - *__t1++ = *__s1++; \ - *__t1 = *__s1; \ - break; \ - } \ - } - -int apply_relocate_add(Elf32_Shdr *sechdrs, - const char *strtab, - unsigned int symindex, - unsigned int relsec, - struct module *me) -{ - unsigned int i; - Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; - Elf32_Sym *sym; - Elf32_Addr relocation; - uint32_t *location; - uint32_t value; - unsigned short *hlocation; - unsigned short hvalue; - int svalue; - int align; - - DEBUGP("Applying relocate section %u to %u\n", relsec, - sechdrs[relsec].sh_info); - for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { - /* This is where to make the change */ - location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr - + rel[i].r_offset; - /* This is the symbol it is referring to. Note that all - undefined symbols have been resolved. */ - sym = (Elf32_Sym *)sechdrs[symindex].sh_addr - + ELF32_R_SYM(rel[i].r_info); - relocation = sym->st_value + rel[i].r_addend; - align = (int)location & 3; - - switch (ELF32_R_TYPE(rel[i].r_info)) { - case R_M32R_32_RELA: - COPY_UNALIGNED_WORD (*location, value, align); - value += relocation; - COPY_UNALIGNED_WORD (value, *location, align); - break; - case R_M32R_HI16_ULO_RELA: - COPY_UNALIGNED_WORD (*location, value, align); - relocation = (relocation >>16) & 0xffff; - /* RELA must has 0 at relocation field. */ - value += relocation; - COPY_UNALIGNED_WORD (value, *location, align); - break; - case R_M32R_HI16_SLO_RELA: - COPY_UNALIGNED_WORD (*location, value, align); - if (relocation & 0x8000) relocation += 0x10000; - relocation = (relocation >>16) & 0xffff; - /* RELA must has 0 at relocation field. */ - value += relocation; - COPY_UNALIGNED_WORD (value, *location, align); - break; - case R_M32R_16_RELA: - hlocation = (unsigned short *)location; - relocation = relocation & 0xffff; - /* RELA must has 0 at relocation field. */ - hvalue = relocation; - COPY_UNALIGNED_WORD (hvalue, *hlocation, align); - break; - case R_M32R_SDA16_RELA: - case R_M32R_LO16_RELA: - COPY_UNALIGNED_WORD (*location, value, align); - relocation = relocation & 0xffff; - /* RELA must has 0 at relocation field. */ - value += relocation; - COPY_UNALIGNED_WORD (value, *location, align); - break; - case R_M32R_24_RELA: - COPY_UNALIGNED_WORD (*location, value, align); - relocation = relocation & 0xffffff; - /* RELA must has 0 at relocation field. */ - value += relocation; - COPY_UNALIGNED_WORD (value, *location, align); - break; - case R_M32R_18_PCREL_RELA: - relocation = (relocation - (Elf32_Addr) location); - if (relocation < -0x20000 || 0x1fffc < relocation) - { - printk(KERN_ERR "module %s: relocation overflow: %u\n", - me->name, relocation); - return -ENOEXEC; - } - COPY_UNALIGNED_WORD (*location, value, align); - if (value & 0xffff) - { - /* RELA must has 0 at relocation field. */ - printk(KERN_ERR "module %s: illegal relocation field: %u\n", - me->name, value); - return -ENOEXEC; - } - relocation = (relocation >> 2) & 0xffff; - value += relocation; - COPY_UNALIGNED_WORD (value, *location, align); - break; - case R_M32R_10_PCREL_RELA: - hlocation = (unsigned short *)location; - relocation = (relocation - (Elf32_Addr) location); - COPY_UNALIGNED_HWORD (*hlocation, hvalue, align); - svalue = (int)hvalue; - svalue = (signed char)svalue << 2; - relocation += svalue; - relocation = (relocation >> 2) & 0xff; - hvalue = hvalue & 0xff00; - hvalue += relocation; - COPY_UNALIGNED_HWORD (hvalue, *hlocation, align); - break; - case R_M32R_26_PCREL_RELA: - relocation = (relocation - (Elf32_Addr) location); - if (relocation < -0x2000000 || 0x1fffffc < relocation) - { - printk(KERN_ERR "module %s: relocation overflow: %u\n", - me->name, relocation); - return -ENOEXEC; - } - COPY_UNALIGNED_WORD (*location, value, align); - if (value & 0xffffff) - { - /* RELA must has 0 at relocation field. */ - printk(KERN_ERR "module %s: illegal relocation field: %u\n", - me->name, value); - return -ENOEXEC; - } - relocation = (relocation >> 2) & 0xffffff; - value += relocation; - COPY_UNALIGNED_WORD (value, *location, align); - break; - default: - printk(KERN_ERR "module %s: Unknown relocation: %u\n", - me->name, ELF32_R_TYPE(rel[i].r_info)); - return -ENOEXEC; - } - } - return 0; -} diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c deleted file mode 100644 index a1a4cb136e99..000000000000 --- a/arch/m32r/kernel/process.c +++ /dev/null @@ -1,154 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/kernel/process.c - * - * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto - * Taken from sh version. - * Copyright (C) 1995 Linus Torvalds - * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima - */ - -#undef DEBUG_PROCESS -#ifdef DEBUG_PROCESS -#define DPRINTK(fmt, args...) printk("%s:%d:%s: " fmt, __FILE__, __LINE__, \ - __func__, ##args) -#else -#define DPRINTK(fmt, args...) -#endif - -/* - * This file handles the architecture-dependent parts of process handling.. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -void (*pm_power_off)(void) = NULL; -EXPORT_SYMBOL(pm_power_off); - -void machine_restart(char *__unused) -{ -#if defined(CONFIG_PLAT_MAPPI3) - outw(1, (unsigned long)PLD_REBOOT); -#endif - - printk("Please push reset button!\n"); - while (1) - cpu_relax(); -} - -void machine_halt(void) -{ - printk("Please push reset button!\n"); - while (1) - cpu_relax(); -} - -void machine_power_off(void) -{ - /* M32R_FIXME */ -} - -void show_regs(struct pt_regs * regs) -{ - printk("\n"); - show_regs_print_info(KERN_DEFAULT); - - printk("BPC[%08lx]:PSW[%08lx]:LR [%08lx]:FP [%08lx]\n", \ - regs->bpc, regs->psw, regs->lr, regs->fp); - printk("BBPC[%08lx]:BBPSW[%08lx]:SPU[%08lx]:SPI[%08lx]\n", \ - regs->bbpc, regs->bbpsw, regs->spu, regs->spi); - printk("R0 [%08lx]:R1 [%08lx]:R2 [%08lx]:R3 [%08lx]\n", \ - regs->r0, regs->r1, regs->r2, regs->r3); - printk("R4 [%08lx]:R5 [%08lx]:R6 [%08lx]:R7 [%08lx]\n", \ - regs->r4, regs->r5, regs->r6, regs->r7); - printk("R8 [%08lx]:R9 [%08lx]:R10[%08lx]:R11[%08lx]\n", \ - regs->r8, regs->r9, regs->r10, regs->r11); - printk("R12[%08lx]\n", \ - regs->r12); - -#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) - printk("ACC0H[%08lx]:ACC0L[%08lx]\n", \ - regs->acc0h, regs->acc0l); - printk("ACC1H[%08lx]:ACC1L[%08lx]\n", \ - regs->acc1h, regs->acc1l); -#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) - printk("ACCH[%08lx]:ACCL[%08lx]\n", \ - regs->acc0h, regs->acc0l); -#else -#error unknown isa configuration -#endif -} - -void flush_thread(void) -{ - DPRINTK("pid = %d\n", current->pid); - memset(¤t->thread.debug_trap, 0, sizeof(struct debug_trap)); -} - -void release_thread(struct task_struct *dead_task) -{ - /* do nothing */ - DPRINTK("pid = %d\n", dead_task->pid); -} - -/* Fill in the fpu structure for a core dump.. */ -int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) -{ - return 0; /* Task didn't use the fpu at all. */ -} - -int copy_thread(unsigned long clone_flags, unsigned long spu, - unsigned long arg, struct task_struct *tsk) -{ - struct pt_regs *childregs = task_pt_regs(tsk); - extern void ret_from_fork(void); - extern void ret_from_kernel_thread(void); - - if (unlikely(tsk->flags & PF_KTHREAD)) { - memset(childregs, 0, sizeof(struct pt_regs)); - childregs->psw = M32R_PSW_BIE; - childregs->r1 = spu; /* fn */ - childregs->r0 = arg; - tsk->thread.lr = (unsigned long)ret_from_kernel_thread; - } else { - /* Copy registers */ - *childregs = *current_pt_regs(); - if (spu) - childregs->spu = spu; - childregs->r0 = 0; /* Child gets zero as return value */ - tsk->thread.lr = (unsigned long)ret_from_fork; - } - tsk->thread.sp = (unsigned long)childregs; - - return 0; -} - -/* - * These bracket the sleeping functions.. - */ -#define first_sched ((unsigned long) scheduling_functions_start_here) -#define last_sched ((unsigned long) scheduling_functions_end_here) - -unsigned long get_wchan(struct task_struct *p) -{ - /* M32R_FIXME */ - return (0); -} diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c deleted file mode 100644 index d702a5ca0f92..000000000000 --- a/arch/m32r/kernel/ptrace.c +++ /dev/null @@ -1,708 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/kernel/ptrace.c - * - * Copyright (C) 2002 Hirokazu Takata, Takeo Takahashi - * Copyright (C) 2004 Hirokazu Takata, Kei Sakamoto - * - * Original x86 implementation: - * By Ross Biro 1/23/92 - * edited by Linus Torvalds - * - * Some code taken from sh version: - * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka - * Some code taken from arm version: - * Copyright (C) 2000 Russell King - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -/* - * This routine will get a word off of the process kernel stack. - */ -static inline unsigned long int -get_stack_long(struct task_struct *task, int offset) -{ - unsigned long *stack; - - stack = (unsigned long *)task_pt_regs(task); - - return stack[offset]; -} - -/* - * This routine will put a word on the process kernel stack. - */ -static inline int -put_stack_long(struct task_struct *task, int offset, unsigned long data) -{ - unsigned long *stack; - - stack = (unsigned long *)task_pt_regs(task); - stack[offset] = data; - - return 0; -} - -static int reg_offset[] = { - PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7, - PT_R8, PT_R9, PT_R10, PT_R11, PT_R12, PT_FP, PT_LR, PT_SPU, -}; - -/* - * Read the word at offset "off" into the "struct user". We - * actually access the pt_regs stored on the kernel stack. - */ -static int ptrace_read_user(struct task_struct *tsk, unsigned long off, - unsigned long __user *data) -{ - unsigned long tmp; -#ifndef NO_FPU - struct user * dummy = NULL; -#endif - - if ((off & 3) || off > sizeof(struct user) - 3) - return -EIO; - - off >>= 2; - switch (off) { - case PT_EVB: - __asm__ __volatile__ ( - "mvfc %0, cr5 \n\t" - : "=r" (tmp) - ); - break; - case PT_CBR: { - unsigned long psw; - psw = get_stack_long(tsk, PT_PSW); - tmp = ((psw >> 8) & 1); - } - break; - case PT_PSW: { - unsigned long psw, bbpsw; - psw = get_stack_long(tsk, PT_PSW); - bbpsw = get_stack_long(tsk, PT_BBPSW); - tmp = ((psw >> 8) & 0xff) | ((bbpsw & 0xff) << 8); - } - break; - case PT_PC: - tmp = get_stack_long(tsk, PT_BPC); - break; - case PT_BPC: - off = PT_BBPC; - /* fall through */ - default: - if (off < (sizeof(struct pt_regs) >> 2)) - tmp = get_stack_long(tsk, off); -#ifndef NO_FPU - else if (off >= (long)(&dummy->fpu >> 2) && - off < (long)(&dummy->u_fpvalid >> 2)) { - if (!tsk_used_math(tsk)) { - if (off == (long)(&dummy->fpu.fpscr >> 2)) - tmp = FPSCR_INIT; - else - tmp = 0; - } else - tmp = ((long *)(&tsk->thread.fpu >> 2)) - [off - (long)&dummy->fpu]; - } else if (off == (long)(&dummy->u_fpvalid >> 2)) - tmp = !!tsk_used_math(tsk); -#endif /* not NO_FPU */ - else - tmp = 0; - } - - return put_user(tmp, data); -} - -static int ptrace_write_user(struct task_struct *tsk, unsigned long off, - unsigned long data) -{ - int ret = -EIO; -#ifndef NO_FPU - struct user * dummy = NULL; -#endif - - if ((off & 3) || off > sizeof(struct user) - 3) - return -EIO; - - off >>= 2; - switch (off) { - case PT_EVB: - case PT_BPC: - case PT_SPI: - /* We don't allow to modify evb. */ - ret = 0; - break; - case PT_PSW: - case PT_CBR: { - /* We allow to modify only cbr in psw */ - unsigned long psw; - psw = get_stack_long(tsk, PT_PSW); - psw = (psw & ~0x100) | ((data & 1) << 8); - ret = put_stack_long(tsk, PT_PSW, psw); - } - break; - case PT_PC: - off = PT_BPC; - data &= ~1; - /* fall through */ - default: - if (off < (sizeof(struct pt_regs) >> 2)) - ret = put_stack_long(tsk, off, data); -#ifndef NO_FPU - else if (off >= (long)(&dummy->fpu >> 2) && - off < (long)(&dummy->u_fpvalid >> 2)) { - set_stopped_child_used_math(tsk); - ((long *)&tsk->thread.fpu) - [off - (long)&dummy->fpu] = data; - ret = 0; - } else if (off == (long)(&dummy->u_fpvalid >> 2)) { - conditional_stopped_child_used_math(data, tsk); - ret = 0; - } -#endif /* not NO_FPU */ - break; - } - - return ret; -} - -/* - * Get all user integer registers. - */ -static int ptrace_getregs(struct task_struct *tsk, void __user *uregs) -{ - struct pt_regs *regs = task_pt_regs(tsk); - - return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0; -} - -/* - * Set all user integer registers. - */ -static int ptrace_setregs(struct task_struct *tsk, void __user *uregs) -{ - struct pt_regs newregs; - int ret; - - ret = -EFAULT; - if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) { - struct pt_regs *regs = task_pt_regs(tsk); - *regs = newregs; - ret = 0; - } - - return ret; -} - - -static inline int -check_condition_bit(struct task_struct *child) -{ - return (int)((get_stack_long(child, PT_PSW) >> 8) & 1); -} - -static int -check_condition_src(unsigned long op, unsigned long regno1, - unsigned long regno2, struct task_struct *child) -{ - unsigned long reg1, reg2; - - reg2 = get_stack_long(child, reg_offset[regno2]); - - switch (op) { - case 0x0: /* BEQ */ - reg1 = get_stack_long(child, reg_offset[regno1]); - return reg1 == reg2; - case 0x1: /* BNE */ - reg1 = get_stack_long(child, reg_offset[regno1]); - return reg1 != reg2; - case 0x8: /* BEQZ */ - return reg2 == 0; - case 0x9: /* BNEZ */ - return reg2 != 0; - case 0xa: /* BLTZ */ - return (int)reg2 < 0; - case 0xb: /* BGEZ */ - return (int)reg2 >= 0; - case 0xc: /* BLEZ */ - return (int)reg2 <= 0; - case 0xd: /* BGTZ */ - return (int)reg2 > 0; - default: - /* never reached */ - return 0; - } -} - -static void -compute_next_pc_for_16bit_insn(unsigned long insn, unsigned long pc, - unsigned long *next_pc, - struct task_struct *child) -{ - unsigned long op, op2, op3; - unsigned long disp; - unsigned long regno; - int parallel = 0; - - if (insn & 0x00008000) - parallel = 1; - if (pc & 3) - insn &= 0x7fff; /* right slot */ - else - insn >>= 16; /* left slot */ - - op = (insn >> 12) & 0xf; - op2 = (insn >> 8) & 0xf; - op3 = (insn >> 4) & 0xf; - - if (op == 0x7) { - switch (op2) { - case 0xd: /* BNC */ - case 0x9: /* BNCL */ - if (!check_condition_bit(child)) { - disp = (long)(insn << 24) >> 22; - *next_pc = (pc & ~0x3) + disp; - return; - } - break; - case 0x8: /* BCL */ - case 0xc: /* BC */ - if (check_condition_bit(child)) { - disp = (long)(insn << 24) >> 22; - *next_pc = (pc & ~0x3) + disp; - return; - } - break; - case 0xe: /* BL */ - case 0xf: /* BRA */ - disp = (long)(insn << 24) >> 22; - *next_pc = (pc & ~0x3) + disp; - return; - break; - } - } else if (op == 0x1) { - switch (op2) { - case 0x0: - if (op3 == 0xf) { /* TRAP */ -#if 1 - /* pass through */ -#else - /* kernel space is not allowed as next_pc */ - unsigned long evb; - unsigned long trapno; - trapno = insn & 0xf; - __asm__ __volatile__ ( - "mvfc %0, cr5\n" - :"=r"(evb) - : - ); - *next_pc = evb + (trapno << 2); - return; -#endif - } else if (op3 == 0xd) { /* RTE */ - *next_pc = get_stack_long(child, PT_BPC); - return; - } - break; - case 0xc: /* JC */ - if (op3 == 0xc && check_condition_bit(child)) { - regno = insn & 0xf; - *next_pc = get_stack_long(child, - reg_offset[regno]); - return; - } - break; - case 0xd: /* JNC */ - if (op3 == 0xc && !check_condition_bit(child)) { - regno = insn & 0xf; - *next_pc = get_stack_long(child, - reg_offset[regno]); - return; - } - break; - case 0xe: /* JL */ - case 0xf: /* JMP */ - if (op3 == 0xc) { /* JMP */ - regno = insn & 0xf; - *next_pc = get_stack_long(child, - reg_offset[regno]); - return; - } - break; - } - } - if (parallel) - *next_pc = pc + 4; - else - *next_pc = pc + 2; -} - -static void -compute_next_pc_for_32bit_insn(unsigned long insn, unsigned long pc, - unsigned long *next_pc, - struct task_struct *child) -{ - unsigned long op; - unsigned long op2; - unsigned long disp; - unsigned long regno1, regno2; - - op = (insn >> 28) & 0xf; - if (op == 0xf) { /* branch 24-bit relative */ - op2 = (insn >> 24) & 0xf; - switch (op2) { - case 0xd: /* BNC */ - case 0x9: /* BNCL */ - if (!check_condition_bit(child)) { - disp = (long)(insn << 8) >> 6; - *next_pc = (pc & ~0x3) + disp; - return; - } - break; - case 0x8: /* BCL */ - case 0xc: /* BC */ - if (check_condition_bit(child)) { - disp = (long)(insn << 8) >> 6; - *next_pc = (pc & ~0x3) + disp; - return; - } - break; - case 0xe: /* BL */ - case 0xf: /* BRA */ - disp = (long)(insn << 8) >> 6; - *next_pc = (pc & ~0x3) + disp; - return; - } - } else if (op == 0xb) { /* branch 16-bit relative */ - op2 = (insn >> 20) & 0xf; - switch (op2) { - case 0x0: /* BEQ */ - case 0x1: /* BNE */ - case 0x8: /* BEQZ */ - case 0x9: /* BNEZ */ - case 0xa: /* BLTZ */ - case 0xb: /* BGEZ */ - case 0xc: /* BLEZ */ - case 0xd: /* BGTZ */ - regno1 = ((insn >> 24) & 0xf); - regno2 = ((insn >> 16) & 0xf); - if (check_condition_src(op2, regno1, regno2, child)) { - disp = (long)(insn << 16) >> 14; - *next_pc = (pc & ~0x3) + disp; - return; - } - break; - } - } - *next_pc = pc + 4; -} - -static inline void -compute_next_pc(unsigned long insn, unsigned long pc, - unsigned long *next_pc, struct task_struct *child) -{ - if (insn & 0x80000000) - compute_next_pc_for_32bit_insn(insn, pc, next_pc, child); - else - compute_next_pc_for_16bit_insn(insn, pc, next_pc, child); -} - -static int -register_debug_trap(struct task_struct *child, unsigned long next_pc, - unsigned long next_insn, unsigned long *code) -{ - struct debug_trap *p = &child->thread.debug_trap; - unsigned long addr = next_pc & ~3; - - if (p->nr_trap == MAX_TRAPS) { - printk("kernel BUG at %s %d: p->nr_trap = %d\n", - __FILE__, __LINE__, p->nr_trap); - return -1; - } - p->addr[p->nr_trap] = addr; - p->insn[p->nr_trap] = next_insn; - p->nr_trap++; - if (next_pc & 3) { - *code = (next_insn & 0xffff0000) | 0x10f1; - /* xxx --> TRAP1 */ - } else { - if ((next_insn & 0x80000000) || (next_insn & 0x8000)) { - *code = 0x10f17000; - /* TRAP1 --> NOP */ - } else { - *code = (next_insn & 0xffff) | 0x10f10000; - /* TRAP1 --> xxx */ - } - } - return 0; -} - -static int -unregister_debug_trap(struct task_struct *child, unsigned long addr, - unsigned long *code) -{ - struct debug_trap *p = &child->thread.debug_trap; - int i; - - /* Search debug trap entry. */ - for (i = 0; i < p->nr_trap; i++) { - if (p->addr[i] == addr) - break; - } - if (i >= p->nr_trap) { - /* The trap may be requested from debugger. - * ptrace should do nothing in this case. - */ - return 0; - } - - /* Recover original instruction code. */ - *code = p->insn[i]; - - /* Shift debug trap entries. */ - while (i < p->nr_trap - 1) { - p->insn[i] = p->insn[i + 1]; - p->addr[i] = p->addr[i + 1]; - i++; - } - p->nr_trap--; - return 1; -} - -static void -unregister_all_debug_traps(struct task_struct *child) -{ - struct debug_trap *p = &child->thread.debug_trap; - int i; - - for (i = 0; i < p->nr_trap; i++) - access_process_vm(child, p->addr[i], &p->insn[i], sizeof(p->insn[i]), - FOLL_FORCE | FOLL_WRITE); - p->nr_trap = 0; -} - -static inline void -invalidate_cache(void) -{ -#if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_OPSP) - - _flush_cache_copyback_all(); - -#else /* ! CONFIG_CHIP_M32700 */ - - /* Invalidate cache */ - __asm__ __volatile__ ( - "ldi r0, #-1 \n\t" - "ldi r1, #0 \n\t" - "stb r1, @r0 ; cache off \n\t" - "; \n\t" - "ldi r0, #-2 \n\t" - "ldi r1, #1 \n\t" - "stb r1, @r0 ; cache invalidate \n\t" - ".fillinsn \n" - "0: \n\t" - "ldb r1, @r0 ; invalidate check \n\t" - "bnez r1, 0b \n\t" - "; \n\t" - "ldi r0, #-1 \n\t" - "ldi r1, #1 \n\t" - "stb r1, @r0 ; cache on \n\t" - : : : "r0", "r1", "memory" - ); - /* FIXME: copying-back d-cache and invalidating i-cache are needed. - */ -#endif /* CONFIG_CHIP_M32700 */ -} - -/* Embed a debug trap (TRAP1) code */ -static int -embed_debug_trap(struct task_struct *child, unsigned long next_pc) -{ - unsigned long next_insn, code; - unsigned long addr = next_pc & ~3; - - if (access_process_vm(child, addr, &next_insn, sizeof(next_insn), - FOLL_FORCE) - != sizeof(next_insn)) { - return -1; /* error */ - } - - /* Set a trap code. */ - if (register_debug_trap(child, next_pc, next_insn, &code)) { - return -1; /* error */ - } - if (access_process_vm(child, addr, &code, sizeof(code), - FOLL_FORCE | FOLL_WRITE) - != sizeof(code)) { - return -1; /* error */ - } - return 0; /* success */ -} - -void -withdraw_debug_trap(struct pt_regs *regs) -{ - unsigned long addr; - unsigned long code; - - addr = (regs->bpc - 2) & ~3; - regs->bpc -= 2; - if (unregister_debug_trap(current, addr, &code)) { - access_process_vm(current, addr, &code, sizeof(code), - FOLL_FORCE | FOLL_WRITE); - invalidate_cache(); - } -} - -void -init_debug_traps(struct task_struct *child) -{ - struct debug_trap *p = &child->thread.debug_trap; - int i; - p->nr_trap = 0; - for (i = 0; i < MAX_TRAPS; i++) { - p->addr[i] = 0; - p->insn[i] = 0; - } -} - -void user_enable_single_step(struct task_struct *child) -{ - unsigned long next_pc; - unsigned long pc, insn; - - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); - - /* Compute next pc. */ - pc = get_stack_long(child, PT_BPC); - - if (access_process_vm(child, pc&~3, &insn, sizeof(insn), - FOLL_FORCE) - != sizeof(insn)) - return; - - compute_next_pc(insn, pc, &next_pc, child); - if (next_pc & 0x80000000) - return; - - if (embed_debug_trap(child, next_pc)) - return; - - invalidate_cache(); -} - -void user_disable_single_step(struct task_struct *child) -{ - unregister_all_debug_traps(child); - invalidate_cache(); -} - -/* - * Called by kernel/ptrace.c when detaching.. - * - * Make sure single step bits etc are not set. - */ -void ptrace_disable(struct task_struct *child) -{ - /* nothing to do.. */ -} - -long -arch_ptrace(struct task_struct *child, long request, - unsigned long addr, unsigned long data) -{ - int ret; - unsigned long __user *datap = (unsigned long __user *) data; - - switch (request) { - /* - * read word at location "addr" in the child process. - */ - case PTRACE_PEEKTEXT: - case PTRACE_PEEKDATA: - ret = generic_ptrace_peekdata(child, addr, data); - break; - - /* - * read the word at location addr in the USER area. - */ - case PTRACE_PEEKUSR: - ret = ptrace_read_user(child, addr, datap); - break; - - /* - * write the word at location addr. - */ - case PTRACE_POKETEXT: - case PTRACE_POKEDATA: - ret = generic_ptrace_pokedata(child, addr, data); - if (ret == 0 && request == PTRACE_POKETEXT) - invalidate_cache(); - break; - - /* - * write the word at location addr in the USER area. - */ - case PTRACE_POKEUSR: - ret = ptrace_write_user(child, addr, data); - break; - - case PTRACE_GETREGS: - ret = ptrace_getregs(child, datap); - break; - - case PTRACE_SETREGS: - ret = ptrace_setregs(child, datap); - break; - - default: - ret = ptrace_request(child, request, addr, data); - break; - } - - return ret; -} - -/* notification of system call entry/exit - * - triggered by current->work.syscall_trace - */ -void do_syscall_trace(void) -{ - if (!test_thread_flag(TIF_SYSCALL_TRACE)) - return; - if (!(current->ptrace & PT_PTRACED)) - return; - /* the 0x80 provides a way for the tracing parent to distinguish - between a syscall stop and SIGTRAP delivery */ - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) - ? 0x80 : 0)); - - /* - * this isn't the same as continuing with a signal, but it will do - * for normal use. strace only continues with a signal if the - * stopping signal is not SIGTRAP. -brl - */ - if (current->exit_code) { - send_sig(current->exit_code, current, 1); - current->exit_code = 0; - } -} diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c deleted file mode 100644 index b72d5db39f00..000000000000 --- a/arch/m32r/kernel/setup.c +++ /dev/null @@ -1,424 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/kernel/setup.c - * - * Setup routines for Renesas M32R - * - * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_MMU -extern void init_mmu(void); -#endif - -extern char _end[]; - -/* - * Machine setup.. - */ -struct cpuinfo_m32r boot_cpu_data; - -#ifdef CONFIG_BLK_DEV_RAM -extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */ -extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */ -extern int rd_image_start; /* starting block # of image */ -#endif - -#if defined(CONFIG_VGA_CONSOLE) -struct screen_info screen_info = { - .orig_video_lines = 25, - .orig_video_cols = 80, - .orig_video_mode = 0, - .orig_video_ega_bx = 0, - .orig_video_isVGA = 1, - .orig_video_points = 8 -}; -#endif - -extern int root_mountflags; - -static char __initdata command_line[COMMAND_LINE_SIZE]; - -static struct resource data_resource = { - .name = "Kernel data", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM -}; - -static struct resource code_resource = { - .name = "Kernel code", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM -}; - -unsigned long memory_start; -EXPORT_SYMBOL(memory_start); - -unsigned long memory_end; -EXPORT_SYMBOL(memory_end); - -void __init setup_arch(char **); -int get_cpuinfo(char *); - -static __inline__ void parse_mem_cmdline(char ** cmdline_p) -{ - char c = ' '; - char *to = command_line; - char *from = COMMAND_LINE; - int len = 0; - int usermem = 0; - - /* Save unparsed command line copy for /proc/cmdline */ - memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; - - memory_start = (unsigned long)CONFIG_MEMORY_START+PAGE_OFFSET; - memory_end = memory_start+(unsigned long)CONFIG_MEMORY_SIZE; - - for ( ; ; ) { - if (c == ' ' && !memcmp(from, "mem=", 4)) { - if (to != command_line) - to--; - - { - unsigned long mem_size; - - usermem = 1; - mem_size = memparse(from+4, &from); - memory_end = memory_start + mem_size; - } - } - c = *(from++); - if (!c) - break; - - if (COMMAND_LINE_SIZE <= ++len) - break; - - *(to++) = c; - } - *to = '\0'; - *cmdline_p = command_line; - if (usermem) - printk(KERN_INFO "user-defined physical RAM map:\n"); -} - -#ifndef CONFIG_DISCONTIGMEM -static unsigned long __init setup_memory(void) -{ - unsigned long start_pfn, max_low_pfn, bootmap_size; - - start_pfn = PFN_UP( __pa(_end) ); - max_low_pfn = PFN_DOWN( __pa(memory_end) ); - - /* - * Initialize the boot-time allocator (with low memory only): - */ - bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, - CONFIG_MEMORY_START>>PAGE_SHIFT, max_low_pfn); - - /* - * Register fully available low RAM pages with the bootmem allocator. - */ - { - unsigned long curr_pfn; - unsigned long last_pfn; - unsigned long pages; - - /* - * We are rounding up the start address of usable memory: - */ - curr_pfn = PFN_UP(__pa(memory_start)); - - /* - * ... and at the end of the usable range downwards: - */ - last_pfn = PFN_DOWN(__pa(memory_end)); - - if (last_pfn > max_low_pfn) - last_pfn = max_low_pfn; - - pages = last_pfn - curr_pfn; - free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages)); - } - - /* - * Reserve the kernel text and - * Reserve the bootmem bitmap. We do this in two steps (first step - * was init_bootmem()), because this catches the (definitely buggy) - * case of us accidentally initializing the bootmem allocator with - * an invalid RAM area. - */ - reserve_bootmem(CONFIG_MEMORY_START + PAGE_SIZE, - (PFN_PHYS(start_pfn) + bootmap_size + PAGE_SIZE - 1) - - CONFIG_MEMORY_START, - BOOTMEM_DEFAULT); - - /* - * reserve physical page 0 - it's a special BIOS page on many boxes, - * enabling clean reboots, SMP operation, laptop functions. - */ - reserve_bootmem(CONFIG_MEMORY_START, PAGE_SIZE, BOOTMEM_DEFAULT); - - /* - * reserve memory hole - */ -#ifdef CONFIG_MEMHOLE - reserve_bootmem(CONFIG_MEMHOLE_START, CONFIG_MEMHOLE_SIZE, - BOOTMEM_DEFAULT); -#endif - -#ifdef CONFIG_BLK_DEV_INITRD - if (LOADER_TYPE && INITRD_START) { - if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { - reserve_bootmem(INITRD_START, INITRD_SIZE, - BOOTMEM_DEFAULT); - initrd_start = INITRD_START + PAGE_OFFSET; - initrd_end = initrd_start + INITRD_SIZE; - printk("initrd:start[%08lx],size[%08lx]\n", - initrd_start, INITRD_SIZE); - } else { - printk("initrd extends beyond end of memory " - "(0x%08lx > 0x%08lx)\ndisabling initrd\n", - INITRD_START + INITRD_SIZE, - max_low_pfn << PAGE_SHIFT); - - initrd_start = 0; - } - } -#endif - - return max_low_pfn; -} -#else /* CONFIG_DISCONTIGMEM */ -extern unsigned long setup_memory(void); -#endif /* CONFIG_DISCONTIGMEM */ - -void __init setup_arch(char **cmdline_p) -{ - ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); - - boot_cpu_data.cpu_clock = M32R_CPUCLK; - boot_cpu_data.bus_clock = M32R_BUSCLK; - boot_cpu_data.timer_divide = M32R_TIMER_DIVIDE; - -#ifdef CONFIG_BLK_DEV_RAM - rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; - rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); - rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0); -#endif - - if (!MOUNT_ROOT_RDONLY) - root_mountflags &= ~MS_RDONLY; - -#ifdef CONFIG_VT -#if defined(CONFIG_VGA_CONSOLE) - conswitchp = &vga_con; -#elif defined(CONFIG_DUMMY_CONSOLE) - conswitchp = &dummy_con; -#endif -#endif - -#ifdef CONFIG_DISCONTIGMEM - nodes_clear(node_online_map); - node_set_online(0); - node_set_online(1); -#endif /* CONFIG_DISCONTIGMEM */ - - init_mm.start_code = (unsigned long) _text; - init_mm.end_code = (unsigned long) _etext; - init_mm.end_data = (unsigned long) _edata; - init_mm.brk = (unsigned long) _end; - - code_resource.start = virt_to_phys(_text); - code_resource.end = virt_to_phys(_etext)-1; - data_resource.start = virt_to_phys(_etext); - data_resource.end = virt_to_phys(_edata)-1; - - parse_mem_cmdline(cmdline_p); - - setup_memory(); - - paging_init(); -} - -static struct cpu cpu_devices[NR_CPUS]; - -static int __init topology_init(void) -{ - int i; - - for_each_present_cpu(i) - register_cpu(&cpu_devices[i], i); - - return 0; -} - -subsys_initcall(topology_init); - -#ifdef CONFIG_PROC_FS -/* - * Get CPU information for use by the procfs. - */ -static int show_cpuinfo(struct seq_file *m, void *v) -{ - struct cpuinfo_m32r *c = v; - unsigned long cpu = c - cpu_data; - -#ifdef CONFIG_SMP - if (!cpu_online(cpu)) - return 0; -#endif /* CONFIG_SMP */ - - seq_printf(m, "processor\t: %ld\n", cpu); - -#if defined(CONFIG_CHIP_VDEC2) - seq_printf(m, "cpu family\t: VDEC2\n" - "cache size\t: Unknown\n"); -#elif defined(CONFIG_CHIP_M32700) - seq_printf(m,"cpu family\t: M32700\n" - "cache size\t: I-8KB/D-8KB\n"); -#elif defined(CONFIG_CHIP_M32102) - seq_printf(m,"cpu family\t: M32102\n" - "cache size\t: I-8KB\n"); -#elif defined(CONFIG_CHIP_OPSP) - seq_printf(m,"cpu family\t: OPSP\n" - "cache size\t: I-8KB/D-8KB\n"); -#elif defined(CONFIG_CHIP_MP) - seq_printf(m, "cpu family\t: M32R-MP\n" - "cache size\t: I-xxKB/D-xxKB\n"); -#elif defined(CONFIG_CHIP_M32104) - seq_printf(m,"cpu family\t: M32104\n" - "cache size\t: I-8KB/D-8KB\n"); -#else - seq_printf(m, "cpu family\t: Unknown\n"); -#endif - seq_printf(m, "bogomips\t: %lu.%02lu\n", - c->loops_per_jiffy/(500000/HZ), - (c->loops_per_jiffy/(5000/HZ)) % 100); -#if defined(CONFIG_PLAT_MAPPI) - seq_printf(m, "Machine\t\t: Mappi Evaluation board\n"); -#elif defined(CONFIG_PLAT_MAPPI2) - seq_printf(m, "Machine\t\t: Mappi-II Evaluation board\n"); -#elif defined(CONFIG_PLAT_MAPPI3) - seq_printf(m, "Machine\t\t: Mappi-III Evaluation board\n"); -#elif defined(CONFIG_PLAT_M32700UT) - seq_printf(m, "Machine\t\t: M32700UT Evaluation board\n"); -#elif defined(CONFIG_PLAT_OPSPUT) - seq_printf(m, "Machine\t\t: OPSPUT Evaluation board\n"); -#elif defined(CONFIG_PLAT_USRV) - seq_printf(m, "Machine\t\t: uServer\n"); -#elif defined(CONFIG_PLAT_OAKS32R) - seq_printf(m, "Machine\t\t: OAKS32R\n"); -#elif defined(CONFIG_PLAT_M32104UT) - seq_printf(m, "Machine\t\t: M3T-M32104UT uT Engine board\n"); -#else - seq_printf(m, "Machine\t\t: Unknown\n"); -#endif - -#define PRINT_CLOCK(name, value) \ - seq_printf(m, name " clock\t: %d.%02dMHz\n", \ - ((value) / 1000000), ((value) % 1000000)/10000) - - PRINT_CLOCK("CPU", (int)c->cpu_clock); - PRINT_CLOCK("Bus", (int)c->bus_clock); - - seq_printf(m, "\n"); - - return 0; -} - -static void *c_start(struct seq_file *m, loff_t *pos) -{ - return *pos < NR_CPUS ? cpu_data + *pos : NULL; -} - -static void *c_next(struct seq_file *m, void *v, loff_t *pos) -{ - ++*pos; - return c_start(m, pos); -} - -static void c_stop(struct seq_file *m, void *v) -{ -} - -const struct seq_operations cpuinfo_op = { - .start = c_start, - .next = c_next, - .stop = c_stop, - .show = show_cpuinfo, -}; -#endif /* CONFIG_PROC_FS */ - -unsigned long cpu_initialized __initdata = 0; - -/* - * cpu_init() initializes state that is per-CPU. Some data is already - * initialized (naturally) in the bootstrap process. - * We reload them nevertheless, this function acts as a - * 'CPU state barrier', nothing should get across. - */ -#if defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_XNUX2) \ - || defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32102) \ - || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) -void __init cpu_init (void) -{ - int cpu_id = smp_processor_id(); - - if (test_and_set_bit(cpu_id, &cpu_initialized)) { - printk(KERN_WARNING "CPU#%d already initialized!\n", cpu_id); - for ( ; ; ) - local_irq_enable(); - } - printk(KERN_INFO "Initializing CPU#%d\n", cpu_id); - - /* Set up and load the per-CPU TSS and LDT */ - mmgrab(&init_mm); - current->active_mm = &init_mm; - if (current->mm) - BUG(); - - /* Force FPU initialization */ - current_thread_info()->status = 0; - clear_used_math(); - -#ifdef CONFIG_MMU - /* Set up MMU */ - init_mmu(); -#endif - - /* Set up ICUIMASK */ - outl(0x00070000, M32R_ICU_IMASK_PORTL); /* imask=111 */ -} -#endif /* defined(CONFIG_CHIP_VDEC2) ... */ diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c deleted file mode 100644 index ba4d8d6330f1..000000000000 --- a/arch/m32r/kernel/signal.c +++ /dev/null @@ -1,336 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/kernel/signal.c - * - * Copyright (c) 2003 Hitoshi Yamamoto - * - * Taken from i386 version. - * Copyright (C) 1991, 1992 Linus Torvalds - * - * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson - * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEBUG_SIG 0 - -/* - * Do a signal return; undo the signal stack. - */ - -struct rt_sigframe -{ - int sig; - struct siginfo __user *pinfo; - void __user *puc; - struct siginfo info; - struct ucontext uc; -// struct _fpstate fpstate; -}; - -static int -restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, - int *r0_p) -{ - unsigned int err = 0; - - /* Always make any pending restarted system calls return -EINTR */ - current->restart_block.fn = do_no_restart_syscall; - -#define COPY(x) err |= __get_user(regs->x, &sc->sc_##x) - COPY(r4); - COPY(r5); - COPY(r6); - COPY(pt_regs); - /* COPY(r0); Skip r0 */ - COPY(r1); - COPY(r2); - COPY(r3); - COPY(r7); - COPY(r8); - COPY(r9); - COPY(r10); - COPY(r11); - COPY(r12); - COPY(acc0h); - COPY(acc0l); - COPY(acc1h); /* ISA_DSP_LEVEL2 only */ - COPY(acc1l); /* ISA_DSP_LEVEL2 only */ - COPY(psw); - COPY(bpc); - COPY(bbpsw); - COPY(bbpc); - COPY(spu); - COPY(fp); - COPY(lr); - COPY(spi); -#undef COPY - - regs->syscall_nr = -1; /* disable syscall checks */ - err |= __get_user(*r0_p, &sc->sc_r0); - - return err; -} - -asmlinkage int -sys_rt_sigreturn(unsigned long r0, unsigned long r1, - unsigned long r2, unsigned long r3, unsigned long r4, - unsigned long r5, unsigned long r6, struct pt_regs *regs) -{ - struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->spu; - sigset_t set; - int result; - - if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) - goto badframe; - if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) - goto badframe; - - set_current_blocked(&set); - - if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) - goto badframe; - - if (restore_altstack(&frame->uc.uc_stack)) - goto badframe; - - return result; - -badframe: - force_sig(SIGSEGV, current); - return 0; -} - -/* - * Set up a signal frame. - */ - -static int -setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, - unsigned long mask) -{ - int err = 0; - -#define COPY(x) err |= __put_user(regs->x, &sc->sc_##x) - COPY(r4); - COPY(r5); - COPY(r6); - COPY(pt_regs); - COPY(r0); - COPY(r1); - COPY(r2); - COPY(r3); - COPY(r7); - COPY(r8); - COPY(r9); - COPY(r10); - COPY(r11); - COPY(r12); - COPY(acc0h); - COPY(acc0l); - COPY(acc1h); /* ISA_DSP_LEVEL2 only */ - COPY(acc1l); /* ISA_DSP_LEVEL2 only */ - COPY(psw); - COPY(bpc); - COPY(bbpsw); - COPY(bbpc); - COPY(spu); - COPY(fp); - COPY(lr); - COPY(spi); -#undef COPY - - err |= __put_user(mask, &sc->oldmask); - - return err; -} - -/* - * Determine which stack to use.. - */ -static inline void __user * -get_sigframe(struct ksignal *ksig, unsigned long sp, size_t frame_size) -{ - return (void __user *)((sigsp(sp, ksig) - frame_size) & -8ul); -} - -static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, - struct pt_regs *regs) -{ - struct rt_sigframe __user *frame; - int err = 0; - int sig = ksig->sig; - - frame = get_sigframe(ksig, regs->spu, sizeof(*frame)); - - if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) - return -EFAULT; - - err |= __put_user(sig, &frame->sig); - if (err) - return -EFAULT; - - err |= __put_user(&frame->info, &frame->pinfo); - err |= __put_user(&frame->uc, &frame->puc); - err |= copy_siginfo_to_user(&frame->info, &ksig->info); - if (err) - return -EFAULT; - - /* Create the ucontext. */ - err |= __put_user(0, &frame->uc.uc_flags); - err |= __put_user(0, &frame->uc.uc_link); - err |= __save_altstack(&frame->uc.uc_stack, regs->spu); - err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); - err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); - if (err) - return -EFAULT; - - /* Set up to return from userspace. */ - regs->lr = (unsigned long)ksig->ka.sa.sa_restorer; - - /* Set up registers for signal handler */ - regs->spu = (unsigned long)frame; - regs->r0 = sig; /* Arg for signal handler */ - regs->r1 = (unsigned long)&frame->info; - regs->r2 = (unsigned long)&frame->uc; - regs->bpc = (unsigned long)ksig->ka.sa.sa_handler; - -#if DEBUG_SIG - printk("SIG deliver (%s:%d): sp=%p pc=%p\n", - current->comm, current->pid, frame, regs->pc); -#endif - - return 0; -} - -static int prev_insn(struct pt_regs *regs) -{ - u16 inst; - if (get_user(inst, (u16 __user *)(regs->bpc - 2))) - return -EFAULT; - if ((inst & 0xfff0) == 0x10f0) /* trap ? */ - regs->bpc -= 2; - else - regs->bpc -= 4; - regs->syscall_nr = -1; - return 0; -} - -/* - * OK, we're invoking a handler - */ - -static void -handle_signal(struct ksignal *ksig, struct pt_regs *regs) -{ - int ret; - - /* Are we from a system call? */ - if (regs->syscall_nr >= 0) { - /* If so, check system call restarting.. */ - switch (regs->r0) { - case -ERESTART_RESTARTBLOCK: - case -ERESTARTNOHAND: - regs->r0 = -EINTR; - break; - - case -ERESTARTSYS: - if (!(ksig->ka.sa.sa_flags & SA_RESTART)) { - regs->r0 = -EINTR; - break; - } - /* fallthrough */ - case -ERESTARTNOINTR: - regs->r0 = regs->orig_r0; - if (prev_insn(regs) < 0) - return; - } - } - - /* Set up the stack frame */ - ret = setup_rt_frame(ksig, sigmask_to_save(), regs); - - signal_setup_done(ret, ksig, 0); -} - -/* - * Note that 'init' is a special process: it doesn't get signals it doesn't - * want to handle. Thus you cannot kill init even with a SIGKILL even by - * mistake. - */ -static void do_signal(struct pt_regs *regs) -{ - struct ksignal ksig; - - /* - * We want the common case to go fast, which - * is why we may in certain cases get here from - * kernel mode. Just return without doing anything - * if so. - */ - if (!user_mode(regs)) - return; - - if (get_signal(&ksig)) { - /* Re-enable any watchpoints before delivering the - * signal to user space. The processor register will - * have been cleared if the watchpoint triggered - * inside the kernel. - */ - - /* Whee! Actually deliver the signal. */ - handle_signal(&ksig, regs); - - return; - } - - /* Did we come from a system call? */ - if (regs->syscall_nr >= 0) { - /* Restart the system call - no handlers present */ - if (regs->r0 == -ERESTARTNOHAND || - regs->r0 == -ERESTARTSYS || - regs->r0 == -ERESTARTNOINTR) { - regs->r0 = regs->orig_r0; - prev_insn(regs); - } else if (regs->r0 == -ERESTART_RESTARTBLOCK){ - regs->r0 = regs->orig_r0; - regs->r7 = __NR_restart_syscall; - prev_insn(regs); - } - } - restore_saved_sigmask(); -} - -/* - * notification of userspace execution resumption - * - triggered by current->work.notify_resume - */ -void do_notify_resume(struct pt_regs *regs, __u32 thread_info_flags) -{ - /* Pending single-step? */ - if (thread_info_flags & _TIF_SINGLESTEP) - clear_thread_flag(TIF_SINGLESTEP); - - /* deal with pending signal delivery */ - if (thread_info_flags & _TIF_SIGPENDING) - do_signal(regs); - - if (thread_info_flags & _TIF_NOTIFY_RESUME) { - clear_thread_flag(TIF_NOTIFY_RESUME); - tracehook_notify_resume(regs); - } -} diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c deleted file mode 100644 index 564052e3d3a0..000000000000 --- a/arch/m32r/kernel/smp.c +++ /dev/null @@ -1,836 +0,0 @@ -/* - * linux/arch/m32r/kernel/smp.c - * - * M32R SMP support routines. - * - * Copyright (c) 2001, 2002 Hitoshi Yamamoto - * - * Taken from i386 version. - * (c) 1995 Alan Cox, Building #3 - * (c) 1998-99, 2000 Ingo Molnar - * - * This code is released under the GNU General Public License version 2 or - * later. - */ - -#undef DEBUG_SMP - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Data structures and variables */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -/* - * For flush_cache_all() - */ -static DEFINE_SPINLOCK(flushcache_lock); -static volatile unsigned long flushcache_cpumask = 0; - -/* - * For flush_tlb_others() - */ -static cpumask_t flush_cpumask; -static struct mm_struct *flush_mm; -static struct vm_area_struct *flush_vma; -static volatile unsigned long flush_va; -static DEFINE_SPINLOCK(tlbstate_lock); -#define FLUSH_ALL 0xffffffff - -DECLARE_PER_CPU(int, prof_multiplier); -DECLARE_PER_CPU(int, prof_old_multiplier); -DECLARE_PER_CPU(int, prof_counter); - -extern spinlock_t ipi_lock[]; - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Function Prototypes */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -void smp_reschedule_interrupt(void); -void smp_flush_cache_all_interrupt(void); - -static void flush_tlb_all_ipi(void *); -static void flush_tlb_others(cpumask_t, struct mm_struct *, - struct vm_area_struct *, unsigned long); - -void smp_invalidate_interrupt(void); - -static void stop_this_cpu(void *); - -void smp_ipi_timer_interrupt(struct pt_regs *); -void smp_local_timer_interrupt(void); - -static void send_IPI_allbutself(int, int); -static void send_IPI_mask(const struct cpumask *, int, int); - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Rescheduling request Routines */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -/*==========================================================================* - * Name: smp_send_reschedule - * - * Description: This routine requests other CPU to execute rescheduling. - * 1.Send 'RESCHEDULE_IPI' to other CPU. - * Request other CPU to execute 'smp_reschedule_interrupt()'. - * - * Born on Date: 2002.02.05 - * - * Arguments: cpu_id - Target CPU ID - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_send_reschedule(int cpu_id) -{ - WARN_ON(cpu_is_offline(cpu_id)); - send_IPI_mask(cpumask_of(cpu_id), RESCHEDULE_IPI, 1); -} - -/*==========================================================================* - * Name: smp_reschedule_interrupt - * - * Description: This routine executes on CPU which received - * 'RESCHEDULE_IPI'. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_reschedule_interrupt(void) -{ - scheduler_ipi(); -} - -/*==========================================================================* - * Name: smp_flush_cache_all - * - * Description: This routine sends a 'INVALIDATE_CACHE_IPI' to all other - * CPUs in the system. - * - * Born on Date: 2003-05-28 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_flush_cache_all(void) -{ - cpumask_t cpumask; - unsigned long *mask; - - preempt_disable(); - cpumask_copy(&cpumask, cpu_online_mask); - cpumask_clear_cpu(smp_processor_id(), &cpumask); - spin_lock(&flushcache_lock); - mask=cpumask_bits(&cpumask); - atomic_or(*mask, (atomic_t *)&flushcache_cpumask); - send_IPI_mask(&cpumask, INVALIDATE_CACHE_IPI, 0); - _flush_cache_copyback_all(); - while (flushcache_cpumask) - mb(); - spin_unlock(&flushcache_lock); - preempt_enable(); -} -EXPORT_SYMBOL(smp_flush_cache_all); - -void smp_flush_cache_all_interrupt(void) -{ - _flush_cache_copyback_all(); - clear_bit(smp_processor_id(), &flushcache_cpumask); -} - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* TLB flush request Routines */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -/*==========================================================================* - * Name: smp_flush_tlb_all - * - * Description: This routine flushes all processes TLBs. - * 1.Request other CPU to execute 'flush_tlb_all_ipi()'. - * 2.Execute 'do_flush_tlb_all_local()'. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_flush_tlb_all(void) -{ - unsigned long flags; - - preempt_disable(); - local_irq_save(flags); - __flush_tlb_all(); - local_irq_restore(flags); - smp_call_function(flush_tlb_all_ipi, NULL, 1); - preempt_enable(); -} - -/*==========================================================================* - * Name: flush_tlb_all_ipi - * - * Description: This routine flushes all local TLBs. - * 1.Execute 'do_flush_tlb_all_local()'. - * - * Born on Date: 2002.02.05 - * - * Arguments: *info - not used - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -static void flush_tlb_all_ipi(void *info) -{ - __flush_tlb_all(); -} - -/*==========================================================================* - * Name: smp_flush_tlb_mm - * - * Description: This routine flushes the specified mm context TLB's. - * - * Born on Date: 2002.02.05 - * - * Arguments: *mm - a pointer to the mm struct for flush TLB - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_flush_tlb_mm(struct mm_struct *mm) -{ - int cpu_id; - cpumask_t cpu_mask; - unsigned long *mmc; - unsigned long flags; - - preempt_disable(); - cpu_id = smp_processor_id(); - mmc = &mm->context[cpu_id]; - cpumask_copy(&cpu_mask, mm_cpumask(mm)); - cpumask_clear_cpu(cpu_id, &cpu_mask); - - if (*mmc != NO_CONTEXT) { - local_irq_save(flags); - *mmc = NO_CONTEXT; - if (mm == current->mm) - activate_context(mm); - else - cpumask_clear_cpu(cpu_id, mm_cpumask(mm)); - local_irq_restore(flags); - } - if (!cpumask_empty(&cpu_mask)) - flush_tlb_others(cpu_mask, mm, NULL, FLUSH_ALL); - - preempt_enable(); -} - -/*==========================================================================* - * Name: smp_flush_tlb_range - * - * Description: This routine flushes a range of pages. - * - * Born on Date: 2002.02.05 - * - * Arguments: *mm - a pointer to the mm struct for flush TLB - * start - not used - * end - not used - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, - unsigned long end) -{ - smp_flush_tlb_mm(vma->vm_mm); -} - -/*==========================================================================* - * Name: smp_flush_tlb_page - * - * Description: This routine flushes one page. - * - * Born on Date: 2002.02.05 - * - * Arguments: *vma - a pointer to the vma struct include va - * va - virtual address for flush TLB - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long va) -{ - struct mm_struct *mm = vma->vm_mm; - int cpu_id; - cpumask_t cpu_mask; - unsigned long *mmc; - unsigned long flags; - - preempt_disable(); - cpu_id = smp_processor_id(); - mmc = &mm->context[cpu_id]; - cpumask_copy(&cpu_mask, mm_cpumask(mm)); - cpumask_clear_cpu(cpu_id, &cpu_mask); - -#ifdef DEBUG_SMP - if (!mm) - BUG(); -#endif - - if (*mmc != NO_CONTEXT) { - local_irq_save(flags); - va &= PAGE_MASK; - va |= (*mmc & MMU_CONTEXT_ASID_MASK); - __flush_tlb_page(va); - local_irq_restore(flags); - } - if (!cpumask_empty(&cpu_mask)) - flush_tlb_others(cpu_mask, mm, vma, va); - - preempt_enable(); -} - -/*==========================================================================* - * Name: flush_tlb_others - * - * Description: This routine requests other CPU to execute flush TLB. - * 1.Setup parameters. - * 2.Send 'INVALIDATE_TLB_IPI' to other CPU. - * Request other CPU to execute 'smp_invalidate_interrupt()'. - * 3.Wait for other CPUs operation finished. - * - * Born on Date: 2002.02.05 - * - * Arguments: cpumask - bitmap of target CPUs - * *mm - a pointer to the mm struct for flush TLB - * *vma - a pointer to the vma struct include va - * va - virtual address for flush TLB - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm, - struct vm_area_struct *vma, unsigned long va) -{ - unsigned long *mask; -#ifdef DEBUG_SMP - unsigned long flags; - __save_flags(flags); - if (!(flags & 0x0040)) /* Interrupt Disable NONONO */ - BUG(); -#endif /* DEBUG_SMP */ - - /* - * A couple of (to be removed) sanity checks: - * - * - we do not send IPIs to not-yet booted CPUs. - * - current CPU must not be in mask - * - mask must exist :) - */ - BUG_ON(cpumask_empty(&cpumask)); - - BUG_ON(cpumask_test_cpu(smp_processor_id(), &cpumask)); - BUG_ON(!mm); - - /* If a CPU which we ran on has gone down, OK. */ - cpumask_and(&cpumask, &cpumask, cpu_online_mask); - if (cpumask_empty(&cpumask)) - return; - - /* - * i'm not happy about this global shared spinlock in the - * MM hot path, but we'll see how contended it is. - * Temporarily this turns IRQs off, so that lockups are - * detected by the NMI watchdog. - */ - spin_lock(&tlbstate_lock); - - flush_mm = mm; - flush_vma = vma; - flush_va = va; - mask=cpumask_bits(&cpumask); - atomic_or(*mask, (atomic_t *)&flush_cpumask); - - /* - * We have to send the IPI only to - * CPUs affected. - */ - send_IPI_mask(&cpumask, INVALIDATE_TLB_IPI, 0); - - while (!cpumask_empty(&flush_cpumask)) { - /* nothing. lockup detection does not belong here */ - mb(); - } - - flush_mm = NULL; - flush_vma = NULL; - flush_va = 0; - spin_unlock(&tlbstate_lock); -} - -/*==========================================================================* - * Name: smp_invalidate_interrupt - * - * Description: This routine executes on CPU which received - * 'INVALIDATE_TLB_IPI'. - * 1.Flush local TLB. - * 2.Report flush TLB process was finished. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_invalidate_interrupt(void) -{ - int cpu_id = smp_processor_id(); - unsigned long *mmc = &flush_mm->context[cpu_id]; - - if (!cpumask_test_cpu(cpu_id, &flush_cpumask)) - return; - - if (flush_va == FLUSH_ALL) { - *mmc = NO_CONTEXT; - if (flush_mm == current->active_mm) - activate_context(flush_mm); - else - cpumask_clear_cpu(cpu_id, mm_cpumask(flush_mm)); - } else { - unsigned long va = flush_va; - - if (*mmc != NO_CONTEXT) { - va &= PAGE_MASK; - va |= (*mmc & MMU_CONTEXT_ASID_MASK); - __flush_tlb_page(va); - } - } - cpumask_clear_cpu(cpu_id, &flush_cpumask); -} - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Stop CPU request Routines */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -/*==========================================================================* - * Name: smp_send_stop - * - * Description: This routine requests stop all CPUs. - * 1.Request other CPU to execute 'stop_this_cpu()'. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_send_stop(void) -{ - smp_call_function(stop_this_cpu, NULL, 0); -} - -/*==========================================================================* - * Name: stop_this_cpu - * - * Description: This routine halt CPU. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -static void stop_this_cpu(void *dummy) -{ - int cpu_id = smp_processor_id(); - - /* - * Remove this CPU: - */ - set_cpu_online(cpu_id, false); - - /* - * PSW IE = 1; - * IMASK = 0; - * goto SLEEP - */ - local_irq_disable(); - outl(0, M32R_ICU_IMASK_PORTL); - inl(M32R_ICU_IMASK_PORTL); /* dummy read */ - local_irq_enable(); - - for ( ; ; ); -} - -void arch_send_call_function_ipi_mask(const struct cpumask *mask) -{ - send_IPI_mask(mask, CALL_FUNCTION_IPI, 0); -} - -void arch_send_call_function_single_ipi(int cpu) -{ - send_IPI_mask(cpumask_of(cpu), CALL_FUNC_SINGLE_IPI, 0); -} - -/*==========================================================================* - * Name: smp_call_function_interrupt - * - * Description: This routine executes on CPU which received - * 'CALL_FUNCTION_IPI'. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_call_function_interrupt(void) -{ - irq_enter(); - generic_smp_call_function_interrupt(); - irq_exit(); -} - -void smp_call_function_single_interrupt(void) -{ - irq_enter(); - generic_smp_call_function_single_interrupt(); - irq_exit(); -} - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Timer Routines */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -/*==========================================================================* - * Name: smp_send_timer - * - * Description: This routine sends a 'LOCAL_TIMER_IPI' to all other CPUs - * in the system. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_send_timer(void) -{ - send_IPI_allbutself(LOCAL_TIMER_IPI, 1); -} - -/*==========================================================================* - * Name: smp_send_timer - * - * Description: This routine executes on CPU which received - * 'LOCAL_TIMER_IPI'. - * - * Born on Date: 2002.02.05 - * - * Arguments: *regs - a pointer to the saved regster info - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -void smp_ipi_timer_interrupt(struct pt_regs *regs) -{ - struct pt_regs *old_regs; - old_regs = set_irq_regs(regs); - irq_enter(); - smp_local_timer_interrupt(); - irq_exit(); - set_irq_regs(old_regs); -} - -/*==========================================================================* - * Name: smp_local_timer_interrupt - * - * Description: Local timer interrupt handler. It does both profiling and - * process statistics/rescheduling. - * We do profiling in every local tick, statistics/rescheduling - * happen only every 'profiling multiplier' ticks. The default - * multiplier is 1 and it can be changed by writing the new - * multiplier value into /proc/profile. - * - * Born on Date: 2002.02.05 - * - * Arguments: *regs - a pointer to the saved regster info - * - * Returns: void (cannot fail) - * - * Original: arch/i386/kernel/apic.c - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * 2003-06-24 hy use per_cpu structure. - *==========================================================================*/ -void smp_local_timer_interrupt(void) -{ - int user = user_mode(get_irq_regs()); - int cpu_id = smp_processor_id(); - - /* - * The profiling function is SMP safe. (nothing can mess - * around with "current", and the profiling counters are - * updated with atomic operations). This is especially - * useful with a profiling multiplier != 1 - */ - - profile_tick(CPU_PROFILING); - - if (--per_cpu(prof_counter, cpu_id) <= 0) { - /* - * The multiplier may have changed since the last time we got - * to this point as a result of the user writing to - * /proc/profile. In this case we need to adjust the APIC - * timer accordingly. - * - * Interrupts are already masked off at this point. - */ - per_cpu(prof_counter, cpu_id) - = per_cpu(prof_multiplier, cpu_id); - if (per_cpu(prof_counter, cpu_id) - != per_cpu(prof_old_multiplier, cpu_id)) - { - per_cpu(prof_old_multiplier, cpu_id) - = per_cpu(prof_counter, cpu_id); - } - - update_process_times(user); - } -} - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Send IPI Routines */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -/*==========================================================================* - * Name: send_IPI_allbutself - * - * Description: This routine sends a IPI to all other CPUs in the system. - * - * Born on Date: 2002.02.05 - * - * Arguments: ipi_num - Number of IPI - * try - 0 : Send IPI certainly. - * !0 : The following IPI is not sent when Target CPU - * has not received the before IPI. - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -static void send_IPI_allbutself(int ipi_num, int try) -{ - cpumask_t cpumask; - - cpumask_copy(&cpumask, cpu_online_mask); - cpumask_clear_cpu(smp_processor_id(), &cpumask); - - send_IPI_mask(&cpumask, ipi_num, try); -} - -/*==========================================================================* - * Name: send_IPI_mask - * - * Description: This routine sends a IPI to CPUs in the system. - * - * Born on Date: 2002.02.05 - * - * Arguments: cpu_mask - Bitmap of target CPUs logical ID - * ipi_num - Number of IPI - * try - 0 : Send IPI certainly. - * !0 : The following IPI is not sent when Target CPU - * has not received the before IPI. - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -static void send_IPI_mask(const struct cpumask *cpumask, int ipi_num, int try) -{ - cpumask_t physid_mask, tmp; - int cpu_id, phys_id; - int num_cpus = num_online_cpus(); - - if (num_cpus <= 1) /* NO MP */ - return; - - cpumask_and(&tmp, cpumask, cpu_online_mask); - BUG_ON(!cpumask_equal(cpumask, &tmp)); - - cpumask_clear(&physid_mask); - for_each_cpu(cpu_id, cpumask) { - if ((phys_id = cpu_to_physid(cpu_id)) != -1) - cpumask_set_cpu(phys_id, &physid_mask); - } - - send_IPI_mask_phys(&physid_mask, ipi_num, try); -} - -/*==========================================================================* - * Name: send_IPI_mask_phys - * - * Description: This routine sends a IPI to other CPUs in the system. - * - * Born on Date: 2002.02.05 - * - * Arguments: cpu_mask - Bitmap of target CPUs physical ID - * ipi_num - Number of IPI - * try - 0 : Send IPI certainly. - * !0 : The following IPI is not sent when Target CPU - * has not received the before IPI. - * - * Returns: IPICRi regster value. - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * - *==========================================================================*/ -unsigned long send_IPI_mask_phys(const cpumask_t *physid_mask, int ipi_num, - int try) -{ - spinlock_t *ipilock; - volatile unsigned long *ipicr_addr; - unsigned long ipicr_val; - unsigned long my_physid_mask; - unsigned long mask = cpumask_bits(physid_mask)[0]; - - - if (mask & ~physids_coerce(phys_cpu_present_map)) - BUG(); - if (ipi_num >= NR_IPIS || ipi_num < 0) - BUG(); - - mask <<= IPI_SHIFT; - ipilock = &ipi_lock[ipi_num]; - ipicr_addr = (volatile unsigned long *)(M32R_ICU_IPICR_ADDR - + (ipi_num << 2)); - my_physid_mask = ~(1 << smp_processor_id()); - - /* - * lock ipi_lock[i] - * check IPICRi == 0 - * write IPICRi (send IPIi) - * unlock ipi_lock[i] - */ - spin_lock(ipilock); - __asm__ __volatile__ ( - ";; CHECK IPICRi == 0 \n\t" - ".fillinsn \n" - "1: \n\t" - "ld %0, @%1 \n\t" - "and %0, %4 \n\t" - "beqz %0, 2f \n\t" - "bnez %3, 3f \n\t" - "bra 1b \n\t" - ";; WRITE IPICRi (send IPIi) \n\t" - ".fillinsn \n" - "2: \n\t" - "st %2, @%1 \n\t" - ".fillinsn \n" - "3: \n\t" - : "=&r"(ipicr_val) - : "r"(ipicr_addr), "r"(mask), "r"(try), "r"(my_physid_mask) - : "memory" - ); - spin_unlock(ipilock); - - return ipicr_val; -} diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c deleted file mode 100644 index a7d04684d2c7..000000000000 --- a/arch/m32r/kernel/smpboot.c +++ /dev/null @@ -1,627 +0,0 @@ -/* - * linux/arch/m32r/kernel/smpboot.c - * orig : i386 2.4.10 - * - * M32R SMP booting functions - * - * Copyright (c) 2001, 2002, 2003 Hitoshi Yamamoto - * - * Taken from i386 version. - * (c) 1995 Alan Cox, Building #3 - * (c) 1998, 1999, 2000 Ingo Molnar - * - * Much of the core SMP work is based on previous work by Thomas Radke, to - * whom a great many thanks are extended. - * - * Thanks to Intel for making available several different Pentium, - * Pentium Pro and Pentium-II/Xeon MP machines. - * Original development of Linux SMP code supported by Caldera. - * - * This code is released under the GNU General Public License version 2 or - * later. - * - * Fixes - * Felix Koop : NR_CPUS used properly - * Jose Renau : Handle single CPU case. - * Alan Cox : By repeated request - * 8) - Total BogoMIP report. - * Greg Wright : Fix for kernel stacks panic. - * Erich Boleyn : MP v1.4 and additional changes. - * Matthias Sattler : Changes for 2.1 kernel map. - * Michel Lespinasse : Changes for 2.1 kernel map. - * Michael Chastain : Change trampoline.S to gnu as. - * Alan Cox : Dumb bug: 'B' step PPro's are fine - * Ingo Molnar : Added APIC timers, based on code - * from Jose Renau - * Ingo Molnar : various cleanups and rewrites - * Tigran Aivazian : fixed "0.00 in /proc/uptime on SMP" bug. - * Maciej W. Rozycki : Bits for genuine 82489DX APICs - * Martin J. Bligh : Added support for multi-quad systems - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define DEBUG_SMP -#ifdef DEBUG_SMP -#define Dprintk(x...) printk(x) -#else -#define Dprintk(x...) -#endif - -extern cpumask_t cpu_initialized; - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Data structures and variables */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -/* Processor that is doing the boot up */ -static unsigned int bsp_phys_id = -1; - -/* Bitmask of physically existing CPUs */ -physid_mask_t phys_cpu_present_map; - -cpumask_t cpu_bootout_map; -cpumask_t cpu_bootin_map; -static cpumask_t cpu_callin_map; -cpumask_t cpu_callout_map; -EXPORT_SYMBOL(cpu_callout_map); - -/* Per CPU bogomips and other parameters */ -struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned; - -static int cpucount; -static cpumask_t smp_commenced_mask; - -extern struct { - void * spi; - unsigned short ss; -} stack_start; - -/* which physical physical ID maps to which logical CPU number */ -static volatile int physid_2_cpu[NR_CPUS]; -#define physid_to_cpu(physid) physid_2_cpu[physid] - -/* which logical CPU number maps to which physical ID */ -volatile int cpu_2_physid[NR_CPUS]; - -DEFINE_PER_CPU(int, prof_multiplier) = 1; -DEFINE_PER_CPU(int, prof_old_multiplier) = 1; -DEFINE_PER_CPU(int, prof_counter) = 1; - -spinlock_t ipi_lock[NR_IPIS]; - -static unsigned int calibration_result; - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Function Prototypes */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -static void init_ipi_lock(void); -static void do_boot_cpu(int); - -int start_secondary(void *); -static void smp_callin(void); -static void smp_online(void); - -static void show_mp_info(int); -static void smp_store_cpu_info(int); -static void show_cpu_info(int); -int setup_profiling_timer(unsigned int); -static void init_cpu_to_physid(void); -static void map_cpu_to_physid(int, int); -static void unmap_cpu_to_physid(int, int); - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Boot up APs Routines : BSP */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -void smp_prepare_boot_cpu(void) -{ - bsp_phys_id = hard_smp_processor_id(); - physid_set(bsp_phys_id, phys_cpu_present_map); - set_cpu_online(0, true); /* BSP's cpu_id == 0 */ - cpumask_set_cpu(0, &cpu_callout_map); - cpumask_set_cpu(0, &cpu_callin_map); - - /* - * Initialize the logical to physical CPU number mapping - */ - init_cpu_to_physid(); - map_cpu_to_physid(0, bsp_phys_id); - current_thread_info()->cpu = 0; -} - -/*==========================================================================* - * Name: smp_prepare_cpus (old smp_boot_cpus) - * - * Description: This routine boot up APs. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * 2003-06-24 hy modify for linux-2.5.69 - * - *==========================================================================*/ -void __init smp_prepare_cpus(unsigned int max_cpus) -{ - int phys_id; - unsigned long nr_cpu; - - nr_cpu = inl(M32R_FPGA_NUM_OF_CPUS_PORTL); - if (nr_cpu > NR_CPUS) { - printk(KERN_INFO "NUM_OF_CPUS reg. value [%ld] > NR_CPU [%d]", - nr_cpu, NR_CPUS); - goto smp_done; - } - for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++) - physid_set(phys_id, phys_cpu_present_map); -#ifndef CONFIG_HOTPLUG_CPU - init_cpu_present(cpu_possible_mask); -#endif - - show_mp_info(nr_cpu); - - init_ipi_lock(); - - /* - * Setup boot CPU information - */ - smp_store_cpu_info(0); /* Final full version of the data */ - - /* - * If SMP should be disabled, then really disable it! - */ - if (!max_cpus) { - printk(KERN_INFO "SMP mode deactivated by commandline.\n"); - goto smp_done; - } - - /* - * Now scan the CPU present map and fire up the other CPUs. - */ - Dprintk("CPU present map : %lx\n", physids_coerce(phys_cpu_present_map)); - - for (phys_id = 0 ; phys_id < NR_CPUS ; phys_id++) { - /* - * Don't even attempt to start the boot CPU! - */ - if (phys_id == bsp_phys_id) - continue; - - if (!physid_isset(phys_id, phys_cpu_present_map)) - continue; - - if (max_cpus <= cpucount + 1) - continue; - - do_boot_cpu(phys_id); - - /* - * Make sure we unmap all failed CPUs - */ - if (physid_to_cpu(phys_id) == -1) { - physid_clear(phys_id, phys_cpu_present_map); - printk("phys CPU#%d not responding - " \ - "cannot use it.\n", phys_id); - } - } - -smp_done: - Dprintk("Boot done.\n"); -} - -/* - * init_ipi_lock : Initialize IPI locks. - */ -static void __init init_ipi_lock(void) -{ - int ipi; - - for (ipi = 0 ; ipi < NR_IPIS ; ipi++) - spin_lock_init(&ipi_lock[ipi]); -} - -/*==========================================================================* - * Name: do_boot_cpu - * - * Description: This routine boot up one AP. - * - * Born on Date: 2002.02.05 - * - * Arguments: phys_id - Target CPU physical ID - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * 2003-06-24 hy modify for linux-2.5.69 - * - *==========================================================================*/ -static void __init do_boot_cpu(int phys_id) -{ - struct task_struct *idle; - unsigned long send_status, boot_status; - int timeout, cpu_id; - - cpu_id = ++cpucount; - - /* - * We can't use kernel_thread since we must avoid to - * reschedule the child. - */ - idle = fork_idle(cpu_id); - if (IS_ERR(idle)) - panic("failed fork for CPU#%d.", cpu_id); - - idle->thread.lr = (unsigned long)start_secondary; - - map_cpu_to_physid(cpu_id, phys_id); - - /* So we see what's up */ - printk("Booting processor %d/%d\n", phys_id, cpu_id); - stack_start.spi = (void *)idle->thread.sp; - task_thread_info(idle)->cpu = cpu_id; - - /* - * Send Startup IPI - * 1.IPI received by CPU#(phys_id). - * 2.CPU#(phys_id) enter startup_AP (arch/m32r/kernel/head.S) - * 3.CPU#(phys_id) enter start_secondary() - */ - send_status = 0; - boot_status = 0; - - cpumask_set_cpu(phys_id, &cpu_bootout_map); - - /* Send Startup IPI */ - send_IPI_mask_phys(cpumask_of(phys_id), CPU_BOOT_IPI, 0); - - Dprintk("Waiting for send to finish...\n"); - timeout = 0; - - /* Wait 100[ms] */ - do { - Dprintk("+"); - udelay(1000); - send_status = !cpumask_test_cpu(phys_id, &cpu_bootin_map); - } while (send_status && (timeout++ < 100)); - - Dprintk("After Startup.\n"); - - if (!send_status) { - /* - * allow APs to start initializing. - */ - Dprintk("Before Callout %d.\n", cpu_id); - cpumask_set_cpu(cpu_id, &cpu_callout_map); - Dprintk("After Callout %d.\n", cpu_id); - - /* - * Wait 5s total for a response - */ - for (timeout = 0; timeout < 5000; timeout++) { - if (cpumask_test_cpu(cpu_id, &cpu_callin_map)) - break; /* It has booted */ - udelay(1000); - } - - if (cpumask_test_cpu(cpu_id, &cpu_callin_map)) { - /* number CPUs logically, starting from 1 (BSP is 0) */ - Dprintk("OK.\n"); - } else { - boot_status = 1; - printk("Not responding.\n"); - } - } else - printk("IPI never delivered???\n"); - - if (send_status || boot_status) { - unmap_cpu_to_physid(cpu_id, phys_id); - cpumask_clear_cpu(cpu_id, &cpu_callout_map); - cpumask_clear_cpu(cpu_id, &cpu_callin_map); - cpumask_clear_cpu(cpu_id, &cpu_initialized); - cpucount--; - } -} - -int __cpu_up(unsigned int cpu_id, struct task_struct *tidle) -{ - int timeout; - - cpumask_set_cpu(cpu_id, &smp_commenced_mask); - - /* - * Wait 5s total for a response - */ - for (timeout = 0; timeout < 5000; timeout++) { - if (cpu_online(cpu_id)) - break; - udelay(1000); - } - if (!cpu_online(cpu_id)) - BUG(); - - return 0; -} - -void __init smp_cpus_done(unsigned int max_cpus) -{ - int cpu_id, timeout; - unsigned long bogosum = 0; - - for (timeout = 0; timeout < 5000; timeout++) { - if (cpumask_equal(&cpu_callin_map, cpu_online_mask)) - break; - udelay(1000); - } - if (!cpumask_equal(&cpu_callin_map, cpu_online_mask)) - BUG(); - - for_each_online_cpu(cpu_id) - show_cpu_info(cpu_id); - - /* - * Allow the user to impress friends. - */ - Dprintk("Before bogomips.\n"); - if (cpucount) { - for_each_cpu(cpu_id,cpu_online_mask) - bogosum += cpu_data[cpu_id].loops_per_jiffy; - - printk(KERN_INFO "Total of %d processors activated " \ - "(%lu.%02lu BogoMIPS).\n", cpucount + 1, - bogosum / (500000 / HZ), - (bogosum / (5000 / HZ)) % 100); - Dprintk("Before bogocount - setting activated=1.\n"); - } -} - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Activate a secondary processor Routines */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ - -/*==========================================================================* - * Name: start_secondary - * - * Description: This routine activate a secondary processor. - * - * Born on Date: 2002.02.05 - * - * Arguments: *unused - currently unused. - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * 2003-06-24 hy modify for linux-2.5.69 - * - *==========================================================================*/ -int __init start_secondary(void *unused) -{ - cpu_init(); - preempt_disable(); - smp_callin(); - while (!cpumask_test_cpu(smp_processor_id(), &smp_commenced_mask)) - cpu_relax(); - - smp_online(); - - /* - * low-memory mappings have been cleared, flush them from - * the local TLBs too. - */ - local_flush_tlb_all(); - - cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); - return 0; -} - -/*==========================================================================* - * Name: smp_callin - * - * Description: This routine activate a secondary processor. - * - * Born on Date: 2002.02.05 - * - * Arguments: NONE - * - * Returns: void (cannot fail) - * - * Modification log: - * Date Who Description - * ---------- --- -------------------------------------------------------- - * 2003-06-24 hy modify for linux-2.5.69 - * - *==========================================================================*/ -static void __init smp_callin(void) -{ - int phys_id = hard_smp_processor_id(); - int cpu_id = smp_processor_id(); - unsigned long timeout; - - if (cpumask_test_cpu(cpu_id, &cpu_callin_map)) { - printk("huh, phys CPU#%d, CPU#%d already present??\n", - phys_id, cpu_id); - BUG(); - } - Dprintk("CPU#%d (phys ID: %d) waiting for CALLOUT\n", cpu_id, phys_id); - - /* Waiting 2s total for startup (udelay is not yet working) */ - timeout = jiffies + (2 * HZ); - while (time_before(jiffies, timeout)) { - /* Has the boot CPU finished it's STARTUP sequence ? */ - if (cpumask_test_cpu(cpu_id, &cpu_callout_map)) - break; - cpu_relax(); - } - - if (!time_before(jiffies, timeout)) { - printk("BUG: CPU#%d started up but did not get a callout!\n", - cpu_id); - BUG(); - } - - /* Allow the master to continue. */ - cpumask_set_cpu(cpu_id, &cpu_callin_map); -} - -static void __init smp_online(void) -{ - int cpu_id = smp_processor_id(); - - notify_cpu_starting(cpu_id); - - local_irq_enable(); - - /* Get our bogomips. */ - calibrate_delay(); - - /* Save our processor parameters */ - smp_store_cpu_info(cpu_id); - - set_cpu_online(cpu_id, true); -} - -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -/* Boot up CPUs common Routines */ -/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -static void __init show_mp_info(int nr_cpu) -{ - int i; - char cpu_model0[17], cpu_model1[17], cpu_ver[9]; - - strncpy(cpu_model0, (char *)M32R_FPGA_CPU_NAME_ADDR, 16); - strncpy(cpu_model1, (char *)M32R_FPGA_MODEL_ID_ADDR, 16); - strncpy(cpu_ver, (char *)M32R_FPGA_VERSION_ADDR, 8); - - cpu_model0[16] = '\0'; - for (i = 15 ; i >= 0 ; i--) { - if (cpu_model0[i] != ' ') - break; - cpu_model0[i] = '\0'; - } - cpu_model1[16] = '\0'; - for (i = 15 ; i >= 0 ; i--) { - if (cpu_model1[i] != ' ') - break; - cpu_model1[i] = '\0'; - } - cpu_ver[8] = '\0'; - for (i = 7 ; i >= 0 ; i--) { - if (cpu_ver[i] != ' ') - break; - cpu_ver[i] = '\0'; - } - - printk(KERN_INFO "M32R-mp information\n"); - printk(KERN_INFO " On-chip CPUs : %d\n", nr_cpu); - printk(KERN_INFO " CPU model : %s/%s(%s)\n", cpu_model0, - cpu_model1, cpu_ver); -} - -/* - * The bootstrap kernel entry code has set these up. Save them for - * a given CPU - */ -static void __init smp_store_cpu_info(int cpu_id) -{ - struct cpuinfo_m32r *ci = cpu_data + cpu_id; - - *ci = boot_cpu_data; - ci->loops_per_jiffy = loops_per_jiffy; -} - -static void __init show_cpu_info(int cpu_id) -{ - struct cpuinfo_m32r *ci = &cpu_data[cpu_id]; - - printk("CPU#%d : ", cpu_id); - -#define PRINT_CLOCK(name, value) \ - printk(name " clock %d.%02dMHz", \ - ((value) / 1000000), ((value) % 1000000) / 10000) - - PRINT_CLOCK("CPU", (int)ci->cpu_clock); - PRINT_CLOCK(", Bus", (int)ci->bus_clock); - printk(", loops_per_jiffy[%ld]\n", ci->loops_per_jiffy); -} - -/* - * the frequency of the profiling timer can be changed - * by writing a multiplier value into /proc/profile. - */ -int setup_profiling_timer(unsigned int multiplier) -{ - int i; - - /* - * Sanity check. [at least 500 APIC cycles should be - * between APIC interrupts as a rule of thumb, to avoid - * irqs flooding us] - */ - if ( (!multiplier) || (calibration_result / multiplier < 500)) - return -EINVAL; - - /* - * Set the new multiplier for each CPU. CPUs don't start using the - * new values until the next timer interrupt in which they do process - * accounting. At that time they also adjust their APIC timers - * accordingly. - */ - for_each_possible_cpu(i) - per_cpu(prof_multiplier, i) = multiplier; - - return 0; -} - -/* Initialize all maps between cpu number and apicids */ -static void __init init_cpu_to_physid(void) -{ - int i; - - for (i = 0 ; i < NR_CPUS ; i++) { - cpu_2_physid[i] = -1; - physid_2_cpu[i] = -1; - } -} - -/* - * set up a mapping between cpu and apicid. Uses logical apicids for multiquad, - * else physical apic ids - */ -static void __init map_cpu_to_physid(int cpu_id, int phys_id) -{ - physid_2_cpu[phys_id] = cpu_id; - cpu_2_physid[cpu_id] = phys_id; -} - -/* - * undo a mapping between cpu and apicid. Uses logical apicids for multiquad, - * else physical apic ids - */ -static void __init unmap_cpu_to_physid(int cpu_id, int phys_id) -{ - physid_2_cpu[phys_id] = -1; - cpu_2_physid[cpu_id] = -1; -} diff --git a/arch/m32r/kernel/sys_m32r.c b/arch/m32r/kernel/sys_m32r.c deleted file mode 100644 index 22a50fc49ab7..000000000000 --- a/arch/m32r/kernel/sys_m32r.c +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/kernel/sys_m32r.c - * - * This file contains various random system calls that - * have a non-standard calling sequence on the Linux/M32R platform. - * - * Taken from i386 version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* - * sys_tas() - test-and-set - */ -asmlinkage int sys_tas(int __user *addr) -{ - int oldval; - - if (!access_ok(VERIFY_WRITE, addr, sizeof (int))) - return -EFAULT; - - /* atomic operation: - * oldval = *addr; *addr = 1; - */ - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r4", "%1") - " .fillinsn\n" - "1:\n" - " lock %0, @%1 -> unlock %2, @%1\n" - "2:\n" - /* NOTE: - * The m32r processor can accept interrupts only - * at the 32-bit instruction boundary. - * So, in the above code, the "unlock" instruction - * can be executed continuously after the "lock" - * instruction execution without any interruptions. - */ - ".section .fixup,\"ax\"\n" - " .balign 4\n" - "3: ldi %0, #%3\n" - " seth r14, #high(2b)\n" - " or3 r14, r14, #low(2b)\n" - " jmp r14\n" - ".previous\n" - ".section __ex_table,\"a\"\n" - " .balign 4\n" - " .long 1b,3b\n" - ".previous\n" - : "=&r" (oldval) - : "r" (addr), "r" (1), "i"(-EFAULT) - : "r14", "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - - return oldval; -} - -asmlinkage int sys_cacheflush(void *addr, int bytes, int cache) -{ - /* This should flush more selectively ... */ - _flush_cache_all(); - return 0; -} - -asmlinkage int sys_cachectl(char *addr, int nbytes, int op) -{ - /* Not implemented yet. */ - return -ENOSYS; -} diff --git a/arch/m32r/kernel/syscall_table.S b/arch/m32r/kernel/syscall_table.S deleted file mode 100644 index cf0bcf014b98..000000000000 --- a/arch/m32r/kernel/syscall_table.S +++ /dev/null @@ -1,328 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -ENTRY(sys_call_table) - .long sys_restart_syscall /* 0 - old "setup()" system call*/ - .long sys_exit - .long sys_fork - .long sys_read - .long sys_write - .long sys_open /* 5 */ - .long sys_close - .long sys_waitpid - .long sys_creat - .long sys_link - .long sys_unlink /* 10 */ - .long sys_execve - .long sys_chdir - .long sys_time - .long sys_mknod - .long sys_chmod /* 15 */ - .long sys_ni_syscall /* lchown16 syscall holder */ - .long sys_ni_syscall /* old break syscall holder */ - .long sys_ni_syscall /* old stat syscall holder */ - .long sys_lseek - .long sys_getpid /* 20 */ - .long sys_mount - .long sys_oldumount - .long sys_ni_syscall /* setuid16 syscall holder */ - .long sys_ni_syscall /* getuid16 syscall holder */ - .long sys_stime /* 25 */ - .long sys_ptrace - .long sys_alarm - .long sys_ni_syscall /* old fstat syscall holder */ - .long sys_pause - .long sys_utime /* 30 */ - .long sys_ni_syscall /* old stty syscall holder */ - .long sys_cachectl /* for M32R */ /* old gtty syscall holder */ - .long sys_access - .long sys_ni_syscall /* nice syscall holder */ - .long sys_ni_syscall /* 35 - old ftime syscall holder */ - .long sys_sync - .long sys_kill - .long sys_rename - .long sys_mkdir - .long sys_rmdir /* 40 */ - .long sys_dup - .long sys_pipe - .long sys_times - .long sys_ni_syscall /* old prof syscall holder */ - .long sys_brk /* 45 */ - .long sys_ni_syscall /* setgid16 syscall holder */ - .long sys_getgid /* will be unused */ - .long sys_ni_syscall /* signal syscall holder */ - .long sys_ni_syscall /* geteuid16 syscall holder */ - .long sys_ni_syscall /* 50 - getegid16 syscall holder */ - .long sys_acct - .long sys_umount /* recycled never used phys() */ - .long sys_ni_syscall /* old lock syscall holder */ - .long sys_ioctl - .long sys_fcntl /* 55 - will be unused */ - .long sys_ni_syscall /* mpx syscall holder */ - .long sys_setpgid - .long sys_ni_syscall /* old ulimit syscall holder */ - .long sys_ni_syscall /* sys_olduname */ - .long sys_umask /* 60 */ - .long sys_chroot - .long sys_ustat - .long sys_dup2 - .long sys_getppid - .long sys_getpgrp /* 65 */ - .long sys_setsid - .long sys_ni_syscall /* sigaction syscall holder */ - .long sys_ni_syscall /* sgetmask syscall holder */ - .long sys_ni_syscall /* ssetmask syscall holder */ - .long sys_ni_syscall /* 70 - setreuid16 syscall holder */ - .long sys_ni_syscall /* setregid16 syscall holder */ - .long sys_ni_syscall /* sigsuspend syscall holder */ - .long sys_ni_syscall /* sigpending syscall holder */ - .long sys_sethostname - .long sys_setrlimit /* 75 */ - .long sys_getrlimit/*will be unused*/ - .long sys_getrusage - .long sys_gettimeofday - .long sys_settimeofday - .long sys_ni_syscall /* 80 - getgroups16 syscall holder */ - .long sys_ni_syscall /* setgroups16 syscall holder */ - .long sys_ni_syscall /* sys_oldselect */ - .long sys_symlink - .long sys_ni_syscall /* old lstat syscall holder */ - .long sys_readlink /* 85 */ - .long sys_uselib - .long sys_swapon - .long sys_reboot - .long sys_ni_syscall /* readdir syscall holder */ - .long sys_ni_syscall /* 90 - old_mmap syscall holder */ - .long sys_munmap - .long sys_truncate - .long sys_ftruncate - .long sys_fchmod - .long sys_ni_syscall /* 95 - fchwon16 syscall holder */ - .long sys_getpriority - .long sys_setpriority - .long sys_ni_syscall /* old profil syscall holder */ - .long sys_statfs - .long sys_fstatfs /* 100 */ - .long sys_ni_syscall /* ioperm syscall holder */ - .long sys_socketcall - .long sys_syslog - .long sys_setitimer - .long sys_getitimer /* 105 */ - .long sys_newstat - .long sys_newlstat - .long sys_newfstat - .long sys_ni_syscall /* old uname syscall holder */ - .long sys_ni_syscall /* 110 - iopl syscall holder */ - .long sys_vhangup - .long sys_ni_syscall /* idle syscall holder */ - .long sys_ni_syscall /* vm86old syscall holder */ - .long sys_wait4 - .long sys_swapoff /* 115 */ - .long sys_sysinfo - .long sys_ipc - .long sys_fsync - .long sys_ni_syscall /* sigreturn syscall holder */ - .long sys_clone /* 120 */ - .long sys_setdomainname - .long sys_newuname - .long sys_ni_syscall /* modify_ldt syscall holder */ - .long sys_adjtimex - .long sys_mprotect /* 125 */ - .long sys_ni_syscall /* sigprocmask syscall holder */ - .long sys_ni_syscall /* create_module syscall holder */ - .long sys_init_module - .long sys_delete_module - .long sys_ni_syscall /* 130 - get_kernel_syms */ - .long sys_quotactl - .long sys_getpgid - .long sys_fchdir - .long sys_bdflush - .long sys_sysfs /* 135 */ - .long sys_personality - .long sys_ni_syscall /* afs_syscall syscall holder */ - .long sys_ni_syscall /* setfsuid16 syscall holder */ - .long sys_ni_syscall /* setfsgid16 syscall holder */ - .long sys_llseek /* 140 */ - .long sys_getdents - .long sys_select - .long sys_flock - .long sys_msync - .long sys_readv /* 145 */ - .long sys_writev - .long sys_getsid - .long sys_fdatasync - .long sys_sysctl - .long sys_mlock /* 150 */ - .long sys_munlock - .long sys_mlockall - .long sys_munlockall - .long sys_sched_setparam - .long sys_sched_getparam /* 155 */ - .long sys_sched_setscheduler - .long sys_sched_getscheduler - .long sys_sched_yield - .long sys_sched_get_priority_max - .long sys_sched_get_priority_min /* 160 */ - .long sys_sched_rr_get_interval - .long sys_nanosleep - .long sys_mremap - .long sys_ni_syscall /* setresuid16 syscall holder */ - .long sys_ni_syscall /* 165 - getresuid16 syscall holder */ - .long sys_tas /* vm86 syscall holder */ - .long sys_ni_syscall /* query_module syscall holder */ - .long sys_poll - .long sys_ni_syscall /* was nfsservctl */ - .long sys_setresgid /* 170 */ - .long sys_getresgid - .long sys_prctl - .long sys_rt_sigreturn - .long sys_rt_sigaction - .long sys_rt_sigprocmask /* 175 */ - .long sys_rt_sigpending - .long sys_rt_sigtimedwait - .long sys_rt_sigqueueinfo - .long sys_rt_sigsuspend - .long sys_pread64 /* 180 */ - .long sys_pwrite64 - .long sys_ni_syscall /* chown16 syscall holder */ - .long sys_getcwd - .long sys_capget - .long sys_capset /* 185 */ - .long sys_sigaltstack - .long sys_sendfile - .long sys_ni_syscall /* streams1 */ - .long sys_ni_syscall /* streams2 */ - .long sys_vfork /* 190 */ - .long sys_getrlimit - .long sys_mmap_pgoff - .long sys_truncate64 - .long sys_ftruncate64 - .long sys_stat64 /* 195 */ - .long sys_lstat64 - .long sys_fstat64 - .long sys_lchown - .long sys_getuid - .long sys_getgid /* 200 */ - .long sys_geteuid - .long sys_getegid - .long sys_setreuid - .long sys_setregid - .long sys_getgroups /* 205 */ - .long sys_setgroups - .long sys_fchown - .long sys_setresuid - .long sys_getresuid - .long sys_setresgid /* 210 */ - .long sys_getresgid - .long sys_chown - .long sys_setuid - .long sys_setgid - .long sys_setfsuid /* 215 */ - .long sys_setfsgid - .long sys_pivot_root - .long sys_mincore - .long sys_madvise - .long sys_getdents64 /* 220 */ - .long sys_fcntl64 - .long sys_ni_syscall /* reserved for TUX */ - .long sys_ni_syscall /* Reserved for Security */ - .long sys_gettid - .long sys_readahead /* 225 */ - .long sys_setxattr - .long sys_lsetxattr - .long sys_fsetxattr - .long sys_getxattr - .long sys_lgetxattr /* 230 */ - .long sys_fgetxattr - .long sys_listxattr - .long sys_llistxattr - .long sys_flistxattr - .long sys_removexattr /* 235 */ - .long sys_lremovexattr - .long sys_fremovexattr - .long sys_tkill - .long sys_sendfile64 - .long sys_futex /* 240 */ - .long sys_sched_setaffinity - .long sys_sched_getaffinity - .long sys_ni_syscall /* reserved for "set_thread_area" system call */ - .long sys_ni_syscall /* reserved for "get_thread_area" system call */ - .long sys_io_setup /* 245 */ - .long sys_io_destroy - .long sys_io_getevents - .long sys_io_submit - .long sys_io_cancel - .long sys_fadvise64 /* 250 */ - .long sys_ni_syscall - .long sys_exit_group - .long sys_lookup_dcookie - .long sys_epoll_create - .long sys_epoll_ctl /* 255 */ - .long sys_epoll_wait - .long sys_remap_file_pages - .long sys_set_tid_address - .long sys_timer_create - .long sys_timer_settime /* 260 */ - .long sys_timer_gettime - .long sys_timer_getoverrun - .long sys_timer_delete - .long sys_clock_settime - .long sys_clock_gettime /* 265 */ - .long sys_clock_getres - .long sys_clock_nanosleep - .long sys_statfs64 - .long sys_fstatfs64 - .long sys_tgkill /* 270 */ - .long sys_utimes - .long sys_fadvise64_64 - .long sys_ni_syscall /* Reserved for sys_vserver */ - .long sys_ni_syscall /* Reserved for sys_mbind */ - .long sys_ni_syscall /* Reserved for sys_get_mempolicy */ - .long sys_ni_syscall /* Reserved for sys_set_mempolicy */ - .long sys_mq_open - .long sys_mq_unlink - .long sys_mq_timedsend - .long sys_mq_timedreceive /* 280 */ - .long sys_mq_notify - .long sys_mq_getsetattr - .long sys_ni_syscall /* reserved for kexec */ - .long sys_waitid - .long sys_ni_syscall /* 285 */ /* available */ - .long sys_add_key - .long sys_request_key - .long sys_keyctl - .long sys_ioprio_set - .long sys_ioprio_get /* 290 */ - .long sys_inotify_init - .long sys_inotify_add_watch - .long sys_inotify_rm_watch - .long sys_migrate_pages - .long sys_openat /* 295 */ - .long sys_mkdirat - .long sys_mknodat - .long sys_fchownat - .long sys_futimesat - .long sys_fstatat64 /* 300 */ - .long sys_unlinkat - .long sys_renameat - .long sys_linkat - .long sys_symlinkat - .long sys_readlinkat /* 305 */ - .long sys_fchmodat - .long sys_faccessat - .long sys_pselect6 - .long sys_ppoll - .long sys_unshare /* 310 */ - .long sys_set_robust_list - .long sys_get_robust_list - .long sys_splice - .long sys_sync_file_range - .long sys_tee /* 315 */ - .long sys_vmsplice - .long sys_move_pages - .long sys_getcpu - .long sys_epoll_pwait - .long sys_utimensat /* 320 */ - .long sys_signalfd - .long sys_ni_syscall - .long sys_eventfd - .long sys_fallocate - .long sys_setns /* 325 */ diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c deleted file mode 100644 index 521749fbbb56..000000000000 --- a/arch/m32r/kernel/time.c +++ /dev/null @@ -1,199 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/kernel/time.c - * - * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto - * Taken from i386 version. - * Copyright (C) 1991, 1992, 1995 Linus Torvalds - * Copyright (C) 1996, 1997, 1998 Ralf Baechle - * - * This file contains the time handling details for PC-style clocks as - * found in some MIPS systems. - * - * Some code taken from sh version. - * Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka - * Copyright (C) 2000 Philipp Rumpf - */ - -#undef DEBUG_TIMER - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) -/* this needs a better home */ -DEFINE_SPINLOCK(rtc_lock); - -#ifdef CONFIG_RTC_DRV_CMOS_MODULE -EXPORT_SYMBOL(rtc_lock); -#endif -#endif /* pc-style 'CMOS' RTC support */ - -#ifdef CONFIG_SMP -extern void smp_local_timer_interrupt(void); -#endif - -#define TICK_SIZE (tick_nsec / 1000) - -/* - * Change this if you have some constant time drift - */ - -/* This is for machines which generate the exact clock. */ -#define USECS_PER_JIFFY (1000000/HZ) - -static unsigned long latch; - -static u32 m32r_gettimeoffset(void) -{ - unsigned long elapsed_time = 0; /* [us] */ - -#if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \ - || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \ - || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) -#ifndef CONFIG_SMP - - unsigned long count; - - /* timer count may underflow right here */ - count = inl(M32R_MFT2CUT_PORTL); - - if (inl(M32R_ICU_CR18_PORTL) & 0x00000100) /* underflow check */ - count = 0; - - count = (latch - count) * TICK_SIZE; - elapsed_time = DIV_ROUND_CLOSEST(count, latch); - /* NOTE: LATCH is equal to the "interval" value (= reload count). */ - -#else /* CONFIG_SMP */ - unsigned long count; - static unsigned long p_jiffies = -1; - static unsigned long p_count = 0; - - /* timer count may underflow right here */ - count = inl(M32R_MFT2CUT_PORTL); - - if (jiffies == p_jiffies && count > p_count) - count = 0; - - p_jiffies = jiffies; - p_count = count; - - count = (latch - count) * TICK_SIZE; - elapsed_time = DIV_ROUND_CLOSEST(count, latch); - /* NOTE: LATCH is equal to the "interval" value (= reload count). */ -#endif /* CONFIG_SMP */ -#elif defined(CONFIG_CHIP_M32310) -#warning do_gettimeoffse not implemented -#else -#error no chip configuration -#endif - - return elapsed_time * 1000; -} - -/* - * timer_interrupt() needs to keep up the real-time clock, - * as well as call the "xtime_update()" routine every clocktick - */ -static irqreturn_t timer_interrupt(int irq, void *dev_id) -{ -#ifndef CONFIG_SMP - profile_tick(CPU_PROFILING); -#endif - xtime_update(1); - -#ifndef CONFIG_SMP - update_process_times(user_mode(get_irq_regs())); -#endif - /* As we return to user mode fire off the other CPU schedulers.. - this is basically because we don't yet share IRQ's around. - This message is rigged to be safe on the 386 - basically it's - a hack, so don't look closely for now.. */ - -#ifdef CONFIG_SMP - smp_local_timer_interrupt(); - smp_send_timer(); -#endif - - return IRQ_HANDLED; -} - -static struct irqaction irq0 = { - .handler = timer_interrupt, - .name = "MFT2", -}; - -void read_persistent_clock(struct timespec *ts) -{ - unsigned int epoch, year, mon, day, hour, min, sec; - - sec = min = hour = day = mon = year = 0; - epoch = 0; - - year = 23; - mon = 4; - day = 17; - - /* Attempt to guess the epoch. This is the same heuristic as in rtc.c - so no stupid things will happen to timekeeping. Who knows, maybe - Ultrix also uses 1952 as epoch ... */ - if (year > 10 && year < 44) - epoch = 1980; - else if (year < 96) - epoch = 1952; - year += epoch; - - ts->tv_sec = mktime(year, mon, day, hour, min, sec); - ts->tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); -} - - -void __init time_init(void) -{ - arch_gettimeoffset = m32r_gettimeoffset; - -#if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \ - || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \ - || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) - - /* M32102 MFT setup */ - setup_irq(M32R_IRQ_MFT2, &irq0); - { - unsigned long bus_clock; - unsigned short divide; - - bus_clock = boot_cpu_data.bus_clock; - divide = boot_cpu_data.timer_divide; - latch = DIV_ROUND_CLOSEST(bus_clock/divide, HZ); - - printk("Timer start : latch = %ld\n", latch); - - outl((M32R_MFTMOD_CC_MASK | M32R_MFTMOD_TCCR \ - |M32R_MFTMOD_CSSEL011), M32R_MFT2MOD_PORTL); - outl(latch, M32R_MFT2RLD_PORTL); - outl(latch, M32R_MFT2CUT_PORTL); - outl(0, M32R_MFT2CMPRLD_PORTL); - outl((M32R_MFTCR_MFT2MSK|M32R_MFTCR_MFT2EN), M32R_MFTCR_PORTL); - } - -#elif defined(CONFIG_CHIP_M32310) -#warning time_init not implemented -#else -#error no chip configuration -#endif -} diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c deleted file mode 100644 index a6f300a208bd..000000000000 --- a/arch/m32r/kernel/traps.c +++ /dev/null @@ -1,324 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/kernel/traps.c - * - * Copyright (C) 2001, 2002 Hirokazu Takata, Hiroyuki Kondo, - * Hitoshi Yamamoto - */ - -/* - * 'traps.c' handles hardware traps and faults after we have saved some - * state in 'entry.S'. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include - -#include - -asmlinkage void alignment_check(void); -asmlinkage void ei_handler(void); -asmlinkage void rie_handler(void); -asmlinkage void debug_trap(void); -asmlinkage void cache_flushing_handler(void); -asmlinkage void ill_trap(void); - -#ifdef CONFIG_SMP -extern void smp_reschedule_interrupt(void); -extern void smp_invalidate_interrupt(void); -extern void smp_call_function_interrupt(void); -extern void smp_ipi_timer_interrupt(void); -extern void smp_flush_cache_all_interrupt(void); -extern void smp_call_function_single_interrupt(void); - -/* - * for Boot AP function - */ -asm ( - " .section .eit_vector4,\"ax\" \n" - " .global _AP_RE \n" - " .global startup_AP \n" - "_AP_RE: \n" - " .fill 32, 4, 0 \n" - "_AP_EI: bra startup_AP \n" - " .previous \n" -); -#endif /* CONFIG_SMP */ - -extern unsigned long eit_vector[]; -#define BRA_INSN(func, entry) \ - ((unsigned long)func - (unsigned long)eit_vector - entry*4)/4 \ - + 0xff000000UL - -static void set_eit_vector_entries(void) -{ - extern void default_eit_handler(void); - extern void system_call(void); - extern void pie_handler(void); - extern void ace_handler(void); - extern void tme_handler(void); - extern void _flush_cache_copyback_all(void); - - eit_vector[0] = 0xd0c00001; /* seth r0, 0x01 */ - eit_vector[1] = BRA_INSN(default_eit_handler, 1); - eit_vector[4] = 0xd0c00010; /* seth r0, 0x10 */ - eit_vector[5] = BRA_INSN(default_eit_handler, 5); - eit_vector[8] = BRA_INSN(rie_handler, 8); - eit_vector[12] = BRA_INSN(alignment_check, 12); - eit_vector[16] = BRA_INSN(ill_trap, 16); - eit_vector[17] = BRA_INSN(debug_trap, 17); - eit_vector[18] = BRA_INSN(system_call, 18); - eit_vector[19] = BRA_INSN(ill_trap, 19); - eit_vector[20] = BRA_INSN(ill_trap, 20); - eit_vector[21] = BRA_INSN(ill_trap, 21); - eit_vector[22] = BRA_INSN(ill_trap, 22); - eit_vector[23] = BRA_INSN(ill_trap, 23); - eit_vector[24] = BRA_INSN(ill_trap, 24); - eit_vector[25] = BRA_INSN(ill_trap, 25); - eit_vector[26] = BRA_INSN(ill_trap, 26); - eit_vector[27] = BRA_INSN(ill_trap, 27); - eit_vector[28] = BRA_INSN(cache_flushing_handler, 28); - eit_vector[29] = BRA_INSN(ill_trap, 29); - eit_vector[30] = BRA_INSN(ill_trap, 30); - eit_vector[31] = BRA_INSN(ill_trap, 31); - eit_vector[32] = BRA_INSN(ei_handler, 32); - eit_vector[64] = BRA_INSN(pie_handler, 64); -#ifdef CONFIG_MMU - eit_vector[68] = BRA_INSN(ace_handler, 68); - eit_vector[72] = BRA_INSN(tme_handler, 72); -#endif /* CONFIG_MMU */ -#ifdef CONFIG_SMP - eit_vector[184] = (unsigned long)smp_reschedule_interrupt; - eit_vector[185] = (unsigned long)smp_invalidate_interrupt; - eit_vector[186] = (unsigned long)smp_call_function_interrupt; - eit_vector[187] = (unsigned long)smp_ipi_timer_interrupt; - eit_vector[188] = (unsigned long)smp_flush_cache_all_interrupt; - eit_vector[189] = 0; /* CPU_BOOT_IPI */ - eit_vector[190] = (unsigned long)smp_call_function_single_interrupt; - eit_vector[191] = 0; -#endif - _flush_cache_copyback_all(); -} - -void __init trap_init(void) -{ - set_eit_vector_entries(); - - /* - * Should be a barrier for any external CPU state. - */ - cpu_init(); -} - -static int kstack_depth_to_print = 24; - -static void show_trace(struct task_struct *task, unsigned long *stack) -{ - unsigned long addr; - - if (!stack) - stack = (unsigned long*)&stack; - - printk("Call Trace: "); - while (!kstack_end(stack)) { - addr = *stack++; - if (__kernel_text_address(addr)) - printk("[<%08lx>] %pSR\n", addr, (void *)addr); - } - printk("\n"); -} - -void show_stack(struct task_struct *task, unsigned long *sp) -{ - unsigned long *stack; - int i; - - /* - * debugging aid: "show_stack(NULL);" prints the - * back trace for this cpu. - */ - - if(sp==NULL) { - if (task) - sp = (unsigned long *)task->thread.sp; - else - sp=(unsigned long*)&sp; - } - - stack = sp; - for(i=0; i < kstack_depth_to_print; i++) { - if (kstack_end(stack)) - break; - if (i && ((i % 4) == 0)) - printk("\n "); - printk("%08lx ", *stack++); - } - printk("\n"); - show_trace(task, sp); -} - -static void show_registers(struct pt_regs *regs) -{ - int i = 0; - int in_kernel = 1; - unsigned long sp; - - printk("CPU: %d\n", smp_processor_id()); - show_regs(regs); - - sp = (unsigned long) (1+regs); - if (user_mode(regs)) { - in_kernel = 0; - sp = regs->spu; - printk("SPU: %08lx\n", sp); - } else { - printk("SPI: %08lx\n", sp); - } - printk("Process %s (pid: %d, process nr: %d, stackpage=%08lx)", - current->comm, task_pid_nr(current), 0xffff & i, 4096+(unsigned long)current); - - /* - * When in-kernel, we also print out the stack and code at the - * time of the fault.. - */ - if (in_kernel) { - printk("\nStack: "); - show_stack(current, (unsigned long*) sp); - - printk("\nCode: "); - if (regs->bpc < PAGE_OFFSET) - goto bad; - - for(i=0;i<20;i++) { - unsigned char c; - if (__get_user(c, &((unsigned char*)regs->bpc)[i])) { -bad: - printk(" Bad PC value."); - break; - } - printk("%02x ", c); - } - } - printk("\n"); -} - -static DEFINE_SPINLOCK(die_lock); - -void die(const char * str, struct pt_regs * regs, long err) -{ - console_verbose(); - spin_lock_irq(&die_lock); - bust_spinlocks(1); - printk("%s: %04lx\n", str, err & 0xffff); - show_registers(regs); - bust_spinlocks(0); - spin_unlock_irq(&die_lock); - do_exit(SIGSEGV); -} - -static __inline__ void die_if_kernel(const char * str, - struct pt_regs * regs, long err) -{ - if (!user_mode(regs)) - die(str, regs, err); -} - -static __inline__ void do_trap(int trapnr, int signr, const char * str, - struct pt_regs * regs, long error_code, siginfo_t *info) -{ - if (user_mode(regs)) { - /* trap_signal */ - struct task_struct *tsk = current; - tsk->thread.error_code = error_code; - tsk->thread.trap_no = trapnr; - if (info) - force_sig_info(signr, info, tsk); - else - force_sig(signr, tsk); - return; - } else { - /* kernel_trap */ - if (!fixup_exception(regs)) - die(str, regs, error_code); - return; - } -} - -#define DO_ERROR(trapnr, signr, str, name) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ -{ \ - do_trap(trapnr, signr, NULL, regs, error_code, NULL); \ -} - -#define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ -{ \ - siginfo_t info; \ - info.si_signo = signr; \ - info.si_errno = 0; \ - info.si_code = sicode; \ - info.si_addr = (void __user *)siaddr; \ - do_trap(trapnr, signr, str, regs, error_code, &info); \ -} - -DO_ERROR( 1, SIGTRAP, "debug trap", debug_trap) -DO_ERROR_INFO(0x20, SIGILL, "reserved instruction ", rie_handler, ILL_ILLOPC, regs->bpc) -DO_ERROR_INFO(0x100, SIGILL, "privileged instruction", pie_handler, ILL_PRVOPC, regs->bpc) -DO_ERROR_INFO(-1, SIGILL, "illegal trap", ill_trap, ILL_ILLTRP, regs->bpc) - -extern int handle_unaligned_access(unsigned long, struct pt_regs *); - -/* This code taken from arch/sh/kernel/traps.c */ -asmlinkage void do_alignment_check(struct pt_regs *regs, long error_code) -{ - mm_segment_t oldfs; - unsigned long insn; - int tmp; - - oldfs = get_fs(); - - if (user_mode(regs)) { - local_irq_enable(); - current->thread.error_code = error_code; - current->thread.trap_no = 0x17; - - set_fs(USER_DS); - if (copy_from_user(&insn, (void *)regs->bpc, 4)) { - set_fs(oldfs); - goto uspace_segv; - } - tmp = handle_unaligned_access(insn, regs); - set_fs(oldfs); - - if (!tmp) - return; - - uspace_segv: - printk(KERN_NOTICE "Killing process \"%s\" due to unaligned " - "access\n", current->comm); - force_sig(SIGSEGV, current); - } else { - set_fs(KERNEL_DS); - if (copy_from_user(&insn, (void *)regs->bpc, 4)) { - set_fs(oldfs); - die("insn faulting in do_address_error", regs, 0); - } - handle_unaligned_access(insn, regs); - set_fs(oldfs); - } -} diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S deleted file mode 100644 index 7e4d957f7f7f..000000000000 --- a/arch/m32r/kernel/vmlinux.lds.S +++ /dev/null @@ -1,79 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* ld script to make M32R Linux kernel - */ - -#include -#include -#include -#include - -OUTPUT_ARCH(m32r) -#if defined(__LITTLE_ENDIAN__) - jiffies = jiffies_64; -#else - jiffies = jiffies_64 + 4; -#endif - -kernel_entry = boot - 0x80000000; -ENTRY(kernel_entry) - -SECTIONS -{ - . = CONFIG_MEMORY_START + __PAGE_OFFSET; - eit_vector = .; - - . = . + 0x1000; - .empty_zero_page : { *(.empty_zero_page) } = 0 - - /* read-only */ - _text = .; /* Text and read-only data */ - .boot : { *(.boot) } = 0 - .text : { - HEAD_TEXT - TEXT_TEXT - SCHED_TEXT - CPUIDLE_TEXT - LOCK_TEXT - *(.fixup) - *(.gnu.warning) - } = 0x9090 -#ifdef CONFIG_SMP - . = ALIGN(65536); - .eit_vector4 : { *(.eit_vector4) } -#endif - _etext = .; /* End of text section */ - - EXCEPTION_TABLE(16) - NOTES - - _sdata = .; /* Start of data section */ - RODATA - RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) - _edata = .; /* End of data section */ - - /* will be freed after init */ - . = ALIGN(PAGE_SIZE); /* Init code and data */ - __init_begin = .; - INIT_TEXT_SECTION(PAGE_SIZE) - INIT_DATA_SECTION(16) - PERCPU_SECTION(32) - . = ALIGN(PAGE_SIZE); - __init_end = .; - /* freed after init ends here */ - - BSS_SECTION(0, 0, 4) - - _end = . ; - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - /* Sections to be discarded */ - DISCARDS -} diff --git a/arch/m32r/lib/Makefile b/arch/m32r/lib/Makefile deleted file mode 100644 index 5889eb9610b5..000000000000 --- a/arch/m32r/lib/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -# Makefile for M32R-specific library files.. -# - -lib-y := checksum.o ashxdi3.o memset.o memcpy.o \ - delay.o strlen.o usercopy.o csum_partial_copy.o \ - ucmpdi2.o diff --git a/arch/m32r/lib/ashxdi3.S b/arch/m32r/lib/ashxdi3.S deleted file mode 100644 index cd1acca53911..000000000000 --- a/arch/m32r/lib/ashxdi3.S +++ /dev/null @@ -1,294 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/lib/ashxdi3.S - * - * Copyright (C) 2001,2002 Hiroyuki Kondo, and Hirokazu Takata - * - */ - -; -; input (r0,r1) src -; input r2 shift val -; r3 scratch -; output (r0,r1) -; - -#ifdef CONFIG_ISA_DUAL_ISSUE - -#ifndef __LITTLE_ENDIAN__ - - .text - .align 4 - .globl __ashrdi3 -__ashrdi3: - cmpz r2 || ldi r3, #32 - jc r14 || cmpu r2, r3 - bc 1f - ; case 32 =< shift - mv r1, r0 || srai r0, #31 - addi r2, #-32 - sra r1, r2 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r0 || srl r1, r2 - sra r0, r2 || neg r2, r2 - sll r3, r2 - or r1, r3 || jmp r14 - - .align 4 - .globl __ashldi3 - .globl __lshldi3 -__ashldi3: -__lshldi3: - cmpz r2 || ldi r3, #32 - jc r14 || cmpu r2, r3 - bc 1f - ; case 32 =< shift - mv r0, r1 || addi r2, #-32 - sll r0, r2 || ldi r1, #0 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r1 || sll r0, r2 - sll r1, r2 || neg r2, r2 - srl r3, r2 - or r0, r3 || jmp r14 - - .align 4 - .globl __lshrdi3 -__lshrdi3: - cmpz r2 || ldi r3, #32 - jc r14 || cmpu r2, r3 - bc 1f - ; case 32 =< shift - mv r1, r0 || addi r2, #-32 - ldi r0, #0 || srl r1, r2 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r0 || srl r1, r2 - srl r0, r2 || neg r2, r2 - sll r3, r2 - or r1, r3 || jmp r14 - -#else /* LITTLE_ENDIAN */ - - .text - .align 4 - .globl __ashrdi3 -__ashrdi3: - cmpz r2 || ldi r3, #32 - jc r14 || cmpu r2, r3 - bc 1f - ; case 32 =< shift - mv r0, r1 || srai r1, #31 - addi r2, #-32 - sra r0, r2 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r1 || srl r0, r2 - sra r1, r2 || neg r2, r2 - sll r3, r2 - or r0, r3 || jmp r14 - - .align 4 - .globl __ashldi3 - .globl __lshldi3 -__ashldi3: -__lshldi3: - cmpz r2 || ldi r3, #32 - jc r14 || cmpu r2, r3 - bc 1f - ; case 32 =< shift - mv r1, r0 || addi r2, #-32 - sll r1, r2 || ldi r0, #0 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r0 || sll r1, r2 - sll r0, r2 || neg r2, r2 - srl r3, r2 - or r1, r3 || jmp r14 - - .align 4 - .globl __lshrdi3 -__lshrdi3: - cmpz r2 || ldi r3, #32 - jc r14 || cmpu r2, r3 - bc 1f - ; case 32 =< shift - mv r0, r1 || addi r2, #-32 - ldi r1, #0 || srl r0, r2 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r1 || srl r0, r2 - srl r1, r2 || neg r2, r2 - sll r3, r2 - or r0, r3 || jmp r14 - -#endif - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - -#ifndef __LITTLE_ENDIAN__ - - .text - .align 4 - .globl __ashrdi3 -__ashrdi3: - beqz r2, 2f - cmpui r2, #32 - bc 1f - ; case 32 =< shift - mv r1, r0 - srai r0, #31 - addi r2, #-32 - sra r1, r2 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r0 - srl r1, r2 - sra r0, r2 - neg r2, r2 - sll r3, r2 - or r1, r3 - .fillinsn -2: - jmp r14 - - .align 4 - .globl __ashldi3 - .globl __lshldi3 -__ashldi3: -__lshldi3: - beqz r2, 2f - cmpui r2, #32 - bc 1f - ; case 32 =< shift - mv r0, r1 - addi r2, #-32 - sll r0, r2 - ldi r1, #0 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r1 - sll r0, r2 - sll r1, r2 - neg r2, r2 - srl r3, r2 - or r0, r3 - .fillinsn -2: - jmp r14 - - .align 4 - .globl __lshrdi3 -__lshrdi3: - beqz r2, 2f - cmpui r2, #32 - bc 1f - ; case 32 =< shift - mv r1, r0 - ldi r0, #0 - addi r2, #-32 - srl r1, r2 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r0 - srl r1, r2 - srl r0, r2 - neg r2, r2 - sll r3, r2 - or r1, r3 - .fillinsn -2: - jmp r14 - -#else - - .text - .align 4 - .globl __ashrdi3 -__ashrdi3: - beqz r2, 2f - cmpui r2, #32 - bc 1f - ; case 32 =< shift - mv r0, r1 - srai r1, #31 - addi r2, #-32 - sra r0, r2 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r1 - srl r0, r2 - sra r1, r2 - neg r2, r2 - sll r3, r2 - or r0, r3 - .fillinsn -2: - jmp r14 - - .align 4 - .globl __ashldi3 - .globl __lshldi3 -__ashldi3: -__lshldi3: - beqz r2, 2f - cmpui r2, #32 - bc 1f - ; case 32 =< shift - mv r1, r0 - addi r2, #-32 - sll r1, r2 - ldi r0, #0 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r0 - sll r1, r2 - sll r0, r2 - neg r2, r2 - srl r3, r2 - or r1, r3 - .fillinsn -2: - jmp r14 - - .align 4 - .globl __lshrdi3 -__lshrdi3: - beqz r2, 2f - cmpui r2, #32 - bc 1f - ; case 32 =< shift - mv r0, r1 - ldi r1, #0 - addi r2, #-32 - srl r0, r2 - jmp r14 - .fillinsn -1: ; case shift <32 - mv r3, r1 - srl r0, r2 - srl r1, r2 - neg r2, r2 - sll r3, r2 - or r0, r3 - .fillinsn -2: - jmp r14 - -#endif - -#endif /* not CONFIG_ISA_DUAL_ISSUE */ - - .end diff --git a/arch/m32r/lib/checksum.S b/arch/m32r/lib/checksum.S deleted file mode 100644 index 0af0360c76d9..000000000000 --- a/arch/m32r/lib/checksum.S +++ /dev/null @@ -1,320 +0,0 @@ -/* - * INET An implementation of the TCP/IP protocol suite for the LINUX - * operating system. INET is implemented using the BSD Socket - * interface as the means of communication with the user level. - * - * IP/TCP/UDP checksumming routines - * - * Authors: Jorge Cwik, - * Arnt Gulbrandsen, - * Tom May, - * Pentium Pro/II routines: - * Alexander Kjeldaas - * Finn Arne Gangstad - * Lots of code moved from tcp.c and ip.c; see those files - * for more names. - * - * Changes: Ingo Molnar, converted csum_partial_copy() to 2.1 exception - * handling. - * Andi Kleen, add zeroing on error - * converted to pure assembler - * Hirokazu Takata,Hiroyuki Kondo rewrite for the m32r architecture. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include - -/* - * computes a partial checksum, e.g. for TCP/UDP fragments - */ - -/* -unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) - */ - - -#ifdef CONFIG_ISA_DUAL_ISSUE - - /* - * Experiments with Ethernet and SLIP connections show that buff - * is aligned on either a 2-byte or 4-byte boundary. We get at - * least a twofold speedup on 486 and Pentium if it is 4-byte aligned. - * Fortunately, it is easy to convert 2-byte alignment to 4-byte - * alignment for the unrolled loop. - */ - - .text -ENTRY(csum_partial) - ; Function args - ; r0: unsigned char *buff - ; r1: int len - ; r2: unsigned int sum - - push r2 || ldi r2, #0 - and3 r7, r0, #1 ; Check alignment. - beqz r7, 1f ; Jump if alignment is ok. - ; 1-byte mis aligned - ldub r4, @r0 || addi r0, #1 - ; clear c-bit || Alignment uses up bytes. - cmp r0, r0 || addi r1, #-1 - ldi r3, #0 || addx r2, r4 - addx r2, r3 - .fillinsn -1: - and3 r4, r0, #2 ; Check alignment. - beqz r4, 2f ; Jump if alignment is ok. - ; clear c-bit || Alignment uses up two bytes. - cmp r0, r0 || addi r1, #-2 - bgtz r1, 1f ; Jump if we had at least two bytes. - bra 4f || addi r1, #2 - .fillinsn ; len(r1) was < 2. Deal with it. -1: - ; 2-byte aligned - lduh r4, @r0 || ldi r3, #0 - addx r2, r4 || addi r0, #2 - addx r2, r3 - .fillinsn -2: - ; 4-byte aligned - cmp r0, r0 ; clear c-bit - srl3 r6, r1, #5 - beqz r6, 2f - .fillinsn - -1: ld r3, @r0+ - ld r4, @r0+ ; +4 - ld r5, @r0+ ; +8 - ld r3, @r0+ || addx r2, r3 ; +12 - ld r4, @r0+ || addx r2, r4 ; +16 - ld r5, @r0+ || addx r2, r5 ; +20 - ld r3, @r0+ || addx r2, r3 ; +24 - ld r4, @r0+ || addx r2, r4 ; +28 - addx r2, r5 || addi r6, #-1 - addx r2, r3 - addx r2, r4 - bnez r6, 1b - - addx r2, r6 ; r6=0 - cmp r0, r0 ; This clears c-bit - .fillinsn -2: and3 r6, r1, #0x1c ; withdraw len - beqz r6, 4f - srli r6, #2 - .fillinsn - -3: ld r4, @r0+ || addi r6, #-1 - addx r2, r4 - bnez r6, 3b - - addx r2, r6 ; r6=0 - cmp r0, r0 ; This clears c-bit - .fillinsn -4: and3 r1, r1, #3 - beqz r1, 7f ; if len == 0 goto end - and3 r6, r1, #2 - beqz r6, 5f ; if len < 2 goto 5f(1byte) - lduh r4, @r0 || addi r0, #2 - addi r1, #-2 || slli r4, #16 - addx r2, r4 - beqz r1, 6f - .fillinsn -5: ldub r4, @r0 || ldi r1, #0 -#ifndef __LITTLE_ENDIAN__ - slli r4, #8 -#endif - addx r2, r4 - .fillinsn -6: addx r2, r1 - .fillinsn -7: - and3 r0, r2, #0xffff - srli r2, #16 - add r0, r2 - srl3 r2, r0, #16 - beqz r2, 1f - addi r0, #1 - and3 r0, r0, #0xffff - .fillinsn -1: - beqz r7, 1f ; swap the upper byte for the lower - and3 r2, r0, #0xff - srl3 r0, r0, #8 - slli r2, #8 - or r0, r2 - .fillinsn -1: - pop r2 || cmp r0, r0 - addx r0, r2 || ldi r2, #0 - addx r0, r2 - jmp r14 - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - - /* - * Experiments with Ethernet and SLIP connections show that buff - * is aligned on either a 2-byte or 4-byte boundary. We get at - * least a twofold speedup on 486 and Pentium if it is 4-byte aligned. - * Fortunately, it is easy to convert 2-byte alignment to 4-byte - * alignment for the unrolled loop. - */ - - .text -ENTRY(csum_partial) - ; Function args - ; r0: unsigned char *buff - ; r1: int len - ; r2: unsigned int sum - - push r2 - ldi r2, #0 - and3 r7, r0, #1 ; Check alignment. - beqz r7, 1f ; Jump if alignment is ok. - ; 1-byte mis aligned - ldub r4, @r0 - addi r0, #1 - addi r1, #-1 ; Alignment uses up bytes. - cmp r0, r0 ; clear c-bit - ldi r3, #0 - addx r2, r4 - addx r2, r3 - .fillinsn -1: - and3 r4, r0, #2 ; Check alignment. - beqz r4, 2f ; Jump if alignment is ok. - addi r1, #-2 ; Alignment uses up two bytes. - cmp r0, r0 ; clear c-bit - bgtz r1, 1f ; Jump if we had at least two bytes. - addi r1, #2 ; len(r1) was < 2. Deal with it. - bra 4f - .fillinsn -1: - ; 2-byte aligned - lduh r4, @r0 - addi r0, #2 - ldi r3, #0 - addx r2, r4 - addx r2, r3 - .fillinsn -2: - ; 4-byte aligned - cmp r0, r0 ; clear c-bit - srl3 r6, r1, #5 - beqz r6, 2f - .fillinsn - -1: ld r3, @r0+ - ld r4, @r0+ ; +4 - ld r5, @r0+ ; +8 - addx r2, r3 - addx r2, r4 - addx r2, r5 - ld r3, @r0+ ; +12 - ld r4, @r0+ ; +16 - ld r5, @r0+ ; +20 - addx r2, r3 - addx r2, r4 - addx r2, r5 - ld r3, @r0+ ; +24 - ld r4, @r0+ ; +28 - addi r6, #-1 - addx r2, r3 - addx r2, r4 - bnez r6, 1b - addx r2, r6 ; r6=0 - cmp r0, r0 ; This clears c-bit - .fillinsn - -2: and3 r6, r1, #0x1c ; withdraw len - beqz r6, 4f - srli r6, #2 - .fillinsn - -3: ld r4, @r0+ - addi r6, #-1 - addx r2, r4 - bnez r6, 3b - addx r2, r6 ; r6=0 - cmp r0, r0 ; This clears c-bit - .fillinsn - -4: and3 r1, r1, #3 - beqz r1, 7f ; if len == 0 goto end - and3 r6, r1, #2 - beqz r6, 5f ; if len < 2 goto 5f(1byte) - - lduh r4, @r0 - addi r0, #2 - addi r1, #-2 - slli r4, #16 - addx r2, r4 - beqz r1, 6f - .fillinsn -5: ldub r4, @r0 -#ifndef __LITTLE_ENDIAN__ - slli r4, #8 -#endif - addx r2, r4 - .fillinsn -6: ldi r5, #0 - addx r2, r5 - .fillinsn -7: - and3 r0, r2, #0xffff - srli r2, #16 - add r0, r2 - srl3 r2, r0, #16 - beqz r2, 1f - addi r0, #1 - and3 r0, r0, #0xffff - .fillinsn -1: - beqz r7, 1f - mv r2, r0 - srl3 r0, r2, #8 - and3 r2, r2, #0xff - slli r2, #8 - or r0, r2 - .fillinsn -1: - pop r2 - cmp r0, r0 - addx r0, r2 - ldi r2, #0 - addx r0, r2 - jmp r14 - -#endif /* not CONFIG_ISA_DUAL_ISSUE */ - -/* -unsigned int csum_partial_copy_generic (const char *src, char *dst, - int len, int sum, int *src_err_ptr, int *dst_err_ptr) - */ - -/* - * Copy from ds while checksumming, otherwise like csum_partial - * - * The macros SRC and DST specify the type of access for the instruction. - * thus we can call a custom exception handler for all access types. - * - * FIXME: could someone double-check whether I haven't mixed up some SRC and - * DST definitions? It's damn hard to trigger all cases. I hope I got - * them all but there's no guarantee. - */ - -ENTRY(csum_partial_copy_generic) - nop - nop - nop - nop - jmp r14 - nop - nop - nop - - .end diff --git a/arch/m32r/lib/csum_partial_copy.c b/arch/m32r/lib/csum_partial_copy.c deleted file mode 100644 index b3cd59c12b8e..000000000000 --- a/arch/m32r/lib/csum_partial_copy.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * INET An implementation of the TCP/IP protocol suite for the LINUX - * operating system. INET is implemented using the BSD Socket - * interface as the means of communication with the user level. - * - * M32R specific IP/TCP/UDP checksumming routines - * (Some code taken from MIPS architecture) - * - * 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) 1994, 1995 Waldorf Electronics GmbH - * Copyright (C) 1998, 1999 Ralf Baechle - * Copyright (C) 2001-2005 Hiroyuki Kondo, Hirokazu Takata - * - */ - -#include -#include -#include - -#include -#include -#include - -/* - * Copy while checksumming, otherwise like csum_partial - */ -__wsum -csum_partial_copy_nocheck (const void *src, void *dst, int len, __wsum sum) -{ - sum = csum_partial(src, len, sum); - memcpy(dst, src, len); - - return sum; -} -EXPORT_SYMBOL(csum_partial_copy_nocheck); - -/* - * Copy from userspace and compute checksum. If we catch an exception - * then zero the rest of the buffer. - */ -__wsum -csum_partial_copy_from_user (const void __user *src, void *dst, - int len, __wsum sum, int *err_ptr) -{ - int missing; - - missing = copy_from_user(dst, src, len); - if (missing) { - memset(dst + len - missing, 0, missing); - *err_ptr = -EFAULT; - } - - return csum_partial(dst, len-missing, sum); -} -EXPORT_SYMBOL(csum_partial_copy_from_user); -EXPORT_SYMBOL(csum_partial); diff --git a/arch/m32r/lib/delay.c b/arch/m32r/lib/delay.c deleted file mode 100644 index ae1fe90892f9..000000000000 --- a/arch/m32r/lib/delay.c +++ /dev/null @@ -1,130 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/lib/delay.c - * - * Copyright (c) 2002 Hitoshi Yamamoto, Hirokazu Takata - * Copyright (c) 2004 Hirokazu Takata - */ - -#include -#include -#ifdef CONFIG_SMP -#include -#include -#include -#endif /* CONFIG_SMP */ -#include - -void __delay(unsigned long loops) -{ -#ifdef CONFIG_ISA_DUAL_ISSUE - __asm__ __volatile__ ( - "beqz %0, 2f \n\t" - "addi %0, #-1 \n\t" - - " .fillinsn \n\t" - "1: \n\t" - "cmpz %0 || addi %0, #-1 \n\t" - "bc 2f || cmpz %0 \n\t" - "bc 2f || addi %0, #-1 \n\t" - "cmpz %0 || addi %0, #-1 \n\t" - "bc 2f || cmpz %0 \n\t" - "bnc 1b || addi %0, #-1 \n\t" - " .fillinsn \n\t" - "2: \n\t" - : "+r" (loops) - : "r" (0) - : "cbit" - ); -#else - __asm__ __volatile__ ( - "beqz %0, 2f \n\t" - " .fillinsn \n\t" - "1: \n\t" - "addi %0, #-1 \n\t" - "blez %0, 2f \n\t" - "addi %0, #-1 \n\t" - "blez %0, 2f \n\t" - "addi %0, #-1 \n\t" - "blez %0, 2f \n\t" - "addi %0, #-1 \n\t" - "bgtz %0, 1b \n\t" - " .fillinsn \n\t" - "2: \n\t" - : "+r" (loops) - : "r" (0) - ); -#endif -} - -void __const_udelay(unsigned long xloops) -{ -#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) - /* - * loops [1] = (xloops >> 32) [sec] * loops_per_jiffy [1/jiffy] - * * HZ [jiffy/sec] - * = (xloops >> 32) [sec] * (loops_per_jiffy * HZ) [1/sec] - * = (((xloops * loops_per_jiffy) >> 32) * HZ) [1] - * - * NOTE: - * - '[]' depicts variable's dimension in the above equation. - * - "rac" instruction rounds the accumulator in word size. - */ - __asm__ __volatile__ ( - "srli %0, #1 \n\t" - "mulwhi %0, %1 ; a0 \n\t" - "mulwu1 %0, %1 ; a1 \n\t" - "sadd ; a0 += (a1 >> 16) \n\t" - "rac a0, a0, #1 \n\t" - "mvfacmi %0, a0 \n\t" - : "+r" (xloops) - : "r" (current_cpu_data.loops_per_jiffy) - : "a0", "a1" - ); -#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) - /* - * u64 ull; - * ull = (u64)xloops * (u64)current_cpu_data.loops_per_jiffy; - * xloops = (ull >> 32); - */ - __asm__ __volatile__ ( - "and3 r4, %0, #0xffff \n\t" - "and3 r5, %1, #0xffff \n\t" - "mul r4, r5 \n\t" - "srl3 r6, %0, #16 \n\t" - "srli r4, #16 \n\t" - "mul r5, r6 \n\t" - "add r4, r5 \n\t" - "and3 r5, %0, #0xffff \n\t" - "srl3 r6, %1, #16 \n\t" - "mul r5, r6 \n\t" - "add r4, r5 \n\t" - "srl3 r5, %0, #16 \n\t" - "srli r4, #16 \n\t" - "mul r5, r6 \n\t" - "add r4, r5 \n\t" - "mv %0, r4 \n\t" - : "+r" (xloops) - : "r" (current_cpu_data.loops_per_jiffy) - : "r4", "r5", "r6" - ); -#else -#error unknown isa configuration -#endif - __delay(xloops * HZ); -} - -void __udelay(unsigned long usecs) -{ - __const_udelay(usecs * 0x000010c7); /* 2**32 / 1000000 (rounded up) */ -} - -void __ndelay(unsigned long nsecs) -{ - __const_udelay(nsecs * 0x00005); /* 2**32 / 1000000000 (rounded up) */ -} - -EXPORT_SYMBOL(__delay); -EXPORT_SYMBOL(__const_udelay); -EXPORT_SYMBOL(__udelay); -EXPORT_SYMBOL(__ndelay); diff --git a/arch/m32r/lib/libgcc.h b/arch/m32r/lib/libgcc.h deleted file mode 100644 index 4854690d944a..000000000000 --- a/arch/m32r/lib/libgcc.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_LIBGCC_H -#define __ASM_LIBGCC_H - -#include - -#ifdef __BIG_ENDIAN -struct DWstruct { - int high, low; -}; -#elif defined(__LITTLE_ENDIAN) -struct DWstruct { - int low, high; -}; -#else -#error I feel sick. -#endif - -typedef union { - struct DWstruct s; - long long ll; -} DWunion; - -#endif /* __ASM_LIBGCC_H */ diff --git a/arch/m32r/lib/memcpy.S b/arch/m32r/lib/memcpy.S deleted file mode 100644 index 249da3e3358d..000000000000 --- a/arch/m32r/lib/memcpy.S +++ /dev/null @@ -1,93 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/lib/memcpy.S - * - * Copyright (C) 2001 Hiroyuki Kondo, and Hirokazu Takata - * Copyright (C) 2004 Hirokazu Takata - * - * void *memcopy(void *dst, const void *src, int n); - * - * dst: r0 - * src: r1 - * n : r2 - */ - - .text -#include -#include - -#ifdef CONFIG_ISA_DUAL_ISSUE - - .text -ENTRY(memcpy) -memcopy: - mv r4, r0 || mv r7, r0 - or r7, r1 || cmpz r2 - jc r14 || cmpeq r0, r1 ; return if r2=0 - jc r14 ; return if r0=r1 - - and3 r7, r7, #3 - bnez r7, byte_copy - srl3 r3, r2, #2 - and3 r2, r2, #3 - beqz r3, byte_copy - addi r4, #-4 -word_copy: - ld r7, @r1+ || addi r3, #-1 - st r7, @+r4 || cmpz r2 - bnez r3, word_copy - addi r4, #4 || jc r14 ; return if r2=0 -#if defined(CONFIG_ISA_M32R2) -byte_copy: - ldb r7, @r1 || addi r1, #1 - addi r2, #-1 || stb r7, @r4+ - bnez r2, byte_copy -#elif defined(CONFIG_ISA_M32R) -byte_copy: - ldb r7, @r1 || addi r1, #1 - addi r2, #-1 || stb r7, @r4 - addi r4, #1 - bnez r2, byte_copy -#else -#error unknown isa configuration -#endif -end_memcopy: - jmp r14 - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - - .text -ENTRY(memcpy) -memcopy: - mv r4, r0 - mv r7, r0 - or r7, r1 - beq r0, r1, end_memcopy - beqz r2, end_memcopy - - and3 r7, r7, #3 - bnez r7, byte_copy - srl3 r3, r2, #2 - and3 r2, r2, #3 - beqz r3, byte_copy - addi r4, #-4 -word_copy: - ld r7, @r1+ - addi r3, #-1 - st r7, @+r4 - bnez r3, word_copy - beqz r2, end_memcopy - addi r4, #4 -byte_copy: - ldb r7, @r1 - addi r1, #1 - addi r2, #-1 - stb r7, @r4 - addi r4, #1 - bnez r2, byte_copy -end_memcopy: - jmp r14 - -#endif /* not CONFIG_ISA_DUAL_ISSUE */ - - .end diff --git a/arch/m32r/lib/memset.S b/arch/m32r/lib/memset.S deleted file mode 100644 index e7f45e6c73f5..000000000000 --- a/arch/m32r/lib/memset.S +++ /dev/null @@ -1,179 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/lib/memset.S - * - * Copyright (C) 2001,2002 Hiroyuki Kondo, and Hirokazu Takata - * Copyright (C) 2004 Hirokazu Takata - * - * void *memset(void *dst, int val, int len); - * - * dst: r0 - * val: r1 - * len: r2 - * ret: r0 - * - */ - - .text - .global memset - -#ifdef CONFIG_ISA_DUAL_ISSUE - - .align 4 -memset: - mv r4, r0 || cmpz r2 - jc r14 - cmpui r2, #16 - bnc qword_align_check - cmpui r2, #4 - bc byte_set -word_align_check: /* len >= 4 */ - and3 r3, r4, #3 - beqz r3, word_set - addi r3, #-4 - neg r3, r3 /* r3 = -(r3 - 4) */ -align_word: - stb r1, @r4 || addi r4, #1 - addi r2, #-1 || addi r3, #-1 - bnez r3, align_word - cmpui r2, #4 - bc byte_set -word_set: - and3 r1, r1, #0x00ff /* r1: abababab <-- ??????ab */ - sll3 r3, r1, #8 - or r1, r3 || addi r4, #-4 - sll3 r3, r1, #16 - or r1, r3 || addi r2, #-4 -word_set_loop: - st r1, @+r4 || addi r2, #-4 - bgtz r2, word_set_loop - bnez r2, byte_set_wrap - st r1, @+r4 - jmp r14 - -qword_align_check: /* len >= 16 */ - and3 r3, r4, #15 - bnez r3, word_align_check -qword_set: - and3 r1, r1, #0x00ff /* r1: abababab <-- ??????ab */ - sll3 r3, r1, #8 - or r1, r3 || addi r4, #-4 - sll3 r3, r1, #16 - or r1, r3 || ldi r5, #16 -qword_set_loop: - ld r3, @(4,r4) /* cache line allocate */ - st r1, @+r4 || addi r2, #-16 - st r1, @+r4 || cmpu r2, r5 - st r1, @+r4 - st r1, @+r4 - bnc qword_set_loop || cmpz r2 - jc r14 -set_remainder: - cmpui r2, #4 - bc byte_set_wrap1 - addi r2, #-4 - bra word_set_loop - -byte_set_wrap: - addi r2, #4 - cmpz r2 - jc r14 -byte_set_wrap1: - addi r4, #4 -#if defined(CONFIG_ISA_M32R2) -byte_set: - addi r2, #-1 || stb r1, @r4+ - bnez r2, byte_set -#elif defined(CONFIG_ISA_M32R) -byte_set: - addi r2, #-1 || stb r1, @r4 - addi r4, #1 - bnez r2, byte_set -#else -#error unknown isa configuration -#endif -end_memset: - jmp r14 - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - - .align 4 -memset: - mv r4, r0 - beqz r2, end_memset - cmpui r2, #16 - bnc qword_align_check - cmpui r2, #4 - bc byte_set -word_align_check: /* len >= 4 */ - and3 r3, r4, #3 - beqz r3, word_set - addi r3, #-4 - neg r3, r3 /* r3 = -(r3 - 4) */ -align_word: - stb r1, @r4 - addi r4, #1 - addi r2, #-1 - addi r3, #-1 - bnez r3, align_word - cmpui r2, #4 - bc byte_set -word_set: - and3 r1, r1, #0x00ff /* r1: abababab <-- ??????ab */ - sll3 r3, r1, #8 - or r1, r3 - sll3 r3, r1, #16 - or r1, r3 - addi r2, #-4 - addi r4, #-4 -word_set_loop: - st r1, @+r4 - addi r2, #-4 - bgtz r2, word_set_loop - bnez r2, byte_set_wrap - st r1, @+r4 - jmp r14 - -qword_align_check: /* len >= 16 */ - and3 r3, r4, #15 - bnez r3, word_align_check -qword_set: - and3 r1, r1, #0x00ff /* r1: abababab <-- ??????ab */ - sll3 r3, r1, #8 - or r1, r3 - sll3 r3, r1, #16 - or r1, r3 - addi r4, #-4 -qword_set_loop: - ld r3, @(4,r4) /* cache line allocate */ - addi r2, #-16 - st r1, @+r4 - st r1, @+r4 - cmpui r2, #16 - st r1, @+r4 - st r1, @+r4 - bnc qword_set_loop - bnez r2, set_remainder - jmp r14 -set_remainder: - cmpui r2, #4 - bc byte_set_wrap1 - addi r2, #-4 - bra word_set_loop - -byte_set_wrap: - addi r2, #4 - beqz r2, end_memset -byte_set_wrap1: - addi r4, #4 -byte_set: - addi r2, #-1 - stb r1, @r4 - addi r4, #1 - bnez r2, byte_set -end_memset: - jmp r14 - -#endif /* not CONFIG_ISA_DUAL_ISSUE */ - - .end diff --git a/arch/m32r/lib/strlen.S b/arch/m32r/lib/strlen.S deleted file mode 100644 index 41c77e387593..000000000000 --- a/arch/m32r/lib/strlen.S +++ /dev/null @@ -1,118 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/strlen.S -- strlen code. - * - * Copyright (C) 2001 Hirokazu Takata - * - * size_t strlen(const char *s); - * - */ - -#include -#include - -#ifdef CONFIG_ISA_DUAL_ISSUE - - .text -ENTRY(strlen) - mv r6, r0 || ldi r2, #0 - and3 r0, r0, #3 - bnez r0, strlen_byte -; -strlen_word: - ld r0, @r6+ -; - seth r5, #high(0x01010101) - or3 r5, r5, #low(0x01010101) - sll3 r7, r5, #7 -strlen_word_loop: - ld r1, @r6+ || not r4, r0 - sub r0, r5 || and r4, r7 - and r4, r0 - bnez r4, strlen_last_bytes - ld r0, @r6+ || not r4, r1 - sub r1, r5 || and r4, r7 - and r4, r1 || addi r2, #4 - bnez r4, strlen_last_bytes - addi r2, #4 || bra.s strlen_word_loop - - ; NOTE: If a null char. exists, return 0. - ; if ((x - 0x01010101) & ~x & 0x80808080) - ; return 0; -; -strlen_byte: - ldb r1, @r6 || addi r6, #1 - beqz r1, strlen_exit - addi r2, #1 || bra.s strlen_byte -; -strlen_last_bytes: - ldi r0, #4 || addi r6, #-8 -; -strlen_byte_loop: - ldb r1, @r6 || addi r6, #1 - addi r0, #-1 || cmpz r1 - bc.s strlen_exit || cmpz r0 - addi r2, #1 || bnc.s strlen_byte_loop -; -strlen_exit: - mv r0, r2 || jmp r14 - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - - .text -ENTRY(strlen) - mv r6, r0 - ldi r2, #0 - and3 r0, r0, #3 - bnez r0, strlen_byte -; -strlen_word: - ld r0, @r6+ -; - seth r5, #high(0x01010101) - or3 r5, r5, #low(0x01010101) - sll3 r7, r5, #7 -strlen_word_loop: - ld r1, @r6+ - not r4, r0 ; NOTE: If a null char. exists, return 0. - sub r0, r5 ; if ((x - 0x01010101) & ~x & 0x80808080) - and r4, r7 ; return 0; - and r4, r0 - bnez r4, strlen_last_bytes - addi r2, #4 -; - ld r0, @r6+ - not r4, r1 ; NOTE: If a null char. exists, return 0. - sub r1, r5 ; if ((x - 0x01010101) & ~x & 0x80808080) - and r4, r7 ; return 0; - and r4, r1 - bnez r4, strlen_last_bytes - addi r2, #4 - bra strlen_word_loop -; -strlen_byte: - ldb r1, @r6 - addi r6, #1 - beqz r1, strlen_exit - addi r2, #1 - bra strlen_byte -; -strlen_last_bytes: - ldi r0, #4 - addi r6, #-8 -; -strlen_byte_loop: - ldb r1, @r6 - addi r6, #1 - addi r0, #-1 - beqz r1, strlen_exit - addi r2, #1 - bnez r0, strlen_byte_loop -; -strlen_exit: - mv r0, r2 - jmp r14 - -#endif /* not CONFIG_ISA_DUAL_ISSUE */ - - .end diff --git a/arch/m32r/lib/ucmpdi2.c b/arch/m32r/lib/ucmpdi2.c deleted file mode 100644 index e20fa3484fd8..000000000000 --- a/arch/m32r/lib/ucmpdi2.c +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "libgcc.h" - -int __ucmpdi2(unsigned long long a, unsigned long long b) -{ - const DWunion au = {.ll = a}; - const DWunion bu = {.ll = b}; - - if ((unsigned int)au.s.high < (unsigned int)bu.s.high) - return 0; - else if ((unsigned int)au.s.high > (unsigned int)bu.s.high) - return 2; - if ((unsigned int)au.s.low < (unsigned int)bu.s.low) - return 0; - else if ((unsigned int)au.s.low > (unsigned int)bu.s.low) - return 2; - return 1; -} diff --git a/arch/m32r/lib/usercopy.c b/arch/m32r/lib/usercopy.c deleted file mode 100644 index 0892a4341b3a..000000000000 --- a/arch/m32r/lib/usercopy.c +++ /dev/null @@ -1,362 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * User address space access functions. - * The non inlined parts of asm-m32r/uaccess.h are here. - * - * Copyright 1997 Andi Kleen - * Copyright 1997 Linus Torvalds - * Copyright 2001, 2002, 2004 Hirokazu Takata - */ -#include -#include -#include -#include - -/* - * Copy a null terminated string from userspace. - */ - -#ifdef CONFIG_ISA_DUAL_ISSUE - -#define __do_strncpy_from_user(dst,src,count,res) \ -do { \ - int __d0, __d1, __d2; \ - __asm__ __volatile__( \ - " beqz %1, 2f\n" \ - " .fillinsn\n" \ - "0: ldb r14, @%3 || addi %3, #1\n" \ - " stb r14, @%4 || addi %4, #1\n" \ - " beqz r14, 1f\n" \ - " addi %1, #-1\n" \ - " bnez %1, 0b\n" \ - " .fillinsn\n" \ - "1: sub %0, %1\n" \ - " .fillinsn\n" \ - "2:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "3: seth r14, #high(2b)\n" \ - " or3 r14, r14, #low(2b)\n" \ - " jmp r14 || ldi %0, #%5\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 0b,3b\n" \ - ".previous" \ - : "=&r"(res), "=&r"(count), "=&r" (__d0), "=&r" (__d1), \ - "=&r" (__d2) \ - : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), \ - "4"(dst) \ - : "r14", "cbit", "memory"); \ -} while (0) - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - -#define __do_strncpy_from_user(dst,src,count,res) \ -do { \ - int __d0, __d1, __d2; \ - __asm__ __volatile__( \ - " beqz %1, 2f\n" \ - " .fillinsn\n" \ - "0: ldb r14, @%3\n" \ - " stb r14, @%4\n" \ - " addi %3, #1\n" \ - " addi %4, #1\n" \ - " beqz r14, 1f\n" \ - " addi %1, #-1\n" \ - " bnez %1, 0b\n" \ - " .fillinsn\n" \ - "1: sub %0, %1\n" \ - " .fillinsn\n" \ - "2:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "3: ldi %0, #%5\n" \ - " seth r14, #high(2b)\n" \ - " or3 r14, r14, #low(2b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 0b,3b\n" \ - ".previous" \ - : "=&r"(res), "=&r"(count), "=&r" (__d0), "=&r" (__d1), \ - "=&r" (__d2) \ - : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), \ - "4"(dst) \ - : "r14", "cbit", "memory"); \ -} while (0) - -#endif /* CONFIG_ISA_DUAL_ISSUE */ - -long -strncpy_from_user(char *dst, const char __user *src, long count) -{ - long res = -EFAULT; - if (access_ok(VERIFY_READ, src, 1)) - __do_strncpy_from_user(dst, src, count, res); - return res; -} - - -/* - * Zero Userspace - */ - -#ifdef CONFIG_ISA_DUAL_ISSUE - -#define __do_clear_user(addr,size) \ -do { \ - int __dst, __c; \ - __asm__ __volatile__( \ - " beqz %1, 9f\n" \ - " and3 r14, %0, #3\n" \ - " bnez r14, 2f\n" \ - " and3 r14, %1, #3\n" \ - " bnez r14, 2f\n" \ - " and3 %1, %1, #3\n" \ - " beqz %2, 2f\n" \ - " addi %0, #-4\n" \ - " .fillinsn\n" \ - "0: ; word clear \n" \ - " st %6, @+%0 || addi %2, #-1\n" \ - " bnez %2, 0b\n" \ - " beqz %1, 9f\n" \ - " .fillinsn\n" \ - "2: ; byte clear \n" \ - " stb %6, @%0 || addi %1, #-1\n" \ - " addi %0, #1\n" \ - " bnez %1, 2b\n" \ - " .fillinsn\n" \ - "9:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "4: slli %2, #2\n" \ - " seth r14, #high(9b)\n" \ - " or3 r14, r14, #low(9b)\n" \ - " jmp r14 || add %1, %2\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 0b,4b\n" \ - " .long 2b,9b\n" \ - ".previous\n" \ - : "=&r"(__dst), "=&r"(size), "=&r"(__c) \ - : "0"(addr), "1"(size), "2"(size / 4), "r"(0) \ - : "r14", "cbit", "memory"); \ -} while (0) - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - -#define __do_clear_user(addr,size) \ -do { \ - int __dst, __c; \ - __asm__ __volatile__( \ - " beqz %1, 9f\n" \ - " and3 r14, %0, #3\n" \ - " bnez r14, 2f\n" \ - " and3 r14, %1, #3\n" \ - " bnez r14, 2f\n" \ - " and3 %1, %1, #3\n" \ - " beqz %2, 2f\n" \ - " addi %0, #-4\n" \ - " .fillinsn\n" \ - "0: st %6, @+%0 ; word clear \n" \ - " addi %2, #-1\n" \ - " bnez %2, 0b\n" \ - " beqz %1, 9f\n" \ - " .fillinsn\n" \ - "2: stb %6, @%0 ; byte clear \n" \ - " addi %1, #-1\n" \ - " addi %0, #1\n" \ - " bnez %1, 2b\n" \ - " .fillinsn\n" \ - "9:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "4: slli %2, #2\n" \ - " add %1, %2\n" \ - " seth r14, #high(9b)\n" \ - " or3 r14, r14, #low(9b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 0b,4b\n" \ - " .long 2b,9b\n" \ - ".previous\n" \ - : "=&r"(__dst), "=&r"(size), "=&r"(__c) \ - : "0"(addr), "1"(size), "2"(size / 4), "r"(0) \ - : "r14", "cbit", "memory"); \ -} while (0) - -#endif /* not CONFIG_ISA_DUAL_ISSUE */ - -unsigned long -clear_user(void __user *to, unsigned long n) -{ - if (access_ok(VERIFY_WRITE, to, n)) - __do_clear_user(to, n); - return n; -} - -unsigned long -__clear_user(void __user *to, unsigned long n) -{ - __do_clear_user(to, n); - return n; -} - -/* - * Return the size of a string (including the ending 0) - * - * Return 0 on exception, a value greater than N if too long - */ - -#ifdef CONFIG_ISA_DUAL_ISSUE - -long strnlen_user(const char __user *s, long n) -{ - unsigned long mask = -__addr_ok(s); - unsigned long res; - - __asm__ __volatile__( - " and %0, %5 || mv r1, %1\n" - " beqz %0, strnlen_exit\n" - " and3 r0, %1, #3\n" - " bnez r0, strnlen_byte_loop\n" - " cmpui %0, #4\n" - " bc strnlen_byte_loop\n" - "strnlen_word_loop:\n" - "0: ld r0, @%1+\n" - " pcmpbz r0\n" - " bc strnlen_last_bytes_fixup\n" - " addi %0, #-4\n" - " beqz %0, strnlen_exit\n" - " bgtz %0, strnlen_word_loop\n" - "strnlen_last_bytes:\n" - " mv %0, %4\n" - "strnlen_last_bytes_fixup:\n" - " addi %1, #-4\n" - "strnlen_byte_loop:\n" - "1: ldb r0, @%1 || addi %0, #-1\n" - " beqz r0, strnlen_exit\n" - " addi %1, #1\n" - " bnez %0, strnlen_byte_loop\n" - "strnlen_exit:\n" - " sub %1, r1\n" - " add3 %0, %1, #1\n" - " .fillinsn\n" - "9:\n" - ".section .fixup,\"ax\"\n" - " .balign 4\n" - "4: addi %1, #-4\n" - " .fillinsn\n" - "5: seth r1, #high(9b)\n" - " or3 r1, r1, #low(9b)\n" - " jmp r1 || ldi %0, #0\n" - ".previous\n" - ".section __ex_table,\"a\"\n" - " .balign 4\n" - " .long 0b,4b\n" - " .long 1b,5b\n" - ".previous" - : "=&r" (res), "=r" (s) - : "0" (n), "1" (s), "r" (n & 3), "r" (mask), "r"(0x01010101) - : "r0", "r1", "cbit"); - - /* NOTE: strnlen_user() algorithm: - * { - * char *p; - * for (p = s; n-- && *p != '\0'; ++p) - * ; - * return p - s + 1; - * } - */ - - /* NOTE: If a null char. exists, return 0. - * if ((x - 0x01010101) & ~x & 0x80808080)\n" - * return 0;\n" - */ - - return res & mask; -} - -#else /* not CONFIG_ISA_DUAL_ISSUE */ - -long strnlen_user(const char __user *s, long n) -{ - unsigned long mask = -__addr_ok(s); - unsigned long res; - - __asm__ __volatile__( - " and %0, %5\n" - " mv r1, %1\n" - " beqz %0, strnlen_exit\n" - " and3 r0, %1, #3\n" - " bnez r0, strnlen_byte_loop\n" - " cmpui %0, #4\n" - " bc strnlen_byte_loop\n" - " sll3 r3, %6, #7\n" - "strnlen_word_loop:\n" - "0: ld r0, @%1+\n" - " not r2, r0\n" - " sub r0, %6\n" - " and r2, r3\n" - " and r2, r0\n" - " bnez r2, strnlen_last_bytes_fixup\n" - " addi %0, #-4\n" - " beqz %0, strnlen_exit\n" - " bgtz %0, strnlen_word_loop\n" - "strnlen_last_bytes:\n" - " mv %0, %4\n" - "strnlen_last_bytes_fixup:\n" - " addi %1, #-4\n" - "strnlen_byte_loop:\n" - "1: ldb r0, @%1\n" - " addi %0, #-1\n" - " beqz r0, strnlen_exit\n" - " addi %1, #1\n" - " bnez %0, strnlen_byte_loop\n" - "strnlen_exit:\n" - " sub %1, r1\n" - " add3 %0, %1, #1\n" - " .fillinsn\n" - "9:\n" - ".section .fixup,\"ax\"\n" - " .balign 4\n" - "4: addi %1, #-4\n" - " .fillinsn\n" - "5: ldi %0, #0\n" - " seth r1, #high(9b)\n" - " or3 r1, r1, #low(9b)\n" - " jmp r1\n" - ".previous\n" - ".section __ex_table,\"a\"\n" - " .balign 4\n" - " .long 0b,4b\n" - " .long 1b,5b\n" - ".previous" - : "=&r" (res), "=r" (s) - : "0" (n), "1" (s), "r" (n & 3), "r" (mask), "r"(0x01010101) - : "r0", "r1", "r2", "r3", "cbit"); - - /* NOTE: strnlen_user() algorithm: - * { - * char *p; - * for (p = s; n-- && *p != '\0'; ++p) - * ; - * return p - s + 1; - * } - */ - - /* NOTE: If a null char. exists, return 0. - * if ((x - 0x01010101) & ~x & 0x80808080)\n" - * return 0;\n" - */ - - return res & mask; -} - -#endif /* CONFIG_ISA_DUAL_ISSUE */ - diff --git a/arch/m32r/mm/Makefile b/arch/m32r/mm/Makefile deleted file mode 100644 index cb20d90c51d1..000000000000 --- a/arch/m32r/mm/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Makefile for the Linux M32R-specific parts of the memory manager. -# - -ifdef CONFIG_MMU -obj-y := init.o fault.o mmu.o extable.o ioremap.o cache.o page.o -else -obj-y := init.o fault-nommu.o mmu.o extable.o ioremap-nommu.o cache.o page.o -endif - -obj-$(CONFIG_DISCONTIGMEM) += discontig.o - diff --git a/arch/m32r/mm/cache.c b/arch/m32r/mm/cache.c deleted file mode 100644 index 0d1ae744e56f..000000000000 --- a/arch/m32r/mm/cache.c +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/mm/cache.c - * - * Copyright (C) 2002-2005 Hirokazu Takata, Hayato Fujiwara - */ - -#include - -#undef MCCR - -#if defined(CONFIG_CHIP_XNUX2) || defined(CONFIG_CHIP_M32700) \ - || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_OPSP) -/* Cache Control Register */ -#define MCCR ((volatile unsigned long*)0xfffffffc) -#define MCCR_CC (1UL << 7) /* Cache mode modify bit */ -#define MCCR_IIV (1UL << 6) /* I-cache invalidate */ -#define MCCR_DIV (1UL << 5) /* D-cache invalidate */ -#define MCCR_DCB (1UL << 4) /* D-cache copy back */ -#define MCCR_ICM (1UL << 1) /* I-cache mode [0:off,1:on] */ -#define MCCR_DCM (1UL << 0) /* D-cache mode [0:off,1:on] */ -#define MCCR_ICACHE_INV (MCCR_CC|MCCR_IIV) -#define MCCR_DCACHE_CB (MCCR_CC|MCCR_DCB) -#define MCCR_DCACHE_CBINV (MCCR_CC|MCCR_DIV|MCCR_DCB) -#define CHECK_MCCR(mccr) (mccr = *MCCR) -#elif defined(CONFIG_CHIP_M32102) -#define MCCR ((volatile unsigned char*)0xfffffffe) -#define MCCR_IIV (1UL << 0) /* I-cache invalidate */ -#define MCCR_ICACHE_INV MCCR_IIV -#elif defined(CONFIG_CHIP_M32104) -#define MCCR ((volatile unsigned short*)0xfffffffe) -#define MCCR_IIV (1UL << 8) /* I-cache invalidate */ -#define MCCR_DIV (1UL << 9) /* D-cache invalidate */ -#define MCCR_DCB (1UL << 10) /* D-cache copy back */ -#define MCCR_ICM (1UL << 0) /* I-cache mode [0:off,1:on] */ -#define MCCR_DCM (1UL << 1) /* D-cache mode [0:off,1:on] */ -#define MCCR_ICACHE_INV MCCR_IIV -#define MCCR_DCACHE_CB MCCR_DCB -#define MCCR_DCACHE_CBINV (MCCR_DIV|MCCR_DCB) -#endif - -#ifndef MCCR -#error Unknown cache type. -#endif - - -/* Copy back and invalidate D-cache and invalidate I-cache all */ -void _flush_cache_all(void) -{ -#if defined(CONFIG_CHIP_M32102) - unsigned char mccr; - *MCCR = MCCR_ICACHE_INV; -#elif defined(CONFIG_CHIP_M32104) - unsigned short mccr; - - /* Copyback and invalidate D-cache */ - /* Invalidate I-cache */ - *MCCR |= (MCCR_ICACHE_INV | MCCR_DCACHE_CBINV); -#else - unsigned long mccr; - - /* Copyback and invalidate D-cache */ - /* Invalidate I-cache */ - *MCCR = MCCR_ICACHE_INV | MCCR_DCACHE_CBINV; -#endif - while ((mccr = *MCCR) & MCCR_IIV); /* loop while invalidating... */ -} - -/* Copy back D-cache and invalidate I-cache all */ -void _flush_cache_copyback_all(void) -{ -#if defined(CONFIG_CHIP_M32102) - unsigned char mccr; - *MCCR = MCCR_ICACHE_INV; -#elif defined(CONFIG_CHIP_M32104) - unsigned short mccr; - - /* Copyback and invalidate D-cache */ - /* Invalidate I-cache */ - *MCCR |= (MCCR_ICACHE_INV | MCCR_DCACHE_CB); -#else - unsigned long mccr; - - /* Copyback D-cache */ - /* Invalidate I-cache */ - *MCCR = MCCR_ICACHE_INV | MCCR_DCACHE_CB; -#endif - while ((mccr = *MCCR) & MCCR_IIV); /* loop while invalidating... */ -} diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c deleted file mode 100644 index eb8e7966dcaf..000000000000 --- a/arch/m32r/mm/discontig.c +++ /dev/null @@ -1,163 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/mm/discontig.c - * - * Discontig memory support - * - * Copyright (c) 2003 Hitoshi Yamamoto - */ - -#include -#include -#include -#include -#include -#include -#include - -#include - -extern char _end[]; - -struct pglist_data *node_data[MAX_NUMNODES]; -EXPORT_SYMBOL(node_data); - -pg_data_t m32r_node_data[MAX_NUMNODES]; - -/* Memory profile */ -typedef struct { - unsigned long start_pfn; - unsigned long pages; - unsigned long holes; - unsigned long free_pfn; -} mem_prof_t; -static mem_prof_t mem_prof[MAX_NUMNODES]; - -extern unsigned long memory_start; -extern unsigned long memory_end; - -static void __init mem_prof_init(void) -{ - unsigned long start_pfn, holes, free_pfn; - const unsigned long zone_alignment = 1UL << (MAX_ORDER - 1); - unsigned long ul; - mem_prof_t *mp; - - /* Node#0 SDRAM */ - mp = &mem_prof[0]; - mp->start_pfn = PFN_UP(CONFIG_MEMORY_START); - mp->pages = PFN_DOWN(memory_end - memory_start); - mp->holes = 0; - mp->free_pfn = PFN_UP(__pa(_end)); - - /* Node#1 internal SRAM */ - mp = &mem_prof[1]; - start_pfn = free_pfn = PFN_UP(CONFIG_IRAM_START); - holes = 0; - if (start_pfn & (zone_alignment - 1)) { - ul = zone_alignment; - while (start_pfn >= ul) - ul += zone_alignment; - - start_pfn = ul - zone_alignment; - holes = free_pfn - start_pfn; - } - - mp->start_pfn = start_pfn; - mp->pages = PFN_DOWN(CONFIG_IRAM_SIZE) + holes; - mp->holes = holes; - mp->free_pfn = PFN_UP(CONFIG_IRAM_START); -} - -unsigned long __init setup_memory(void) -{ - unsigned long bootmap_size; - unsigned long min_pfn; - int nid; - mem_prof_t *mp; - - max_low_pfn = 0; - min_low_pfn = -1; - - mem_prof_init(); - - for_each_online_node(nid) { - mp = &mem_prof[nid]; - NODE_DATA(nid)=(pg_data_t *)&m32r_node_data[nid]; - NODE_DATA(nid)->bdata = &bootmem_node_data[nid]; - min_pfn = mp->start_pfn; - max_pfn = mp->start_pfn + mp->pages; - bootmap_size = init_bootmem_node(NODE_DATA(nid), mp->free_pfn, - mp->start_pfn, max_pfn); - - free_bootmem_node(NODE_DATA(nid), PFN_PHYS(mp->start_pfn), - PFN_PHYS(mp->pages)); - - reserve_bootmem_node(NODE_DATA(nid), PFN_PHYS(mp->start_pfn), - PFN_PHYS(mp->free_pfn - mp->start_pfn) + bootmap_size, - BOOTMEM_DEFAULT); - - if (max_low_pfn < max_pfn) - max_low_pfn = max_pfn; - - if (min_low_pfn > min_pfn) - min_low_pfn = min_pfn; - } - -#ifdef CONFIG_BLK_DEV_INITRD - if (LOADER_TYPE && INITRD_START) { - if (INITRD_START + INITRD_SIZE <= PFN_PHYS(max_low_pfn)) { - reserve_bootmem_node(NODE_DATA(0), INITRD_START, - INITRD_SIZE, BOOTMEM_DEFAULT); - initrd_start = INITRD_START + PAGE_OFFSET; - initrd_end = initrd_start + INITRD_SIZE; - printk("initrd:start[%08lx],size[%08lx]\n", - initrd_start, INITRD_SIZE); - } else { - printk("initrd extends beyond end of memory " - "(0x%08lx > 0x%08llx)\ndisabling initrd\n", - INITRD_START + INITRD_SIZE, - (unsigned long long)PFN_PHYS(max_low_pfn)); - - initrd_start = 0; - } - } -#endif /* CONFIG_BLK_DEV_INITRD */ - - return max_low_pfn; -} - -#define START_PFN(nid) (NODE_DATA(nid)->bdata->node_min_pfn) -#define MAX_LOW_PFN(nid) (NODE_DATA(nid)->bdata->node_low_pfn) - -void __init zone_sizes_init(void) -{ - unsigned long zones_size[MAX_NR_ZONES], zholes_size[MAX_NR_ZONES]; - unsigned long low, start_pfn; - int nid, i; - mem_prof_t *mp; - - for_each_online_node(nid) { - mp = &mem_prof[nid]; - for (i = 0 ; i < MAX_NR_ZONES ; i++) { - zones_size[i] = 0; - zholes_size[i] = 0; - } - start_pfn = START_PFN(nid); - low = MAX_LOW_PFN(nid); - zones_size[ZONE_DMA] = low - start_pfn; - zholes_size[ZONE_DMA] = mp->holes; - - node_set_state(nid, N_NORMAL_MEMORY); - free_area_init_node(nid, zones_size, start_pfn, zholes_size); - } - - /* - * For test - * Use all area of internal RAM. - * see __alloc_pages() - */ - NODE_DATA(1)->node_zones->watermark[WMARK_MIN] = 0; - NODE_DATA(1)->node_zones->watermark[WMARK_LOW] = 0; - NODE_DATA(1)->node_zones->watermark[WMARK_HIGH] = 0; -} diff --git a/arch/m32r/mm/extable.c b/arch/m32r/mm/extable.c deleted file mode 100644 index 066982756a4e..000000000000 --- a/arch/m32r/mm/extable.c +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/mm/extable.c - */ - -#include -#include - -int fixup_exception(struct pt_regs *regs) -{ - const struct exception_table_entry *fixup; - - fixup = search_exception_tables(regs->bpc); - if (fixup) { - regs->bpc = fixup->fixup; - return 1; - } - - return 0; -} diff --git a/arch/m32r/mm/fault-nommu.c b/arch/m32r/mm/fault-nommu.c deleted file mode 100644 index 240e00067d5e..000000000000 --- a/arch/m32r/mm/fault-nommu.c +++ /dev/null @@ -1,134 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/mm/fault.c - * - * Copyright (c) 2001, 2002 Hitoshi Yamamoto, and H. Kondo - * - * Some code taken from i386 version. - * Copyright (C) 1995 Linus Torvalds - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* For unblank_screen() */ - -#include -#include -#include -#include -#include -#include - -extern void die(const char *, struct pt_regs *, long); - -#ifndef CONFIG_SMP -asmlinkage unsigned int tlb_entry_i_dat; -asmlinkage unsigned int tlb_entry_d_dat; -#define tlb_entry_i tlb_entry_i_dat -#define tlb_entry_d tlb_entry_d_dat -#else -unsigned int tlb_entry_i_dat[NR_CPUS]; -unsigned int tlb_entry_d_dat[NR_CPUS]; -#define tlb_entry_i tlb_entry_i_dat[smp_processor_id()] -#define tlb_entry_d tlb_entry_d_dat[smp_processor_id()] -#endif - -void do_BUG(const char *file, int line) -{ - bust_spinlocks(1); - printk("kernel BUG at %s:%d!\n", file, line); -} - -/*======================================================================* - * do_page_fault() - *======================================================================* - * This routine handles page faults. It determines the address, - * and the problem, and then passes it off to one of the appropriate - * routines. - * - * ARGUMENT: - * regs : M32R SP reg. - * error_code : See below - * address : M32R MMU MDEVA reg. (Operand ACE) - * : M32R BPC reg. (Instruction ACE) - * - * error_code : - * bit 0 == 0 means no page found, 1 means protection fault - * bit 1 == 0 means read, 1 means write - * bit 2 == 0 means kernel, 1 means user-mode - *======================================================================*/ -asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, - unsigned long address) -{ - -/* - * Oops. The kernel tried to access some bad page. We'll have to - * terminate things with extreme prejudice. - */ - - bust_spinlocks(1); - - if (address < PAGE_SIZE) - printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); - else - printk(KERN_ALERT "Unable to handle kernel paging request"); - printk(" at virtual address %08lx\n",address); - printk(" printing bpc:\n"); - printk(KERN_ALERT "bpc = %08lx\n", regs->bpc); - - die("Oops", regs, error_code); - bust_spinlocks(0); - do_exit(SIGKILL); -} - -/*======================================================================* - * update_mmu_cache() - *======================================================================*/ -void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, - pte_t *ptep) -{ - BUG(); -} - -/*======================================================================* - * flush_tlb_page() : flushes one page - *======================================================================*/ -void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) -{ - BUG(); -} - -/*======================================================================* - * flush_tlb_range() : flushes a range of pages - *======================================================================*/ -void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, - unsigned long end) -{ - BUG(); -} - -/*======================================================================* - * flush_tlb_mm() : flushes the specified mm context TLB's - *======================================================================*/ -void local_flush_tlb_mm(struct mm_struct *mm) -{ - BUG(); -} - -/*======================================================================* - * flush_tlb_all() : flushes all processes TLBs - *======================================================================*/ -void local_flush_tlb_all(void) -{ - BUG(); -} diff --git a/arch/m32r/mm/fault.c b/arch/m32r/mm/fault.c deleted file mode 100644 index 46d9a5ca0e3a..000000000000 --- a/arch/m32r/mm/fault.c +++ /dev/null @@ -1,550 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/mm/fault.c - * - * Copyright (c) 2001, 2002 Hitoshi Yamamoto, and H. Kondo - * Copyright (c) 2004 Naoto Sugai, NIIBE Yutaka - * - * Some code taken from i386 version. - * Copyright (C) 1995 Linus Torvalds - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* For unblank_screen() */ -#include -#include -#include - -#include -#include -#include -#include - -extern void die(const char *, struct pt_regs *, long); - -#ifndef CONFIG_SMP -asmlinkage unsigned int tlb_entry_i_dat; -asmlinkage unsigned int tlb_entry_d_dat; -#define tlb_entry_i tlb_entry_i_dat -#define tlb_entry_d tlb_entry_d_dat -#else -unsigned int tlb_entry_i_dat[NR_CPUS]; -unsigned int tlb_entry_d_dat[NR_CPUS]; -#define tlb_entry_i tlb_entry_i_dat[smp_processor_id()] -#define tlb_entry_d tlb_entry_d_dat[smp_processor_id()] -#endif - -extern void init_tlb(void); - -/*======================================================================* - * do_page_fault() - *======================================================================* - * This routine handles page faults. It determines the address, - * and the problem, and then passes it off to one of the appropriate - * routines. - * - * ARGUMENT: - * regs : M32R SP reg. - * error_code : See below - * address : M32R MMU MDEVA reg. (Operand ACE) - * : M32R BPC reg. (Instruction ACE) - * - * error_code : - * bit 0 == 0 means no page found, 1 means protection fault - * bit 1 == 0 means read, 1 means write - * bit 2 == 0 means kernel, 1 means user-mode - * bit 3 == 0 means data, 1 means instruction - *======================================================================*/ -#define ACE_PROTECTION 1 -#define ACE_WRITE 2 -#define ACE_USERMODE 4 -#define ACE_INSTRUCTION 8 - -asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, - unsigned long address) -{ - struct task_struct *tsk; - struct mm_struct *mm; - struct vm_area_struct * vma; - unsigned long page, addr; - unsigned long flags = 0; - int fault; - siginfo_t info; - - /* - * If BPSW IE bit enable --> set PSW IE bit - */ - if (regs->psw & M32R_PSW_BIE) - local_irq_enable(); - - tsk = current; - - info.si_code = SEGV_MAPERR; - - /* - * We fault-in kernel-space virtual memory on-demand. The - * 'reference' page table is init_mm.pgd. - * - * NOTE! We MUST NOT take any locks for this case. We may - * be in an interrupt or a critical region, and should - * only copy the information from the master page table, - * nothing more. - * - * This verifies that the fault happens in kernel space - * (error_code & ACE_USERMODE) == 0, and that the fault was not a - * protection error (error_code & ACE_PROTECTION) == 0. - */ - if (address >= TASK_SIZE && !(error_code & ACE_USERMODE)) - goto vmalloc_fault; - - mm = tsk->mm; - - /* - * If we're in an interrupt or have no user context or have pagefaults - * disabled then we must not take the fault. - */ - if (faulthandler_disabled() || !mm) - goto bad_area_nosemaphore; - - if (error_code & ACE_USERMODE) - flags |= FAULT_FLAG_USER; - - /* When running in the kernel we expect faults to occur only to - * addresses in user space. All other faults represent errors in the - * kernel and should generate an OOPS. Unfortunately, in the case of an - * erroneous fault occurring in a code path which already holds mmap_sem - * we will deadlock attempting to validate the fault against the - * address space. Luckily the kernel only validly references user - * space from well defined areas of code, which are listed in the - * exceptions table. - * - * As the vast majority of faults will be valid we will only perform - * the source reference check when there is a possibility of a deadlock. - * Attempt to lock the address space, if we cannot we then validate the - * source. If this is invalid we can skip the address space check, - * thus avoiding the deadlock. - */ - if (!down_read_trylock(&mm->mmap_sem)) { - if ((error_code & ACE_USERMODE) == 0 && - !search_exception_tables(regs->psw)) - goto bad_area_nosemaphore; - down_read(&mm->mmap_sem); - } - - vma = find_vma(mm, address); - if (!vma) - goto bad_area; - if (vma->vm_start <= address) - goto good_area; - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; - - if (error_code & ACE_USERMODE) { - /* - * accessing the stack below "spu" is always a bug. - * The "+ 4" is there due to the push instruction - * doing pre-decrement on the stack and that - * doesn't show up until later.. - */ - if (address + 4 < regs->spu) - goto bad_area; - } - - if (expand_stack(vma, address)) - goto bad_area; -/* - * Ok, we have a good vm_area for this memory access, so - * we can handle it.. - */ -good_area: - info.si_code = SEGV_ACCERR; - switch (error_code & (ACE_WRITE|ACE_PROTECTION)) { - default: /* 3: write, present */ - /* fall through */ - case ACE_WRITE: /* write, not present */ - if (!(vma->vm_flags & VM_WRITE)) - goto bad_area; - flags |= FAULT_FLAG_WRITE; - break; - case ACE_PROTECTION: /* read, present */ - case 0: /* read, not present */ - if (!(vma->vm_flags & (VM_READ | VM_EXEC))) - goto bad_area; - } - - /* - * For instruction access exception, check if the area is executable - */ - if ((error_code & ACE_INSTRUCTION) && !(vma->vm_flags & VM_EXEC)) - goto bad_area; - - /* - * If for any reason at all we couldn't handle the fault, - * make sure we exit gracefully rather than endlessly redo - * the fault. - */ - addr = (address & PAGE_MASK); - set_thread_fault_code(error_code); - fault = handle_mm_fault(vma, addr, flags); - if (unlikely(fault & VM_FAULT_ERROR)) { - if (fault & VM_FAULT_OOM) - goto out_of_memory; - else if (fault & VM_FAULT_SIGSEGV) - goto bad_area; - else if (fault & VM_FAULT_SIGBUS) - goto do_sigbus; - BUG(); - } - if (fault & VM_FAULT_MAJOR) - tsk->maj_flt++; - else - tsk->min_flt++; - set_thread_fault_code(0); - up_read(&mm->mmap_sem); - return; - -/* - * Something tried to access memory that isn't in our memory map.. - * Fix it, but check if it's kernel or user first.. - */ -bad_area: - up_read(&mm->mmap_sem); - -bad_area_nosemaphore: - /* User mode accesses just cause a SIGSEGV */ - if (error_code & ACE_USERMODE) { - tsk->thread.address = address; - tsk->thread.error_code = error_code | (address >= TASK_SIZE); - tsk->thread.trap_no = 14; - info.si_signo = SIGSEGV; - info.si_errno = 0; - /* info.si_code has been set above */ - info.si_addr = (void __user *)address; - force_sig_info(SIGSEGV, &info, tsk); - return; - } - -no_context: - /* Are we prepared to handle this kernel fault? */ - if (fixup_exception(regs)) - return; - -/* - * Oops. The kernel tried to access some bad page. We'll have to - * terminate things with extreme prejudice. - */ - - bust_spinlocks(1); - - if (address < PAGE_SIZE) - printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); - else - printk(KERN_ALERT "Unable to handle kernel paging request"); - printk(" at virtual address %08lx\n",address); - printk(KERN_ALERT " printing bpc:\n"); - printk("%08lx\n", regs->bpc); - page = *(unsigned long *)MPTB; - page = ((unsigned long *) page)[address >> PGDIR_SHIFT]; - printk(KERN_ALERT "*pde = %08lx\n", page); - if (page & _PAGE_PRESENT) { - page &= PAGE_MASK; - address &= 0x003ff000; - page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT]; - printk(KERN_ALERT "*pte = %08lx\n", page); - } - die("Oops", regs, error_code); - bust_spinlocks(0); - do_exit(SIGKILL); - -/* - * We ran out of memory, or some other thing happened to us that made - * us unable to handle the page fault gracefully. - */ -out_of_memory: - up_read(&mm->mmap_sem); - if (!(error_code & ACE_USERMODE)) - goto no_context; - pagefault_out_of_memory(); - return; - -do_sigbus: - up_read(&mm->mmap_sem); - - /* Kernel mode? Handle exception or die */ - if (!(error_code & ACE_USERMODE)) - goto no_context; - - tsk->thread.address = address; - tsk->thread.error_code = error_code; - tsk->thread.trap_no = 14; - info.si_signo = SIGBUS; - info.si_errno = 0; - info.si_code = BUS_ADRERR; - info.si_addr = (void __user *)address; - force_sig_info(SIGBUS, &info, tsk); - return; - -vmalloc_fault: - { - /* - * Synchronize this task's top level page-table - * with the 'reference' page table. - * - * Do _not_ use "tsk" here. We might be inside - * an interrupt in the middle of a task switch.. - */ - int offset = pgd_index(address); - pgd_t *pgd, *pgd_k; - pmd_t *pmd, *pmd_k; - pte_t *pte_k; - - pgd = (pgd_t *)*(unsigned long *)MPTB; - pgd = offset + (pgd_t *)pgd; - pgd_k = init_mm.pgd + offset; - - if (!pgd_present(*pgd_k)) - goto no_context; - - /* - * set_pgd(pgd, *pgd_k); here would be useless on PAE - * and redundant with the set_pmd() on non-PAE. - */ - - pmd = pmd_offset(pgd, address); - pmd_k = pmd_offset(pgd_k, address); - if (!pmd_present(*pmd_k)) - goto no_context; - set_pmd(pmd, *pmd_k); - - pte_k = pte_offset_kernel(pmd_k, address); - if (!pte_present(*pte_k)) - goto no_context; - - addr = (address & PAGE_MASK); - set_thread_fault_code(error_code); - update_mmu_cache(NULL, addr, pte_k); - set_thread_fault_code(0); - return; - } -} - -/*======================================================================* - * update_mmu_cache() - *======================================================================*/ -#define TLB_MASK (NR_TLB_ENTRIES - 1) -#define ITLB_END (unsigned long *)(ITLB_BASE + (NR_TLB_ENTRIES * 8)) -#define DTLB_END (unsigned long *)(DTLB_BASE + (NR_TLB_ENTRIES * 8)) -void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr, - pte_t *ptep) -{ - volatile unsigned long *entry1, *entry2; - unsigned long pte_data, flags; - unsigned int *entry_dat; - int inst = get_thread_fault_code() & ACE_INSTRUCTION; - int i; - - /* Ptrace may call this routine. */ - if (vma && current->active_mm != vma->vm_mm) - return; - - local_irq_save(flags); - - vaddr = (vaddr & PAGE_MASK) | get_asid(); - - pte_data = pte_val(*ptep); - -#ifdef CONFIG_CHIP_OPSP - entry1 = (unsigned long *)ITLB_BASE; - for (i = 0; i < NR_TLB_ENTRIES; i++) { - if (*entry1++ == vaddr) { - set_tlb_data(entry1, pte_data); - break; - } - entry1++; - } - entry2 = (unsigned long *)DTLB_BASE; - for (i = 0; i < NR_TLB_ENTRIES; i++) { - if (*entry2++ == vaddr) { - set_tlb_data(entry2, pte_data); - break; - } - entry2++; - } -#else - /* - * Update TLB entries - * entry1: ITLB entry address - * entry2: DTLB entry address - */ - __asm__ __volatile__ ( - "seth %0, #high(%4) \n\t" - "st %2, @(%5, %0) \n\t" - "ldi %1, #1 \n\t" - "st %1, @(%6, %0) \n\t" - "add3 r4, %0, %7 \n\t" - ".fillinsn \n" - "1: \n\t" - "ld %1, @(%6, %0) \n\t" - "bnez %1, 1b \n\t" - "ld %0, @r4+ \n\t" - "ld %1, @r4 \n\t" - "st %3, @+%0 \n\t" - "st %3, @+%1 \n\t" - : "=&r" (entry1), "=&r" (entry2) - : "r" (vaddr), "r" (pte_data), "i" (MMU_REG_BASE), - "i" (MSVA_offset), "i" (MTOP_offset), "i" (MIDXI_offset) - : "r4", "memory" - ); -#endif - - if ((!inst && entry2 >= DTLB_END) || (inst && entry1 >= ITLB_END)) - goto notfound; - -found: - local_irq_restore(flags); - - return; - - /* Valid entry not found */ -notfound: - /* - * Update ITLB or DTLB entry - * entry1: TLB entry address - * entry2: TLB base address - */ - if (!inst) { - entry2 = (unsigned long *)DTLB_BASE; - entry_dat = &tlb_entry_d; - } else { - entry2 = (unsigned long *)ITLB_BASE; - entry_dat = &tlb_entry_i; - } - entry1 = entry2 + (((*entry_dat - 1) & TLB_MASK) << 1); - - for (i = 0 ; i < NR_TLB_ENTRIES ; i++) { - if (!(entry1[1] & 2)) /* Valid bit check */ - break; - - if (entry1 != entry2) - entry1 -= 2; - else - entry1 += TLB_MASK << 1; - } - - if (i >= NR_TLB_ENTRIES) { /* Empty entry not found */ - entry1 = entry2 + (*entry_dat << 1); - *entry_dat = (*entry_dat + 1) & TLB_MASK; - } - *entry1++ = vaddr; /* Set TLB tag */ - set_tlb_data(entry1, pte_data); - - goto found; -} - -/*======================================================================* - * flush_tlb_page() : flushes one page - *======================================================================*/ -void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) -{ - if (vma->vm_mm && mm_context(vma->vm_mm) != NO_CONTEXT) { - unsigned long flags; - - local_irq_save(flags); - page &= PAGE_MASK; - page |= (mm_context(vma->vm_mm) & MMU_CONTEXT_ASID_MASK); - __flush_tlb_page(page); - local_irq_restore(flags); - } -} - -/*======================================================================* - * flush_tlb_range() : flushes a range of pages - *======================================================================*/ -void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, - unsigned long end) -{ - struct mm_struct *mm; - - mm = vma->vm_mm; - if (mm_context(mm) != NO_CONTEXT) { - unsigned long flags; - int size; - - local_irq_save(flags); - size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT; - if (size > (NR_TLB_ENTRIES / 4)) { /* Too many TLB to flush */ - mm_context(mm) = NO_CONTEXT; - if (mm == current->mm) - activate_context(mm); - } else { - unsigned long asid; - - asid = mm_context(mm) & MMU_CONTEXT_ASID_MASK; - start &= PAGE_MASK; - end += (PAGE_SIZE - 1); - end &= PAGE_MASK; - - start |= asid; - end |= asid; - while (start < end) { - __flush_tlb_page(start); - start += PAGE_SIZE; - } - } - local_irq_restore(flags); - } -} - -/*======================================================================* - * flush_tlb_mm() : flushes the specified mm context TLB's - *======================================================================*/ -void local_flush_tlb_mm(struct mm_struct *mm) -{ - /* Invalidate all TLB of this process. */ - /* Instead of invalidating each TLB, we get new MMU context. */ - if (mm_context(mm) != NO_CONTEXT) { - unsigned long flags; - - local_irq_save(flags); - mm_context(mm) = NO_CONTEXT; - if (mm == current->mm) - activate_context(mm); - local_irq_restore(flags); - } -} - -/*======================================================================* - * flush_tlb_all() : flushes all processes TLBs - *======================================================================*/ -void local_flush_tlb_all(void) -{ - unsigned long flags; - - local_irq_save(flags); - __flush_tlb_all(); - local_irq_restore(flags); -} - -/*======================================================================* - * init_mmu() - *======================================================================*/ -void __init init_mmu(void) -{ - tlb_entry_i = 0; - tlb_entry_d = 0; - mmu_context_cache = MMU_CONTEXT_FIRST_VERSION; - set_asid(mmu_context_cache & MMU_CONTEXT_ASID_MASK); - *(volatile unsigned long *)MPTB = (unsigned long)swapper_pg_dir; -} diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c deleted file mode 100644 index 93abc8c3a46e..000000000000 --- a/arch/m32r/mm/init.c +++ /dev/null @@ -1,152 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/mm/init.c - * - * Copyright (c) 2001, 2002 Hitoshi Yamamoto - * - * Some code taken from sh version. - * Copyright (C) 1999 Niibe Yutaka - * Based on linux/arch/i386/mm/init.c: - * Copyright (C) 1995 Linus Torvalds - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -pgd_t swapper_pg_dir[1024]; - -/* - * Cache of MMU context last used. - */ -#ifndef CONFIG_SMP -unsigned long mmu_context_cache_dat; -#else -unsigned long mmu_context_cache_dat[NR_CPUS]; -#endif - -/* - * function prototype - */ -void __init paging_init(void); -void __init mem_init(void); -void free_initmem(void); -#ifdef CONFIG_BLK_DEV_INITRD -void free_initrd_mem(unsigned long, unsigned long); -#endif - -/* It'd be good if these lines were in the standard header file. */ -#define START_PFN(nid) (NODE_DATA(nid)->bdata->node_min_pfn) -#define MAX_LOW_PFN(nid) (NODE_DATA(nid)->bdata->node_low_pfn) - -#ifndef CONFIG_DISCONTIGMEM -void __init zone_sizes_init(void) -{ - unsigned long zones_size[MAX_NR_ZONES] = {0, }; - unsigned long start_pfn; - -#ifdef CONFIG_MMU - { - unsigned long low; - unsigned long max_dma; - - start_pfn = START_PFN(0); - max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; - low = MAX_LOW_PFN(0); - - if (low < max_dma) { - zones_size[ZONE_DMA] = low - start_pfn; - zones_size[ZONE_NORMAL] = 0; - } else { - zones_size[ZONE_DMA] = low - start_pfn; - zones_size[ZONE_NORMAL] = low - max_dma; - } - } -#else - zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT; - zones_size[ZONE_NORMAL] = __MEMORY_SIZE >> PAGE_SHIFT; - start_pfn = __MEMORY_START >> PAGE_SHIFT; -#endif /* CONFIG_MMU */ - - free_area_init_node(0, zones_size, start_pfn, 0); -} -#else /* CONFIG_DISCONTIGMEM */ -extern void zone_sizes_init(void); -#endif /* CONFIG_DISCONTIGMEM */ - -/*======================================================================* - * paging_init() : sets up the page tables - *======================================================================*/ -void __init paging_init(void) -{ -#ifdef CONFIG_MMU - int i; - pgd_t *pg_dir; - - /* We don't need kernel mapping as hardware support that. */ - pg_dir = swapper_pg_dir; - - for (i = 0 ; i < USER_PTRS_PER_PGD * 2 ; i++) - pgd_val(pg_dir[i]) = 0; -#endif /* CONFIG_MMU */ - zone_sizes_init(); -} - -/*======================================================================* - * mem_init() : - * orig : arch/sh/mm/init.c - *======================================================================*/ -void __init mem_init(void) -{ -#ifndef CONFIG_MMU - extern unsigned long memory_end; - - high_memory = (void *)(memory_end & PAGE_MASK); -#else - high_memory = (void *)__va(PFN_PHYS(MAX_LOW_PFN(0))); -#endif /* CONFIG_MMU */ - - /* clear the zero-page */ - memset(empty_zero_page, 0, PAGE_SIZE); - - set_max_mapnr(get_num_physpages()); - free_all_bootmem(); - mem_init_print_info(NULL); -} - -/*======================================================================* - * free_initmem() : - * orig : arch/sh/mm/init.c - *======================================================================*/ -void free_initmem(void) -{ - free_initmem_default(-1); -} - -#ifdef CONFIG_BLK_DEV_INITRD -/*======================================================================* - * free_initrd_mem() : - * orig : arch/sh/mm/init.c - *======================================================================*/ -void free_initrd_mem(unsigned long start, unsigned long end) -{ - free_reserved_area((void *)start, (void *)end, -1, "initrd"); -} -#endif diff --git a/arch/m32r/mm/ioremap-nommu.c b/arch/m32r/mm/ioremap-nommu.c deleted file mode 100644 index 2759f2d48384..000000000000 --- a/arch/m32r/mm/ioremap-nommu.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * linux/arch/m32r/mm/ioremap-nommu.c - * - * Copyright (c) 2001, 2002 Hiroyuki Kondo - * - * Taken from mips version. - * (C) Copyright 1995 1996 Linus Torvalds - * (C) Copyright 2001 Ralf Baechle - */ - -/* - * 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. - * - */ - -#include -#include -#include - -#include -#include -#include -#include -#include - - -/* - * Remap an arbitrary physical address space into the kernel virtual - * address space. Needed when the kernel wants to access high addresses - * directly. - * - * NOTE! We need to allow non-page-aligned mappings too: we will obviously - * have to convert them into an offset in a page-aligned mapping, but the - * caller shouldn't need to know that small detail. - */ - -#define IS_LOW512(addr) (!((unsigned long)(addr) & ~0x1fffffffUL)) - -void __iomem * -__ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) -{ - return (void *)phys_addr; -} - -#define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == KSEG1) - -void iounmap(volatile void __iomem *addr) -{ -} - diff --git a/arch/m32r/mm/ioremap.c b/arch/m32r/mm/ioremap.c deleted file mode 100644 index 5152c4e6ac80..000000000000 --- a/arch/m32r/mm/ioremap.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * linux/arch/m32r/mm/ioremap.c - * - * Copyright (c) 2001, 2002 Hiroyuki Kondo - * - * Taken from mips version. - * (C) Copyright 1995 1996 Linus Torvalds - * (C) Copyright 2001 Ralf Baechle - */ - -/* - * 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. - * - */ - -#include -#include -#include - -#include -#include -#include - -/* - * Generic mapping function (not visible outside): - */ - -/* - * Remap an arbitrary physical address space into the kernel virtual - * address space. Needed when the kernel wants to access high addresses - * directly. - * - * NOTE! We need to allow non-page-aligned mappings too: we will obviously - * have to convert them into an offset in a page-aligned mapping, but the - * caller shouldn't need to know that small detail. - */ - -#define IS_LOW512(addr) (!((unsigned long)(addr) & ~0x1fffffffUL)) - -void __iomem * -__ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) -{ - void __iomem * addr; - struct vm_struct * area; - unsigned long offset, last_addr; - pgprot_t pgprot; - - /* Don't allow wraparound or zero size */ - last_addr = phys_addr + size - 1; - if (!size || last_addr < phys_addr) - return NULL; - - /* - * Map objects in the low 512mb of address space using KSEG1, otherwise - * map using page tables. - */ - if (IS_LOW512(phys_addr) && IS_LOW512(phys_addr + size - 1)) - return (void *) KSEG1ADDR(phys_addr); - - /* - * Don't allow anybody to remap normal RAM that we're using.. - */ - if (phys_addr < virt_to_phys(high_memory)) { - char *t_addr, *t_end; - struct page *page; - - t_addr = __va(phys_addr); - t_end = t_addr + (size - 1); - - for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++) - if(!PageReserved(page)) - return NULL; - } - - pgprot = __pgprot(_PAGE_GLOBAL | _PAGE_PRESENT | _PAGE_READ - | _PAGE_WRITE | flags); - - /* - * Mappings have to be page-aligned - */ - offset = phys_addr & ~PAGE_MASK; - phys_addr &= PAGE_MASK; - size = PAGE_ALIGN(last_addr + 1) - phys_addr; - - /* - * Ok, go for it.. - */ - area = get_vm_area(size, VM_IOREMAP); - if (!area) - return NULL; - area->phys_addr = phys_addr; - addr = (void __iomem *) area->addr; - if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, - phys_addr, pgprot)) { - vunmap((void __force *) addr); - return NULL; - } - - return (void __iomem *) (offset + (char __iomem *)addr); -} - -#define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == KSEG1) - -void iounmap(volatile void __iomem *addr) -{ - if (!IS_KSEG1(addr)) - vfree((void *) (PAGE_MASK & (unsigned long) addr)); -} - diff --git a/arch/m32r/mm/mmu.S b/arch/m32r/mm/mmu.S deleted file mode 100644 index fd8f9c9b7b07..000000000000 --- a/arch/m32r/mm/mmu.S +++ /dev/null @@ -1,355 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/arch/m32r/mm/mmu.S - * - * Copyright (C) 2001 by Hiroyuki Kondo - */ - -#include -#include -#include - - .text -#ifdef CONFIG_MMU - -#include -#include -#include -#include - -/* - * TLB Miss Exception handler - */ - .balign 16 -ENTRY(tme_handler) - .global tlb_entry_i_dat - .global tlb_entry_d_dat - - SWITCH_TO_KERNEL_STACK - -#if defined(CONFIG_ISA_M32R2) - st r0, @-sp - st r1, @-sp - st r2, @-sp - st r3, @-sp - - seth r3, #high(MMU_REG_BASE) - ld r1, @(MESTS_offset, r3) ; r1: status (MESTS reg.) - ld r0, @(MDEVP_offset, r3) ; r0: PFN + ASID (MDEVP reg.) - st r1, @(MESTS_offset, r3) ; clear status (MESTS reg.) - and3 r1, r1, #(MESTS_IT) - bnez r1, 1f ; instruction TLB miss? - -;; data TLB miss -;; input -;; r0: PFN + ASID (MDEVP reg.) -;; r1 - r3: free -;; output -;; r0: PFN + ASID -;; r1: TLB entry base address -;; r2: &tlb_entry_{i|d}_dat -;; r3: free - -#ifndef CONFIG_SMP - seth r2, #high(tlb_entry_d_dat) - or3 r2, r2, #low(tlb_entry_d_dat) -#else /* CONFIG_SMP */ - ldi r1, #-8192 - seth r2, #high(tlb_entry_d_dat) - or3 r2, r2, #low(tlb_entry_d_dat) - and r1, sp - ld r1, @(16, r1) ; current_thread_info->cpu - slli r1, #2 - add r2, r1 -#endif /* !CONFIG_SMP */ - seth r1, #high(DTLB_BASE) - or3 r1, r1, #low(DTLB_BASE) - bra 2f - - .balign 16 - .fillinsn -1: -;; instrucntion TLB miss -;; input -;; r0: MDEVP reg. (included ASID) -;; r1 - r3: free -;; output -;; r0: PFN + ASID -;; r1: TLB entry base address -;; r2: &tlb_entry_{i|d}_dat -;; r3: free - ldi r3, #-4096 - and3 r0, r0, #(MMU_CONTEXT_ASID_MASK) - mvfc r1, bpc - and r1, r3 - or r0, r1 ; r0: PFN + ASID -#ifndef CONFIG_SMP - seth r2, #high(tlb_entry_i_dat) - or3 r2, r2, #low(tlb_entry_i_dat) -#else /* CONFIG_SMP */ - ldi r1, #-8192 - seth r2, #high(tlb_entry_i_dat) - or3 r2, r2, #low(tlb_entry_i_dat) - and r1, sp - ld r1, @(16, r1) ; current_thread_info->cpu - slli r1, #2 - add r2, r1 -#endif /* !CONFIG_SMP */ - seth r1, #high(ITLB_BASE) - or3 r1, r1, #low(ITLB_BASE) - - .fillinsn -2: -;; select TLB entry -;; input -;; r0: PFN + ASID -;; r1: TLB entry base address -;; r2: &tlb_entry_{i|d}_dat -;; r3: free -;; output -;; r0: PFN + ASID -;; r1: TLB entry address -;; r2, r3: free -#ifdef CONFIG_ISA_DUAL_ISSUE - ld r3, @r2 || srli r1, #3 -#else - ld r3, @r2 - srli r1, #3 -#endif - add r1, r3 - ; tlb_entry_{d|i}_dat++; - addi r3, #1 - and3 r3, r3, #(NR_TLB_ENTRIES - 1) -#ifdef CONFIG_ISA_DUAL_ISSUE - st r3, @r2 || slli r1, #3 -#else - st r3, @r2 - slli r1, #3 -#endif - -;; load pte -;; input -;; r0: PFN + ASID -;; r1: TLB entry address -;; r2, r3: free -;; output -;; r0: PFN + ASID -;; r1: TLB entry address -;; r2: pte_data -;; r3: free - ; pgd = *(unsigned long *)MPTB; - ld24 r2, #(-MPTB - 1) - srl3 r3, r0, #22 -#ifdef CONFIG_ISA_DUAL_ISSUE - not r2, r2 || slli r3, #2 ; r3: pgd offset -#else - not r2, r2 - slli r3, #2 -#endif - ld r2, @r2 ; r2: pgd base addr (MPTB reg.) - or r3, r2 ; r3: pmd addr - - ; pmd = pmd_offset(pgd, address); - ld r3, @r3 ; r3: pmd data - beqz r3, 3f ; pmd_none(*pmd) ? - - and3 r2, r3, #0xfff - add3 r2, r2, #-355 ; _KERNPG_TABLE(=0x163) - bnez r2, 3f ; pmd_bad(*pmd) ? - ldi r2, #-4096 - - ; pte = pte_offset(pmd, address); - and r2, r3 ; r2: pte base addr - srl3 r3, r0, #10 - and3 r3, r3, #0xffc ; r3: pte offset - or r3, r2 - seth r2, #0x8000 - or r3, r2 ; r3: pte addr - - ; pte_data = (unsigned long)pte_val(*pte); - ld r2, @r3 ; r2: pte data - and3 r3, r2, #2 ; _PAGE_PRESENT(=2) check - beqz r3, 3f - - .fillinsn -5: -;; set tlb -;; input -;; r0: PFN + ASID -;; r1: TLB entry address -;; r2: pte_data -;; r3: free - st r0, @r1 ; set_tlb_tag(entry++, address); - st r2, @+r1 ; set_tlb_data(entry, pte_data); - - .fillinsn -6: - ld r3, @sp+ - ld r2, @sp+ - ld r1, @sp+ - ld r0, @sp+ - rte - - .fillinsn -3: -;; error -;; input -;; r0: PFN + ASID -;; r1: TLB entry address -;; r2, r3: free -;; output -;; r0: PFN + ASID -;; r1: TLB entry address -;; r2: pte_data -;; r3: free -#ifdef CONFIG_ISA_DUAL_ISSUE - bra 5b || ldi r2, #2 -#else - ldi r2, #2 ; r2: pte_data = 0 | _PAGE_PRESENT(=2) - bra 5b -#endif - -#elif defined (CONFIG_ISA_M32R) - - st sp, @-sp - st r0, @-sp - st r1, @-sp - st r2, @-sp - st r3, @-sp - st r4, @-sp - - seth r3, #high(MMU_REG_BASE) - ld r0, @(MDEVA_offset,r3) ; r0: address (MDEVA reg.) - mvfc r2, bpc ; r2: bpc - ld r1, @(MESTS_offset,r3) ; r1: status (MESTS reg.) - st r1, @(MESTS_offset,r3) ; clear status (MESTS reg.) - and3 r1, r1, #(MESTS_IT) - beqz r1, 1f ; data TLB miss? - -;; instrucntion TLB miss - mv r0, r2 ; address = bpc; - ; entry = (unsigned long *)ITLB_BASE+tlb_entry_i*2; - seth r3, #shigh(tlb_entry_i_dat) - ld r4, @(low(tlb_entry_i_dat),r3) - sll3 r2, r4, #3 - seth r1, #high(ITLB_BASE) - or3 r1, r1, #low(ITLB_BASE) - add r2, r1 ; r2: entry - addi r4, #1 ; tlb_entry_i++; - and3 r4, r4, #(NR_TLB_ENTRIES-1) - st r4, @(low(tlb_entry_i_dat),r3) - bra 2f - .fillinsn -1: -;; data TLB miss - ; entry = (unsigned long *)DTLB_BASE+tlb_entry_d*2; - seth r3, #shigh(tlb_entry_d_dat) - ld r4, @(low(tlb_entry_d_dat),r3) - sll3 r2, r4, #3 - seth r1, #high(DTLB_BASE) - or3 r1, r1, #low(DTLB_BASE) - add r2, r1 ; r2: entry - addi r4, #1 ; tlb_entry_d++; - and3 r4, r4, #(NR_TLB_ENTRIES-1) - st r4, @(low(tlb_entry_d_dat),r3) - .fillinsn -2: -;; load pte -; r0: address, r2: entry -; r1,r3,r4: (free) - ; pgd = *(unsigned long *)MPTB; - ld24 r1, #(-MPTB-1) - not r1, r1 - ld r1, @r1 - srl3 r4, r0, #22 - sll3 r3, r4, #2 - add r3, r1 ; r3: pgd - ; pmd = pmd_offset(pgd, address); - ld r1, @r3 ; r1: pmd - beqz r1, 3f ; pmd_none(*pmd) ? -; - and3 r1, r1, #0x3ff - ldi r4, #0x163 ; _KERNPG_TABLE(=0x163) - bne r1, r4, 3f ; pmd_bad(*pmd) ? - - .fillinsn -4: - ; pte = pte_offset(pmd, address); - ld r4, @r3 ; r4: pte - ldi r3, #-4096 - and r4, r3 - srl3 r3, r0, #10 - and3 r3, r3, #0xffc - add r4, r3 - seth r3, #0x8000 - add r4, r3 ; r4: pte - ; pte_data = (unsigned long)pte_val(*pte); - ld r1, @r4 ; r1: pte_data - and3 r3, r1, #2 ; _PAGE_PRESENT(=2) check - beqz r3, 3f - - .fillinsn -;; set tlb -; r0: address, r1: pte_data, r2: entry -; r3,r4: (free) -5: - ldi r3, #-4096 ; set_tlb_tag(entry++, address); - and r3, r0 - seth r4, #shigh(MASID) - ld r4, @(low(MASID),r4) ; r4: MASID - and3 r4, r4, #(MMU_CONTEXT_ASID_MASK) - or r3, r4 - st r3, @r2 - st r1, @(4,r2) ; set_tlb_data(entry, pte_data); - - ld r4, @sp+ - ld r3, @sp+ - ld r2, @sp+ - ld r1, @sp+ - ld r0, @sp+ - ld sp, @sp+ - rte - - .fillinsn -3: - ldi r1, #2 ; r1: pte_data = 0 | _PAGE_PRESENT(=2) - bra 5b - -#else -#error unknown isa configuration -#endif - -ENTRY(init_tlb) -;; Set MMU Register - seth r0, #high(MMU_REG_BASE) ; Set MMU_REG_BASE higher - or3 r0, r0, #low(MMU_REG_BASE) ; Set MMU_REG_BASE lower - ldi r1, #0 - st r1, @(MPSZ_offset,r0) ; Set MPSZ Reg(Page size 4KB:0 16KB:1 64KB:2) - ldi r1, #0 - st r1, @(MASID_offset,r0) ; Set ASID Zero - -;; Set TLB - seth r0, #high(ITLB_BASE) ; Set ITLB_BASE higher - or3 r0, r0, #low(ITLB_BASE) ; Set ITLB_BASE lower - seth r1, #high(DTLB_BASE) ; Set DTLB_BASE higher - or3 r1, r1, #low(DTLB_BASE) ; Set DTLB_BASE lower - ldi r2, #0 - ldi r3, #NR_TLB_ENTRIES - addi r0, #-4 - addi r1, #-4 -clear_tlb: - st r2, @+r0 ; VPA <- 0 - st r2, @+r0 ; PPA <- 0 - st r2, @+r1 ; VPA <- 0 - st r2, @+r1 ; PPA <- 0 - addi r3, #-1 - bnez r3, clear_tlb -;; - jmp r14 - -ENTRY(m32r_itlb_entrys) -ENTRY(m32r_otlb_entrys) - -#endif /* CONFIG_MMU */ - - .end diff --git a/arch/m32r/mm/page.S b/arch/m32r/mm/page.S deleted file mode 100644 index a2e9367dbf79..000000000000 --- a/arch/m32r/mm/page.S +++ /dev/null @@ -1,82 +0,0 @@ -/* - * linux/arch/m32r/mm/page.S - * - * Clear/Copy page with CPU - * - * Copyright (C) 2004 The Free Software Initiative of Japan - * - * Written by Niibe Yutaka - * - * 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. - * - */ - .text - .global copy_page - /* - * copy_page (to, from) - * - * PAGE_SIZE = 4096-byte - * Cache line = 16-byte - * 16 * 256 - */ - .align 4 -copy_page: - ldi r2, #255 - ld r3, @r0 /* cache line allocate */ - ld r4, @r1+ - ld r5, @r1+ - ld r6, @r1+ - ld r7, @r1+ - .fillinsn -0: - st r4, @r0 - st r5, @+r0 - st r6, @+r0 - st r7, @+r0 - ld r4, @r1+ - addi r0, #4 - ld r5, @r1+ - ld r6, @r1+ - ld r7, @r1+ - ld r3, @r0 /* cache line allocate */ - addi r2, #-1 - bnez r2, 0b - - st r4, @r0 - st r5, @+r0 - st r6, @+r0 - st r7, @+r0 - jmp r14 - - .text - .global clear_page - /* - * clear_page (to) - * - * PAGE_SIZE = 4096-byte - * Cache line = 16-byte - * 16 * 256 - */ - .align 4 -clear_page: - ldi r2, #255 - ldi r4, #0 - ld r3, @r0 /* cache line allocate */ - .fillinsn -0: - st r4, @r0 - st r4, @+r0 - st r4, @+r0 - st r4, @+r0 - addi r0, #4 - ld r3, @r0 /* cache line allocate */ - addi r2, #-1 - bnez r2, 0b - - st r4, @r0 - st r4, @+r0 - st r4, @+r0 - st r4, @+r0 - jmp r14 diff --git a/arch/m32r/oprofile/Makefile b/arch/m32r/oprofile/Makefile deleted file mode 100644 index 8e63a3a5a64c..000000000000 --- a/arch/m32r/oprofile/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_OPROFILE) += oprofile.o - -DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \ - oprof.o cpu_buffer.o buffer_sync.o \ - event_buffer.o oprofile_files.o \ - oprofilefs.o oprofile_stats.o \ - timer_int.o ) - -oprofile-y := $(DRIVER_OBJS) init.o diff --git a/arch/m32r/oprofile/init.c b/arch/m32r/oprofile/init.c deleted file mode 100644 index fa56860f4258..000000000000 --- a/arch/m32r/oprofile/init.c +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @file init.c - * - * @remark Copyright 2002 OProfile authors - * @remark Read the file COPYING - * - * @author John Levon - */ - -#include -#include -#include -#include - -int __init oprofile_arch_init(struct oprofile_operations *ops) -{ - return -ENODEV; -} - -void oprofile_arch_exit(void) -{ -} diff --git a/arch/m32r/platforms/Makefile b/arch/m32r/platforms/Makefile deleted file mode 100644 index 9e1a82529ad9..000000000000 --- a/arch/m32r/platforms/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# arch/m32r/platforms/Makefile -obj-$(CONFIG_PLAT_M32104UT) += m32104ut/ -obj-$(CONFIG_PLAT_M32700UT) += m32700ut/ -obj-$(CONFIG_PLAT_MAPPI) += mappi/ -obj-$(CONFIG_PLAT_MAPPI2) += mappi2/ -obj-$(CONFIG_PLAT_MAPPI3) += mappi3/ -obj-$(CONFIG_PLAT_OAKS32R) += oaks32r/ -obj-$(CONFIG_PLAT_OPSPUT) += opsput/ -obj-$(CONFIG_PLAT_USRV) += usrv/ diff --git a/arch/m32r/platforms/m32104ut/Makefile b/arch/m32r/platforms/m32104ut/Makefile deleted file mode 100644 index 0de59084f21c..000000000000 --- a/arch/m32r/platforms/m32104ut/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y := setup.o io.o diff --git a/arch/m32r/platforms/m32104ut/io.c b/arch/m32r/platforms/m32104ut/io.c deleted file mode 100644 index ff2bb3b58bb5..000000000000 --- a/arch/m32r/platforms/m32104ut/io.c +++ /dev/null @@ -1,298 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/platforms/m32104ut/io.c - * - * Typical I/O routines for M32104UT board. - * - * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto, Mamoru Sakugawa, - * Naoto Sugai, Hayato Fujiwara - */ - -#include -#include -#include -#include - -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) -#include - -#define M32R_PCC_IOMAP_SIZE 0x1000 - -#define M32R_PCC_IOSTART0 0x1000 -#define M32R_PCC_IOEND0 (M32R_PCC_IOSTART0 + M32R_PCC_IOMAP_SIZE - 1) - -extern void pcc_ioread_byte(int, unsigned long, void *, size_t, size_t, int); -extern void pcc_ioread_word(int, unsigned long, void *, size_t, size_t, int); -extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int); -extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); -#endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ - -#define PORT2ADDR(port) _port2addr(port) - -static inline void *_port2addr(unsigned long port) -{ - return (void *)(port | NONCACHE_OFFSET); -} - -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) -static inline void *__port2addr_ata(unsigned long port) -{ - static int dummy_reg; - - switch (port) { - case 0x1f0: return (void *)(0x0c002000 | NONCACHE_OFFSET); - case 0x1f1: return (void *)(0x0c012800 | NONCACHE_OFFSET); - case 0x1f2: return (void *)(0x0c012002 | NONCACHE_OFFSET); - case 0x1f3: return (void *)(0x0c012802 | NONCACHE_OFFSET); - case 0x1f4: return (void *)(0x0c012004 | NONCACHE_OFFSET); - case 0x1f5: return (void *)(0x0c012804 | NONCACHE_OFFSET); - case 0x1f6: return (void *)(0x0c012006 | NONCACHE_OFFSET); - case 0x1f7: return (void *)(0x0c012806 | NONCACHE_OFFSET); - case 0x3f6: return (void *)(0x0c01200e | NONCACHE_OFFSET); - default: return (void *)&dummy_reg; - } -} -#endif - -/* - * M32104T-LAN is located in the extended bus space - * from 0x01000000 to 0x01ffffff on physical address. - * The base address of LAN controller(LAN91C111) is 0x300. - */ -#define LAN_IOSTART (0x300 | NONCACHE_OFFSET) -#define LAN_IOEND (0x320 | NONCACHE_OFFSET) -static inline void *_port2addr_ne(unsigned long port) -{ - return (void *)(port + NONCACHE_OFFSET + 0x01000000); -} - -static inline void delay(void) -{ - __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); -} - -/* - * NIC I/O function - */ - -#define PORT2ADDR_NE(port) _port2addr_ne(port) - -static inline unsigned char _ne_inb(void *portp) -{ - return *(volatile unsigned char *)portp; -} - -static inline unsigned short _ne_inw(void *portp) -{ - return (unsigned short)le16_to_cpu(*(volatile unsigned short *)portp); -} - -static inline void _ne_insb(void *portp, void *addr, unsigned long count) -{ - unsigned char *buf = (unsigned char *)addr; - - while (count--) - *buf++ = _ne_inb(portp); -} - -static inline void _ne_outb(unsigned char b, void *portp) -{ - *(volatile unsigned char *)portp = b; -} - -static inline void _ne_outw(unsigned short w, void *portp) -{ - *(volatile unsigned short *)portp = cpu_to_le16(w); -} - -unsigned char _inb(unsigned long port) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - return _ne_inb(PORT2ADDR_NE(port)); - - return *(volatile unsigned char *)PORT2ADDR(port); -} - -unsigned short _inw(unsigned long port) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - return _ne_inw(PORT2ADDR_NE(port)); - - return *(volatile unsigned short *)PORT2ADDR(port); -} - -unsigned long _inl(unsigned long port) -{ - return *(volatile unsigned long *)PORT2ADDR(port); -} - -unsigned char _inb_p(unsigned long port) -{ - unsigned char v = _inb(port); - delay(); - return (v); -} - -unsigned short _inw_p(unsigned long port) -{ - unsigned short v = _inw(port); - delay(); - return (v); -} - -unsigned long _inl_p(unsigned long port) -{ - unsigned long v = _inl(port); - delay(); - return (v); -} - -void _outb(unsigned char b, unsigned long port) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - _ne_outb(b, PORT2ADDR_NE(port)); - else - *(volatile unsigned char *)PORT2ADDR(port) = b; -} - -void _outw(unsigned short w, unsigned long port) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - _ne_outw(w, PORT2ADDR_NE(port)); - else - *(volatile unsigned short *)PORT2ADDR(port) = w; -} - -void _outl(unsigned long l, unsigned long port) -{ - *(volatile unsigned long *)PORT2ADDR(port) = l; -} - -void _outb_p(unsigned char b, unsigned long port) -{ - _outb(b, port); - delay(); -} - -void _outw_p(unsigned short w, unsigned long port) -{ - _outw(w, port); - delay(); -} - -void _outl_p(unsigned long l, unsigned long port) -{ - _outl(l, port); - delay(); -} - -void _insb(unsigned int port, void *addr, unsigned long count) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - _ne_insb(PORT2ADDR_NE(port), addr, count); - else { - unsigned char *buf = addr; - unsigned char *portp = PORT2ADDR(port); - while (count--) - *buf++ = *(volatile unsigned char *)portp; - } -} - -void _insw(unsigned int port, void *addr, unsigned long count) -{ - unsigned short *buf = addr; - unsigned short *portp; - - if (port >= LAN_IOSTART && port < LAN_IOEND) { - /* - * This portion is only used by smc91111.c to read data - * from the DATA_REG. Do not swap the data. - */ - portp = PORT2ADDR_NE(port); - while (count--) - *buf++ = *(volatile unsigned short *)portp; -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), - count, 1); -#endif -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - portp = __port2addr_ata(port); - while (count--) - *buf++ = *(volatile unsigned short *)portp; -#endif - } else { - portp = PORT2ADDR(port); - while (count--) - *buf++ = *(volatile unsigned short *)portp; - } -} - -void _insl(unsigned int port, void *addr, unsigned long count) -{ - unsigned long *buf = addr; - unsigned long *portp; - - portp = PORT2ADDR(port); - while (count--) - *buf++ = *(volatile unsigned long *)portp; -} - -void _outsb(unsigned int port, const void *addr, unsigned long count) -{ - const unsigned char *buf = addr; - unsigned char *portp; - - if (port >= LAN_IOSTART && port < LAN_IOEND) { - portp = PORT2ADDR_NE(port); - while (count--) - _ne_outb(*buf++, portp); - } else { - portp = PORT2ADDR(port); - while (count--) - *(volatile unsigned char *)portp = *buf++; - } -} - -void _outsw(unsigned int port, const void *addr, unsigned long count) -{ - const unsigned short *buf = addr; - unsigned short *portp; - - if (port >= LAN_IOSTART && port < LAN_IOEND) { - /* - * This portion is only used by smc91111.c to write data - * into the DATA_REG. Do not swap the data. - */ - portp = PORT2ADDR_NE(port); - while (count--) - *(volatile unsigned short *)portp = *buf++; -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - portp = __port2addr_ata(port); - while (count--) - *(volatile unsigned short *)portp = *buf++; -#endif -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), - count, 1); -#endif - } else { - portp = PORT2ADDR(port); - while (count--) - *(volatile unsigned short *)portp = *buf++; - } -} - -void _outsl(unsigned int port, const void *addr, unsigned long count) -{ - const unsigned long *buf = addr; - unsigned char *portp; - - portp = PORT2ADDR(port); - while (count--) - *(volatile unsigned long *)portp = *buf++; -} diff --git a/arch/m32r/platforms/m32104ut/setup.c b/arch/m32r/platforms/m32104ut/setup.c deleted file mode 100644 index 297936003b1f..000000000000 --- a/arch/m32r/platforms/m32104ut/setup.c +++ /dev/null @@ -1,139 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/m32r/platforms/m32104ut/setup.c - * - * Setup routines for M32104UT Board - * - * Copyright (c) 2002-2005 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto, Mamoru Sakugawa, - * Naoto Sugai, Hayato Fujiwara - */ - -#include -#include -#include -#include - -#include -#include - -#define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long))) - -icu_data_t icu_data[NR_IRQS]; - -static void disable_m32104ut_irq(unsigned int irq) -{ - unsigned long port, data; - - port = irq2port(irq); - data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7; - outl(data, port); -} - -static void enable_m32104ut_irq(unsigned int irq) -{ - unsigned long port, data; - - port = irq2port(irq); - data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6; - outl(data, port); -} - -static void mask_m32104ut_irq(struct irq_data *data) -{ - disable_m32104ut_irq(data->irq); -} - -static void unmask_m32104ut_irq(struct irq_data *data) -{ - enable_m32104ut_irq(data->irq); -} - -static void shutdown_m32104ut_irq(struct irq_data *data) -{ - unsigned int irq = data->irq; - unsigned long port = irq2port(irq); - - outl(M32R_ICUCR_ILEVEL7, port); -} - -static struct irq_chip m32104ut_irq_type = -{ - .name = "M32104UT-IRQ", - .irq_shutdown = shutdown_m32104ut_irq, - .irq_unmask = unmask_m32104ut_irq, - .irq_mask = mask_m32104ut_irq, -}; - -void __init init_IRQ(void) -{ - static int once = 0; - - if (once) - return; - else - once++; - -#if defined(CONFIG_SMC91X) - /* INT#0: LAN controller on M32104UT-LAN (SMC91C111)*/ - irq_set_chip_and_handler(M32R_IRQ_INT0, &m32104ut_irq_type, - handle_level_irq); - /* "H" level sense */ - cu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD11; - disable_m32104ut_irq(M32R_IRQ_INT0); -#endif /* CONFIG_SMC91X */ - - /* MFT2 : system timer */ - irq_set_chip_and_handler(M32R_IRQ_MFT2, &m32104ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; - disable_m32104ut_irq(M32R_IRQ_MFT2); - -#ifdef CONFIG_SERIAL_M32R_SIO - /* SIO0_R : uart receive data */ - irq_set_chip_and_handler(M32R_IRQ_SIO0_R, &m32104ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_SIO0_R].icucr = M32R_ICUCR_IEN; - disable_m32104ut_irq(M32R_IRQ_SIO0_R); - - /* SIO0_S : uart send data */ - irq_set_chip_and_handler(M32R_IRQ_SIO0_S, &m32104ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_SIO0_S].icucr = M32R_ICUCR_IEN; - disable_m32104ut_irq(M32R_IRQ_SIO0_S); -#endif /* CONFIG_SERIAL_M32R_SIO */ -} - -#if defined(CONFIG_SMC91X) - -#define LAN_IOSTART 0x300 -#define LAN_IOEND 0x320 -static struct resource smc91x_resources[] = { - [0] = { - .start = (LAN_IOSTART), - .end = (LAN_IOEND), - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = M32R_IRQ_INT0, - .end = M32R_IRQ_INT0, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device smc91x_device = { - .name = "smc91x", - .id = 0, - .num_resources = ARRAY_SIZE(smc91x_resources), - .resource = smc91x_resources, -}; -#endif - -static int __init platform_init(void) -{ -#if defined(CONFIG_SMC91X) - platform_device_register(&smc91x_device); -#endif - return 0; -} -arch_initcall(platform_init); diff --git a/arch/m32r/platforms/m32700ut/Makefile b/arch/m32r/platforms/m32700ut/Makefile deleted file mode 100644 index 0de59084f21c..000000000000 --- a/arch/m32r/platforms/m32700ut/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y := setup.o io.o diff --git a/arch/m32r/platforms/m32700ut/dot.gdbinit_200MHz_16MB b/arch/m32r/platforms/m32700ut/dot.gdbinit_200MHz_16MB deleted file mode 100644 index 525dab46982b..000000000000 --- a/arch/m32r/platforms/m32700ut/dot.gdbinit_200MHz_16MB +++ /dev/null @@ -1,249 +0,0 @@ -# .gdbinit file -# $Id: dot.gdbinit_200MHz_16MB,v 1.2 2004/10/20 03:02:27 fujiwara Exp $ -#----- -# NOTE: this file is generated by a script, "gen_gdbinit.pl". -# (Please type "gen_gdbinit.pl --help" and check the help message). -# $ Id: gen_gdbinit.pl,v 1.12 2004/07/26 09:56:10 takata Exp $ -#----- -# target platform: m32700ut - -# setting -set width 0d70 -set radix 0d16 - -debug_chaos - -# clk xin:cpu:bif:bus=25:200:50:50 -define clock_init - set *(unsigned long *)0x00ef4008 = 0x00000000 - set *(unsigned long *)0x00ef4004 = 0 - shell sleep 0.1 - # NOTE: Please change the master clock source from PLL-clock to Xin-clock - # and switch off PLL, before resetting the clock gear ratio. - - set *(unsigned long *)0x00ef4024 = 2 - set *(unsigned long *)0x00ef4020 = 2 - set *(unsigned long *)0x00ef4010 = 0 - set *(unsigned long *)0x00ef4014 = 0 - set *(unsigned long *)0x00ef4004 = 3 - shell sleep 0.1 - set *(unsigned long *)0x00ef4008 = 0x00000200 -end - -# Initialize SDRAM controller -define sdram_init - # SDIR0 - set *(unsigned long *)0x00ef6008 = 0x00000182 - # SDIR1 - set *(unsigned long *)0x00ef600c = 0x00000001 - # Initialize wait - shell sleep 0.1 - # Ch0-MOD - set *(unsigned long *)0x00ef602c = 0x00000020 - # Ch0-TR - set *(unsigned long *)0x00ef6028 = 0x00041302 - # Ch0-ADR (size:16MB) - set *(unsigned long *)0x00ef6020 = 0x08000002 - # AutoRef On - set *(unsigned long *)0x00ef6004 = 0x00010517 - # Access enable - set *(unsigned long *)0x00ef6024 = 0x00000001 -end -document sdram_init - SDRAM controller initialization - 0x08000000 - 0x08ffffff (16MB) -end - -# Initialize BSEL3 for UT-CFC -define cfc_init - set $sfrbase = 0xa0ef0000 -# too fast -# set *(unsigned long *)($sfrbase + 0x5300) = 0x0b0b8000 -# set *(unsigned long *)($sfrbase + 0x5304) = 0x00102204 -# set *(unsigned long *)($sfrbase + 0x5300) = 0x1f1f8000 -# set *(unsigned long *)($sfrbase + 0x5300) = 0x1f1f1fdf -# set *(unsigned long *)($sfrbase + 0x5304) = 0x0013220f -# set *(unsigned long *)($sfrbase + 0x5304) = 0x0013330f -end -document cfc_init - CF controller initialization -end - -# MMU enable -define mmu_enable - set $evb=0x88000000 - set *(unsigned long *)0xffff0024=1 -end - -# MMU disable -define mmu_disable - set $evb=0 - set *(unsigned long *)0xffff0024=0 -end - -# Show TLB entries -define show_tlb_entries - set $i = 0 - set $addr = $arg0 - set $nr_entries = $arg1 - use_mon_code - while ($i < $nr_entries) - set $tlb_tag = *(unsigned long*)$addr - set $tlb_data = *(unsigned long*)($addr + 4) - printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data - set $i = $i + 1 - set $addr = $addr + 8 - end - use_debug_dma -end -define itlb - set $itlb=0xfe000000 - show_tlb_entries $itlb 0d32 -end -define dtlb - set $dtlb=0xfe000800 - show_tlb_entries $dtlb 0d32 -end - -# Initialize TLB entries -define init_tlb_entries - set $i = 0 - set $addr = $arg0 - set $nr_entries = $arg1 - use_mon_code - while ($i < $nr_entries) - set *(unsigned long *)($addr + 0x4) = 0 - set $i = $i + 1 - set $addr = $addr + 8 - end - use_debug_dma -end -define tlb_init - set $itlb=0xfe000000 - init_tlb_entries $itlb 0d32 - set $dtlb=0xfe000800 - init_tlb_entries $dtlb 0d32 -end - -# Show current task structure -define show_current - set $current = $spi & 0xffffe000 - printf "$current=0x%08lX\n",$current - print *(struct task_struct *)$current -end - -# Show user assigned task structure -define show_task - set = $arg0 & 0xffffe000 - printf "$task=0x%08lX\n",$task - print *(struct task_struct *)$task -end -document show_task - Show user assigned task structure - arg0 : task structure address -end - -# Show M32R registers -define show_regs - printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3 - printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7 - printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11 - printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp - printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu - printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch - printf "EVB[0x%08lX]\n",$evb -end - -# Setup all -define setup - use_mon_code - set *(unsigned int)0xfffffffc=0x60 - shell sleep 0.1 - clock_init - shell sleep 0.1 - # SDRAM: 16MB - set *(unsigned long *)0x00ef6020 = 0x08000002 - cfc_init - # USB - set *(unsigned short *)0xb0301000 = 0x100 - - set $evb=0x08000000 -end - -# Load modules -define load_modules - use_debug_dma - load -end - -# Set kernel parameters -define set_kernel_parameters - set $param = (void*)0x08001000 - # INITRD_START -# set *(unsigned long *)($param + 0x0010) = 0x08300000 - # INITRD_SIZE -# set *(unsigned long *)($param + 0x0014) = 0x00000000 - # M32R_CPUCLK - set *(unsigned long *)($param + 0x0018) = 0d200000000 - # M32R_BUSCLK - set *(unsigned long *)($param + 0x001c) = 0d50000000 - - # M32R_TIMER_DIVIDE - set *(unsigned long *)($param + 0x0020) = 0d128 - - set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs,rsize=1024,wsize=1024 nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 mem=16M \0" -end - -# Boot -define boot - set_kernel_parameters - set $fp = 0 - set $pc = 0x08002000 -# set *(unsigned char *)0xffffffff = 0x03 - si - c -end - -# Set breakpoints -define set_breakpoints - b *0x08000030 -end - -# Restart -define restart - sdireset - sdireset - set $pc = 0 - b *0x04001000 - b *0x08001000 - b *0x08002000 - si - c - tlb_init - del - setup - load_modules - boot -end - -define si - stepi - x/i $pc - show_reg -end - -sdireset -sdireset -file vmlinux -target m32rsdi -set $pc = 0 -b *0x04001000 -b *0x08001000 -b *0x08002000 -c -tlb_init -del -setup -load_modules -boot - diff --git a/arch/m32r/platforms/m32700ut/dot.gdbinit_300MHz_32MB b/arch/m32r/platforms/m32700ut/dot.gdbinit_300MHz_32MB deleted file mode 100644 index aa503657a49b..000000000000 --- a/arch/m32r/platforms/m32700ut/dot.gdbinit_300MHz_32MB +++ /dev/null @@ -1,249 +0,0 @@ -# .gdbinit file -# $Id: dot.gdbinit_300MHz_32MB,v 1.2 2004/10/20 03:02:27 fujiwara Exp $ -#----- -# NOTE: this file is generated by a script, "gen_gdbinit.pl". -# (Please type "gen_gdbinit.pl --help" and check the help message). -# $ Id: gen_gdbinit.pl,v 1.12 2004/07/26 09:56:10 takata Exp $ -#----- -# target platform: m32700ut - -# setting -set width 0d70 -set radix 0d16 - -debug_chaos - -# clk xin:cpu:bif:bus=25:300:75:75 -define clock_init - set *(unsigned long *)0x00ef4008 = 0x00000000 - set *(unsigned long *)0x00ef4004 = 0 - shell sleep 0.1 - # NOTE: Please change the master clock source from PLL-clock to Xin-clock - # and switch off PLL, before resetting the clock gear ratio. - - set *(unsigned long *)0x00ef4024 = 2 - set *(unsigned long *)0x00ef4020 = 2 - set *(unsigned long *)0x00ef4010 = 0 - set *(unsigned long *)0x00ef4014 = 0 - set *(unsigned long *)0x00ef4004 = 5 - shell sleep 0.1 - set *(unsigned long *)0x00ef4008 = 0x00000200 -end - -# Initialize SDRAM controller -define sdram_init - # SDIR0 - set *(unsigned long *)0x00ef6008 = 0x00000182 - # SDIR1 - set *(unsigned long *)0x00ef600c = 0x00000001 - # Initialize wait - shell sleep 0.1 - # Ch0-MOD - set *(unsigned long *)0x00ef602c = 0x00000020 - # Ch0-TR - set *(unsigned long *)0x00ef6028 = 0x00051502 - # Ch0-ADR (size:32MB) - set *(unsigned long *)0x00ef6020 = 0x08000003 - # AutoRef On - set *(unsigned long *)0x00ef6004 = 0x00010e24 - # Access enable - set *(unsigned long *)0x00ef6024 = 0x00000001 -end -document sdram_init - SDRAM controller initialization - 0x08000000 - 0x09ffffff (32MB) -end - -# Initialize BSEL3 for UT-CFC -define cfc_init - set $sfrbase = 0xa0ef0000 -# too fast -# set *(unsigned long *)($sfrbase + 0x5300) = 0x0b0b8000 -# set *(unsigned long *)($sfrbase + 0x5304) = 0x00102204 -# set *(unsigned long *)($sfrbase + 0x5300) = 0x1f1f8000 -# set *(unsigned long *)($sfrbase + 0x5300) = 0x1f1f1fdf -# set *(unsigned long *)($sfrbase + 0x5304) = 0x0013220f -# set *(unsigned long *)($sfrbase + 0x5304) = 0x0013330f -end -document cfc_init - CF controller initialization -end - -# MMU enable -define mmu_enable - set $evb=0x88000000 - set *(unsigned long *)0xffff0024=1 -end - -# MMU disable -define mmu_disable - set $evb=0 - set *(unsigned long *)0xffff0024=0 -end - -# Show TLB entries -define show_tlb_entries - set $i = 0 - set $addr = $arg0 - set $nr_entries = $arg1 - use_mon_code - while ($i < $nr_entries) - set $tlb_tag = *(unsigned long*)$addr - set $tlb_data = *(unsigned long*)($addr + 4) - printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data - set $i = $i + 1 - set $addr = $addr + 8 - end - use_debug_dma -end -define itlb - set $itlb=0xfe000000 - show_tlb_entries $itlb 0d32 -end -define dtlb - set $dtlb=0xfe000800 - show_tlb_entries $dtlb 0d32 -end - -# Initialize TLB entries -define init_tlb_entries - set $i = 0 - set $addr = $arg0 - set $nr_entries = $arg1 - use_mon_code - while ($i < $nr_entries) - set *(unsigned long *)($addr + 0x4) = 0 - set $i = $i + 1 - set $addr = $addr + 8 - end - use_debug_dma -end -define tlb_init - set $itlb=0xfe000000 - init_tlb_entries $itlb 0d32 - set $dtlb=0xfe000800 - init_tlb_entries $dtlb 0d32 -end - -# Show current task structure -define show_current - set $current = $spi & 0xffffe000 - printf "$current=0x%08lX\n",$current - print *(struct task_struct *)$current -end - -# Show user assigned task structure -define show_task - set = $arg0 & 0xffffe000 - printf "$task=0x%08lX\n",$task - print *(struct task_struct *)$task -end -document show_task - Show user assigned task structure - arg0 : task structure address -end - -# Show M32R registers -define show_regs - printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3 - printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7 - printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11 - printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp - printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu - printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch - printf "EVB[0x%08lX]\n",$evb -end - -# Setup all -define setup - use_mon_code - set *(unsigned int)0xfffffffc=0x60 - shell sleep 0.1 - clock_init - shell sleep 0.1 - # SDRAM: 32MB - set *(unsigned long *)0x00ef6020 = 0x08000003 - cfc_init - # USB - set *(unsigned short *)0xb0301000 = 0x100 - - set $evb=0x08000000 -end - -# Load modules -define load_modules - use_debug_dma - load -end - -# Set kernel parameters -define set_kernel_parameters - set $param = (void*)0x08001000 - # INITRD_START -# set *(unsigned long *)($param + 0x0010) = 0x08300000 - # INITRD_SIZE -# set *(unsigned long *)($param + 0x0014) = 0x00000000 - # M32R_CPUCLK - set *(unsigned long *)($param + 0x0018) = 0d300000000 - # M32R_BUSCLK - set *(unsigned long *)($param + 0x001c) = 0d75000000 - - # M32R_TIMER_DIVIDE - set *(unsigned long *)($param + 0x0020) = 0d128 - - set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs,rsize=1024,wsize=1024 nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 mem=32M \0" -end - -# Boot -define boot - set_kernel_parameters - set $fp = 0 - set $pc = 0x08002000 -# set *(unsigned char *)0xffffffff = 0x03 - si - c -end - -# Set breakpoints -define set_breakpoints - b *0x08000030 -end - -# Restart -define restart - sdireset - sdireset - set $pc = 0 - b *0x04001000 - b *0x08001000 - b *0x08002000 - si - c - tlb_init - del - setup - load_modules - boot -end - -define si - stepi - x/i $pc - show_reg -end - -sdireset -sdireset -file vmlinux -target m32rsdi -set $pc = 0 -b *0x04001000 -b *0x08001000 -b *0x08002000 -c -tlb_init -del -setup -load_modules -boot - diff --git a/arch/m32r/platforms/m32700ut/dot.gdbinit_400MHz_32MB b/arch/m32r/platforms/m32700ut/dot.gdbinit_400MHz_32MB deleted file mode 100644 index adc608aab2fe..000000000000 --- a/arch/m32r/platforms/m32700ut/dot.gdbinit_400MHz_32MB +++ /dev/null @@ -1,249 +0,0 @@ -# .gdbinit file -# $Id: dot.gdbinit_400MHz_32MB,v 1.1 2004/10/21 01:41:27 fujiwara Exp $ -#----- -# NOTE: this file is generated by a script, "gen_gdbinit.pl". -# (Please type "gen_gdbinit.pl --help" and check the help message). -# $ Id: gen_gdbinit.pl,v 1.12 2004/07/26 09:56:10 takata Exp $ -#----- -# target platform: m32700ut - -# setting -set width 0d70 -set radix 0d16 - -debug_chaos - -# clk xin:cpu:bif:bus=25:400:100:50 -define clock_init - set *(unsigned long *)0x00ef4008 = 0x00000000 - set *(unsigned long *)0x00ef4004 = 0 - shell sleep 0.1 - # NOTE: Please change the master clock source from PLL-clock to Xin-clock - # and switch off PLL, before resetting the clock gear ratio. - - set *(unsigned long *)0x00ef4024 = 3 - set *(unsigned long *)0x00ef4020 = 2 - set *(unsigned long *)0x00ef4010 = 0 - set *(unsigned long *)0x00ef4014 = 0 - set *(unsigned long *)0x00ef4004 = 7 - shell sleep 0.1 - set *(unsigned long *)0x00ef4008 = 0x00000200 -end - -# Initialize SDRAM controller -define sdram_init - # SDIR0 - set *(unsigned long *)0x00ef6008 = 0x00000182 - # SDIR1 - set *(unsigned long *)0x00ef600c = 0x00000001 - # Initialize wait - shell sleep 0.1 - # Ch0-MOD - set *(unsigned long *)0x00ef602c = 0x00000020 - # Ch0-TR - set *(unsigned long *)0x00ef6028 = 0x00041302 - # Ch0-ADR (size:32MB) - set *(unsigned long *)0x00ef6020 = 0x08000003 - # AutoRef On - set *(unsigned long *)0x00ef6004 = 0x00010517 - # Access enable - set *(unsigned long *)0x00ef6024 = 0x00000001 -end -document sdram_init - SDRAM controller initialization - 0x08000000 - 0x09ffffff (32MB) -end - -# Initialize BSEL3 for UT-CFC -define cfc_init - set $sfrbase = 0xa0ef0000 -# too fast -# set *(unsigned long *)($sfrbase + 0x5300) = 0x0b0b8000 -# set *(unsigned long *)($sfrbase + 0x5304) = 0x00102204 -# set *(unsigned long *)($sfrbase + 0x5300) = 0x1f1f8000 -# set *(unsigned long *)($sfrbase + 0x5300) = 0x1f1f1fdf -# set *(unsigned long *)($sfrbase + 0x5304) = 0x0013220f -# set *(unsigned long *)($sfrbase + 0x5304) = 0x0013330f -end -document cfc_init - CF controller initialization -end - -# MMU enable -define mmu_enable - set $evb=0x88000000 - set *(unsigned long *)0xffff0024=1 -end - -# MMU disable -define mmu_disable - set $evb=0 - set *(unsigned long *)0xffff0024=0 -end - -# Show TLB entries -define show_tlb_entries - set $i = 0 - set $addr = $arg0 - set $nr_entries = $arg1 - use_mon_code - while ($i < $nr_entries) - set $tlb_tag = *(unsigned long*)$addr - set $tlb_data = *(unsigned long*)($addr + 4) - printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data - set $i = $i + 1 - set $addr = $addr + 8 - end - use_debug_dma -end -define itlb - set $itlb=0xfe000000 - show_tlb_entries $itlb 0d32 -end -define dtlb - set $dtlb=0xfe000800 - show_tlb_entries $dtlb 0d32 -end - -# Initialize TLB entries -define init_tlb_entries - set $i = 0 - set $addr = $arg0 - set $nr_entries = $arg1 - use_mon_code - while ($i < $nr_entries) - set *(unsigned long *)($addr + 0x4) = 0 - set $i = $i + 1 - set $addr = $addr + 8 - end - use_debug_dma -end -define tlb_init - set $itlb=0xfe000000 - init_tlb_entries $itlb 0d32 - set $dtlb=0xfe000800 - init_tlb_entries $dtlb 0d32 -end - -# Show current task structure -define show_current - set $current = $spi & 0xffffe000 - printf "$current=0x%08lX\n",$current - print *(struct task_struct *)$current -end - -# Show user assigned task structure -define show_task - set = $arg0 & 0xffffe000 - printf "$task=0x%08lX\n",$task - print *(struct task_struct *)$task -end -document show_task - Show user assigned task structure - arg0 : task structure address -end - -# Show M32R registers -define show_regs - printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3 - printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7 - printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11 - printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp - printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu - printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch - printf "EVB[0x%08lX]\n",$evb -end - -# Setup all -define setup - use_mon_code - set *(unsigned int)0xfffffffc=0x60 - shell sleep 0.1 - clock_init - shell sleep 0.1 - # SDRAM: 32MB - set *(unsigned long *)0x00ef6020 = 0x08000003 - cfc_init - # USB - set *(unsigned short *)0xb0301000 = 0x100 - - set $evb=0x08000000 -end - -# Load modules -define load_modules - use_debug_dma - load -end - -# Set kernel parameters -define set_kernel_parameters - set $param = (void*)0x08001000 - # INITRD_START -# set *(unsigned long *)($param + 0x0010) = 0x08300000 - # INITRD_SIZE -# set *(unsigned long *)($param + 0x0014) = 0x00000000 - # M32R_CPUCLK - set *(unsigned long *)($param + 0x0018) = 0d400000000 - # M32R_BUSCLK - set *(unsigned long *)($param + 0x001c) = 0d50000000 - - # M32R_TIMER_DIVIDE - set *(unsigned long *)($param + 0x0020) = 0d128 - - set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x console=tty1 root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs,rsize=1024,wsize=1024 nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 mem=32M \0" -end - -# Boot -define boot - set_kernel_parameters - set $fp = 0 - set $pc = 0x08002000 -# set *(unsigned char *)0xffffffff = 0x03 - si - c -end - -# Set breakpoints -define set_breakpoints - b *0x08000030 -end - -# Restart -define restart - sdireset - sdireset - set $pc = 0 - b *0x04001000 - b *0x08001000 - b *0x08002000 - si - c - tlb_init - del - setup - load_modules - boot -end - -define si - stepi - x/i $pc - show_reg -end - -sdireset -sdireset -file vmlinux -target m32rsdi -set $pc = 0 -b *0x04001000 -b *0x08001000 -b *0x08002000 -c -tlb_init -del -setup -load_modules -boot - diff --git a/arch/m32r/platforms/m32700ut/io.c b/arch/m32r/platforms/m32700ut/io.c deleted file mode 100644 index 6862586e58db..000000000000 --- a/arch/m32r/platforms/m32700ut/io.c +++ /dev/null @@ -1,395 +0,0 @@ -/* - * linux/arch/m32r/platforms/m32700ut/io.c - * - * Typical I/O routines for M32700UT board. - * - * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto, Takeo Takahashi - * - * 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. - */ - -#include -#include -#include -#include - -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) -#include - -#define M32R_PCC_IOMAP_SIZE 0x1000 - -#define M32R_PCC_IOSTART0 0x1000 -#define M32R_PCC_IOEND0 (M32R_PCC_IOSTART0 + M32R_PCC_IOMAP_SIZE - 1) - -extern void pcc_ioread_byte(int, unsigned long, void *, size_t, size_t, int); -extern void pcc_ioread_word(int, unsigned long, void *, size_t, size_t, int); -extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int); -extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); -#endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ - -#define PORT2ADDR(port) _port2addr(port) -#define PORT2ADDR_USB(port) _port2addr_usb(port) - -static inline void *_port2addr(unsigned long port) -{ - return (void *)(port | NONCACHE_OFFSET); -} - -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) -static inline void *__port2addr_ata(unsigned long port) -{ - static int dummy_reg; - - switch (port) { - case 0x1f0: return (void *)(0x0c002000 | NONCACHE_OFFSET); - case 0x1f1: return (void *)(0x0c012800 | NONCACHE_OFFSET); - case 0x1f2: return (void *)(0x0c012002 | NONCACHE_OFFSET); - case 0x1f3: return (void *)(0x0c012802 | NONCACHE_OFFSET); - case 0x1f4: return (void *)(0x0c012004 | NONCACHE_OFFSET); - case 0x1f5: return (void *)(0x0c012804 | NONCACHE_OFFSET); - case 0x1f6: return (void *)(0x0c012006 | NONCACHE_OFFSET); - case 0x1f7: return (void *)(0x0c012806 | NONCACHE_OFFSET); - case 0x3f6: return (void *)(0x0c01200e | NONCACHE_OFFSET); - default: return (void *)&dummy_reg; - } -} -#endif - -/* - * M32700UT-LAN is located in the extended bus space - * from 0x10000000 to 0x13ffffff on physical address. - * The base address of LAN controller(LAN91C111) is 0x300. - */ -#define LAN_IOSTART (0x300 | NONCACHE_OFFSET) -#define LAN_IOEND (0x320 | NONCACHE_OFFSET) -static inline void *_port2addr_ne(unsigned long port) -{ - return (void *)(port + 0x10000000); -} -static inline void *_port2addr_usb(unsigned long port) -{ - return (void *)((port & 0x0f) + NONCACHE_OFFSET + 0x10303000); -} - -static inline void delay(void) -{ - __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); -} - -/* - * NIC I/O function - */ - -#define PORT2ADDR_NE(port) _port2addr_ne(port) - -static inline unsigned char _ne_inb(void *portp) -{ - return *(volatile unsigned char *)portp; -} - -static inline unsigned short _ne_inw(void *portp) -{ - return (unsigned short)le16_to_cpu(*(volatile unsigned short *)portp); -} - -static inline void _ne_insb(void *portp, void *addr, unsigned long count) -{ - unsigned char *buf = (unsigned char *)addr; - - while (count--) - *buf++ = _ne_inb(portp); -} - -static inline void _ne_outb(unsigned char b, void *portp) -{ - *(volatile unsigned char *)portp = b; -} - -static inline void _ne_outw(unsigned short w, void *portp) -{ - *(volatile unsigned short *)portp = cpu_to_le16(w); -} - -unsigned char _inb(unsigned long port) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - return _ne_inb(PORT2ADDR_NE(port)); - -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - return *(volatile unsigned char *)__port2addr_ata(port); - } -#endif -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); - return b; - } else -#endif - - return *(volatile unsigned char *)PORT2ADDR(port); -} - -unsigned short _inw(unsigned long port) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - return _ne_inw(PORT2ADDR_NE(port)); -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - return *(volatile unsigned short *)__port2addr_ata(port); - } -#endif -#if defined(CONFIG_USB) - else if(port >= 0x340 && port < 0x3a0) - return *(volatile unsigned short *)PORT2ADDR_USB(port); -#endif -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); - return w; - } else -#endif - return *(volatile unsigned short *)PORT2ADDR(port); -} - -unsigned long _inl(unsigned long port) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned long l; - pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); - return l; - } else -#endif - return *(volatile unsigned long *)PORT2ADDR(port); -} - -unsigned char _inb_p(unsigned long port) -{ - unsigned char v = _inb(port); - delay(); - return (v); -} - -unsigned short _inw_p(unsigned long port) -{ - unsigned short v = _inw(port); - delay(); - return (v); -} - -unsigned long _inl_p(unsigned long port) -{ - unsigned long v = _inl(port); - delay(); - return (v); -} - -void _outb(unsigned char b, unsigned long port) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - _ne_outb(b, PORT2ADDR_NE(port)); - else -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - *(volatile unsigned char *)__port2addr_ata(port) = b; - } else -#endif -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); - } else -#endif - *(volatile unsigned char *)PORT2ADDR(port) = b; -} - -void _outw(unsigned short w, unsigned long port) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - _ne_outw(w, PORT2ADDR_NE(port)); - else -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - *(volatile unsigned short *)__port2addr_ata(port) = w; - } else -#endif -#if defined(CONFIG_USB) - if(port >= 0x340 && port < 0x3a0) - *(volatile unsigned short *)PORT2ADDR_USB(port) = w; - else -#endif -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); - } else -#endif - *(volatile unsigned short *)PORT2ADDR(port) = w; -} - -void _outl(unsigned long l, unsigned long port) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); - } else -#endif - *(volatile unsigned long *)PORT2ADDR(port) = l; -} - -void _outb_p(unsigned char b, unsigned long port) -{ - _outb(b, port); - delay(); -} - -void _outw_p(unsigned short w, unsigned long port) -{ - _outw(w, port); - delay(); -} - -void _outl_p(unsigned long l, unsigned long port) -{ - _outl(l, port); - delay(); -} - -void _insb(unsigned int port, void *addr, unsigned long count) -{ - if (port >= LAN_IOSTART && port < LAN_IOEND) - _ne_insb(PORT2ADDR_NE(port), addr, count); -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - unsigned char *buf = addr; - unsigned char *portp = __port2addr_ata(port); - while (count--) - *buf++ = *(volatile unsigned char *)portp; - } -#endif -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), - count, 1); - } -#endif - else { - unsigned char *buf = addr; - unsigned char *portp = PORT2ADDR(port); - while (count--) - *buf++ = *(volatile unsigned char *)portp; - } -} - -void _insw(unsigned int port, void *addr, unsigned long count) -{ - unsigned short *buf = addr; - unsigned short *portp; - - if (port >= LAN_IOSTART && port < LAN_IOEND) { - /* - * This portion is only used by smc91111.c to read data - * from the DATA_REG. Do not swap the data. - */ - portp = PORT2ADDR_NE(port); - while (count--) - *buf++ = *(volatile unsigned short *)portp; -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), - count, 1); -#endif -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - portp = __port2addr_ata(port); - while (count--) - *buf++ = *(volatile unsigned short *)portp; -#endif - } else { - portp = PORT2ADDR(port); - while (count--) - *buf++ = *(volatile unsigned short *)portp; - } -} - -void _insl(unsigned int port, void *addr, unsigned long count) -{ - unsigned long *buf = addr; - unsigned long *portp; - - portp = PORT2ADDR(port); - while (count--) - *buf++ = *(volatile unsigned long *)portp; -} - -void _outsb(unsigned int port, const void *addr, unsigned long count) -{ - const unsigned char *buf = addr; - unsigned char *portp; - - if (port >= LAN_IOSTART && port < LAN_IOEND) { - portp = PORT2ADDR_NE(port); - while (count--) - _ne_outb(*buf++, portp); -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - portp = __port2addr_ata(port); - while (count--) - *(volatile unsigned char *)portp = *buf++; -#endif -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), - count, 1); -#endif - } else { - portp = PORT2ADDR(port); - while (count--) - *(volatile unsigned char *)portp = *buf++; - } -} - -void _outsw(unsigned int port, const void *addr, unsigned long count) -{ - const unsigned short *buf = addr; - unsigned short *portp; - - if (port >= LAN_IOSTART && port < LAN_IOEND) { - /* - * This portion is only used by smc91111.c to write data - * into the DATA_REG. Do not swap the data. - */ - portp = PORT2ADDR_NE(port); - while (count--) - *(volatile unsigned short *)portp = *buf++; -#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { - portp = __port2addr_ata(port); - while (count--) - *(volatile unsigned short *)portp = *buf++; -#endif -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) - } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), - count, 1); -#endif - } else { - portp = PORT2ADDR(port); - while (count--) - *(volatile unsigned short *)portp = *buf++; - } -} - -void _outsl(unsigned int port, const void *addr, unsigned long count) -{ - const unsigned long *buf = addr; - unsigned char *portp; - - portp = PORT2ADDR(port); - while (count--) - *(volatile unsigned long *)portp = *buf++; -} diff --git a/arch/m32r/platforms/m32700ut/setup.c b/arch/m32r/platforms/m32700ut/setup.c deleted file mode 100644 index 349eb341752c..000000000000 --- a/arch/m32r/platforms/m32700ut/setup.c +++ /dev/null @@ -1,451 +0,0 @@ -/* - * linux/arch/m32r/platforms/m32700ut/setup.c - * - * Setup routines for Renesas M32700UT Board - * - * Copyright (c) 2002-2005 Hiroyuki Kondo, Hirokazu Takata, - * Hitoshi Yamamoto, Takeo Takahashi - * - * 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. - */ - -#include -#include -#include -#include - -#include -#include - -/* - * M32700 Interrupt Control Unit (Level 1) - */ -#define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long))) - -icu_data_t icu_data[M32700UT_NUM_CPU_IRQ]; - -static void disable_m32700ut_irq(unsigned int irq) -{ - unsigned long port, data; - - port = irq2port(irq); - data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7; - outl(data, port); -} - -static void enable_m32700ut_irq(unsigned int irq) -{ - unsigned long port, data; - - port = irq2port(irq); - data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6; - outl(data, port); -} - -static void mask_m32700ut(struct irq_data *data) -{ - disable_m32700ut_irq(data->irq); -} - -static void unmask_m32700ut(struct irq_data *data) -{ - enable_m32700ut_irq(data->irq); -} - -static void shutdown_m32700ut(struct irq_data *data) -{ - unsigned long port; - - port = irq2port(data->irq); - outl(M32R_ICUCR_ILEVEL7, port); -} - -static struct irq_chip m32700ut_irq_type = -{ - .name = "M32700UT-IRQ", - .irq_shutdown = shutdown_m32700ut, - .irq_mask = mask_m32700ut, - .irq_unmask = unmask_m32700ut -}; - -/* - * Interrupt Control Unit of PLD on M32700UT (Level 2) - */ -#define irq2pldirq(x) ((x) - M32700UT_PLD_IRQ_BASE) -#define pldirq2port(x) (unsigned long)((int)PLD_ICUCR1 + \ - (((x) - 1) * sizeof(unsigned short))) - -typedef struct { - unsigned short icucr; /* ICU Control Register */ -} pld_icu_data_t; - -static pld_icu_data_t pld_icu_data[M32700UT_NUM_PLD_IRQ]; - -static void disable_m32700ut_pld_irq(unsigned int irq) -{ - unsigned long port, data; - unsigned int pldirq; - - pldirq = irq2pldirq(irq); - port = pldirq2port(pldirq); - data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; - outw(data, port); -} - -static void enable_m32700ut_pld_irq(unsigned int irq) -{ - unsigned long port, data; - unsigned int pldirq; - - pldirq = irq2pldirq(irq); - port = pldirq2port(pldirq); - data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; - outw(data, port); -} - -static void mask_m32700ut_pld(struct irq_data *data) -{ - disable_m32700ut_pld_irq(data->irq); -} - -static void unmask_m32700ut_pld(struct irq_data *data) -{ - enable_m32700ut_pld_irq(data->irq); - enable_m32700ut_irq(M32R_IRQ_INT1); -} - -static void shutdown_m32700ut_pld_irq(struct irq_data *data) -{ - unsigned long port; - unsigned int pldirq; - - pldirq = irq2pldirq(data->irq); - port = pldirq2port(pldirq); - outw(PLD_ICUCR_ILEVEL7, port); -} - -static struct irq_chip m32700ut_pld_irq_type = -{ - .name = "M32700UT-PLD-IRQ", - .irq_shutdown = shutdown_m32700ut_pld_irq, - .irq_mask = mask_m32700ut_pld, - .irq_unmask = unmask_m32700ut_pld, -}; - -/* - * Interrupt Control Unit of PLD on M32700UT-LAN (Level 2) - */ -#define irq2lanpldirq(x) ((x) - M32700UT_LAN_PLD_IRQ_BASE) -#define lanpldirq2port(x) (unsigned long)((int)M32700UT_LAN_ICUCR1 + \ - (((x) - 1) * sizeof(unsigned short))) - -static pld_icu_data_t lanpld_icu_data[M32700UT_NUM_LAN_PLD_IRQ]; - -static void disable_m32700ut_lanpld_irq(unsigned int irq) -{ - unsigned long port, data; - unsigned int pldirq; - - pldirq = irq2lanpldirq(irq); - port = lanpldirq2port(pldirq); - data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; - outw(data, port); -} - -static void enable_m32700ut_lanpld_irq(unsigned int irq) -{ - unsigned long port, data; - unsigned int pldirq; - - pldirq = irq2lanpldirq(irq); - port = lanpldirq2port(pldirq); - data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; - outw(data, port); -} - -static void mask_m32700ut_lanpld(struct irq_data *data) -{ - disable_m32700ut_lanpld_irq(data->irq); -} - -static void unmask_m32700ut_lanpld(struct irq_data *data) -{ - enable_m32700ut_lanpld_irq(data->irq); - enable_m32700ut_irq(M32R_IRQ_INT0); -} - -static void shutdown_m32700ut_lanpld(struct irq_data *data) -{ - unsigned long port; - unsigned int pldirq; - - pldirq = irq2lanpldirq(data->irq); - port = lanpldirq2port(pldirq); - outw(PLD_ICUCR_ILEVEL7, port); -} - -static struct irq_chip m32700ut_lanpld_irq_type = -{ - .name = "M32700UT-PLD-LAN-IRQ", - .irq_shutdown = shutdown_m32700ut_lanpld, - .irq_mask = mask_m32700ut_lanpld, - .irq_unmask = unmask_m32700ut_lanpld, -}; - -/* - * Interrupt Control Unit of PLD on M32700UT-LCD (Level 2) - */ -#define irq2lcdpldirq(x) ((x) - M32700UT_LCD_PLD_IRQ_BASE) -#define lcdpldirq2port(x) (unsigned long)((int)M32700UT_LCD_ICUCR1 + \ - (((x) - 1) * sizeof(unsigned short))) - -#ifdef CONFIG_USB -static pld_icu_data_t lcdpld_icu_data[M32700UT_NUM_LCD_PLD_IRQ]; - -static void disable_m32700ut_lcdpld_irq(unsigned int irq) -{ - unsigned long port, data; - unsigned int pldirq; - - pldirq = irq2lcdpldirq(irq); - port = lcdpldirq2port(pldirq); - data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; - outw(data, port); -} - -static void enable_m32700ut_lcdpld_irq(unsigned int irq) -{ - unsigned long port, data; - unsigned int pldirq; - - pldirq = irq2lcdpldirq(irq); - port = lcdpldirq2port(pldirq); - data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; - outw(data, port); -} - -static void mask_m32700ut_lcdpld(struct irq_data *data) -{ - disable_m32700ut_lcdpld_irq(data->irq); -} - -static void unmask_m32700ut_lcdpld(struct irq_data *data) -{ - enable_m32700ut_lcdpld_irq(data->irq); - enable_m32700ut_irq(M32R_IRQ_INT2); -} - -static void shutdown_m32700ut_lcdpld(struct irq_data *data) -{ - unsigned long port; - unsigned int pldirq; - - pldirq = irq2lcdpldirq(data->irq); - port = lcdpldirq2port(pldirq); - outw(PLD_ICUCR_ILEVEL7, port); -} - -static struct irq_chip m32700ut_lcdpld_irq_type = -{ - .name = "M32700UT-PLD-LCD-IRQ", - .irq_shutdown = shutdown_m32700ut_lcdpld, - .irq_mask = mask_m32700ut_lcdpld, - .irq_unmask = unmask_m32700ut_lcdpld, -}; -#endif - -void __init init_IRQ(void) -{ -#if defined(CONFIG_SMC91X) - /* INT#0: LAN controller on M32700UT-LAN (SMC91C111)*/ - irq_set_chip_and_handler(M32700UT_LAN_IRQ_LAN, - &m32700ut_lanpld_irq_type, handle_level_irq); - lanpld_icu_data[irq2lanpldirq(M32700UT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */ - disable_m32700ut_lanpld_irq(M32700UT_LAN_IRQ_LAN); -#endif /* CONFIG_SMC91X */ - - /* MFT2 : system timer */ - irq_set_chip_and_handler(M32R_IRQ_MFT2, &m32700ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; - disable_m32700ut_irq(M32R_IRQ_MFT2); - - /* SIO0 : receive */ - irq_set_chip_and_handler(M32R_IRQ_SIO0_R, &m32700ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_SIO0_R].icucr = 0; - disable_m32700ut_irq(M32R_IRQ_SIO0_R); - - /* SIO0 : send */ - irq_set_chip_and_handler(M32R_IRQ_SIO0_S, &m32700ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_SIO0_S].icucr = 0; - disable_m32700ut_irq(M32R_IRQ_SIO0_S); - - /* SIO1 : receive */ - irq_set_chip_and_handler(M32R_IRQ_SIO1_R, &m32700ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_SIO1_R].icucr = 0; - disable_m32700ut_irq(M32R_IRQ_SIO1_R); - - /* SIO1 : send */ - irq_set_chip_and_handler(M32R_IRQ_SIO1_S, &m32700ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_SIO1_S].icucr = 0; - disable_m32700ut_irq(M32R_IRQ_SIO1_S); - - /* DMA1 : */ - irq_set_chip_and_handler(M32R_IRQ_DMA1, &m32700ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_DMA1].icucr = 0; - disable_m32700ut_irq(M32R_IRQ_DMA1); - -#ifdef CONFIG_SERIAL_M32R_PLDSIO - /* INT#1: SIO0 Receive on PLD */ - irq_set_chip_and_handler(PLD_IRQ_SIO0_RCV, &m32700ut_pld_irq_type, - handle_level_irq); - pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; - disable_m32700ut_pld_irq(PLD_IRQ_SIO0_RCV); - - /* INT#1: SIO0 Send on PLD */ - irq_set_chip_and_handler(PLD_IRQ_SIO0_SND, &m32700ut_pld_irq_type, - handle_level_irq); - pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; - disable_m32700ut_pld_irq(PLD_IRQ_SIO0_SND); -#endif /* CONFIG_SERIAL_M32R_PLDSIO */ - - /* INT#1: CFC IREQ on PLD */ - irq_set_chip_and_handler(PLD_IRQ_CFIREQ, &m32700ut_pld_irq_type, - handle_level_irq); - pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* 'L' level sense */ - disable_m32700ut_pld_irq(PLD_IRQ_CFIREQ); - - /* INT#1: CFC Insert on PLD */ - irq_set_chip_and_handler(PLD_IRQ_CFC_INSERT, &m32700ut_pld_irq_type, - handle_level_irq); - pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00; /* 'L' edge sense */ - disable_m32700ut_pld_irq(PLD_IRQ_CFC_INSERT); - - /* INT#1: CFC Eject on PLD */ - irq_set_chip_and_handler(PLD_IRQ_CFC_EJECT, &m32700ut_pld_irq_type, - handle_level_irq); - pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ - disable_m32700ut_pld_irq(PLD_IRQ_CFC_EJECT); - - /* - * INT0# is used for LAN, DIO - * We enable it here. - */ - icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; - enable_m32700ut_irq(M32R_IRQ_INT0); - - /* - * INT1# is used for UART, MMC, CF Controller in FPGA. - * We enable it here. - */ - icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; - enable_m32700ut_irq(M32R_IRQ_INT1); - -#if defined(CONFIG_USB) - outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */ - irq_set_chip_and_handler(M32700UT_LCD_IRQ_USB_INT1, - &m32700ut_lcdpld_irq_type, handle_level_irq); - - lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ - disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1); -#endif - /* - * INT2# is used for BAT, USB, AUDIO - * We enable it here. - */ - icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; - enable_m32700ut_irq(M32R_IRQ_INT2); - -#if defined(CONFIG_VIDEO_M32R_AR) - /* - * INT3# is used for AR - */ - irq_set_chip_and_handler(M32R_IRQ_INT3, &m32700ut_irq_type, - handle_level_irq); - icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; - disable_m32700ut_irq(M32R_IRQ_INT3); -#endif /* CONFIG_VIDEO_M32R_AR */ -} - -#if defined(CONFIG_SMC91X) - -#define LAN_IOSTART 0x300 -#define LAN_IOEND 0x320 -static struct resource smc91x_resources[] = { - [0] = { - .start = (LAN_IOSTART), - .end = (LAN_IOEND), - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = M32700UT_LAN_IRQ_LAN, - .end = M32700UT_LAN_IRQ_LAN, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device smc91x_device = { - .name = "smc91x", - .id = 0, - .num_resources = ARRAY_SIZE(smc91x_resources), - .resource = smc91x_resources, -}; -#endif - -#if defined(CONFIG_FB_S1D13XXX) - -#include