gpios.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright 2010 eXMeritus, A Boeing Company
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of
  7. * the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  17. * MA 02111-1307 USA
  18. */
  19. #include <asm/mpc85xx_gpio.h>
  20. /* Common CPU A/B GPIOs (GPIO8-GPIO15 and IRQ4-IRQ6) */
  21. #define GPIO_CPU_ID (1UL << (31 - 8))
  22. #define GPIO_BLUE_LED (1UL << (31 - 9))
  23. #define GPIO_DIMM_RESET (1UL << (31 - 10))
  24. #define GPIO_USB_RESET (1UL << (31 - 11))
  25. #define GPIO_UNUSED_12 (1UL << (31 - 12))
  26. #define GPIO_GETH0_RESET (1UL << (31 - 13))
  27. #define GPIO_RS422_RE (1UL << (31 - 14))
  28. #define GPIO_RS422_DE (1UL << (31 - 15))
  29. #define IRQ_I2CINT (1UL << (31 - 20))
  30. #define IRQ_FANINT (1UL << (31 - 21))
  31. #define IRQ_DIMM_EVENT (1UL << (31 - 22))
  32. #define GPIO_RESETS (GPIO_DIMM_RESET|GPIO_USB_RESET|GPIO_GETH0_RESET)
  33. /* CPU A GPIOS (GPIO0-GPIO7 and IRQ0-IRQ3) */
  34. #define GPIO_CPUA_UNUSED_0 (1UL << (31 - 0))
  35. #define GPIO_CPUA_CPU_READY (1UL << (31 - 1))
  36. #define GPIO_CPUA_DEBUG_LED2 (1UL << (31 - 2))
  37. #define GPIO_CPUA_DEBUG_LED1 (1UL << (31 - 3))
  38. #define GPIO_CPUA_TDIS2B (1UL << (31 - 4)) /* MAC 2 TX B */
  39. #define GPIO_CPUA_TDIS2A (1UL << (31 - 5)) /* MAC 2 TX A */
  40. #define GPIO_CPUA_TDIS1B (1UL << (31 - 6)) /* MAC 1 TX B */
  41. #define GPIO_CPUA_TDIS1A (1UL << (31 - 7)) /* MAC 1 TX A */
  42. #define IRQ_CPUA_UNUSED_0 (1UL << (31 - 16))
  43. #define IRQ_CPUA_UNUSED_1 (1UL << (31 - 17))
  44. #define IRQ_CPUA_UNUSED_2 (1UL << (31 - 18))
  45. #define IRQ_CPUA_UNUSED_3 (1UL << (31 - 19))
  46. /* CPU B GPIOS (GPIO0-GPIO7 and IRQ0-IRQ3) */
  47. #define GPIO_CPUB_RMUX_SEL1B (1UL << (31 - 0))
  48. #define GPIO_CPUB_RMUX_SEL0B (1UL << (31 - 1))
  49. #define GPIO_CPUB_RMUX_SEL1A (1UL << (31 - 2))
  50. #define GPIO_CPUB_RMUX_SEL0A (1UL << (31 - 3))
  51. #define GPIO_CPUB_UNUSED_4 (1UL << (31 - 4))
  52. #define GPIO_CPUB_CPU_READY (1UL << (31 - 5))
  53. #define GPIO_CPUB_DEBUG_LED2 (1UL << (31 - 6))
  54. #define GPIO_CPUB_DEBUG_LED1 (1UL << (31 - 7))
  55. #define IRQ_CPUB_SD_1A (1UL << (31 - 16))
  56. #define IRQ_CPUB_SD_2B (1UL << (31 - 17))
  57. #define IRQ_CPUB_SD_2A (1UL << (31 - 18))
  58. #define IRQ_CPUB_SD_1B (1UL << (31 - 19))
  59. /* If it isn't CPU A then it's CPU B */
  60. static inline unsigned int hww1u1a_is_cpu_a(void)
  61. {
  62. return !mpc85xx_gpio_get(GPIO_CPU_ID);
  63. }