Commit 10ca61c6 authored by Biju Das's avatar Biju Das Committed by Geert Uytterhoeven

arm64: dts: renesas: rzg2l-smarc: Add support for enabling MTU3

Add support for PMOD_MTU3 macro to enable MTU3 node on RZ/{G2,V2}L SMARC
EVK.

The MTU3a PWM pins are muxed with spi1 pins and counter external input
phase clock pins are muxed with scif2 pins. Disable these IPs when
PMOD_MTU3 macro is enabled.

Apart from this, the counter Z phase clock signal is muxed with the
SDHI1 cd signal. So disable SDHI1 IP, when the counter Z phase signal
is enabled.
Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230706153047.368993-1-biju.das.jz@bp.renesas.comSigned-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent f5b4a0fa
...@@ -6,6 +6,27 @@ ...@@ -6,6 +6,27 @@
*/ */
/dts-v1/; /dts-v1/;
/* Enable SCIF2 (SER0) on PMOD1 (CN7) */
#define PMOD1_SER0 1
/*
* To enable MTU3a PWM on PMOD0,
* Disable PMOD1_SER0 by setting "#define PMOD1_SER0 0" above and
* enable PMOD_MTU3 by setting "#define PMOD_MTU3 1" below.
*/
#define PMOD_MTU3 0
#if (PMOD_MTU3 && PMOD1_SER0)
#error "Cannot set as PMOD_MTU3 and PMOD1_SER0 are mutually exclusive "
#endif
#define MTU3_COUNTER_Z_PHASE_SIGNAL 0
#if (!PMOD_MTU3 && MTU3_COUNTER_Z_PHASE_SIGNAL)
#error "Cannot set 1 to MTU3_COUNTER_Z_PHASE_SIGNAL as PMOD_MTU3=0"
#endif
#include "r9a07g044l2.dtsi" #include "r9a07g044l2.dtsi"
#include "rzg2l-smarc-som.dtsi" #include "rzg2l-smarc-som.dtsi"
#include "rzg2l-smarc-pinfunction.dtsi" #include "rzg2l-smarc-pinfunction.dtsi"
......
...@@ -6,6 +6,26 @@ ...@@ -6,6 +6,26 @@
*/ */
/dts-v1/; /dts-v1/;
/* Enable SCIF2 (SER0) on PMOD1 (CN7) */
#define PMOD1_SER0 1
/*
* To enable MTU3a PWM on PMOD0,
* Disable PMOD1_SER0 by setting "#define PMOD1_SER0 0" above and
* enable PMOD_MTU3 by setting "#define PMOD_MTU3 1" below.
*/
#define PMOD_MTU3 0
#if (PMOD_MTU3 && PMOD1_SER0)
#error "Cannot set as PMOD_MTU3 and PMOD1_SER0 are mutually exclusive "
#endif
#define MTU3_COUNTER_Z_PHASE_SIGNAL 0
#if (!PMOD_MTU3 && MTU3_COUNTER_Z_PHASE_SIGNAL)
#error "Cannot set 1 to MTU3_COUNTER_Z_PHASE_SIGNAL as PMOD_MTU3=0"
#endif
#include "r9a07g054l2.dtsi" #include "r9a07g054l2.dtsi"
#include "rzg2l-smarc-som.dtsi" #include "rzg2l-smarc-som.dtsi"
#include "rzg2l-smarc-pinfunction.dtsi" #include "rzg2l-smarc-pinfunction.dtsi"
......
...@@ -53,6 +53,26 @@ i2c3_pins: i2c3 { ...@@ -53,6 +53,26 @@ i2c3_pins: i2c3 {
<RZG2L_PORT_PINMUX(18, 1, 3)>; /* SCL */ <RZG2L_PORT_PINMUX(18, 1, 3)>; /* SCL */
}; };
mtu3_pins: mtu3 {
mtu3-ext-clk-input-pin {
pinmux = <RZG2L_PORT_PINMUX(48, 0, 4)>, /* MTCLKA */
<RZG2L_PORT_PINMUX(48, 1, 4)>; /* MTCLKB */
};
mtu3-pwm {
pinmux = <RZG2L_PORT_PINMUX(44, 0, 4)>, /* MTIOC3A */
<RZG2L_PORT_PINMUX(44, 1, 4)>, /* MTIOC3B */
<RZG2L_PORT_PINMUX(44, 2, 4)>, /* MTIOC3C */
<RZG2L_PORT_PINMUX(44, 3, 4)>; /* MTIOC3D */
};
#if MTU3_COUNTER_Z_PHASE_SIGNAL
mtu3-zphase-clk {
pinmux = <RZG2L_PORT_PINMUX(19, 0, 3)>; /* MTIOC1A */
};
#endif /* MTU3_COUNTER_Z_PHASE_SIGNAL */
};
scif0_pins: scif0 { scif0_pins: scif0 {
pinmux = <RZG2L_PORT_PINMUX(38, 0, 1)>, /* TxD */ pinmux = <RZG2L_PORT_PINMUX(38, 0, 1)>, /* TxD */
<RZG2L_PORT_PINMUX(38, 1, 1)>; /* RxD */ <RZG2L_PORT_PINMUX(38, 1, 1)>; /* RxD */
......
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rzg2l-pinctrl.h> #include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
/* comment the #define statement to disable SCIF2 (SER0) on PMOD1 (CN7) */
#define PMOD1_SER0 1
/ { / {
aliases { aliases {
serial1 = &scif2; serial1 = &scif2;
...@@ -115,6 +112,26 @@ wm8978: codec@1a { ...@@ -115,6 +112,26 @@ wm8978: codec@1a {
}; };
}; };
#if PMOD_MTU3
&mtu3 {
pinctrl-0 = <&mtu3_pins>;
pinctrl-names = "default";
status = "okay";
};
#if MTU3_COUNTER_Z_PHASE_SIGNAL
/* SDHI cd pin is muxed with counter Z phase signal */
&sdhi1 {
status = "disabled";
};
#endif /* MTU3_COUNTER_Z_PHASE_SIGNAL */
&spi1 {
status = "disabled";
};
#endif /* PMOD_MTU3 */
/* /*
* To enable SCIF2 (SER0) on PMOD1 (CN7) * To enable SCIF2 (SER0) on PMOD1 (CN7)
* SW1 should be at position 2->3 so that SER0_CTS# line is activated * SW1 should be at position 2->3 so that SER0_CTS# line is activated
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment