imx8mm-venice-gw73xx-0x-rs422.dts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright 2021 Gateworks Corporation
  4. *
  5. * GW73xx RS422 (RS485 full duplex):
  6. * - GPIO1_0 rs485_term selects on-chip termination
  7. * - GPIO4_0 rs485_en needs to be driven high (active)
  8. * - GPIO4_2 rs485_hd needs to be driven low (in-active)
  9. * - UART4_TX is DE for RS485 transmitter
  10. * - RS485_EN needs to be pulled high
  11. * - RS485_HALF needs to be low
  12. */
  13. #include <dt-bindings/gpio/gpio.h>
  14. #include "imx8mm-pinfunc.h"
  15. /dts-v1/;
  16. /plugin/;
  17. &{/} {
  18. compatible = "gw,imx8mm-gw73xx-0x";
  19. };
  20. &gpio4 {
  21. rs485_en {
  22. gpio-hog;
  23. gpios = <0 GPIO_ACTIVE_HIGH>;
  24. output-high;
  25. line-name = "rs485_en";
  26. };
  27. rs485_hd {
  28. gpio-hog;
  29. gpios = <2 GPIO_ACTIVE_HIGH>;
  30. output-low;
  31. line-name = "rs485_hd";
  32. };
  33. };
  34. &uart2 {
  35. pinctrl-names = "default";
  36. pinctrl-0 = <&pinctrl_uart2>;
  37. rts-gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
  38. linux,rs485-enabled-at-boot-time;
  39. status = "okay";
  40. };
  41. &uart4 {
  42. status = "disabled";
  43. };
  44. &iomuxc {
  45. pinctrl_uart2: uart2grp {
  46. fsl,pins = <
  47. MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX 0x140
  48. MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX 0x140
  49. MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29 0x140
  50. >;
  51. };
  52. };