summaryrefslogtreecommitdiffstats
path: root/arch/mips/cobalt/hw-access.c
blob: 968dfefb8b369c3f622de24157c907f0a40872f7 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Low-level hardware access stuff for Cobalt Microserver 27 board.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
 */
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/linkage.h>
#include <linux/types.h>
#include <asm/cachectl.h>
#include <asm/cobalt.h>
#include <asm/segment.h>
#include <asm/vector.h>

void
dummy(void)
{
	panic("What the hell is this called for?");
}

static unsigned char cobalt_read_cmos(unsigned long reg)
{
	unsigned char retval;

	VIA_PORT_WRITE(0x70, reg);
	retval = VIA_PORT_READ(0x71);
	VIA_DELAY();

	return retval;
}

static void cobalt_write_cmos(unsigned char val, unsigned long reg)
{
	VIA_PORT_WRITE(0x70, reg);
	VIA_PORT_WRITE(0x71, val); 
}

struct feature cobalt_feature = {
	/*
	 * How to access the floppy controller's ports
	 */
	(void *)dummy, (void *)dummy,
	/*
	 * How to access the floppy DMA functions.
	 */
	(void *)dummy, (void *)dummy, (void *)dummy, (void *)dummy,
	(void *)dummy, (void *)dummy, (void *)dummy, (void *)dummy,
	(void *)dummy, (void *)dummy, (void *)dummy,
	/*
	 * How to access the RTC functions.
	 */
	cobalt_read_cmos,
	cobalt_write_cmos
};