Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/alphapc/fdc37c93x.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname alphapc/fdc37c93x.c 1999/0503
## diff -e /dev/null /n/emeliedump/1999/0503/sys/src/brazil/alphapc/fdc37c93x.c
0a
#include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"

.
## diffname alphapc/fdc37c93x.c 1999/0504
## diff -e /n/emeliedump/1999/0503/sys/src/brazil/alphapc/fdc37c93x.c /n/emeliedump/1999/0504/sys/src/brazil/alphapc/fdc37c93x.c
7a
/*
 * SMC FDC37C93x Plug and Play Compatible Ultra I/O Controller.
 */
enum {					/* I/O Ports */
	Config		= 0x370,	/* could also be 0x3F0 */

	Index		= 0,
	Data		= 1,
};

static int fddregs[] = {
	0x30,
	0x60, 0x61,
	0x70,
	0x74,
	0xF0,
	0xF1,
	0xF2,
	0xF4,
	0xF5,
	0,
};

void
fdc37c93xdump(void)
{
	int config, i, x;

	config = Config;

	outb(config, 0x55);
	outb(config, 0x55);

	outb(config+Index, 0x20);
	x = inb(config+Data);
	print("fdc37c93x: Device ID 0x%2.2uX\n", x);

	outb(config+Index, 0x07);
	outb(config+Data, 0);
	for(i = 0; fddregs[i]; i++){
		outb(config+Index, fddregs[i]);
		x = inb(config+Data);
		print("FDD%2.2uX: 0x%2.2uX\n", fddregs[i], x);
	}

	outb(config, 0x70);
	outb(config, 0x06);
	outb(config, 0x74);
	outb(config, 0x02);
	outb(config, 0x30);
	outb(config, 0x01);

	outb(config, 0xAA);
}
.
## diffname alphapc/fdc37c93x.c 1999/0506
## diff -e /n/emeliedump/1999/0504/sys/src/brazil/alphapc/fdc37c93x.c /n/emeliedump/1999/0506/sys/src/brazil/alphapc/fdc37c93x.c
60c
	OUTB(config, 0xAA);
.
53,58c
	OUTB(config+Index, 0x70);
	OUTB(config+Data, 0x06);
	OUTB(config+Index, 0x74);
	OUTB(config+Data, 0x02);
	OUTB(config+Index, 0x30);
	OUTB(config+Data, 0x01);
.
48c
		OUTB(config+Index, fddregs[i]);
.
45,46c
	OUTB(config+Index, 0x07);
	OUTB(config+Data, 0);
.
43a
	OUTB(config+Index, 0x22);
	x = inb(config+Data);
	print("fdc37c93x: Power/Control 0x%2.2uX\n", x);
.
41c
	OUTB(config+Index, 0x20);
.
38,39c
	OUTB(config, 0x55);
	OUTB(config, 0x55);
.
30a
#define OUTB(p, d)	outb(p, d); microdelay(10);

.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.