xref: /openbmc/linux/arch/sparc/include/uapi/asm/apc.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
254579826SDavid Howells /* apc - Driver definitions for power management functions
354579826SDavid Howells  * of Aurora Personality Chip (APC) on SPARCstation-4/5 and
454579826SDavid Howells  * derivatives
554579826SDavid Howells  *
654579826SDavid Howells  * Copyright (c) 2001 Eric Brower (ebrower@usa.net)
754579826SDavid Howells  *
854579826SDavid Howells  */
954579826SDavid Howells 
1054579826SDavid Howells #ifndef _SPARC_APC_H
1154579826SDavid Howells #define _SPARC_APC_H
1254579826SDavid Howells 
1354579826SDavid Howells #include <linux/ioctl.h>
1454579826SDavid Howells 
1554579826SDavid Howells #define APC_IOC	'A'
1654579826SDavid Howells 
1754579826SDavid Howells #define APCIOCGFANCTL _IOR(APC_IOC, 0x00, int)	/* Get fan speed	*/
1854579826SDavid Howells #define APCIOCSFANCTL _IOW(APC_IOC, 0x01, int)	/* Set fan speed	*/
1954579826SDavid Howells 
2054579826SDavid Howells #define APCIOCGCPWR   _IOR(APC_IOC, 0x02, int)	/* Get CPOWER state	*/
2154579826SDavid Howells #define APCIOCSCPWR   _IOW(APC_IOC, 0x03, int)	/* Set CPOWER state	*/
2254579826SDavid Howells 
2354579826SDavid Howells #define APCIOCGBPORT   _IOR(APC_IOC, 0x04, int)	/* Get BPORT state 	*/
2454579826SDavid Howells #define APCIOCSBPORT   _IOW(APC_IOC, 0x05, int)	/* Set BPORT state	*/
2554579826SDavid Howells 
2654579826SDavid Howells /*
2754579826SDavid Howells  * Register offsets
2854579826SDavid Howells  */
2954579826SDavid Howells #define APC_IDLE_REG	0x00
3054579826SDavid Howells #define APC_FANCTL_REG	0x20
3154579826SDavid Howells #define APC_CPOWER_REG	0x24
3254579826SDavid Howells #define APC_BPORT_REG	0x30
3354579826SDavid Howells 
3454579826SDavid Howells #define APC_REGMASK		0x01
3554579826SDavid Howells #define APC_BPMASK		0x03
3654579826SDavid Howells 
3754579826SDavid Howells /*
3854579826SDavid Howells  * IDLE - CPU standby values (set to initiate standby)
3954579826SDavid Howells  */
4054579826SDavid Howells #define APC_IDLE_ON		0x01
4154579826SDavid Howells 
4254579826SDavid Howells /*
4354579826SDavid Howells  * FANCTL - Fan speed control state values
4454579826SDavid Howells  */
4554579826SDavid Howells #define APC_FANCTL_HI	0x00	/* Fan speed high	*/
4654579826SDavid Howells #define APC_FANCTL_LO	0x01	/* Fan speed low	*/
4754579826SDavid Howells 
4854579826SDavid Howells /*
4954579826SDavid Howells  * CPWR - Convenience power outlet state values
5054579826SDavid Howells  */
5154579826SDavid Howells #define APC_CPOWER_ON	0x00	/* Conv power on	*/
5254579826SDavid Howells #define APC_CPOWER_OFF	0x01	/* Conv power off	*/
5354579826SDavid Howells 
5454579826SDavid Howells /*
5554579826SDavid Howells  * BPA/BPB - Read-Write "Bit Ports" state values (reset to 0 at power-on)
5654579826SDavid Howells  *
5754579826SDavid Howells  * WARNING: Internal usage of bit ports is platform dependent--
5854579826SDavid Howells  * don't modify BPORT settings unless you know what you are doing.
5954579826SDavid Howells  *
6054579826SDavid Howells  * On SS5 BPA seems to toggle onboard ethernet loopback... -E
6154579826SDavid Howells  */
6254579826SDavid Howells #define APC_BPORT_A		0x01	/* Bit Port A		*/
6354579826SDavid Howells #define APC_BPORT_B		0x02	/* Bit Port B		*/
6454579826SDavid Howells 
6554579826SDavid Howells #endif /* !(_SPARC_APC_H) */
66