summaryrefslogtreecommitdiff
path: root/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
blob: 1e67f0a2a945c929da51b09c2c7c4862b950bc03 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/*
 * Device Tree Source for the RZ/G3E SMARC EVK board
 *
 * Copyright (C) 2024 Renesas Electronics Corp.
 */

/dts-v1/;

/* Switch selection settings */
#define SW_LCD_EN		0
#define SW_GPIO8_CAN0_STB	0
#define SW_GPIO9_CAN1_STB	0
#define SW_LCD_EN		0
#define SW_PDM_EN		0
#define SW_SD0_DEV_SEL		0
#define SW_SDIO_M2E		0

#define PMOD_GPIO4		0
#define PMOD_GPIO6		0
#define PMOD_GPIO7		0

#define KEY_1_GPIO		RZG3E_GPIO(3, 1)
#define KEY_2_GPIO		RZG3E_GPIO(8, 4)
#define KEY_3_GPIO		RZG3E_GPIO(8, 5)

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
#include "r9a09g047e57.dtsi"
#include "rzg3e-smarc-som.dtsi"
#include "renesas-smarc2.dtsi"

/ {
	model = "Renesas SMARC EVK version 2 based on r9a09g047e57";
	compatible = "renesas,smarc2-evk", "renesas,rzg3e-smarcm",
		     "renesas,r9a09g047e57", "renesas,r9a09g047";

	vqmmc_sd1_pvdd: regulator-vqmmc-sd1-pvdd {
		compatible = "regulator-gpio";
		regulator-name = "SD1_PVDD";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
		gpios = <&pinctrl RZG3E_GPIO(1, 5) GPIO_ACTIVE_HIGH>;
		gpios-states = <0>;
		states = <3300000 0>, <1800000 1>;
	};
};

&canfd {
	pinctrl-0 = <&canfd_pins>;
	pinctrl-names = "default";

#if (!SW_PDM_EN)
	channel1 {
		status = "okay";
#if (!SW_LCD_EN) && (SW_GPIO9_CAN1_STB)
		phys = <&can_transceiver1>;
#endif
	};
#endif

#if (!SW_LCD_EN)
	channel4 {
		status = "okay";
#if (SW_GPIO8_CAN0_STB)
		phys = <&can_transceiver0>;
#endif
	};
#endif
};

#if (!SW_LCD_EN) && (SW_GPIO8_CAN0_STB)
&can_transceiver0 {
	standby-gpios = <&pinctrl RZG3E_GPIO(5, 4) GPIO_ACTIVE_HIGH>;
	status = "okay";
};
#endif

#if (!SW_LCD_EN) && (SW_GPIO9_CAN1_STB)
&can_transceiver1 {
	standby-gpios = <&pinctrl RZG3E_GPIO(5, 5) GPIO_ACTIVE_HIGH>;
	status = "okay";
};
#endif

&i2c0 {
	pinctrl-0 = <&i2c0_pins>;
	pinctrl-names = "default";
};

&keys {
	key-sleep {
		pinctrl-0 = <&nmi_pins>;
		pinctrl-names = "default";

		interrupts-extended = <&icu 0 IRQ_TYPE_EDGE_FALLING>;
		linux,code = <KEY_SLEEP>;
		label = "SLEEP";
		debounce-interval = <20>;
	};
#if PMOD_GPIO4
	/delete-node/ key-1;
#endif

#if SW_LCD_EN || PMOD_GPIO6
	/delete-node/ key-2;
#endif

#if SW_LCD_EN || PMOD_GPIO7
	/delete-node/ key-3;
#endif
};

&pinctrl {
	canfd_pins: canfd {
		can1_pins: can1 {
			pinmux = <RZG3E_PORT_PINMUX(L, 2, 3)>, /* RX */
				 <RZG3E_PORT_PINMUX(L, 3, 3)>; /* TX */
		};

		can4_pins: can4 {
			pinmux = <RZG3E_PORT_PINMUX(5, 2, 3)>, /* RX */
				 <RZG3E_PORT_PINMUX(5, 3, 3)>; /* TX */
		};
	};

	i2c0_pins: i2c0 {
		pinmux = <RZG3E_PORT_PINMUX(D, 4, 4)>, /* SCL0 */
			 <RZG3E_PORT_PINMUX(D, 5, 4)>; /* SDA0 */
	};

	nmi_pins: nmi {
		pinmux = <RZG3E_PORT_PINMUX(S, 0, 0)>; /* NMI */
	};

	scif_pins: scif {
		pins = "SCIF_TXD", "SCIF_RXD";
		renesas,output-impedance = <1>;
	};

	sd1-pwr-en-hog {
		gpio-hog;
		gpios = <RZG3E_GPIO(1, 6) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "sd1_pwr_en";
	};

	sdhi1_pins: sd1 {
		sd1-cd {
			pinmux = <RZG3E_PORT_PINMUX(1, 4, 8)>; /* SD1CD */
		};

		sd1-ctrl {
			pinmux = <RZG3E_PORT_PINMUX(G, 0, 1)>, /* SD1CLK */
				 <RZG3E_PORT_PINMUX(G, 1, 1)>; /* SD1CMD */
		};

		sd1-data {
			pinmux = <RZG3E_PORT_PINMUX(G, 2, 1)>, /* SD1DAT0 */
				 <RZG3E_PORT_PINMUX(G, 3, 1)>, /* SD1DAT1 */
				 <RZG3E_PORT_PINMUX(G, 4, 1)>, /* SD1DAT2 */
				 <RZG3E_PORT_PINMUX(G, 5, 1)>; /* SD1DAT3 */
		};
	};
};

&scif0 {
	pinctrl-0 = <&scif_pins>;
	pinctrl-names = "default";
};

&sdhi1 {
	pinctrl-0 = <&sdhi1_pins>;
	pinctrl-1 = <&sdhi1_pins>;
	pinctrl-names = "default", "state_uhs";

	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&vqmmc_sd1_pvdd>;
};