CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom
Module Name:src Committed By: matt Date: Thu Feb 7 06:51:50 UTC 2013 Modified Files: src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_board.c bcm53xx_eth.c bcm53xx_idm.c bcm53xx_reg.h bcm53xx_rng.c Log Message: Sync bcm53xx support to HEAD. To generate a diff of this commit: cvs rdiff -u -r1.8.4.2 -r1.8.4.3 src/sys/arch/arm/broadcom/bcm53xx_board.c cvs rdiff -u -r1.17.2.3 -r1.17.2.4 src/sys/arch/arm/broadcom/bcm53xx_eth.c cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/arch/arm/broadcom/bcm53xx_idm.c cvs rdiff -u -r1.10.2.3 -r1.10.2.4 src/sys/arch/arm/broadcom/bcm53xx_reg.h cvs rdiff -u -r1.3.4.2 -r1.3.4.3 src/sys/arch/arm/broadcom/bcm53xx_rng.c 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/broadcom/bcm53xx_board.c diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.2 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.3 --- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.2 Wed Nov 28 22:40:21 2012 +++ src/sys/arch/arm/broadcom/bcm53xx_board.c Thu Feb 7 06:51:48 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm53xx_board.c,v 1.8.4.2 2012/11/28 22:40:21 matt Exp $ */ +/* $NetBSD: bcm53xx_board.c,v 1.8.4.3 2013/02/07 06:51:48 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -34,7 +34,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.2 2012/11/28 22:40:21 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.3 2013/02/07 06:51:48 matt Exp $"); #include #include @@ -65,7 +65,6 @@ bus_space_tag_t bcm53xx_armcore_bst = &b bus_space_handle_t bcm53xx_armcore_bsh; static struct cpu_softc cpu_softc; -static struct bcm53xx_clock_info clk_info; struct arm32_dma_range bcm53xx_dma_ranges[2] = { [0] = { @@ -450,23 +449,24 @@ void bcm53xx_print_clocks(void) { #if defined(VERBOSE_ARM_INIT) - printf("ref clk = %u (%#x)\n", clk_info.clk_ref, clk_info.clk_ref); - printf("sys clk = %u (%#x)\n", clk_info.clk_sys, clk_info.clk_sys); - printf("lcpll clk = %u (%#x)\n", clk_info.clk_lcpll, clk_info.clk_lcpll); - printf("pcie ref clk = %u (%#x) [CH0]\n", clk_info.clk_pcie_ref, clk_info.clk_pcie_ref); - printf("sdio clk = %u (%#x) [CH1]\n", clk_info.clk_sdio, clk_info.clk_sdio); - printf("ddr ref clk = %u (%#x) [CH2]\n", clk_info.clk_ddr_ref, clk_info.clk_ddr_ref); - printf("axi clk = %u (%#x) [CH3]\n", clk_info.clk_axi, clk_info.clk_axi); - printf("genpll clk = %u (%#x)\n", clk_info.clk_genpll, clk_info.clk_genpll); - printf("mac clk = %u (%#x) [CH0]\n", clk_info.clk_mac, clk_info.clk_mac); - printf("robo clk = %u (%#x) [CH1]\n", clk_info.clk_robo, clk_info.clk_robo); - printf("usb2 clk = %u (%#x) [CH2]\n", clk_info.clk_usb2, clk_info.clk_usb2); - printf("iproc clk = %u (%#x) [CH3]\n", clk_info.clk_iproc, clk_info.clk_iproc); - printf("ddr clk = %u (%#x)\n", clk_info.clk_ddr, clk_info.clk_ddr); - printf("ddr mhz = %u (%#x)\n", clk_info.clk_ddr_mhz, clk_info.clk_ddr_mhz); - printf("cpu clk = %u (%#x)\n", clk_info.clk_cpu, clk_info.clk_cpu); - printf("apb clk = %u (%#x)\n", clk_info.clk_apb, clk_info.clk_apb); - printf("usb ref clk = %u (%#x)\n", clk_info.clk_usb_ref, clk_info.clk_usb_ref); + const struct bcm53xx_clock_info * const clk = &cpu_softc.cpu_clk; + printf("ref clk = %u (%#x)\n", clk->clk_ref, clk->clk_ref); + printf("sys clk = %u (%#x)\n", clk->clk_sys, clk->clk_sys); + printf("lcpll clk = %u (%#x)\n", clk->clk_lcpll, clk->clk_lcpll); + printf("pcie ref clk = %u (%#x) [CH0]\n", clk->clk_pcie_ref, clk->clk_pcie_ref); + printf("sdio clk = %u (%#x) [CH1]\n", clk->clk_sdio, clk->clk_sdio); + printf("ddr ref clk = %u (%#x) [CH2]\n", clk->clk_ddr_ref, clk->clk_ddr_ref); + printf("axi clk = %u (%#x) [CH3]\n", clk->clk_axi, clk->clk_axi); + printf("genpll clk = %u (%#x)\n", clk->clk_genpll, clk->clk_genpll); + printf("mac clk = %u (%#x) [CH0]\n", clk->clk_mac, clk->clk_mac); + printf("robo clk = %u (%#x) [CH1]\n", clk->clk_robo, clk->clk_robo); + printf("usb2 clk = %u (%#x) [CH2]\n", clk->clk_usb2, clk->clk_usb2); + printf("iproc clk = %u (%#x) [CH3]\n", clk->clk_iproc, clk->clk_iproc); + printf("ddr clk = %u (%#x)\n", clk->clk_ddr, clk->clk_ddr); + printf("ddr mhz = %u (%#x)\n", clk->clk_ddr_mhz, clk->clk_ddr_mhz); + printf("cpu clk = %u (%#x)\n", clk->clk_cpu, clk->clk_cpu); + printf("apb clk = %u (%#x)\n", clk->clk_apb, clk->clk_apb); + printf("usb ref clk = %u (%#x)\n", clk->clk_usb_ref, clk->clk_usb_ref); #endif } @@ -500,7 +500,7 @@ bcm53xx_bootstrap(vaddr_t iobase) bcm53xx_get_chip_ioreg_state(&bcs, bcm53xx_ioreg_bst, bcm53xx_ioreg_bsh); bcm53xx_get_chip_armcore_state(&bcs, bcm53xx_armcore_bst, bcm53xx_armcore_bsh); - struct bcm53xx_clock_info * const clk = &clk_info; + struct bcm53xx_clock_info * const clk = &cpu_softc.cpu_clk; bcm53xx_clock_init(clk); bcm53xx_lcpll_clock_init(clk, bcs.bcs_lcpll_control1, @@ -575,7 +575,7 @@ bcm53xx_device_register(device_t self, v * to ti
CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom
Module Name:src Committed By: matt Date: Wed Feb 13 23:52:18 UTC 2013 Modified Files: src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_board.c Log Message: Sync with HEAD To generate a diff of this commit: cvs rdiff -u -r1.8.4.3 -r1.8.4.4 src/sys/arch/arm/broadcom/bcm53xx_board.c 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/broadcom/bcm53xx_board.c diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.3 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.4 --- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.3 Thu Feb 7 06:51:48 2013 +++ src/sys/arch/arm/broadcom/bcm53xx_board.c Wed Feb 13 23:52:18 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm53xx_board.c,v 1.8.4.3 2013/02/07 06:51:48 matt Exp $ */ +/* $NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -34,7 +34,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.3 2013/02/07 06:51:48 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $"); #include #include @@ -66,7 +66,7 @@ bus_space_handle_t bcm53xx_armcore_bsh; static struct cpu_softc cpu_softc; -struct arm32_dma_range bcm53xx_dma_ranges[2] = { +struct arm32_dma_range bcm53xx_dma_ranges[] = { [0] = { .dr_sysbase = 0x8000, .dr_busbase = 0x8000, @@ -85,15 +85,17 @@ struct arm32_bus_dma_tag bcm53xx_dma_tag _BUS_DMATAG_FUNCS, }; -struct arm32_dma_range bcm53xx_coherent_dma_ranges[2] = { +struct arm32_dma_range bcm53xx_coherent_dma_ranges[] = { [0] = { .dr_sysbase = 0x8000, .dr_busbase = 0x8000, .dr_len = 0x1000, .dr_flags = _BUS_DMAMAP_COHERENT, +#ifndef _ARM32_NEED_BUS_DMA_BOUNCE }, [1] = { .dr_sysbase = 0x9000, .dr_busbase = 0x9000, +#endif }, }; @@ -521,19 +523,23 @@ bcm53xx_bootstrap(vaddr_t iobase) void bcm53xx_dma_bootstrap(psize_t memsize) { - if (memsize > 256*1024*1024) { + if (memsize <= 256*1024*1024) { + bcm53xx_dma_ranges[0].dr_len = memsize; + bcm53xx_coherent_dma_ranges[0].dr_len = memsize; + bcm53xx_dma_tag._nranges = 1; +#ifndef _ARM32_NEED_BUS_DMA_BOUNCE + bcm53xx_coherent_dma_tag._nranges = 1; +#endif + } else { /* * By setting up two ranges, bus_dmamem_alloc will always * try to allocate from range 0 first resulting in allocations * below 256MB which for PCI and GMAC are coherent. */ bcm53xx_dma_ranges[1].dr_len = memsize - 0x1000; +#ifndef _ARM32_NEED_BUS_DMA_BOUNCE bcm53xx_coherent_dma_ranges[1].dr_len = memsize - 0x1000; - } else { - bcm53xx_dma_ranges[0].dr_len = memsize; - bcm53xx_coherent_dma_ranges[0].dr_len = memsize; - bcm53xx_dma_tag._nranges = 1; - bcm53xx_coherent_dma_tag._nranges = 1; +#endif } KASSERT(bcm53xx_dma_tag._ranges[0].dr_flags == 0); KASSERT(bcm53xx_coherent_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);
CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom
Module Name:src Committed By: matt Date: Tue Feb 19 02:22:02 UTC 2013 Modified Files: src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_board.c bcm53xx_eth.c bcm53xx_pax.c bcm53xx_var.h Log Message: Sync with HEAD. To generate a diff of this commit: cvs rdiff -u -r1.8.4.4 -r1.8.4.5 src/sys/arch/arm/broadcom/bcm53xx_board.c cvs rdiff -u -r1.17.2.4 -r1.17.2.5 src/sys/arch/arm/broadcom/bcm53xx_eth.c cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/sys/arch/arm/broadcom/bcm53xx_pax.c cvs rdiff -u -r1.4.4.2 -r1.4.4.3 src/sys/arch/arm/broadcom/bcm53xx_var.h 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/broadcom/bcm53xx_board.c diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.4 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.5 --- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.4 Wed Feb 13 23:52:18 2013 +++ src/sys/arch/arm/broadcom/bcm53xx_board.c Tue Feb 19 02:22:02 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $ */ +/* $NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -34,7 +34,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $"); #include #include @@ -91,11 +91,9 @@ struct arm32_dma_range bcm53xx_coherent_ .dr_busbase = 0x8000, .dr_len = 0x1000, .dr_flags = _BUS_DMAMAP_COHERENT, -#ifndef _ARM32_NEED_BUS_DMA_BOUNCE }, [1] = { .dr_sysbase = 0x9000, .dr_busbase = 0x9000, -#endif }, }; @@ -107,6 +105,25 @@ struct arm32_bus_dma_tag bcm53xx_coheren _BUS_DMATAG_FUNCS, }; +#ifdef _ARM32_NEED_BUS_DMA_BOUNCE +struct arm32_dma_range bcm53xx_bounce_dma_ranges[] = { + [0] = { + .dr_sysbase = 0x8000, + .dr_busbase = 0x8000, + .dr_len = 0x1000, + .dr_flags = _BUS_DMAMAP_COHERENT, + }, +}; + +struct arm32_bus_dma_tag bcm53xx_bounce_dma_tag = { + ._ranges = bcm53xx_bounce_dma_ranges, + ._nranges = __arraycount(bcm53xx_bounce_dma_ranges), + _BUS_DMAMAP_FUNCS, + _BUS_DMAMEM_FUNCS, + _BUS_DMATAG_FUNCS, +}; +#endif + #ifdef BCM53XX_CONSOLE_EARLY #include #include @@ -529,6 +546,8 @@ bcm53xx_dma_bootstrap(psize_t memsize) bcm53xx_dma_tag._nranges = 1; #ifndef _ARM32_NEED_BUS_DMA_BOUNCE bcm53xx_coherent_dma_tag._nranges = 1; +#else + bcm53xx_bounce_dma_ranges[0].dr_len = memsize; #endif } else { /* @@ -537,12 +556,16 @@ bcm53xx_dma_bootstrap(psize_t memsize) * below 256MB which for PCI and GMAC are coherent. */ bcm53xx_dma_ranges[1].dr_len = memsize - 0x1000; -#ifndef _ARM32_NEED_BUS_DMA_BOUNCE bcm53xx_coherent_dma_ranges[1].dr_len = memsize - 0x1000; +#ifdef _ARM32_NEED_BUS_DMA_BOUNCE + bcm53xx_bounce_dma_ranges[1].dr_len = memsize - 0x1000; #endif } KASSERT(bcm53xx_dma_tag._ranges[0].dr_flags == 0); KASSERT(bcm53xx_coherent_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT); +#ifdef _ARM32_NEED_BUS_DMA_BOUNCE + KASSERT(bcm53xx_bounce_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT); +#endif } #ifdef MULTIPROCESSOR Index: src/sys/arch/arm/broadcom/bcm53xx_eth.c diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.4 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.5 --- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.4 Thu Feb 7 06:51:49 2013 +++ src/sys/arch/arm/broadcom/bcm53xx_eth.c Tue Feb 19 02:22:02 2013 @@ -35,7 +35,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.4 2013/02/07 06:51:49 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.5 2013/02/19 02:22:02 matt Exp $"); #include #include @@ -281,6 +281,11 @@ bcmeth_ccb_attach(device_t parent, devic * We need to use the coherent dma tag for the GMAC. */ sc->sc_dmat = &bcm53xx_coherent_dma_tag; +#if _ARM32_NEED_BUS_DMA_BOUNCE + if (device_cfdata(self)->cf_flags & 2) { + sc->sc_dmat = &bcm53xx_bounce_dma_tag; + } +#endif prop_data_t eaprop = prop_dictionary_get(dict, "mac-address"); if (eaprop == NULL) { Index: src/sys/arch/arm/broadcom/bcm53xx_pax.c diff -u src/sys/arch/arm/broadcom/bcm53xx_pax.c:1.7.4.2 src/sys/arch/arm/broadcom/bcm53xx_pax.c:1.7.4.3 --- src/sys/arch/arm/broadcom/bcm53xx_pax.c:1.7.4.2 Wed Nov 28 22:40:23 2012 +++ src/sys/arch/arm/broadcom/bcm53xx_pax.c Tue Feb 19 02:22:02 2013 @@ -34,7 +34,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: bcm53xx_pax.c,v 1.7.4.2 2012/11/28 22:40:23 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: bcm53xx_pax.c,v 1.7.4.3 2013/02/19 02:22:02 matt Exp $"); #include #include @@ -199,10 +199,15 @@ bcmpax_ccb_attach(device_t parent, devic struct bcmccb_attach_args * const ccbaa = aux; const struct bcm_locators * const loc = &ccbaa->ccbaa_loc; const char * const xname = device_xname(self); + cfdata_t cf = de
CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom
Module Name:src Committed By: matt Date: Tue Feb 19 02:31:55 UTC 2013 Modified Files: src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_board.c Log Message: Sync with HEAD. To generate a diff of this commit: cvs rdiff -u -r1.8.4.5 -r1.8.4.6 src/sys/arch/arm/broadcom/bcm53xx_board.c 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/broadcom/bcm53xx_board.c diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.5 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.6 --- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.5 Tue Feb 19 02:22:02 2013 +++ src/sys/arch/arm/broadcom/bcm53xx_board.c Tue Feb 19 02:31:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $ */ +/* $NetBSD: bcm53xx_board.c,v 1.8.4.6 2013/02/19 02:31:55 matt Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -34,7 +34,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.6 2013/02/19 02:31:55 matt Exp $"); #include #include @@ -106,18 +106,9 @@ struct arm32_bus_dma_tag bcm53xx_coheren }; #ifdef _ARM32_NEED_BUS_DMA_BOUNCE -struct arm32_dma_range bcm53xx_bounce_dma_ranges[] = { - [0] = { - .dr_sysbase = 0x8000, - .dr_busbase = 0x8000, - .dr_len = 0x1000, - .dr_flags = _BUS_DMAMAP_COHERENT, - }, -}; - struct arm32_bus_dma_tag bcm53xx_bounce_dma_tag = { - ._ranges = bcm53xx_bounce_dma_ranges, - ._nranges = __arraycount(bcm53xx_bounce_dma_ranges), + ._ranges = bcm53xx_coherent_dma_ranges, + ._nranges = 1, _BUS_DMAMAP_FUNCS, _BUS_DMAMEM_FUNCS, _BUS_DMATAG_FUNCS, @@ -544,11 +535,7 @@ bcm53xx_dma_bootstrap(psize_t memsize) bcm53xx_dma_ranges[0].dr_len = memsize; bcm53xx_coherent_dma_ranges[0].dr_len = memsize; bcm53xx_dma_tag._nranges = 1; -#ifndef _ARM32_NEED_BUS_DMA_BOUNCE bcm53xx_coherent_dma_tag._nranges = 1; -#else - bcm53xx_bounce_dma_ranges[0].dr_len = memsize; -#endif } else { /* * By setting up two ranges, bus_dmamem_alloc will always @@ -557,9 +544,6 @@ bcm53xx_dma_bootstrap(psize_t memsize) */ bcm53xx_dma_ranges[1].dr_len = memsize - 0x1000; bcm53xx_coherent_dma_ranges[1].dr_len = memsize - 0x1000; -#ifdef _ARM32_NEED_BUS_DMA_BOUNCE - bcm53xx_bounce_dma_ranges[1].dr_len = memsize - 0x1000; -#endif } KASSERT(bcm53xx_dma_tag._ranges[0].dr_flags == 0); KASSERT(bcm53xx_coherent_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);
CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom
Module Name:src Committed By: matt Date: Thu Nov 29 18:42:06 UTC 2012 Modified Files: src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_reg.h bcm53xx_usb.c Log Message: Sync with HEAD. To generate a diff of this commit: cvs rdiff -u -r1.10.2.2 -r1.10.2.3 src/sys/arch/arm/broadcom/bcm53xx_reg.h cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/arch/arm/broadcom/bcm53xx_usb.c 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/broadcom/bcm53xx_reg.h diff -u src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.10.2.2 src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.10.2.3 --- src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.10.2.2 Wed Nov 28 22:40:23 2012 +++ src/sys/arch/arm/broadcom/bcm53xx_reg.h Thu Nov 29 18:42:05 2012 @@ -658,6 +658,13 @@ #endif /* IDM_PRIVATE */ +#ifdef USBH_PRIVATE +#define USBH_PHY_CTRL_P0 0x200 +#define USBH_PHY_CTRL_P1 0x204 + +#define USBH_PHY_CTRL_INIT 0x3ff +#endif + #ifdef GMAC_PRIVATE struct gmac_txdb { Index: src/sys/arch/arm/broadcom/bcm53xx_usb.c diff -u src/sys/arch/arm/broadcom/bcm53xx_usb.c:1.2.4.2 src/sys/arch/arm/broadcom/bcm53xx_usb.c:1.2.4.3 --- src/sys/arch/arm/broadcom/bcm53xx_usb.c:1.2.4.2 Wed Nov 28 22:40:24 2012 +++ src/sys/arch/arm/broadcom/bcm53xx_usb.c Thu Nov 29 18:42:05 2012 @@ -26,12 +26,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +#define USBH_PRIVATE #include "locators.h" #include -__KERNEL_RCSID(1, "$NetBSD: bcm53xx_usb.c,v 1.2.4.2 2012/11/28 22:40:24 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: bcm53xx_usb.c,v 1.2.4.3 2012/11/29 18:42:05 matt Exp $"); #include #include @@ -242,6 +243,14 @@ bcmusb_ccb_attach(device_t parent, devic 0x1000, &usbsc->usbsc_ohci_bsh); /* + * Bring the PHYs out of reset. + */ + bus_space_write_4(usbsc->usbsc_bst, usbsc->usbsc_ehci_bsh, + USBH_PHY_CTRL_P0, USBH_PHY_CTRL_INIT); + bus_space_write_4(usbsc->usbsc_bst, usbsc->usbsc_ehci_bsh, + USBH_PHY_CTRL_P1, USBH_PHY_CTRL_INIT); + + /* * Disable interrupts */ bus_space_write_4(usbsc->usbsc_bst, usbsc->usbsc_ohci_bsh,
CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom
Module Name:src Committed By: matt Date: Fri Dec 7 22:47:13 UTC 2012 Modified Files: src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_eth.c files.bcm53xx Log Message: Sync with HEAD. To generate a diff of this commit: cvs rdiff -u -r1.17.2.2 -r1.17.2.3 src/sys/arch/arm/broadcom/bcm53xx_eth.c cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/arch/arm/broadcom/files.bcm53xx 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/broadcom/bcm53xx_eth.c diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.2 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.3 --- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.2 Wed Nov 28 22:40:22 2012 +++ src/sys/arch/arm/broadcom/bcm53xx_eth.c Fri Dec 7 22:47:13 2012 @@ -31,10 +31,11 @@ #define GMAC_PRIVATE #include "locators.h" +#include "opt_broadcom.h" #include -__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.2 2012/11/28 22:40:22 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.3 2012/12/07 22:47:13 matt Exp $"); #include #include @@ -63,6 +64,13 @@ __KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth. //#define BCMETH_MPSAFE +#ifdef BCMETH_COUNTERS +#define BCMETH_EVCNT_ADD(a,b) ((void)((a).ev_count += (b))) +#else +#define BCMETH_EVCNT_ADD(a,b) do { } while (/*CONSTCOND*/0) +#endif +#define BCMETH_EVCNT_INCR(a) BCMETH_EVCNT_ADD((a), 1) + #define BCMETH_RCVOFFSET 10 #define BCMETH_MAXTXMBUFS 128 #define BCMETH_NTXSEGS 30 @@ -148,12 +156,14 @@ struct bcmeth_softc { #define SOFT_RXINTR 0x01 #define SOFT_TXINTR 0x02 +#ifdef BCMETH_COUNTERS struct evcnt sc_ev_intr; struct evcnt sc_ev_soft_intr; struct evcnt sc_ev_work; struct evcnt sc_ev_tx_stall; struct evcnt sc_ev_rx_badmagic_lo; struct evcnt sc_ev_rx_badmagic_hi; +#endif struct ifqueue sc_rx_bufcache; struct bcmeth_mapcache *sc_rx_mapcache; @@ -386,6 +396,7 @@ bcmeth_ccb_attach(device_t parent, devic if_attach(ifp); ether_ifattach(ifp, sc->sc_enaddr); +#ifdef BCMETH_COUNTERS evcnt_attach_dynamic(&sc->sc_ev_intr, EVCNT_TYPE_INTR, NULL, xname, "intr"); evcnt_attach_dynamic(&sc->sc_ev_soft_intr, EVCNT_TYPE_INTR, @@ -398,6 +409,7 @@ bcmeth_ccb_attach(device_t parent, devic NULL, xname, "rx badmagic lo"); evcnt_attach_dynamic(&sc->sc_ev_rx_badmagic_hi, EVCNT_TYPE_MISC, NULL, xname, "rx badmagic hi"); +#endif } static int @@ -1056,9 +1068,9 @@ bcmeth_rxq_consume( if (rxsts == BCMETH_RCVMAGIC) { ifp->if_ierrors++; if ((m->m_ext.ext_paddr >> 28) == 8) { -sc->sc_ev_rx_badmagic_lo.ev_count++; +BCMETH_EVCNT_INCR(sc->sc_ev_rx_badmagic_lo); } else { -sc->sc_ev_rx_badmagic_hi.ev_count++; +BCMETH_EVCNT_INCR( sc->sc_ev_rx_badmagic_hi); } IF_ENQUEUE(&sc->sc_rx_bufcache, m); } else @@ -1709,7 +1721,7 @@ bcmeth_intr(void *arg) mutex_enter(sc->sc_hwlock); uint32_t intmask = sc->sc_intmask; - sc->sc_ev_intr.ev_count++; + BCMETH_EVCNT_INCR(sc->sc_ev_intr); for (;;) { uint32_t intstatus = bcmeth_read_4(sc, GMAC_INTSTATUS); @@ -1821,7 +1833,7 @@ bcmeth_soft_txintr(struct bcmeth_softc * */ if (!bcmeth_txq_consume(sc, &sc->sc_txq) || !bcmeth_txq_enqueue(sc, &sc->sc_txq)) { - sc->sc_ev_tx_stall.ev_count++; + BCMETH_EVCNT_INCR(sc->sc_ev_tx_stall); sc->sc_if.if_flags |= IFF_OACTIVE; } else { sc->sc_if.if_flags &= ~IFF_OACTIVE; @@ -1847,7 +1859,7 @@ bcmeth_soft_intr(void *arg) u_int soft_flags = atomic_swap_uint(&sc->sc_soft_flags, 0); - sc->sc_ev_soft_intr.ev_count++; + BCMETH_EVCNT_INCR(sc->sc_ev_soft_intr); if ((soft_flags & SOFT_TXINTR) || bcmeth_txq_active_p(sc, &sc->sc_txq)) { @@ -1857,7 +1869,7 @@ bcmeth_soft_intr(void *arg) */ if (!bcmeth_txq_consume(sc, &sc->sc_txq) || !bcmeth_txq_enqueue(sc, &sc->sc_txq)) { - sc->sc_ev_tx_stall.ev_count++; + BCMETH_EVCNT_INCR(sc->sc_ev_tx_stall); ifp->if_flags |= IFF_OACTIVE; } else { ifp->if_flags &= ~IFF_OACTIVE; @@ -1893,7 +1905,7 @@ bcmeth_worker(struct work *wk, void *arg mutex_enter(sc->sc_lock); - sc->sc_ev_work.ev_count++; + BCMETH_EVCNT_INCR(sc->sc_ev_work); uint32_t work_flags = atomic_swap_32(&sc->sc_work_flags, 0); if (work_flags & WORK_REINIT) { Index: src/sys/arch/arm/broadcom/files.bcm53xx diff -u src/sys/arch/arm/broadcom/files.bcm53xx:1.2.4.2 src/sys/arch/arm/broadcom/files.bcm53xx:1.2.4.3 --- src/sys/arch/arm/broadcom/files.bcm53xx:1.2.4.2 Wed Nov 28 22:40:24 2012 +++ src/sys/arch/arm/broadcom/files.bcm53xx Fri Dec 7 22:47:13 2012 @@ -1,4 +1,4 @@ -# $NetBSD: files.bcm53xx,v 1.2.4.2 2012/11/28 22:40:24 matt Exp $ +# $NetBSD: files.bcm53xx,v 1.2.4.3 2012/12/07 22:47:13 matt Exp $ # # Configuration info for Broadcom BCM5301X ARM Peripherals # @@ -20,6 +20,7 @@ defparam opt_broadcom.hCONSPEED defparam opt_broadcom.hCONMODE defparam opt_broadcom.hMEMSIZE defflag opt_broadcom.hBCM53XX_CONSOLE_EARLY +defflag opt_broadcom.hBCMET