Module Name: src Committed By: kiyohara Date: Sun Aug 9 06:12:34 UTC 2009
Modified Files: src/sys/arch/arm/sa11x0: sa11x0.c sa11x0_ost.c sa11x0_var.h src/sys/arch/arm/xscale: pxa2x0.c pxa2x0_ohci.c pxa2x0_rtc.c pxa2x0_udc.c pxa2x0var.h src/sys/arch/evbarm/gumstix: gxiic.c gxmci.c src/sys/arch/zaurus/conf: GENERIC Log Message: Fix matching by improper driver. see http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html And remove some white-spaces. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/sa11x0/sa11x0.c cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/sa11x0/sa11x0_ost.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/sa11x0/sa11x0_var.h cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/xscale/pxa2x0.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/pxa2x0_ohci.c \ src/sys/arch/arm/xscale/pxa2x0var.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/xscale/pxa2x0_rtc.c \ src/sys/arch/arm/xscale/pxa2x0_udc.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/gumstix/gxiic.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/gumstix/gxmci.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/zaurus/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/sa11x0/sa11x0.c diff -u src/sys/arch/arm/sa11x0/sa11x0.c:1.24 src/sys/arch/arm/sa11x0/sa11x0.c:1.25 --- src/sys/arch/arm/sa11x0/sa11x0.c:1.24 Fri May 29 14:15:44 2009 +++ src/sys/arch/arm/sa11x0/sa11x0.c Sun Aug 9 06:12:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sa11x0.c,v 1.24 2009/05/29 14:15:44 rjs Exp $ */ +/* $NetBSD: sa11x0.c,v 1.25 2009/08/09 06:12:33 kiyohara Exp $ */ /*- * Copyright (c) 2001, The NetBSD Foundation, Inc. All rights reserved. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sa11x0.c,v 1.24 2009/05/29 14:15:44 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sa11x0.c,v 1.25 2009/08/09 06:12:33 kiyohara Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -203,10 +203,11 @@ struct sa11x0_attach_args sa; sa.sa_sc = sc; - sa.sa_iot = sc->sc_iot; - sa.sa_addr = cf->cf_loc[SAIPCF_ADDR]; - sa.sa_size = cf->cf_loc[SAIPCF_SIZE]; - sa.sa_intr = cf->cf_loc[SAIPCF_INTR]; + sa.sa_iot = sc->sc_iot; + sa.sa_name = cf->cf_name; + sa.sa_addr = cf->cf_loc[SAIPCF_ADDR]; + sa.sa_size = cf->cf_loc[SAIPCF_SIZE]; + sa.sa_intr = cf->cf_loc[SAIPCF_INTR]; sa.sa_gpio = cf->cf_loc[SAIPCF_GPIO]; if (config_match(parent, cf, &sa) > 0) Index: src/sys/arch/arm/sa11x0/sa11x0_ost.c diff -u src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.27 src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.28 --- src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.27 Sat Aug 1 10:33:58 2009 +++ src/sys/arch/arm/sa11x0/sa11x0_ost.c Sun Aug 9 06:12:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sa11x0_ost.c,v 1.27 2009/08/01 10:33:58 kiyohara Exp $ */ +/* $NetBSD: sa11x0_ost.c,v 1.28 2009/08/09 06:12:33 kiyohara Exp $ */ /* * Copyright (c) 1997 Mark Brinicombe. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.27 2009/08/01 10:33:58 kiyohara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.28 2009/08/09 06:12:33 kiyohara Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -99,7 +99,10 @@ static int saost_match(device_t parent, cfdata_t match, void *aux) { + struct sa11x0_attach_args *sa = aux; + if (strcmp(sa->sa_name, match->cf_name) != 0) + return 0; return 1; } Index: src/sys/arch/arm/sa11x0/sa11x0_var.h diff -u src/sys/arch/arm/sa11x0/sa11x0_var.h:1.9 src/sys/arch/arm/sa11x0/sa11x0_var.h:1.10 --- src/sys/arch/arm/sa11x0/sa11x0_var.h:1.9 Fri May 29 14:15:44 2009 +++ src/sys/arch/arm/sa11x0/sa11x0_var.h Sun Aug 9 06:12:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sa11x0_var.h,v 1.9 2009/05/29 14:15:44 rjs Exp $ */ +/* $NetBSD: sa11x0_var.h,v 1.10 2009/08/09 06:12:33 kiyohara Exp $ */ /*- * Copyright (c) 2001, The NetBSD Foundation, Inc. All rights reserved. @@ -52,7 +52,8 @@ typedef void *sa11x0_chipset_tag_t; struct sa11x0_attach_args { - sa11x0_chipset_tag_t sa_sc; + const char * sa_name; + sa11x0_chipset_tag_t sa_sc; bus_space_tag_t sa_iot; /* Bus tag */ bus_addr_t sa_addr; /* i/o address */ bus_size_t sa_size; @@ -61,7 +62,7 @@ int sa_gpio; }; -void *sa11x0_intr_establish(sa11x0_chipset_tag_t, int, int, int, +void *sa11x0_intr_establish(sa11x0_chipset_tag_t, int, int, int, int (*)(void *), void *); void sa11x0_intr_disestablish(sa11x0_chipset_tag_t, void *); Index: src/sys/arch/arm/xscale/pxa2x0.c diff -u src/sys/arch/arm/xscale/pxa2x0.c:1.17 src/sys/arch/arm/xscale/pxa2x0.c:1.18 --- src/sys/arch/arm/xscale/pxa2x0.c:1.17 Sat May 3 23:06:06 2008 +++ src/sys/arch/arm/xscale/pxa2x0.c Sun Aug 9 06:12:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0.c,v 1.17 2008/05/03 23:06:06 martin Exp $ */ +/* $NetBSD: pxa2x0.c,v 1.18 2009/08/09 06:12:33 kiyohara Exp $ */ /* * Copyright (c) 2002, 2005 Genetec Corporation. All rights reserved. @@ -99,7 +99,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pxa2x0.c,v 1.17 2008/05/03 23:06:06 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pxa2x0.c,v 1.18 2009/08/09 06:12:33 kiyohara Exp $"); #include "pxaintc.h" #include "pxagpio.h" @@ -242,6 +242,7 @@ aa.pxa_iot = sc->sc_bust; aa.pxa_dmat = sc->sc_dmat; + aa.pxa_name = cf->cf_name; aa.pxa_addr = cf->cf_loc[PXAIPCF_ADDR]; aa.pxa_size = cf->cf_loc[PXAIPCF_SIZE]; aa.pxa_index = cf->cf_loc[PXAIPCF_INDEX]; @@ -260,6 +261,7 @@ aa.pxa_iot = sc->sc_bust; aa.pxa_dmat = sc->sc_dmat; + aa.pxa_name = "pxaintc"; aa.pxa_addr = PXA2X0_INTCTL_BASE; aa.pxa_size = PXA2X0_INTCTL_SIZE; aa.pxa_intr = PXAIPCF_INTR_DEFAULT; @@ -269,6 +271,7 @@ #if NPXAGPIO > 0 aa.pxa_iot = sc->sc_bust; aa.pxa_dmat = sc->sc_dmat; + aa.pxa_name = "pxagpio"; aa.pxa_addr = PXA2X0_GPIO_BASE; aa.pxa_size = PXA2X0_GPIO_SIZE; aa.pxa_intr = PXAIPCF_INTR_DEFAULT; @@ -279,6 +282,7 @@ #if NPXADMAC > 0 aa.pxa_iot = sc->sc_bust; aa.pxa_dmat = sc->sc_dmat; + aa.pxa_name = "pxaidmac"; aa.pxa_addr = PXA2X0_DMAC_BASE; aa.pxa_size = PXA2X0_DMAC_SIZE; aa.pxa_intr = PXA2X0_INT_DMA; Index: src/sys/arch/arm/xscale/pxa2x0_ohci.c diff -u src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.5 src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.6 --- src/sys/arch/arm/xscale/pxa2x0_ohci.c:1.5 Thu Jan 29 14:46:06 2009 +++ src/sys/arch/arm/xscale/pxa2x0_ohci.c Sun Aug 9 06:12:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0_ohci.c,v 1.5 2009/01/29 14:46:06 nonaka Exp $ */ +/* $NetBSD: pxa2x0_ohci.c,v 1.6 2009/08/09 06:12:34 kiyohara Exp $ */ /* $OpenBSD: pxa2x0_ohci.c,v 1.19 2005/04/08 02:32:54 dlg Exp $ */ /* @@ -56,9 +56,12 @@ static int pxaohci_match(device_t parent, struct cfdata *cf, void *aux) { + struct pxaip_attach_args *pxa = aux; - if (CPU_IS_PXA270) + if (CPU_IS_PXA270 && strcmp(pxa->pxa_name, cf->cf_name) == 0) { + pxa->pxa_size = PXA2X0_USBHC_SIZE; return 1; + } return 0; } @@ -67,6 +70,7 @@ { struct pxaohci_softc *sc = device_private(self); struct pxaip_attach_args *pxa = aux; + bus_space_handle_t powman_ioh; usbd_status r; #ifdef USB_DEBUG @@ -87,12 +91,12 @@ aprint_naive("\n"); /* Map I/O space */ - if (bus_space_map(sc->sc.iot, PXA2X0_USBHC_BASE, PXA2X0_USBHC_SIZE, 0, + if (bus_space_map(sc->sc.iot, pxa->pxa_addr, pxa->pxa_size, 0, &sc->sc.ioh)) { aprint_error_dev(sc->sc.sc_dev, "couldn't map memory space\n"); return; } - sc->sc.sc_size = PXA2X0_USBHC_SIZE; + sc->sc.sc_size = pxa->pxa_size; /* XXX copied from ohci_pci.c. needed? */ bus_space_barrier(sc->sc.iot, sc->sc.ioh, 0, sc->sc.sc_size, @@ -235,7 +239,11 @@ hr = HREAD4(sc, USBHC_HR); HWRITE4(sc, USBHC_HR, (hr & USBHC_HR_MASK) & ~(USBHC_HR_SSE)); hr = HREAD4(sc, USBHC_HR); - HWRITE4(sc, USBHC_HR, (hr & USBHC_HR_MASK) & ~(USBHC_HR_SSEP2)); + HWRITE4(sc, USBHC_HR, (hr & USBHC_HR_MASK) & + ~(USBHC_HR_SSEP1 | USBHC_HR_SSEP2 | USBHC_HR_SSEP3)); + HWRITE4(sc, USBHC_HIE, USBHC_HIE_RWIE | USBHC_HIE_UPRIE); + + hr = HREAD4(sc, USBHC_UHCRHDA); } static void Index: src/sys/arch/arm/xscale/pxa2x0var.h diff -u src/sys/arch/arm/xscale/pxa2x0var.h:1.5 src/sys/arch/arm/xscale/pxa2x0var.h:1.6 --- src/sys/arch/arm/xscale/pxa2x0var.h:1.5 Wed Feb 21 22:59:39 2007 +++ src/sys/arch/arm/xscale/pxa2x0var.h Sun Aug 9 06:12:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0var.h,v 1.5 2007/02/21 22:59:39 thorpej Exp $ */ +/* $NetBSD: pxa2x0var.h,v 1.6 2009/08/09 06:12:34 kiyohara Exp $ */ /* * Copyright (c) 2002 Genetec Corporation. All rights reserved. @@ -48,6 +48,7 @@ bus_dma_tag_t pxa_dmat; int pxa_index; /* to specify device by index number */ +#define pxa_name pxa_sa.sa_name #define pxa_iot pxa_sa.sa_iot #define pxa_addr pxa_sa.sa_addr #define pxa_size pxa_sa.sa_size Index: src/sys/arch/arm/xscale/pxa2x0_rtc.c diff -u src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.1 src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.2 --- src/sys/arch/arm/xscale/pxa2x0_rtc.c:1.1 Sun Feb 25 13:46:40 2007 +++ src/sys/arch/arm/xscale/pxa2x0_rtc.c Sun Aug 9 06:12:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0_rtc.c,v 1.1 2007/02/25 13:46:40 nonaka Exp $ */ +/* $NetBSD: pxa2x0_rtc.c,v 1.2 2009/08/09 06:12:34 kiyohara Exp $ */ /* * Copyright (c) 2007 NONAKA Kimihiro <non...@netbsd.org> @@ -22,7 +22,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pxa2x0_rtc.c,v 1.1 2007/02/25 13:46:40 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pxa2x0_rtc.c,v 1.2 2009/08/09 06:12:34 kiyohara Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -72,14 +72,10 @@ { struct pxaip_attach_args *pxa = aux; - if (pxa->pxa_size == PXA270_RTC_SIZE) { - if (!CPU_IS_PXA270) { - return 0; - } - } else { - pxa->pxa_size = PXA250_RTC_SIZE; - } + if (strcmp(pxa->pxa_name, cf->cf_name) != 0) + return 0; + pxa->pxa_size = CPU_IS_PXA270 ? PXA270_RTC_SIZE : PXA250_RTC_SIZE; return 1; } @@ -93,7 +89,7 @@ aprint_normal(": PXA2x0 Real-time Clock\n"); - if (bus_space_map(sc->sc_iot, PXA2X0_RTC_BASE, pxa->pxa_size, 0, + if (bus_space_map(sc->sc_iot, pxa->pxa_addr, pxa->pxa_size, 0, &sc->sc_ioh)) { aprint_error("%s: couldn't map registers\n", sc->sc_dev.dv_xname); Index: src/sys/arch/arm/xscale/pxa2x0_udc.c diff -u src/sys/arch/arm/xscale/pxa2x0_udc.c:1.1 src/sys/arch/arm/xscale/pxa2x0_udc.c:1.2 --- src/sys/arch/arm/xscale/pxa2x0_udc.c:1.1 Sun Dec 17 16:03:33 2006 +++ src/sys/arch/arm/xscale/pxa2x0_udc.c Sun Aug 9 06:12:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0_udc.c,v 1.1 2006/12/17 16:03:33 peter Exp $ */ +/* $NetBSD: pxa2x0_udc.c,v 1.2 2009/08/09 06:12:34 kiyohara Exp $ */ /* $OpenBSD: pxa27x_udc.c,v 1.5 2005/03/30 14:24:39 dlg Exp $ */ /* @@ -52,9 +52,12 @@ static int pxaudc_match(struct device *parent, struct cfdata *cf, void *aux) { + struct pxaip_attach_args *pxa = aux; - if (CPU_IS_PXA270) + if (CPU_IS_PXA270 && strcmp(pxa->pxa_name, cf->cf_name) == 0) { + pxa->pxa_size = PXA270_USBDC_SIZE; return 1; + } return 0; } @@ -68,12 +71,12 @@ sc->sc_size = 0; sc->sc_powerhook = NULL; - if (bus_space_map(sc->sc_iot, PXA2X0_USBDC_BASE, PXA2X0_USBDC_SIZE, 0, + if (bus_space_map(sc->sc_iot, pxa->pxa_addr, pxa->pxa_size, 0, &sc->sc_ioh)) { aprint_error(": couldn't map memory space\n"); return; } - sc->sc_size = PXA2X0_USBDC_SIZE; + sc->sc_size = pxa->pxa_size; printf(": PXA2x0 USB Device Controller\n"); Index: src/sys/arch/evbarm/gumstix/gxiic.c diff -u src/sys/arch/evbarm/gumstix/gxiic.c:1.4 src/sys/arch/evbarm/gumstix/gxiic.c:1.5 --- src/sys/arch/evbarm/gumstix/gxiic.c:1.4 Mon Apr 20 12:58:33 2009 +++ src/sys/arch/evbarm/gumstix/gxiic.c Sun Aug 9 06:12:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: gxiic.c,v 1.4 2009/04/20 12:58:33 pgoyette Exp $ */ +/* $NetBSD: gxiic.c,v 1.5 2009/08/09 06:12:34 kiyohara Exp $ */ /* * Copyright (c) 2007 KIYOHARA Takashi * All rights reserved. @@ -25,13 +25,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gxiic.c,v 1.4 2009/04/20 12:58:33 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gxiic.c,v 1.5 2009/08/09 06:12:34 kiyohara Exp $"); #include <sys/param.h> #include <sys/device.h> #include <sys/errno.h> #include <sys/mutex.h> +#include <arm/xscale/pxa2x0var.h> #include <arm/xscale/pxa2x0_i2c.h> #include <evbarm/gumstix/gumstixvar.h> @@ -47,7 +48,7 @@ }; -static int gxiicmatch(device_t, struct cfdata *, void *); +static int gxiicmatch(device_t, cfdata_t, void *); static void gxiicattach(device_t, device_t, void *); /* fuctions for i2c_controller */ @@ -63,9 +64,14 @@ /* ARGSUSED */ static int -gxiicmatch(device_t parent, struct cfdata *match, void *aux) +gxiicmatch(device_t parent, cfdata_t match, void *aux) { + struct pxaip_attach_args *pxa = aux; + if (strcmp(pxa->pxa_name, match->cf_name) != 0) + return 0; + + pxa->pxa_size = PXA2X0_I2C_SIZE; return 1; } @@ -73,15 +79,15 @@ static void gxiicattach(device_t parent, device_t self, void *aux) { + struct pxaip_attach_args *pxa = aux; struct gxiic_softc *sc = device_private(self); - struct gxio_attach_args *gxa = aux; struct i2cbus_attach_args iba; aprint_normal("\n"); aprint_naive("\n"); - sc->sc_pxa_i2c.sc_iot = gxa->gxa_iot; - sc->sc_pxa_i2c.sc_size = PXA2X0_I2C_SIZE; + sc->sc_pxa_i2c.sc_iot = pxa->pxa_iot; + sc->sc_pxa_i2c.sc_size = pxa->pxa_size; if (pxa2x0_i2c_attach_sub(&sc->sc_pxa_i2c)) { aprint_error_dev(self, "unable to attach PXA I2C\n"); return; Index: src/sys/arch/evbarm/gumstix/gxmci.c diff -u src/sys/arch/evbarm/gumstix/gxmci.c:1.1 src/sys/arch/evbarm/gumstix/gxmci.c:1.2 --- src/sys/arch/evbarm/gumstix/gxmci.c:1.1 Tue Apr 21 03:00:30 2009 +++ src/sys/arch/evbarm/gumstix/gxmci.c Sun Aug 9 06:12:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: gxmci.c,v 1.1 2009/04/21 03:00:30 nonaka Exp $ */ +/* $NetBSD: gxmci.c,v 1.2 2009/08/09 06:12:34 kiyohara Exp $ */ /*- * Copyright (c) 2007 NONAKA Kimihiro <non...@netbsd.org> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gxmci.c,v 1.1 2009/04/21 03:00:30 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gxmci.c,v 1.2 2009/08/09 06:12:34 kiyohara Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -66,8 +66,9 @@ static int gxmci_write_protect(void *); static int -pxamci_match(device_t parent, cfdata_t cf, void *aux) +pxamci_match(device_t parent, cfdata_t match, void *aux) { + struct pxaip_attach_args *pxa = aux; static struct pxa2x0_gpioconf pxa25x_gxmci_gpioconf[] = { { 8, GPIO_ALT_FN_1_OUT }, /* MMCCS0 */ { 53, GPIO_ALT_FN_1_OUT }, /* MMCLK */ @@ -77,6 +78,9 @@ u_int reg; int i; + if (strcmp(pxa->pxa_name, match->cf_name) != 0) + return 0; + /* * Check GPIO configuration. If you use these, it is sure already * to have been set by gxio. @@ -89,6 +93,7 @@ GPIO_FN_IS_OUT(reg) != GPIO_FN_IS_OUT(gpioconf[i].value)) return 0; } + pxa->pxa_size = PXA2X0_MMC_SIZE; return 1; } Index: src/sys/arch/zaurus/conf/GENERIC diff -u src/sys/arch/zaurus/conf/GENERIC:1.24 src/sys/arch/zaurus/conf/GENERIC:1.25 --- src/sys/arch/zaurus/conf/GENERIC:1.24 Tue Apr 21 03:00:30 2009 +++ src/sys/arch/zaurus/conf/GENERIC Sun Aug 9 06:12:34 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.24 2009/04/21 03:00:30 nonaka Exp $ +# $NetBSD: GENERIC,v 1.25 2009/08/09 06:12:34 kiyohara Exp $ # # GENERIC machine description file # @@ -240,8 +240,8 @@ # USB Controller and Devices zusb* at pxaip? -#pxaudc0 at pxaip? # USB Device Controller -ohci0 at pxaip? # USB Host Controller +#pxaudc0 at pxaip? addr 0x40600000 # USB Device Controller +ohci0 at pxaip? addr 0x4c000000 intr 3 # USB Host Controller # PCMCIA USB controllers #slhci* at pcmcia? function ? # ScanLogic SL811HS