summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-05-25 16:23:59 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-05-25 16:23:59 +0000
commit0ee7790b8fc63df37f28852fdc4327a58c6565b7 (patch)
treebc9a1db2753c4c3b32a94335b8485aa36c7a5182 /sys
parentbddffa476bf561f2cbec7d85c3d5c0e19f2b7d20 (diff)
Specify the PHY to be used in the kernel config instead of hardcoding it
int tsec(4).
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/socppc/conf/GENERIC8
-rw-r--r--sys/arch/socppc/conf/files.socppc4
-rw-r--r--sys/arch/socppc/dev/if_tsec.c5
-rw-r--r--sys/arch/socppc/dev/obio.c3
-rw-r--r--sys/arch/socppc/include/autoconf.h4
5 files changed, 15 insertions, 9 deletions
diff --git a/sys/arch/socppc/conf/GENERIC b/sys/arch/socppc/conf/GENERIC
index 122a8c5318b..f4595f6fa26 100644
--- a/sys/arch/socppc/conf/GENERIC
+++ b/sys/arch/socppc/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.4 2008/05/19 19:57:57 kettenis Exp $
+# $OpenBSD: GENERIC,v 1.5 2008/05/25 16:23:58 kettenis Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -62,8 +62,10 @@ rum* at uhub? # Ralink RT2501USB/RT2601USB
sd* at scsibus?
# On-board TSEC
-tsec0 at obio? addr 0x24000 ivec 32
-tsec1 at obio? addr 0x25000 ivec 35
+tsec0 at obio? addr 0x24000 ivec 32 phy 17
+tsec1 at obio? addr 0x25000 ivec 35 phy 5
rgephy* at mii? # Realtek 8169S/8110S PHY
+eephy* at mii? # Marvell 88E1000 series PHY
+gentbi* at mii? # Generic 1000BASE-X ten-bit PHY
ukphy* at mii? # generic unknown PHYs
diff --git a/sys/arch/socppc/conf/files.socppc b/sys/arch/socppc/conf/files.socppc
index 1a98af17083..e79ce8fad28 100644
--- a/sys/arch/socppc/conf/files.socppc
+++ b/sys/arch/socppc/conf/files.socppc
@@ -1,4 +1,4 @@
-# $OpenBSD: files.socppc,v 1.2 2008/05/19 19:57:23 kettenis Exp $
+# $OpenBSD: files.socppc,v 1.3 2008/05/25 16:23:58 kettenis Exp $
#
# macppc-specific configuration info
@@ -28,7 +28,7 @@ attach cpu at mainbus
file arch/socppc/socppc/cpu.c
# MPC8349E on-board devices
-device obio {addr, [ivec = -1]}
+device obio {addr, [ivec = -1], [phy = -1]}
attach obio at mainbus
file arch/socppc/dev/obio.c
diff --git a/sys/arch/socppc/dev/if_tsec.c b/sys/arch/socppc/dev/if_tsec.c
index 0a987cda14f..a372c4819ed 100644
--- a/sys/arch/socppc/dev/if_tsec.c
+++ b/sys/arch/socppc/dev/if_tsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tsec.c,v 1.6 2008/05/25 15:25:30 kettenis Exp $ */
+/* $OpenBSD: if_tsec.c,v 1.7 2008/05/25 16:23:58 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -360,7 +360,8 @@ tsec_attach(struct device *parent, struct device *self, void *aux)
break;
}
- mii_attach(self, &sc->sc_mii, 0xffffffff, 17, MII_OFFSET_ANY, 0);
+ mii_attach(self, &sc->sc_mii, 0xffffffff, oa->oa_phy,
+ MII_OFFSET_ANY, 0);
if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
printf("%s: no PHY found!\n", sc->sc_dev.dv_xname);
ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_MANUAL, 0, NULL);
diff --git a/sys/arch/socppc/dev/obio.c b/sys/arch/socppc/dev/obio.c
index 2afcb84f79d..1081e854ce0 100644
--- a/sys/arch/socppc/dev/obio.c
+++ b/sys/arch/socppc/dev/obio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: obio.c,v 1.2 2008/05/17 15:49:05 kettenis Exp $ */
+/* $OpenBSD: obio.c,v 1.3 2008/05/25 16:23:58 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -62,6 +62,7 @@ obio_search(struct device *parent, void *cfdata, void *aux)
oa.oa_dmat = ma->ma_dmat;
oa.oa_offset = cf->cf_offset;
oa.oa_ivec = cf->cf_ivec;
+ oa.oa_phy = cf->cf_phy;
oa.oa_name = cf->cf_driver->cd_name;
config_found(parent, &oa, obio_print);
diff --git a/sys/arch/socppc/include/autoconf.h b/sys/arch/socppc/include/autoconf.h
index 19a3886394b..05806bd55a1 100644
--- a/sys/arch/socppc/include/autoconf.h
+++ b/sys/arch/socppc/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.h,v 1.2 2008/05/17 15:49:05 kettenis Exp $ */
+/* $OpenBSD: autoconf.h,v 1.3 2008/05/25 16:23:58 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -32,11 +32,13 @@ struct obio_attach_args {
bus_dma_tag_t oa_dmat;
bus_addr_t oa_offset;
int oa_ivec;
+ int oa_phy;
char *oa_name;
};
#define cf_offset cf_loc[0]
#define cf_ivec cf_loc[1]
+#define cf_phy cf_loc[2]
typedef int (time_read_t)(time_t *sec);
typedef int (time_write_t)(time_t sec);