Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * auxio.h: Definitions and code for the Auxiliary I/O register.
4 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */
7#ifndef _SPARC_AUXIO_H
8#define _SPARC_AUXIO_H
9
10#include <asm/vaddrs.h>
11
12/* This register is an unsigned char in IO space. It does two things.
13 * First, it is used to control the front panel LED light on machines
14 * that have it (good for testing entry points to trap handlers and irq's)
15 * Secondly, it controls various floppy drive parameters.
16 */
17#define AUXIO_ORMEIN 0xf0 /* All writes must set these bits. */
18#define AUXIO_ORMEIN4M 0xc0 /* sun4m - All writes must set these bits. */
19#define AUXIO_FLPY_DENS 0x20 /* Floppy density, high if set. Read only. */
20#define AUXIO_FLPY_DCHG 0x10 /* A disk change occurred. Read only. */
21#define AUXIO_EDGE_ON 0x10 /* sun4m - On means Jumper block is in. */
22#define AUXIO_FLPY_DSEL 0x08 /* Drive select/start-motor. Write only. */
23#define AUXIO_LINK_TEST 0x08 /* sun4m - On means TPE Carrier detect. */
24
25/* Set the following to one, then zero, after doing a pseudo DMA transfer. */
26#define AUXIO_FLPY_TCNT 0x04 /* Floppy terminal count. Write only. */
27
28/* Set the following to zero to eject the floppy. */
29#define AUXIO_FLPY_EJCT 0x02 /* Eject floppy disk. Write only. */
30#define AUXIO_LED 0x01 /* On if set, off if unset. Read/Write */
31
32#ifndef __ASSEMBLY__
33
34/*
35 * NOTE: these routines are implementation dependent--
36 * understand the hardware you are querying!
37 */
38void set_auxio(unsigned char bits_on, unsigned char bits_off);
39unsigned char get_auxio(void); /* .../asm/floppy.h */
40
41/*
42 * The following routines are provided for driver-compatibility
43 * with sparc64 (primarily sunlance.c)
44 */
45
46#define AUXIO_LTE_ON 1
47#define AUXIO_LTE_OFF 0
48
49/* auxio_set_lte - Set Link Test Enable (TPE Link Detect)
50 *
51 * on - AUXIO_LTE_ON or AUXIO_LTE_OFF
52 */
53#define auxio_set_lte(on) \
54do { \
55 if(on) { \
56 set_auxio(AUXIO_LINK_TEST, 0); \
57 } else { \
58 set_auxio(0, AUXIO_LINK_TEST); \
59 } \
60} while (0)
61
62#define AUXIO_LED_ON 1
63#define AUXIO_LED_OFF 0
64
65/* auxio_set_led - Set system front panel LED
66 *
67 * on - AUXIO_LED_ON or AUXIO_LED_OFF
68 */
69#define auxio_set_led(on) \
70do { \
71 if(on) { \
72 set_auxio(AUXIO_LED, 0); \
73 } else { \
74 set_auxio(0, AUXIO_LED); \
75 } \
76} while (0)
77
78#endif /* !(__ASSEMBLY__) */
79
80
81/* AUXIO2 (Power Off Control) */
82extern volatile u8 __iomem *auxio_power_register;
83
84#define AUXIO_POWER_DETECT_FAILURE 32
85#define AUXIO_POWER_CLEAR_FAILURE 2
86#define AUXIO_POWER_OFF 1
87
88
89#endif /* !(_SPARC_AUXIO_H) */
1/*
2 * auxio.h: Definitions and code for the Auxiliary I/O register.
3 *
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
5 */
6#ifndef _SPARC_AUXIO_H
7#define _SPARC_AUXIO_H
8
9#include <asm/vaddrs.h>
10
11/* This register is an unsigned char in IO space. It does two things.
12 * First, it is used to control the front panel LED light on machines
13 * that have it (good for testing entry points to trap handlers and irq's)
14 * Secondly, it controls various floppy drive parameters.
15 */
16#define AUXIO_ORMEIN 0xf0 /* All writes must set these bits. */
17#define AUXIO_ORMEIN4M 0xc0 /* sun4m - All writes must set these bits. */
18#define AUXIO_FLPY_DENS 0x20 /* Floppy density, high if set. Read only. */
19#define AUXIO_FLPY_DCHG 0x10 /* A disk change occurred. Read only. */
20#define AUXIO_EDGE_ON 0x10 /* sun4m - On means Jumper block is in. */
21#define AUXIO_FLPY_DSEL 0x08 /* Drive select/start-motor. Write only. */
22#define AUXIO_LINK_TEST 0x08 /* sun4m - On means TPE Carrier detect. */
23
24/* Set the following to one, then zero, after doing a pseudo DMA transfer. */
25#define AUXIO_FLPY_TCNT 0x04 /* Floppy terminal count. Write only. */
26
27/* Set the following to zero to eject the floppy. */
28#define AUXIO_FLPY_EJCT 0x02 /* Eject floppy disk. Write only. */
29#define AUXIO_LED 0x01 /* On if set, off if unset. Read/Write */
30
31#ifndef __ASSEMBLY__
32
33/*
34 * NOTE: these routines are implementation dependent--
35 * understand the hardware you are querying!
36 */
37void set_auxio(unsigned char bits_on, unsigned char bits_off);
38unsigned char get_auxio(void); /* .../asm/floppy.h */
39
40/*
41 * The following routines are provided for driver-compatibility
42 * with sparc64 (primarily sunlance.c)
43 */
44
45#define AUXIO_LTE_ON 1
46#define AUXIO_LTE_OFF 0
47
48/* auxio_set_lte - Set Link Test Enable (TPE Link Detect)
49 *
50 * on - AUXIO_LTE_ON or AUXIO_LTE_OFF
51 */
52#define auxio_set_lte(on) \
53do { \
54 if(on) { \
55 set_auxio(AUXIO_LINK_TEST, 0); \
56 } else { \
57 set_auxio(0, AUXIO_LINK_TEST); \
58 } \
59} while (0)
60
61#define AUXIO_LED_ON 1
62#define AUXIO_LED_OFF 0
63
64/* auxio_set_led - Set system front panel LED
65 *
66 * on - AUXIO_LED_ON or AUXIO_LED_OFF
67 */
68#define auxio_set_led(on) \
69do { \
70 if(on) { \
71 set_auxio(AUXIO_LED, 0); \
72 } else { \
73 set_auxio(0, AUXIO_LED); \
74 } \
75} while (0)
76
77#endif /* !(__ASSEMBLY__) */
78
79
80/* AUXIO2 (Power Off Control) */
81extern volatile u8 __iomem *auxio_power_register;
82
83#define AUXIO_POWER_DETECT_FAILURE 32
84#define AUXIO_POWER_CLEAR_FAILURE 2
85#define AUXIO_POWER_OFF 1
86
87
88#endif /* !(_SPARC_AUXIO_H) */