auxio_32.h 2.5 KB

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