serial-sccnxp.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * NXP (Philips) SCC+++(SCN+++) serial driver
  4. *
  5. * Copyright (C) 2012 Alexander Shiyan <[email protected]>
  6. *
  7. * Based on sc26xx.c, by Thomas Bogendörfer ([email protected])
  8. */
  9. #ifndef _PLATFORM_DATA_SERIAL_SCCNXP_H_
  10. #define _PLATFORM_DATA_SERIAL_SCCNXP_H_
  11. #define SCCNXP_MAX_UARTS 2
  12. /* Output lines */
  13. #define LINE_OP0 1
  14. #define LINE_OP1 2
  15. #define LINE_OP2 3
  16. #define LINE_OP3 4
  17. #define LINE_OP4 5
  18. #define LINE_OP5 6
  19. #define LINE_OP6 7
  20. #define LINE_OP7 8
  21. /* Input lines */
  22. #define LINE_IP0 9
  23. #define LINE_IP1 10
  24. #define LINE_IP2 11
  25. #define LINE_IP3 12
  26. #define LINE_IP4 13
  27. #define LINE_IP5 14
  28. #define LINE_IP6 15
  29. /* Signals */
  30. #define DTR_OP 0 /* DTR */
  31. #define RTS_OP 4 /* RTS */
  32. #define DSR_IP 8 /* DSR */
  33. #define CTS_IP 12 /* CTS */
  34. #define DCD_IP 16 /* DCD */
  35. #define RNG_IP 20 /* RNG */
  36. #define DIR_OP 24 /* Special signal for control RS-485.
  37. * Goes high when transmit,
  38. * then goes low.
  39. */
  40. /* Routing control signal 'sig' to line 'line' */
  41. #define MCTRL_SIG(sig, line) ((line) << (sig))
  42. /*
  43. * Example board initialization data:
  44. *
  45. * static struct resource sc2892_resources[] = {
  46. * DEFINE_RES_MEM(UART_PHYS_START, 0x10),
  47. * DEFINE_RES_IRQ(IRQ_EXT2),
  48. * };
  49. *
  50. * static struct sccnxp_pdata sc2892_info = {
  51. * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0),
  52. * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1),
  53. * };
  54. *
  55. * static struct platform_device sc2892 = {
  56. * .name = "sc2892",
  57. * .id = -1,
  58. * .resource = sc2892_resources,
  59. * .num_resources = ARRAY_SIZE(sc2892_resources),
  60. * .dev = {
  61. * .platform_data = &sc2892_info,
  62. * },
  63. * };
  64. */
  65. /* SCCNXP platform data structure */
  66. struct sccnxp_pdata {
  67. /* Shift for A0 line */
  68. const u8 reg_shift;
  69. /* Modem control lines configuration */
  70. const u32 mctrl_cfg[SCCNXP_MAX_UARTS];
  71. /* Timer value for polling mode (usecs) */
  72. const unsigned int poll_time_us;
  73. };
  74. #endif