xref: /freebsd/sys/contrib/device-tree/src/arm/st/stm32mp153c-lxa-fairytux2-gen1.dts (revision 8ccc0d235c226d84112561d453c49904398d085c)
1*8ccc0d23SEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
2*8ccc0d23SEmmanuel Vadot/*
3*8ccc0d23SEmmanuel Vadot * Copyright (C) 2024 Leonard Göhrs, Pengutronix
4*8ccc0d23SEmmanuel Vadot */
5*8ccc0d23SEmmanuel Vadot
6*8ccc0d23SEmmanuel Vadot/dts-v1/;
7*8ccc0d23SEmmanuel Vadot
8*8ccc0d23SEmmanuel Vadot#include "stm32mp153c-lxa-fairytux2.dtsi"
9*8ccc0d23SEmmanuel Vadot
10*8ccc0d23SEmmanuel Vadot/ {
11*8ccc0d23SEmmanuel Vadot	model = "Linux Automation GmbH FairyTux 2 Gen 1";
12*8ccc0d23SEmmanuel Vadot	compatible = "lxa,stm32mp153c-fairytux2-gen1", "oct,stm32mp153x-osd32", "st,stm32mp153";
13*8ccc0d23SEmmanuel Vadot
14*8ccc0d23SEmmanuel Vadot	gpio-keys {
15*8ccc0d23SEmmanuel Vadot		compatible = "gpio-keys";
16*8ccc0d23SEmmanuel Vadot
17*8ccc0d23SEmmanuel Vadot		button-left {
18*8ccc0d23SEmmanuel Vadot			label = "USER_BTN1";
19*8ccc0d23SEmmanuel Vadot			linux,code = <KEY_ESC>;
20*8ccc0d23SEmmanuel Vadot			gpios = <&gpioi 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
21*8ccc0d23SEmmanuel Vadot		};
22*8ccc0d23SEmmanuel Vadot
23*8ccc0d23SEmmanuel Vadot		button-right {
24*8ccc0d23SEmmanuel Vadot			label = "USER_BTN2";
25*8ccc0d23SEmmanuel Vadot			linux,code = <KEY_HOME>;
26*8ccc0d23SEmmanuel Vadot			gpios = <&gpioe 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
27*8ccc0d23SEmmanuel Vadot		};
28*8ccc0d23SEmmanuel Vadot	};
29*8ccc0d23SEmmanuel Vadot};
30*8ccc0d23SEmmanuel Vadot
31*8ccc0d23SEmmanuel Vadot&gpiof {
32*8ccc0d23SEmmanuel Vadot	gpio-line-names = "GPIO1", "GPIO2", "", "", "",			/*  0 */
33*8ccc0d23SEmmanuel Vadot			  "", "", "", "", "",				/*  5 */
34*8ccc0d23SEmmanuel Vadot			  "", "", "", "", "",				/* 10 */
35*8ccc0d23SEmmanuel Vadot			  "";						/* 15 */
36*8ccc0d23SEmmanuel Vadot};
37*8ccc0d23SEmmanuel Vadot
38*8ccc0d23SEmmanuel Vadot&gpioh {
39*8ccc0d23SEmmanuel Vadot	gpio-line-names = "", "", "", "", "LCD_RESET",			/*  0 */
40*8ccc0d23SEmmanuel Vadot			  "", "", "", "", "",				/*  5 */
41*8ccc0d23SEmmanuel Vadot			  "", "", "", "GPIO3", "",			/* 10 */
42*8ccc0d23SEmmanuel Vadot			  "";						/* 15 */
43*8ccc0d23SEmmanuel Vadot};
44*8ccc0d23SEmmanuel Vadot
45*8ccc0d23SEmmanuel Vadot&gpioi {
46*8ccc0d23SEmmanuel Vadot	gpio-line-names = "", "", "", "", "",				/*  0 */
47*8ccc0d23SEmmanuel Vadot			  "", "", "", "ETH_", "",			/*  5 */
48*8ccc0d23SEmmanuel Vadot			  "", "USER_BTN1";				/* 10 */
49*8ccc0d23SEmmanuel Vadot};
50*8ccc0d23SEmmanuel Vadot
51*8ccc0d23SEmmanuel Vadot&i2c1 {
52*8ccc0d23SEmmanuel Vadot	pinctrl-names = "default", "sleep";
53*8ccc0d23SEmmanuel Vadot	pinctrl-0 = <&i2c1_pins_b>;
54*8ccc0d23SEmmanuel Vadot	pinctrl-1 = <&i2c1_sleep_pins_b>;
55*8ccc0d23SEmmanuel Vadot	status = "okay";
56*8ccc0d23SEmmanuel Vadot
57*8ccc0d23SEmmanuel Vadot	io_board_gpio: gpio@20 {
58*8ccc0d23SEmmanuel Vadot		compatible = "ti,tca6408";
59*8ccc0d23SEmmanuel Vadot		reg = <0x20>;
60*8ccc0d23SEmmanuel Vadot		gpio-controller;
61*8ccc0d23SEmmanuel Vadot		#gpio-cells = <2>;
62*8ccc0d23SEmmanuel Vadot		vcc-supply = <&v3v3_hdmi>;
63*8ccc0d23SEmmanuel Vadot		gpio-line-names = "LED1_GA_YK", "LED2_GA_YK", "LED1_GK_YA", "LED2_GK_YA",
64*8ccc0d23SEmmanuel Vadot				  "RS485_EN", "RS485_120R", "", "CAN_120R";
65*8ccc0d23SEmmanuel Vadot	};
66*8ccc0d23SEmmanuel Vadot};
67*8ccc0d23SEmmanuel Vadot
68*8ccc0d23SEmmanuel Vadot&led_controller_io {
69*8ccc0d23SEmmanuel Vadot	/*
70*8ccc0d23SEmmanuel Vadot	 * led-2 and led-3 are internally connected antiparallel to one
71*8ccc0d23SEmmanuel Vadot	 * another inside the ethernet jack like this:
72*8ccc0d23SEmmanuel Vadot	 * GPIO1 ---+---|led-2|>--+--- GPIO3
73*8ccc0d23SEmmanuel Vadot	 *          +--<|led-3|---+
74*8ccc0d23SEmmanuel Vadot	 * E.g. only one of the LEDs can be illuminated at a time while
75*8ccc0d23SEmmanuel Vadot	 * the other output must be driven low.
76*8ccc0d23SEmmanuel Vadot	 * This should likely be implemented using a multi color LED
77*8ccc0d23SEmmanuel Vadot	 * driver for antiparallel LEDs.
78*8ccc0d23SEmmanuel Vadot	 */
79*8ccc0d23SEmmanuel Vadot	led-2 {
80*8ccc0d23SEmmanuel Vadot		color = <LED_COLOR_ID_GREEN>;
81*8ccc0d23SEmmanuel Vadot		function = LED_FUNCTION_ACTIVITY;
82*8ccc0d23SEmmanuel Vadot		gpios = <&io_board_gpio 1 GPIO_ACTIVE_HIGH>;
83*8ccc0d23SEmmanuel Vadot	};
84*8ccc0d23SEmmanuel Vadot
85*8ccc0d23SEmmanuel Vadot	led-3 {
86*8ccc0d23SEmmanuel Vadot		color = <LED_COLOR_ID_ORANGE>;
87*8ccc0d23SEmmanuel Vadot		function = LED_FUNCTION_ACTIVITY;
88*8ccc0d23SEmmanuel Vadot		gpios = <&io_board_gpio 3 GPIO_ACTIVE_HIGH>;
89*8ccc0d23SEmmanuel Vadot	};
90*8ccc0d23SEmmanuel Vadot};
91*8ccc0d23SEmmanuel Vadot
92*8ccc0d23SEmmanuel Vadot&usart3 {
93*8ccc0d23SEmmanuel Vadot	/*
94*8ccc0d23SEmmanuel Vadot	 * On Gen 1 FairyTux 2 only RTS can be used and not CTS as well,
95*8ccc0d23SEmmanuel Vadot	 * Because pins PD11 (CTS) and PI11 (USER_BTN1) share the same
96*8ccc0d23SEmmanuel Vadot	 * interrupt and only one of them can be used at a time.
97*8ccc0d23SEmmanuel Vadot	 */
98*8ccc0d23SEmmanuel Vadot	rts-gpios = <&gpiod 12 GPIO_ACTIVE_LOW>;
99*8ccc0d23SEmmanuel Vadot};
100*8ccc0d23SEmmanuel Vadot
101*8ccc0d23SEmmanuel Vadot&usbotg_hs {
102*8ccc0d23SEmmanuel Vadot	dr_mode = "peripheral";
103*8ccc0d23SEmmanuel Vadot};
104