diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2019-09-15 07:15:15 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2019-09-15 07:15:15 +0000 |
commit | 14c9317f5f7524d192302464950e0d0e8c9ea7fd (patch) | |
tree | ef47fbb1ecc32fb364274859a3cc5d34d4eecd75 /sys/arch | |
parent | b1c1f301cd982d3206470e0fb51b1cdf4f3c80bf (diff) |
Attach packet interfaces to octpip to use fdt.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/octeon/conf/GENERIC | 5 | ||||
-rw-r--r-- | sys/arch/octeon/conf/RAMDISK | 5 | ||||
-rw-r--r-- | sys/arch/octeon/conf/files.octeon | 5 | ||||
-rw-r--r-- | sys/arch/octeon/dev/cn30xxgmx.c | 4 | ||||
-rw-r--r-- | sys/arch/octeon/dev/octeon_iobus.c | 30 |
5 files changed, 12 insertions, 37 deletions
diff --git a/sys/arch/octeon/conf/GENERIC b/sys/arch/octeon/conf/GENERIC index 4803c966345..220ddf3221c 100644 --- a/sys/arch/octeon/conf/GENERIC +++ b/sys/arch/octeon/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.49 2019/09/07 14:03:52 visa Exp $ +# $OpenBSD: GENERIC,v 1.50 2019/09/15 07:15:14 visa Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -57,9 +57,10 @@ octcit* at fdt? # Interrupt controller v3 octciu* at fdt? # Interrupt controller v1 octgpio* at fdt? # GPIO controller octmmc* at fdt? # MMC host controller +octpip* at fdt? # Packet input processing unit sdmmc* at octmmc? # SD/MMC bus -cn30xxgmx* at iobus? irq 48 +cn30xxgmx* at octpip? cnmac* at cn30xxgmx? rgephy* at mii? diff --git a/sys/arch/octeon/conf/RAMDISK b/sys/arch/octeon/conf/RAMDISK index ded22945e87..e1e7528d09a 100644 --- a/sys/arch/octeon/conf/RAMDISK +++ b/sys/arch/octeon/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.42 2019/09/07 14:03:52 visa Exp $ +# $OpenBSD: RAMDISK,v 1.43 2019/09/15 07:15:14 visa Exp $ machine octeon mips64 maxusers 4 @@ -55,9 +55,10 @@ octcit* at fdt? # Interrupt controller v3 octciu* at fdt? # Interrupt controller v1 octgpio* at fdt? # GPIO controller octmmc* at fdt? # MMC host controller +octpip* at fdt? # Packet input processing unit sdmmc* at octmmc? # SD/MMC bus -cn30xxgmx* at iobus? irq 48 +cn30xxgmx* at octpip? cnmac* at cn30xxgmx? pciide* at pci? flags 0x0000 diff --git a/sys/arch/octeon/conf/files.octeon b/sys/arch/octeon/conf/files.octeon index 57f777875ba..17f4d8e444b 100644 --- a/sys/arch/octeon/conf/files.octeon +++ b/sys/arch/octeon/conf/files.octeon @@ -1,4 +1,4 @@ -# $OpenBSD: files.octeon,v 1.53 2019/09/15 06:57:05 visa Exp $ +# $OpenBSD: files.octeon,v 1.54 2019/09/15 07:15:14 visa Exp $ # Standard stanzas config(8) can't run without maxpartitions 16 @@ -115,8 +115,9 @@ device cn30xxsmi {} attach cn30xxsmi at fdt file arch/octeon/dev/cn30xxsmi.c cn30xxsmi +define octpip {} device cn30xxgmx {} -attach cn30xxgmx at iobus +attach cn30xxgmx at octpip file arch/octeon/dev/cn30xxgmx.c cn30xxgmx device cnmac: ether, ifnet, mii, ifmedia diff --git a/sys/arch/octeon/dev/cn30xxgmx.c b/sys/arch/octeon/dev/cn30xxgmx.c index fb5c2a05bf2..23a810fa2b7 100644 --- a/sys/arch/octeon/dev/cn30xxgmx.c +++ b/sys/arch/octeon/dev/cn30xxgmx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cn30xxgmx.c,v 1.40 2017/11/20 15:13:08 visa Exp $ */ +/* $OpenBSD: cn30xxgmx.c,v 1.41 2019/09/15 07:15:14 visa Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -162,8 +162,6 @@ cn30xxgmx_match(struct device *parent, void *match, void *aux) if (strcmp(cf->cf_driver->cd_name, aa->aa_name) != 0) return 0; - if (cf->cf_unit != aa->aa_unitno) - return 0; return 1; } diff --git a/sys/arch/octeon/dev/octeon_iobus.c b/sys/arch/octeon/dev/octeon_iobus.c index 477fdf87c4b..0a3e42c6cd8 100644 --- a/sys/arch/octeon/dev/octeon_iobus.c +++ b/sys/arch/octeon/dev/octeon_iobus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octeon_iobus.c,v 1.24 2019/09/07 13:58:58 visa Exp $ */ +/* $OpenBSD: octeon_iobus.c,v 1.25 2019/09/15 07:15:14 visa Exp $ */ /* * Copyright (c) 2000-2004 Opsycon AB (www.opsycon.se) @@ -51,7 +51,6 @@ #include <machine/octeon_model.h> #include <octeon/dev/iobusvar.h> -#include <octeon/dev/cn30xxgmxreg.h> #include <octeon/dev/octhcireg.h> /* USBN_BASE */ int iobusmatch(struct device *, void *, void *); @@ -207,7 +206,7 @@ iobusattach(struct device *parent, struct device *self, void *aux) struct fdt_attach_args fa; struct octeon_config oc; struct device *sc = self; - int chipid, i, ngmx, soc; + int soc; iobus_found = 1; @@ -236,31 +235,6 @@ iobusattach(struct device *parent, struct device *self, void *aux) config_search(iobussearch, self, sc); - chipid = octeon_get_chipid(); - switch (octeon_model_family(chipid)) { - case OCTEON_MODEL_FAMILY_CN30XX: - case OCTEON_MODEL_FAMILY_CN50XX: - default: - ngmx = 1; - break; - case OCTEON_MODEL_FAMILY_CN61XX: - case OCTEON_MODEL_FAMILY_CN71XX: - ngmx = 2; - break; - case OCTEON_MODEL_FAMILY_CN73XX: - ngmx = 0; - break; - } - for (i = 0; i < ngmx; i++) { - aa.aa_name = "cn30xxgmx"; - aa.aa_bust = &iobus_tag; - aa.aa_dmat = &iobus_bus_dma_tag; - aa.aa_addr = GMX0_BASE_PORT0 + GMX_BLOCK_SIZE * i; - aa.aa_irq = -1; - aa.aa_unitno = i; - config_found_sm(self, &aa, iobusprint, iobussubmatch); - } - if (octeon_ver == OCTEON_2 || octeon_ver == OCTEON_3) { memset(&aa, 0, sizeof(aa)); aa.aa_name = "octpcie"; |