diff --git a/sys/arch/arm/xscale/ixp425.c b/sys/arch/arm/xscale/ixp425.c index d820ad67493a..729b204efbd5 100644 --- a/sys/arch/arm/xscale/ixp425.c +++ b/sys/arch/arm/xscale/ixp425.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixp425.c,v 1.2 2003/05/23 09:41:02 ichiro Exp $ */ +/* $NetBSD: ixp425.c,v 1.3 2003/05/24 01:59:32 ichiro Exp $ */ /* * Copyright (c) 2003 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ixp425.c,v 1.2 2003/05/23 09:41:02 ichiro Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixp425.c,v 1.3 2003/05/24 01:59:32 ichiro Exp $"); #include #include @@ -46,6 +46,8 @@ __KERNEL_RCSID(0, "$NetBSD: ixp425.c,v 1.2 2003/05/23 09:41:02 ichiro Exp $"); #include #include +#include + static struct ixp425_softc *ixp425_softc; void diff --git a/sys/arch/arm/xscale/ixp425var.h b/sys/arch/arm/xscale/ixp425var.h index 7ac61d0fdec0..859af401c79b 100644 --- a/sys/arch/arm/xscale/ixp425var.h +++ b/sys/arch/arm/xscale/ixp425var.h @@ -1,4 +1,4 @@ -/* $NetBSD: ixp425var.h,v 1.1 2003/05/23 00:57:26 ichiro Exp $ */ +/* $NetBSD: ixp425var.h,v 1.2 2003/05/24 01:59:32 ichiro Exp $ */ /* * Copyright (c) 2003 @@ -82,7 +82,7 @@ struct intrhand { int ih_irq; /* IRQ number */ }; -#define IRQNAMESIZE sizeof("ixp425 irq xxx") +#define IRQNAMESIZE sizeof("ixp425 irq xx") struct intrq { TAILQ_HEAD(, intrhand) iq_list; /* handler list */ diff --git a/sys/arch/evbarm/conf/ZAO425 b/sys/arch/evbarm/conf/ZAO425 index 7e1de8ad3449..5979ca61f25e 100644 --- a/sys/arch/evbarm/conf/ZAO425 +++ b/sys/arch/evbarm/conf/ZAO425 @@ -1,4 +1,4 @@ -# $NetBSD: ZAO425,v 1.2 2003/05/23 14:23:47 thorpej Exp $ +# $NetBSD: ZAO425,v 1.3 2003/05/24 01:59:32 ichiro Exp $ # # ZAO425 -- Intel IXP425 # @@ -26,6 +26,9 @@ makeoptions COPTS="-O2 -mcpu=xscale" options XSCALE_CACHE_READ_WRITE_ALLOCATE #options HZ=512 +# Board Type +makeoptions BOARDTYPE="zao425" + # File systems file-system FFS # UFS diff --git a/sys/arch/evbarm/conf/files.ixdp425 b/sys/arch/evbarm/conf/files.ixdp425 index c5840a0226bc..b3a32872f5b8 100644 --- a/sys/arch/evbarm/conf/files.ixdp425 +++ b/sys/arch/evbarm/conf/files.ixdp425 @@ -1,4 +1,4 @@ -# $NetBSD: files.ixdp425,v 1.1 2003/05/23 00:57:26 ichiro Exp $ +# $NetBSD: files.ixdp425,v 1.2 2003/05/24 01:59:32 ichiro Exp $ # # Intel IXP425 networkproccesor board configuration info # @@ -14,6 +14,8 @@ include "arch/arm/xscale/files.ixp425" #file arch/evbarm/evbarm/initarm_common.c file arch/evbarm/ixdp425/ixdp425_machdep.c +file arch/evbarm/ixdp425/ixdp425_pci.c + # IXP425 PCI bus support attach ixpio at mainbus with ixpio_mainbus file arch/evbarm/ixdp425/ixdp425_mainbus.c ixpio_mainbus diff --git a/sys/arch/evbarm/conf/std.ixdp425 b/sys/arch/evbarm/conf/std.ixdp425 index 6dbf71eecc7a..cc2cb6867047 100644 --- a/sys/arch/evbarm/conf/std.ixdp425 +++ b/sys/arch/evbarm/conf/std.ixdp425 @@ -1,4 +1,4 @@ -# $NetBSD: std.ixdp425,v 1.2 2003/05/23 09:38:05 ichiro Exp $ +# $NetBSD: std.ixdp425,v 1.3 2003/05/24 01:59:32 ichiro Exp $ # # standard NetBSD/evbarm for IXDP425 options @@ -17,7 +17,6 @@ options ARM32 #options ARM32_NEW_VM_LAYOUT # Not yet ready for prime-time makeoptions LOADADDRESS="0xc0200000" -makeoptions BOARDTYPE="ixdp425" makeoptions BOARDMKFRAG="${THISARM}/conf/mk.ixdp425" options ARM_INTR_IMPL="" diff --git a/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c b/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c index b616d211e5ac..de20cfb64db0 100644 --- a/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c +++ b/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixdp425_mainbus.c,v 1.1 2003/05/23 00:57:27 ichiro Exp $ */ +/* $NetBSD: ixdp425_mainbus.c,v 1.2 2003/05/24 01:59:32 ichiro Exp $ */ /* * Copyright (c) 2003 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ixdp425_mainbus.c,v 1.1 2003/05/23 00:57:27 ichiro Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixdp425_mainbus.c,v 1.2 2003/05/24 01:59:32 ichiro Exp $"); /* * front-end for the ixp425 NetworkProcessor. @@ -50,6 +50,8 @@ __KERNEL_RCSID(0, "$NetBSD: ixdp425_mainbus.c,v 1.1 2003/05/23 00:57:27 ichiro E #include #include +#include + #include "locators.h" static int ixp425_mainbus_match(struct device *, struct cfdata *, void *); @@ -74,11 +76,11 @@ ixp425_mainbus_attach(struct device *parent, struct device *self, void *aux) ixp425_bs_init(&ixp425_bs_tag, sc); sc->sc_iot = &ixp425_bs_tag; sc->sc_ioh = IXP425_IO_VBASE; -#if 0 + /* * Initialize the interrupt part of our PCI chipset tag */ - ixm1200_pci_init(&sc->ia_pci_chipset, sc); -#endif + ixdp425_pci_init(&sc->ia_pci_chipset, sc); + ixp425_attach(sc); } diff --git a/sys/arch/evbarm/ixdp425/ixdp425_pci.c b/sys/arch/evbarm/ixdp425/ixdp425_pci.c new file mode 100644 index 000000000000..a6f4c4aa50a3 --- /dev/null +++ b/sys/arch/evbarm/ixdp425/ixdp425_pci.c @@ -0,0 +1,151 @@ +/* $NetBSD: ixdp425_pci.c,v 1.1 2003/05/24 01:59:32 ichiro Exp $ */ +/* + * Copyright (c) 2003 + * Ichiro FUKUHARA . + * 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 Ichiro FUKUHARA. + * 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 ICHIRO FUKUHARA ``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 ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD 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 +__KERNEL_RCSID(0, "$NetBSD: ixdp425_pci.c,v 1.1 2003/05/24 01:59:32 ichiro Exp $"); + +/* + * IXDP425 PCI interrupt support. + */ + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +int ixdp425_pci_intr_map(struct pci_attach_args *, pci_intr_handle_t *); +const char *ixdp425_pci_intr_string(void *, pci_intr_handle_t); +const struct evcnt *ixdp425_pci_intr_evcnt(void *, pci_intr_handle_t); +void *ixdp425_pci_intr_establish(void *, pci_intr_handle_t, int, + int (*func)(void *), void *); +void ixdp425_pci_intr_disestablish(void *, void *); + +void +ixdp425_pci_init(pci_chipset_tag_t pc, void *cookie) +{ + pc->pc_intr_v = cookie; + pc->pc_intr_map = ixdp425_pci_intr_map; + pc->pc_intr_string = ixdp425_pci_intr_string; + pc->pc_intr_evcnt = ixdp425_pci_intr_evcnt; + pc->pc_intr_establish = ixdp425_pci_intr_establish; + pc->pc_intr_disestablish = ixdp425_pci_intr_disestablish; +} + +int +ixdp425_pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp) +{ + int pin = pa->pa_intrpin; + +#ifdef PCI_DEBUG + void *v = pa->pa_pc; + int line = pa->pa_intrline; + int dev=pa->pa_device; + pcitag_t intrtag = pa->pa_intrtag; + + printf("ixdp425_pci_intr_map: v=%p, tag=%08lx intrpin=%d line=%d dev=%d\n", + v, intrtag, pin, line, dev); +#endif + + switch (pin) { + case 1: + *ihp = PCI_INT_A; + return (0); + case 2: + *ihp = PCI_INT_B; + return (0); + case 3: + *ihp = PCI_INT_C; + return (0); + case 4: + *ihp = PCI_INT_D; + return (0); + default: +#ifdef PCI_DEBUG + printf("ixdp425_pci_intr_map: no mapping for %d/%d/%d\n", + pa->pa_bus, pa->pa_device, pa->pa_function); +#endif + return (1); + } + + return (0); +} + +const char * +ixdp425_pci_intr_string(void *v, pci_intr_handle_t ih) +{ + static char irqstr[IRQNAMESIZE]; + + sprintf(irqstr, "ixp425 irq %ld", ih); + return (irqstr); +} + +const struct evcnt * +ixdp425_pci_intr_evcnt(void *v, pci_intr_handle_t ih) +{ + return (NULL); +} + +void * +ixdp425_pci_intr_establish(void *v, pci_intr_handle_t ih, int ipl, + int (*func)(void *), void *arg) +{ +#ifdef PCI_DEBUG + printf("ixdp425_pci_intr_establish(v=%p, irq=%d, ipl=%d, func=%p, arg=%p)\n", + v, (int) ih, ipl, func, arg); +#endif + + return (ixp425_intr_establish(ih, ipl, func, arg)); +} + +void +ixdp425_pci_intr_disestablish(void *v, void *cookie) +{ +#ifdef PCI_DEBUG + printf("ixdp425_pci_intr_disestablish(v=%p, cookie=%p)\n", + v, cookie); +#endif + + ixp425_intr_disestablish(cookie); +} diff --git a/sys/arch/evbarm/ixdp425/ixdp425_start.S b/sys/arch/evbarm/ixdp425/ixdp425_start.S index ad15157b5fa2..e30a078ef3de 100644 --- a/sys/arch/evbarm/ixdp425/ixdp425_start.S +++ b/sys/arch/evbarm/ixdp425/ixdp425_start.S @@ -1,4 +1,4 @@ -/* $NetBSD: ixdp425_start.S,v 1.1 2003/05/23 00:57:27 ichiro Exp $ */ +/* $NetBSD: ixdp425_start.S,v 1.2 2003/05/24 01:59:32 ichiro Exp $ */ /* * Copyright (c) 2003 @@ -57,7 +57,7 @@ _C_LABEL(ixdp425_start): * Setup coprocessor 15. */ /* - *ZAO425 with CSR(microengine code produced by Intel Corp.) + *IXDP425 with CSR(microengine code produced by Intel Corp.) * running well on BigEndian, because CSR written on bigendian */ mrc p15, 0, r2, c1, c0, 0 diff --git a/sys/arch/evbarm/ixdp425/ixdp425reg.h b/sys/arch/evbarm/ixdp425/ixdp425reg.h index 272f09d64138..4e08d75417e1 100644 --- a/sys/arch/evbarm/ixdp425/ixdp425reg.h +++ b/sys/arch/evbarm/ixdp425/ixdp425reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: ixdp425reg.h,v 1.1 2003/05/23 00:57:27 ichiro Exp $ */ +/* $NetBSD: ixdp425reg.h,v 1.2 2003/05/24 01:59:32 ichiro Exp $ */ /* * Copyright (c) 2003 * Ichiro FUKUHARA . @@ -32,28 +32,40 @@ * SUCH DAMAGE. */ -#ifndef _ZAO425REG_H_ -#define _ZAO425REG_H_ +#ifndef _IXDP425REG_H_ +#define _IXDP425REG_H_ /* * GPIO */ -/* ZAO 425 MD */ -#define ZAO425_MPCI_GPIO0 IXP425_INT_GPIO_12 -#define ZAO425_PCI_INT_D IXP425_INT_GPIO_11 -#define ZAO425_PCI_INT_C IXP425_INT_GPIO_10 -#define ZAO425_PCI_INT_B IXP425_INT_GPIO_9 -#define ZAO425_PCI_INT_A IXP425_INT_GPIO_8 -#define ZAO425_I2C_SDA IXP425_INT_GPIO_7 -#define ZAO425_I2C_SCL IXP425_INT_GPIO_6 -#define ZAO425_MPCI_GPIO3 IXP425_INT_GPIO_5 -#define ZAO425_HSS0_INT IXP425_INT_GPIO_4 -#define ZAO425_HSS0_SCLK IXP425_INT_GPIO_3 -#define ZAO425_HSS0_SDI IXP425_INT_GPIO_2 -#define ZAO425_HSS0_SDO IXP425_INT_GPIO_1 -#define ZAO425_HSS0_CS IXP425_INT_GPIO_0 +#if BOARDTYPE == ixdp425 +#define PCI_CLK 14 +#define PCI_RESET 13 +#define PCI_INT_D IXP425_INT_GPIO_11 +#define PCI_INT_C IXP425_INT_GPIO_10 +#define PCI_INT_B IXP425_INT_GPIO_9 +#define PCI_INT_A IXP425_INT_GPIO_8 +#define I2C_SDA IXP425_INT_GPIO_7 +#define I2C_SCL IXP425_INT_GPIO_6 +#endif /* BOARDTYPE == ixdp425 */ -/* IXDP425 MD */ +#if BOARDTYPE == zao425 /* conf/ZAO425 */ +#define PCI_CLK 14 +#define PCI_RESET 13 +#define MPCI_GPIO0 IXP425_INT_GPIO_12 +#define PCI_INT_D IXP425_INT_GPIO_11 +#define PCI_INT_C IXP425_INT_GPIO_10 +#define PCI_INT_B IXP425_INT_GPIO_9 +#define PCI_INT_A IXP425_INT_GPIO_8 +#define I2C_SDA IXP425_INT_GPIO_7 +#define I2C_SCL IXP425_INT_GPIO_6 +#define MPCI_GPIO3 IXP425_INT_GPIO_5 +#define HSS0_INT IXP425_INT_GPIO_4 +#define HSS0_SCLK IXP425_INT_GPIO_3 +#define HSS0_SDI IXP425_INT_GPIO_2 +#define HSS0_SDO IXP425_INT_GPIO_1 +#define HSS0_CS IXP425_INT_GPIO_0 +#endif /* BOARDTYPE == zao425 */ -#endif /* _ZAO425REG_H_ */ +#endif /* _IXDP425REG_H_ */ diff --git a/sys/arch/evbarm/ixdp425/ixdp425var.h b/sys/arch/evbarm/ixdp425/ixdp425var.h new file mode 100644 index 000000000000..a022e33e69c0 --- /dev/null +++ b/sys/arch/evbarm/ixdp425/ixdp425var.h @@ -0,0 +1,42 @@ +/* $NetBSD: ixdp425var.h,v 1.1 2003/05/24 01:59:32 ichiro Exp $ */ +/* + * Copyright (c) 2003 + * Ichiro FUKUHARA . + * 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 Ichiro FUKUHARA. + * 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 ICHIRO FUKUHARA ``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 ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD 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 _IXDP425VAR_H_ +#define _IXDP425VAR_H_ + +#include + +void ixdp425_pci_init(pci_chipset_tag_t, void *); + +#endif /* _IXDP425VAR_H_ */