rzg2lc-smarc.dtsi 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. /*
  3. * Device Tree Source for the RZ/G2LC SMARC EVK parts
  4. *
  5. * Copyright (C) 2022 Renesas Electronics Corp.
  6. */
  7. #include <dt-bindings/gpio/gpio.h>
  8. #include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
  9. /*
  10. * DIP-Switch SW1 setting on SoM
  11. * 1 : High; 0: Low
  12. * SW1-2 : SW_SD0_DEV_SEL (1: eMMC; 0: uSD)
  13. * SW1-3 : SW_SCIF_CAN (1: CAN1; 0: SCIF1)
  14. * SW1-4 : SW_RSPI_CAN (1: CAN1; 0: RSPI1)
  15. * SW1-5 : SW_I2S0_I2S1 (1: I2S2 (HDMI audio); 0: I2S0)
  16. * Please change below macros according to SW1 setting
  17. */
  18. #define SW_SD0_DEV_SEL 1
  19. #define SW_SCIF_CAN 0
  20. #if (SW_SCIF_CAN)
  21. /* Due to HW routing, SW_RSPI_CAN is always 0 when SW_SCIF_CAN is set to 1 */
  22. #define SW_RSPI_CAN 0
  23. #else
  24. /* Please set SW_RSPI_CAN. Default value is 1 */
  25. #define SW_RSPI_CAN 1
  26. #endif
  27. #if (SW_SCIF_CAN && SW_RSPI_CAN)
  28. #error "Can not set 1 to both SW_SCIF_CAN and SW_RSPI_CAN due to HW routing"
  29. #endif
  30. #include "rzg2lc-smarc-som.dtsi"
  31. #include "rzg2lc-smarc-pinfunction.dtsi"
  32. #include "rz-smarc-common.dtsi"
  33. /* comment the #define statement to disable SCIF1 (SER0) on PMOD1 (CN7) */
  34. #define PMOD1_SER0 1
  35. / {
  36. aliases {
  37. serial1 = &scif1;
  38. i2c2 = &i2c2;
  39. };
  40. };
  41. #if (SW_SCIF_CAN || SW_RSPI_CAN)
  42. &canfd {
  43. pinctrl-0 = <&can1_pins>;
  44. /delete-node/ channel@0;
  45. };
  46. #else
  47. &canfd {
  48. /delete-property/ pinctrl-0;
  49. /delete-property/ pinctrl-names;
  50. status = "disabled";
  51. };
  52. #endif
  53. &cpu_dai {
  54. sound-dai = <&ssi0>;
  55. };
  56. &i2c2 {
  57. pinctrl-0 = <&i2c2_pins>;
  58. pinctrl-names = "default";
  59. clock-frequency = <400000>;
  60. status = "okay";
  61. wm8978: codec@1a {
  62. compatible = "wlf,wm8978";
  63. #sound-dai-cells = <0>;
  64. reg = <0x1a>;
  65. };
  66. };
  67. /*
  68. * To enable SCIF1 (SER0) on PMOD1 (CN7), On connector board
  69. * SW1 should be at position 2->3 so that SER0_CTS# line is activated
  70. * SW2 should be at position 2->3 so that SER0_TX line is activated
  71. * SW3 should be at position 2->3 so that SER0_RX line is activated
  72. * SW4 should be at position 2->3 so that SER0_RTS# line is activated
  73. */
  74. #if (!SW_SCIF_CAN && PMOD1_SER0)
  75. &scif1 {
  76. pinctrl-0 = <&scif1_pins>;
  77. pinctrl-names = "default";
  78. uart-has-rtscts;
  79. status = "okay";
  80. };
  81. #endif
  82. &ssi0 {
  83. pinctrl-0 = <&ssi0_pins>;
  84. pinctrl-names = "default";
  85. status = "okay";
  86. };
  87. #if (SW_RSPI_CAN)
  88. &spi1 {
  89. /delete-property/ pinctrl-0;
  90. /delete-property/ pinctrl-names;
  91. status = "disabled";
  92. };
  93. #endif
  94. &vccq_sdhi1 {
  95. gpios = <&pinctrl RZG2L_GPIO(39, 1) GPIO_ACTIVE_HIGH>;
  96. };