Module Name: src Committed By: matt Date: Sun Sep 8 04:06:44 UTC 2013
Modified Files: src/sys/arch/arm/allwinner: awin_eth.c awin_gige.c awin_io.c files.awin src/sys/arch/evbarm/conf: CUBIEBOARD src/sys/arch/evbarm/cubie: cubie_machdep.c Log Message: Rename awinfe to awe and awinge to awge. Allow properties in awinio0 to disable devices. Use such a property to disable probing of gige. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/allwinner/awin_eth.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/allwinner/awin_gige.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/allwinner/awin_io.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/allwinner/files.awin cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/CUBIEBOARD cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/cubie/cubie_machdep.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/allwinner/awin_eth.c diff -u src/sys/arch/arm/allwinner/awin_eth.c:1.2 src/sys/arch/arm/allwinner/awin_eth.c:1.3 --- src/sys/arch/arm/allwinner/awin_eth.c:1.2 Sun Sep 8 00:05:27 2013 +++ src/sys/arch/arm/allwinner/awin_eth.c Sun Sep 8 04:06:44 2013 @@ -31,7 +31,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: awin_eth.c,v 1.2 2013/09/08 00:05:27 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: awin_eth.c,v 1.3 2013/09/08 04:06:44 matt Exp $"); #include <sys/bus.h> #include <sys/device.h> @@ -89,7 +89,9 @@ static int awin_eth_match(device_t parent, cfdata_t cf, void *aux) { struct awinio_attach_args * const aio = aux; +#ifdef DIAGNOSTIC const struct awin_locators * const loc = &aio->aio_loc; +#endif const struct awin_gpio_pinset * const pinset = &awin_eth_pinsets[cf->cf_flags & 1]; @@ -127,7 +129,7 @@ awin_eth_attach(device_t parent, device_ loc->loc_offset, loc->loc_size, &sc->sc_bsh); aprint_naive("\n"); - aprint_normal("\n"); + aprint_normal(": 10/100 Ethernet Controller\n"); ifp->if_softc = sc; Index: src/sys/arch/arm/allwinner/awin_gige.c diff -u src/sys/arch/arm/allwinner/awin_gige.c:1.1 src/sys/arch/arm/allwinner/awin_gige.c:1.2 --- src/sys/arch/arm/allwinner/awin_gige.c:1.1 Wed Sep 4 02:39:01 2013 +++ src/sys/arch/arm/allwinner/awin_gige.c Sun Sep 8 04:06:44 2013 @@ -31,7 +31,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: awin_gige.c,v 1.1 2013/09/04 02:39:01 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: awin_gige.c,v 1.2 2013/09/08 04:06:44 matt Exp $"); #include <sys/bus.h> #include <sys/device.h> @@ -51,6 +51,10 @@ struct awin_gige_softc { bus_dma_tag_t sc_dmat; }; +static const struct awin_gpio_pinset awin_gige_gpio_pinset = { + 'A', AWIN_PIO_PA_GMAC_FUNC, AWIN_PIO_PA_GMAC_PINS, +}; + CFATTACH_DECL_NEW(awin_gige, sizeof(struct awin_gige_softc), awin_gige_match, awin_gige_attach, NULL, NULL); @@ -58,12 +62,18 @@ static int awin_gige_match(device_t parent, cfdata_t cf, void *aux) { struct awinio_attach_args * const aio = aux; +#ifdef DIAGNOSTIC const struct awin_locators * const loc = &aio->aio_loc; - - if (strcmp(cf->cf_name, loc->loc_name)) +#endif + if (cf->cf_flags & 1) return 0; - KASSERT(cf->cf_loc[AWINIOCF_PORT] == AWINIOCF_PORT_DEFAULT); + KASSERT(!strcmp(cf->cf_name, loc->loc_name)); + KASSERT(cf->cf_loc[AWINIOCF_PORT] == AWINIOCF_PORT_DEFAULT + || cf->cf_loc[AWINIOCF_PORT] == loc->loc_port); + + if (!awin_gpio_pinset_available(&awin_gige_pinset)) + return 0; return 1; } @@ -77,11 +87,13 @@ awin_gige_attach(device_t parent, device sc->sc_dev = self; + awin_gpio_pinset_acquire(&awin_gige_pinset); + sc->sc_bst = aio->aio_core_bst; sc->sc_dmat = aio->aio_dmat; bus_space_subregion(sc->sc_bst, aio->aio_core_bsh, loc->loc_offset, loc->loc_size, &sc->sc_bsh); aprint_naive("\n"); - aprint_normal("\n"); + aprint_normal(": Gigabit Ethernet Controller\n"); } Index: src/sys/arch/arm/allwinner/awin_io.c diff -u src/sys/arch/arm/allwinner/awin_io.c:1.4 src/sys/arch/arm/allwinner/awin_io.c:1.5 --- src/sys/arch/arm/allwinner/awin_io.c:1.4 Sat Sep 7 02:46:06 2013 +++ src/sys/arch/arm/allwinner/awin_io.c Sun Sep 8 04:06:44 2013 @@ -31,7 +31,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.4 2013/09/07 02:46:06 matt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.5 2013/09/08 04:06:44 matt Exp $"); #include <sys/bus.h> #include <sys/cpu.h> @@ -118,8 +118,8 @@ static const struct awin_locators awin_l { "spi", OFFANDSIZE(SPI1), 1, AWIN_IRQ_SPI1, AANY }, { "spi", OFFANDSIZE(SPI2), 1, AWIN_IRQ_SPI2, AANY }, { "spi", OFFANDSIZE(SPI3), 3, AWIN_IRQ_SPI3, AANY }, - { "awinfe", OFFANDSIZE(EMAC), NOPORT, AWIN_IRQ_EMAC, AANY }, - { "awinge", AWIN_GMAC_OFFSET, AWIN_GMAC_SIZE, NOPORT, AWIN_IRQ_GMAC, A20 }, + { "awe", OFFANDSIZE(EMAC), NOPORT, AWIN_IRQ_EMAC, AANY }, + { "awge", AWIN_GMAC_OFFSET, AWIN_GMAC_SIZE, NOPORT, AWIN_IRQ_GMAC, A20 }, { "awincrypto", OFFANDSIZE(SS), NOPORT, AWIN_IRQ_SS, AANY }, }; @@ -143,6 +143,7 @@ awinio_attach(device_t parent, device_t struct awinio_softc * const sc = &awinio_sc; const bool a10_p = CPU_ID_CORTEX_A8_P(curcpu()->ci_arm_cpuid); const bool a20_p = CPU_ID_CORTEX_A7_P(curcpu()->ci_arm_cpuid); + prop_dictionary_t dict = device_properties(self); sc->sc_dev = self; @@ -160,12 +161,25 @@ awinio_attach(device_t parent, device_t const struct awin_locators * const eloc = awin_locators + __arraycount(awin_locators); for (const struct awin_locators *loc = awin_locators; loc < eloc; loc++) { + char prop_name[31]; + bool skip; + if (loc->loc_port == AWINIOCF_PORT_DEFAULT) { + snprintf(prop_name, sizeof(prop_name), + "no-%s", loc->loc_name); + } else { + snprintf(prop_name, sizeof(prop_name), + "no-%s-%d", loc->loc_name, loc->loc_port); + } + if (prop_dictionary_get_bool(dict, prop_name, &skip) && skip) + continue; + if (loc->loc_flags & AWINIO_ONLY) { if (a10_p && !(loc->loc_flags & AWINIO_ONLY_A10)) continue; if (a20_p && !(loc->loc_flags & AWINIO_ONLY_A20)) continue; } + struct awinio_attach_args aio = { .aio_loc = *loc, .aio_core_bst = sc->sc_bst, Index: src/sys/arch/arm/allwinner/files.awin diff -u src/sys/arch/arm/allwinner/files.awin:1.5 src/sys/arch/arm/allwinner/files.awin:1.6 --- src/sys/arch/arm/allwinner/files.awin:1.5 Sun Sep 8 00:03:59 2013 +++ src/sys/arch/arm/allwinner/files.awin Sun Sep 8 04:06:44 2013 @@ -1,4 +1,4 @@ -# $NetBSD: files.awin,v 1.5 2013/09/08 00:03:59 matt Exp $ +# $NetBSD: files.awin,v 1.6 2013/09/08 04:06:44 matt Exp $ # # Configuration info for Allwinner ARM Peripherals # @@ -72,13 +72,13 @@ attach awincrypto at awinio with awin_cr file arch/arm/allwinner/awin_crypto.c awin_crypto # A10/A20 EMAC -device awinfe { } : ether, ifnet, arp, mii -attach awinfe at awinio with awin_eth +device awe { } : ether, ifnet, arp, mii +attach awe at awinio with awin_eth file arch/arm/allwinner/awin_eth.c awin_eth # A20 GMAC -device awinge { } : ether, ifnet, arp, mii -attach awinge at awinio with awin_gige +device awge { } : ether, ifnet, arp, mii +attach awge at awinio with awin_gige file arch/arm/allwinner/awin_gige.c awin_gige # USB2 Host Controller (EHCI/OHCI) Index: src/sys/arch/evbarm/conf/CUBIEBOARD diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.7 src/sys/arch/evbarm/conf/CUBIEBOARD:1.8 --- src/sys/arch/evbarm/conf/CUBIEBOARD:1.7 Sun Sep 8 00:03:40 2013 +++ src/sys/arch/evbarm/conf/CUBIEBOARD Sun Sep 8 04:06:44 2013 @@ -1,5 +1,5 @@ # -# $NetBSD: CUBIEBOARD,v 1.7 2013/09/08 00:03:40 matt Exp $ +# $NetBSD: CUBIEBOARD,v 1.8 2013/09/08 04:06:44 matt Exp $ # # CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel # @@ -114,6 +114,9 @@ options SYSVSHM # System V-like memory #options MINIROOTSIZE=1000 # Size in blocks #options MEMORY_DISK_IS_ROOT # use memory disk as root +options DKWEDGE_AUTODISCOVER +options DKWEDGE_METHOD_GPT + # Miscellaneous kernel options options KTRACE # system call tracing, a la ktrace(1) #options KMEMSTATS # kernel memory statistics @@ -256,18 +259,13 @@ ehci* at awinusb? usb* at ohci? usb* at ehci? -# SATA (A20) +# SATA ahcisata* at awinio0 -# PATA (A10) -wdc* at awinio0 - atabus* at ata? wd* at atabus? drive ? -# 10/100 Ethernet (A10/A20) -awinfe0 at awinio0 -# Gigabit Ethernet (A20) -awinge0 at awinio0 +# 10/100/1000 Ethernet (A10/A20) +awe0 at awinio0 port ? include "dev/usb/usbdevices.config" @@ -281,6 +279,7 @@ ukphy* at mii? phy ? #pseudo-device vnd # disk-like interface to files #pseudo-device fss # file system snapshot device #pseudo-device putter # for puffs and pud +pseudo-device drvctl # driver control # network pseudo-devices pseudo-device bpfilter # Berkeley packet filter Index: src/sys/arch/evbarm/cubie/cubie_machdep.c diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.6 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.7 --- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.6 Sat Sep 7 19:47:28 2013 +++ src/sys/arch/evbarm/cubie/cubie_machdep.c Sun Sep 8 04:06:44 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: cubie_machdep.c,v 1.6 2013/09/07 19:47:28 matt Exp $ */ +/* $NetBSD: cubie_machdep.c,v 1.7 2013/09/08 04:06:44 matt Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cubie_machdep.c,v 1.6 2013/09/07 19:47:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cubie_machdep.c,v 1.7 2013/09/08 04:06:44 matt Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -510,9 +510,15 @@ cubie_device_register(device_t self, voi * frequency. */ prop_dictionary_set_uint32(dict, "frequency", AWIN_REF_FREQ); + return; } #endif + if (device_is_a(self, "awinio")) { + prop_dictionary_set_bool(dict, "no-awge", true); + return; + } + if (device_is_a(self, "awingpio")) { /* * These are GPIOs being used for various functions.