summaryrefslogtreecommitdiffstats
path: root/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
blob: a199de8f8b025109e5e50b5fe2db0f60130669de (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
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/*
 * Device Tree Source for the R9A08G045S33 SMARC Carrier-II's SoM board.
 *
 * Copyright (C) 2023 Renesas Electronics Corp.
 */

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

/*
 * Signals of SW_CONFIG switches:
 * @SW_SD0_DEV_SEL:
 *	0 - SD0 is connected to eMMC
 *	1 - SD0 is connected to uSD0 card
 */
#define SW_SD0_DEV_SEL	1

/ {
	compatible = "renesas,rzg3s-smarcm", "renesas,r9a08g045s33", "renesas,r9a08g045";

	aliases {
		mmc0 = &sdhi0;
	};

	chosen {
		bootargs = "ignore_loglevel";
		stdout-path = "serial0:115200n8";
	};

	memory@48000000 {
		device_type = "memory";
		/* First 128MB is reserved for secure area. */
		reg = <0x0 0x48000000 0x0 0x38000000>;
	};

	vcc_sdhi0: regulator0 {
		compatible = "regulator-fixed";
		regulator-name = "SDHI0 Vcc";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpios = <&pinctrl RZG2L_GPIO(2, 1) GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

#if SW_SD0_DEV_SEL
	vccq_sdhi0: regulator1 {
		compatible = "regulator-gpio";
		regulator-name = "SDHI0 VccQ";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
		gpios = <&pinctrl RZG2L_GPIO(2, 2) GPIO_ACTIVE_HIGH>;
		gpios-states = <1>;
		states = <3300000 1>, <1800000 0>;
	};
#else
	reg_1p8v: regulator1 {
		compatible = "regulator-fixed";
		regulator-name = "fixed-1.8V";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-boot-on;
		regulator-always-on;
	};
#endif
};

&extal_clk {
	clock-frequency = <24000000>;
};

#if SW_SD0_DEV_SEL
/* SD0 slot */
&sdhi0 {
	pinctrl-0 = <&sdhi0_pins>;
	pinctrl-1 = <&sdhi0_uhs_pins>;
	pinctrl-names = "default", "state_uhs";
	vmmc-supply = <&vcc_sdhi0>;
	vqmmc-supply = <&vccq_sdhi0>;
	bus-width = <4>;
	sd-uhs-sdr50;
	sd-uhs-sdr104;
	max-frequency = <125000000>;
	status = "okay";
};
#else
/* eMMC */
&sdhi0 {
	pinctrl-0 = <&sdhi0_emmc_pins>;
	pinctrl-1 = <&sdhi0_emmc_pins>;
	pinctrl-names = "default", "state_uhs";
	vmmc-supply = <&vcc_sdhi0>;
	vqmmc-supply = <&reg_1p8v>;
	bus-width = <8>;
	mmc-hs200-1_8v;
	non-removable;
	fixed-emmc-driver-type = <1>;
	max-frequency = <125000000>;
	status = "okay";
};
#endif

&pinctrl {
	sdhi0_pins: sd0 {
		data {
			pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3";
			power-source = <3300>;
		};

		ctrl {
			pins = "SD0_CLK", "SD0_CMD";
			power-source = <3300>;
		};

		cd {
			pinmux = <RZG2L_PORT_PINMUX(0, 0, 1)>; /* SD0_CD */
		};
	};

	sdhi0_uhs_pins: sd0-uhs {
		data {
			pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3";
			power-source = <1800>;
		};

		ctrl {
			pins = "SD0_CLK", "SD0_CMD";
			power-source = <1800>;
		};

		cd {
			pinmux = <RZG2L_PORT_PINMUX(0, 0, 1)>; /* SD0_CD */
		};
	};

	sdhi0_emmc_pins: sd0-emmc {
		pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3",
		       "SD0_DATA4", "SD0_DATA5", "SD0_DATA6", "SD0_DATA7",
		       "SD0_CLK", "SD0_CMD", "SD0_RST#";
		power-source = <1800>;
	};
};