Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Rename awinfe to awe and awinge to awge.
details: https://anonhg.NetBSD.org/src/rev/6057d4f034d4
branches: trunk
changeset: 789798:6057d4f034d4
user: matt <matt%NetBSD.org@localhost>
date: Sun Sep 08 04:06:44 2013 +0000
description:
Rename awinfe to awe and awinge to awge.
Allow properties in awinio0 to disable devices.
Use such a property to disable probing of gige.
diffstat:
sys/arch/arm/allwinner/awin_eth.c | 6 ++++--
sys/arch/arm/allwinner/awin_gige.c | 22 +++++++++++++++++-----
sys/arch/arm/allwinner/awin_io.c | 20 +++++++++++++++++---
sys/arch/arm/allwinner/files.awin | 10 +++++-----
sys/arch/evbarm/conf/CUBIEBOARD | 17 ++++++++---------
sys/arch/evbarm/cubie/cubie_machdep.c | 10 ++++++++--
6 files changed, 59 insertions(+), 26 deletions(-)
diffs (259 lines):
diff -r f181aa24f490 -r 6057d4f034d4 sys/arch/arm/allwinner/awin_eth.c
--- a/sys/arch/arm/allwinner/awin_eth.c Sun Sep 08 03:17:02 2013 +0000
+++ b/sys/arch/arm/allwinner/awin_eth.c Sun Sep 08 04:06:44 2013 +0000
@@ -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 @@
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 @@
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;
diff -r f181aa24f490 -r 6057d4f034d4 sys/arch/arm/allwinner/awin_gige.c
--- a/sys/arch/arm/allwinner/awin_gige.c Sun Sep 08 03:17:02 2013 +0000
+++ b/sys/arch/arm/allwinner/awin_gige.c Sun Sep 08 04:06:44 2013 +0000
@@ -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 @@
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 @@
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 @@
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");
}
diff -r f181aa24f490 -r 6057d4f034d4 sys/arch/arm/allwinner/awin_io.c
--- a/sys/arch/arm/allwinner/awin_io.c Sun Sep 08 03:17:02 2013 +0000
+++ b/sys/arch/arm/allwinner/awin_io.c Sun Sep 08 04:06:44 2013 +0000
@@ -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 @@
{ "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 @@
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 @@
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,
diff -r f181aa24f490 -r 6057d4f034d4 sys/arch/arm/allwinner/files.awin
--- a/sys/arch/arm/allwinner/files.awin Sun Sep 08 03:17:02 2013 +0000
+++ b/sys/arch/arm/allwinner/files.awin Sun Sep 08 04:06:44 2013 +0000
@@ -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 @@
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)
diff -r f181aa24f490 -r 6057d4f034d4 sys/arch/evbarm/conf/CUBIEBOARD
--- a/sys/arch/evbarm/conf/CUBIEBOARD Sun Sep 08 03:17:02 2013 +0000
+++ b/sys/arch/evbarm/conf/CUBIEBOARD Sun Sep 08 04:06:44 2013 +0000
@@ -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 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 @@
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 @@
#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
diff -r f181aa24f490 -r 6057d4f034d4 sys/arch/evbarm/cubie/cubie_machdep.c
--- a/sys/arch/evbarm/cubie/cubie_machdep.c Sun Sep 08 03:17:02 2013 +0000
+++ b/sys/arch/evbarm/cubie/cubie_machdep.c Sun Sep 08 04:06:44 2013 +0000
@@ -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 @@
* 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.
Home |
Main Index |
Thread Index |
Old Index