/arch/mips/include/asm/mach-rc32434/gpio.h

http://github.com/mirrors/linux · C Header · 79 lines · 34 code · 12 blank · 33 comment · 0 complexity · cbab0067d428d67070edd32c2a21e0ef MD5 · raw file

  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright 2002 Integrated Device Technology, Inc.
  4. * All rights reserved.
  5. *
  6. * GPIO register definition.
  7. *
  8. * Author : ryan.holmQVist@idt.com
  9. * Date : 20011005
  10. * Copyright (C) 2001, 2002 Ryan Holm <ryan.holmQVist@idt.com>
  11. * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
  12. */
  13. #ifndef _RC32434_GPIO_H_
  14. #define _RC32434_GPIO_H_
  15. struct rb532_gpio_reg {
  16. u32 gpiofunc; /* GPIO Function Register
  17. * gpiofunc[x]==0 bit = gpio
  18. * func[x]==1 bit = altfunc
  19. */
  20. u32 gpiocfg; /* GPIO Configuration Register
  21. * gpiocfg[x]==0 bit = input
  22. * gpiocfg[x]==1 bit = output
  23. */
  24. u32 gpiod; /* GPIO Data Register
  25. * gpiod[x] read/write gpio pinX status
  26. */
  27. u32 gpioilevel; /* GPIO Interrupt Status Register
  28. * interrupt level (see gpioistat)
  29. */
  30. u32 gpioistat; /* Gpio Interrupt Status Register
  31. * istat[x] = (gpiod[x] == level[x])
  32. * cleared in ISR (STICKY bits)
  33. */
  34. u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
  35. };
  36. /* UART GPIO signals */
  37. #define RC32434_UART0_SOUT (1 << 0)
  38. #define RC32434_UART0_SIN (1 << 1)
  39. #define RC32434_UART0_RTS (1 << 2)
  40. #define RC32434_UART0_CTS (1 << 3)
  41. /* M & P bus GPIO signals */
  42. #define RC32434_MP_BIT_22 (1 << 4)
  43. #define RC32434_MP_BIT_23 (1 << 5)
  44. #define RC32434_MP_BIT_24 (1 << 6)
  45. #define RC32434_MP_BIT_25 (1 << 7)
  46. /* CPU GPIO signals */
  47. #define RC32434_CPU_GPIO (1 << 8)
  48. /* Reserved GPIO signals */
  49. #define RC32434_AF_SPARE_6 (1 << 9)
  50. #define RC32434_AF_SPARE_4 (1 << 10)
  51. #define RC32434_AF_SPARE_3 (1 << 11)
  52. #define RC32434_AF_SPARE_2 (1 << 12)
  53. /* PCI messaging unit */
  54. #define RC32434_PCI_MSU_GPIO (1 << 13)
  55. /* NAND GPIO signals */
  56. #define GPIO_RDY 8
  57. #define GPIO_WPX 9
  58. #define GPIO_ALE 10
  59. #define GPIO_CLE 11
  60. /* Compact Flash GPIO pin */
  61. #define CF_GPIO_NUM 13
  62. /* S1 button GPIO (shared with UART0_SIN) */
  63. #define GPIO_BTN_S1 1
  64. extern void rb532_gpio_set_ilevel(int bit, unsigned gpio);
  65. extern void rb532_gpio_set_istat(int bit, unsigned gpio);
  66. extern void rb532_gpio_set_func(unsigned gpio);
  67. #endif /* _RC32434_GPIO_H_ */