summaryrefslogtreecommitdiffstats
path: root/arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi
blob: 6be25a8a28db7b803d121c1843112b0335143940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/*
 * Device Tree Source for the RZ/G2LC SMARC EVK parts
 *
 * Copyright (C) 2022 Renesas Electronics Corp.
 */

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>

/*
 * DIP-Switch SW1 setting on SoM
 * 1 : High; 0: Low
 * SW1-2 : SW_SD0_DEV_SEL	(1: eMMC; 0: uSD)
 * SW1-3 : SW_SCIF_CAN		(1: CAN1; 0: SCIF1)
 * SW1-4 : SW_RSPI_CAN		(1: CAN1; 0: RSPI1)
 * SW1-5 : SW_I2S0_I2S1		(1: I2S2 (HDMI audio); 0: I2S0)
 * Please change below macros according to SW1 setting
 */

#define SW_SD0_DEV_SEL	1

#define SW_SCIF_CAN	0
#if (SW_SCIF_CAN)
/* Due to HW routing, SW_RSPI_CAN is always 0 when SW_SCIF_CAN is set to 1 */
#define SW_RSPI_CAN	0
#else
/* Please set SW_RSPI_CAN. Default value is 1 */
#define SW_RSPI_CAN	1
#endif

#if (SW_SCIF_CAN && SW_RSPI_CAN)
#error "Can not set 1 to both SW_SCIF_CAN and SW_RSPI_CAN due to HW routing"
#endif

#include "rzg2lc-smarc-som.dtsi"
#include "rzg2lc-smarc-pinfunction.dtsi"
#include "rz-smarc-common.dtsi"

/* comment the #define statement to disable SCIF1 (SER0) on PMOD1 (CN7) */
#define PMOD1_SER0	1

/ {
	aliases {
		serial1 = &scif1;
		i2c2 = &i2c2;
	};
};

#if (SW_SCIF_CAN || SW_RSPI_CAN)
&canfd {
	pinctrl-0 = <&can1_pins>;
	/delete-node/ channel@0;
};
#else
&canfd {
	/delete-property/ pinctrl-0;
	/delete-property/ pinctrl-names;
	status = "disabled";
};
#endif

&cpu_dai {
	sound-dai = <&ssi0>;
};

&i2c2 {
	pinctrl-0 = <&i2c2_pins>;
	pinctrl-names = "default";
	clock-frequency = <400000>;

	status = "okay";

	wm8978: codec@1a {
		compatible = "wlf,wm8978";
		#sound-dai-cells = <0>;
		reg = <0x1a>;
	};
};

/*
 * To enable SCIF1 (SER0) on PMOD1 (CN7), On connector board
 * SW1 should be at position 2->3 so that SER0_CTS# line is activated
 * SW2 should be at position 2->3 so that SER0_TX line is activated
 * SW3 should be at position 2->3 so that SER0_RX line is activated
 * SW4 should be at position 2->3 so that SER0_RTS# line is activated
 */
#if (!SW_SCIF_CAN && PMOD1_SER0)
&scif1 {
	pinctrl-0 = <&scif1_pins>;
	pinctrl-names = "default";

	uart-has-rtscts;
	status = "okay";
};
#endif

&ssi0 {
	pinctrl-0 = <&ssi0_pins>;
	pinctrl-names = "default";

	status = "okay";
};

#if (SW_RSPI_CAN)
&spi1 {
	/delete-property/ pinctrl-0;
	/delete-property/ pinctrl-names;
	status = "disabled";
};
#endif

&vccq_sdhi1 {
	gpios = <&pinctrl RZG2L_GPIO(39, 1) GPIO_ACTIVE_HIGH>;
};