summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc/mac/uni_n.c
blob: 545d186c3261539fc7c63ab699a9c16fe0da619d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
}