diff options
-rw-r--r-- | sys/arch/amd64/amd64/rbus_machdep.c | 133 | ||||
-rw-r--r-- | sys/arch/amd64/conf/GENERIC | 60 | ||||
-rw-r--r-- | sys/arch/amd64/conf/files.amd64 | 18 | ||||
-rw-r--r-- | sys/arch/amd64/include/pci_machdep.h | 4 | ||||
-rw-r--r-- | sys/arch/amd64/include/rbus_machdep.h | 52 |
5 files changed, 235 insertions, 32 deletions
diff --git a/sys/arch/amd64/amd64/rbus_machdep.c b/sys/arch/amd64/amd64/rbus_machdep.c new file mode 100644 index 00000000000..dd6b620c590 --- /dev/null +++ b/sys/arch/amd64/amd64/rbus_machdep.c @@ -0,0 +1,133 @@ +/* $OpenBSD: rbus_machdep.c,v 1.1 2005/10/05 21:48:34 tdeval Exp $ */ +/* $NetBSD: rbus_machdep.c,v 1.2 1999/10/15 06:43:06 haya Exp $ */ + +/* + * Copyright (c) 1999 + * HAYAKAWA Koichi. 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 HAYAKAWA Koichi. + * 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. + */ + +/*#include "pcibios.h"*/ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/extent.h> + +#include <uvm/uvm_extern.h> + +#include <sys/sysctl.h> + +#include <sys/device.h> + +#include <machine/bus.h> +#include <dev/cardbus/rbus.h> + +#include <dev/isa/isareg.h> +#include <dev/isa/isavar.h> + +#include <dev/pci/pcivar.h> +#include <arch/amd64/pci/pchbvar.h> + + +/********************************************************************** + * rbus_tag_t rbus_fakeparent_mem(struct pci_attach_args *pa) + * + * This function makes an rbus tag for memory space. This rbus tag + * shares the all memory region of ex_iomem. + **********************************************************************/ +#define RBUS_MEM_START 0x40000000 +#define RBUS_MEM_SIZE 0x00100000 + +rbus_tag_t +rbus_pccbb_parent_mem(self, pa) + struct device *self; + struct pci_attach_args *pa; +{ + bus_addr_t start, min_start; + bus_size_t size; + struct extent *ex; + + size = RBUS_MEM_SIZE; + start = min_start = max(RBUS_MEM_START, ctob(physmem)); +#if NPCIBIOS > 0 + if ((ex = pciaddr_search(PCIADDR_SEARCH_MEM, &start, size)) == NULL) +#endif + { + extern struct extent *iomem_ex; + ex = iomem_ex; + start = ex->ex_start; + + /* XXX: unfortunately, iomem_ex cannot be used for the + * dynamic bus_space allocatoin. There are some + * hidden memory (or some obstacles which do not + * recognised by the kernel) in the region governed by + * iomem_ex. So I decide to use only very high + * address region. + * + * if defined PCIBIOS_ADDR_FIXUP, PCI device using + * area which is not recognised by the kernel are + * already reserved. + */ + + if (start < min_start) { + start = min_start; + } + + size = ex->ex_end - start; + } + + return rbus_new_root_share(pa->pa_memt, ex, start, size, 0); +} + + +/********************************************************************** + * rbus_tag_t rbus_pccbb_parent_io(struct pci_attach_args *pa) + **********************************************************************/ +#define RBUS_IO_START 0xa000 +#define RBUS_IO_SIZE 0x1000 + +rbus_tag_t +rbus_pccbb_parent_io(self, pa) + struct device *self; + struct pci_attach_args *pa; +{ + struct extent *ex; + bus_addr_t start; + bus_size_t size; + + size = RBUS_IO_SIZE; + start = RBUS_IO_START; +#if NPCIBIOS > 0 + if ((ex = pciaddr_search(PCIADDR_SEARCH_IO, &start, size)) == NULL) +#endif + { + extern struct extent *ioport_ex; + ex = ioport_ex; + } + + return rbus_new_root_share(pa->pa_iot, ex, start, size, 0); +} diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC index f5cc85a1b19..af1f1cb0f9d 100644 --- a/sys/arch/amd64/conf/GENERIC +++ b/sys/arch/amd64/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.81 2005/10/02 17:08:14 brad Exp $ +# $OpenBSD: GENERIC,v 1.82 2005/10/05 21:48:34 tdeval Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -80,17 +80,17 @@ viaenv* at pci? # VIA VT82C686A hardware monitor #pcmcia* at pcic? # CardBus bus support -#cardbus* at cardslot? -#pcmcia* at cardslot? -#cbb* at pci? -#cardslot* at cbb? +cbb* at pci? +cardslot* at cbb? +cardbus* at cardslot? +pcmcia* at cardslot? # USB Controllers ehci* at pci? # Enhanced Host Controller -#ehci* at cardbus? # Enhanced Host Controller +ehci* at cardbus? # Enhanced Host Controller uhci* at pci? # Universal Host Controller (Intel) ohci* at pci? # Open Host Controller -#ohci* at cardbus? # Open Host Controller +ohci* at cardbus? # Open Host Controller # USB bus support usb* at ehci? @@ -179,7 +179,7 @@ com1 at isa? port 0x2f8 irq 3 #com2 at isa? port 0x3e8 irq 5 #com3 at isa? port 0x2e8 irq 9 # (conflicts with some video cards) -#com* at pcmcia? # PCMCIA modems/serial ports +com* at pcmcia? # PCMCIA modems/serial ports com* at puc? # options CY_HW_RTS @@ -217,8 +217,8 @@ scsibus* at ciss? #scsibus* at iha? isp* at pci? # Qlogic ISP [12]0x0 SCSI/FibreChannel scsibus* at isp? -#aic* at pcmcia? # PCMCIA Adaptec 152[02] SCSI -#scsibus* at aic? +aic* at pcmcia? # PCMCIA Adaptec 152[02] SCSI +scsibus* at aic? #esp* at pcmcia? # PCMCIA based NCR 53C9X SCSI #scsibus* at esp? siop* at pci? # NCR 538XX SCSI controllers @@ -248,14 +248,14 @@ fd* at fdc? flags 0x00 # IDE controllers pciide* at pci? flags 0x0000 -#wdc* at pcmcia? +wdc* at pcmcia? # IDE hard drives -#wd* at wdc? flags 0x0000 +wd* at wdc? flags 0x0000 wd* at pciide? flags 0x0000 # ATAPI<->SCSI -#atapiscsi* at wdc? +atapiscsi* at wdc? atapiscsi* at pciide? scsibus* at atapiscsi? @@ -264,18 +264,18 @@ scsibus* at atapiscsi? #le* at pci? # PCnet-PCI based ethernet #de* at pci? # DC21X4X-based ethernet fxp* at pci? # EtherExpress 10/100B ethernet -#fxp* at cardbus? # Intel PRO/100 ethernet +fxp* at cardbus? # Intel PRO/100 ethernet #ne* at pci? # NE2000-compat ethernet ep* at pci? # 3C59x ethernet -#ne* at pcmcia? # PCMCIA based NE2000 ethernet -#ep* at pcmcia? # PCMCIA based 3C5xx ethernet -#sm* at pcmcia? # PCMCIA based sm ethernet -#xe* at pcmcia? # Xircom ethernet +ne* at pcmcia? # PCMCIA based NE2000 ethernet +ep* at pcmcia? # PCMCIA based 3C5xx ethernet +sm* at pcmcia? # PCMCIA based sm ethernet +xe* at pcmcia? # Xircom ethernet #fpa* at pci? # DEC DEFPA FDDI xl* at pci? # 3C9xx ethernet -#xl* at cardbus? # 3C575/3C656 ethernet +xl* at cardbus? # 3C575/3C656 ethernet rl* at pci? # RealTek 81[23]9 ethernet -#rl* at cardbus? # RealTek 81[23]9 ethernet +rl* at cardbus? # RealTek 81[23]9 ethernet #mtd* at pci? # Myson MTD800/803/891 epic* at pci? # SMC EPIC/100 ethernet #tl* at pci? # Compaq Thunderlan ethernet @@ -285,7 +285,7 @@ vr* at pci? # VIA Rhine ethernet sis* at pci? # SiS 900/7016 ethernet #ste* at pci? # Sundance ST201 ethernet BORKED dc* at pci? # 21143, "tulip" clone ethernet -#dc* at cardbus? # 21143, "tulip" clone ethernet +dc* at cardbus? # 21143, "tulip" clone ethernet ti* at pci? # Alteon Tigon 1Gb ethernet skc* at pci? # SysKonnect GEnesis 984x sk* at skc? # each port of above @@ -300,21 +300,21 @@ hme* at pci? # Sun Happy Meal vge* at pci? # VIA VT612x # Wireless network cards -#ath* at pci? # Atheros AR5k (802.11a/b/g) -#ath* at cardbus? # Atheros AR5k (802.11a/b/g) +ath* at pci? # Atheros AR5k (802.11a/b/g) +ath* at cardbus? # Atheros AR5k (802.11a/b/g) atw* at pci? # ADMtek ADM8211 (802.11) -#atw* at cardbus? # ADMtek ADM8211 (802.11) +atw* at cardbus? # ADMtek ADM8211 (802.11) wi* at pci? # WaveLAN IEEE 802.11DS -#wi* at pcmcia? # WaveLAN IEEE 802.11DS +wi* at pcmcia? # WaveLAN IEEE 802.11DS #awi* at pcmcia? # Bay Networks IEEE 802.11FH #an* at pci? # Aironet IEEE 802.11DS -#an* at pcmcia? # Aironet IEEE 802.11DS -#cnw* at pcmcia? # Xircom Netwave -#ray* at pcmcia? # Raylink Aviator2.4/Pro 802.11FH +an* at pcmcia? # Aironet IEEE 802.11DS +cnw* at pcmcia? # Xircom Netwave +ray* at pcmcia? # Raylink Aviator2.4/Pro 802.11FH ral* at pci? # Ralink RT2500 -#ral* at cardbus? # Ralink RT2500 +ral* at cardbus? # Ralink RT2500 rtw* at pci? # Realtek 8180 -#rtw* at cardbus? # Realtek 8180 +rtw* at cardbus? # Realtek 8180 # Media Independent Interface (mii) drivers exphy* at mii? # 3Com internal PHYs diff --git a/sys/arch/amd64/conf/files.amd64 b/sys/arch/amd64/conf/files.amd64 index e084d68065d..439b8b1843c 100644 --- a/sys/arch/amd64/conf/files.amd64 +++ b/sys/arch/amd64/conf/files.amd64 @@ -1,4 +1,4 @@ -# $OpenBSD: files.amd64,v 1.13 2005/10/02 22:53:42 deraadt Exp $ +# $OpenBSD: files.amd64,v 1.14 2005/10/05 21:48:34 tdeval Exp $ maxpartitions 16 maxusers 2 16 128 @@ -98,6 +98,22 @@ device pchb: pcibus attach pchb at pci file arch/amd64/pci/pchb.c pchb +# +# CARDBUS +# +include "dev/cardbus/files.cardbus" +file arch/amd64/amd64/rbus_machdep.c cardbus + +# PCIC pcmcia controller +device pcic: pcmciabus +file dev/ic/i82365.c pcic + +# PCIC pcmcia controller on PCI bus. +attach pcic at pci with pcic_pci +file dev/pci/i82365_pci.c pcic_pci + +include "dev/pcmcia/files.pcmcia" + # PCI-ISA bridges device pcib: isabus attach pcib at pci diff --git a/sys/arch/amd64/include/pci_machdep.h b/sys/arch/amd64/include/pci_machdep.h index d58d306e91f..e3cd9f94c61 100644 --- a/sys/arch/amd64/include/pci_machdep.h +++ b/sys/arch/amd64/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.3 2005/09/04 19:19:40 brad Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.4 2005/10/05 21:48:34 tdeval Exp $ */ /* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */ /* @@ -64,6 +64,8 @@ typedef void *pci_chipset_tag_t; typedef union x86_pci_tag_u pcitag_t; typedef int pci_intr_handle_t; +#define pci_intr_line(ih) ((ih) & 0xff) + /* * i386-specific PCI variables and functions. * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE. diff --git a/sys/arch/amd64/include/rbus_machdep.h b/sys/arch/amd64/include/rbus_machdep.h new file mode 100644 index 00000000000..c6fac0e1255 --- /dev/null +++ b/sys/arch/amd64/include/rbus_machdep.h @@ -0,0 +1,52 @@ +/* $OpenBSD: rbus_machdep.h,v 1.1 2005/10/05 21:48:34 tdeval Exp $ */ +/* $NetBSD: rbus_machdep.h,v 1.2 1999/10/15 06:43:05 haya Exp $ */ + +/* + * Copyright (c) 1999 + * HAYAKAWA Koichi. 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 HAYAKAWA Koichi. + * 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. + */ + + +#if !defined _ARCH_AMD64_AMD64_RBUS_MACHDEP_H_ +#define _ARCH_AMD64_AMD64_RBUS_MACHDEP_H_ + +struct pci_attach_args; /* XXX */ + +#define md_space_map(bt, physaddr, size, flags, bshp) \ + _x86_memio_map((bt), (physaddr), (size), (flags), (bshp)) + +#define md_space_unmap(bt, bsh, size, adrp) \ + _x86_memio_unmap((bt), (bsh), (size), (adrp)) + + +rbus_tag_t rbus_pccbb_parent_io(struct device *self, + struct pci_attach_args *pa); +rbus_tag_t rbus_pccbb_parent_mem(struct device *self, + struct pci_attach_args *pa); + +#endif /* _ARCH_AMD64_AMD64_RBUS_MACHDEP_H_ */ |