auxio_32.h 2.6 KB

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