0418-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. From 2770e16422c3d3df76bb510a309877b507d4553f Mon Sep 17 00:00:00 2001
  2. From: Erdem MEYDANLI <erdem.meydanli@punica.com.tr>
  3. Date: Thu, 30 Jun 2016 21:05:08 +0300
  4. Subject: [PATCH] dts: Add overlay for NXP SC16IS752 Dual UART with SPI
  5. Interface
  6. ---
  7. arch/arm/boot/dts/overlays/Makefile | 1 +
  8. arch/arm/boot/dts/overlays/README | 10 ++++
  9. .../boot/dts/overlays/sc16is752-spi1-overlay.dts | 61 ++++++++++++++++++++++
  10. 3 files changed, 72 insertions(+)
  11. create mode 100644 arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts
  12. --- a/arch/arm/boot/dts/overlays/Makefile
  13. +++ b/arch/arm/boot/dts/overlays/Makefile
  14. @@ -71,6 +71,7 @@ dtbo-$(RPI_DT_OVERLAYS) += rpi-ft5406.dt
  15. dtbo-$(RPI_DT_OVERLAYS) += rpi-proto.dtbo
  16. dtbo-$(RPI_DT_OVERLAYS) += rpi-sense.dtbo
  17. dtbo-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio.dtbo
  18. +dtbo-$(RPI_DT_OVERLAYS) += sc16is752-spi1.dtbo
  19. dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo
  20. dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo
  21. dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo
  22. --- a/arch/arm/boot/dts/overlays/README
  23. +++ b/arch/arm/boot/dts/overlays/README
  24. @@ -888,6 +888,16 @@ Load: dtoverlay=rra-digidac1-wm8741-au
  25. Params: <None>
  26. +Name: sc16is752-spi1
  27. +Info: Overlay for the NXP SC16IS752 Dual UART with SPI Interface
  28. + Enables the chip on SPI1.
  29. + N.B.: spi1 is only accessible on devices with a 40pin header, eg:
  30. + A+, B+, Zero and PI2 B; as well as the Compute Module.
  31. +
  32. +Load: dtoverlay=sc16is752-spi1,<param>=<val>
  33. +Params: int_pin GPIO used for IRQ (default 24)
  34. +
  35. +
  36. Name: sdhost
  37. Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock.
  38. N.B. This overlay is designed for situations where the mmc driver is
  39. --- /dev/null
  40. +++ b/arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts
  41. @@ -0,0 +1,61 @@
  42. +/dts-v1/;
  43. +/plugin/;
  44. +
  45. +/ {
  46. + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
  47. +
  48. + fragment@0 {
  49. + target = <&gpio>;
  50. + __overlay__ {
  51. + spi1_pins: spi1_pins {
  52. + brcm,pins = <19 20 21>;
  53. + brcm,function = <3>; /* alt4 */
  54. + };
  55. +
  56. + spi1_cs_pins: spi1_cs_pins {
  57. + brcm,pins = <18>;
  58. + brcm,function = <1>; /* output */
  59. + };
  60. + };
  61. + };
  62. +
  63. + fragment@1 {
  64. + target = <&spi1>;
  65. + frag1: __overlay__ {
  66. + #address-cells = <1>;
  67. + #size-cells = <0>;
  68. + pinctrl-names = "default";
  69. + pinctrl-0 = <&spi1_pins &spi1_cs_pins>;
  70. + cs-gpios = <&gpio 18 1>;
  71. + status = "okay";
  72. +
  73. + sc16is752: sc16is752@0 {
  74. + compatible = "nxp,sc16is752";
  75. + reg = <0>; /* CE0 */
  76. + clocks = <&sc16is752_clk>;
  77. + interrupt-parent = <&gpio>;
  78. + interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
  79. + #gpio-controller;
  80. + #gpio-cells = <2>;
  81. + spi-max-frequency = <4000000>;
  82. +
  83. + sc16is752_clk: sc16is752_clk {
  84. + compatible = "fixed-clock";
  85. + #clock-cells = <0>;
  86. + clock-frequency = <14745600>;
  87. + };
  88. + };
  89. + };
  90. + };
  91. +
  92. + fragment@2 {
  93. + target = <&aux>;
  94. + __overlay__ {
  95. + status = "okay";
  96. + };
  97. + };
  98. +
  99. + __overrides__ {
  100. + int_pin = <&sc16is752>,"interrupts:0";
  101. + };
  102. +};