mach-rb750.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * MikroTik RouterBOARD 750 definitions
  3. *
  4. * Copyright (C) 2010-2012 Gabor Juhos <juhosg@openwrt.org>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published
  8. * by the Free Software Foundation.
  9. */
  10. #ifndef _MACH_RB750_H
  11. #define _MACH_RB750_H
  12. #include <linux/bitops.h>
  13. #define RB750_GPIO_LVC573_LE 0 /* Latch enable on LVC573 */
  14. #define RB750_GPIO_NAND_IO0 1 /* NAND I/O 0 */
  15. #define RB750_GPIO_NAND_IO1 2 /* NAND I/O 1 */
  16. #define RB750_GPIO_NAND_IO2 3 /* NAND I/O 2 */
  17. #define RB750_GPIO_NAND_IO3 4 /* NAND I/O 3 */
  18. #define RB750_GPIO_NAND_IO4 5 /* NAND I/O 4 */
  19. #define RB750_GPIO_NAND_IO5 6 /* NAND I/O 5 */
  20. #define RB750_GPIO_NAND_IO6 7 /* NAND I/O 6 */
  21. #define RB750_GPIO_NAND_IO7 8 /* NAND I/O 7 */
  22. #define RB750_GPIO_NAND_NCE 11 /* NAND Chip Enable (active low) */
  23. #define RB750_GPIO_NAND_RDY 12 /* NAND Ready */
  24. #define RB750_GPIO_NAND_CLE 14 /* NAND Command Latch Enable */
  25. #define RB750_GPIO_NAND_ALE 15 /* NAND Address Latch Enable */
  26. #define RB750_GPIO_NAND_NRE 16 /* NAND Read Enable (active low) */
  27. #define RB750_GPIO_NAND_NWE 17 /* NAND Write Enable (active low) */
  28. #define RB750_GPIO_BTN_RESET 1
  29. #define RB750_GPIO_SPI_CS0 2
  30. #define RB750_GPIO_LED_ACT 12
  31. #define RB750_GPIO_LED_PORT1 13
  32. #define RB750_GPIO_LED_PORT2 14
  33. #define RB750_GPIO_LED_PORT3 15
  34. #define RB750_GPIO_LED_PORT4 16
  35. #define RB750_GPIO_LED_PORT5 17
  36. #define RB750_LED_ACT BIT(RB750_GPIO_LED_ACT)
  37. #define RB750_LED_PORT1 BIT(RB750_GPIO_LED_PORT1)
  38. #define RB750_LED_PORT2 BIT(RB750_GPIO_LED_PORT2)
  39. #define RB750_LED_PORT3 BIT(RB750_GPIO_LED_PORT3)
  40. #define RB750_LED_PORT4 BIT(RB750_GPIO_LED_PORT4)
  41. #define RB750_LED_PORT5 BIT(RB750_GPIO_LED_PORT5)
  42. #define RB750_NAND_NCE BIT(RB750_GPIO_NAND_NCE)
  43. #define RB750_LVC573_LE BIT(RB750_GPIO_LVC573_LE)
  44. #define RB750_LED_BITS (RB750_LED_PORT1 | RB750_LED_PORT2 | RB750_LED_PORT3 | \
  45. RB750_LED_PORT4 | RB750_LED_PORT5 | RB750_LED_ACT)
  46. #define RB7XX_GPIO_NAND_NCE 0
  47. #define RB7XX_GPIO_MON 9
  48. #define RB7XX_GPIO_LED_ACT 11
  49. #define RB7XX_GPIO_USB_POWERON 13
  50. #define RB7XX_NAND_NCE BIT(RB7XX_GPIO_NAND_NCE)
  51. #define RB7XX_LED_ACT BIT(RB7XX_GPIO_LED_ACT)
  52. #define RB7XX_MONITOR BIT(RB7XX_GPIO_MON)
  53. #define RB7XX_USB_POWERON BIT(RB7XX_GPIO_USB_POWERON)
  54. struct rb750_led_data {
  55. char *name;
  56. char *default_trigger;
  57. u32 mask;
  58. int active_low;
  59. };
  60. struct rb750_led_platform_data {
  61. int num_leds;
  62. struct rb750_led_data *leds;
  63. void (*latch_change)(u32 clear, u32 set);
  64. };
  65. struct rb7xx_nand_platform_data {
  66. u32 nce_line;
  67. void (*enable_pins)(void);
  68. void (*disable_pins)(void);
  69. void (*latch_change)(u32, u32);
  70. };
  71. #endif /* _MACH_RB750_H */