18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * auxio.h:  Definitions and code for the Auxiliary I/O registers.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Refactoring for unified NCR/PCIO support 2002 Eric Brower (ebrower@usa.net)
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#ifndef _SPARC64_AUXIO_H
108c2ecf20Sopenharmony_ci#define _SPARC64_AUXIO_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/* AUXIO implementations:
138c2ecf20Sopenharmony_ci * sbus-based NCR89C105 "Slavio"
148c2ecf20Sopenharmony_ci *	LED/Floppy (AUX1) register
158c2ecf20Sopenharmony_ci *	Power (AUX2) register
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci * ebus-based auxio on PCIO
188c2ecf20Sopenharmony_ci *	LED Auxio Register
198c2ecf20Sopenharmony_ci *	Power Auxio Register
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci * Register definitions from NCR _NCR89C105 Chip Specification_
228c2ecf20Sopenharmony_ci *
238c2ecf20Sopenharmony_ci * SLAVIO AUX1 @ 0x1900000
248c2ecf20Sopenharmony_ci * -------------------------------------------------
258c2ecf20Sopenharmony_ci * | (R) | (R) |  D  | (R) |  E  |  M  |  T  |  L  |
268c2ecf20Sopenharmony_ci * -------------------------------------------------
278c2ecf20Sopenharmony_ci * (R) - bit 7:6,4 are reserved and should be masked in s/w
288c2ecf20Sopenharmony_ci *  D  - Floppy Density Sense (1=high density) R/O
298c2ecf20Sopenharmony_ci *  E  - Link Test Enable, directly reflected on AT&T 7213 LTE pin
308c2ecf20Sopenharmony_ci *  M  - Monitor/Mouse Mux, directly reflected on MON_MSE_MUX pin
318c2ecf20Sopenharmony_ci *  T  - Terminal Count: sends TC pulse to 82077 floppy controller
328c2ecf20Sopenharmony_ci *  L  - System LED on front panel (0=off, 1=on)
338c2ecf20Sopenharmony_ci */
348c2ecf20Sopenharmony_ci#define AUXIO_AUX1_MASK		0xc0 /* Mask bits 		*/
358c2ecf20Sopenharmony_ci#define AUXIO_AUX1_FDENS	0x20 /* Floppy Density Sense	*/
368c2ecf20Sopenharmony_ci#define AUXIO_AUX1_LTE 		0x08 /* Link Test Enable 	*/
378c2ecf20Sopenharmony_ci#define AUXIO_AUX1_MMUX		0x04 /* Monitor/Mouse Mux	*/
388c2ecf20Sopenharmony_ci#define AUXIO_AUX1_FTCNT	0x02 /* Terminal Count, 	*/
398c2ecf20Sopenharmony_ci#define AUXIO_AUX1_LED		0x01 /* System LED		*/
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci/* SLAVIO AUX2 @ 0x1910000
428c2ecf20Sopenharmony_ci * -------------------------------------------------
438c2ecf20Sopenharmony_ci * | (R) | (R) |  D  | (R) | (R) | (R) |  C  |  F  |
448c2ecf20Sopenharmony_ci * -------------------------------------------------
458c2ecf20Sopenharmony_ci * (R) - bits 7:6,4:2 are reserved and should be masked in s/w
468c2ecf20Sopenharmony_ci *  D  - Power Failure Detect (1=power fail)
478c2ecf20Sopenharmony_ci *  C  - Clear Power Failure Detect Int (1=clear)
488c2ecf20Sopenharmony_ci *  F  - Power Off (1=power off)
498c2ecf20Sopenharmony_ci */
508c2ecf20Sopenharmony_ci#define AUXIO_AUX2_MASK		0xdc /* Mask Bits		*/
518c2ecf20Sopenharmony_ci#define AUXIO_AUX2_PFAILDET	0x20 /* Power Fail Detect	*/
528c2ecf20Sopenharmony_ci#define AUXIO_AUX2_PFAILCLR 	0x02 /* Clear Pwr Fail Det Intr	*/
538c2ecf20Sopenharmony_ci#define AUXIO_AUX2_PWR_OFF	0x01 /* Power Off		*/
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* Register definitions from Sun Microsystems _PCIO_ p/n 802-7837
568c2ecf20Sopenharmony_ci *
578c2ecf20Sopenharmony_ci * PCIO LED Auxio @ 0x726000
588c2ecf20Sopenharmony_ci * -------------------------------------------------
598c2ecf20Sopenharmony_ci * |             31:1 Unused                 | LED |
608c2ecf20Sopenharmony_ci * -------------------------------------------------
618c2ecf20Sopenharmony_ci * Bits 31:1 unused
628c2ecf20Sopenharmony_ci * LED - System LED on front panel (0=off, 1=on)
638c2ecf20Sopenharmony_ci */
648c2ecf20Sopenharmony_ci#define AUXIO_PCIO_LED		0x01 /* System LED 		*/
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* PCIO Power Auxio @ 0x724000
678c2ecf20Sopenharmony_ci * -------------------------------------------------
688c2ecf20Sopenharmony_ci * |             31:2 Unused           | CPO | SPO |
698c2ecf20Sopenharmony_ci * -------------------------------------------------
708c2ecf20Sopenharmony_ci * Bits 31:2 unused
718c2ecf20Sopenharmony_ci * CPO - Courtesy Power Off (1=off)
728c2ecf20Sopenharmony_ci * SPO - System Power Off   (1=off)
738c2ecf20Sopenharmony_ci */
748c2ecf20Sopenharmony_ci#define AUXIO_PCIO_CPWR_OFF	0x02 /* Courtesy Power Off	*/
758c2ecf20Sopenharmony_ci#define AUXIO_PCIO_SPWR_OFF	0x01 /* System Power Off	*/
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci#define AUXIO_LTE_ON	1
808c2ecf20Sopenharmony_ci#define AUXIO_LTE_OFF	0
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* auxio_set_lte - Set Link Test Enable (TPE Link Detect)
838c2ecf20Sopenharmony_ci *
848c2ecf20Sopenharmony_ci * on - AUXIO_LTE_ON or AUXIO_LTE_OFF
858c2ecf20Sopenharmony_ci */
868c2ecf20Sopenharmony_civoid auxio_set_lte(int on);
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define AUXIO_LED_ON	1
898c2ecf20Sopenharmony_ci#define AUXIO_LED_OFF	0
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci/* auxio_set_led - Set system front panel LED
928c2ecf20Sopenharmony_ci *
938c2ecf20Sopenharmony_ci * on - AUXIO_LED_ON or AUXIO_LED_OFF
948c2ecf20Sopenharmony_ci */
958c2ecf20Sopenharmony_civoid auxio_set_led(int on);
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#endif /* ifndef __ASSEMBLY__ */
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci#endif /* !(_SPARC64_AUXIO_H) */
100