summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-08-01 21:28:37 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-08-01 21:28:37 +0000
commit2d70004cdf30f4366a9491d89aa815fee6af277b (patch)
treee5cbc8953450b07ecdb07b001cb0515787c017d9 /sys
parent78e3747faca380a2773a67695f2cbe0c3d6b3938 (diff)
I have a dream of cvs not missing the files I have cvs rm'd with love.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/arm/footbridge/dc21285mem.h90
-rw-r--r--sys/arch/arm/footbridge/dc21285reg.h393
-rw-r--r--sys/arch/arm/footbridge/footbridge.c287
-rw-r--r--sys/arch/arm/footbridge/footbridge.h17
-rw-r--r--sys/arch/arm/footbridge/footbridge_clock.c473
-rw-r--r--sys/arch/arm/footbridge/footbridge_com.c868
-rw-r--r--sys/arch/arm/footbridge/footbridge_com_io.c211
-rw-r--r--sys/arch/arm/footbridge/footbridge_intr.h213
-rw-r--r--sys/arch/arm/footbridge/footbridge_io.c323
-rw-r--r--sys/arch/arm/footbridge/footbridge_irqhandler.c459
-rw-r--r--sys/arch/arm/footbridge/footbridge_irqhandler.h60
-rw-r--r--sys/arch/arm/footbridge/footbridge_machdep.c66
-rw-r--r--sys/arch/arm/footbridge/footbridge_mutex.c67
-rw-r--r--sys/arch/arm/footbridge/footbridge_mutex.h61
-rw-r--r--sys/arch/arm/footbridge/footbridge_pci.c400
-rw-r--r--sys/arch/arm/footbridge/footbridgevar.h95
-rw-r--r--sys/arch/arm/footbridge/isa/ds1687reg.h129
-rw-r--r--sys/arch/arm/footbridge/isa/dsrtc.c277
-rw-r--r--sys/arch/arm/footbridge/isa/icu.h71
-rw-r--r--sys/arch/arm/footbridge/isa/isa_io.c321
-rw-r--r--sys/arch/arm/footbridge/isa/isa_io_asm.S342
-rw-r--r--sys/arch/arm/footbridge/isa/isa_machdep.c601
-rw-r--r--sys/arch/arm/footbridge/todclock.c344
-rw-r--r--sys/arch/arm/footbridge/todclockvar.h68
-rw-r--r--sys/arch/cats/Makefile36
-rw-r--r--sys/arch/cats/cats/autoconf.c129
-rw-r--r--sys/arch/cats/cats/cats_machdep.c1046
-rw-r--r--sys/arch/cats/compile/.cvsignore2
-rw-r--r--sys/arch/cats/conf/GENERIC322
-rw-r--r--sys/arch/cats/conf/Makefile.cats216
-rw-r--r--sys/arch/cats/conf/RAMDISK237
-rw-r--r--sys/arch/cats/conf/files.cats110
-rw-r--r--sys/arch/cats/conf/ldscript.elf76
-rw-r--r--sys/arch/cats/include/_types.h12
-rw-r--r--sys/arch/cats/include/asm.h4
-rw-r--r--sys/arch/cats/include/atomic.h10
-rw-r--r--sys/arch/cats/include/bootconfig.h76
-rw-r--r--sys/arch/cats/include/bus.h4
-rw-r--r--sys/arch/cats/include/cdefs.h3
-rw-r--r--sys/arch/cats/include/conf.h19
-rw-r--r--sys/arch/cats/include/cpu.h4
-rw-r--r--sys/arch/cats/include/cyclone_boot.h67
-rw-r--r--sys/arch/cats/include/db_machdep.h4
-rw-r--r--sys/arch/cats/include/disklabel.h3
-rw-r--r--sys/arch/cats/include/elf_abi.h3
-rw-r--r--sys/arch/cats/include/endian.h4
-rw-r--r--sys/arch/cats/include/exec.h3
-rw-r--r--sys/arch/cats/include/float.h4
-rw-r--r--sys/arch/cats/include/fp.h4
-rw-r--r--sys/arch/cats/include/frame.h4
-rw-r--r--sys/arch/cats/include/ieee.h4
-rw-r--r--sys/arch/cats/include/ieeefp.h4
-rw-r--r--sys/arch/cats/include/internal_types.h7
-rw-r--r--sys/arch/cats/include/intr.h4
-rw-r--r--sys/arch/cats/include/irqhandler.h4
-rw-r--r--sys/arch/cats/include/isa_machdep.h13
-rw-r--r--sys/arch/cats/include/limits.h4
-rw-r--r--sys/arch/cats/include/lock.h4
-rw-r--r--sys/arch/cats/include/mutex.h3
-rw-r--r--sys/arch/cats/include/param.h51
-rw-r--r--sys/arch/cats/include/pcb.h4
-rw-r--r--sys/arch/cats/include/pio.h4
-rw-r--r--sys/arch/cats/include/pmap.h4
-rw-r--r--sys/arch/cats/include/proc.h4
-rw-r--r--sys/arch/cats/include/profile.h4
-rw-r--r--sys/arch/cats/include/psl.h1
-rw-r--r--sys/arch/cats/include/ptrace.h4
-rw-r--r--sys/arch/cats/include/reg.h4
-rw-r--r--sys/arch/cats/include/reloc.h2
-rw-r--r--sys/arch/cats/include/setjmp.h4
-rw-r--r--sys/arch/cats/include/signal.h4
-rw-r--r--sys/arch/cats/include/spinlock.h6
-rw-r--r--sys/arch/cats/include/stdarg.h3
-rw-r--r--sys/arch/cats/include/sysarch.h4
-rw-r--r--sys/arch/cats/include/trap.h4
-rw-r--r--sys/arch/cats/include/vmparam.h100
-rw-r--r--sys/arch/cats/isa/isa_machdep.h3
-rw-r--r--sys/arch/cats/pci/pci_machdep.h2
-rw-r--r--sys/arch/cats/pci/pcib.c136
-rw-r--r--sys/arch/cats/pci/pciide_machdep.c90
80 files changed, 0 insertions, 9123 deletions
diff --git a/sys/arch/arm/footbridge/dc21285mem.h b/sys/arch/arm/footbridge/dc21285mem.h
deleted file mode 100644
index 29ab4045e87..00000000000
--- a/sys/arch/arm/footbridge/dc21285mem.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* $OpenBSD: dc21285mem.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
-/* $NetBSD: dc21285mem.h,v 1.2 2001/06/09 10:44:11 chris Exp $ */
-
-/*
- * Copyright (c) 1997,1998 Mark Brinicombe.
- * Copyright (c) 1997,1998 Causality Limited
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Physical memory map provided by the DC21285 'Footbridge'
- */
-
-#define DC21285_SDRAM_BASE 0x00000000
-#define DC21285_SDRAM_SIZE 0x10000000 /* 256 MB */
-
-#define DC21285_SDRAM_A0MR 0x40000000
-#define DC21285_SDRAM_A1MR 0x40004000
-#define DC21285_SDRAM_A2MR 0x40008000
-#define DC21285_SDRAM_A3MR 0x4000C000
-
-#define DC21285_XBUS_XCS0 0x40010000
-#define DC21285_XBUS_XCS1 0x40011000
-#define DC21285_XBUS_XCS2 0x40012000
-#define DC21285_XBUS_NOCS 0x40013000
-
-#define DC21285_ROM_BASE 0x41000000
-#define DC21285_ROM_SIZE 0x01000000 /* 16MB */
-
-#define DC21285_ARMCSR_BASE 0x42000000
-#define DC21285_ARMCSR_SIZE 0x00100000 /* 1MB */
-
-#define DC21285_SA_CACHE_FLUSH_BASE 0x50000000
-#define DC21285_SA_CACHE_FLUSH_SIZE 0x01000000 /* 16MB */
-
-#define DC21285_OUTBOUND_WRITE_FLUSH 0x78000000
-
-#define DC21285_PCI_IACK_SPECIAL 0x79000000
-#define DC21285_PCI_TYPE_1_CONFIG 0x7A000000
-#define DC21285_PCI_TYPE_0_CONFIG 0x7B000000
-#define DC21285_PCI_IO_BASE 0x7C000000
-#define DC21285_PCI_IO_SIZE 0x00010000 /* 64K */
-#define DC21285_PCI_MEM_BASE 0x80000000
-#define DC21285_PCI_MEM_SIZE 0x80000000 /* 2GB */
-
-/*
- * Standard Virtual memory map used for the DC21285 'Footbridge'
- */
-#define DC21285_ARMCSR_VBASE 0xFD000000
-#define DC21285_ARMCSR_VSIZE 0x00100000 /* 1MB */
-#define DC21285_CACHE_FLUSH_VBASE 0xFD100000
-#define DC21285_CACHE_FLUSH_VSIZE 0x00100000 /* 1MB */
-#define DC21285_PCI_IO_VBASE 0xFD200000
-#define DC21285_PCI_IO_VSIZE 0x00100000 /* 1MB */
-#define DC21285_PCI_IACK_VBASE 0xFD300000
-#define DC21285_PCI_IACK_VSIZE 0x00100000 /* 1MB */
-#define DC21285_PCI_ISA_MEM_VBASE 0xFD400000
-#define DC21285_PCI_ISA_MEM_VSIZE 0x00100000 /* 1MB */
-#define DC21285_PCI_TYPE_1_CONFIG_VBASE 0xFE000000
-#define DC21285_PCI_TYPE_1_CONFIG_VSIZE 0x01000000 /* 16MB */
-#define DC21285_PCI_TYPE_0_CONFIG_VBASE 0xFF000000
-#define DC21285_PCI_TYPE_0_CONFIG_VSIZE 0x01000000 /* 16MB */
diff --git a/sys/arch/arm/footbridge/dc21285reg.h b/sys/arch/arm/footbridge/dc21285reg.h
deleted file mode 100644
index e1a690ccc1e..00000000000
--- a/sys/arch/arm/footbridge/dc21285reg.h
+++ /dev/null
@@ -1,393 +0,0 @@
-/* $OpenBSD: dc21285reg.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
-/* $NetBSD: dc21285reg.h,v 1.3 2002/11/03 21:43:30 chris Exp $ */
-
-/*
- * Copyright (c) 1997,1998 Mark Brinicombe.
- * Copyright (c) 1997,1998 Causality Limited
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * DC21285 register definitions
- */
-
-/* PCI registers in CSR space */
-
-#define VENDOR_ID 0x00
-#define DC21285_VENDOR_ID 0x1011
-#define DEVICE_ID 0x02
-#define DC21285_DEVICE_ID 0x1065
-#define REVISION 0x08
-#define CLASS 0x0A
-
-/* Other PCI control / status registers */
-
-#define OUTBOUND_INT_STATUS 0x030
-#define OUTBOUND_INT_MASK 0x034
-#define I2O_INBOUND_FIFO 0x040
-#define I2O_OUTBOUND_FIFO 0x044
-
-/* Mailbox registers */
-
-#define MAILBOX_0 0x050
-#define MAILBOX_1 0x054
-#define MAILBOX_2 0x058
-#define MAILBOX_3 0x05C
-
-#define DOORBELL 0x060
-#define DOORBELL_SETUP 0x064
-#define ROM_WRITE_BYTE_ADDRESS 0x068
-
-/* DMA Channel registers */
-
-#define DMA_CHAN_1_BYTE_COUNT 0x80
-#define DMA_CHAN_1_PCI_ADDR 0x84
-#define DMA_CHAN_1_SDRAM_ADDR 0x88
-#define DMA_CHAN_1_DESCRIPT 0x8C
-#define DMA_CHAN_1_CONTROL 0x90
-#define DMA_CHAN_2_BYTE_COUNT 0xA0
-#define DMA_CHAN_2_PCI_ADDR 0xA4
-#define DMA_CHAN_2_SDRAM_ADDR 0xA8
-#define DMA_CHAN_2_DESCRIPTOR 0xAC
-#define DMA_CHAN_2_CONTROL 0xB0
-
-/* Offsets into DMA descriptor */
-
-#define DMA_BYTE_COUNT 0
-#define DMA_PCI_ADDRESS 4
-#define DMA_SDRAM_ADDRESS 8
-#define DMA_NEXT_DESCRIPTOR 12
-
-/* DMA byte count register bits */
-
-#define DMA_INTERBURST_SHIFT 24
-#define DMA_PCI_TO_SDRAM 0
-#define DMA_SDRAM_TO_PCI (1 << 30)
-#define DMA_END_CHAIN (1 << 31)
-
-/* DMA control bits */
-
-#define DMA_ENABLE (1 << 0)
-#define DMA_TRANSFER_DONE (1 << 2)
-#define DMA_ERROR (1 << 3)
-#define DMA_REGISTOR_DESCRIPTOR (1 << 4)
-#define DMA_PCI_MEM_READ (0 << 5)
-#define DMA_PCI_MEM_READ_LINE (1 << 5)
-#define DMA_PCI_MEM_READ_MULTI1 (2 << 5)
-#define DMA_PCI_MEM_READ_MULTI2 (3 << 5)
-#define DMA_CHAIN_DONE (1 << 7)
-#define DMA_INTERBURST_4 (0 << 8)
-#define DMA_INTERBURST_8 (1 << 8)
-#define DMA_INTERBURST_16 (2 << 8)
-#define DMA_INTERBURST_32 (3 << 8)
-#define DMA_PCI_LENGTH_8 0
-#define DMA_PCI_LENGTH_16 (1 << 15)
-#define DMA_SDRAM_LENGTH_1 (0 << 16)
-#define DMA_SDRAM_LENGTH_2 (1 << 16)
-#define DMA_SDRAM_LENGTH_4 (2 << 16)
-#define DMA_SDRAM_LENGTH_8 (3 << 16)
-#define DMA_SDRAM_LENGTH_16 (4 << 16)
-
-/* CSR Base Address Mask */
-
-#define CSR_BA_MASK 0x0F8
-#define CSR_MASK_128B 0x00000000
-#define CSR_MASK_512KB 0x00040000
-#define CSR_MASK_1MB 0x000C0000
-#define CSR_MASK_2MB 0x001C0000
-#define CSR_MASK_4MB 0x003C0000
-#define CSR_MASK_8MB 0x007C0000
-#define CSR_MASK_16MB 0x00FC0000
-#define CSR_MASK_32MB 0x01FC0000
-#define CSR_MASK_64MB 0x03FC0000
-#define CSR_MASK_128MB 0x07FC0000
-#define CSR_MASK_256MB 0x0FFC0000
-#define CSR_BA_OFFSET 0x0FC
-
-/* SDRAM Base Address Mask */
-
-#define SDRAM_BA_MASK 0x100
-#define SDRAM_MASK_256KB 0x00000000
-#define SDRAM_MASK_512KB 0x00040000
-#define SDRAM_MASK_1MB 0x000C0000
-#define SDRAM_MASK_2MB 0x001C0000
-#define SDRAM_MASK_4MB 0x003C0000
-#define SDRAM_MASK_8MB 0x007C0000
-#define SDRAM_MASK_16MB 0x00FC0000
-#define SDRAM_MASK_32MB 0x01FC0000
-#define SDRAM_MASK_64MB 0x03FC0000
-#define SDRAM_MASK_128MB 0x07FC0000
-#define SDRAM_MASK_256MB 0x0FFC0000
-#define SDRAM_WINDOW_DISABLE (1 << 31)
-#define SDRAM_BA_OFFSET 0x104
-
-/* Expansion ROM Base Address Mask */
-
-#define EXPANSION_ROM_BA_MASK 0x108
-#define ROM_MASK_1MB 0x00000000
-#define ROM_MASK_2MB 0x00100000
-#define ROM_MASK_4MB 0x00300000
-#define ROM_MASK_8MB 0x00700000
-#define ROM_MASK_16MB 0x00F00000
-#define ROM_WINDOW_DISABLE (1 << 31)
-
-/* SDRAM configuration */
-
-#define SDRAM_TIMING 0x10C
-#define SDRAM_ARRAY_SIZE_0 0x0
-#define SDRAM_ARRAY_SIZE_1MB 0x1
-#define SDRAM_ARRAY_SIZE_2MB 0x2
-#define SDRAM_ARRAY_SIZE_4MB 0x3
-#define SDRAM_ARRAY_SIZE_8MB 0x4
-#define SDRAM_ARRAY_SIZE_16MB 0x5
-#define SDRAM_ARRAY_SIZE_32MB 0x6
-#define SDRAM_ARRAY_SIZE_64MB 0x7
-#define SDRAM_2_BANKS 0
-#define SDRAM_4_BANKS (1 << 3)
-#define SDRAM_ADDRESS_MUX_SHIFT 4
-#define SDRAM_ARRAY_BASE_SHIFT 20
-#define SDRAM_ADDRESS_SIZE_0 0x110
-#define SDRAM_ADDRESS_SIZE_1 0x114
-#define SDRAM_ADDRESS_SIZE_2 0x118
-#define SDRAM_ADDRESS_SIZE_3 0x11C
-
-/* I2O registers */
-
-#define I2O_INBOUND_FREE_HEAD 0x120
-#define I2O_INBOUND_POST_TAIL 0x124
-#define I2O_OUTBOUND_POST_HEAD 0x128
-#define I2O_OUTBOUND_FREE_TAIL 0x12c
-#define I2O_INBOUND_FREE_COUNT 0x130
-#define I2O_OUTBOUND_POST_COUNT 0x134
-#define I2O_INBOUND_POST_COUNT 0x138
-
-/* Control register */
-
-#define SA_CONTROL 0x13C
-#define INITIALIZE_COMPLETE (1 << 0)
-#define ASSERT_SERR (1 << 1)
-#define RECEIVED_SERR (1 << 3)
-#define SA_SDRAM_PARITY_ERROR (1 << 4)
-#define PCI_SDRAM_PARITY_ERROR (1 << 5)
-#define DMA_SDRAM_PARITY_ERROR (1 << 6)
-#define DISCARD_TIMER_EXPIRED (1 << 8)
-#define PCI_NOT_RESET (1 << 9)
-#define WATCHDOG_ENABLE (1 << 13)
-#define I2O_SIZE_256 (0 << 10)
-#define I2O_SIZE_512 (1 << 10)
-#define I2O_SIZE_1024 (2 << 10)
-#define I2O_SIZE_2048 (3 << 10)
-#define I2O_SIZE_4096 (4 << 10)
-#define I2O_SIZE_8192 (5 << 10)
-#define I2O_SIZE_16384 (6 << 10)
-#define I2O_SIZE_32768 (7 << 10)
-#define ROM_WIDTH_8 (3 << 14)
-#define ROM_WIDTH_16 (1 << 14)
-#define ROM_WIDTH_32 (2 << 14)
-#define ROM_ACCESS_TIME_SHIFT 16
-#define ROM_BURST_TIME_SHIFT 20
-#define ROM_TRISTATE_TIME_SHIFT 24
-#define XCS_DIRECTION_SHIFT 28
-#define PCI_CENTRAL_FUNCTION (1 << 31)
-
-#define PCI_ADDRESS_EXTENSION 0x140
-#define PREFETCHABLE_MEM_RANGE 0x144
-
-/* XBUS / PCI Arbiter registers */
-
-#define XBUS_CYCLE_ARBITER 0x148
-#define XBUS_CYCLE_0_SHIFT 0
-#define XBUS_CYCLE_1_SHIFT 3
-#define XBUS_CYCLE_2_SHIFT 6
-#define XBUS_CYCLE_3_SHIFT 9
-#define XBUS_CYCLE_STROBE_SHIFT 12
-#define XBUS_PCI_ARBITER (1 << 23)
-#define XBUS_INT_IN_L0_LOW 0
-#define XBUS_INT_IN_L0_HIGH (1 << 24)
-#define XBUS_INT_IN_L1_LOW 0
-#define XBUS_INT_IN_L1_HIGH (1 << 25)
-#define XBUS_INT_IN_L2_LOW 0
-#define XBUS_INT_IN_L2_HIGH (1 << 26)
-#define XBUS_INT_IN_L3_LOW 0
-#define XBUS_INT_IN_L3_HIGH (1 << 27)
-#define XBUS_INT_XCS0_LOW 0
-#define XBUS_INT_XCS0_HIGH (1 << 28)
-#define XBUS_INT_XCS1_LOW 0
-#define XBUS_INT_XCS1_HIGH (1 << 29)
-#define XBUS_INT_XCS2_LOW 0
-#define XBUS_INT_XCS2_HIGH (1 << 30)
-#define XBUS_PCI_INT_REQUEST (1 << 31)
-
-#define XBUS_IO_STROBE_MASK 0x14C
-#define XBUS_IO_STROBE_0_SHIFT 0
-#define XBUS_IO_STROBE_2_SHIFT 8
-#define XBUS_IO_STROBE_3_SHIFT 16
-#define XBUS_IO_STROBE_4_SHIFT 24
-
-#define DOORBELL_PCI_MASK 0x150
-#define DOORBELL_SA_MASK 0x154
-
-/* UART registers */
-
-#define UART_DATA 0x160
-#define UART_RX_STAT 0x164
-#define UART_PARITY_ERROR 0x01
-#define UART_FRAME_ERROR 0x02
-#define UART_OVERRUN_ERROR 0x04
-#define UART_RX_ERROR (UART_PARITY_ERROR | UART_FRAME_ERROR \
- | UART_OVERRUN_ERROR)
-#define UART_H_UBRLCR 0x168
-#define UART_BREAK 0x01
-#define UART_PARITY_ENABLE 0x02
-#define UART_ODD_PARITY 0x00
-#define UART_EVEN_PARITY 0x04
-#define UART_STOP_BITS_1 0x00
-#define UART_STOP_BITS_2 0x08
-#define UART_ENABLE_FIFO 0x10
-#define UART_DATA_BITS_5 0x00
-#define UART_DATA_BITS_6 0x20
-#define UART_DATA_BITS_7 0x40
-#define UART_DATA_BITS_8 0x60
-#define UART_M_UBRLCR 0x16C
-#define UART_L_UBRLCR 0x170
-#define UART_BRD(fclk, x) (((fclk) / 4 / 16 / x) - 1)
-
-#define UART_CONTROL 0x174
-#define UART_ENABLE 0x01
-#define UART_SIR_ENABLE 0x02
-#define UART_IRDA_ENABLE 0x04
-#define UART_FLAGS 0x178
-#define UART_TX_BUSY 0x08
-#define UART_RX_FULL 0x10
-#define UART_TX_EMPTY 0x20
-
-/* Interrupt numbers for IRQ and FIQ registers */
-
-#define IRQ_RESERVED0 0x00
-#define IRQ_SOFTINT 0x01
-#define IRQ_SERIAL_RX 0x02
-#define IRQ_SERIAL_TX 0x03
-#define IRQ_TIMER_1 0x04
-#define IRQ_TIMER_2 0x05
-#define IRQ_TIMER_3 0x06
-#define IRQ_TIMER_4 0x07
-#define IRQ_IN_L0 0x08
-#define IRQ_IN_L1 0x09
-#define IRQ_IN_L2 0x0A
-#define IRQ_IN_L3 0x0B
-#define IRQ_XCS_L0 0x0C
-#define IRQ_XCS_L1 0x0D
-#define IRQ_XCS_L2 0x0E
-#define IRQ_DOORBELL 0x0F
-#define IRQ_DMA_1 0x10
-#define IRQ_DMA_2 0x11
-#define IRQ_PCI 0x12
-#define IRQ_PMCSR 0x13
-#define IRQ_RESERVED1 0x14
-#define IRQ_RESERVED2 0x15
-#define IRQ_BIST 0x16
-#define IRQ_SERR 0x17
-#define IRQ_SDRAM_PARITY 0x18
-#define IRQ_I2O 0x19
-#define IRQ_RESERVED3 0x1A
-#define IRQ_DISCARD_TIMER 0x1B
-#define IRQ_DATA_PARITY 0x1C
-#define IRQ_MASTER_ABORT 0x1D
-#define IRQ_TARGET_ABORT 0x1E
-#define IRQ_PARITY 0x1F
-
-/* IRQ and FIQ status / enable registers */
-
-#define IRQ_STATUS 0x180
-#define IRQ_RAW_STATUS 0x184
-#define IRQ_ENABLE 0x188
-#define IRQ_ENABLE_SET 0x188
-#define IRQ_ENABLE_CLEAR 0x18c
-#define IRQ_SOFT 0x190
-
-#define FIQ_STATUS 0x280
-#define FIQ_RAW_STATUS 0x284
-#define FIQ_ENABLE 0x288
-#define FIQ_ENABLE_SET 0x288
-#define FIQ_ENABLE_CLEAR 0x28c
-#define FIQ_SOFT 0x290
-
-/* Timer registers */
-
-/* Relative offsets and bases */
-
-#define TIMER_LOAD 0x00
-#define TIMER_VALUE 0x04
-#define TIMER_CONTROL 0x08
-#define TIMER_CLEAR 0x0C
-#define TIMER_1_BASE 0x300
-#define TIMER_2_BASE 0x320
-#define TIMER_3_BASE 0x340
-#define TIMER_4_BASE 0x360
-
-/* Control register bits */
-
-#define TIMER_FCLK 0x00
-#define TIMER_FCLK_16 0x04
-#define TIMER_FCLK_256 0x08
-#define TIMER_EXTERNAL 0x0C
-#define TIMER_MODE_FREERUN 0x00
-#define TIMER_MODE_PERIODIC 0x40
-#define TIMER_ENABLE 0x80
-
-/* Maximum timer value */
-
-#define TIMER_MAX_VAL 0x00FFFFFF
-
-/* Specific registers */
-
-#define TIMER_1_LOAD 0x300
-#define TIMER_1_VALUE 0x304
-#define TIMER_1_CONTROL 0x308
-#define TIMER_1_CLEAR 0x30C
-#define TIMER_2_LOAD 0x320
-#define TIMER_2_VALUE 0x324
-#define TIMER_2_CONTROL 0x328
-#define TIMER_2_CLEAR 0x32C
-#define TIMER_3_LOAD 0x340
-#define TIMER_3_VALUE 0x344
-#define TIMER_3_CONTROL 0x348
-#define TIMER_3_CLEAR 0x34C
-#define TIMER_4_LOAD 0x360
-#define TIMER_4_VALUE 0x364
-#define TIMER_4_CONTROL 0x368
-#define TIMER_4_CLEAR 0x36C
-
-/* Miscellaneous definitions */
-
-#ifndef FCLK
-#define FCLK 50000000
-#endif
diff --git a/sys/arch/arm/footbridge/footbridge.c b/sys/arch/arm/footbridge/footbridge.c
deleted file mode 100644
index 0bf0fd385fa..00000000000
--- a/sys/arch/arm/footbridge/footbridge.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/* $OpenBSD: footbridge.c,v 1.6 2006/12/14 17:36:12 kettenis Exp $ */
-/* $NetBSD: footbridge.c,v 1.7 2002/05/16 01:01:33 thorpej Exp $ */
-
-/*
- * Copyright (c) 1997,1998 Mark Brinicombe.
- * Copyright (c) 1997,1998 Causality Limited
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/malloc.h>
-#include <sys/device.h>
-
-#include <dev/pci/pcivar.h>
-#define _ARM32_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-#include <machine/intr.h>
-
-#include <arm/cpuconf.h>
-#include <arm/cpufunc.h>
-
-#include <arm/mainbus/mainbus.h>
-#include <arm/footbridge/footbridgevar.h>
-#include <arm/footbridge/dc21285reg.h>
-#include <arm/footbridge/dc21285mem.h>
-#include <arm/footbridge/footbridge.h>
-
-/*
- * DC21285 'Footbridge' device
- *
- * This probes and attaches the footbridge device
- * It then configures any children
- */
-
-/* Declare prototypes */
-
-static int footbridge_match (struct device *parent, void *cf,
- void *aux);
-static void footbridge_attach (struct device *parent, struct device *self,
- void *aux);
-static int footbridge_print (void *aux, const char *pnp);
-static int footbridge_intr (void *arg);
-
-/* Driver and attach structures */
-struct cfattach footbridge_ca = {
- sizeof(struct footbridge_softc), footbridge_match, footbridge_attach
-};
-
-struct cfdriver footbridge_cd = {
- NULL, "footbridge", DV_DULL
-};
-
-/* Various bus space tags */
-extern struct bus_space footbridge_bs_tag;
-extern void footbridge_create_io_bs_tag(bus_space_tag_t t, void *cookie);
-extern void footbridge_create_mem_bs_tag(bus_space_tag_t t, void *cookie);
-struct bus_space footbridge_csr_tag;
-struct bus_space footbridge_pci_io_bs_tag;
-struct bus_space footbridge_pci_mem_bs_tag;
-extern struct arm32_pci_chipset footbridge_pci_chipset;
-extern struct arm32_bus_dma_tag footbridge_pci_bus_dma_tag;
-
-/* Used in footbridge_clock.c */
-struct footbridge_softc *clock_sc;
-
-/* Set to non-zero to enable verbose reporting of footbridge system ints */
-int footbridge_intr_report = 0;
-
-int footbridge_found;
-
-void
-footbridge_pci_bs_tag_init(void)
-{
- /* Set up the PCI bus tags */
- footbridge_create_io_bs_tag(&footbridge_pci_io_bs_tag,
- (void *)DC21285_PCI_IO_VBASE);
- footbridge_create_mem_bs_tag(&footbridge_pci_mem_bs_tag,
- (void *)DC21285_PCI_MEM_BASE);
-}
-
-/*
- * int footbridgeprint(void *aux, const char *name)
- *
- * print configuration info for children
- */
-
-static int
-footbridge_print(aux, pnp)
- void *aux;
- const char *pnp;
-{
- union footbridge_attach_args *fba = aux;
-
- if (pnp)
- printf("%s at %s", fba->fba_name, pnp);
- if (strcmp(fba->fba_name, "pci") == 0)
- printf(" bus %d", fba->fba_pba.pba_bus);
- return(UNCONF);
-}
-
-/*
- * int footbridge_match(struct device *parent, struct cfdata *cf, void *aux)
- *
- * Just return ok for this if it is device 0
- */
-
-static int
-footbridge_match(parent, vcf, aux)
- struct device *parent;
- void *vcf;
- void *aux;
-{
- struct mainbus_attach_args *ma = aux;
- struct cfdata *cf = (struct cfdata *)vcf;
-
- return (strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0);
-}
-
-
-/*
- * void footbridge_attach(struct device *parent, struct device *dev, void *aux)
- *
- */
-
-static void
-footbridge_attach(parent, self, aux)
- struct device *parent;
- struct device *self;
- void *aux;
-{
- struct footbridge_softc *sc = (struct footbridge_softc *)self;
- union footbridge_attach_args fba;
- int vendor, device, rev;
-
- /* There can only be 1 footbridge. */
- footbridge_found = 1;
-
- clock_sc = sc;
-
- sc->sc_iot = &footbridge_bs_tag;
-
- /* Map the Footbridge */
- if (bus_space_map(sc->sc_iot, DC21285_ARMCSR_VBASE,
- DC21285_ARMCSR_VSIZE, 0, &sc->sc_ioh))
- panic("%s: Cannot map registers", self->dv_xname);
-
- /* Read the ID to make sure it is what we think it is */
- vendor = bus_space_read_2(sc->sc_iot, sc->sc_ioh, VENDOR_ID);
- device = bus_space_read_2(sc->sc_iot, sc->sc_ioh, DEVICE_ID);
- rev = bus_space_read_1(sc->sc_iot, sc->sc_ioh, REVISION);
- if (vendor != DC21285_VENDOR_ID && device != DC21285_DEVICE_ID)
- panic("%s: Unrecognised ID", self->dv_xname);
-
- printf(": DC21285 rev %d\n", rev);
-
- /* Disable all interrupts from the footbridge */
- bus_space_write_4(sc->sc_iot, sc->sc_ioh, IRQ_ENABLE_CLEAR, 0xffffffff);
- bus_space_write_4(sc->sc_iot, sc->sc_ioh, FIQ_ENABLE_CLEAR, 0xffffffff);
-
-/* bus_space_write_4(sc->sc_iot, sc->sc_ioh, 0x18, 0x40000000);*/
-
- /* Install a generic handler to catch a load of system interrupts */
- sc->sc_serr_ih = footbridge_intr_claim(IRQ_SERR, IPL_HIGH,
- "serr", footbridge_intr, sc);
- sc->sc_sdram_par_ih = footbridge_intr_claim(IRQ_SDRAM_PARITY, IPL_HIGH,
- "sdram_parity", footbridge_intr, sc);
- sc->sc_data_par_ih = footbridge_intr_claim(IRQ_DATA_PARITY, IPL_HIGH,
- "data_parity", footbridge_intr, sc);
- sc->sc_master_abt_ih = footbridge_intr_claim(IRQ_MASTER_ABORT, IPL_HIGH,
- "mast_abt", footbridge_intr, sc);
- sc->sc_target_abt_ih = footbridge_intr_claim(IRQ_TARGET_ABORT, IPL_HIGH,
- "targ_abt", footbridge_intr, sc);
- sc->sc_parity_ih = footbridge_intr_claim(IRQ_PARITY, IPL_HIGH,
- "parity", footbridge_intr, sc);
-
- /* Set up the PCI bus tags */
- footbridge_create_io_bs_tag(&footbridge_pci_io_bs_tag,
- (void *)DC21285_PCI_IO_VBASE);
- footbridge_create_mem_bs_tag(&footbridge_pci_mem_bs_tag,
- (void *)DC21285_PCI_MEM_BASE);
-
- /* calibrate the delay loop */
- calibrate_delay();
- /* Attach the PCI bus */
- fba.fba_pba.pba_busname = "pci";
- fba.fba_pba.pba_pc = &footbridge_pci_chipset;
- fba.fba_pba.pba_iot = &footbridge_pci_io_bs_tag;
- fba.fba_pba.pba_memt = &footbridge_pci_mem_bs_tag;
- fba.fba_pba.pba_dmat = &footbridge_pci_bus_dma_tag;
- /*
- fba.fba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
- */
- fba.fba_pba.pba_domain = pci_ndomains++;
- fba.fba_pba.pba_bus = 0;
- fba.fba_pba.pba_bridgetag = NULL;
- config_found(self, &fba.fba_pba, footbridge_print);
-
- /* Attach uart device */
- fba.fba_fca.fca_name = "fcom";
- fba.fba_fca.fca_iot = sc->sc_iot;
- fba.fba_fca.fca_ioh = sc->sc_ioh;
- fba.fba_fca.fca_rx_irq = IRQ_SERIAL_RX;
- fba.fba_fca.fca_tx_irq = IRQ_SERIAL_TX;
- config_found(self, &fba.fba_fca, footbridge_print);
-
- /* Setup fast SA110 cache clean area */
-#ifdef CPU_SA110
- if (cputype == CPU_ID_SA110)
- footbridge_sa110_cc_setup();
-#endif /* CPU_SA110 */
-
-}
-
-/* Generic footbridge interrupt handler */
-
-int
-footbridge_intr(arg)
- void *arg;
-{
- struct footbridge_softc *sc = arg;
- u_int ctrl, intr;
-
- /*
- * Read the footbridge control register and check for
- * SERR and parity errors
- */
- ctrl = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SA_CONTROL);
- intr = ctrl & (RECEIVED_SERR | SA_SDRAM_PARITY_ERROR |
- PCI_SDRAM_PARITY_ERROR | DMA_SDRAM_PARITY_ERROR);
- if (intr) {
- /* Report the interrupt if reporting is enabled */
- if (footbridge_intr_report)
- printf("footbridge_intr: ctrl=%08x\n", intr);
- /* Clear the interrupt state */
- bus_space_write_4(sc->sc_iot, sc->sc_ioh, SA_CONTROL,
- ctrl | intr);
- }
- /*
- * Read the PCI status register and check for errors
- */
- ctrl = bus_space_read_4(sc->sc_iot, sc->sc_ioh, PCI_COMMAND_STATUS_REG);
- intr = ctrl & (PCI_STATUS_PARITY_ERROR | PCI_STATUS_MASTER_TARGET_ABORT
- | PCI_STATUS_MASTER_ABORT | PCI_STATUS_SPECIAL_ERROR
- | PCI_STATUS_PARITY_DETECT);
- if (intr) {
- /* Report the interrupt if reporting is enabled */
- if (footbridge_intr_report)
- printf("footbridge_intr: pcistat=%08x\n", intr);
- /* Clear the interrupt state */
- bus_space_write_4(sc->sc_iot, sc->sc_ioh,
- PCI_COMMAND_STATUS_REG, ctrl | intr);
- }
- return(intr != 0);
-}
-
-/* End of footbridge.c */
diff --git a/sys/arch/arm/footbridge/footbridge.h b/sys/arch/arm/footbridge/footbridge.h
deleted file mode 100644
index bb833e1ff84..00000000000
--- a/sys/arch/arm/footbridge/footbridge.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* $OpenBSD: footbridge.h,v 1.2 2004/05/19 03:17:07 drahn Exp $ */
-/* $NetBSD: footbridge.h,v 1.2 2002/05/04 10:04:42 chris Exp $ */
-
-#ifndef _FOOTBRIDGE_H_
-#define _FOOTBRIDGE_H_
-
-#include <sys/termios.h>
-#include <arm/bus.h>
-void footbridge_pci_bs_tag_init (void);
-void footbridge_sa110_cc_setup (void);
-void footbridge_create_io_bs_tag (struct bus_space *, void *);
-void footbridge_create_mem_bs_tag (struct bus_space *, void *);
-int fcomcnattach (u_int, int, tcflag_t);
-int fcomcndetach (void);
-void calibrate_delay (void);
-
-#endif
diff --git a/sys/arch/arm/footbridge/footbridge_clock.c b/sys/arch/arm/footbridge/footbridge_clock.c
deleted file mode 100644
index 0c695192213..00000000000
--- a/sys/arch/arm/footbridge/footbridge_clock.c
+++ /dev/null
@@ -1,473 +0,0 @@
-/* $OpenBSD: footbridge_clock.c,v 1.8 2007/01/11 07:24:52 robert Exp $ */
-/* $NetBSD: footbridge_clock.c,v 1.17 2003/03/23 14:12:25 chris Exp $ */
-
-/*
- * Copyright (c) 1997 Mark Brinicombe.
- * Copyright (c) 1997 Causality Limited.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-/* Include header files */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/time.h>
-#include <sys/device.h>
-
-#include <machine/intr.h>
-
-#include <arm/cpufunc.h>
-
-#include <arm/footbridge/dc21285reg.h>
-#include <arm/footbridge/footbridgevar.h>
-#include <arm/footbridge/footbridge.h>
-
-extern struct footbridge_softc *clock_sc;
-extern u_int dc21285_fclk;
-
-int clockhandler (void *);
-int statclockhandler (void *);
-static int load_timer (int, int);
-
-/*
- * Statistics clock variance, in usec. Variance must be a
- * power of two. Since this gives us an even number, not an odd number,
- * we discard one case and compensate. That is, a variance of 1024 would
- * give us offsets in [0..1023]. Instead, we take offsets in [1..1023].
- * This is symmetric about the point 512, or statvar/2, and thus averages
- * to that value (assuming uniform random numbers).
- */
-const int statvar = 1024;
-int statmin; /* minimum stat clock count in ticks */
-int statcountperusec; /* number of ticks per usec at current stathz */
-int statprev; /* last value of we set statclock to */
-
-#if 0
-static int clockmatch (struct device *parent, struct cfdata *cf, void *aux);
-static void clockattach (struct device *parent, struct device *self, void *aux);
-
-CFATTACH_DECL(footbridge_clock, sizeof(struct clock_softc),
- clockmatch, clockattach, NULL, NULL);
-
-/*
- * int clockmatch(struct device *parent, void *match, void *aux)
- *
- * Just return ok for this if it is device 0
- */
-
-static int
-clockmatch(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- union footbridge_attach_args *fba = aux;
-
- if (strcmp(fba->fba_ca.ca_name, "clk") == 0)
- return(1);
- return(0);
-}
-
-
-/*
- * void clockattach(struct device *parent, struct device *dev, void *aux)
- *
- */
-
-static void
-clockattach(parent, self, aux)
- struct device *parent;
- struct device *self;
- void *aux;
-{
- struct clock_softc *sc = (struct clock_softc *)self;
- union footbridge_attach_args *fba = aux;
-
- sc->sc_iot = fba->fba_ca.ca_iot;
- sc->sc_ioh = fba->fba_ca.ca_ioh;
-
- clock_sc = sc;
-
- /* Cannot do anything until cpu_initclocks() has been called */
-
- printf("\n");
-}
-#endif
-
-/*
- * int clockhandler(struct clockframe *frame)
- *
- * Function called by timer 1 interrupts.
- * This just clears the interrupt condition and calls hardclock().
- */
-
-int
-clockhandler(aframe)
- void *aframe;
-{
- struct clockframe *frame = aframe;
- bus_space_write_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- TIMER_1_CLEAR, 0);
- hardclock(frame);
- return(-1); /* Pass the interrupt on down the chain */
-}
-
-/*
- * int statclockhandler(struct clockframe *frame)
- *
- * Function called by timer 2 interrupts.
- * This just clears the interrupt condition and calls statclock().
- */
-
-int
-statclockhandler(aframe)
- void *aframe;
-{
- struct clockframe *frame = aframe;
- int newint, r;
- int currentclock ;
-
- /* start the clock off again */
- bus_space_write_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- TIMER_2_CLEAR, 0);
-
- do {
- r = random() & (statvar-1);
- } while (r == 0);
- newint = statmin + (r * statcountperusec);
-
- /* fetch the current count */
- currentclock = bus_space_read_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- TIMER_2_VALUE);
-
- /*
- * work out how much time has run, add another usec for time spent
- * here
- */
- r = ((statprev - currentclock) + statcountperusec);
-
- if (r < newint) {
- newint -= r;
- r = 0;
- }
- else
- printf("statclockhandler: Statclock overrun\n");
-
-
- /*
- * update the clock to the new counter, this reloads the existing
- * timer
- */
- bus_space_write_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- TIMER_2_LOAD, newint);
- statprev = newint;
- statclock(frame);
- if (r)
- /*
- * We've completely overrun the previous interval,
- * make sure we report the correct number of ticks.
- */
- statclock(frame);
-
- return(-1); /* Pass the interrupt on down the chain */
-}
-
-static int
-load_timer(base, hz)
- int base;
- int hz;
-{
- unsigned int timer_count;
- int control;
-
- timer_count = dc21285_fclk / hz;
- if (timer_count > TIMER_MAX_VAL * 16) {
- control = TIMER_FCLK_256;
- timer_count >>= 8;
- } else if (timer_count > TIMER_MAX_VAL) {
- control = TIMER_FCLK_16;
- timer_count >>= 4;
- } else
- control = TIMER_FCLK;
-
- control |= (TIMER_ENABLE | TIMER_MODE_PERIODIC);
- bus_space_write_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- base + TIMER_LOAD, timer_count);
- bus_space_write_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- base + TIMER_CONTROL, control);
- bus_space_write_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- base + TIMER_CLEAR, 0);
- return(timer_count);
-}
-
-/*
- * void setstatclockrate(int hz)
- *
- * Set the stat clock rate. The stat clock uses timer2
- */
-
-void
-setstatclockrate(hz)
- int hz;
-{
- int statint;
- int countpersecond;
- int statvarticks;
-
- /* statint == num in counter to drop by desired hz */
- statint = statprev = clock_sc->sc_statclock_count =
- load_timer(TIMER_2_BASE, hz);
-
- /* Get the total ticks a second */
- countpersecond = statint * hz;
-
- /* now work out how many ticks per usec */
- statcountperusec = countpersecond / 1000000;
-
- /* calculate a variance range of statvar */
- statvarticks = statcountperusec * statvar;
-
- /* minimum is statint - 50% of variant */
- statmin = statint - (statvarticks / 2);
-}
-
-/*
- * void cpu_initclocks(void)
- *
- * Initialise the clocks.
- *
- * Timer 1 is used for the main system clock (hardclock)
- * Timer 2 is used for the statistics clock (statclock)
- */
-
-void
-cpu_initclocks()
-{
- /* stathz and profhz should be set to something, we have the timer */
-
- if (stathz == 0)
- stathz = 128;
-
- if (profhz == 0)
- profhz = stathz * 8;
-
- /* Setup timer 1 and claim interrupt */
- clock_sc->sc_clock_count = load_timer(TIMER_1_BASE, hz);
-
- /*
- * Use ticks per 256us for accuracy since ticks per us is often
- * fractional e.g. @ 66MHz
- */
- clock_sc->sc_clock_ticks_per_256us =
- ((((clock_sc->sc_clock_count * hz) / 1000) * 256) / 1000);
- clock_sc->sc_clockintr = footbridge_intr_claim(IRQ_TIMER_1, IPL_CLOCK,
- "clock", clockhandler, 0);
-
- if (clock_sc->sc_clockintr == NULL)
- panic("%s: Cannot install timer 1 interrupt handler",
- clock_sc->sc_dev.dv_xname);
-
- /* If stathz is non-zero then setup the stat clock */
- if (stathz) {
- /* Setup timer 2 and claim interrupt */
- setstatclockrate(stathz);
- clock_sc->sc_statclockintr = footbridge_intr_claim(IRQ_TIMER_2, IPL_STATCLOCK,
- "stat", statclockhandler, 0);
- if (clock_sc->sc_statclockintr == NULL)
- panic("%s: Cannot install timer 2 interrupt handler",
- clock_sc->sc_dev.dv_xname);
- }
-}
-
-
-/*
- * void microtime(struct timeval *tvp)
- *
- * Fill in the specified timeval struct with the current time
- * accurate to the microsecond.
- */
-
-void
-microtime(tvp)
- struct timeval *tvp;
-{
- int s;
- int tm;
- int deltatm;
- static struct timeval oldtv;
-
- if (clock_sc == NULL || clock_sc->sc_clock_count == 0)
- return;
-
- s = splhigh();
-
- tm = bus_space_read_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- TIMER_1_VALUE);
-
- deltatm = clock_sc->sc_clock_count - tm;
-
-#ifdef DIAGNOSTIC
- if (deltatm < 0)
- panic("opps deltatm < 0 tm=%d deltatm=%d", tm, deltatm);
-#endif
-
- /* Fill in the timeval struct */
- *tvp = time;
- tvp->tv_usec += ((deltatm << 8) / clock_sc->sc_clock_ticks_per_256us);
-
- /* Make sure the micro seconds don't overflow. */
- while (tvp->tv_usec >= 1000000) {
- tvp->tv_usec -= 1000000;
- ++tvp->tv_sec;
- }
-
- /* Make sure the time has advanced. */
- if (tvp->tv_sec == oldtv.tv_sec &&
- tvp->tv_usec <= oldtv.tv_usec) {
- tvp->tv_usec = oldtv.tv_usec + 1;
- if (tvp->tv_usec >= 1000000) {
- tvp->tv_usec -= 1000000;
- ++tvp->tv_sec;
- }
- }
-
- oldtv = *tvp;
- (void)splx(s);
-}
-
-/*
- * Use a timer to track microseconds, if the footbridge hasn't been setup we
- * rely on an estimated loop, however footbridge is attached very early on.
- */
-
-static int delay_clock_count = 0;
-static int delay_count_per_usec = 0;
-
-void
-calibrate_delay(void)
-{
- delay_clock_count = load_timer(TIMER_3_BASE, 100);
- delay_count_per_usec = delay_clock_count/10000;
-#ifdef VERBOSE_DELAY_CALIBRATION
- printf("delay calibration: delay_cc = %d, delay_c/us=%d\n",
- delay_clock_count, delay_count_per_usec);
-
- printf("0..");
- delay(1000000);
- printf("1..");
- delay(1000000);
- printf("2..");
- delay(1000000);
- printf("3..");
- delay(1000000);
- printf("4..");
- delay(1000000);
- printf("5..");
- delay(1000000);
- printf("6..");
- delay(1000000);
- printf("7..");
- delay(1000000);
- printf("8..");
- delay(1000000);
- printf("9..");
- delay(1000000);
- printf("10\n");
-#endif
-}
-
-int delaycount = 25000;
-
-void
-delay(n)
- u_int n;
-{
- volatile u_int i;
- uint32_t cur, last, delta, usecs;
-
- if (n == 0) return;
-
-
- /*
- * not calibrated the timer yet, so try to live with this horrible
- * loop!
- */
- if (delay_clock_count == 0)
- {
- while (n-- > 0) {
- for (i = delaycount; --i;);
- }
- return;
- }
-
- /*
- * read the current value (do not reset it as delay is reentrant)
- */
- last = bus_space_read_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- TIMER_3_VALUE);
-
- delta = usecs = 0;
-
- while (n > usecs)
- {
- cur = bus_space_read_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- TIMER_3_VALUE);
- if (last < cur)
- /* timer has wrapped */
- delta += ((delay_clock_count - cur) + last);
- else
- delta += (last - cur);
-
- if (cur == 0)
- {
- /*
- * reset the timer, note that if something blocks us for more
- * than 1/100s we may delay for too long, but I believe that
- * is fairly unlikely.
- */
- bus_space_write_4(clock_sc->sc_iot, clock_sc->sc_ioh,
- TIMER_3_CLEAR, 0);
- }
- last = cur;
-
- if (delta >= delay_count_per_usec)
- {
- usecs += delta / delay_count_per_usec;
- delta %= delay_count_per_usec;
- }
- }
-}
-
-/* End of footbridge_clock.c */
diff --git a/sys/arch/arm/footbridge/footbridge_com.c b/sys/arch/arm/footbridge/footbridge_com.c
deleted file mode 100644
index 0912d165042..00000000000
--- a/sys/arch/arm/footbridge/footbridge_com.c
+++ /dev/null
@@ -1,868 +0,0 @@
-/* $OpenBSD: footbridge_com.c,v 1.6 2005/11/21 18:16:36 millert Exp $ */
-/* $NetBSD: footbridge_com.c,v 1.13 2003/03/23 14:12:25 chris Exp $ */
-
-/*-
- * Copyright (c) 1997 Mark Brinicombe
- * Copyright (c) 1997 Causality Limited
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * COM driver, using the footbridge UART
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/ioctl.h>
-#include <sys/selinfo.h>
-#include <sys/tty.h>
-#include <sys/proc.h>
-#include <sys/conf.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/termios.h>
-#include <machine/bus.h>
-#include <machine/intr.h>
-#include <arm/conf.h>
-#include <arm/footbridge/dc21285mem.h>
-#include <arm/footbridge/dc21285reg.h>
-#include <arm/footbridge/footbridgevar.h>
-#include <arm/footbridge/footbridge.h>
-
-#include <dev/cons.h>
-
-#include "fcom.h"
-
-extern u_int dc21285_fclk;
-
-
-#ifdef DDB
-/*
- * Define the keycode recognised as a request to call the debugger
- * A value of 0 disables the feature when DDB is built in
- */
-#define DDB_KEYCODE '@'
-#ifndef DDB_KEYCODE
-#define DDB_KEYCODE 0
-#endif /* DDB_KEYCODE */
-#endif /* DDB */
-
-struct fcom_softc {
- struct device sc_dev;
- bus_space_tag_t sc_iot;
- bus_space_handle_t sc_ioh;
- void *sc_ih;
- void *sc_si;
- int sc_rx_irq;
- int sc_tx_irq;
- int sc_hwflags;
-#define HW_FLAG_CONSOLE 0x01
- int sc_swflags;
- int sc_l_ubrlcr;
- int sc_m_ubrlcr;
- int sc_h_ubrlcr;
- char *sc_rxbuffer[2];
- char *sc_rxbuf;
- int sc_rxpos;
- int sc_rxcur;
- struct tty *sc_tty;
-};
-
-#define RX_BUFFER_SIZE 0x100
-
-static int fcom_probe (struct device *, void*, void *);
-static void fcom_attach (struct device *, struct device *, void *);
-static void fcom_softintr (void *);
-
-static int fcom_rxintr (void *);
-/*static int fcom_txintr (void *);*/
-
-cons_decl(fcom);
-
-struct cfattach fcom_ca = {
- sizeof (struct fcom_softc), fcom_probe, fcom_attach
-};
-
-struct cfdriver fcom_cd = {
- NULL, "fcom", DV_DULL
-};
-#if 0
-CFATTACH_DECL(fcom, sizeof(struct fcom_softc),
- fcom_probe, fcom_attach, NULL, NULL);
-#endif
-
-extern struct cfdriver fcom_cd;
-
-dev_type_open(fcomopen);
-dev_type_close(fcomclose);
-dev_type_read(fcomread);
-dev_type_write(fcomwrite);
-dev_type_ioctl(fcomioctl);
-dev_type_tty(fcomtty);
-dev_type_poll(fcompoll);
-
-#if 0
-const struct cdevsw fcom_cdevsw = {
- fcomopen, fcomclose, fcomread, fcomwrite, fcomioctl,
- nostop, fcomtty, fcompoll, nommap, ttykqfilter, D_TTY
-};
-#endif
-
-void fcominit (bus_space_tag_t, bus_space_handle_t, int, int);
-void fcominitcons (bus_space_tag_t, bus_space_handle_t);
-
-bus_space_tag_t fcomconstag;
-bus_space_handle_t fcomconsioh;
-extern int comcnmode;
-extern int comcnspeed;
-
-#define COMUNIT(x) (minor(x))
-#ifndef CONUNIT
-#define CONUNIT 0
-#endif
-
-/*
- * The console is set up at init time, well in advance of the reset of the
- * system and thus we have a private bus space tag for the console.
- *
- * The tag is provided by fcom_io.c and fcom_io_asm.S
- */
-extern struct bus_space fcomcons_bs_tag;
-
-/*
- * int fcom_probe(struct device *parent, struct cfdata *cf, void *aux)
- *
- * Make sure we are trying to attach a com device and then
- * probe for one.
- */
-
-static int
-fcom_probe(parent, cf, aux)
- struct device *parent;
- void *cf;
- void *aux;
-{
- union footbridge_attach_args *fba = aux;
-
- if (strcmp(fba->fba_name, "fcom") == 0)
- return(1);
- return(0);
-}
-
-/*
- * void fcom_attach(struct device *parent, struct device *self, void *aux)
- *
- * attach the com device
- */
-
-static void
-fcom_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- union footbridge_attach_args *fba = aux;
- struct fcom_softc *sc = (struct fcom_softc *)self;
-
- /* Set up the softc */
- sc->sc_iot = fba->fba_fca.fca_iot;
- sc->sc_ioh = fba->fba_fca.fca_ioh;
- sc->sc_si = softintr_establish(IPL_TTY, fcom_softintr, sc);
- if (sc->sc_si == NULL)
- panic(": can't establish soft interrupt");
- sc->sc_rx_irq = fba->fba_fca.fca_rx_irq;
- sc->sc_tx_irq = fba->fba_fca.fca_tx_irq;
- sc->sc_hwflags = 0;
- sc->sc_swflags = 0;
-
- /* If we have a console tag then make a note of it */
- if (fcomconstag)
- sc->sc_hwflags |= HW_FLAG_CONSOLE;
-
- if (sc->sc_hwflags & HW_FLAG_CONSOLE) {
- int major;
-
- /* locate the major number */
- for (major = 0; major < nchrdev; ++major)
- if (cdevsw[major].d_open == fcomopen)
- break;
-
- cn_tab->cn_dev = makedev(major, sc->sc_dev.dv_unit);
- printf(": console");
- }
- printf("\n");
-
- sc->sc_ih = footbridge_intr_claim(sc->sc_rx_irq, IPL_SERIAL,
- "serial_rx", fcom_rxintr, sc);
- if (sc->sc_ih == NULL)
- panic("%s: Cannot install rx interrupt handler",
- sc->sc_dev.dv_xname);
-}
-
-static void fcomstart (struct tty *);
-static int fcomparam (struct tty *, struct termios *);
-
-int
-fcomopen(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- struct fcom_softc *sc;
- int unit = minor(dev);
- struct tty *tp;
-
- if (unit >= fcom_cd.cd_ndevs)
- return ENXIO;
- sc = fcom_cd.cd_devs[unit];
- if (!sc)
- return ENXIO;
- if (!(tp = sc->sc_tty))
- sc->sc_tty = tp = ttymalloc();
- if (!sc->sc_rxbuffer[0]) {
- sc->sc_rxbuffer[0] = malloc(RX_BUFFER_SIZE, M_DEVBUF, M_WAITOK);
- sc->sc_rxbuffer[1] = malloc(RX_BUFFER_SIZE, M_DEVBUF, M_WAITOK);
- sc->sc_rxpos = 0;
- sc->sc_rxcur = 0;
- sc->sc_rxbuf = sc->sc_rxbuffer[sc->sc_rxcur];
- if (!sc->sc_rxbuf)
- panic("%s: Cannot allocate rx buffer memory",
- sc->sc_dev.dv_xname);
- }
- tp->t_oproc = fcomstart;
- tp->t_param = fcomparam;
- tp->t_dev = dev;
- if (!ISSET(tp->t_state, TS_ISOPEN)) {
- SET(tp->t_state, TS_WOPEN);
- ttychars(tp);
- tp->t_cflag = TTYDEF_CFLAG;
- tp->t_iflag = TTYDEF_IFLAG;
- tp->t_oflag = TTYDEF_OFLAG;
- tp->t_lflag = TTYDEF_LFLAG;
-
- /*
- * Initialize the termios status to the defaults. Add in the
- * sticky bits from TIOCSFLAGS.
- */
- tp->t_ispeed = 0;
- if (ISSET(sc->sc_hwflags, HW_FLAG_CONSOLE))
- tp->t_ospeed = comcnspeed;
- else
- tp->t_ospeed = TTYDEF_SPEED;
-
- fcomparam(tp, &tp->t_termios);
- ttsetwater(tp);
- } else if (ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0)
- return EBUSY;
- tp->t_state |= TS_CARR_ON;
-
- return (*linesw[tp->t_line].l_open)(dev, tp);
-}
-
-int
-fcomclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
- struct tty *tp = sc->sc_tty;
- /* XXX This is for cons.c. */
- if (!ISSET(tp->t_state, TS_ISOPEN))
- return (0);
-
- (*linesw[tp->t_line].l_close)(tp, flag);
- ttyclose(tp);
-#ifdef DIAGNOSTIC
- if (sc->sc_rxbuffer[0] == NULL)
- panic("fcomclose: rx buffers not allocated");
-#endif /* DIAGNOSTIC */
- free(sc->sc_rxbuffer[0], M_DEVBUF);
- free(sc->sc_rxbuffer[1], M_DEVBUF);
- sc->sc_rxbuffer[0] = NULL;
- sc->sc_rxbuffer[1] = NULL;
-
- return 0;
-}
-
-int
-fcomread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
- struct tty *tp = sc->sc_tty;
-
- return (*linesw[tp->t_line].l_read)(tp, uio, flag);
-}
-
-int
-fcomwrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
- struct tty *tp = sc->sc_tty;
-
- return (*linesw[tp->t_line].l_write)(tp, uio, flag);
-}
-
-#if 0
-int
-fcompoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
- struct tty *tp = sc->sc_tty;
-
- return (*linesw[tp->t_line].l_poll)(tp, events, p));
-}
-#endif
-
-int
-fcomioctl(dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
- struct tty *tp = sc->sc_tty;
- int error;
-
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
- if (error >= 0)
- return error;
- error = ttioctl(tp, cmd, data, flag, p);
- if (error >= 0)
- return error;
-
- switch (cmd) {
- case TIOCGFLAGS:
- *(int *)data = sc->sc_swflags;
- break;
-
- case TIOCSFLAGS:
- error = suser(p, 0);
- if (error)
- return (error);
- sc->sc_swflags = *(int *)data;
- break;
-
- default:
- return ENOTTY;
- }
-
- return 0;
-}
-
-struct tty *
-fcomtty(dev)
- dev_t dev;
-{
- struct fcom_softc *sc = fcom_cd.cd_devs[minor(dev)];
-
- return sc->sc_tty;
-}
-
-int
-fcomstop(struct tty *tp, int flag)
-{
- return 0;
-}
-
-static void
-fcomstart(tp)
- struct tty *tp;
-{
- struct clist *cl;
- int s, len;
- u_char buf[64];
- int loop;
- struct fcom_softc *sc = fcom_cd.cd_devs[minor(tp->t_dev)];
- bus_space_tag_t iot = sc->sc_iot;
- bus_space_handle_t ioh = sc->sc_ioh;
- int timo;
-
- s = spltty();
- if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) {
- (void)splx(s);
- return;
- }
- tp->t_state |= TS_BUSY;
- (void)splx(s);
-
-/* s = splserial();*/
- /* wait for any pending transmission to finish */
- timo = 100000;
- while ((bus_space_read_4(iot, ioh, UART_FLAGS) & UART_TX_BUSY) && --timo)
- ;
-
- s = splserial();
- if (bus_space_read_4(iot, ioh, UART_FLAGS) & UART_TX_BUSY) {
- tp->t_state |= TS_TIMEOUT;
- timeout_add(&tp->t_rstrt_to, 1);
- (void)splx(s);
- return;
- }
-
- (void)splx(s);
-
- cl = &tp->t_outq;
- len = q_to_b(cl, buf, 64);
- for (loop = 0; loop < len; ++loop) {
-/* s = splserial();*/
-
- bus_space_write_4(iot, ioh, UART_DATA, buf[loop]);
-
- /* wait for this transmission to complete */
- timo = 100000;
- while ((bus_space_read_4(iot, ioh, UART_FLAGS) & UART_TX_BUSY) && --timo)
- ;
-/* (void)splx(s);*/
- }
- s = spltty();
- tp->t_state &= ~TS_BUSY;
- if (cl->c_cc) {
- tp->t_state |= TS_TIMEOUT;
- timeout_add(&tp->t_rstrt_to, 1);
- }
- if (cl->c_cc <= tp->t_lowat) {
- if (tp->t_state & TS_ASLEEP) {
- tp->t_state &= ~TS_ASLEEP;
- wakeup(cl);
- }
- selwakeup(&tp->t_wsel);
- }
- (void)splx(s);
-}
-
-static int
-fcomparam(tp, t)
- struct tty *tp;
- struct termios *t;
-{
- struct fcom_softc *sc = fcom_cd.cd_devs[minor(tp->t_dev)];
- bus_space_tag_t iot = sc->sc_iot;
- bus_space_handle_t ioh = sc->sc_ioh;
- int baudrate;
- int h_ubrlcr;
- int m_ubrlcr;
- int l_ubrlcr;
- int s;
-
- /* check requested parameters */
- if (t->c_ospeed < 0)
- return (EINVAL);
- if (t->c_ispeed && t->c_ispeed != t->c_ospeed)
- return (EINVAL);
-
- switch (t->c_ospeed) {
- case B1200:
- case B2400:
- case B4800:
- case B9600:
- case B19200:
- case B38400:
- baudrate = UART_BRD(dc21285_fclk, t->c_ospeed);
- break;
- default:
- baudrate = UART_BRD(dc21285_fclk, 9600);
- break;
- }
-
- l_ubrlcr = baudrate & 0xff;
- m_ubrlcr = (baudrate >> 8) & 0xf;
- h_ubrlcr = 0;
-
- switch (ISSET(t->c_cflag, CSIZE)) {
- case CS5:
- h_ubrlcr |= UART_DATA_BITS_5;
- break;
- case CS6:
- h_ubrlcr |= UART_DATA_BITS_6;
- break;
- case CS7:
- h_ubrlcr |= UART_DATA_BITS_7;
- break;
- case CS8:
- h_ubrlcr |= UART_DATA_BITS_8;
- break;
- }
-
- if (ISSET(t->c_cflag, PARENB)) {
- h_ubrlcr |= UART_PARITY_ENABLE;
- if (ISSET(t->c_cflag, PARODD))
- h_ubrlcr |= UART_ODD_PARITY;
- else
- h_ubrlcr |= UART_EVEN_PARITY;
- }
-
- if (ISSET(t->c_cflag, CSTOPB))
- h_ubrlcr |= UART_STOP_BITS_2;
-
- bus_space_write_4(iot, ioh, UART_L_UBRLCR, l_ubrlcr);
- bus_space_write_4(iot, ioh, UART_M_UBRLCR, m_ubrlcr);
- bus_space_write_4(iot, ioh, UART_H_UBRLCR, h_ubrlcr);
-
- s = splserial();
-
- sc->sc_l_ubrlcr = l_ubrlcr;
- sc->sc_m_ubrlcr = m_ubrlcr;
- sc->sc_h_ubrlcr = h_ubrlcr;
-
- /*
- * For the console, always force CLOCAL and !HUPCL, so that the port
- * is always active.
- */
- if (ISSET(sc->sc_swflags, TIOCFLAG_SOFTCAR) ||
- ISSET(sc->sc_hwflags, HW_FLAG_CONSOLE)) {
- SET(t->c_cflag, CLOCAL);
- CLR(t->c_cflag, HUPCL);
- }
-
- /* and copy to tty */
- tp->t_ispeed = 0;
- tp->t_ospeed = t->c_ospeed;
- tp->t_cflag = t->c_cflag;
-
- bus_space_write_4(iot, ioh, UART_L_UBRLCR, l_ubrlcr);
- bus_space_write_4(iot, ioh, UART_M_UBRLCR, m_ubrlcr);
- bus_space_write_4(iot, ioh, UART_H_UBRLCR, h_ubrlcr);
-
- (void)splx(s);
-
- return (0);
-}
-
-static void
-fcom_softintr(arg)
- void *arg;
-{
- struct fcom_softc *sc = arg;
- struct tty *tp = sc->sc_tty;
- int s;
- int loop;
- int len;
- char *ptr;
-
- s = spltty();
- ptr = sc->sc_rxbuf;
- len = sc->sc_rxpos;
- sc->sc_rxcur ^= 1;
- sc->sc_rxbuf = sc->sc_rxbuffer[sc->sc_rxcur];
- sc->sc_rxpos = 0;
- (void)splx(s);
-
- for (loop = 0; loop < len; ++loop)
- (*linesw[tp->t_line].l_rint)(ptr[loop], tp);
-}
-
-#if 0
-static int
-fcom_txintr(arg)
- void *arg;
-{
-/* struct fcom_softc *sc = arg;*/
-
- printf("fcom_txintr()\n");
- return(0);
-}
-#endif
-
-static int
-fcom_rxintr(arg)
- void *arg;
-{
- struct fcom_softc *sc = arg;
- bus_space_tag_t iot = sc->sc_iot;
- bus_space_handle_t ioh = sc->sc_ioh;
- struct tty *tp = sc->sc_tty;
- int status;
- int byte;
- int softint_scheduled = 0;
-
- do {
- status = bus_space_read_4(iot, ioh, UART_FLAGS);
- if ((status & UART_RX_FULL))
- break;
- byte = bus_space_read_4(iot, ioh, UART_DATA);
- status = bus_space_read_4(iot, ioh, UART_RX_STAT);
-#if defined(DDB) && DDB_KEYCODE > 0
- /*
- * Temporary hack so that I can force the kernel into
- * the debugger via the serial port
- */
- if (byte == DDB_KEYCODE) Debugger();
-#endif
- if (tp && (tp->t_state & TS_ISOPEN))
- if (sc->sc_rxpos < RX_BUFFER_SIZE) {
- sc->sc_rxbuf[sc->sc_rxpos++] = byte;
- if (!softint_scheduled) {
- softint_scheduled = 1;
- softintr_schedule(sc->sc_si);
- }
- }
- } while (1);
- return(1);
-}
-
-#if 0
-void
-fcom_iflush(sc)
- struct fcom_softc *sc;
-{
- bus_space_tag_t iot = sc->sc_iot;
- bus_space_handle_t ioh = sc->sc_ioh;
-
- /* flush any pending I/O */
- while (!ISSET(bus_space_read_4(iot, ioh, UART_FLAGS), UART_RX_FULL))
- (void) bus_space_read_4(iot, ioh, UART_DATA);
-}
-#endif
-
-/*
- * Following are all routines needed for COM to act as console
- */
-
-#if 0
-void
-fcomcnprobe(cp)
- struct consdev *cp;
-{
- int major;
-
- /* Serial console is always present so no probe */
-
- /* locate the major number */
- major = cdevsw_lookup_major(&fcom_cdevsw);
-
- /* initialize required fields */
- cp->cn_dev = makedev(major, CONUNIT);
- cp->cn_pri = CN_REMOTE; /* Force a serial port console */
-}
-
-void
-fcomcninit(cp)
- struct consdev *cp;
-{
- fcomconstag = &fcomcons_bs_tag;
-
- if (bus_space_map(fcomconstag, DC21285_ARMCSR_BASE, DC21285_ARMCSR_SIZE, 0, &fcomconsioh))
- panic("fcomcninit: mapping failed");
-
- fcominitcons(fcomconstag, fcomconsioh);
-}
-#endif
-
-struct consdev fcomcons = {
- NULL, NULL, fcomcngetc, fcomcnputc, fcomcnpollc, NULL,
- NODEV, CN_NORMAL
-};
-
-int
-fcomcnattach(iobase, rate, cflag)
- u_int iobase;
- int rate;
- tcflag_t cflag;
-{
-#if 0
- static struct consdev fcomcons = {
- NULL, NULL, fcomcngetc, fcomcnputc, fcomcnpollc, NULL,
- NULL, NULL, NODEV, CN_NORMAL
- };
-#endif
-
- fcomconstag = &fcomcons_bs_tag;
-
- if (bus_space_map(fcomconstag, iobase, DC21285_ARMCSR_SIZE,
- 0, &fcomconsioh))
- panic("fcomcninit: mapping failed");
-
- fcominit(fcomconstag, fcomconsioh, rate, cflag);
-
- cn_tab = &fcomcons;
-
-/* comcnspeed = rate;
- comcnmode = cflag;*/
- return (0);
-}
-
-int
-fcomcndetach(void)
-{
- bus_space_unmap(fcomconstag, fcomconsioh, DC21285_ARMCSR_SIZE);
-
- cn_tab = NULL;
- return (0);
-}
-
-/*
- * Initialize UART to known state.
- */
-void
-fcominit(iot, ioh, rate, mode)
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
- int rate;
- int mode;
-{
- int baudrate;
- int h_ubrlcr;
- int m_ubrlcr;
- int l_ubrlcr;
-
- switch (rate) {
- case B1200:
- case B2400:
- case B4800:
- case B9600:
- case B19200:
- case B38400:
- baudrate = UART_BRD(dc21285_fclk, rate);
- break;
- default:
- baudrate = UART_BRD(dc21285_fclk, 9600);
- break;
- }
-
- h_ubrlcr = 0;
- switch (mode & CSIZE) {
- case CS5:
- h_ubrlcr |= UART_DATA_BITS_5;
- break;
- case CS6:
- h_ubrlcr |= UART_DATA_BITS_6;
- break;
- case CS7:
- h_ubrlcr |= UART_DATA_BITS_7;
- break;
- case CS8:
- h_ubrlcr |= UART_DATA_BITS_8;
- break;
- }
-
- if (mode & PARENB)
- h_ubrlcr |= UART_PARITY_ENABLE;
- if (mode & PARODD)
- h_ubrlcr |= UART_ODD_PARITY;
- else
- h_ubrlcr |= UART_EVEN_PARITY;
-
- if (mode & CSTOPB)
- h_ubrlcr |= UART_STOP_BITS_2;
-
- m_ubrlcr = (baudrate >> 8) & 0xf;
- l_ubrlcr = baudrate & 0xff;
-
- bus_space_write_4(iot, ioh, UART_L_UBRLCR, l_ubrlcr);
- bus_space_write_4(iot, ioh, UART_M_UBRLCR, m_ubrlcr);
- bus_space_write_4(iot, ioh, UART_H_UBRLCR, h_ubrlcr);
-}
-#if 0
-/*
- * Set UART for console use. Do normal init, then enable interrupts.
- */
-void
-fcominitcons(iot, ioh)
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
-{
- int s = splserial();
-
- fcominit(iot, ioh, comcnspeed, comcnmode);
-
- delay(10000);
-
- (void)splx(s);
-}
-#endif
-
-int
-fcomcngetc(dev)
- dev_t dev;
-{
- int s = splserial();
- bus_space_tag_t iot = fcomconstag;
- bus_space_handle_t ioh = fcomconsioh;
- u_char stat, c;
-
- while ((bus_space_read_4(iot, ioh, UART_FLAGS) & UART_RX_FULL) != 0)
- ;
- c = bus_space_read_4(iot, ioh, UART_DATA);
- stat = bus_space_read_4(iot, ioh, UART_RX_STAT);
- (void)splx(s);
-#if defined(DDB) && DDB_KEYCODE > 0
- /*
- * Temporary hack so that I can force the kernel into
- * the debugger via the serial port
- */
- if (c == DDB_KEYCODE) Debugger();
-#endif
-
- return (c);
-}
-
-/*
- * Console kernel output character routine.
- */
-void
-fcomcnputc(dev, c)
- dev_t dev;
- int c;
-{
- int s = splserial();
- bus_space_tag_t iot = fcomconstag;
- bus_space_handle_t ioh = fcomconsioh;
- int timo;
-
- /* wait for any pending transmission to finish */
- timo = 50000;
- while ((bus_space_read_4(iot, ioh, UART_FLAGS) & UART_TX_BUSY) && --timo)
- ;
- bus_space_write_4(iot, ioh, UART_DATA, c);
-
- /* wait for this transmission to complete */
- timo = 1500000;
- while ((bus_space_read_4(iot, ioh, UART_FLAGS) & UART_TX_BUSY) && --timo)
- ;
- /* Clear interrupt status here */
- (void)splx(s);
-}
-
-void
-fcomcnpollc(dev, on)
- dev_t dev;
- int on;
-{
-}
diff --git a/sys/arch/arm/footbridge/footbridge_com_io.c b/sys/arch/arm/footbridge/footbridge_com_io.c
deleted file mode 100644
index 4b6681e11df..00000000000
--- a/sys/arch/arm/footbridge/footbridge_com_io.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* $OpenBSD: footbridge_com_io.c,v 1.2 2007/05/25 16:45:59 krw Exp $ */
-/* $NetBSD: footbridge_com_io.c,v 1.4 2002/09/27 15:35:44 provos Exp $ */
-
-/*
- * Copyright (c) 1997 Mark Brinicombe.
- * Copyright (c) 1997 Causality Limited.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * This file provides the bus space tag for the footbridge serial console
- */
-
-/*
- * bus_space I/O functions for mainbus
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <machine/bus.h>
-
-/* Prototypes for all the bus_space structure functions */
-
-bs_protos(fcomcons);
-bs_protos(generic);
-bs_protos(bs_notimpl);
-
-/* Declare the fcomcons bus space tag */
-
-struct bus_space fcomcons_bs_tag = {
- /* cookie */
- NULL,
-
- /* mapping/unmapping */
- fcomcons_bs_map,
- fcomcons_bs_unmap,
- fcomcons_bs_subregion,
-
- /* allocation/deallocation */
- fcomcons_bs_alloc,
- fcomcons_bs_free,
-
- /* get kernel virtual address */
- 0, /* never used */
-
- /* Mmap bus space for user */
- bs_notimpl_bs_mmap,
-
- /* barrier */
- fcomcons_bs_barrier,
-
- /* read (single) */
- bs_notimpl_bs_r_1,
- bs_notimpl_bs_r_2,
- generic_bs_r_4,
- bs_notimpl_bs_r_8,
-
- /* read multiple */
- bs_notimpl_bs_rm_1,
- bs_notimpl_bs_rm_2,
- bs_notimpl_bs_rm_4,
- bs_notimpl_bs_rm_8,
-
- /* read region */
- bs_notimpl_bs_rr_1,
- bs_notimpl_bs_rr_2,
- bs_notimpl_bs_rr_4,
- bs_notimpl_bs_rr_8,
-
- /* write (single) */
- bs_notimpl_bs_w_1,
- bs_notimpl_bs_w_2,
- generic_bs_w_4,
- bs_notimpl_bs_w_8,
-
- /* write multiple */
- bs_notimpl_bs_wm_1,
- bs_notimpl_bs_wm_2,
- bs_notimpl_bs_wm_4,
- bs_notimpl_bs_wm_8,
-
- /* write region */
- bs_notimpl_bs_wr_1,
- bs_notimpl_bs_wr_2,
- bs_notimpl_bs_wr_4,
- bs_notimpl_bs_wr_8,
-
- bs_notimpl_bs_sm_1,
- bs_notimpl_bs_sm_2,
- bs_notimpl_bs_sm_4,
- bs_notimpl_bs_sm_8,
-
- /* set region */
- bs_notimpl_bs_sr_1,
- bs_notimpl_bs_sr_2,
- bs_notimpl_bs_sr_4,
- bs_notimpl_bs_sr_8,
-
- /* copy */
- bs_notimpl_bs_c_1,
- bs_notimpl_bs_c_2,
- bs_notimpl_bs_c_4,
- bs_notimpl_bs_c_8,
-};
-
-/* bus space functions */
-
-int
-fcomcons_bs_map(t, bpa, size, cacheable, bshp)
- void *t;
- bus_addr_t bpa;
- bus_size_t size;
- int cacheable;
- bus_space_handle_t *bshp;
-{
- /*
- * Temporary implementation as all I/O is already mapped etc.
- *
- * Eventually this function will do the mapping check for multiple maps
- */
- *bshp = bpa;
- return(0);
- }
-
-int
-fcomcons_bs_alloc(t, rstart, rend, size, alignment, boundary, cacheable,
- bpap, bshp)
- void *t;
- bus_addr_t rstart, rend;
- bus_size_t size, alignment, boundary;
- int cacheable;
- bus_addr_t *bpap;
- bus_space_handle_t *bshp;
-{
- panic("fcomcons_alloc(): Help!");
-}
-
-
-void
-fcomcons_bs_unmap(t, bsh, size)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t size;
-{
- /*
- * Temporary implementation
- */
-}
-
-void
-fcomcons_bs_free(t, bsh, size)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t size;
-{
-
- panic("fcomcons_free(): Help!");
- /* fcomcons_unmap() does all that we need to do. */
-/* fcomcons_unmap(t, bsh, size);*/
-}
-
-int
-fcomcons_bs_subregion(t, bsh, offset, size, nbshp)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t offset, size;
- bus_space_handle_t *nbshp;
-{
-
- *nbshp = bsh + offset;
- return (0);
-}
-
-void
-fcomcons_bs_barrier(t, bsh, offset, len, flags)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t offset, len;
- int flags;
-{
-}
-
-/* End of footbridge_com_io.c */
diff --git a/sys/arch/arm/footbridge/footbridge_intr.h b/sys/arch/arm/footbridge/footbridge_intr.h
deleted file mode 100644
index 8df63b4f863..00000000000
--- a/sys/arch/arm/footbridge/footbridge_intr.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/* $OpenBSD: footbridge_intr.h,v 1.7 2007/05/15 05:26:44 miod Exp $ */
-/* $NetBSD: footbridge_intr.h,v 1.4 2003/01/03 00:56:00 thorpej Exp $ */
-
-/*
- * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Jason R. Thorpe for Wasabi Systems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FOOTBRIDGE_INTR_H_
-#define _FOOTBRIDGE_INTR_H_
-
-#include <arm/armreg.h>
-
-/* Define the various Interrupt Priority Levels */
-
-/* Hardware Interrupt Priority Levels are not mutually exclusive. */
-
-#define IPL_NONE 0 /* nothing */
-#define IPL_SOFT 1 /* generic soft interrupts */
-#define IPL_SOFTCLOCK 2 /* clock software interrupts */
-#define IPL_SOFTNET 3 /* network software interrupts */
-#define IPL_BIO 4 /* block I/O */
-#define IPL_NET 5 /* network */
-#define IPL_SOFTSERIAL 6 /* serial software interrupts */
-#define IPL_TTY 7 /* terminal */
-#define IPL_VM 8 /* memory allocation */
-#define IPL_AUDIO 9 /* audio */
-#define IPL_CLOCK 10 /* clock */
-#define IPL_STATCLOCK 11 /* statclock */
-#define IPL_HIGH 12 /* everything */
-#define IPL_SERIAL 13 /* serial */
-
-#define NIPL 14
-
-#define IST_UNUSABLE -1 /* interrupt cannot be used */
-#define IST_NONE 0 /* none (dummy) */
-#define IST_PULSE 1 /* pulsed */
-#define IST_EDGE 2 /* edge-triggered */
-#define IST_LEVEL 3 /* level-triggered */
-
-#define ARM_IRQ_HANDLER _C_LABEL(footbridge_intr_dispatch)
-
-#ifndef _LOCORE
-#include <arm/cpufunc.h>
-#include <sys/evcount.h>
-
-#include <arm/footbridge/dc21285mem.h>
-#include <arm/footbridge/dc21285reg.h>
-
-#define INT_SWMASK \
- ((1U << IRQ_SOFTINT) | (1U << IRQ_RESERVED0) | \
- (1U << IRQ_RESERVED1) | (1U << IRQ_RESERVED2))
-#define ICU_INT_HWMASK (0xffffffff & ~(INT_SWMASK | (1U << IRQ_RESERVED3)))
-
-/* only call this with interrupts off */
-static __inline void __attribute__((__unused__))
- footbridge_set_intrmask(void)
-{
- extern __volatile uint32_t intr_enabled;
- /* fetch once so we write the same number to both registers */
- uint32_t tmp = intr_enabled & ICU_INT_HWMASK;
-
- ((__volatile uint32_t*)(DC21285_ARMCSR_VBASE))[IRQ_ENABLE_SET>>2] = tmp;
- ((__volatile uint32_t*)(DC21285_ARMCSR_VBASE))[IRQ_ENABLE_CLEAR>>2] = ~tmp;
-}
-
-static __inline void __attribute__((__unused__))
-footbridge_splx(int newspl)
-{
- extern __volatile uint32_t intr_enabled;
- extern __volatile int current_spl_level;
- extern __volatile int footbridge_ipending;
- extern void footbridge_do_pending(void);
- int oldirqstate, hwpend;
-
- current_spl_level = newspl;
-
- hwpend = (footbridge_ipending & ICU_INT_HWMASK) & ~newspl;
- if (hwpend != 0) {
- oldirqstate = disable_interrupts(I32_bit);
- intr_enabled |= hwpend;
- footbridge_set_intrmask();
- restore_interrupts(oldirqstate);
- }
-
- if ((footbridge_ipending & INT_SWMASK) & ~newspl)
- footbridge_do_pending();
-}
-
-static __inline int __attribute__((__unused__))
-footbridge_splraise(int ipl)
-{
- extern __volatile int current_spl_level;
- extern int footbridge_imask[];
- int old;
-
- old = current_spl_level;
- current_spl_level |= footbridge_imask[ipl];
-
- return (old);
-}
-
-static __inline int __attribute__((__unused__))
-footbridge_spllower(int ipl)
-{
- extern __volatile int current_spl_level;
- extern int footbridge_imask[];
- int old = current_spl_level;
-
- footbridge_splx(footbridge_imask[ipl]);
- return(old);
-}
-
-/* should only be defined in footbridge_intr.c */
-#if !defined(ARM_SPL_NOINLINE)
-
-#define splx(newspl) footbridge_splx(newspl)
-#define _spllower(ipl) footbridge_spllower(ipl)
-#define _splraise(ipl) footbridge_splraise(ipl)
-void _setsoftintr(int);
-
-#else
-
-int _splraise(int);
-int _spllower(int);
-void splx(int);
-void _setsoftintr(int);
-
-#endif /* ! ARM_SPL_NOINLINE */
-
-#include <sys/device.h>
-#include <sys/queue.h>
-#include <machine/irqhandler.h>
-
-#define splsoft() _splraise(IPL_SOFT)
-#define splsoftclock() _splraise(IPL_SOFTCLOCK)
-#define splsoftnet() _splraise(IPL_SOFTNET)
-#define splbio() _splraise(IPL_BIO)
-#define splnet() _splraise(IPL_NET)
-#define splsoftserial() _splraise(IPL_SOFTSERIAL)
-#define spltty() _splraise(IPL_TTY)
-#define spllpt() spltty()
-#define splvm() _splraise(IPL_VM)
-#define splaudio() _splraise(IPL_AUDIO)
-#define splclock() _splraise(IPL_CLOCK)
-#define splstatclock() _splraise(IPL_STATCLOCK)
-#define splhigh() _splraise(IPL_HIGH)
-#define splserial() _splraise(IPL_SERIAL)
-
-#define spl0() (void)_spllower(IPL_NONE)
-
-#define splsched() splhigh()
-#define spllock() splhigh()
-
-/* Use generic software interrupt support. */
-#include <arm/softintr.h>
-
-/* footbridge has 32 interrupt lines */
-#define NIRQ 32
-
-struct intrhand {
- TAILQ_ENTRY(intrhand) ih_list; /* link on intrq list */
- struct evcount ih_count; /* interrupt counter */
- int (*ih_func)(void *); /* handler */
- void *ih_arg; /* arg for handler */
- int ih_ipl; /* IPL_* */
- int ih_irq; /* IRQ number */
-};
-
-#define IRQNAMESIZE sizeof("footbridge irq 31")
-
-struct intrq {
- TAILQ_HEAD(, intrhand) iq_list; /* handler list */
- int iq_mask; /* IRQs to mask while handling */
- int iq_levels; /* IPL_*'s this IRQ has */
- int iq_ist; /* share type */
-};
-
-#endif /* _LOCORE */
-
-#define splassert(wantipl) do { /* nada */ } while (0)
-
-#endif /* _FOOTBRIDGE_INTR_H */
diff --git a/sys/arch/arm/footbridge/footbridge_io.c b/sys/arch/arm/footbridge/footbridge_io.c
deleted file mode 100644
index 7582027b96d..00000000000
--- a/sys/arch/arm/footbridge/footbridge_io.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/* $OpenBSD: footbridge_io.c,v 1.2 2007/05/25 16:22:27 krw Exp $ */
-/* $NetBSD: footbridge_io.c,v 1.6 2002/04/12 19:12:31 thorpej Exp $ */
-
-/*
- * Copyright (c) 1997 Causality Limited
- * Copyright (c) 1997 Mark Brinicombe.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * bus_space I/O functions for footbridge
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <machine/bus.h>
-#include <arm/footbridge/footbridge.h>
-#include <arm/footbridge/dc21285mem.h>
-#include <uvm/uvm_extern.h>
-
-/* Prototypes for all the bus_space structure functions */
-
-bs_protos(footbridge);
-bs_protos(generic);
-bs_protos(generic_armv4);
-bs_protos(bs_notimpl);
-bs_map_proto(footbridge_mem);
-bs_unmap_proto(footbridge_mem);
-
-/* Declare the footbridge bus space tag */
-
-struct bus_space footbridge_bs_tag = {
- /* cookie */
- (void *) 0, /* Base address */
-
- /* mapping/unmapping */
- footbridge_bs_map,
- footbridge_bs_unmap,
- footbridge_bs_subregion,
-
- /* allocation/deallocation */
- footbridge_bs_alloc,
- footbridge_bs_free,
-
- /* get kernel virtual address */
- footbridge_bs_vaddr,
-
- /* Mmap bus space for user */
- bs_notimpl_bs_mmap,
-
- /* barrier */
- footbridge_bs_barrier,
-
- /* read (single) */
- generic_bs_r_1,
- generic_armv4_bs_r_2,
- generic_bs_r_4,
- bs_notimpl_bs_r_8,
-
- /* read multiple */
- generic_bs_rm_1,
- generic_armv4_bs_rm_2,
- generic_bs_rm_4,
- bs_notimpl_bs_rm_8,
-
- /* read region */
- bs_notimpl_bs_rr_1,
- generic_armv4_bs_rr_2,
- generic_bs_rr_4,
- bs_notimpl_bs_rr_8,
-
- /* write (single) */
- generic_bs_w_1,
- generic_armv4_bs_w_2,
- generic_bs_w_4,
- bs_notimpl_bs_w_8,
-
- /* write multiple */
- generic_bs_wm_1,
- generic_armv4_bs_wm_2,
- generic_bs_wm_4,
- bs_notimpl_bs_wm_8,
-
- /* write region */
- bs_notimpl_bs_wr_1,
- generic_armv4_bs_wr_2,
- generic_bs_wr_4,
- bs_notimpl_bs_wr_8,
-
- /* set multiple */
- bs_notimpl_bs_sm_1,
- bs_notimpl_bs_sm_2,
- bs_notimpl_bs_sm_4,
- bs_notimpl_bs_sm_8,
-
- /* set region */
- bs_notimpl_bs_sr_1,
- generic_armv4_bs_sr_2,
- bs_notimpl_bs_sr_4,
- bs_notimpl_bs_sr_8,
-
- /* copy */
- bs_notimpl_bs_c_1,
- generic_armv4_bs_c_2,
- bs_notimpl_bs_c_4,
- bs_notimpl_bs_c_8,
-};
-
-void footbridge_create_io_bs_tag(t, cookie)
- struct bus_space *t;
- void *cookie;
-{
- *t = footbridge_bs_tag;
- t->bs_cookie = cookie;
-}
-
-void footbridge_create_mem_bs_tag(t, cookie)
- struct bus_space *t;
- void *cookie;
-{
- *t = footbridge_bs_tag;
- t->bs_map = footbridge_mem_bs_map;
- t->bs_unmap = footbridge_mem_bs_unmap;
- t->bs_cookie = cookie;
-}
-
-/* bus space functions */
-
-int
-footbridge_bs_map(t, bpa, size, cacheable, bshp)
- void *t;
- bus_addr_t bpa;
- bus_size_t size;
- int cacheable;
- bus_space_handle_t *bshp;
-{
- /*
- * The whole 64K of PCI space is always completely mapped during
- * boot.
- *
- * Eventually this function will do the mapping check overlapping /
- * multiple mappings.
- */
-
- /* The cookie is the base address for the I/O area */
- *bshp = bpa + (bus_addr_t)t;
- return(0);
-}
-
-int
-footbridge_mem_bs_map(t, bpa, size, cacheable, bshp)
- void *t;
- bus_addr_t bpa;
- bus_size_t size;
- int cacheable;
- bus_space_handle_t *bshp;
-{
- bus_addr_t startpa, endpa;
- vaddr_t va;
-
- /* Round the allocation to page boundaries */
- startpa = trunc_page(bpa);
- endpa = round_page(bpa + size);
-
- /*
- * Check for mappings below 1MB as we have this space already
- * mapped. In practice it is only the VGA hole that takes
- * advantage of this.
- */
- if (endpa < DC21285_PCI_ISA_MEM_VSIZE) {
- /* Store the bus space handle */
- *bshp = DC21285_PCI_ISA_MEM_VBASE + bpa;
- return 0;
- }
-
- /*
- * Eventually this function will do the mapping check for overlapping /
- * multiple mappings
- */
-
- va = uvm_km_valloc(kernel_map, endpa - startpa);
- if (va == 0)
- return ENOMEM;
-
- /* Store the bus space handle */
- *bshp = va + (bpa & PGOFSET);
-
- /*
- * Now map the pages. The cookie is the physical base address for the
- * I/O area.
- */
- while (startpa < endpa) {
- pmap_enter(pmap_kernel(), va, (bus_addr_t)t + startpa,
- VM_PROT_READ | VM_PROT_WRITE, 0);
- va += PAGE_SIZE;
- startpa += PAGE_SIZE;
- }
- pmap_update(pmap_kernel());
-
-/* if (bpa >= DC21285_PCI_MEM_VSIZE && bpa != DC21285_ARMCSR_VBASE)
- panic("footbridge_bs_map: Address out of range (%08lx)", bpa);
-*/
- return(0);
-}
-
-int
-footbridge_bs_alloc(t, rstart, rend, size, alignment, boundary, cacheable,
- bpap, bshp)
- void *t;
- bus_addr_t rstart, rend;
- bus_size_t size, alignment, boundary;
- int cacheable;
- bus_addr_t *bpap;
- bus_space_handle_t *bshp;
-{
- panic("footbridge_alloc(): Help!");
-}
-
-
-void
-footbridge_bs_unmap(t, bsh, size)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t size;
-{
- /*
- * Temporary implementation
- */
-}
-
-void
-footbridge_mem_bs_unmap(t, bsh, size)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t size;
-{
- vaddr_t startva, endva;
-
- /*
- * Check for mappings below 1MB as we have this space permenantly
- * mapped. In practice it is only the VGA hole that takes
- * advantage of this.
- */
- if (bsh >= DC21285_PCI_ISA_MEM_VBASE
- && bsh < (DC21285_PCI_ISA_MEM_VBASE + DC21285_PCI_ISA_MEM_VSIZE)) {
- return;
- }
-
- startva = trunc_page(bsh);
- endva = round_page(bsh + size);
-
- uvm_km_free(kernel_map, startva, endva - startva);
-}
-
-void
-footbridge_bs_free(t, bsh, size)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t size;
-{
-
- panic("footbridge_free(): Help!");
- /* footbridge_bs_unmap() does all that we need to do. */
-/* footbridge_bs_unmap(t, bsh, size);*/
-}
-
-int
-footbridge_bs_subregion(t, bsh, offset, size, nbshp)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t offset, size;
- bus_space_handle_t *nbshp;
-{
-
- *nbshp = bsh + (offset << ((int)t));
- return (0);
-}
-
-void *
-footbridge_bs_vaddr(t, bsh)
- void *t;
- bus_space_handle_t bsh;
-{
-
- return ((void *)bsh);
-}
-
-void
-footbridge_bs_barrier(t, bsh, offset, len, flags)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t offset, len;
- int flags;
-{
-}
diff --git a/sys/arch/arm/footbridge/footbridge_irqhandler.c b/sys/arch/arm/footbridge/footbridge_irqhandler.c
deleted file mode 100644
index ab53287084c..00000000000
--- a/sys/arch/arm/footbridge/footbridge_irqhandler.c
+++ /dev/null
@@ -1,459 +0,0 @@
-/* $OpenBSD: footbridge_irqhandler.c,v 1.5 2004/09/18 22:01:18 tedu Exp $ */
-/* $NetBSD: footbridge_irqhandler.c,v 1.9 2003/06/16 20:00:57 thorpej Exp $ */
-
-/*
- * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Jason R. Thorpe for Wasabi Systems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ARM_SPL_NOINLINE
-#define ARM_SPL_NOINLINE
-#endif
-
-#include <sys/cdefs.h>
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <uvm/uvm_extern.h>
-
-#include <machine/intr.h>
-#include <machine/cpu.h>
-#include <arm/footbridge/dc21285mem.h>
-#include <arm/footbridge/dc21285reg.h>
-
-#include <dev/pci/pcivar.h>
-
-#include "isa.h"
-#if NISA > 0
-#include <dev/isa/isavar.h>
-#endif
-
-/* Interrupt handler queues. */
-static struct intrq footbridge_intrq[NIRQ];
-
-/* Interrupts to mask at each level. */
-int footbridge_imask[NIPL];
-
-/* Software copy of the IRQs we have enabled. */
-__volatile uint32_t intr_enabled;
-
-/* Current interrupt priority level */
-__volatile int current_spl_level;
-
-/* Interrupts pending */
-__volatile int footbridge_ipending;
-
-void footbridge_intr_dispatch(struct clockframe *frame);
-
-void footbridge_do_pending(void);
-
-static const uint32_t si_to_irqbit[SI_NQUEUES] =
- { IRQ_SOFTINT,
- IRQ_RESERVED0,
- IRQ_RESERVED1,
- IRQ_RESERVED2 };
-
-#define SI_TO_IRQBIT(si) (1U << si_to_irqbit[(si)])
-
-/*
- * Map a software interrupt queue to an interrupt priority level.
- */
-static const int si_to_ipl[SI_NQUEUES] = {
- IPL_SOFT, /* SI_SOFT */
- IPL_SOFTCLOCK, /* SI_SOFTCLOCK */
- IPL_SOFTNET, /* SI_SOFTNET */
- IPL_SOFTSERIAL, /* SI_SOFTSERIAL */
-};
-static __inline void
-footbridge_enable_irq(int irq)
-{
- intr_enabled |= (1U << irq);
-
- footbridge_set_intrmask();
-}
-
-static __inline void
-footbridge_disable_irq(int irq)
-{
- intr_enabled &= ~(1U << irq);
- footbridge_set_intrmask();
-}
-
-/*
- * NOTE: This routine must be called with interrupts disabled in the CPSR.
- */
-static void
-footbridge_intr_calculate_masks(void)
-{
- struct intrq *iq;
- struct intrhand *ih;
- int irq, ipl;
-
- /* First, figure out which IPLs each IRQ has. */
- for (irq = 0; irq < NIRQ; irq++) {
- int levels = 0;
- iq = &footbridge_intrq[irq];
- footbridge_disable_irq(irq);
- for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
- ih = TAILQ_NEXT(ih, ih_list))
- levels |= (1U << ih->ih_ipl);
- iq->iq_levels = levels;
- }
-
- /* Next, figure out which IRQs are used by each IPL. */
- for (ipl = 0; ipl < NIPL; ipl++) {
- int irqs = 0;
- for (irq = 0; irq < NIRQ; irq++) {
- if (footbridge_intrq[irq].iq_levels & (1U << ipl))
- irqs |= (1U << irq);
- }
- footbridge_imask[ipl] = irqs;
- }
-
- /* IPL_NONE must open up all interrupts */
- footbridge_imask[IPL_NONE] = 0;
-
- /*
- * Initialize the soft interrupt masks to block themselves.
- */
- footbridge_imask[IPL_SOFT] = SI_TO_IRQBIT(SI_SOFT);
- footbridge_imask[IPL_SOFTCLOCK] = SI_TO_IRQBIT(SI_SOFTCLOCK);
- footbridge_imask[IPL_SOFTNET] = SI_TO_IRQBIT(SI_SOFTNET);
- footbridge_imask[IPL_SOFTSERIAL] = SI_TO_IRQBIT(SI_SOFTSERIAL);
-
- footbridge_imask[IPL_SOFTCLOCK] |= footbridge_imask[IPL_SOFT];
- footbridge_imask[IPL_SOFTNET] |= footbridge_imask[IPL_SOFTCLOCK];
-
- /*
- * Enforce a hierarchy that gives "slow" device (or devices with
- * limited input buffer space/"real-time" requirements) a better
- * chance at not dropping data.
- */
- footbridge_imask[IPL_BIO] |= footbridge_imask[IPL_SOFTNET];
- footbridge_imask[IPL_NET] |= footbridge_imask[IPL_BIO];
- footbridge_imask[IPL_SOFTSERIAL] |= footbridge_imask[IPL_NET];
-
- footbridge_imask[IPL_TTY] |= footbridge_imask[IPL_SOFTSERIAL];
-
- /*
- * splvm() blocks all interrupts that use the kernel memory
- * allocation facilities.
- */
- footbridge_imask[IPL_VM] |= footbridge_imask[IPL_TTY];
-
- /*
- * Audio devices are not allowed to perform memory allocation
- * in their interrupt routines, and they have fairly "real-time"
- * requirements, so give them a high interrupt priority.
- */
- footbridge_imask[IPL_AUDIO] |= footbridge_imask[IPL_VM];
-
- /*
- * splclock() must block anything that uses the scheduler.
- */
- footbridge_imask[IPL_CLOCK] |= footbridge_imask[IPL_AUDIO];
-
- /*
- * footbridge has seperate statclock.
- */
- footbridge_imask[IPL_STATCLOCK] |= footbridge_imask[IPL_CLOCK];
-
- /*
- * splhigh() must block "everything".
- */
- footbridge_imask[IPL_HIGH] |= footbridge_imask[IPL_STATCLOCK];
-
- /*
- * XXX We need serial drivers to run at the absolute highest priority
- * in order to avoid overruns, so serial > high.
- */
- footbridge_imask[IPL_SERIAL] |= footbridge_imask[IPL_HIGH];
-
- /*
- * Calculate the ipl level to go to when handling this interrupt
- */
- for (irq = 0; irq < NIRQ; irq++) {
- int irqs = (1U << irq);
- iq = &footbridge_intrq[irq];
- if (TAILQ_FIRST(&iq->iq_list) != NULL)
- footbridge_enable_irq(irq);
- for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
- ih = TAILQ_NEXT(ih, ih_list))
- irqs |= footbridge_imask[ih->ih_ipl];
- iq->iq_mask = irqs;
- }
-}
-
-int
-_splraise(int ipl)
-{
- return (footbridge_splraise(ipl));
-}
-
-/* this will always take us to the ipl passed in */
-void
-splx(int new)
-{
- footbridge_splx(new);
-}
-
-int
-_spllower(int ipl)
-{
- return (footbridge_spllower(ipl));
-}
-
-__inline void
-footbridge_do_pending(void)
-{
-#if 0
- static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED;
-#else
- static int processing;
-#endif
- uint32_t new, oldirqstate;
-
-#if 0
- if (__cpu_simple_lock_try(&processing) == 0)
- return;
-#else
- if (processing)
- return;
- processing = 1;
-#endif
-
- new = current_spl_level;
-
- oldirqstate = disable_interrupts(I32_bit);
-
-#define DO_SOFTINT(si) \
- if ((footbridge_ipending & ~new) & SI_TO_IRQBIT(si)) { \
- footbridge_ipending &= ~SI_TO_IRQBIT(si); \
- current_spl_level |= footbridge_imask[si_to_ipl[(si)]]; \
- restore_interrupts(oldirqstate); \
- softintr_dispatch(si); \
- oldirqstate = disable_interrupts(I32_bit); \
- current_spl_level = new; \
- }
- DO_SOFTINT(SI_SOFTSERIAL);
- DO_SOFTINT(SI_SOFTNET);
- DO_SOFTINT(SI_SOFTCLOCK);
- DO_SOFTINT(SI_SOFT);
-
-#if 0
- __cpu_simple_unlock(&processing);
-#else
- processing = 0;
-#endif
-
- restore_interrupts(oldirqstate);
-}
-
-
-/* called from splhigh, so the matching splx will set the interrupt up.*/
-void
-_setsoftintr(int si)
-{
- int oldirqstate;
-
- oldirqstate = disable_interrupts(I32_bit);
- footbridge_ipending |= SI_TO_IRQBIT(si);
- restore_interrupts(oldirqstate);
-
- /* Process unmasked pending soft interrupts. */
- if ((footbridge_ipending & INT_SWMASK) & ~current_spl_level)
- footbridge_do_pending();
-}
-
-void
-footbridge_intr_init(void)
-{
- struct intrq *iq;
- int i;
-
- intr_enabled = 0;
- current_spl_level = 0xffffffff;
- footbridge_ipending = 0;
- footbridge_set_intrmask();
-
- for (i = 0; i < NIRQ; i++) {
- iq = &footbridge_intrq[i];
- TAILQ_INIT(&iq->iq_list);
- }
-
- footbridge_intr_calculate_masks();
-
- /* Enable IRQ's, we don't have any FIQ's*/
- enable_interrupts(I32_bit);
-}
-
-void *
-footbridge_intr_claim(int irq, int ipl, char *name, int (*func)(void *), void *arg)
-{
- struct intrq *iq;
- struct intrhand *ih;
- u_int oldirqstate;
-
- if (irq < 0 || irq > NIRQ)
- panic("footbridge_intr_establish: IRQ %d out of range", irq);
-
- ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
- if (ih == NULL)
- {
- printf("No memory");
- return (NULL);
- }
-
- ih->ih_func = func;
- ih->ih_arg = arg;
- ih->ih_ipl = ipl;
- ih->ih_irq = irq;
-
- iq = &footbridge_intrq[irq];
-
- iq->iq_ist = IST_LEVEL;
-
- oldirqstate = disable_interrupts(I32_bit);
-
- TAILQ_INSERT_TAIL(&iq->iq_list, ih, ih_list);
-
- footbridge_intr_calculate_masks();
-
- if (name != NULL)
- evcount_attach(&ih->ih_count, name, (void *)&ih->ih_irq,
- &evcount_intr);
-
- restore_interrupts(oldirqstate);
-
- return(ih);
-}
-
-void
-footbridge_intr_disestablish(void *cookie)
-{
- struct intrhand *ih = cookie;
- struct intrq *iq = &footbridge_intrq[ih->ih_irq];
- int oldirqstate;
-
- /* XXX need to free ih ? */
- oldirqstate = disable_interrupts(I32_bit);
-
- TAILQ_REMOVE(&iq->iq_list, ih, ih_list);
-
- footbridge_intr_calculate_masks();
-
- restore_interrupts(oldirqstate);
-}
-
-static uint32_t footbridge_intstatus(void);
-
-static inline uint32_t footbridge_intstatus()
-{
- return ((__volatile uint32_t*)(DC21285_ARMCSR_VBASE))[IRQ_STATUS>>2];
-}
-
-/* called with external interrupts disabled */
-void
-footbridge_intr_dispatch(struct clockframe *frame)
-{
- struct intrq *iq;
- struct intrhand *ih;
- int oldirqstate, pcpl, irq, ibit, hwpend;
-
- pcpl = current_spl_level;
-
- hwpend = footbridge_intstatus();
-
- /*
- * Disable all the interrupts that are pending. We will
- * reenable them once they are processed and not masked.
- */
- intr_enabled &= ~hwpend;
- footbridge_set_intrmask();
-
- while (hwpend != 0) {
- int intr_rc = 0;
- irq = ffs(hwpend) - 1;
- ibit = (1U << irq);
-
- hwpend &= ~ibit;
-
- if (pcpl & ibit) {
- /*
- * IRQ is masked; mark it as pending and check
- * the next one. Note: the IRQ is already disabled.
- */
- footbridge_ipending |= ibit;
- continue;
- }
-
- footbridge_ipending &= ~ibit;
-
- iq = &footbridge_intrq[irq];
- uvmexp.intrs++;
- current_spl_level |= iq->iq_mask;
- oldirqstate = enable_interrupts(I32_bit);
- for (ih = TAILQ_FIRST(&iq->iq_list);
- ((ih != NULL) && (intr_rc != 1));
- ih = TAILQ_NEXT(ih, ih_list)) {
- intr_rc = (*ih->ih_func)(ih->ih_arg ?
- ih->ih_arg : frame);
- if (intr_rc)
- ih->ih_count.ec_count++;
-
- }
- restore_interrupts(oldirqstate);
-
- current_spl_level = pcpl;
-
- /* Re-enable this interrupt now that's it's cleared. */
- intr_enabled |= ibit;
- footbridge_set_intrmask();
-
- /* also check for any new interrupts that may have occured,
- * that we can handle at this spl level */
- hwpend |= (footbridge_ipending & ICU_INT_HWMASK) & ~pcpl;
- }
-
- /* Check for pendings soft intrs. */
- if ((footbridge_ipending & INT_SWMASK) & ~current_spl_level) {
- /*
- * XXX this feels the wrong place to enable irqs, as some
- * soft ints are higher priority than hardware irqs
- */
- oldirqstate = enable_interrupts(I32_bit);
- footbridge_do_pending();
- restore_interrupts(oldirqstate);
- }
-}
diff --git a/sys/arch/arm/footbridge/footbridge_irqhandler.h b/sys/arch/arm/footbridge/footbridge_irqhandler.h
deleted file mode 100644
index cf0a7d109ca..00000000000
--- a/sys/arch/arm/footbridge/footbridge_irqhandler.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $OpenBSD: footbridge_irqhandler.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
-/* $NetBSD: footbridge_irqhandler.h,v 1.2 2002/11/03 21:43:31 chris Exp $ */
-
-/*
- * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Jason R. Thorpe for Wasabi Systems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FOOTBRIDGE_IRQHANDLER_H_
-#define _FOOTBRIDGE_IRQHANDLER_H_
-
-#ifndef _LOCORE
-#include <sys/types.h>
-#endif /* _LOCORE */
-
-#include <machine/intr.h>
-
-void footbridge_intr_init(void);
-void *footbridge_intr_establish(int, int, int (*)(void *), void *);
-void footbridge_intr_disestablish(void *);
-
-#ifdef _KERNEL
-void *footbridge_intr_claim(int irq, int ipl, char *name, int (*func)(void *), void *arg);
-void footbridge_intr_init(void);
-void footbridge_intr_disestablish(void *cookie);
-#endif /* _KERNEL */
-
-#endif /* _FOOTBRIDGE_IRQHANDLER_H_ */
-
-/* End of irqhandler.h */
diff --git a/sys/arch/arm/footbridge/footbridge_machdep.c b/sys/arch/arm/footbridge/footbridge_machdep.c
deleted file mode 100644
index 40a5a1b4798..00000000000
--- a/sys/arch/arm/footbridge/footbridge_machdep.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* $OpenBSD: footbridge_machdep.c,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
-/* $NetBSD: footbridge_machdep.c,v 1.8 2002/05/03 16:45:22 rjs Exp $ */
-
-/*
- * Copyright (c) 1997 Mark Brinicombe.
- * Copyright (c) 1997 Causality Limited
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <uvm/uvm_extern.h>
-#include <machine/pmap.h>
-#include <arm/footbridge/footbridge.h>
-#include <arm/footbridge/dc21285mem.h>
-
-/*
- * For optimal cache cleaning we need two 16K banks of
- * virtual address space that NOTHING else will access
- * and then we alternate the cache cleaning between the
- * two banks.
- * The cache cleaning code requires requires 2 banks aligned
- * on total size boundry so the banks can be alternated by
- * eorring the size bit (assumes the bank size is a power of 2)
- *
- * On the DC21285 we have a special cache clean area so we will
- * use it.
- */
-
-extern unsigned int sa1_cache_clean_addr;
-extern unsigned int sa1_cache_clean_size;
-
-void
-footbridge_sa110_cc_setup(void)
-{
- sa1_cache_clean_addr = DC21285_CACHE_FLUSH_VBASE;
- sa1_cache_clean_size = (PAGE_SIZE * 4);
-}
diff --git a/sys/arch/arm/footbridge/footbridge_mutex.c b/sys/arch/arm/footbridge/footbridge_mutex.c
deleted file mode 100644
index 978514a536f..00000000000
--- a/sys/arch/arm/footbridge/footbridge_mutex.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* $OpenBSD: footbridge_mutex.c,v 1.1 2007/05/15 05:26:44 miod Exp $ */
-
-/*
- * Copyright (c) 2004 Artur Grabowski <art@openbsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/mutex.h>
-#include <sys/systm.h>
-
-#include <machine/intr.h>
-
-#ifdef MULTIPROCESSOR
-#error This code needs more work
-#endif
-
-/*
- * Single processor systems don't need any mutexes, but they need the spl
- * raising semantics of the mutexes.
- */
-void
-mtx_init(struct mutex *mtx, int wantipl)
-{
- mtx->mtx_lock = 0;
- mtx->mtx_wantipl = wantipl;
- mtx->mtx_oldcpl = 0;
-}
-
-void
-mtx_enter(struct mutex *mtx)
-{
- if (mtx->mtx_wantipl != IPL_NONE)
- mtx->mtx_oldcpl = _splraise(mtx->mtx_wantipl);
-
- MUTEX_ASSERT_UNLOCKED(mtx);
- mtx->mtx_lock = 1;
-}
-
-void
-mtx_leave(struct mutex *mtx)
-{
- MUTEX_ASSERT_LOCKED(mtx);
- mtx->mtx_lock = 0;
- if (mtx->mtx_wantipl != IPL_NONE)
- splx(mtx->mtx_oldcpl);
-}
diff --git a/sys/arch/arm/footbridge/footbridge_mutex.h b/sys/arch/arm/footbridge/footbridge_mutex.h
deleted file mode 100644
index 60492ed737d..00000000000
--- a/sys/arch/arm/footbridge/footbridge_mutex.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* $OpenBSD: footbridge_mutex.h,v 1.1 2007/05/15 05:26:44 miod Exp $ */
-
-/*
- * Copyright (c) 2004 Artur Grabowski <art@openbsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _MACHINE_MUTEX_H_
-#define _MACHINE_MUTEX_H_
-
-/*
- * Simple non-mp implementation.
- */
-struct mutex {
- int mtx_lock;
- int mtx_wantipl;
- int mtx_oldcpl;
-};
-
-void mtx_init(struct mutex *, int);
-
-#define MUTEX_INITIALIZER(ipl) { 0, (ipl), 0 }
-
-#ifdef DIAGNOSTIC
-#define MUTEX_ASSERT_LOCKED(mtx) do { \
- if ((mtx)->mtx_lock == 0) \
- panic("mutex %p not held in %s", (mtx), __func__); \
-} while (0)
-
-#define MUTEX_ASSERT_UNLOCKED(mtx) do { \
- if ((mtx)->mtx_lock != 0) \
- panic("mutex %p held in %s", (mtx), __func__); \
-} while (0)
-#else
-#define MUTEX_ASSERT_LOCKED(mtx) do { } while (0)
-#define MUTEX_ASSERT_UNLOCKED(mtx) do { } while (0)
-#endif
-
-#define MUTEX_OLDIPL(mtx) (mtx)->mtx_oldcpl
-
-#endif
diff --git a/sys/arch/arm/footbridge/footbridge_pci.c b/sys/arch/arm/footbridge/footbridge_pci.c
deleted file mode 100644
index 460b5d7cb42..00000000000
--- a/sys/arch/arm/footbridge/footbridge_pci.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/* $OpenBSD: footbridge_pci.c,v 1.5 2005/05/22 19:40:51 art Exp $ */
-/* $NetBSD: footbridge_pci.c,v 1.4 2001/09/05 16:17:35 matt Exp $ */
-
-/*
- * Copyright (c) 1997,1998 Mark Brinicombe.
- * Copyright (c) 1997,1998 Causality Limited
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/malloc.h>
-#include <sys/device.h>
-
-#define _ARM32_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-#include <machine/intr.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <arm/footbridge/dc21285reg.h>
-#include <arm/footbridge/dc21285mem.h>
-
-#include "isa.h"
-#if NISA > 0
-#include <dev/isa/isavar.h>
-#endif
-
-void footbridge_pci_attach_hook (struct device *,
- struct device *, struct pcibus_attach_args *);
-int footbridge_pci_bus_maxdevs (void *, int);
-pcitag_t footbridge_pci_make_tag (void *, int, int, int);
-void footbridge_pci_decompose_tag (void *, pcitag_t, int *,
- int *, int *);
-pcireg_t footbridge_pci_conf_read (void *, pcitag_t, int);
-void footbridge_pci_conf_write (void *, pcitag_t, int,
- pcireg_t);
-int footbridge_pci_intr_map (struct pci_attach_args *,
- pci_intr_handle_t *);
-const char *footbridge_pci_intr_string (void *, pci_intr_handle_t);
-void *footbridge_pci_intr_establish (void *, pci_intr_handle_t,
- int, int (*)(void *), void *, char *);
-void footbridge_pci_intr_disestablish (void *, void *);
-
-
-struct arm32_pci_chipset footbridge_pci_chipset = {
- NULL, /* conf_v */
-#ifdef netwinder
- netwinder_pci_attach_hook,
-#else
- footbridge_pci_attach_hook,
-#endif
- footbridge_pci_bus_maxdevs,
- footbridge_pci_make_tag,
- footbridge_pci_decompose_tag,
- footbridge_pci_conf_read,
- footbridge_pci_conf_write,
- NULL, /* intr_v */
- footbridge_pci_intr_map,
- footbridge_pci_intr_string,
- footbridge_pci_intr_establish,
- footbridge_pci_intr_disestablish
-};
-
-/*
- * PCI doesn't have any special needs; just use the generic versions
- * of these functions.
- */
-struct arm32_bus_dma_tag footbridge_pci_bus_dma_tag = {
- 0,
- 0,
- NULL,
- _bus_dmamap_create,
- _bus_dmamap_destroy,
- _bus_dmamap_load,
- _bus_dmamap_load_mbuf,
- _bus_dmamap_load_uio,
- _bus_dmamap_load_raw,
- _bus_dmamap_unload,
- _bus_dmamap_sync,
- _bus_dmamem_alloc,
- _bus_dmamem_free,
- _bus_dmamem_map,
- _bus_dmamem_unmap,
- _bus_dmamem_mmap,
-};
-
-/*
- * Currently we only support 12 devices as we select directly in the
- * type 0 config cycle
- * (See conf_{read,write} for more detail
- */
-#define MAX_PCI_DEVICES 21
-
-/*static int
-pci_intr(void *arg)
-{
- printf("pci int %x\n", (int)arg);
- return(0);
-}*/
-
-
-void
-footbridge_pci_attach_hook(parent, self, pba)
- struct device *parent, *self;
- struct pcibus_attach_args *pba;
-{
-#ifdef PCI_DEBUG
- printf("footbridge_pci_attach_hook()\n");
-#endif
-
-/* intr_claim(18, IPL_NONE, "pci int 0", pci_intr, (void *)0x10000);
- intr_claim(8, IPL_NONE, "pci int 1", pci_intr, (void *)0x10001);
- intr_claim(9, IPL_NONE, "pci int 2", pci_intr, (void *)0x10002);
- intr_claim(11, IPL_NONE, "pci int 3", pci_intr, (void *)0x10003);*/
-}
-
-int
-footbridge_pci_bus_maxdevs(pcv, busno)
- void *pcv;
- int busno;
-{
-#ifdef PCI_DEBUG
- printf("footbridge_pci_bus_maxdevs(pcv=%p, busno=%d)\n", pcv, busno);
-#endif
- return(MAX_PCI_DEVICES);
-}
-
-pcitag_t
-footbridge_pci_make_tag(pcv, bus, device, function)
- void *pcv;
- int bus, device, function;
-{
-#ifdef PCI_DEBUG
- printf("footbridge_pci_make_tag(pcv=%p, bus=%d, device=%d, function=%d)\n",
- pcv, bus, device, function);
-#endif
- return ((bus << 16) | (device << 11) | (function << 8));
-}
-
-void
-footbridge_pci_decompose_tag(pcv, tag, busp, devicep, functionp)
- void *pcv;
- pcitag_t tag;
- int *busp, *devicep, *functionp;
-{
-#ifdef PCI_DEBUG
- printf("footbridge_pci_decompose_tag(pcv=%p, tag=0x%08x, bp=%x, dp=%x, fp=%x)\n",
- pcv, tag, busp, devicep, functionp);
-#endif
-
- if (busp != NULL)
- *busp = (tag >> 16) & 0xff;
- if (devicep != NULL)
- *devicep = (tag >> 11) & 0x1f;
- if (functionp != NULL)
- *functionp = (tag >> 8) & 0x7;
-}
-
-pcireg_t
-footbridge_pci_conf_read(pcv, tag, reg)
- void *pcv;
- pcitag_t tag;
- int reg;
-{
- int bus, device, function;
- u_int address;
- pcireg_t data;
-
- footbridge_pci_decompose_tag(pcv, tag, &bus, &device, &function);
- if (bus == 0)
- /* Limited to 12 devices or we exceed type 0 config space */
- address = DC21285_PCI_TYPE_0_CONFIG_VBASE | (3 << 22) | (device << 11);
- else
- address = DC21285_PCI_TYPE_1_CONFIG_VBASE | (device << 11) |
- (bus << 16);
-
- address |= (function << 8) | reg;
-
- data = *((unsigned int *)address);
-#ifdef PCI_DEBUG
- printf("footbridge_pci_conf_read(pcv=%p tag=0x%08x reg=0x%02x)=0x%08x\n",
- pcv, tag, reg, data);
-#endif
- return(data);
-}
-
-void
-footbridge_pci_conf_write(pcv, tag, reg, data)
- void *pcv;
- pcitag_t tag;
- int reg;
- pcireg_t data;
-{
- int bus, device, function;
- u_int address;
-
- footbridge_pci_decompose_tag(pcv, tag, &bus, &device, &function);
- if (bus == 0)
- address = DC21285_PCI_TYPE_0_CONFIG_VBASE | (3 << 22) | (device << 11);
- else
- address = DC21285_PCI_TYPE_1_CONFIG_VBASE | (device << 11) |
- (bus << 16);
-
- address |= (function << 8) | reg;
-
-#ifdef PCI_DEBUG
- printf("footbridge_pci_conf_write(pcv=%p tag=0x%08x reg=0x%02x, 0x%08x)\n",
- pcv, tag, reg, data);
-#endif
-
- *((unsigned int *)address) = data;
-}
-
-int
-footbridge_pci_intr_map(pa, ihp)
- struct pci_attach_args *pa;
- pci_intr_handle_t *ihp;
-{
- int pin = pa->pa_intrpin, line = pa->pa_intrline;
- int intr = -1;
-
-#ifdef PCI_DEBUG
- void *pcv = pa->pa_pc;
- pcitag_t intrtag = pa->pa_intrtag;
- int bus, device, function;
-
- footbridge_pci_decompose_tag(pcv, intrtag, &bus, &device, &function);
- printf("footbride_pci_intr_map: pcv=%p, tag=%08lx pin=%d line=%d dev=%d\n",
- pcv, intrtag, pin, line, device);
-#endif
-
- /*
- * Only the line is used to map the interrupt.
- * The firmware is expected to setup up the interrupt
- * line as seen from the CPU
- * This means the firmware deals with the interrupt rotation
- * between slots etc.
- *
- * Perhaps the firmware should also to the final mapping
- * to a 21285 interrupt bit so the code below would be
- * completely MI.
- */
-
- switch (line) {
- case PCI_INTERRUPT_PIN_NONE:
- case 0xff:
- /* No IRQ */
- printf("pci_intr_map: no mapping for pin %c\n", '@' + pin);
- *ihp = -1;
- return(1);
- break;
-#ifdef __cats__
- /* This is machine dependant and needs to be moved */
- case PCI_INTERRUPT_PIN_A:
- intr = IRQ_PCI;
- break;
- case PCI_INTERRUPT_PIN_B:
- intr = IRQ_IN_L0;
- break;
- case PCI_INTERRUPT_PIN_C:
- intr = IRQ_IN_L1;
- break;
- case PCI_INTERRUPT_PIN_D:
- intr = IRQ_IN_L3;
- break;
-#endif
- default:
- /*
- * Experimental firmware feature ...
- *
- * If the interrupt line is in the range 0x80 to 0x8F
- * then the lower 4 bits indicate the ISA interrupt
- * bit that should be used.
- * If the interrupt line is in the range 0x40 to 0x5F
- * then the lower 5 bits indicate the actual DC21285
- * interrupt bit that should be used.
- */
-
- if (line >= 0x40 && line <= 0x5f)
- intr = line & 0x1f;
- else if (line >= 0x80 && line <= 0x8f)
- intr = line;
- else {
- printf("footbridge_pci_intr_map: out of range interrupt"
- "pin %d line %d (%#x)\n", pin, line, line);
- *ihp = -1;
- return(1);
- }
- break;
- }
-
-#ifdef PCI_DEBUG
- printf("pin %d, line %d mapped to int %d\n", pin, line, intr);
-#endif
-
- *ihp = intr;
- return(0);
-}
-
-
-const char *
-footbridge_pci_intr_string(pcv, ih)
- void *pcv;
- pci_intr_handle_t ih;
-{
- static char irqstr[32];
-
-#ifdef PCI_DEBUG
- printf("footbridge_pci_intr_string(pcv=%p, ih=0x%lx)\n", pcv, ih);
-#endif
- if (ih == 0)
- panic("footbridge_pci_intr_string: bogus handle 0x%lx", ih);
-
-#if NISA > 0
- if (ih >= 0x80 && ih <= 0x8f) {
- snprintf(irqstr, sizeof(irqstr), "isairq %ld", (ih & 0x0f));
- return(irqstr);
- }
-#endif
- snprintf(irqstr, sizeof(irqstr), "irq %ld", ih);
- return(irqstr);
-}
-
-
-void *
-footbridge_pci_intr_establish(pcv, ih, level, func, arg, name)
- void *pcv;
- pci_intr_handle_t ih;
- int level, (*func) (void *);
- void *arg;
- char *name;
-{
- void *intr;
-
-#ifdef PCI_DEBUG
- printf("footbridge_pci_intr_establish(pcv=%p, ih=0x%lx, level=%d, func=%p, arg=%p)\n",
- pcv, ih, level, func, arg);
-#endif
-
-#if NISA > 0
- /*
- * XXX the IDE driver will attach the interrupts in compat mode and
- * thus we need to fail this here.
- * This assumes that the interrupts are 14 and 15 which they are for
- * IDE compat mode.
- * Really the firmware should make this clear in the interrupt reg.
- */
- if (ih >= 0x80 && ih <= 0x8d) {
- intr = isa_intr_establish(NULL, (ih & 0x0f), IST_EDGE,
- level, func, arg, name);
- } else
-#endif
- intr = footbridge_intr_claim(ih, level, name, func, arg);
-
- return(intr);
-}
-
-void
-footbridge_pci_intr_disestablish(pcv, cookie)
- void *pcv;
- void *cookie;
-{
-#ifdef PCI_DEBUG
- printf("footbridge_pci_intr_disestablish(pcv=%p, cookie=0x%x)\n",
- pcv, cookie);
-#endif
-
- footbridge_intr_disestablish(cookie);
-}
diff --git a/sys/arch/arm/footbridge/footbridgevar.h b/sys/arch/arm/footbridge/footbridgevar.h
deleted file mode 100644
index 482d52b9e63..00000000000
--- a/sys/arch/arm/footbridge/footbridgevar.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $OpenBSD: footbridgevar.h,v 1.2 2006/05/26 20:34:01 miod Exp $ */
-/* $NetBSD: footbridgevar.h,v 1.2 2002/02/10 12:26:00 chris Exp $ */
-
-/*
- * Copyright (c) 1997 Mark Brinicombe.
- * Copyright (c) 1997 Causality Limited
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/bus.h>
-#include <dev/pci/pcivar.h>
-#include <arm/footbridge/todclockvar.h>
-
-/*
- * DC21285 softc structure.
- *
- * Contains the device node, bus space tag, handle and address
- */
-
-struct footbridge_softc {
- struct device sc_dev; /* device node */
- bus_space_tag_t sc_iot; /* bus tag */
- bus_space_handle_t sc_ioh; /* bus handle */
-
- /* Clock related variables - used in footbridge_clock.c */
- unsigned int sc_clock_ticks_per_256us;
- unsigned int sc_clock_count;
- void *sc_clockintr;
- unsigned int sc_statclock_count;
- void *sc_statclockintr;
-
- /* Miscellaneous interrupts */
- void * sc_serr_ih;
- void * sc_sdram_par_ih;
- void * sc_data_par_ih;
- void * sc_master_abt_ih;
- void * sc_target_abt_ih;
- void * sc_parity_ih;
-};
-
-/*
- * Attach args for child devices
- */
-
-union footbridge_attach_args {
- const char *fba_name; /* first element*/
- struct {
- bus_space_tag_t fba_iot; /* Bus tag */
- bus_space_handle_t fba_ioh; /* Bus handle */
- } fba_fba;
- struct pcibus_attach_args fba_pba; /* pci attach args */
- struct todclock_attach_args fba_tca;
- struct fcom_attach_args {
- char *fca_name;
- bus_space_tag_t fca_iot;
- bus_space_handle_t fca_ioh;
- int fca_rx_irq;
- int fca_tx_irq;
- } fba_fca;
-/* struct clock_attach_args {
- char *ca_name;
- bus_space_tag_t ca_iot;
- bus_space_handle_t ca_ioh;
- } fba_ca;*/
-};
-
-/* End of footbridgevar.h */
diff --git a/sys/arch/arm/footbridge/isa/ds1687reg.h b/sys/arch/arm/footbridge/isa/ds1687reg.h
deleted file mode 100644
index 5f5e1ff9f1c..00000000000
--- a/sys/arch/arm/footbridge/isa/ds1687reg.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* $OpenBSD: ds1687reg.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
-/* $NetBSD: ds1687reg.h,v 1.1 2002/02/10 12:26:01 chris Exp $ */
-
-/*
- * Copyright (c) 1998 Mark Brinicombe.
- * Copyright (c) 1998 Causality Limited.
- * All rights reserved.
- *
- * Written by Mark Brinicombe, Causality Limited
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CAUASLITY LIMITED ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL CAUSALITY LIMITED OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#define RTC_ADDR 0x72
-#define RTC_ADDR_REG 0x00
-#define RTC_DATA_REG 0x01
-
-#define RTC_SECONDS 0x00
-#define RTC_SECONDS_ALARM 0x01
-#define RTC_MINUTES 0x02
-#define RTC_MINUTES_ALARM 0x03
-#define RTC_HOURS 0x04
-#define RTC_HOURS_ALARM 0x05
-#define RTC_DAYOFWEEK 0x06
-#define RTC_DAYOFMONTH 0x07
-#define RTC_MONTH 0x08
-#define RTC_YEAR 0x09
-
-#define RTC_REG_A 0x0a
-#define RTC_REG_A_UIP 0x80 /* Update In Progress */
-#define RTC_REG_A_DV2 0x40 /* Countdown CHain */
-#define RTC_REG_A_DV1 0x20 /* Oscillator Enable */
-#define RTC_REG_A_DV0 0x10 /* Bank Select */
-#define RTC_REG_A_BANK_MASK RTC_REG_A_DV0
-#define RTC_REG_A_BANK1 RTC_REG_A_DV0
-#define RTC_REG_A_BANK0 0x00
-#define RTC_REG_A_RS_MASK 0x0f /* Rate select mask */
-#define RTC_REG_A_RS_NONE 0x00
-#define RTC_REG_A_RS_256HZ_1 0x01
-#define RTC_REG_A_RS_128HZ_1 0x02
-#define RTC_REG_A_RS_8192HZ 0x03
-#define RTC_REG_A_RS_4096HZ 0x04
-#define RTC_REG_A_RS_2048HZ 0x05
-#define RTC_REG_A_RS_1024HZ 0x06
-#define RTC_REG_A_RS_512HZ 0x07
-#define RTC_REG_A_RS_256HZ 0x08
-#define RTC_REG_A_RS_128HZ 0x09
-#define RTC_REG_A_RS_64HZ 0x0A
-#define RTC_REG_A_RS_32HZ 0x0B
-#define RTC_REG_A_RS_16HZ 0x0C
-#define RTC_REG_A_RS_8HZ 0x0D
-#define RTC_REG_A_RS_4HZ 0x0E
-#define RTC_REG_A_RS_2HZ 0x0F
-
-#define RTC_REG_B 0x0b
-#define RTC_REG_B_SET 0x80 /* Inhibit update */
-#define RTC_REG_B_PIE 0x40 /* Periodic Interrupt Enable */
-#define RTC_REG_B_AIE 0x20 /* Alarm Interrupt Enable */
-#define RTC_REG_B_UIE 0x10 /* Updated Ended Interrupt Enable */
-#define RTC_REG_B_SQWE 0x08 /* Square Wave Enable */
-#define RTC_REG_B_DM 0x04 /* Data Mode */
-#define RTC_REG_B_BINARY RTC_REG_B_DM
-#define RTC_REG_B_BCD 0
-#define RTC_REG_B_24_12 0x02 /* Hour format */
-#define RTC_REG_B_24_HOUR RTC_REG_B_24_12
-#define RTC_REG_B_12_HOUR 0
-#define RTC_REG_B_DSE 0x01 /* Daylight Savings Enable */
-
-#define RTC_REG_C 0x0c
-#define RTC_REG_C_IRQF 0x80 /* Interrupt Request Flag */
-#define RTC_REG_C_PF 0x40 /* Periodic Interrupt Flag */
-#define RTC_REG_C_AF 0x20 /* Alarm Interrupt Flag */
-#define RTC_REG_C_UF 0x10 /* Update Ended Flags */
-
-#define RTC_REG_D 0x0d
-#define RTC_REG_D_VRT 0x80 /* Valid RAM and Time */
-
-#define RTC_PC_RAM_START 0x0e
-#define RTC_PC_RAM_SIZE 50
-
-#define RTC_BANK0_RAM_START 0x40
-#define RTC_BANK0_RAM_SIZE 0x40
-
-#define RTC_MODEL 0x40
-#define RTC_SERIAL_1 0x41
-#define RTC_SERIAL_2 0x42
-#define RTC_SERIAL_3 0x43
-#define RTC_SERIAL_4 0x44
-#define RTC_SERIAL_5 0x45
-#define RTC_SERIAL_6 0x46
-#define RTC_CRC 0x47
-#define RTC_CENTURY 0x48
-#define RTC_DATE_ALARM 0x49
-#define RTC_REG_4A 0x4a
-#define RTC_REG_4A_VRT2 0x80
-#define RTC_REG_4A_INCR 0x40
-#define RTC_REG_4A_PAB 0x08
-#define RTC_REG_4A_RF 0x04
-#define RTC_REG_4B 0x4b
-#define RTC_EXT_RAM_ADDRESS 0x50
-#define RTC_EXT_RAM_DATA 0x53
-#define RTC_EXT_RAM_START 0x00
-#define RTC_EXT_RAM_SIZE 0x80
diff --git a/sys/arch/arm/footbridge/isa/dsrtc.c b/sys/arch/arm/footbridge/isa/dsrtc.c
deleted file mode 100644
index 46531d4ddd3..00000000000
--- a/sys/arch/arm/footbridge/isa/dsrtc.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* $OpenBSD: dsrtc.c,v 1.3 2006/05/26 20:34:03 miod Exp $ */
-/* $NetBSD: dsrtc.c,v 1.5 2003/03/23 14:12:26 chris Exp $ */
-
-/*
- * Copyright (c) 1998 Mark Brinicombe.
- * Copyright (c) 1998 Causality Limited.
- * All rights reserved.
- *
- * Written by Mark Brinicombe, Causality Limited
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CAUASLITY LIMITED ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL CAUSALITY LIMITED OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/device.h>
-
-#include <arm/footbridge/todclockvar.h>
-#include <arm/footbridge/isa/ds1687reg.h>
-
-#include <dev/isa/isavar.h>
-
-#define NRTC_PORTS 2
-
-struct dsrtc_softc {
- struct device sc_dev;
- bus_space_tag_t sc_iot;
- bus_space_handle_t sc_ioh;
-};
-
-void dsrtcattach (struct device *parent, struct device *self, void *aux);
-int dsrtcmatch (struct device *parent, void *cf, void *aux);
-int ds1687_read (struct dsrtc_softc *sc, int addr);
-void ds1687_write (struct dsrtc_softc *sc, int addr, int data);
-int ds1687_ram_read (struct dsrtc_softc *sc, int addr);
-void ds1687_ram_write (struct dsrtc_softc *sc, int addr, int data);
-static void ds1687_bank_select (struct dsrtc_softc *, int);
-static int dsrtc_write (void *, rtc_t *);
-static int dsrtc_read (void *, rtc_t *);
-
-int
-ds1687_read(sc, addr)
- struct dsrtc_softc *sc;
- int addr;
-{
-
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, RTC_ADDR_REG, addr);
- return(bus_space_read_1(sc->sc_iot, sc->sc_ioh, RTC_DATA_REG));
-}
-
-void
-ds1687_write(sc, addr, data)
- struct dsrtc_softc *sc;
- int addr;
- int data;
-{
-
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, RTC_ADDR_REG, addr);
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, RTC_DATA_REG, data);
-}
-
-static void
-ds1687_bank_select(sc, bank)
- struct dsrtc_softc *sc;
- int bank;
-{
- int data;
-
- data = ds1687_read(sc, RTC_REG_A);
- data &= ~RTC_REG_A_BANK_MASK;
- if (bank)
- data |= RTC_REG_A_BANK1;
- ds1687_write(sc, RTC_REG_A, data);
-}
-
-#if 0
-/* Nothing uses these yet */
-int
-ds1687_ram_read(sc, addr)
- struct dsrtc_softc *sc;
- int addr;
-{
- if (addr < RTC_PC_RAM_SIZE)
- return(ds1687_read(sc, RTC_PC_RAM_START + addr));
-
- addr -= RTC_PC_RAM_SIZE;
- if (addr < RTC_BANK0_RAM_SIZE)
- return(ds1687_read(sc, RTC_BANK0_RAM_START + addr));
-
- addr -= RTC_BANK0_RAM_SIZE;
- if (addr < RTC_EXT_RAM_SIZE) {
- int data;
-
- ds1687_bank_select(sc, 1);
- ds1687_write(sc, RTC_EXT_RAM_ADDRESS, addr);
- data = ds1687_read(sc, RTC_EXT_RAM_DATA);
- ds1687_bank_select(sc, 0);
- return(data);
- }
- return(-1);
-}
-
-void
-ds1687_ram_write(sc, addr, val)
- struct dsrtc_softc *sc;
- int addr;
- int val;
-{
- if (addr < RTC_PC_RAM_SIZE)
- return(ds1687_write(sc, RTC_PC_RAM_START + addr, val));
-
- addr -= RTC_PC_RAM_SIZE;
- if (addr < RTC_BANK0_RAM_SIZE)
- return(ds1687_write(sc, RTC_BANK0_RAM_START + addr, val));
-
- addr -= RTC_BANK0_RAM_SIZE;
- if (addr < RTC_EXT_RAM_SIZE) {
- ds1687_bank_select(sc, 1);
- ds1687_write(sc, RTC_EXT_RAM_ADDRESS, addr);
- ds1687_write(sc, RTC_EXT_RAM_DATA, val);
- ds1687_bank_select(sc, 0);
- }
-}
-#endif
-
-static int
-dsrtc_write(arg, rtc)
- void *arg;
- rtc_t *rtc;
-{
- struct dsrtc_softc *sc = arg;
-
- ds1687_write(sc, RTC_SECONDS, rtc->rtc_sec);
- ds1687_write(sc, RTC_MINUTES, rtc->rtc_min);
- ds1687_write(sc, RTC_HOURS, rtc->rtc_hour);
- ds1687_write(sc, RTC_DAYOFMONTH, rtc->rtc_day);
- ds1687_write(sc, RTC_MONTH, rtc->rtc_mon);
- ds1687_write(sc, RTC_YEAR, rtc->rtc_year);
- ds1687_bank_select(sc, 1);
- ds1687_write(sc, RTC_CENTURY, rtc->rtc_cen);
- ds1687_bank_select(sc, 0);
- return(1);
-}
-
-static int
-dsrtc_read(arg, rtc)
- void *arg;
- rtc_t *rtc;
-{
- struct dsrtc_softc *sc = arg;
-
- rtc->rtc_micro = 0;
- rtc->rtc_centi = 0;
- rtc->rtc_sec = ds1687_read(sc, RTC_SECONDS);
- rtc->rtc_min = ds1687_read(sc, RTC_MINUTES);
- rtc->rtc_hour = ds1687_read(sc, RTC_HOURS);
- rtc->rtc_day = ds1687_read(sc, RTC_DAYOFMONTH);
- rtc->rtc_mon = ds1687_read(sc, RTC_MONTH);
- rtc->rtc_year = ds1687_read(sc, RTC_YEAR);
- ds1687_bank_select(sc, 1);
- rtc->rtc_cen = ds1687_read(sc, RTC_CENTURY);
- ds1687_bank_select(sc, 0);
-
- return(1);
-}
-
-/* device and attach structures */
-struct cfattach ds1687rtc_ca = {
- sizeof(struct dsrtc_softc), dsrtcmatch, dsrtcattach
-};
-
-struct cfdriver ds1687rtc_cd = {
- NULL, "dsrtc", DV_DULL
-};
-
-/*
- * dsrtcmatch()
- *
- * Validate the IIC address to make sure its an RTC we understand
- */
-
-int
-dsrtcmatch(parent, cf, aux)
- struct device *parent;
- void *cf;
- void *aux;
-{
- struct isa_attach_args *ia = aux;
-
-#ifdef __NetBSD__
- if (ia->ia_nio < 1 ||
- ia->ia_iobase == -1)
- return (0);
-
- ia->ia_nio = 1;
- ia->ia_io[0].ir_size = NRTC_PORTS;
-#else
- ia->ia_iosize = NRTC_PORTS;
-#endif
-
-
-#if 0
- ia->ia_niomem = 0;
- ia->ia_nirq = 0;
- ia->ia_ndrq = 0;
-#endif
-
- return(1);
-}
-
-/*
- * dsrtcattach()
- *
- * Attach the rtc device
- */
-
-void
-dsrtcattach(parent, self, aux)
- struct device *parent;
- struct device *self;
- void *aux;
-{
- struct dsrtc_softc *sc = (struct dsrtc_softc *)self;
- struct isa_attach_args *ia = aux;
- struct todclock_attach_args ta;
-
- sc->sc_iot = ia->ia_iot;
- if (bus_space_map(sc->sc_iot, ia->ia_iobase,
- ia->ia_iosize, 0, &sc->sc_ioh)) {
- printf(": cannot map I/O space\n");
- return;
- }
-
- ds1687_write(sc, RTC_REG_A, RTC_REG_A_DV1);
- ds1687_write(sc, RTC_REG_B, RTC_REG_B_BINARY | RTC_REG_B_24_HOUR);
-
- if (!(ds1687_read(sc, RTC_REG_D) & RTC_REG_D_VRT))
- printf(": lithium cell is dead, RTC unreliable");
- printf("\n");
-
- ta.ta_name = "todclock";
- ta.ta_rtc_arg = sc;
- ta.ta_rtc_write = dsrtc_write;
- ta.ta_rtc_read = dsrtc_read;
- ta.ta_flags = 0;
- config_found(self, &ta, NULL);
-}
-
-/* End of dsrtc.c */
diff --git a/sys/arch/arm/footbridge/isa/icu.h b/sys/arch/arm/footbridge/isa/icu.h
deleted file mode 100644
index 357a0d8e5a0..00000000000
--- a/sys/arch/arm/footbridge/isa/icu.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* $OpenBSD: icu.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
-/* $NetBSD: icu.h,v 1.1 2002/02/10 12:26:01 chris Exp $ */
-
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)icu.h 5.6 (Berkeley) 5/9/91
- */
-
-/*
- * AT/386 Interrupt Control constants
- * W. Jolitz 8/89
- */
-
-#ifndef _ARM32_ISA_ICU_H_
-#define _ARM32_ISA_ICU_H_
-
-#ifndef _LOCORE
-
-/*
- * Interrupt "level" mechanism variables, masks, and macros
- */
-extern unsigned imen; /* interrupt mask enable */
-
-#define SET_ICUS() { \
- outb(IO_ICU1 + 1, imen); \
- outb(IO_ICU2 + 1, imen >> 8); \
-}
-
-#endif /* !_LOCORE */
-
-/*
- * Interrupt enable bits -- in order of priority
- */
-#define IRQ_SLAVE 2
-
-/*
- * Interrupt Control offset into Interrupt descriptor table (IDT)
- */
-#define ICU_OFFSET 32 /* 0-31 are processor exceptions */
-#define ICU_LEN 16 /* 32-47 are ISA interrupts */
-
-#endif /* !_ARM32_ISA_ICU_H_ */
diff --git a/sys/arch/arm/footbridge/isa/isa_io.c b/sys/arch/arm/footbridge/isa/isa_io.c
deleted file mode 100644
index 2ae10d950b8..00000000000
--- a/sys/arch/arm/footbridge/isa/isa_io.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/* $OpenBSD: isa_io.c,v 1.3 2007/05/25 16:45:59 krw Exp $ */
-/* $NetBSD: isa_io.c,v 1.2 2002/09/27 15:35:44 provos Exp $ */
-
-/*
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- *
- * This software is furnished under license and may be used and
- * copied only in accordance with the following terms and conditions.
- * Subject to these conditions, you may download, copy, install,
- * use, modify and distribute this software in source and/or binary
- * form. No title or ownership is transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce
- * and retain this copyright notice and list of conditions as
- * they appear in the source file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of
- * Digital Equipment Corporation. Neither the "Digital Equipment
- * Corporation" name nor any trademark or logo of Digital Equipment
- * Corporation may be used to endorse or promote products derived
- * from this software without the prior written permission of
- * Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied
- * warranties, including but not limited to, any implied warranties
- * of merchantability, fitness for a particular purpose, or
- * non-infringement are disclaimed. In no event shall DIGITAL be
- * liable for any damages whatsoever, and in particular, DIGITAL
- * shall not be liable for special, indirect, consequential, or
- * incidental damages or damages for lost profits, loss of
- * revenue or loss of use, whether such damages arise in contract,
- * negligence, tort, under statute, in equity, at law or otherwise,
- * even if advised of the possibility of such damage.
- */
-
-/*
- * bus_space I/O functions for isa
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <machine/bus.h>
-#include <machine/pio.h>
-#include <machine/isa_machdep.h>
-
-/* Prototypes for all the bus_space structure functions */
-
-bs_protos(isa);
-bs_protos(bs_notimpl);
-
-/*
- * Declare the isa bus space tags
- * The IO and MEM structs are identical, except for the cookies,
- * which contain the address space bases.
- */
-
-/*
- * NOTE: ASSEMBLY LANGUAGE RELIES ON THE COOKIE -- THE FIRST MEMBER OF
- * THIS STRUCTURE -- TO BE THE VIRTUAL ADDRESS OF ISA/IO!
- */
-struct bus_space isa_io_bs_tag = {
- /* cookie */
- NULL, /* initialized below */
-
- /* mapping/unmapping */
- isa_bs_map,
- isa_bs_unmap,
- isa_bs_subregion,
-
- /* allocation/deallocation */
- isa_bs_alloc,
- isa_bs_free,
-
- /* get kernel virtual address */
- isa_bs_vaddr,
-
- /* mmap bus space for userland */
- bs_notimpl_bs_mmap, /* XXX possible even? XXX */
-
- /* barrier */
- isa_bs_barrier,
-
- /* read (single) */
- isa_bs_r_1,
- isa_bs_r_2,
- isa_bs_r_4,
- bs_notimpl_bs_r_8,
-
- /* read multiple */
- isa_bs_rm_1,
- isa_bs_rm_2,
- isa_bs_rm_4,
- bs_notimpl_bs_rm_8,
-
- /* read region */
- isa_bs_rr_1,
- isa_bs_rr_2,
- isa_bs_rr_4,
- bs_notimpl_bs_rr_8,
-
- /* write (single) */
- isa_bs_w_1,
- isa_bs_w_2,
- isa_bs_w_4,
- bs_notimpl_bs_w_8,
-
- /* write multiple */
- isa_bs_wm_1,
- isa_bs_wm_2,
- isa_bs_wm_4,
- bs_notimpl_bs_wm_8,
-
- /* write region */
- isa_bs_wr_1,
- isa_bs_wr_2,
- isa_bs_wr_4,
- bs_notimpl_bs_wr_8,
-
- /* set multiple */
- bs_notimpl_bs_sm_1,
- bs_notimpl_bs_sm_2,
- bs_notimpl_bs_sm_4,
- bs_notimpl_bs_sm_8,
-
- /* set region */
- bs_notimpl_bs_sr_1,
- isa_bs_sr_2,
- bs_notimpl_bs_sr_4,
- bs_notimpl_bs_sr_8,
-
- /* copy */
- bs_notimpl_bs_c_1,
- bs_notimpl_bs_c_2,
- bs_notimpl_bs_c_4,
- bs_notimpl_bs_c_8,
-};
-
-/*
- * NOTE: ASSEMBLY LANGUAGE RELIES ON THE COOKIE -- THE FIRST MEMBER OF
- * THIS STRUCTURE -- TO BE THE VIRTUAL ADDRESS OF ISA/MEMORY!
- */
-struct bus_space isa_mem_bs_tag = {
- /* cookie */
- NULL, /* initialized below */
-
- /* mapping/unmapping */
- isa_bs_map,
- isa_bs_unmap,
- isa_bs_subregion,
-
- /* allocation/deallocation */
- isa_bs_alloc,
- isa_bs_free,
-
- /* get kernel virtual address */
- isa_bs_vaddr,
-
- /* mmap bus space for userland */
- bs_notimpl_bs_mmap, /* XXX open for now ... XXX */
-
- /* barrier */
- isa_bs_barrier,
-
- /* read (single) */
- isa_bs_r_1,
- isa_bs_r_2,
- isa_bs_r_4,
- bs_notimpl_bs_r_8,
-
- /* read multiple */
- isa_bs_rm_1,
- isa_bs_rm_2,
- isa_bs_rm_4,
- bs_notimpl_bs_rm_8,
-
- /* read region */
- isa_bs_rr_1,
- isa_bs_rr_2,
- isa_bs_rr_4,
- bs_notimpl_bs_rr_8,
-
- /* write (single) */
- isa_bs_w_1,
- isa_bs_w_2,
- isa_bs_w_4,
- bs_notimpl_bs_w_8,
-
- /* write multiple */
- isa_bs_wm_1,
- isa_bs_wm_2,
- isa_bs_wm_4,
- bs_notimpl_bs_wm_8,
-
- /* write region */
- isa_bs_wr_1,
- isa_bs_wr_2,
- isa_bs_wr_4,
- bs_notimpl_bs_wr_8,
-
- /* set multiple */
- bs_notimpl_bs_sm_1,
- bs_notimpl_bs_sm_2,
- bs_notimpl_bs_sm_4,
- bs_notimpl_bs_sm_8,
-
- /* set region */
- bs_notimpl_bs_sr_1,
- isa_bs_sr_2,
- bs_notimpl_bs_sr_4,
- bs_notimpl_bs_sr_8,
-
- /* copy */
- bs_notimpl_bs_c_1,
- bs_notimpl_bs_c_2,
- bs_notimpl_bs_c_4,
- bs_notimpl_bs_c_8,
-};
-
-/* bus space functions */
-
-void
-isa_io_init(isa_io_addr, isa_mem_addr)
- vaddr_t isa_io_addr;
- vaddr_t isa_mem_addr;
-{
- isa_io_bs_tag.bs_cookie = (void *)isa_io_addr;
- isa_mem_bs_tag.bs_cookie = (void *)isa_mem_addr;
-}
-
-/*
- * break the abstraction: sometimes, other parts of the system
- * (e.g. X servers) need to map ISA space directly. use these
- * functions sparingly!
- */
-vaddr_t
-isa_io_data_vaddr(void)
-{
- return (vaddr_t)isa_io_bs_tag.bs_cookie;
-}
-
-vaddr_t
-isa_mem_data_vaddr(void)
-{
- return (vaddr_t)isa_mem_bs_tag.bs_cookie;
-}
-
-int
-isa_bs_map(t, bpa, size, cacheable, bshp)
- void *t;
- bus_addr_t bpa;
- bus_size_t size;
- int cacheable;
- bus_space_handle_t *bshp;
-{
- *bshp = bpa + (bus_addr_t)t;
- return(0);
-}
-
-void
-isa_bs_unmap(t, bsh, size)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t size;
-{
- /* Nothing to do. */
-}
-
-int
-isa_bs_subregion(t, bsh, offset, size, nbshp)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t offset, size;
- bus_space_handle_t *nbshp;
-{
-/* printf("isa_subregion(tag=%p, bsh=%lx, off=%lx, sz=%lx)\n",
- t, bsh, offset, size);*/
- *nbshp = bsh + offset;
- return(0);
-}
-
-int
-isa_bs_alloc(t, rstart, rend, size, alignment, boundary, cacheable,
- bpap, bshp)
- void *t;
- bus_addr_t rstart, rend;
- bus_size_t size, alignment, boundary;
- int cacheable;
- bus_addr_t *bpap;
- bus_space_handle_t *bshp;
-{
- panic("isa_alloc(): Help!");
-}
-
-void
-isa_bs_free(t, bsh, size)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t size;
-{
- panic("isa_free(): Help!");
-}
-
-void *
-isa_bs_vaddr(t, bsh)
- void *t;
- bus_space_handle_t bsh;
-{
-
- return ((void *)bsh);
-}
-
-void
-isa_bs_barrier(t, bsh, offset, len, flags)
- void *t;
- bus_space_handle_t bsh;
- bus_size_t offset, len;
- int flags;
-{
- /* just return */
-}
diff --git a/sys/arch/arm/footbridge/isa/isa_io_asm.S b/sys/arch/arm/footbridge/isa/isa_io_asm.S
deleted file mode 100644
index 6e618e161b6..00000000000
--- a/sys/arch/arm/footbridge/isa/isa_io_asm.S
+++ /dev/null
@@ -1,342 +0,0 @@
-/* $OpenBSD: isa_io_asm.S,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
-/* $NetBSD: isa_io_asm.S,v 1.1 2002/02/10 12:26:01 chris Exp $ */
-
-/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Mark Brinicombe.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- *
- * This software is furnished under license and may be used and
- * copied only in accordance with the following terms and conditions.
- * Subject to these conditions, you may download, copy, install,
- * use, modify and distribute this software in source and/or binary
- * form. No title or ownership is transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce
- * and retain this copyright notice and list of conditions as
- * they appear in the source file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of
- * Digital Equipment Corporation. Neither the "Digital Equipment
- * Corporation" name nor any trademark or logo of Digital Equipment
- * Corporation may be used to endorse or promote products derived
- * from this software without the prior written permission of
- * Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied
- * warranties, including but not limited to, any implied warranties
- * of merchantability, fitness for a particular purpose, or
- * non-infringement are disclaimed. In no event shall DIGITAL be
- * liable for any damages whatsoever, and in particular, DIGITAL
- * shall not be liable for special, indirect, consequential, or
- * incidental damages or damages for lost profits, loss of
- * revenue or loss of use, whether such damages arise in contract,
- * negligence, tort, under statute, in equity, at law or otherwise,
- * even if advised of the possibility of such damage.
- */
-
-/*
- * bus_space I/O functions for isa
- */
-
-#include <machine/asm.h>
-
-#ifdef GPROF
-#define PAUSE nop ; nop ; nop ; nop ; nop
-#else
-#define PAUSE
-#endif
-
-/*
- * Note these functions use ARM Architecture V4 instructions as
- * all current systems with ISA will be using processors that support
- * V4 or later architectures (SHARK & CATS)
- */
-
-/*
- * read single
- */
-
-ENTRY(isa_bs_r_1)
- ldrb r0, [r1, r2]
- PAUSE
- mov pc, lr
-
-ENTRY(isa_bs_r_2)
- ldrh r0, [r1, r2] /*.word 0xe19100b2*/
- PAUSE
- mov pc, lr
-
-ENTRY(isa_bs_r_4)
- ldr r0, [r1, r2]
- PAUSE
- mov pc, lr
-
-/*
- * read multiple.
- */
-
-ENTRY(isa_bs_rm_1)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_rm_1_loop:
- ldrb r3, [r0]
- strb r3, [r1], #1
- subs r2, r2, #1
- bne Lisa_rm_1_loop
-
- mov pc, lr
-
-ENTRY(isa_bs_rm_2)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_rm_2_loop:
- ldrh r3, [r0] /*.word 0xe1d030b0*/
- strh r3, [r1], #2 /*.word 0xe0c130b2*/
- subs r2, r2, #1
- bne Lisa_rm_2_loop
-
- mov pc, lr
-
-ENTRY(isa_bs_rm_4)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_rm_4_loop:
- ldr r3, [r0]
- str r3, [r1], #4
- subs r2, r2, #1
- bne Lisa_rm_4_loop
-
- mov pc, lr
-
-/*
- * read region.
- */
-
-ENTRY(isa_bs_rr_1)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_rr_1_loop:
- ldrb r3, [r0], #1
- strb r3, [r1], #1
- subs r2, r2, #1
- bne Lisa_rr_1_loop
-
- mov pc, lr
-
-ENTRY(isa_bs_rr_2)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_rr_2_loop:
- ldrh r3, [r0], #2
- strh r3, [r1], #2 /*.word 0xe0c130b2*/
- subs r2, r2, #1
- bne Lisa_rr_2_loop
-
- mov pc, lr
-
-ENTRY(isa_bs_rr_4)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_rr_4_loop:
- ldr r3, [r0], #4
- str r3, [r1], #4
- subs r2, r2, #1
- bne Lisa_rr_4_loop
-
- mov pc, lr
-
-/*
- * write single
- */
-
-ENTRY(isa_bs_w_1)
- strb r3, [r1, r2]
- PAUSE
- mov pc, lr
-
-ENTRY(isa_bs_w_2)
- strh r3, [r1, r2] /*.word 0xe18130b2*/
- PAUSE
- mov pc, lr
-
-ENTRY(isa_bs_w_4)
- str r3, [r1, r2]
- PAUSE
- mov pc, lr
-
-/*
- * write multiple
- */
-
-ENTRY(isa_bs_wm_1)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_wm_1_loop:
- ldrb r3, [r1], #1
- strb r3, [r0]
- subs r2, r2, #1
- bne Lisa_wm_1_loop
-
- mov pc, lr
-
-ENTRY(isa_bs_wm_2)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_wm_2_loop:
- ldrh r3, [r1], #2 /*.word 0xe0d130b2*/
- strh r3, [r0] /*.word 0xe1c030b0*/
- subs r2, r2, #1
- bne Lisa_wm_2_loop
-
- mov pc, lr
-
-ENTRY(isa_bs_wm_4)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_wm_4_loop:
- ldr r3, [r1], #4
- str r3, [r0]
- subs r2, r2, #1
- bne Lisa_wm_4_loop
-
- mov pc, lr
-
-
-/*
- * write region.
- */
-
-ENTRY(isa_bs_wr_1)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_wr_1_loop:
- ldrb r3, [r1], #1
- strb r3, [r0], #1
- subs r2, r2, #1
- bne Lisa_wr_1_loop
-
- mov pc, lr
-
-ENTRY(isa_bs_wr_2)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_wr_2_loop:
- ldrh r3, [r1], #2 /*.word 0xe0d130b2*/
- strh r3, [r0], #2
- subs r2, r2, #1
- bne Lisa_wr_2_loop
-
- mov pc, lr
-
-ENTRY(isa_bs_wr_4)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_wr_4_loop:
- ldr r3, [r1], #4
- str r3, [r0], #4
- subs r2, r2, #1
- bne Lisa_wr_4_loop
-
- mov pc, lr
-
-/*
- * Set region
- */
-
-ENTRY(isa_bs_sr_2)
- add r0, r1, r2
- mov r1, r3
- ldr r2, [sp, #0]
- teq r2, #0
- moveq pc, lr
-
-Lisa_bs_sr_2_loop:
- strh r1, [r0], #2 /*.word e0c010b2*/
- subs r2, r2, #1
- bne Lisa_bs_sr_2_loop
-
- mov pc, lr
diff --git a/sys/arch/arm/footbridge/isa/isa_machdep.c b/sys/arch/arm/footbridge/isa/isa_machdep.c
deleted file mode 100644
index cbbdae8a482..00000000000
--- a/sys/arch/arm/footbridge/isa/isa_machdep.c
+++ /dev/null
@@ -1,601 +0,0 @@
-/* $OpenBSD: isa_machdep.c,v 1.4 2004/08/17 19:40:45 drahn Exp $ */
-/* $NetBSD: isa_machdep.c,v 1.4 2003/06/16 20:00:57 thorpej Exp $ */
-
-/*-
- * Copyright (c) 1996-1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Mark Brinicombe, Charles M. Hannum and by Jason R. Thorpe of the
- * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)isa.c 7.2 (Berkeley) 5/13/91
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/proc.h>
-
-#define _ARM32_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-
-#include <machine/intr.h>
-#include <machine/pio.h>
-#include <machine/bootconfig.h>
-#include <machine/isa_machdep.h>
-
-#include <dev/isa/isareg.h>
-#include <dev/isa/isavar.h>
-#include <dev/isa/isadmareg.h>
-#include <dev/isa/isadmavar.h>
-#include <arm/footbridge/isa/icu.h>
-#include <arm/footbridge/dc21285reg.h>
-#include <arm/footbridge/dc21285mem.h>
-
-#include <uvm/uvm_extern.h>
-
-#include "isadma.h"
-
-/* prototypes */
-static void isa_icu_init (void);
-
-struct arm32_isa_chipset isa_chipset_tag;
-
-void isa_strayintr (int);
-void intr_calculatemasks (void);
-int fakeintr (void *);
-
-int isa_irqdispatch (void *arg);
-
-u_int imask[NIPL];
-unsigned imen;
-
-#define AUTO_EOI_1
-#define AUTO_EOI_2
-
-/*
- * Fill in default interrupt table (in case of spuruious interrupt
- * during configuration of kernel, setup interrupt control unit
- */
-static void
-isa_icu_init(void)
-{
- /* initialize 8259's */
- outb(IO_ICU1, 0x11); /* reset; program device, four bytes */
- outb(IO_ICU1+1, ICU_OFFSET); /* starting at this vector index */
- outb(IO_ICU1+1, 1 << IRQ_SLAVE); /* slave on line 2 */
-#ifdef AUTO_EOI_1
- outb(IO_ICU1+1, 2 | 1); /* auto EOI, 8086 mode */
-#else
- outb(IO_ICU1+1, 1); /* 8086 mode */
-#endif
- outb(IO_ICU1+1, 0xff); /* leave interrupts masked */
- outb(IO_ICU1, 0x68); /* special mask mode (if available) */
- outb(IO_ICU1, 0x0a); /* Read IRR by default. */
-#ifdef REORDER_IRQ
- outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */
-#endif
-
- outb(IO_ICU2, 0x11); /* reset; program device, four bytes */
- outb(IO_ICU2+1, ICU_OFFSET+8); /* staring at this vector index */
- outb(IO_ICU2+1, IRQ_SLAVE);
-#ifdef AUTO_EOI_2
- outb(IO_ICU2+1, 2 | 1); /* auto EOI, 8086 mode */
-#else
- outb(IO_ICU2+1, 1); /* 8086 mode */
-#endif
- outb(IO_ICU2+1, 0xff); /* leave interrupts masked */
- outb(IO_ICU2, 0x68); /* special mask mode (if available) */
- outb(IO_ICU2, 0x0a); /* Read IRR by default. */
-}
-
-/*
- * Caught a stray interrupt, notify
- */
-void
-isa_strayintr(irq)
- int irq;
-{
- static u_long strays;
-
- /*
- * Stray interrupts on irq 7 occur when an interrupt line is raised
- * and then lowered before the CPU acknowledges it. This generally
- * means either the device is screwed or something is cli'ing too
- * long and it's timing out.
- */
- if (++strays <= 5)
- log(LOG_ERR, "stray interrupt %d%s\n", irq,
- strays >= 5 ? "; stopped logging" : "");
-}
-
-static struct intrq isa_intrq[ICU_LEN];
-
-/*
- * Recalculate the interrupt masks from scratch.
- * We could code special registry and deregistry versions of this function that
- * would be faster, but the code would be nastier, and we don't expect this to
- * happen very much anyway.
- */
-void
-intr_calculatemasks()
-{
- int irq, level;
- struct intrq *iq;
- struct intrhand *ih;
-
- /* First, figure out which levels each IRQ uses. */
- for (irq = 0; irq < ICU_LEN; irq++) {
- int levels = 0;
- iq = &isa_intrq[irq];
- for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
- ih = TAILQ_NEXT(ih, ih_list))
- levels |= (1U << ih->ih_ipl);
- iq->iq_levels = levels;
- }
-
- /* Then figure out which IRQs use each level. */
- for (level = 0; level < NIPL; level++) {
- int irqs = 0;
- for (irq = 0; irq < ICU_LEN; irq++)
- if (isa_intrq[irq].iq_levels & (1U << level))
- irqs |= (1U << irq);
- imask[level] = irqs;
- }
-
- /*
- * IPL_NONE is used for hardware interrupts that are never blocked,
- * and do not block anything else.
- */
- imask[IPL_NONE] = 0;
-
- imask[IPL_SOFT] |= imask[IPL_NONE];
- imask[IPL_SOFTCLOCK] |= imask[IPL_SOFT];
- imask[IPL_SOFTNET] |= imask[IPL_SOFTCLOCK];
-
- /*
- * Enforce a hierarchy that gives slow devices a better chance at not
- * dropping data.
- */
- imask[IPL_BIO] |= imask[IPL_SOFTCLOCK];
- imask[IPL_NET] |= imask[IPL_BIO];
- imask[IPL_SOFTSERIAL] |= imask[IPL_NET];
- imask[IPL_TTY] |= imask[IPL_NET];
- /*
- * There are tty, network and disk drivers that use free() at interrupt
- * time, so imp > (tty | net | bio).
- */
- imask[IPL_VM] |= imask[IPL_TTY];
- imask[IPL_AUDIO] |= imask[IPL_VM];
-
- /*
- * Since run queues may be manipulated by both the statclock and tty,
- * network, and disk drivers, clock > imp.
- */
- imask[IPL_CLOCK] |= imask[IPL_VM];
- imask[IPL_STATCLOCK] |= imask[IPL_CLOCK];
-
- /*
- * IPL_HIGH must block everything that can manipulate a run queue.
- */
- imask[IPL_HIGH] |= imask[IPL_STATCLOCK];
-
- /*
- * We need serial drivers to run at the absolute highest priority to
- * avoid overruns, so serial > high.
- */
- imask[IPL_SERIAL] |= imask[IPL_HIGH];
-
- /* And eventually calculate the complete masks. */
- for (irq = 0; irq < ICU_LEN; irq++) {
- int irqs = 1 << irq;
- iq = &isa_intrq[irq];
- for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
- ih = TAILQ_NEXT(ih, ih_list))
- irqs |= imask[ih->ih_ipl];
- iq->iq_mask = irqs;
- }
-
- /* Lastly, determine which IRQs are actually in use. */
- {
- int irqs = 0;
- for (irq = 0; irq < ICU_LEN; irq++)
- if (!TAILQ_EMPTY(&isa_intrq[irq].iq_list))
- irqs |= (1U << irq);
- if (irqs >= 0x100) /* any IRQs >= 8 in use */
- irqs |= 1 << IRQ_SLAVE;
- imen = ~irqs;
- SET_ICUS();
- }
-#if 0
- printf("type\tmask\tlevel\thand\n");
- for (irq = 0; irq < ICU_LEN; irq++) {
- printf("%x\t%04x\t%x\t%p\n", intrtype[irq], intrmask[irq],
- intrlevel[irq], intrhand[irq]);
- }
- for (level = 0; level < IPL_LEVELS; ++level)
- printf("%d: %08x\n", level, imask[level]);
-#endif
-}
-
-int
-fakeintr(arg)
- void *arg;
-{
-
- return 0;
-}
-
-#define LEGAL_IRQ(x) ((x) >= 0 && (x) < ICU_LEN && (x) != 2)
-
-int
-isa_intr_alloc(ic, mask, type, irq)
- isa_chipset_tag_t ic;
- int mask;
- int type;
- int *irq;
-{
- int i, tmp, bestirq, count;
- struct intrq *iq;
- struct intrhand *ih;
-
- if (type == IST_NONE)
- panic("intr_alloc: bogus type");
-
- bestirq = -1;
- count = -1;
-
- /* some interrupts should never be dynamically allocated */
- mask &= 0xdef8;
-
- /*
- * XXX some interrupts will be used later (6 for fdc, 12 for pms).
- * the right answer is to do "breadth-first" searching of devices.
- */
- mask &= 0xefbf;
-
- for (i = 0; i < ICU_LEN; i++) {
- if (LEGAL_IRQ(i) == 0 || (mask & (1<<i)) == 0)
- continue;
-
- iq = &isa_intrq[i];
- switch(iq->iq_ist) {
- case IST_NONE:
- /*
- * if nothing's using the irq, just return it
- */
- *irq = i;
- return (0);
-
- case IST_EDGE:
- case IST_LEVEL:
- if (type != iq->iq_ist)
- continue;
- /*
- * if the irq is shareable, count the number of other
- * handlers, and if it's smaller than the last irq like
- * this, remember it
- *
- * XXX We should probably also consider the
- * interrupt level and stick IPL_TTY with other
- * IPL_TTY, etc.
- */
- tmp = 0;
- TAILQ_FOREACH(ih, &(iq->iq_list), ih_list)
- tmp++;
- if ((bestirq == -1) || (count > tmp)) {
- bestirq = i;
- count = tmp;
- }
- break;
-
- case IST_PULSE:
- /* this just isn't shareable */
- continue;
- }
- }
-
- if (bestirq == -1)
- return (1);
-
- *irq = bestirq;
-
- return (0);
-}
-
-/*
- * Set up an interrupt handler to start being called.
- * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM.
- */
-void *
-isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, name)
- isa_chipset_tag_t ic;
- int irq;
- int type;
- int level;
- int (*ih_fun) (void *);
- void *ih_arg;
- char *name;
-{
- struct intrq *iq;
- struct intrhand *ih;
- u_int oldirqstate;
-
-#if 0
- printf("isa_intr_establish(%d, %d, %d)\n", irq, type, level);
-#endif
- /* no point in sleeping unless someone can free memory. */
- ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
- if (ih == NULL)
- return (NULL);
-
- if (!LEGAL_IRQ(irq) || type == IST_NONE)
- panic("intr_establish: bogus irq or type");
-
- iq = &isa_intrq[irq];
-
- switch (iq->iq_ist) {
- case IST_NONE:
- iq->iq_ist = type;
-#if 0
- printf("Setting irq %d to type %d - ", irq, type);
-#endif
- if (irq < 8) {
- outb(0x4d0, (inb(0x4d0) & ~(1 << irq))
- | ((type == IST_LEVEL) ? (1 << irq) : 0));
-/* printf("%02x\n", inb(0x4d0));*/
- } else {
- outb(0x4d1, (inb(0x4d1) & ~(1 << irq))
- | ((type == IST_LEVEL) ? (1 << irq) : 0));
-/* printf("%02x\n", inb(0x4d1));*/
- }
- break;
- case IST_EDGE:
- case IST_LEVEL:
- if (iq->iq_ist == type)
- break;
- case IST_PULSE:
- if (type != IST_NONE)
- panic("intr_establish: can't share %s with %s",
- isa_intr_typename(iq->iq_ist),
- isa_intr_typename(type));
- break;
- }
-
- ih->ih_func = ih_fun;
- ih->ih_arg = ih_arg;
- ih->ih_ipl = level;
- ih->ih_irq = irq;
- evcount_attach(&ih->ih_count, name, (void *)&ih->ih_irq,
- &evcount_intr);
-
- /* do not stop us */
- oldirqstate = disable_interrupts(I32_bit);
-
- TAILQ_INSERT_TAIL(&iq->iq_list, ih, ih_list);
-
- intr_calculatemasks();
- restore_interrupts(oldirqstate);
-
- return (ih);
-}
-
-/*
- * Deregister an interrupt handler.
- */
-void
-isa_intr_disestablish(ic, arg)
- isa_chipset_tag_t ic;
- void *arg;
-{
- struct intrhand *ih = arg;
- struct intrq *iq = &isa_intrq[ih->ih_irq];
- int irq = ih->ih_irq;
- u_int oldirqstate;
-
- if (!LEGAL_IRQ(irq))
- panic("intr_disestablish: bogus irq");
-
- oldirqstate = disable_interrupts(I32_bit);
-
- TAILQ_REMOVE(&iq->iq_list, ih, ih_list);
-
- intr_calculatemasks();
-
- restore_interrupts(oldirqstate);
-
- evcount_detach(&ih->ih_count);
- free(ih, M_DEVBUF);
-
- if (TAILQ_EMPTY(&(iq->iq_list)))
- iq->iq_ist = IST_NONE;
-}
-
-/*
- * isa_intr_init()
- *
- * Initialise the ISA ICU and attach an ISA interrupt handler to the
- * ISA interrupt line on the footbridge.
- */
-void
-isa_intr_init(void)
-{
- static void *isa_ih;
- struct intrq *iq;
- int i;
-
- /*
- * should get the parent here, but initialisation order being so
- * strange I need to check if it's available
- */
- for (i = 0; i < ICU_LEN; i++) {
- iq = &isa_intrq[i];
- TAILQ_INIT(&iq->iq_list);
- }
-
- isa_icu_init();
- intr_calculatemasks();
- /* something to break the build in an informative way */
-#ifndef ISA_FOOTBRIDGE_IRQ
-#warning Before using isa with footbridge you must define ISA_FOOTBRIDGE_IRQ
-#endif
- isa_ih = footbridge_intr_claim(ISA_FOOTBRIDGE_IRQ, IPL_BIO, NULL,
- isa_irqdispatch, NULL);
-
-}
-
-/* Static array of ISA DMA segments. We only have one on CATS */
-#if NISADMA > 0
-struct arm32_dma_range machdep_isa_dma_ranges[1];
-#endif
-
-void
-isa_footbridge_init(iobase, membase)
- u_int iobase, membase;
-{
-#if NISADMA > 0
- extern struct arm32_dma_range *footbridge_isa_dma_ranges;
- extern int footbridge_isa_dma_nranges;
-
- machdep_isa_dma_ranges[0].dr_sysbase = bootconfig.dram[0].address;
- machdep_isa_dma_ranges[0].dr_busbase = bootconfig.dram[0].address;
- machdep_isa_dma_ranges[0].dr_len = (16 * 1024 * 1024);
-
- footbridge_isa_dma_ranges = machdep_isa_dma_ranges;
- footbridge_isa_dma_nranges = 1;
-#endif
-
- isa_io_init(iobase, membase);
-}
-
-void
-isa_attach_hook(parent, self, iba)
- struct device *parent, *self;
- struct isabus_attach_args *iba;
-{
- /*
- * Since we can only have one ISA bus, we just use a single
- * statically allocated ISA chipset structure. Pass it up
- * now.
- */
- iba->iba_ic = &isa_chipset_tag;
-#if NISADMA > 0
- isa_dma_init();
-#endif
-}
-
-int
-isa_irqdispatch(arg)
- void *arg;
-{
- struct clockframe *frame = arg;
- int irq;
- struct intrq *iq;
- struct intrhand *ih;
- u_int iack;
- int res = 0;
-
- iack = *((u_int *)(DC21285_PCI_IACK_VBASE));
- iack &= 0xff;
- if (iack < 0x20 || iack > 0x2f) {
- printf("isa_irqdispatch: %x\n", iack);
- return(0);
- }
-
- irq = iack & 0x0f;
- iq = &isa_intrq[irq];
- for (ih = TAILQ_FIRST(&iq->iq_list); res != 1 && ih != NULL;
- ih = TAILQ_NEXT(ih, ih_list)) {
- res = (*ih->ih_func)(ih->ih_arg ? ih->ih_arg : frame);
- if (res)
- ih->ih_count.ec_count++;
- }
- return res;
-}
-
-
-void
-isa_fillw(val, addr, len)
- u_int val;
- void *addr;
- size_t len;
-{
- if ((u_int)addr >= isa_mem_data_vaddr()
- && (u_int)addr < isa_mem_data_vaddr() + 0x100000) {
- bus_size_t offset = ((u_int)addr) & 0xfffff;
- bus_space_set_region_2(&isa_mem_bs_tag,
- (bus_space_handle_t)isa_mem_bs_tag.bs_cookie, offset,
- val, len);
- } else {
- u_short *ptr = addr;
-
- while (len > 0) {
- *ptr++ = val;
- --len;
- }
- }
-}
diff --git a/sys/arch/arm/footbridge/todclock.c b/sys/arch/arm/footbridge/todclock.c
deleted file mode 100644
index 63d3fe675e6..00000000000
--- a/sys/arch/arm/footbridge/todclock.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/* $OpenBSD: todclock.c,v 1.6 2006/05/26 20:34:01 miod Exp $ */
-/* $NetBSD: todclock.c,v 1.4 2002/10/02 05:02:30 thorpej Exp $ */
-
-/*
- * Copyright (c) 1994-1997 Mark Brinicombe.
- * Copyright (c) 1994 Brini.
- * All rights reserved.
- *
- * This code is derived from software written for Brini by Mark Brinicombe
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * RiscBSD kernel project
- *
- * clock.c
- *
- * Timer related machine specific code
- *
- * Created : 29/09/94
- */
-
-/* Include header files */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/time.h>
-#include <sys/device.h>
-
-#include <arm/footbridge/todclockvar.h>
-
-#include "todclock.h"
-
-#if NTODCLOCK > 1
-#error "Can only had 1 todclock device"
-#endif
-
-static int yeartoday (int);
-
-/*
- * softc structure for the todclock device
- */
-
-struct todclock_softc {
- struct device sc_dev; /* device node */
- void *sc_rtc_arg; /* arg to read/write */
- int (*sc_rtc_write) (void *, rtc_t *); /* rtc write function */
- int (*sc_rtc_read) (void *, rtc_t *); /* rtc read function */
-};
-
-/* prototypes for functions */
-
-static void todclockattach (struct device *parent, struct device *self,
- void *aux);
-static int todclockmatch (struct device *parent, void *cf, void *aux);
-
-/*
- * We need to remember our softc for functions like inittodr()
- * and resettodr()
- * since we only ever have one time-of-day device we can just store
- * the direct pointer to softc.
- */
-
-static struct todclock_softc *todclock_sc = NULL;
-
-/* driver and attach structures */
-
-struct cfattach todclock_ca = {
- sizeof(struct todclock_softc), todclockmatch, todclockattach
-};
-
-struct cfdriver todclock_cd = {
- NULL, "todclock", DV_DULL
-};
-
-
-/*
- * int todclockmatch(struct device *parent, struct cfdata *cf, void *aux)
- *
- * todclock device probe function.
- * just validate the attach args
- */
-
-int
-todclockmatch(parent, cf, aux)
- struct device *parent;
- void *cf;
- void *aux;
-{
- struct todclock_attach_args *ta = aux;
-
- if (todclock_sc != NULL)
- return(0);
- if (strcmp(ta->ta_name, "todclock") != 0)
- return(0);
-
- if (ta->ta_flags & TODCLOCK_FLAG_FAKE)
- return(1);
- return(2);
-}
-
-/*
- * void todclockattach(struct device *parent, struct device *self, void *aux)
- *
- * todclock device attach function.
- * Initialise the softc structure and do a search for children
- */
-
-void
-todclockattach(parent, self, aux)
- struct device *parent;
- struct device *self;
- void *aux;
-{
- struct todclock_softc *sc = (void *)self;
- struct todclock_attach_args *ta = aux;
-
- /* set up our softc */
- todclock_sc = sc;
- todclock_sc->sc_rtc_arg = ta->ta_rtc_arg;
- todclock_sc->sc_rtc_write = ta->ta_rtc_write;
- todclock_sc->sc_rtc_read = ta->ta_rtc_read;
-
- printf("\n");
-
- /*
- * Initialise the time of day register.
- * This is normally left to the filing system to do but not all
- * filing systems call it e.g. cd9660
- */
-
- inittodr(0);
-}
-
-static __inline int
-yeartoday(year)
- int year;
-{
- return((year % 4) ? 365 : 366);
-}
-
-
-static int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-static int timeset = 0;
-
-#define SECPERDAY (24*60*60)
-#define SECPERNYEAR (365*SECPERDAY)
-#define SECPER4YEARS (4*SECPERNYEAR+SECPERDAY)
-#define EPOCHYEAR 1970
-
-/*
- * Globally visible functions
- *
- * These functions are used from other parts of the kernel.
- * These functions use the functions defined in the tod_sc
- * to actually read and write the rtc.
- *
- * The first todclock to be attached will be used for handling
- * the time of day.
- */
-
-/*
- * Write back the time of day to the rtc
- */
-
-void
-resettodr()
-{
- int s;
- time_t year, mon, day, hour, min, sec;
- rtc_t rtc;
-
- /* Have we set the system time in inittodr() */
- if (!timeset)
- return;
-
- /* We need a todclock device and should always have one */
- if (!todclock_sc)
- return;
-
- /* Abort early if there is not actually an RTC write routine */
- if (todclock_sc->sc_rtc_write == NULL)
- return;
-
- sec = time.tv_sec;
- sec -= tz.tz_minuteswest * 60;
- if (tz.tz_dsttime)
- time.tv_sec += 3600;
- year = (sec / SECPER4YEARS) * 4;
- sec %= SECPER4YEARS;
-
- /* year now hold the number of years rounded down 4 */
-
- while (sec > (yeartoday(EPOCHYEAR+year) * SECPERDAY)) {
- sec -= yeartoday(EPOCHYEAR+year)*SECPERDAY;
- year++;
- }
-
- /* year is now a correct offset from the EPOCHYEAR */
-
- year+=EPOCHYEAR;
- mon=0;
- if (yeartoday(year) == 366)
- month[1]=29;
- else
- month[1]=28;
- while (sec >= month[mon]*SECPERDAY) {
- sec -= month[mon]*SECPERDAY;
- mon++;
- }
-
- day = sec / SECPERDAY;
- sec %= SECPERDAY;
- hour = sec / 3600;
- sec %= 3600;
- min = sec / 60;
- sec %= 60;
- rtc.rtc_cen = year / 100;
- rtc.rtc_year = year % 100;
- rtc.rtc_mon = mon+1;
- rtc.rtc_day = day+1;
- rtc.rtc_hour = hour;
- rtc.rtc_min = min;
- rtc.rtc_sec = sec;
- rtc.rtc_centi =
- rtc.rtc_micro = 0;
-
-#ifdef DEBUG
- printf("resettod: %02d/%02d/%02d%02d %02d:%02d:%02d\n", rtc.rtc_day,
- rtc.rtc_mon, rtc.rtc_cen, rtc.rtc_year, rtc.rtc_hour,
- rtc.rtc_min, rtc.rtc_sec);
-#endif
-
- s = splclock();
- todclock_sc->sc_rtc_write(todclock_sc->sc_rtc_arg, &rtc);
- (void)splx(s);
-}
-
-/*
- * Initialise the time of day register, based on the time base which is, e.g.
- * from a filesystem.
- */
-
-void
-inittodr(base)
- time_t base;
-{
- time_t n;
- int i, days = 0;
- int s;
- int year;
- rtc_t rtc;
-
- /*
- * Default to the suggested time but replace that we one from an
- * RTC is we can.
- */
-
- /* We expect a todclock device */
-
- /* Use the suggested time as a fall back */
- time.tv_sec = base;
- time.tv_usec = 0;
-
- /* Can we read an RTC ? */
- if (todclock_sc->sc_rtc_read) {
- s = splclock();
- if (todclock_sc->sc_rtc_read(todclock_sc->sc_rtc_arg, &rtc) == 0) {
- (void)splx(s);
- return;
- }
- (void)splx(s);
- } else
- return;
-
- /* Convert the rtc time into seconds */
-
- n = rtc.rtc_sec + 60 * rtc.rtc_min + 3600 * rtc.rtc_hour;
- n += (rtc.rtc_day - 1) * 3600 * 24;
- year = (rtc.rtc_year + rtc.rtc_cen * 100) - 1900;
-
- if (yeartoday(year) == 366)
- month[1] = 29;
- for (i = rtc.rtc_mon - 2; i >= 0; i--)
- days += month[i];
- month[1] = 28;
-
- for (i = 70; i < year; i++)
- days += yeartoday(i);
-
- n += days * 3600 * 24;
-
- n += tz.tz_minuteswest * 60;
- if (tz.tz_dsttime)
- time.tv_sec -= 3600;
-
- time.tv_sec = n;
- time.tv_usec = 0;
-
- /* timeset is used to ensure the time is valid before a resettodr() */
-
- timeset = 1;
-
- /* If the base was 0 then keep quiet */
-
- if (base) {
- if (n > base + 60) {
- days = (n - base) / SECPERDAY;
- printf("Clock has gained %d day%c %ld hours %ld minutes %ld secs\n",
- days, ((days == 1) ? 0 : 's'),
- (long)((n - base) / 3600) % 24,
- (long)((n - base) / 60) % 60,
- (long) (n - base) % 60);
- }
- }
-}
-
-/* End of todclock.c */
diff --git a/sys/arch/arm/footbridge/todclockvar.h b/sys/arch/arm/footbridge/todclockvar.h
deleted file mode 100644
index 45a5ee4c513..00000000000
--- a/sys/arch/arm/footbridge/todclockvar.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $OpenBSD: todclockvar.h,v 1.3 2006/05/26 20:34:01 miod Exp $ */
-/* $NetBSD: todclockvar.h,v 1.1 2002/02/10 12:26:00 chris Exp $ */
-
-/*
- * Copyright (c) 1997 Mark Brinicombe.
- * Copyright (c) 1997 Causality Limited
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * todclockvar.h
- *
- * structures and variables for the todclock device
- *
- * Created : 12/02/97
- */
-
-typedef struct {
- u_char rtc_micro;
- u_char rtc_centi;
- u_char rtc_sec;
- u_char rtc_min;
- u_char rtc_hour;
- u_char rtc_day;
- u_char rtc_mon;
- u_char rtc_year;
- u_char rtc_cen;
-} rtc_t;
-
-/*
- * Attach args for todclock device
- */
-
-struct todclock_attach_args {
- const char *ta_name; /* device name */
- void *ta_rtc_arg; /* arg to read/write */
- int (*ta_rtc_write) (void *, rtc_t *); /* function to write rtc */
- int (*ta_rtc_read) (void *, rtc_t *); /* function to read rtc */
- int ta_flags; /* flags */
-#define TODCLOCK_FLAG_FAKE 0x01 /* tod service is faked */
-};
-
-/* End of todclockvar.h */
diff --git a/sys/arch/cats/Makefile b/sys/arch/cats/Makefile
deleted file mode 100644
index 599f07863be..00000000000
--- a/sys/arch/cats/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# $OpenBSD: Makefile,v 1.4 2005/05/06 03:06:04 marco Exp $
-# $NetBSD: Makefile,v 1.1 2001/06/12 08:32:46 chris Exp $
-
-# Makefile for cats tags file and boot blocks
-
-S=${.CURDIR}/../..
-.include "$S/kern/Make.tags.inc"
-
-NOPROG= noprog
-NOMAN= noman
-
-TCATS= $S/arch/cats/tags
-SCATS= $S/arch/cats/cats/*.[ch] $S/arch/cats/include/*.h \
- $S/arch/cats/isa/*.[ch] $S/arch/cats/pci/*.[ch] \
- $S/arch/arm/arm/*.[ch] $S/arch/arm/footbridge/*.[ch] \
- $S/arch/arm/footbridge/isa/*.[ch]
-ACATS= $S/arch/arm/arm/*.S \
- $S/arch/arm/footbridge/isa/*.S
-
-# Directories in which to place tags links
-DCATS=cats conf include isa pci
-
-tags:
- -ctags -wdtf ${TCATS} ${SCATS} ${COMM}
- egrep "^ENTRY(.*)|^ALTENTRY(.*)" ${ACATS} | \
- sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
- >> ${TCATS}
- sort -o ${TCATS} ${TCATS}
-
-links:
- -for i in ${DCATS}; do \
- (cd $$i && { rm -f tags; ln -s ${TCATS} tags; }) done
-
-obj: _SUBDIRUSE
-
-.include <bsd.prog.mk>
diff --git a/sys/arch/cats/cats/autoconf.c b/sys/arch/cats/cats/autoconf.c
deleted file mode 100644
index eda554068bf..00000000000
--- a/sys/arch/cats/cats/autoconf.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* $OpenBSD: autoconf.c,v 1.12 2007/06/01 19:25:09 deraadt Exp $ */
-/* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */
-
-/*
- * Copyright (c) 1994-1998 Mark Brinicombe.
- * Copyright (c) 1994 Brini.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe for
- * the NetBSD project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * RiscBSD kernel project
- *
- * autoconf.c
- *
- * Autoconfiguration functions
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/reboot.h>
-#include <sys/disklabel.h>
-#include <sys/device.h>
-#include <sys/conf.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <machine/bootconfig.h>
-#include <machine/intr.h>
-
-#include <dev/cons.h>
-
-#include "isa.h"
-
-struct device *booted_device;
-int booted_partition;
-struct device *bootdv = NULL;
-extern char *boot_file;
-
-void isa_intr_init(void);
-
-/*
- * void cpu_configure()
- *
- * Configure all the root devices
- * The root devices are expected to configure their own children
- */
-void
-cpu_configure(void)
-{
- softintr_init();
-
- /*
- * Since various PCI interrupts could be routed via the ICU
- * (for PCI devices in the bridge) we need to set up the ICU
- * now so that these interrupts can be established correctly
- * i.e. This is a hack.
- */
- isa_intr_init();
-
- config_rootfound("mainbus", NULL);
-
- /*
- * We can not know which is our root disk, defer
- * until we can checksum blocks to figure it out.
- */
- cold = 0;
-
- /* Time to start taking interrupts so lets open the flood gates .... */
- (void)spl0();
-
-}
-
-/*
- * Now that we are fully operational, we can checksum the
- * disks, and using some heuristics, hopefully are able to
- * always determine the correct root disk.
- */
-void
-diskconf(void)
-{
-#if 0
- /*
- * Configure root, swap, and dump area. This is
- * currently done by running the same checksum
- * algorithm over all known disks, as was done in
- * /boot. Then we basically fixup the *dev vars
- * from the info we gleaned from this.
- */
- dkcsumattach();
-#endif
-
- printf("boot_file: '%s'\n", boot_file);
- setroot(bootdv, 0, RB_USERREQ);
- dumpconf();
-}
-
-struct nam2blk nam2blk[] = {
- { "wd", 16 },
- { "sd", 24 },
- { "cd", 26 },
- { "rd", 18 },
- { "raid", 71 },
- { NULL, -1 }
-};
diff --git a/sys/arch/cats/cats/cats_machdep.c b/sys/arch/cats/cats/cats_machdep.c
deleted file mode 100644
index a1a000279b0..00000000000
--- a/sys/arch/cats/cats/cats_machdep.c
+++ /dev/null
@@ -1,1046 +0,0 @@
-/* $OpenBSD: cats_machdep.c,v 1.16 2007/05/19 15:49:06 miod Exp $ */
-/* $NetBSD: cats_machdep.c,v 1.50 2003/10/04 14:28:28 chris Exp $ */
-
-/*
- * Copyright (c) 1997,1998 Mark Brinicombe.
- * Copyright (c) 1997,1998 Causality Limited.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Machine dependant functions for kernel setup for EBSA285 core architecture
- * using cyclone firmware
- *
- * Created : 24/11/97
- */
-
-#include <sys/cdefs.h>
-#include "isadma.h"
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/exec.h>
-#include <sys/proc.h>
-#include <sys/msgbuf.h>
-#include <sys/reboot.h>
-#include <sys/termios.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <dev/cons.h>
-
-#include <machine/db_machdep.h>
-#include <ddb/db_sym.h>
-#include <ddb/db_extern.h>
-
-#include <machine/bootconfig.h>
-#define _ARM32_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-#include <machine/cpu.h>
-#include <machine/frame.h>
-#include <machine/intr.h>
-#include <arm/kcore.h>
-#include <arm/undefined.h>
-#include <arm/machdep.h>
-
-#include <machine/cyclone_boot.h>
-#include <arm/footbridge/dc21285mem.h>
-#include <arm/footbridge/dc21285reg.h>
-
-#include "isa.h"
-#if NISA > 0
-#include <dev/isa/isareg.h>
-#include <dev/isa/isavar.h>
-#endif
-
-/* Kernel text starts at the base of the kernel address space. */
-#define KERNEL_TEXT_BASE (KERNEL_BASE + 0x00000000)
-#define KERNEL_VM_BASE (KERNEL_BASE + 0x01000000)
-
-/*
- * The range 0xf1000000 - 0xfcffffff is available for kernel VM space
- * Footbridge registers and I/O mappings occupy 0xfd000000 - 0xffffffff
- */
-
-/*
- * Size of available KVM space, note that growkernel will grow into this.
- */
-#define KERNEL_VM_SIZE 0x0C000000
-
-/*
- * Address to call from cpu_reset() to reset the machine.
- * This is machine architecture dependant as it varies depending
- * on where the ROM appears when you turn the MMU off.
- */
-
-u_int cpu_reset_address = DC21285_ROM_BASE;
-
-u_int dc21285_fclk = FCLK;
-
-/* Define various stack sizes in pages */
-#define IRQ_STACK_SIZE 1
-#define ABT_STACK_SIZE 1
-#ifdef IPKDB
-#define UND_STACK_SIZE 2
-#else
-#define UND_STACK_SIZE 1
-#endif
-
-struct ebsaboot ebsabootinfo;
-BootConfig bootconfig; /* Boot config storage */
-static char bootargs[MAX_BOOT_STRING + 1];
-char *boot_args = NULL;
-char *boot_file = NULL;
-
-paddr_t physical_start;
-paddr_t physical_freestart;
-paddr_t physical_freeend;
-paddr_t physical_end;
-u_int free_pages;
-int physmem = 0;
-
-/*int debug_flags;*/
-#ifndef PMAP_STATIC_L1S
-int max_processes = 64; /* Default number */
-#endif /* !PMAP_STATIC_L1S */
-
-/* Physical and virtual addresses for some global pages */
-pv_addr_t systempage;
-pv_addr_t irqstack;
-pv_addr_t undstack;
-pv_addr_t abtstack;
-extern pv_addr_t kernelstack;
-
-paddr_t msgbufphys;
-
-extern u_int data_abort_handler_address;
-extern u_int prefetch_abort_handler_address;
-extern u_int undefined_handler_address;
-
-#ifdef PMAP_DEBUG
-extern int pmap_debug_level;
-#endif
-
-#define KERNEL_PT_SYS 0 /* L2 table for mapping zero page */
-#define KERNEL_PT_KERNEL 1 /* L2 table for mapping kernel */
-#define KERNEL_PT_KERNEL_NUM 2
-
-/* now this could move into something more generic */
- /* L2 tables for mapping kernel VM */
-#define KERNEL_PT_VMDATA (KERNEL_PT_KERNEL + KERNEL_PT_KERNEL_NUM)
-#define KERNEL_PT_VMDATA_NUM 4 /* 16MB kernel VM !*/
-#define NUM_KERNEL_PTS (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM)
-
-pv_addr_t kernel_pt_table[NUM_KERNEL_PTS];
-
-extern struct user *proc0paddr;
-
-/* Prototypes */
-
-void consinit(void);
-
-int fcomcnattach(u_int iobase, int rate,tcflag_t cflag);
-int fcomcndetach(void);
-
-static void process_kernel_args(char *);
-extern void configure(void);
-
-/* A load of console goo. */
-#include "vga.h"
-#if (NVGA > 0)
-#include <dev/ic/mc6845reg.h>
-#include <dev/ic/pcdisplayvar.h>
-#include <dev/ic/vgareg.h>
-#include <dev/ic/vgavar.h>
-#endif
-
-#include "pckbc.h"
-#if (NPCKBC > 0)
-#include <dev/ic/i8042reg.h>
-#include <dev/ic/pckbcvar.h>
-#endif
-
-#include "com.h"
-#if (NCOM > 0)
-#include <dev/ic/comreg.h>
-#include <dev/ic/comvar.h>
-#ifndef CONCOMADDR
-#define CONCOMADDR 0x3f8
-#endif
-#endif
-
-#ifndef CONSDEVNAME
-#define CONSDEVNAME "vga"
-#endif
-
-#define CONSPEED B38400
-#ifndef CONSPEED
-#define CONSPEED B9600 /* TTYDEF_SPEED */
-#endif
-#ifndef CONMODE
-#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
-#endif
-
-int comcnspeed = CONSPEED;
-int comcnmode = CONMODE;
-
-
-/*
- * void cpu_reboot(int howto, char *bootstr)
- *
- * Reboots the system
- *
- * Deal with any syncing, unmounting, dumping and shutdown hooks,
- * then reset the CPU.
- */
-
-void
-boot(howto)
- int howto;
-{
-#ifdef DEBUG
- /* info */
- printf("boot: howto=%08x curproc=%p\n", howto, curproc);
-#endif
-
- /*
- * If we are still cold then hit the air brakes
- * and crash to earth fast
- */
- if (cold) {
- doshutdownhooks();
- /*
- * If the system is cold, just halt, unless the user
- * explicitly asked for reboot.
- */
- if ((howto & (RB_HALT | RB_USERREQ)) != RB_USERREQ) {
- printf("The operating system has halted.\n");
- printf("Please press any key to reboot.\n\n");
- cngetc();
- }
- printf("rebooting...\n");
- cpu_reset();
- /*NOTREACHED*/
- }
-
- /* Disable console buffering */
-/* cnpollc(1);*/
-
- /*
- * If RB_NOSYNC was not specified sync the discs.
- * Note: Unless cold is set to 1 here, syslogd will die during the unmount.
- * It looks like syslogd is getting woken up only to find that it cannot
- * page part of the binary in as the filesystem has been unmounted.
- */
- if (!(howto & RB_NOSYNC))
- bootsync(howto);
-
- /* Say NO to interrupts */
- splhigh();
-
- /* Do a dump if requested. */
- if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
- dumpsys();
-
- /* Run any shutdown hooks */
- doshutdownhooks();
-
- /* Make sure IRQ's are disabled */
- IRQdisable;
-
- if (howto & RB_HALT) {
- printf("The operating system has halted.\n");
- printf("Please press any key to reboot.\n\n");
- cngetc();
- }
-
- printf("rebooting...\n");
- cpu_reset();
- /*NOTREACHED*/
-}
-
-/*
- * Mapping table for core kernel memory. This memory is mapped at init
- * time with section mappings.
- */
-struct l1_sec_map {
- vaddr_t va;
- paddr_t pa;
- vsize_t size;
- vm_prot_t prot;
- int cache;
-} l1_sec_table[] = {
- /* Map 1MB for CSR space */
- { DC21285_ARMCSR_VBASE, DC21285_ARMCSR_BASE,
- DC21285_ARMCSR_VSIZE, VM_PROT_READ|VM_PROT_WRITE,
- PTE_NOCACHE },
-
- /* Map 1MB for fast cache cleaning space */
- { DC21285_CACHE_FLUSH_VBASE, DC21285_SA_CACHE_FLUSH_BASE,
- DC21285_CACHE_FLUSH_VSIZE, VM_PROT_READ|VM_PROT_WRITE,
- PTE_CACHE },
-
- /* Map 1MB for PCI IO space */
- { DC21285_PCI_IO_VBASE, DC21285_PCI_IO_BASE,
- DC21285_PCI_IO_VSIZE, VM_PROT_READ|VM_PROT_WRITE,
- PTE_NOCACHE },
-
- /* Map 1MB for PCI IACK space */
- { DC21285_PCI_IACK_VBASE, DC21285_PCI_IACK_SPECIAL,
- DC21285_PCI_IACK_VSIZE, VM_PROT_READ|VM_PROT_WRITE,
- PTE_NOCACHE },
-
- /* Map 16MB of type 1 PCI config access */
- { DC21285_PCI_TYPE_1_CONFIG_VBASE, DC21285_PCI_TYPE_1_CONFIG,
- DC21285_PCI_TYPE_1_CONFIG_VSIZE, VM_PROT_READ|VM_PROT_WRITE,
- PTE_NOCACHE },
-
- /* Map 16MB of type 0 PCI config access */
- { DC21285_PCI_TYPE_0_CONFIG_VBASE, DC21285_PCI_TYPE_0_CONFIG,
- DC21285_PCI_TYPE_0_CONFIG_VSIZE, VM_PROT_READ|VM_PROT_WRITE,
- PTE_NOCACHE },
-
- /* Map 1MB of 32 bit PCI address space for ISA MEM accesses via PCI */
- { DC21285_PCI_ISA_MEM_VBASE, DC21285_PCI_MEM_BASE,
- DC21285_PCI_ISA_MEM_VSIZE, VM_PROT_READ|VM_PROT_WRITE,
- PTE_NOCACHE },
-
- { 0, 0, 0, 0, 0 }
-};
-
-/*
- * u_int initarm(struct ebsaboot *bootinfo)
- *
- * Initial entry point on startup. This gets called before main() is
- * entered.
- * It should be responsible for setting up everything that must be
- * in place when main is called.
- * This includes
- * Taking a copy of the boot configuration structure.
- * Initialising the physical console so characters can be printed.
- * Setting up page tables for the kernel
- * Relocating the kernel to the bottom of physical memory
- */
-
-u_int
-initarm(bootargs)
- void *bootargs;
-{
- extern cpu_kcore_hdr_t cpu_kcore_hdr;
- struct ebsaboot *bootinfo = bootargs;
- int loop;
- int loop1;
- u_int l1pagetable;
- pv_addr_t kernel_l1pt;
- extern u_int cpu_get_control(void);
-
- /*
- * Heads up ... Setup the CPU / MMU / TLB functions
- */
- set_cpufuncs();
-
- /* Copy the boot configuration structure */
- ebsabootinfo = *bootinfo;
-
- if (ebsabootinfo.bt_fclk >= 50000000
- && ebsabootinfo.bt_fclk <= 66000000)
- dc21285_fclk = ebsabootinfo.bt_fclk;
-
- /* Fake bootconfig structure for the benefit of pmap.c */
- /* XXX must make the memory description h/w independant */
- bootconfig.dramblocks = 1;
- bootconfig.dram[0].address = ebsabootinfo.bt_memstart;
- bootconfig.dram[0].pages = (ebsabootinfo.bt_memend
- - ebsabootinfo.bt_memstart) / PAGE_SIZE;
-
- /*
- * Initialise the diagnostic serial console
- * This allows a means of generating output during initarm().
- * Once all the memory map changes are complete we can call consinit()
- * and not have to worry about things moving.
- */
-#ifdef FCOM_INIT_ARM
- fcomcnattach(DC21285_ARMCSR_BASE, comcnspeed, comcnmode);
-#endif
-
- /* Talk to the user */
- printf("OpenBSD/cats booting ...\n");
-
- if (ebsabootinfo.bt_magic != BT_MAGIC_NUMBER_EBSA
- && ebsabootinfo.bt_magic != BT_MAGIC_NUMBER_CATS)
- panic("Incompatible magic number passed in boot args");
-
-#ifdef DEBUG
- for (loop = 0; loop < 8; ++loop) {
- printf("%08x\n", *(((int *)bootinfo)+loop));
- }
-#endif
-
- /*
- * Ok we have the following memory map
- *
- * virtual address == physical address apart from the areas:
- * 0x00000000 -> 0x000fffff which is mapped to
- * top 1MB of physical memory
- * 0x00100000 -> 0x0fffffff which is mapped to
- * physical addresses 0x00100000 -> 0x0fffffff
- * 0x10000000 -> 0x1fffffff which is mapped to
- * physical addresses 0x00000000 -> 0x0fffffff
- * 0x20000000 -> 0xefffffff which is mapped to
- * physical addresses 0x20000000 -> 0xefffffff
- * 0xf0000000 -> 0xf03fffff which is mapped to
- * physical addresses 0x00000000 -> 0x003fffff
- *
- * This means that the kernel is mapped suitably for continuing
- * execution, all I/O is mapped 1:1 virtual to physical and
- * physical memory is accessible.
- *
- * The initarm() has the responsibility for creating the kernel
- * page tables.
- * It must also set up various memory pointers that are used
- * by pmap etc.
- */
-
- /*
- * Examine the boot args string for options we need to know about
- * now.
- */
- process_kernel_args((char *)ebsabootinfo.bt_args);
-
-#ifdef DEBUG
- printf("initarm: Configuring system ...\n");
-#endif
-
- /*
- * Set up the variables that define the availablilty of
- * physical memory
- */
- physical_start = ebsabootinfo.bt_memstart;
- physical_freestart = physical_start;
- physical_end = ebsabootinfo.bt_memend;
- physical_freeend = physical_end;
- free_pages = (physical_end - physical_start) / PAGE_SIZE;
-
- physmem = (physical_end - physical_start) / PAGE_SIZE;
-
-#ifdef DEBUG
- /* Tell the user about the memory */
- printf("physmemory: %d pages at 0x%08lx -> 0x%08lx\n", physmem,
- physical_start, physical_end - 1);
-#endif
-
- /*
- * Ok the kernel occupies the bottom of physical memory.
- * The first free page after the kernel can be found in
- * ebsabootinfo->bt_memavail
- * We now need to allocate some fixed page tables to get the kernel
- * going.
- * We allocate one page directory and a number page tables and store
- * the physical addresses in the kernel_pt_table array.
- *
- * Ok the next bit of physical allocation may look complex but it is
- * simple really. I have done it like this so that no memory gets
- * wasted during the allocation of various pages and tables that are
- * all different sizes.
- * The start addresses will be page aligned.
- * We allocate the kernel page directory on the first free 16KB boundry
- * we find.
- * We allocate the kernel page tables on the first 4KB boundry we find.
- * Since we allocate at least 3 L2 pagetables we know that we must
- * encounter at least one 16KB aligned address.
- */
-
-#ifdef VERBOSE_INIT_ARM
- printf("Allocating page tables");
-#endif
-
- /* Update the address of the first free page of physical memory */
- physical_freestart = ebsabootinfo.bt_memavail;
- free_pages -= (physical_freestart - physical_start) / PAGE_SIZE;
-
-#ifdef VERBOSE_INIT_ARM
- printf(" above %p\n", (void *)physical_freestart);
-#endif
- /* Define a macro to simplify memory allocation */
-#define valloc_pages(var, np) \
- alloc_pages((var).pv_pa, (np)); \
- (var).pv_va = KERNEL_BASE + (var).pv_pa - physical_start;
-
-#define alloc_pages(var, np) \
- (var) = physical_freestart; \
- physical_freestart += ((np) * PAGE_SIZE);\
- free_pages -= (np); \
- memset((char *)(var), 0, ((np) * PAGE_SIZE));
-
- loop1 = 0;
- kernel_l1pt.pv_pa = 0;
- for (loop = 0; loop <= NUM_KERNEL_PTS; ++loop) {
- /* Are we 16KB aligned for an L1 ? */
- if ((physical_freestart & (L1_TABLE_SIZE - 1)) == 0
- && kernel_l1pt.pv_pa == 0) {
- valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE);
- } else {
- valloc_pages(kernel_pt_table[loop1],
- L2_TABLE_SIZE / PAGE_SIZE);
- ++loop1;
- }
- }
-
-#ifdef DIAGNOSTIC
- /* This should never be able to happen but better confirm that. */
- if (!kernel_l1pt.pv_pa || (kernel_l1pt.pv_pa & (L1_TABLE_SIZE-1)) != 0)
- panic("initarm: Failed to align the kernel page directory");
-#endif
-
- /*
- * Allocate a page for the system page mapped to V0x00000000
- * This page will just contain the system vectors and can be
- * shared by all processes.
- */
- alloc_pages(systempage.pv_pa, 1);
-
- /* Allocate stacks for all modes */
- valloc_pages(irqstack, IRQ_STACK_SIZE);
- valloc_pages(abtstack, ABT_STACK_SIZE);
- valloc_pages(undstack, UND_STACK_SIZE);
- valloc_pages(kernelstack, UPAGES);
-
-#ifdef VERBOSE_INIT_ARM
- printf("IRQ stack: p0x%08lx v0x%08lx\n", irqstack.pv_pa, irqstack.pv_va);
- printf("ABT stack: p0x%08lx v0x%08lx\n", abtstack.pv_pa, abtstack.pv_va);
- printf("UND stack: p0x%08lx v0x%08lx\n", undstack.pv_pa, undstack.pv_va);
- printf("SVC stack: p0x%08lx v0x%08lx\n", kernelstack.pv_pa, kernelstack.pv_va);
-#endif
-
- alloc_pages(msgbufphys, round_page(MSGBUFSIZE) / PAGE_SIZE);
-
- /*
- * Ok we have allocated physical pages for the primary kernel
- * page tables
- */
-
-#ifdef VERBOSE_INIT_ARM
- printf("Creating L1 page table\n");
-#endif
-
- /*
- * Now we start construction of the L1 page table
- * We start by mapping the L2 page tables into the L1.
- * This means that we can replace L1 mappings later on if necessary
- */
- l1pagetable = kernel_l1pt.pv_pa;
-
- /* Map the L2 pages tables in the L1 page table */
- pmap_link_l2pt(l1pagetable, 0x00000000,
- &kernel_pt_table[KERNEL_PT_SYS]);
-
- for (loop = 0; loop < KERNEL_PT_KERNEL_NUM; loop++)
- pmap_link_l2pt(l1pagetable, KERNEL_BASE + loop * 0x00400000,
- &kernel_pt_table[KERNEL_PT_KERNEL + loop]);
-
- for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; ++loop)
- pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
- &kernel_pt_table[KERNEL_PT_VMDATA + loop]);
-
- /* update the top of the kernel VM */
- pmap_curmaxkvaddr =
- KERNEL_VM_BASE + (KERNEL_PT_VMDATA_NUM * 0x00400000);
-
-#ifdef VERBOSE_INIT_ARM
- printf("Mapping kernel\n");
-#endif
-
- /* Now we fill in the L2 pagetable for the kernel static code/data */
- {
- extern char etext[], _end[];
- size_t textsize = (u_int32_t) etext - KERNEL_BASE;
- size_t totalsize = (u_int32_t) _end - KERNEL_BASE;
- u_int logical;
-
- textsize = round_page(textsize);
- totalsize = round_page(totalsize);
-
- /* Update dump information */
- cpu_kcore_hdr.kernelbase = KERNEL_BASE;
- cpu_kcore_hdr.kerneloffs = 0;
- cpu_kcore_hdr.staticsize = totalsize;
-
- logical = pmap_map_chunk(l1pagetable, KERNEL_BASE,
- physical_start, textsize,
- VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-
- (void) pmap_map_chunk(l1pagetable, KERNEL_BASE + logical,
- physical_start + logical, totalsize - textsize,
- VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- }
-
- /*
- * PATCH PATCH ...
- *
- * Fixup the first word of the kernel to be the instruction
- * add pc, pc, #0x41000000
- *
- * This traps the case where the CPU core resets due to bus contention
- * on a prototype CATS system and will reboot into the firmware.
- */
- *((u_int *)KERNEL_TEXT_BASE) = 0xe28ff441;
-
-#ifdef VERBOSE_INIT_ARM
- printf("Constructing L2 page tables\n");
-#endif
-
- /* Map the boot arguments page */
- pmap_map_entry(l1pagetable, ebsabootinfo.bt_vargp,
- ebsabootinfo.bt_pargp, VM_PROT_READ, PTE_CACHE);
-
- /* Map the stack pages */
- pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
- IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- pmap_map_chunk(l1pagetable, abtstack.pv_va, abtstack.pv_pa,
- ABT_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- pmap_map_chunk(l1pagetable, undstack.pv_va, undstack.pv_pa,
- UND_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- pmap_map_chunk(l1pagetable, kernelstack.pv_va, kernelstack.pv_pa,
- UPAGES * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-
- pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa,
- L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
-
- for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) {
- pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va,
- kernel_pt_table[loop].pv_pa, L2_TABLE_SIZE,
- VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
- }
-
- /* Map the vector page. */
- pmap_map_entry(l1pagetable, vector_page, systempage.pv_pa,
- VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-
- /* Map the core memory needed before autoconfig */
- loop = 0;
- while (l1_sec_table[loop].size) {
- vsize_t sz;
-
-#ifdef VERBOSE_INIT_ARM
- printf("%08lx -> %08lx @ %08lx\n", l1_sec_table[loop].pa,
- l1_sec_table[loop].pa + l1_sec_table[loop].size - 1,
- l1_sec_table[loop].va);
-#endif
- for (sz = 0; sz < l1_sec_table[loop].size; sz += L1_S_SIZE)
- pmap_map_section(l1pagetable,
- l1_sec_table[loop].va + sz,
- l1_sec_table[loop].pa + sz,
- l1_sec_table[loop].prot,
- l1_sec_table[loop].cache);
- ++loop;
- }
-
- /*
- * Now we have the real page tables in place so we can switch to them.
- * Once this is done we will be running with the REAL kernel page tables.
- */
-#ifdef VERBOSE_INIT_ARM
- /* checking sttb address */
- printf("setttb address = %p\n", cpufuncs.cf_setttb);
-
- printf("kernel_l1pt=0x%08x old = 0x%08x, phys = 0x%08x\n",
- ((uint*)kernel_l1pt.pv_va)[0xf00],
- ((uint*)ebsabootinfo.bt_l1)[0xf00],
- ((uint*)kernel_l1pt.pv_pa)[0xf00]);
-
- printf("old pt @ %p, new pt @ %p\n", (uint*)kernel_l1pt.pv_pa, (uint*)ebsabootinfo.bt_l1);
-
- printf("Enabling System access\n");
-#endif
- /*
- * enable the system bit in the control register, otherwise we can't
- * access the kernel after the switch to the new L1 table
- * I suspect cyclone hid this problem, by enabling the ROM bit
- * Note can not have both SYST and ROM enabled together, the results
- * are "undefined"
- */
- cpu_control(CPU_CONTROL_SYST_ENABLE | CPU_CONTROL_ROM_ENABLE,
- CPU_CONTROL_SYST_ENABLE);
-#ifdef VERBOSE_INIT_ARM
- printf("switching domains\n");
-#endif
- /* be a client to all domains */
- cpu_domains(0x55555555);
- /* Switch tables */
-#ifdef VERBOSE_INIT_ARM
- printf("switching to new L1 page table\n");
-#endif
-
- /*
- * Ok the DC21285 CSR registers are about to be moved.
- * Detach the diagnostic serial port.
- */
-#ifdef FCOM_INIT_ARM
- fcomcndetach();
-#endif
-
- setttb(kernel_l1pt.pv_pa);
-
- cpu_tlb_flushID();
- cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2));
- /*
- * Moved from cpu_startup() as data_abort_handler() references
- * this during uvm init
- */
- proc0paddr = (struct user *)kernelstack.pv_va;
- proc0.p_addr = proc0paddr;
- /*
- * XXX this should only be done in main() but it useful to
- * have output earlier ...
- */
- consinit();
-
-#ifdef VERBOSE_INIT_ARM
- printf("bootstrap done.\n");
-#endif
-
- if (boothowto & RB_CONFIG) {
-#ifdef BOOT_CONFIG
- user_config();
-#else
- printf("kernel does not support -c; continuing..\n");
-#endif
- }
-
- arm32_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL);
-
- /*
- * Pages were allocated during the secondary bootstrap for the
- * stacks for different CPU modes.
- * We must now set the r13 registers in the different CPU modes to
- * point to these stacks.
- * Since the ARM stacks use STMFD etc. we must set r13 to the top end
- * of the stack memory.
- */
-#ifdef VERBOSE_INIT_ARM
- printf("init subsystems: stacks ");
-#endif
-
- set_stackptr(PSR_IRQ32_MODE,
- irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE);
- set_stackptr(PSR_ABT32_MODE,
- abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE);
- set_stackptr(PSR_UND32_MODE,
- undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE);
-
- /*
- * Well we should set a data abort handler.
- * Once things get going this will change as we will need a proper handler.
- * Until then we will use a handler that just panics but tells us
- * why.
- * Initialisation of the vectors will just panic on a data abort.
- * This just fills in a slightly better one.
- */
-#ifdef VERBOSE_INIT_ARM
- printf("vectors ");
-#endif
- data_abort_handler_address = (u_int)data_abort_handler;
- prefetch_abort_handler_address = (u_int)prefetch_abort_handler;
- undefined_handler_address = (u_int)undefinedinstruction_bounce;
-
- /* At last !
- * We now have the kernel in physical memory from the bottom upwards.
- * Kernel page tables are physically above this.
- * The kernel is mapped to KERNEL_TEXT_BASE
- * The kernel data PTs will handle the mapping of 0xf1000000-0xf3ffffff
- * The page tables are mapped to 0xefc00000
- */
-
- /* Initialise the undefined instruction handlers */
-#ifdef VERBOSE_INIT_ARM
- printf("undefined ");
-#endif
- undefined_init();
-
- /* Load memory into UVM. */
-#ifdef VERBOSE_INIT_ARM
- printf("page ");
-#endif
- uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */
-
- /* XXX Always one RAM block -- nuke the loop. */
- for (loop = 0; loop < bootconfig.dramblocks; loop++) {
- paddr_t start = (paddr_t)bootconfig.dram[loop].address;
- paddr_t end = start + (bootconfig.dram[loop].pages * PAGE_SIZE);
-#if NISADMA > 0
- paddr_t istart, isize;
- extern struct arm32_dma_range *footbridge_isa_dma_ranges;
- extern int footbridge_isa_dma_nranges;
-#endif
-
- if (start < physical_freestart)
- start = physical_freestart;
- if (end > physical_freeend)
- end = physical_freeend;
-
-#if 0
- printf("%d: %lx -> %lx\n", loop, start, end - 1);
-#endif
-
-#if NISADMA > 0
- if (arm32_dma_range_intersect(footbridge_isa_dma_ranges,
- footbridge_isa_dma_nranges,
- start, end - start,
- &istart, &isize)) {
- /*
- * Place the pages that intersect with the
- * ISA DMA range onto the ISA DMA free list.
- */
-#if 0
- printf(" ISADMA 0x%lx -> 0x%lx\n", istart,
- istart + isize - 1);
-#endif
- uvm_page_physload(atop(istart),
- atop(istart + isize), atop(istart),
- atop(istart + isize), VM_FREELIST_ISADMA);
-
- /*
- * Load the pieces that come before the
- * intersection onto the default free list.
- */
- if (start < istart) {
-#if 0
- printf(" BEFORE 0x%lx -> 0x%lx\n",
- start, istart - 1);
-#endif
- uvm_page_physload(atop(start),
- atop(istart), atop(start),
- atop(istart), VM_FREELIST_DEFAULT);
- }
-
- /*
- * Load the pieces that come after the
- * intersection onto the default free list.
- */
- if ((istart + isize) < end) {
-#if 0
- printf(" AFTER 0x%lx -> 0x%lx\n",
- (istart + isize), end - 1);
-#endif
- uvm_page_physload(atop(istart + isize),
- atop(end), atop(istart + isize),
- atop(end), VM_FREELIST_DEFAULT);
- }
- } else {
- uvm_page_physload(atop(start), atop(end),
- atop(start), atop(end), VM_FREELIST_DEFAULT);
- }
-#else /* NISADMA > 0 */
- uvm_page_physload(atop(start), atop(end),
- atop(start), atop(end), VM_FREELIST_DEFAULT);
-#endif /* NISADMA > 0 */
- }
-
- /* Boot strap pmap telling it where the kernel page table is */
-#ifdef VERBOSE_INIT_ARM
- printf("pmap ");
-#endif
- pmap_bootstrap((pd_entry_t *)kernel_l1pt.pv_va, KERNEL_VM_BASE,
- KERNEL_VM_BASE + KERNEL_VM_SIZE);
-
- /* Update dump information */
- cpu_kcore_hdr.pmap_kernel_l1 = (u_int32_t)pmap_kernel()->pm_l1;
- cpu_kcore_hdr.pmap_kernel_l2 = (u_int32_t)&(pmap_kernel()->pm_l2);
-
- /* Setup the IRQ system */
-#ifdef VERBOSE_INIT_ARM
- printf("irq ");
-#endif
- footbridge_intr_init();
-#ifdef VERBOSE_INIT_ARM
- printf("done.\n");
-#endif
-
-#ifdef IPKDB
- /* Initialise ipkdb */
- ipkdb_init();
- if (boothowto & RB_KDB)
- ipkdb_connect(0);
-#endif
-
-#if 0
-#if NKSYMS || defined(DDB) || defined(LKM)
-#ifdef __ELF__
- /* ok this is really rather sick, in ELF what happens is that the
- * ELF symbol table is added after the text section.
- */
- ksyms_init(0, NULL, NULL); /* XXX */
-#else
- {
- extern int end;
- extern int *esym;
-
- ksyms_init(*(int *)&end, ((int *)&end) + 1, esym);
- }
-#endif /* __ELF__ */
-#endif
-#endif
-
-#ifdef DDB
- db_machine_init();
- if (boothowto & RB_KDB)
- Debugger();
-#endif
-
- /* We return the new stack pointer address */
- return(kernelstack.pv_va + USPACE_SVC_STACK_TOP);
-}
-
-void
-board_startup(void)
-{
-}
-
-char *console = CONSDEVNAME;
-
-static void
-process_kernel_args(args)
- char *args;
-{
-
- boothowto = 0;
-
- /* Make a local copy of the bootargs */
- strncpy(bootargs, args, MAX_BOOT_STRING);
-
- args = bootargs;
- boot_file = bootargs;
-
- if (strncmp(args, "(hd0)", 5)== 0)
- boot_file = "wd0";
-
- /* Skip the kernel image filename, or 'setargs' */
- while (*args != ' ' && *args != 0)
- ++args;
- if (*args != 0)
- *args++ = 0;
-
-
- while (*args == ' ')
- ++args;
- boot_args = args;
-
- while (*args == '-') {
- while (*args && *args != ' ') {
- switch (*args++) {
- case 'a':
- boothowto |= RB_ASKNAME;
- break;
- case 's':
- boothowto |= RB_SINGLE;
- break;
- case 'd':
- boothowto |= RB_KDB;
- break;
- case 'c':
- boothowto |= RB_CONFIG;
- break;
- case 'v':
- console = "vga";
- break;
- case 'f':
- console = "fcom";
- break;
- default:
- break;
- }
- }
- while (*args == ' ')
- ++args;
- }
-
-#ifdef DEBUG
- /* XXX too early for console */
- printf("bootfile: %s\n", boot_file);
- printf("bootargs: %s\n", boot_args);
-#endif
-}
-
-extern struct bus_space footbridge_pci_io_bs_tag;
-extern struct bus_space footbridge_pci_mem_bs_tag;
-void footbridge_pci_bs_tag_init(void);
-
-void
-consinit(void)
-{
- static int consinit_called = 0;
-
- if (consinit_called != 0)
- return;
-
- consinit_called = 1;
-
-#if NISA > 0
- /* Initialise the ISA subsystem early ... */
- isa_footbridge_init(DC21285_PCI_IO_VBASE, DC21285_PCI_ISA_MEM_VBASE);
-#endif
-
- footbridge_pci_bs_tag_init();
-
- get_bootconf_option(boot_args, "console", BOOTOPT_TYPE_STRING,
- &console);
-
- if (strncmp(console, "fcom", 4) == 0
- || strncmp(console, "diag", 4) == 0) {
- fcomcnattach(DC21285_ARMCSR_VBASE, comcnspeed, comcnmode);
- }
-#if (NVGA > 0)
- else if (strncmp(console, "vga", 3) == 0) {
- if (0 == vga_cnattach(&footbridge_pci_io_bs_tag,
- &footbridge_pci_mem_bs_tag, - 1, 1)) {
-#if (NPCKBC > 0)
- pckbc_cnattach(&isa_io_bs_tag, IO_KBD, KBCMDP, PCKBC_KBD_SLOT);
-#endif /* NPCKBC */
- } else {
- /* fall back to serial if no video present */
- fcomcnattach(DC21285_ARMCSR_VBASE, comcnspeed,
- comcnmode);
- }
- }
-#endif /* NVGA */
-#if (NCOM > 0)
- else if (strncmp(console, "com", 3) == 0) {
- if (comcnattach(&isa_io_bs_tag, CONCOMADDR, comcnspeed,
- COM_FREQ, comcnmode))
- panic("can't init serial console @%x", CONCOMADDR);
- }
-#endif
- /* Don't know what console was requested so use the fall back. */
- else
- fcomcnattach(DC21285_ARMCSR_VBASE, comcnspeed, comcnmode);
-}
-
-/* End of ebsa285_machdep.c */
diff --git a/sys/arch/cats/compile/.cvsignore b/sys/arch/cats/compile/.cvsignore
deleted file mode 100644
index b72af3039e6..00000000000
--- a/sys/arch/cats/compile/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-GENERIC
-RAMDISK
diff --git a/sys/arch/cats/conf/GENERIC b/sys/arch/cats/conf/GENERIC
deleted file mode 100644
index c3bae9aa054..00000000000
--- a/sys/arch/cats/conf/GENERIC
+++ /dev/null
@@ -1,322 +0,0 @@
-# $OpenBSD: GENERIC,v 1.37 2007/05/31 23:18:25 uwe Exp $
-#
-# For further information on compiling OpenBSD kernels, see the config(8)
-# man page.
-#
-# For further information on hardware support for this architecture, see
-# the intro(4) man page. For further information about kernel options
-# for this architecture, see the options(4) man page. For an explanation
-# of each device driver in this file see the section 4 man page for the
-# device.
-
-machine cats arm
-include "../../../conf/GENERIC"
-maxusers 32 # estimated number of users
-
-options ARM32
-
-#options UCONSOLE # users can use TIOCCONS (for xconsole)
-#options INSECURE # disable kernel securelevel
-
-#options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT
-#options NTP # NTP phase/frequency locked loop
-
-option APERTURE # in-kernel aperture driver for XFree86
-option USER_PCICONF # user-space PCI configuration
-
-# CPU options
-
-# For StrongARM systems
-options CPU_SA110 # Support the SA110 core
-
-# FPA options
-
-#options ARMFPE # ARM Ltd FPE
-
-option WSDISPLAY_COMPAT_USL # VT handling
-option WSDISPLAY_COMPAT_RAWKBD # provide raw scancodes; needed for X11
-option WSDISPLAY_DEFAULTSCREENS=6 # initial number of text consoles
-option WSDISPLAY_COMPAT_PCVT # emulate some ioctls; needed for X11
-
-config bsd swap generic
-
-# The main bus device
-mainbus0 at root
-cpu0 at mainbus?
-footbridge0 at mainbus?
-
-fcom0 at footbridge? # footbridge uart
-#clock* at footbridge? # system clock via footbridge
-todclock0 at todservice? # time-of-day device
-
-pci0 at footbridge? # PCI bus
-pci* at ppb?
-
-option PCIVERBOSE
-option USBVERBOSE
-
-# PCI bridges
-ppb* at pci? # PCI-PCI bridges
-# XXX 'puc's aren't really bridges, but there's no better place for them here
-#puc* at pci? # PCI "universal" comm. cards
-
-# PCI serial interfaces
-#com* at puc? # 16x50s on "universal" comm boards
-#cy* at pci? # Cyclades Cyclom-Y serial boards
-
-# PCI parallel printer interfaces
-#lpt* at puc? # || ports on "universal" comm boards
-
-# PCI SCSI Controllers and Buses
-adv* at pci? # AdvanSys 1200[A,B], ULTRA SCSI
-scsibus* at adv?
-#adw* at pci? # AdvanSys 9xxUW SCSI
-#scsibus* at adw?
-ahc* at pci? # Adaptec [23]94x, aic78x0 SCSI controllers
-scsibus* at ahc?
-#bha* at pci? # BusLogic 9xx SCSI
-#scsibus* at bha?
-iha* at pci? # Initio INIC-940/950 SCSI
-scsibus* at iha?
-#isp* at pci? # Qlogic ISP 10x0 SCSI controllers
-#scsibus* at isp?
-pcscp* at pci? # AMD 53c974 PCscsi-PCI SCSI
-scsibus* at pcscp?
-siop* at pci? # NCR 53c8xx SCSI
-scsibus* at siop?
-
-# SCSI devices
-sd* at scsibus? # SCSI disk drives
-st* at scsibus? # SCSI tape drives
-cd* at scsibus? # SCSI CD-ROM drives
-ch* at scsibus? # SCSI auto-changers
-uk* at scsibus? # SCSI unknown device
-ss* at scsibus? # SCSI scanner
-safte* at scsibus? # SCSI accessed fault-tolerant enclosures
-ses* at scsibus? # SCSI enclosure services
-
-# PCI IDE Controllers and Devices
-# PCI IDE controllers - see pciide(4) for supported hardware.
-# The 0x0001 flag force the driver to use DMA, even if the driver doesn't know
-# how to set up DMA modes for this chip. This may work, or may cause
-# a machine hang with some controllers.
-pciide* at pci? flags 0x0000
-
-# IDE drives
-# Flags are used only with controllers that support DMA operations
-# and mode settings (e.g. some pciide controllers)
-# The lowest order four bits (rightmost digit) of the flags define the PIO
-# mode to use, the next set of four bits the DMA mode and the third set the
-# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode
-# to use, and the last bit must be 1 for this setting to be used.
-# For DMA and UDMA, 0xf (1111) means 'disable'.
-# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
-# (0xc=1100, 0xa=1010, 0xf=1111)
-# 0x0000 means "use whatever the drive claims to support".
-wd* at pciide? flags 0x0000 # the drives themselves
-
-# ATAPI bus support
-atapiscsi* at pciide?
-scsibus* at atapiscsi?
-
-# PCI network interfaces
-#en* at pci? # ENI/Adaptec ATM
-#ep* at pci? # 3C590 ethernet cards
-em* at pci? # Intel Pro/1000 ethernet
-fxp* at pci? # Intel EtherExpress PRO 10+/100B
-ne* at pci? # NE2000 compat ethernet
-#ntwoc* at pci? # Riscom/N2 PCI Sync Serial
-dc* at pci? # DECchip 21x4x and clones
-vr* at pci? # VIA Rhine Fast Ethernet
-xl* at pci? # 3C9xx ethernet
-#lmc* at pci? # Lan Media Corp SSI/HSSI/DS3
-
-# MII/PHY support
-acphy* at mii? # Altima AC101 PHYs
-amphy* at mii? # AMD 79C873 PHYs
-bmtphy* at mii? # Broadcom 10/100 PHYs
-exphy* at mii? # 3Com internal PHYs
-icsphy* at mii? # Integrated Circuit Systems ICS189x
-inphy* at mii? # Intel 82555 PHYs
-iophy* at mii? # Intel 82553 PHYs
-lxtphy* at mii? # Level One LXT-970 PHYs
-nsphy* at mii? # NS83840 PHYs
-nsphyter* at mii? # NS83843 PHYs
-qsphy* at mii? # Quality Semiconductor QS6612 PHYs
-eephy* at mii? # Marvell 88E1000 series PHY
-rlphy* at mii? # RealTek 8139 internal PHYs
-sqphy* at mii? # Seeq 80220/80221/80223 PHYs
-tlphy* at mii? # ThunderLAN PHYs
-tqphy* at mii? # TDK Semiconductor PHYs
-ukphy* at mii? # generic unknown PHYs
-urlphy* at mii? # Realtek RTL8150L internal PHY
-
-# USB Controller and Devices
-
-# PCI USB controllers
-ohci* at pci? # Open Host Controller
-
-# USB bus support
-usb* at ohci?
-
-# USB devices
-uhub* at usb? # USB Hubs
-uhub* at uhub? # USB Hubs
-umodem* at uhub? # USB Modems/Serial
-ucom* at umodem?
-uvisor* at uhub? # Handspring Visor
-ucom* at uvisor?
-uvscom* at uhub? # SUNTAC Slipper U VS-10U serial
-ucom* at uvscom?
-ubsa* at uhub? # Belkin serial adapter
-ucom* at ubsa?
-uftdi* at uhub? # FTDI FT8U100AX serial adapter
-ucom* at uftdi?
-uplcom* at uhub? # I/O DATA USB-RSAQ2 serial adapter
-ucom* at uplcom?
-umct* at uhub? # MCT USB-RS232 serial adapter
-ucom* at umct?
-uslcom* at uhub? # Silicon Laboratories CP210x serial
-ucom* at uslcom?
-uark* at uhub? # Arkmicro ARK3116 serial
-ucom* at uark?
-uipaq* at uhub? # iPAQ serial adapter
-ucom* at uipaq?
-uaudio* at uhub? # USB Audio
-audio* at uaudio?
-umidi* at uhub? # USB MIDI
-midi* at umidi?
-ulpt* at uhub? # USB Printers
-umass* at uhub? # USB Mass Storage devices
-scsibus* at umass?
-atapiscsi* at umass?
-uhidev* at uhub? # Human Interface Devices
-ums* at uhidev? # USB mouse
-wsmouse* at ums? mux 0
-ukbd* at uhidev? # USB keyboard
-wskbd* at ukbd? mux 1
-ucycom* at uhidev? # Cypress serial
-ucom* at ucycom?
-uhid* at uhidev? # USB generic HID support
-aue* at uhub? # ADMtek AN986 Pegasus Ethernet
-#atu* at uhub? # Atmel AT76c50x based 802.11b
-axe* at uhub? # ASIX Electronics AX88172 USB Ethernet
-cue* at uhub? # CATC USB-EL1201A based Ethernet
-cdce* at uhub? # CDC Ethernet
-kue* at uhub? # Kawasaki KL5KUSB101B based Ethernet
-udav* at uhub? # Davicom DM9601 based Ethernet
-upl* at uhub? # Prolific PL2301/PL2302 host-to-host `network'
-url* at uhub? # Realtek RTL8150L based adapters
-wi* at uhub? # WaveLAN IEEE 802.11DS
-urio* at uhub? # Diamond Multimedia Rio 500
-uscanner* at uhub? # USB Scanners
-usscanner* at uhub? # USB SCSI scanners, e.g., HP5300
-scsibus* at usscanner?
-#uyap* at uhub? # Y@P firmware loader
-udsbr* at uhub? # D-Link DSB-R100 radio
-radio* at udsbr? # USB radio
-ugen* at uhub? # USB Generic driver
-uow* at uhub? # Maxim/Dallas DS2490 1-Wire adapter
-onewire* at uow?
-
-# Bluetooth controllers
-#ubt* at uhub? # USB Bluetooth
-
-# Bluetooth bus support
-#bthub* at ubt?
-
-# Audio Devices
-
-# PCI audio devices
-#eap* at pci? # Ensoniq AudioPCI
-#sv* at pci? # S3 SonicVibes
-
-# Audio support
-#audio* at eap?
-#audio* at sv?
-
-vga* at pci?
-wsdisplay* at vga?
-
-# ISA bus bridging
-
-pcib* at pci? # PCI-ISA bridge
-isa* at pcib? # ISA bus
-
-# ISA Plug-and-Play bus support
-#isapnp0 at isa?
-
-# wscons
-pckbc0 at isa? # pc keyboard controller
-pckbd* at pckbc? # PC keyboard
-pms* at pckbc? # PS/2 mouse for wsmouse
-wskbd* at pckbd? mux 1
-wsmouse* at pms? mux 0
-
-pcppi0 at isa?
-
-# ISA Plug-and-Play serial interfaces
-#com* at isapnp? # Modems and serial boards
-
-# ISA Plug-and-Play network interfaces
-#ep* at isapnp? # 3Com 3c509 Ethernet
-
-# ISA serial interfaces
-com0 at isa? port 0x3f8 irq 4 # Standard PC serial ports
-com1 at isa? port 0x2f8 irq 3
-#com2 at isa? port 0x3e8 irq 9
-#com3 at isa? port 0x2e8 irq 10
-
-# ISA parallel printer interfaces
-lpt0 at isa? port 0x378 irq 7 # standard PC parallel ports
-lpt1 at isa? port 0x278 irq 5
-#lpt2 at isa? port 0x3bc
-
-# ISA floppy
-#fdc0 at isa? port 0x3f0 irq 6 drq 2 # standard PC floppy controllers
-#fdc1 at isa? port 0x370
-#fd* at fdc? # the drives themselves
-
-# ISA network interface
-#ne0 at isa? port 0x280 irq 9
-#ne1 at isa? port 0x300 irq 10
-ep* at isa?
-lc0 at isa? port 0x200 irq ?
-lc1 at isa? port 0x280 irq ?
-
-spkr0 at pcppi? # PC speaker
-
-ds1687rtc0 at isa? port 0x72 # Dallas RTC
-
-# ISA Plug-and-Play audio devices
-#ess* at isapnp? # ESS Tech ES1887, ES1888, ES888 audio
-#sb* at isapnp? # SoundBlaster-compatible audio
-#wss* at isapnp? # Windows Sound System
-
-# MPU 401 UARTs
-#mpu* at sb?
-
-# MIDI support
-midi* at pcppi? # MIDI interface to the PC speaker
-#midi* at mpu? # MPU 401
-#midi* at eap?
-
-# Joysticks
-
-# ISA Plug-and-Play joysticks
-#joy* at isapnp? # Game ports (usually on audio cards)
-
-# ISA joysticks. Probe is a little strange; add only if you have one.
-#joy0 at isa? port 0x201
-
-hifn* at pci? # Hi/fn 7751 crypto card
-
-# 1-Wire devices
-option ONEWIREVERBOSE
-owid* at onewire? # ID
-owsbm* at onewire? # Smart Battery Monitor
-owtemp* at onewire? # Temperature
-
-# Pseudo-Devices
-pseudo-device wsmux 2 # mouse & keyboard multiplexor
-pseudo-device crypto 1
diff --git a/sys/arch/cats/conf/Makefile.cats b/sys/arch/cats/conf/Makefile.cats
deleted file mode 100644
index 53eb6dca6f7..00000000000
--- a/sys/arch/cats/conf/Makefile.cats
+++ /dev/null
@@ -1,216 +0,0 @@
-# $OpenBSD: Makefile.cats,v 1.7 2007/07/30 16:23:33 thib Exp $
-# $OpenBSD: Makefile.cats,v 1.7 2007/07/30 16:23:33 thib Exp $
-# $NetBSD: Makefile.i386,v 1.67 1996/05/11 16:12:11 mycroft Exp $
-
-# Makefile for OpenBSD
-#
-# This makefile is constructed from a machine description:
-# config machineid
-# Most changes should be made in the machine description
-# /sys/arch/cats/conf/``machineid''
-# after which you should do
-# config machineid
-# Machine generic makefile changes should be made in
-# /sys/arch/cats/conf/Makefile.cats
-# after which config should be rerun for all machines of that type.
-#
-# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
-# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
-#
-# -DTRACE compile in kernel tracing hooks
-# -DQUOTA compile in file system quotas
-
-# DEBUG is set to -g if debugging.
-# PROF is set to -pg if profiling.
-
-.include <bsd.own.mk>
-
-MKDEP?= mkdep
-SIZE?= size
-STRIP?= strip
-
-# source tree is located via $S relative to the compilation directory
-.ifndef S
-S!= cd ../../../..; pwd
-.endif
-CATS= $S/arch/cats
-ARM= $S/arch/arm
-
-INCLUDES= -nostdinc -I. -I$S -I$S/arch
-CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -D__cats__
-CDIAGFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
- -Wno-uninitialized -Wno-format -Wno-main \
- -Wstack-larger-than-2047
-
-CMACHFLAGS= -ffreestanding
-#CMACHFLAGS= -march=armv4 -mtune=strongarm -ffreestanding
-.if ${IDENT:M-DNO_PROPOLICE}
-CMACHFLAGS+= -fno-stack-protector
-.endif
-CMACHFLAGS+= -msoft-float -fno-builtin-printf -fno-builtin-log
-
-COPTS?= -O2
-CFLAGS= ${DEBUG} ${CDIAGFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
-AFLAGS= -x assembler-with-cpp -D_LOCORE ${CMACHFLAGS}
-#LINKFLAGS= -Ttext 0xF0000020 -e start --warn-common
-#LINKFLAGS= -T ${CATS}/conf/kern.ldscript
-LINKFLAGS= -T ${CATS}/conf/ldscript.elf
-LINKFLAGS+= --warn-common
-STRIPFLAGS= -g -X -x
-
-HOSTCC= ${CC}
-HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
-HOSTED_CFLAGS= ${CFLAGS}
-
-### find out what to use for libkern
-.include "$S/lib/libkern/Makefile.inc"
-.ifndef PROF
-LIBKERN= ${KERNLIB}
-.else
-LIBKERN= ${KERNLIB_PROF}
-.endif
-
-### find out what to use for libcompat
-.include "$S/compat/common/Makefile.inc"
-.ifndef PROF
-LIBCOMPAT= ${COMPATLIB}
-.else
-LIBCOMPAT= ${COMPATLIB_PROF}
-.endif
-
-# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
-# where TYPE is NORMAL, DRIVER, or PROFILE; SUFFIX is the file suffix,
-# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
-# is marked as config-dependent.
-
-NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
-NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
-
-DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
-DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
-
-NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
-NORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
-
-HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
-
-%OBJS
-
-%CFILES
-
-%SFILES
-
-# load lines for config "xxx" will be emitted as:
-# xxx: ${SYSTEM_DEP} swapxxx.o
-# ${SYSTEM_LD_HEAD}
-# ${SYSTEM_LD} swapxxx.o
-# ${SYSTEM_LD_TAIL}
-SYSTEM_OBJ= locore.o \
- param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
-SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
-SYSTEM_LD_HEAD= rm -f $@
-SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
- ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
-SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
-
-DEBUG?=
-.if ${DEBUG} == "-g"
-LINKFLAGS+= -X
-SYSTEM_LD_TAIL+=; \
- echo mv $@ $@.gdb; rm -f $@.gdb; mv $@ $@.gdb; \
- echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
- ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
-.else
-LINKFLAGS+= -S -x
-.endif
-
-%LOAD
-
-assym.h: $S/kern/genassym.sh ${ARM}/arm/genassym.cf Makefile
- cat ${ARM}/arm/genassym.cf | \
- sh $S/kern/genassym.sh ${CC} ${CFLAGS} \
- ${CPPFLAGS} ${PARAM} > assym.h.tmp && \
- mv -f assym.h.tmp assym.h
-
-param.c: $S/conf/param.c
- rm -f param.c
- cp $S/conf/param.c .
-
-param.o: param.c Makefile
- ${NORMAL_C_C}
-
-ioconf.o: ioconf.c
- ${NORMAL_C}
-
-newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
- sh $S/conf/newvers.sh
- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-
-
-clean::
- rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \
- [Ee]rrs linterrs makelinks assym.h
-
-lint:
- @lint -hbxncez -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
- ${CFILES} ioconf.c param.c | \
- grep -v 'static function .* unused'
-
-tags:
- @echo "see $S/kern/Makefile for tags"
-
-links:
- egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
- sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
- echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
- sort -u | comm -23 - dontlink | \
- sed 's,.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
- sh makelinks && rm -f dontlink makelinks
-
-SRCS= ${ARM}/arm/locore.S \
- param.c ioconf.c ${CFILES} ${SFILES}
-depend:: .depend
-.depend: ${SRCS} assym.h param.c ${APMINC}
- ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${ARM}/arm/locore.S
- ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
- ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
- cat ${ARM}/arm/genassym.cf | \
- sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
- ${CPPFLAGS}
- @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
- @rm -f assym.dep
-
-
-# depend on root or device configuration
-autoconf.o conf.o: Makefile
-
-# depend on network or filesystem configuration
-uipc_domain.o uipc_proto.o vfs_conf.o: Makefile
-if.o if_tun.o if_loop.o if_ethersubr.o: Makefile
-if_arp.o if_ether.o: Makefile
-ip_input.o ip_output.o in_pcb.o in_proto.o: Makefile
-tcp_subr.o tcp_timer.o tcp_output.o: Makefile
-
-# depend on maxusers
-machdep.o: Makefile
-
-# depend on CPU configuration
-locore.o machdep.o: Makefile
-
-
-locore.o: ${ARM}/arm/locore.S assym.h
- ${NORMAL_S}
-
-# The install target can be redefined by putting a
-# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
-MACHINE_NAME!= uname -n
-install: install-kernel-${MACHINE_NAME}
-.if !target(install-kernel-${MACHINE_NAME}})
-install-kernel-${MACHINE_NAME}:
- rm -f /obsd
- ln /bsd /obsd
- cp bsd /nbsd
- mv /nbsd /bsd
-.endif
-
-%RULES
diff --git a/sys/arch/cats/conf/RAMDISK b/sys/arch/cats/conf/RAMDISK
deleted file mode 100644
index 36a9eb316e7..00000000000
--- a/sys/arch/cats/conf/RAMDISK
+++ /dev/null
@@ -1,237 +0,0 @@
-# $OpenBSD: RAMDISK,v 1.17 2006/02/12 19:55:39 miod Exp $
-
-machine cats arm
-
-# include "../../../conf/GENERIC"
-option TIMEZONE=0 # time zone to adjust RTC time by
-option DST=0 # daylight saving time used by RTC
-option FFS # UFS
-option NFSCLIENT # Network File System client
-option CD9660 # ISO 9660 + Rock Ridge file system
-option MSDOSFS # MS-DOS file system
-option INET # IP + ICMP + TCP + UDP
-option INET6 # IPv6 (needs INET)
-option DDB # kernel debugger
-option EXT2FS # Second Extended Filesystem
-option FIFO # FIFOs; RECOMMENDED
-
-options ARM32
-
-# estimated number of users
-
-maxusers 32
-
-# CPU options
-
-# For StrongARM systems
-options CPU_SA110 # Support the SA110 core
-
-# FPA options
-
-#options ARMFPE # ARM Ltd FPE
-
-config bsd root on rd0a swap on rd0b
-
-# The main bus device
-mainbus0 at root
-
-# The boot cpu
-cpu0 at mainbus?
-
-# Core logic
-footbridge0 at mainbus?
-
-# footbridge uart
-fcom0 at footbridge?
-
-# time-of-day device via footbridge or RTC
-todclock0 at todservice?
-
-# PCI bus support
-# PCI bus via footbridge
-pci0 at footbridge? # PCI bus
-
-pci* at ppb?
-
-option PCIVERBOSE
-option USBVERBOSE
-
-# PCI bridges
-ppb* at pci? # PCI-PCI bridges
-# XXX 'puc's aren't really bridges, but there's no better place for them here
-#puc* at pci? # PCI "universal" comm. cards
-
-# PCI serial interfaces
-#com* at puc? # 16x50s on "universal" comm boards
-#cy* at pci? # Cyclades Cyclom-Y serial boards
-
-# PCI parallel printer interfaces
-#lpt* at puc? # || ports on "universal" comm boards
-
-# PCI SCSI Controllers and Buses
-adv* at pci? # AdvanSys 1200[A,B], ULTRA SCSI
-scsibus* at adv?
-#adw* at pci? # AdvanSys 9xxUW SCSI
-#scsibus* at adw?
-ahc* at pci? # Adaptec [23]94x, aic78x0 SCSI controllers
-scsibus* at ahc?
-#bha* at pci? # BusLogic 9xx SCSI
-#scsibus* at bha?
-iha* at pci? # Initio INIC-940/950 SCSI
-scsibus* at iha?
-#isp* at pci? # Qlogic ISP 10x0 SCSI controllers
-#scsibus* at isp?
-pcscp* at pci? # AMD 53c974 PCscsi-PCI SCSI
-scsibus* at pcscp?
-siop* at pci? # NCR 53c8xx SCSI
-scsibus* at siop?
-
-# SCSI devices
-sd* at scsibus? # SCSI disk drives
-st* at scsibus? # SCSI tape drives
-cd* at scsibus? # SCSI CD-ROM drives
-#ch* at scsibus? # SCSI auto-changers
-#uk* at scsibus? # SCSI unknown device
-#ss* at scsibus? # SCSI scanner
-
-# PCI IDE Controllers and Devices
-# PCI IDE controllers - see pciide(4) for supported hardware.
-# The 0x0001 flag force the driver to use DMA, even if the driver doesn't know
-# how to set up DMA modes for this chip. This may work, or may cause
-# a machine hang with some controllers.
-pciide* at pci? flags 0x0000
-
-# IDE drives
-# Flags are used only with controllers that support DMA operations
-# and mode settings (e.g. some pciide controllers)
-# The lowest order four bits (rightmost digit) of the flags define the PIO
-# mode to use, the next set of four bits the DMA mode and the third set the
-# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode
-# to use, and the last bit must be 1 for this setting to be used.
-# For DMA and UDMA, 0xf (1111) means 'disable'.
-# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
-# (0xc=1100, 0xa=1010, 0xf=1111)
-# 0x0000 means "use whatever the drive claims to support".
-wd* at pciide? flags 0x0000 # the drives themselves
-
-# ATAPI bus support
-atapiscsi* at pciide?
-scsibus* at atapiscsi?
-
-# PCI network interfaces
-#en* at pci? # ENI/Adaptec ATM
-#ep* at pci? # 3C590 ethernet cards
-em* at pci? # Intel Pro/1000 ethernet
-fxp* at pci? # Intel EtherExpress PRO 10+/100B
-ne* at pci? # NE2000 compat ethernet
-#ntwoc* at pci? # Riscom/N2 PCI Sync Serial
-dc* at pci? # DECchip 21x4x and clones
-vr* at pci? # VIA Rhine Fast Ethernet
-xl* at pci? # 3C9xx ethernet
-#lmc* at pci? # Lan Media Corp SSI/HSSI/DS3
-
-# MII/PHY support
-exphy* at mii? # 3Com internal PHYs
-#icsphy* at mii? # Integrated Circuit Systems ICS189x
-inphy* at mii? # Intel 82555 PHYs
-#iophy* at mii? # Intel 82553 PHYs
-#lxtphy* at mii? # Level One LXT-970 PHYs
-nsphy* at mii? # NS83840 PHYs
-#nsphyter* at mii? # NS83843 PHYs
-qsphy* at mii? # Quality Semiconductor QS6612 PHYs
-#sqphy* at mii? # Seeq 80220/80221/80223 PHYs
-#tlphy* at mii? # ThunderLAN PHYs
-#tqphy* at mii? # TDK Semiconductor PHYs
-ukphy* at mii? # generic unknown PHYs
-
-# USB Controller and Devices
-
-# PCI USB controllers
-ohci* at pci? # Open Host Controller
-
-# USB bus support
-usb* at ohci?
-
-# USB Hubs
-uhub* at usb?
-uhub* at uhub?
-
-# USB HID device
-uhidev* at uhub?
-
-# USB Keyboards
-ukbd* at uhidev?
-wskbd* at ukbd? mux 1
-
-# USB Mass Storage
-umass* at uhub?
-atapiscsi* at umass?
-scsibus* at umass?
-atapiscsi* at umass?
-
-# USB Ethernet adapters
-aue* at uhub? # ADMtek AN986 Pegasus based adapters
-cue* at uhub? # CATC USB-EL1201A based adapters
-kue* at uhub? # Kawasaki LSI KL5KUSB101B based adapters
-
-vga* at pci?
-wsdisplay* at vga?
-
-# ISA bus bridging
-
-pcib* at pci? # PCI-ISA bridge
-isa* at pcib? # ISA bus
-
-# ISA Plug-and-Play bus support
-#isapnp0 at isa?
-
-# wscons
-pckbc0 at isa? # pc keyboard controller
-pckbd* at pckbc? # PC keyboard
-wskbd* at pckbd? mux 1
-
-#pcppi0 at isa?
-
-# ISA Plug-and-Play serial interfaces
-#com* at isapnp? # Modems and serial boards
-
-# ISA Plug-and-Play network interfaces
-#ep* at isapnp? # 3Com 3c509 Ethernet
-
-# ISA serial interfaces
-com0 at isa? port 0x3f8 irq 4 # Standard PC serial ports
-com1 at isa? port 0x2f8 irq 3
-#com2 at isa? port 0x3e8 irq 9
-#com3 at isa? port 0x2e8 irq 10
-
-# ISA floppy
-#fdc0 at isa? port 0x3f0 irq 6 drq 2 # standard PC floppy controllers
-#fdc1 at isa? port 0x370
-#fd* at fdc? # the drives themselves
-
-# ISA network interface
-#ne0 at isa? port 0x280 irq 9
-#ne1 at isa? port 0x300 irq 10
-#ep* at isa?
-lc0 at isa? port 0x200 irq ?
-lc1 at isa? port 0x280 irq ?
-
-# The spkr driver provides a simple tone interface to the built in speaker.
-#spkr0 at pcppi? # PC speaker
-
-ds1687rtc0 at isa? port 0x72 # Dallas RTC
-
-# Pseudo-Devices
-
-# mouse & keyboard multiplexor pseudo-devices
-pseudo-device wsmux 2
-#pseudo-device crypto 1
-pseudo-device loop 1 # network loopback
-pseudo-device bpfilter 1 # packet filter
-pseudo-device rd 1 # ram disk
-
-option BOOT_CONFIG # boot-time kernel config
-
-# RAMDISK stuff
-option MINIROOTSIZE=8192
-option RAMDISK_HOOKS
diff --git a/sys/arch/cats/conf/files.cats b/sys/arch/cats/conf/files.cats
deleted file mode 100644
index 091293ae6e2..00000000000
--- a/sys/arch/cats/conf/files.cats
+++ /dev/null
@@ -1,110 +0,0 @@
-# $OpenBSD: files.cats,v 1.7 2007/06/08 22:57:43 jasper Exp $
-# $NetBSD: files.cats,v 1.27 2003/10/21 08:15:40 skrll Exp $
-#
-# CATS-specific configuration info
-#
-
-maxpartitions 16
-maxusers 2 8 64
-
-define todservice {}
-
-#
-# ISA and mixed ISA+EISA or ISA+PCI drivers
-#
-include "dev/isa/files.isa"
-include "dev/isa/files.isapnp"
-
-# Include arm32 footbridge
-include "arch/arm/conf/files.footbridge"
-
-#
-# Machine-independent ATA drivers
-#
-include "dev/ata/files.ata"
-major {wd = 16}
-
-#
-# time of day clock
-#
-device todclock
-attach todclock at todservice
-file arch/arm/footbridge/todclock.c todclock needs-count
-
-# ISA DMA glue
-file arch/arm/footbridge/isa/isadma_machdep.c isadma
-
-# Game adapter (joystick)
-file arch/arm/footbridge/isa/joy_timer.c joy
-
-major {rd = 18}
-
-# RAIDframe
-major {raid = 71}
-
-#
-# Machine-independent SCSI/ATAPI drivers
-#
-
-include "../../../scsi/files.scsi"
-include "../../../dev/atapiscsi/files.atapiscsi"
-major {sd = 24}
-major {cd = 26}
-
-file arch/arm/arm/conf.c
-
-# Generic MD files
-file arch/cats/cats/autoconf.c
-file arch/cats/cats/cats_machdep.c
-
-# library functions
-
-file arch/arm/arm/disksubr.c disk
-
-# ISA Plug 'n Play autoconfiguration glue.
-file arch/arm/footbridge/isa/isapnp_machdep.c isapnp
-
-# ISA support.
-file arch/arm/footbridge/isa/isa_io.c isa
-file arch/arm/footbridge/isa/isa_io_asm.S isa
-
-# CATS boards have an EBSA285 based core with an ISA bus
-file arch/arm/footbridge/isa/isa_machdep.c isa
-
-device ds1687rtc: todservice
-attach ds1687rtc at isa
-file arch/arm/footbridge/isa/dsrtc.c ds1687rtc
-
-# Machine-independent I2O drivers.
-include "dev/i2o/files.i2o"
-
-# PCI devices
-
-#
-# Include PCI config
-#
-include "dev/mii/files.mii"
-include "dev/pci/files.pci"
-
-device pcib: isabus
-attach pcib at pci
-file arch/cats/pci/pcib.c pcib
-
-file arch/cats/pci/pciide_machdep.c pciide
-
-# Include USB stuff
-include "dev/usb/files.usb"
-
-# Bluetooth
-include "dev/bluetooth/files.bluetooth"
-
-# Include WSCONS stuff
-include "dev/wscons/files.wscons"
-include "dev/rasops/files.rasops"
-include "dev/wsfont/files.wsfont"
-include "dev/pckbc/files.pckbc"
-
-#
-# Machine-independent 1-Wire drivers
-#
-include "dev/onewire/files.onewire"
diff --git a/sys/arch/cats/conf/ldscript.elf b/sys/arch/cats/conf/ldscript.elf
deleted file mode 100644
index 26b2ab2dbaf..00000000000
--- a/sys/arch/cats/conf/ldscript.elf
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $OpenBSD: ldscript.elf,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: ldscript.evbarm,v 1.3 2003/05/23 00:57:27 ichiro Exp $ */
-
-OUTPUT_ARCH(arm)
-ENTRY(KERNEL_BASE_phys)
-SECTIONS
-{
- KERNEL_BASE_phys = 0xF0000000;
- KERNEL_BASE_virt = 0xF0000000;
-
- /* Kernel start: */
- .start (KERNEL_BASE_phys) :
- {
- *(.start)
- } =0
-
- /* Read-only sections, merged into text segment: */
- .text (KERNEL_BASE_virt + SIZEOF(.start)) :
- AT (LOADADDR(.start) + SIZEOF(.start))
- {
- *(.text)
- *(.text.*)
- *(.stub)
- *(.glue_7t) *(.glue_7)
- *(.rodata) *(.rodata.*)
- } =0
- PROVIDE (__etext = .);
- PROVIDE (_etext = .);
- PROVIDE (etext = .);
- /* Adjust the address for the data segment to start on the next page
- boundary. */
- . = ALIGN(0x8000);
- .data :
- AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
- {
- __data_start = . ;
- *(.data)
- *(.data.*)
- }
- .sdata :
- AT (LOADADDR(.data) + (ADDR(.sdata) - ADDR(.data)))
- {
- *(.sdata)
- *(.sdata.*)
- }
- _edata = .;
- PROVIDE (edata = .);
- __bss_start = .;
- __bss_start__ = .;
- .sbss :
- {
- PROVIDE (__sbss_start = .);
- PROVIDE (___sbss_start = .);
- *(.dynsbss)
- *(.sbss)
- *(.sbss.*)
- *(.scommon)
- PROVIDE (__sbss_end = .);
- PROVIDE (___sbss_end = .);
- }
- .bss :
- {
- *(.dynbss)
- *(.bss)
- *(.bss.*)
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections. */
- . = ALIGN(32 / 8);
- }
- . = ALIGN(32 / 8);
- _end = .;
- _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
- PROVIDE (end = .);
-}
diff --git a/sys/arch/cats/include/_types.h b/sys/arch/cats/include/_types.h
deleted file mode 100644
index 80cabc3e2d5..00000000000
--- a/sys/arch/cats/include/_types.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* $OpenBSD: _types.h,v 1.3 2007/05/15 15:23:35 art Exp $ */
-
-/* public domain */
-
-#ifndef _CATS__TYPES_H_
-#define _CATS__TYPES_H_
-
-#include <arm/_types.h>
-
-#define __HAVE_GENERIC_SOFT_INTERRUPTS
-
-#endif /* _CATS__TYPES */
diff --git a/sys/arch/cats/include/asm.h b/sys/arch/cats/include/asm.h
deleted file mode 100644
index e730a1e3998..00000000000
--- a/sys/arch/cats/include/asm.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: asm.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: asm.h,v 1.3 2001/11/25 15:55:54 thorpej Exp $ */
-
-#include <arm/asm.h>
diff --git a/sys/arch/cats/include/atomic.h b/sys/arch/cats/include/atomic.h
deleted file mode 100644
index d8f88699072..00000000000
--- a/sys/arch/cats/include/atomic.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $OpenBSD: atomic.h,v 1.4 2007/02/19 17:18:42 deraadt Exp $ */
-
-/* Public Domain */
-
-#ifndef __CATS_ATOMIC_H__
-#define __CATS_ATOMIC_H__
-
-#include <arm/atomic.h>
-
-#endif /* __CATS_ATOMIC_H__ */
diff --git a/sys/arch/cats/include/bootconfig.h b/sys/arch/cats/include/bootconfig.h
deleted file mode 100644
index 1940f83d5e9..00000000000
--- a/sys/arch/cats/include/bootconfig.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $OpenBSD: bootconfig.h,v 1.2 2004/05/19 04:11:31 drahn Exp $ */
-/* $NetBSD: bootconfig.h,v 1.2 2001/06/21 22:08:28 chris Exp $ */
-
-/*
- * Copyright (c) 1994 Mark Brinicombe.
- * Copyright (c) 1994 Brini.
- * All rights reserved.
- *
- * This code is derived from software written for Brini by Mark Brinicombe
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * boot configuration structures
- *
- * Created : 12/09/94
- *
- * Based on kate/boot/bootconfig.h
- */
-
-typedef struct _PhysMem {
- u_int address;
- u_int pages;
-} PhysMem;
-
-#if defined(_KERNEL)
-
-#define DRAM_BLOCKS 1
-
-typedef struct _BootConfig {
- PhysMem dram[DRAM_BLOCKS];
- u_int dramblocks;
-} BootConfig;
-
-extern BootConfig bootconfig;
-#define MAX_BOOT_STRING 255
-
-#define BOOTOPT_TYPE_BOOLEAN 0
-#define BOOTOPT_TYPE_STRING 1
-#define BOOTOPT_TYPE_INT 2
-#define BOOTOPT_TYPE_BININT 3
-#define BOOTOPT_TYPE_HEXINT 4
-#define BOOTOPT_TYPE_MASK 7
-
-int get_bootconf_option (char *string, char *option, int type, void *result);
-
-extern char *boot_args;
-extern char *boot_file;
-#endif /* _KERNEL */
-
-/* End of bootconfig.h */
diff --git a/sys/arch/cats/include/bus.h b/sys/arch/cats/include/bus.h
deleted file mode 100644
index f0cdace92b6..00000000000
--- a/sys/arch/cats/include/bus.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: bus.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: bus.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */
-
-#include <arm/bus.h>
diff --git a/sys/arch/cats/include/cdefs.h b/sys/arch/cats/include/cdefs.h
deleted file mode 100644
index ec0b6021cd7..00000000000
--- a/sys/arch/cats/include/cdefs.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $OpenBSD: cdefs.h,v 1.2 2005/11/24 20:46:44 deraadt Exp $ */
-
-#include <arm/cdefs.h>
diff --git a/sys/arch/cats/include/conf.h b/sys/arch/cats/include/conf.h
deleted file mode 100644
index 54010b008cc..00000000000
--- a/sys/arch/cats/include/conf.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* $OpenBSD: conf.h,v 1.3 2005/05/13 22:54:00 miod Exp $ */
-/* $NetBSD: conf.h,v 1.8 2002/02/10 12:26:03 chris Exp $ */
-
-#ifndef _CATS_CONF_H
-#define _CATS_CONF_H
-
-/*
- * CATS specific device includes go in here
- */
-#define CONF_HAVE_PCI
-#define CONF_HAVE_USB
-#define CONF_HAVE_SCSIPI
-#define CONF_HAVE_WSCONS
-#define CONF_HAVE_FCOM
-#define CONF_HAVE_SPKR
-
-#include <arm/conf.h>
-
-#endif /* _CATS_CONF_H */
diff --git a/sys/arch/cats/include/cpu.h b/sys/arch/cats/include/cpu.h
deleted file mode 100644
index 1997a1569d0..00000000000
--- a/sys/arch/cats/include/cpu.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: cpu.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: cpu.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */
-
-#include <arm/cpu.h>
diff --git a/sys/arch/cats/include/cyclone_boot.h b/sys/arch/cats/include/cyclone_boot.h
deleted file mode 100644
index edf06464f0f..00000000000
--- a/sys/arch/cats/include/cyclone_boot.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* $OpenBSD: cyclone_boot.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: cyclone_boot.h,v 1.1 2001/06/20 22:14:34 chris Exp $ */
-
-/*
- * Copyright (c) 1997,1998 Mark Brinicombe.
- * Copyright (c) 1997,1998 Causality Limited.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Define the boot structure that is passed to the kernel
- * from the cyclone firmware.
- *
- * The bootloader reserves a page for boot argument info.
- * This page will contain the ebsaboot structure and the
- * kernel argument string.
- */
-
-struct ebsaboot {
- u_int32_t bt_magic; /* boot info magic number */
- u_int32_t bt_vargp; /* virtual addr of arg page */
- u_int32_t bt_pargp; /* physical addr of arg page */
- const char * bt_args; /* kernel args string pointer */
- pd_entry_t * bt_l1; /* active L1 page table */
- u_int32_t bt_memstart; /* start of physical memory */
- u_int32_t bt_memend; /* end of physical memory */
- u_int32_t bt_memavail; /* start of avail phys memory */
- u_int32_t bt_fclk; /* fclk frequency */
- u_int32_t bt_pciclk; /* PCI bus frequency */
- u_int32_t bt_vers; /* structure version (CATS) */
- u_int32_t bt_features; /* feature mask (CATS) */
-};
-
-#define BT_MAGIC_NUMBER_EBSA 0x45425341
-#define BT_MAGIC_NUMBER_CATS 0x43415453
-
-#define BT_BOOT_VERSION_OLD 0
-#define BT_BOOT_VERSION_NEW 1
-
-/* End of cyclone_boot.h */
diff --git a/sys/arch/cats/include/db_machdep.h b/sys/arch/cats/include/db_machdep.h
deleted file mode 100644
index 75cc8636737..00000000000
--- a/sys/arch/cats/include/db_machdep.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: db_machdep.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: db_machdep.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */
-
-#include <arm/db_machdep.h>
diff --git a/sys/arch/cats/include/disklabel.h b/sys/arch/cats/include/disklabel.h
deleted file mode 100644
index e7f8b010c8e..00000000000
--- a/sys/arch/cats/include/disklabel.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $OpenBSD: disklabel.h,v 1.2 2007/06/17 00:27:27 deraadt Exp $ */
-
-#include <arm/disklabel.h>
diff --git a/sys/arch/cats/include/elf_abi.h b/sys/arch/cats/include/elf_abi.h
deleted file mode 100644
index 80acd57afe1..00000000000
--- a/sys/arch/cats/include/elf_abi.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $OpenBSD: elf_abi.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-
-#include <arm/elf_abi.h>
diff --git a/sys/arch/cats/include/endian.h b/sys/arch/cats/include/endian.h
deleted file mode 100644
index b39fda184d3..00000000000
--- a/sys/arch/cats/include/endian.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: endian.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: endian.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
-
-#include <arm/endian.h>
diff --git a/sys/arch/cats/include/exec.h b/sys/arch/cats/include/exec.h
deleted file mode 100644
index 7726fe108cd..00000000000
--- a/sys/arch/cats/include/exec.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $OpenBSD: exec.h,v 1.4 2006/10/02 17:45:33 miod Exp $ */
-/* public domain */
-#include <arm/exec.h>
diff --git a/sys/arch/cats/include/float.h b/sys/arch/cats/include/float.h
deleted file mode 100644
index c48d6fb3732..00000000000
--- a/sys/arch/cats/include/float.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: float.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: float.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
-
-#include <arm/float.h>
diff --git a/sys/arch/cats/include/fp.h b/sys/arch/cats/include/fp.h
deleted file mode 100644
index 52072045e73..00000000000
--- a/sys/arch/cats/include/fp.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: fp.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: fp.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
-
-#include <arm/fp.h>
diff --git a/sys/arch/cats/include/frame.h b/sys/arch/cats/include/frame.h
deleted file mode 100644
index 9d8216149fb..00000000000
--- a/sys/arch/cats/include/frame.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: frame.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: frame.h,v 1.1 2001/06/08 22:23:00 chris Exp $ */
-
-#include <arm/frame.h>
diff --git a/sys/arch/cats/include/ieee.h b/sys/arch/cats/include/ieee.h
deleted file mode 100644
index 8536ad855bc..00000000000
--- a/sys/arch/cats/include/ieee.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: ieee.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: ieee.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
-
-#include <arm/ieee.h>
diff --git a/sys/arch/cats/include/ieeefp.h b/sys/arch/cats/include/ieeefp.h
deleted file mode 100644
index f4367fb3104..00000000000
--- a/sys/arch/cats/include/ieeefp.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: ieeefp.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: ieeefp.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
-
-#include <arm/ieeefp.h>
diff --git a/sys/arch/cats/include/internal_types.h b/sys/arch/cats/include/internal_types.h
deleted file mode 100644
index c13787132f0..00000000000
--- a/sys/arch/cats/include/internal_types.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $OpenBSD: internal_types.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* Public domain */
-#ifndef _MACHINE_INTERNAL_TYPES_H_
-#define _MACHINE_INTERNAL_TYPES_H_
-
-#include "arm/internal_types.h"
-#endif
diff --git a/sys/arch/cats/include/intr.h b/sys/arch/cats/include/intr.h
deleted file mode 100644
index 5110f79f21a..00000000000
--- a/sys/arch/cats/include/intr.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: intr.h,v 1.2 2007/05/15 05:26:44 miod Exp $ */
-/* $NetBSD: intr.h,v 1.4 2002/09/28 15:44:29 chris Exp $ */
-
-#include <arm/footbridge/footbridge_intr.h>
diff --git a/sys/arch/cats/include/irqhandler.h b/sys/arch/cats/include/irqhandler.h
deleted file mode 100644
index 4805cf98e45..00000000000
--- a/sys/arch/cats/include/irqhandler.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: irqhandler.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: irqhandler.h,v 1.4 2002/04/12 18:50:32 thorpej Exp $ */
-
-#include <arm/footbridge/footbridge_irqhandler.h>
diff --git a/sys/arch/cats/include/isa_machdep.h b/sys/arch/cats/include/isa_machdep.h
deleted file mode 100644
index 7ff5dd94990..00000000000
--- a/sys/arch/cats/include/isa_machdep.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $OpenBSD: isa_machdep.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: isa_machdep.h,v 1.4 2002/01/07 22:58:08 chris Exp $ */
-
-#ifndef _CATS_ISA_MACHDEP_H_
-#define _CATS_ISA_MACHDEP_H_
-#include <arm/isa_machdep.h>
-
-#ifdef _KERNEL
-#define ISA_FOOTBRIDGE_IRQ IRQ_IN_L2
-void isa_footbridge_init(u_int, u_int);
-#endif /* _KERNEL */
-
-#endif /* _CATS_ISA_MACHDEP_H_ */
diff --git a/sys/arch/cats/include/limits.h b/sys/arch/cats/include/limits.h
deleted file mode 100644
index f6fd82683af..00000000000
--- a/sys/arch/cats/include/limits.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: limits.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: limits.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
-
-#include <arm/limits.h>
diff --git a/sys/arch/cats/include/lock.h b/sys/arch/cats/include/lock.h
deleted file mode 100644
index ba2a06187db..00000000000
--- a/sys/arch/cats/include/lock.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: lock.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: lock.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
-
-#include <arm/lock.h>
diff --git a/sys/arch/cats/include/mutex.h b/sys/arch/cats/include/mutex.h
deleted file mode 100644
index 03d7fd1ffd0..00000000000
--- a/sys/arch/cats/include/mutex.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $OpenBSD: mutex.h,v 1.1 2007/05/15 05:26:44 miod Exp $ */
-/* public domain */
-#include <arm/footbridge/footbridge_mutex.h>
diff --git a/sys/arch/cats/include/param.h b/sys/arch/cats/include/param.h
deleted file mode 100644
index 0d1335d2efd..00000000000
--- a/sys/arch/cats/include/param.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $OpenBSD: param.h,v 1.2 2004/02/06 17:30:38 drahn Exp $ */
-/* $NetBSD: param.h,v 1.4 2002/02/12 06:58:19 thorpej Exp $ */
-
-/*
- * Copyright (c) 1994,1995 Mark Brinicombe.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the RiscBSD team.
- * 4. The name "RiscBSD" nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _CATS_PARAM_H_
-#define _CATS_PARAM_H_
-
-/*
- * cats boot dmesg is bigger than 4k
- */
-#ifndef MSGBUFSIZE
-#define MSGBUFSIZE (2*NBPG)
-#endif
-
-#include <arm/param.h>
-
-#define _MACHINE cats
-#define MACHINE "cats"
-
-#endif /* _CATS_PARAM_H_ */
diff --git a/sys/arch/cats/include/pcb.h b/sys/arch/cats/include/pcb.h
deleted file mode 100644
index f99d13969d8..00000000000
--- a/sys/arch/cats/include/pcb.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: pcb.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: pcb.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
-
-#include <arm/pcb.h>
diff --git a/sys/arch/cats/include/pio.h b/sys/arch/cats/include/pio.h
deleted file mode 100644
index 045c59ff6c3..00000000000
--- a/sys/arch/cats/include/pio.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: pio.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: pio.h,v 1.3 2001/12/07 23:09:33 chris Exp $ */
-
-#include <arm/pio.h>
diff --git a/sys/arch/cats/include/pmap.h b/sys/arch/cats/include/pmap.h
deleted file mode 100644
index aa1f8123abc..00000000000
--- a/sys/arch/cats/include/pmap.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: pmap.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: pmap.h,v 1.2 2001/11/23 17:29:01 thorpej Exp $ */
-
-#include <arm/pmap.h>
diff --git a/sys/arch/cats/include/proc.h b/sys/arch/cats/include/proc.h
deleted file mode 100644
index 7bda86370d2..00000000000
--- a/sys/arch/cats/include/proc.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: proc.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: proc.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
-
-#include <arm/proc.h>
diff --git a/sys/arch/cats/include/profile.h b/sys/arch/cats/include/profile.h
deleted file mode 100644
index c9c50fbe848..00000000000
--- a/sys/arch/cats/include/profile.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: profile.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: profile.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
-
-#include <arm/profile.h>
diff --git a/sys/arch/cats/include/psl.h b/sys/arch/cats/include/psl.h
deleted file mode 100644
index 0785bb0dffb..00000000000
--- a/sys/arch/cats/include/psl.h
+++ /dev/null
@@ -1 +0,0 @@
-/* $OpenBSD: psl.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
diff --git a/sys/arch/cats/include/ptrace.h b/sys/arch/cats/include/ptrace.h
deleted file mode 100644
index 8e16de5f88b..00000000000
--- a/sys/arch/cats/include/ptrace.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: ptrace.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: ptrace.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
-
-#include <arm/ptrace.h>
diff --git a/sys/arch/cats/include/reg.h b/sys/arch/cats/include/reg.h
deleted file mode 100644
index 8e503fbc8d1..00000000000
--- a/sys/arch/cats/include/reg.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: reg.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: reg.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
-
-#include <arm/reg.h>
diff --git a/sys/arch/cats/include/reloc.h b/sys/arch/cats/include/reloc.h
deleted file mode 100644
index 0a788984d8c..00000000000
--- a/sys/arch/cats/include/reloc.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $OpenBSD: reloc.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-#include <arm/reloc.h>
diff --git a/sys/arch/cats/include/setjmp.h b/sys/arch/cats/include/setjmp.h
deleted file mode 100644
index bd4d39265e3..00000000000
--- a/sys/arch/cats/include/setjmp.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: setjmp.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: setjmp.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
-
-#include <arm/setjmp.h>
diff --git a/sys/arch/cats/include/signal.h b/sys/arch/cats/include/signal.h
deleted file mode 100644
index 7f374547760..00000000000
--- a/sys/arch/cats/include/signal.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: signal.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: signal.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
-
-#include <arm/signal.h>
diff --git a/sys/arch/cats/include/spinlock.h b/sys/arch/cats/include/spinlock.h
deleted file mode 100644
index e1795805ee4..00000000000
--- a/sys/arch/cats/include/spinlock.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-/* $OpenBSD: spinlock.h,v 1.2 2005/12/01 22:09:44 deraadt Exp $ */
-#ifndef _CATS_SPINLOCK_H_
-#define _CATS_SPINLOCK_H_
-#include <arm/spinlock.h>
-#endif /* _CATS_SPINLOCK_H_ */
diff --git a/sys/arch/cats/include/stdarg.h b/sys/arch/cats/include/stdarg.h
deleted file mode 100644
index ecec78f756b..00000000000
--- a/sys/arch/cats/include/stdarg.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $NetBSD: stdarg.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
-
-#include <arm/stdarg.h>
diff --git a/sys/arch/cats/include/sysarch.h b/sys/arch/cats/include/sysarch.h
deleted file mode 100644
index 18778d71e0c..00000000000
--- a/sys/arch/cats/include/sysarch.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: sysarch.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: sysarch.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
-
-#include <arm/sysarch.h>
diff --git a/sys/arch/cats/include/trap.h b/sys/arch/cats/include/trap.h
deleted file mode 100644
index 3093ee74a2f..00000000000
--- a/sys/arch/cats/include/trap.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $OpenBSD: trap.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: trap.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
-
-#include <arm/trap.h>
diff --git a/sys/arch/cats/include/vmparam.h b/sys/arch/cats/include/vmparam.h
deleted file mode 100644
index bf47c165dd3..00000000000
--- a/sys/arch/cats/include/vmparam.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* $OpenBSD: vmparam.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* $NetBSD: vmparam.h,v 1.23 2003/05/22 05:47:07 thorpej Exp $ */
-
-/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _ARM32_VMPARAM_H_
-#define _ARM32_VMPARAM_H_
-
-#define ARM_KERNEL_BASE 0xf0000000
-
-#include <arm/vmparam.h>
-
-#ifdef _KERNEL
-/*
- * Address space constants
- */
-
-/*
- * The line between user space and kernel space
- * Mappings >= KERNEL_BASE are constant across all processes
- */
-#define KERNEL_BASE ARM_KERNEL_BASE
-
-/*
- * Override the default pager_map size, there's not enough KVA.
- */
-#define PAGER_MAP_SIZE (4 * 1024 * 1024)
-
-/*
- * Size of User Raw I/O map
- */
-
-#define USRIOSIZE 300
-
-/* virtual sizes (bytes) for various kernel submaps */
-
-#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
-
-/*
- * max number of non-contig chunks of physical RAM you can have
- */
-
-#define VM_PHYSSEG_MAX 32
-
-/*
- * when converting a physical address to a vm_page structure, we
- * want to use a binary search on the chunks of physical memory
- * to find our RAM
- */
-
-#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
-
-/*
- * this indicates that we can't add RAM to the VM system after the
- * vm system is init'd.
- */
-
-#define VM_PHYSSEG_NOADD
-
-/*
- * we support 2 free lists:
- *
- * - DEFAULT for all systems
- * - ISADMA for the ISA DMA range on Sharks only
- */
-#endif /* _KERNEL */
-
-#define VM_NFREELIST 2
-#define VM_FREELIST_DEFAULT 0
-#define VM_FREELIST_ISADMA 1
-
-
-#endif /* _ARM32_VMPARAM_H_ */
diff --git a/sys/arch/cats/isa/isa_machdep.h b/sys/arch/cats/isa/isa_machdep.h
deleted file mode 100644
index 3995d02ce84..00000000000
--- a/sys/arch/cats/isa/isa_machdep.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $OpenBSD: isa_machdep.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-/* stub until this file is moved */
-#include <machine/isa_machdep.h>
diff --git a/sys/arch/cats/pci/pci_machdep.h b/sys/arch/cats/pci/pci_machdep.h
deleted file mode 100644
index ed767599faa..00000000000
--- a/sys/arch/cats/pci/pci_machdep.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $OpenBSD: pci_machdep.h,v 1.1 2004/02/01 05:12:54 drahn Exp $ */
-#include <arm/pci_machdep.h>
diff --git a/sys/arch/cats/pci/pcib.c b/sys/arch/cats/pci/pcib.c
deleted file mode 100644
index 52e540c777b..00000000000
--- a/sys/arch/cats/pci/pcib.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* $OpenBSD: pcib.c,v 1.3 2006/03/17 20:48:46 miod Exp $ */
-/* $NetBSD: pcib.c,v 1.4 2003/01/01 01:25:34 thorpej Exp $ */
-
-/*-
- * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * from: i386/pci/pcib.c,v 1.12
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-
-#include <machine/bus.h>
-
-#include <dev/isa/isavar.h>
-
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcireg.h>
-
-#include <dev/pci/pcidevs.h>
-
-#include "isadma.h"
-
-int pcibmatch (struct device *, void *, void *);
-void pcibattach (struct device *, struct device *, void *);
-
-struct cfattach pcib_ca = {
- sizeof(struct device), pcibmatch, pcibattach
-};
-
-struct cfdriver pcib_cd = {
- NULL, "pcib", DV_DULL
-};
-
-
-void pcib_callback (struct device *);
-int pcib_print (void *, const char *);
-
-int
-pcibmatch(parent, match, aux)
- struct device *parent;
- void *match;
- void *aux;
-{
- struct pci_attach_args *pa = aux;
-
- /*
- * Match tested PCI-ISA bridges.
- */
- switch (PCI_VENDOR(pa->pa_id)) {
- case PCI_VENDOR_ALI:
- switch (PCI_PRODUCT(pa->pa_id)) {
- case PCI_PRODUCT_ALI_M1533:
- case PCI_PRODUCT_ALI_M1543:
- return (1);
- }
- break;
- }
-
- return (0);
-}
-
-void
-pcibattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- printf("\n");
-
- /* Set the ISA bus callback */
- config_defer(self, pcib_callback);
-}
-
-void
-pcib_callback(self)
- struct device *self;
-{
- struct isabus_attach_args iba;
-
- /*
- * Attach the ISA bus behind this bridge.
- */
- memset(&iba, 0, sizeof(iba));
- iba.iba_busname = "isa";
- iba.iba_iot = &isa_io_bs_tag;
- iba.iba_memt = &isa_mem_bs_tag;
-#if NISADMA > 0
- iba.iba_dmat = &isa_bus_dma_tag;
-#endif
- config_found(self, &iba, pcib_print);
-}
-
-int
-pcib_print(aux, pnp)
- void *aux;
- const char *pnp;
-{
-
- /* Only ISAs can attach to pcib's; easy. */
- if (pnp)
- printf("isa at %s", pnp);
- return (UNCONF);
-}
diff --git a/sys/arch/cats/pci/pciide_machdep.c b/sys/arch/cats/pci/pciide_machdep.c
deleted file mode 100644
index b1fee7cd1ba..00000000000
--- a/sys/arch/cats/pci/pciide_machdep.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* $OpenBSD: pciide_machdep.c,v 1.2 2004/05/19 04:11:31 drahn Exp $ */
-/* $NetBSD: pciide_machdep.c,v 1.2 2002/09/27 15:35:56 provos Exp $ */
-
-/*
- * Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Christopher G. Demetriou
- * for the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * PCI IDE controller driver (arm32 machine-dependent portion).
- *
- * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
- * sys/dev/pci/ppb.c, revision 1.16).
- *
- * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
- * PCI SIG.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pciidereg.h>
-#include <dev/pci/pciidevar.h>
-
-#include <dev/isa/isavar.h>
-#include <machine/intr.h>
-#include "isa.h"
-
-void *
-pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg)
- struct device *dev;
- struct pci_attach_args *pa;
- int chan;
- int (*func) (void *);
- void *arg;
-{
-#if NISA > 0
- int irq;
- void *cookie;
-
- irq = PCIIDE_COMPAT_IRQ(chan);
- cookie = isa_intr_establish(NULL, irq, IST_EDGE, IPL_BIO, func, arg,
- dev->dv_xname);
- if (cookie == NULL)
- return (NULL);
- printf("%s: %s channel interrupting at irq %d\n", dev->dv_xname,
- PCIIDE_CHANNEL_NAME(chan), irq);
- return (cookie);
-#else
- panic("pciide_machdep_compat_intr_establish() called");
-#endif
-}
-
-void
-pciide_machdep_compat_intr_disestablish(pci_chipset_tag_t pc, void *cookie)
-{
-#if NISA > 0
- isa_intr_disestablish(NULL, cookie);
-#else
- panic("pciide_machdep_compat_intr_disestablish() called");
-#endif
-}