Commit dba8ee27 authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Geert Uytterhoeven
Browse files

arm64: dts: renesas: rzt2h-rzn2h-evk: Enable MicroSD card slot

parent 4d7624fc
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,13 @@
 */
#define SD0_EMMC	1

/*
 * P17_4 = SD1_CD; SW2[3] = ON
 * P08_5 = SD1_PWEN; SW2[3] = ON
 * P08_6 = SD1_IOVS; SW2[3] = ON; SW5[3] = OFF; SW5[4] = ON
 */
#define SD1_MICRO_SD	1

#include "rzt2h-n2h-evk-common.dtsi"

/ {
@@ -49,6 +56,7 @@ led-2 {
			function-enumerator = <2>;
		};

#if (!SD1_MICRO_SD)
		led-3 {
			/* SW2-3: OFF */
			gpios = <&pinctrl RZT2H_GPIO(8, 5) GPIO_ACTIVE_HIGH>;
@@ -56,6 +64,7 @@ led-3 {
			function = LED_FUNCTION_DEBUG;
			function-enumerator = <3>;
		};
#endif

		led-4 {
			/* SW8-3: ON, SW8-4: OFF */
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,12 @@
 */
#define SD0_EMMC       1

/*
 * P17_4 = SD1_CD; DSW5[3] = ON; DSW19[1] = OFF; DSW19[2] = ON
 * P08_6 = SD1_IOVS; DSW5[3] = ON
 */
#define SD1_MICRO_SD	1

#include "rzt2h-n2h-evk-common.dtsi"

/*
+51 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ aliases {
		i2c0 = &i2c0;
		i2c1 = &i2c1;
		mmc0 = &sdhi0;
		mmc1 = &sdhi1;
		serial0 = &sci0;
	};

@@ -38,6 +39,18 @@ reg_3p3v: regulator-3p3v {
		regulator-boot-on;
		regulator-always-on;
	};

#if SD1_MICRO_SD
	vccq_sdhi1: regulator-vccq-sdhi1 {
		compatible = "regulator-gpio";
		regulator-name = "SDHI1 VccQ";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
		gpios = <&pinctrl RZT2H_GPIO(8, 6) GPIO_ACTIVE_HIGH>;
		gpios-states = <0>;
		states = <3300000 0>, <1800000 1>;
	};
#endif
};

&extal_clk {
@@ -93,6 +106,30 @@ ctrl-pins {
				 <RZT2H_PORT_PINMUX(13, 2, 0x29)>; /* SD0_RST# */
		};
	};

#if SD1_MICRO_SD
	sdhi1-pwen-hog {
		gpio-hog;
		gpios = <RZT2H_GPIO(8, 5) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "SD1_PWEN";
	};
#endif

	sdhi1_pins: sd1-group {
		data-pins {
			pinmux = <RZT2H_PORT_PINMUX(16, 7, 0x29)>, /* SD1_DATA0 */
				 <RZT2H_PORT_PINMUX(17, 0, 0x29)>, /* SD1_DATA1 */
				 <RZT2H_PORT_PINMUX(17, 1, 0x29)>, /* SD1_DATA2 */
				 <RZT2H_PORT_PINMUX(17, 2, 0x29)>; /* SD1_DATA3 */
		};

		ctrl-pins {
			pinmux = <RZT2H_PORT_PINMUX(16, 5, 0x29)>, /* SD1_CLK */
				 <RZT2H_PORT_PINMUX(16, 6, 0x29)>, /* SD1_CMD */
				 <RZT2H_PORT_PINMUX(17, 4, 0x29)>; /* SD1_CD */
		};
	};
};

&sci0 {
@@ -115,3 +152,17 @@ &sdhi0 {
	status = "okay";
};
#endif

#if SD1_MICRO_SD
&sdhi1 {
	pinctrl-0 = <&sdhi1_pins>;
	pinctrl-1 = <&sdhi1_pins>;
	pinctrl-names = "default", "state_uhs";
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&vccq_sdhi1>;
	bus-width = <4>;
	sd-uhs-sdr50;
	sd-uhs-sdr104;
	status = "okay";
};
#endif