serial-sccnxp.h 2.1 KB

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