diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/powerpc/conf/files.powerpc | 2 | ||||
-rw-r--r-- | sys/arch/powerpc/mac/uni_n.c | 33 | ||||
-rw-r--r-- | sys/dev/ofw/ofbus.c | 14 |
3 files changed, 46 insertions, 3 deletions
diff --git a/sys/arch/powerpc/conf/files.powerpc b/sys/arch/powerpc/conf/files.powerpc index 9f9a44d6f63..281893a2fbd 100644 --- a/sys/arch/powerpc/conf/files.powerpc +++ b/sys/arch/powerpc/conf/files.powerpc @@ -69,6 +69,8 @@ include "../../../dev/ofw/files.ofw" file arch/powerpc/powerpc/opendev.c ofcons | ofnet | ofdisk | ofrtc major { ofdisk = 4 } +file arch/powerpc/mac/uni_n.c ofbus + file arch/powerpc/powerpc/rd_root.c ramdisk_hooks major {rd = 17} diff --git a/sys/arch/powerpc/mac/uni_n.c b/sys/arch/powerpc/mac/uni_n.c new file mode 100644 index 00000000000..545d186c326 --- /dev/null +++ b/sys/arch/powerpc/mac/uni_n.c @@ -0,0 +1,33 @@ +/* $OpenBSD: uni_n.c,v 1.1 2000/10/16 00:18:01 drahn Exp $ */ + + +/* put BSD copyright here */ + +#include <sys/param.h> +#include <sys/device.h> +#include <machine/bus.h> + +#include <dev/ofw/openfirm.h> + +void +uni_n_config(int handle) +{ + char name[20]; + char *baseaddr; + int *ctladdr; + u_int32_t address; + if (OF_getprop(handle, "name", name, sizeof name) > 0) { + /* sanity test */ + if (!strcmp (name, "uni-n")) { + if (OF_getprop(handle, "reg", &address, + sizeof address) > 0) + { + printf("found uni-n at address %x\n", address); + baseaddr = mapiodev(address, NBPG); + ctladdr = (void*)(baseaddr + 0x20); + *ctladdr |= 0x02; + } + } + } + return; +} diff --git a/sys/dev/ofw/ofbus.c b/sys/dev/ofw/ofbus.c index b234c7b0bd7..7bba2c0eb06 100644 --- a/sys/dev/ofw/ofbus.c +++ b/sys/dev/ofw/ofbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofbus.c,v 1.8 2000/03/31 06:06:28 rahnds Exp $ */ +/* $OpenBSD: ofbus.c,v 1.9 2000/10/16 00:18:01 drahn Exp $ */ /* $NetBSD: ofbus.c,v 1.3 1996/10/13 01:38:11 christos Exp $ */ /* @@ -109,7 +109,7 @@ ofrattach(parent, dev, aux) void *aux; { int child; - char name[5]; + char name[64]; struct ofprobe *ofp = aux; struct ofprobe probe; int units; @@ -161,13 +161,16 @@ ofbprobe(parent, cf, aux) return 1; } +#ifdef __powerpc__ +void uni_n_config(int); +#endif /* __powerpc__ */ void ofbattach(parent, dev, aux) struct device *parent, *dev; void *aux; { int child; - char name[5]; + char name[20]; struct ofprobe *ofp = aux; struct ofprobe probe; int units; @@ -196,6 +199,11 @@ ofbattach(parent, dev, aux) #else units = 2; #endif + +#ifdef __powerpc__ + } else if (!strcmp(name, "uni-n")) { + uni_n_config(ofp->phandle); +#endif /* __powerpc__ */ } } for (child = OF_child(ofp->phandle); child; child = OF_peer(child)) { |