xref: /freebsd/sys/contrib/device-tree/src/arm/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2f126890aSEmmanuel Vadot/*
3f126890aSEmmanuel Vadot * Broadcom BCM470X / BCM5301X ARM platform code.
4f126890aSEmmanuel Vadot * DTS for Buffalo WZR-1166DHP and WZR-1166DHP2
5f126890aSEmmanuel Vadot *
6f126890aSEmmanuel Vadot * Copyright (C) 2014 Rafał Miłecki <zajec5@gmail.com>
7f126890aSEmmanuel Vadot * Copyright (C) 2022 SHIMAMOTO Takayoshi <takayoshi.shimamoto.360@gmail.com>
8f126890aSEmmanuel Vadot */
9f126890aSEmmanuel Vadot
10f126890aSEmmanuel Vadot
11f126890aSEmmanuel Vadot#include "bcm4708.dtsi"
12f126890aSEmmanuel Vadot#include "bcm5301x-nand-cs0-bch8.dtsi"
13f126890aSEmmanuel Vadot#include <dt-bindings/leds/common.h>
14f126890aSEmmanuel Vadot
15f126890aSEmmanuel Vadot/ {
16f126890aSEmmanuel Vadot	spi {
17f126890aSEmmanuel Vadot		compatible = "spi-gpio";
18f126890aSEmmanuel Vadot		num-chipselects = <1>;
19f126890aSEmmanuel Vadot		sck-gpios = <&chipcommon 7 0>;
20f126890aSEmmanuel Vadot		mosi-gpios = <&chipcommon 4 0>;
21f126890aSEmmanuel Vadot		cs-gpios = <&chipcommon 6 0>;
22f126890aSEmmanuel Vadot		#address-cells = <1>;
23f126890aSEmmanuel Vadot		#size-cells = <0>;
24f126890aSEmmanuel Vadot
25f126890aSEmmanuel Vadot		hc595: gpio_spi@0 {
26f126890aSEmmanuel Vadot			compatible = "fairchild,74hc595";
27f126890aSEmmanuel Vadot			reg = <0>;
28f126890aSEmmanuel Vadot			registers-number = <1>;
29f126890aSEmmanuel Vadot			spi-max-frequency = <100000>;
30f126890aSEmmanuel Vadot
31f126890aSEmmanuel Vadot			gpio-controller;
32f126890aSEmmanuel Vadot			#gpio-cells = <2>;
33f126890aSEmmanuel Vadot
34f126890aSEmmanuel Vadot		};
35f126890aSEmmanuel Vadot	};
36f126890aSEmmanuel Vadot
37f126890aSEmmanuel Vadot	leds {
38f126890aSEmmanuel Vadot		compatible = "gpio-leds";
39f126890aSEmmanuel Vadot
40f126890aSEmmanuel Vadot		led-usb {
41f126890aSEmmanuel Vadot			/* label = "bcm53xx:blue:usb"; */
42f126890aSEmmanuel Vadot			function = LED_FUNCTION_USB;
43f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_BLUE>;
44f126890aSEmmanuel Vadot			gpios = <&hc595 0 GPIO_ACTIVE_HIGH>;
45f126890aSEmmanuel Vadot			trigger-sources = <&ohci_port1>, <&ehci_port1>,
46f126890aSEmmanuel Vadot					  <&xhci_port1>, <&ohci_port2>,
47f126890aSEmmanuel Vadot					  <&ehci_port2>;
48f126890aSEmmanuel Vadot			linux,default-trigger = "usbport";
49f126890aSEmmanuel Vadot		};
50f126890aSEmmanuel Vadot
51f126890aSEmmanuel Vadot		led-power0 {
52f126890aSEmmanuel Vadot			/* label = "bcm53xx:red:power"; */
53f126890aSEmmanuel Vadot			function = LED_FUNCTION_FAULT;
54f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_RED>;
55f126890aSEmmanuel Vadot			gpios = <&hc595 1 GPIO_ACTIVE_HIGH>;
56f126890aSEmmanuel Vadot		};
57f126890aSEmmanuel Vadot
58f126890aSEmmanuel Vadot		led-power1 {
59f126890aSEmmanuel Vadot			/* label = "bcm53xx:white:power"; */
60f126890aSEmmanuel Vadot			function = LED_FUNCTION_POWER;
61f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_WHITE>;
62f126890aSEmmanuel Vadot			gpios = <&hc595 2 GPIO_ACTIVE_HIGH>;
63f126890aSEmmanuel Vadot			linux,default-trigger = "default-on";
64f126890aSEmmanuel Vadot		};
65f126890aSEmmanuel Vadot
66f126890aSEmmanuel Vadot		led-router0 {
67f126890aSEmmanuel Vadot			/*  label = "bcm53xx:blue:router"; */
68f126890aSEmmanuel Vadot			function = LED_FUNCTION_STATUS;
69f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_BLUE>;
70f126890aSEmmanuel Vadot			gpios = <&hc595 3 GPIO_ACTIVE_HIGH>;
71f126890aSEmmanuel Vadot			linux,default-trigger = "default-on";
72f126890aSEmmanuel Vadot		};
73f126890aSEmmanuel Vadot
74f126890aSEmmanuel Vadot		led-router1 {
75f126890aSEmmanuel Vadot			/* label = "bcm53xx:amber:router"; */
76f126890aSEmmanuel Vadot			function = LED_FUNCTION_STATUS;
77f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_AMBER>;
78f126890aSEmmanuel Vadot			gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
79f126890aSEmmanuel Vadot		};
80f126890aSEmmanuel Vadot
81f126890aSEmmanuel Vadot		led-wan {
82f126890aSEmmanuel Vadot			/* label = "bcm53xx:blue:wan"; */
83f126890aSEmmanuel Vadot			function = LED_FUNCTION_WAN;
84f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_BLUE>;
85f126890aSEmmanuel Vadot			gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
86f126890aSEmmanuel Vadot			linux,default-trigger = "default-on";
87f126890aSEmmanuel Vadot		};
88f126890aSEmmanuel Vadot
89f126890aSEmmanuel Vadot		led-wireless0 {
90f126890aSEmmanuel Vadot			/* label = "bcm53xx:blue:wireless"; */
91f126890aSEmmanuel Vadot			function = LED_FUNCTION_WLAN;
92f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_BLUE>;
93f126890aSEmmanuel Vadot			gpios = <&hc595 6 GPIO_ACTIVE_HIGH>;
94f126890aSEmmanuel Vadot		};
95f126890aSEmmanuel Vadot
96f126890aSEmmanuel Vadot		led-wireless1 {
97f126890aSEmmanuel Vadot			/* label = "bcm53xx:amber:wireless"; */
98f126890aSEmmanuel Vadot			function = LED_FUNCTION_WLAN;
99f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_AMBER>;
100f126890aSEmmanuel Vadot			gpios = <&hc595 7 GPIO_ACTIVE_HIGH>;
101f126890aSEmmanuel Vadot		};
102f126890aSEmmanuel Vadot	};
103f126890aSEmmanuel Vadot
104f126890aSEmmanuel Vadot	gpio-keys {
105f126890aSEmmanuel Vadot		compatible = "gpio-keys";
106f126890aSEmmanuel Vadot
107f126890aSEmmanuel Vadot		button-restart {
108f126890aSEmmanuel Vadot			label = "Reset";
109f126890aSEmmanuel Vadot			linux,code = <KEY_RESTART>;
110f126890aSEmmanuel Vadot			gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
111f126890aSEmmanuel Vadot		};
112f126890aSEmmanuel Vadot
113f126890aSEmmanuel Vadot		button-aoss {
114f126890aSEmmanuel Vadot			label = "AOSS";
115f126890aSEmmanuel Vadot			linux,code = <KEY_WPS_BUTTON>;
116f126890aSEmmanuel Vadot			gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>;
117f126890aSEmmanuel Vadot		};
118f126890aSEmmanuel Vadot
119f126890aSEmmanuel Vadot		/* Commit mode set by switch? */
120f126890aSEmmanuel Vadot		button-mode {
121f126890aSEmmanuel Vadot			label = "Mode";
122f126890aSEmmanuel Vadot			linux,code = <KEY_SETUP>;
123f126890aSEmmanuel Vadot			gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>;
124f126890aSEmmanuel Vadot		};
125f126890aSEmmanuel Vadot
126f126890aSEmmanuel Vadot		/* Switch: AP mode */
127f126890aSEmmanuel Vadot		button-sw-ap {
128f126890aSEmmanuel Vadot			label = "AP";
129f126890aSEmmanuel Vadot			linux,code = <BTN_0>;
130f126890aSEmmanuel Vadot			gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
131f126890aSEmmanuel Vadot		};
132f126890aSEmmanuel Vadot
133f126890aSEmmanuel Vadot		button-eject {
134f126890aSEmmanuel Vadot			label = "USB eject";
135f126890aSEmmanuel Vadot			linux,code = <KEY_EJECTCD>;
136f126890aSEmmanuel Vadot			gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
137f126890aSEmmanuel Vadot		};
138f126890aSEmmanuel Vadot	};
139f126890aSEmmanuel Vadot};
140f126890aSEmmanuel Vadot
141f126890aSEmmanuel Vadot&usb2 {
142f126890aSEmmanuel Vadot	vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
143f126890aSEmmanuel Vadot};
144f126890aSEmmanuel Vadot
145f126890aSEmmanuel Vadot&usb3 {
146f126890aSEmmanuel Vadot	vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_LOW>;
147f126890aSEmmanuel Vadot};
148f126890aSEmmanuel Vadot
149f126890aSEmmanuel Vadot&spi_nor {
150f126890aSEmmanuel Vadot	status = "okay";
151f126890aSEmmanuel Vadot};
152f126890aSEmmanuel Vadot
153f126890aSEmmanuel Vadot&usb3_phy {
154f126890aSEmmanuel Vadot	status = "okay";
155f126890aSEmmanuel Vadot};
156f126890aSEmmanuel Vadot
157f126890aSEmmanuel Vadot&srab {
158f126890aSEmmanuel Vadot	status = "okay";
159f126890aSEmmanuel Vadot
160f126890aSEmmanuel Vadot	ports {
161f126890aSEmmanuel Vadot		port@0 {
162f126890aSEmmanuel Vadot			label = "lan1";
163f126890aSEmmanuel Vadot		};
164f126890aSEmmanuel Vadot
165f126890aSEmmanuel Vadot		port@1 {
166f126890aSEmmanuel Vadot			label = "lan2";
167f126890aSEmmanuel Vadot		};
168f126890aSEmmanuel Vadot
169f126890aSEmmanuel Vadot		port@2 {
170f126890aSEmmanuel Vadot			label = "lan3";
171f126890aSEmmanuel Vadot		};
172f126890aSEmmanuel Vadot
173f126890aSEmmanuel Vadot		port@3 {
174f126890aSEmmanuel Vadot			label = "lan4";
175f126890aSEmmanuel Vadot		};
176f126890aSEmmanuel Vadot
177f126890aSEmmanuel Vadot		port@4 {
178f126890aSEmmanuel Vadot			label = "wan";
179f126890aSEmmanuel Vadot		};
180f126890aSEmmanuel Vadot
181f126890aSEmmanuel Vadot		port@5 {
182f126890aSEmmanuel Vadot			label = "cpu";
183f126890aSEmmanuel Vadot		};
184*84943d6fSEmmanuel Vadot
185*84943d6fSEmmanuel Vadot		port@7 {
186*84943d6fSEmmanuel Vadot			status = "disabled";
187*84943d6fSEmmanuel Vadot		};
188*84943d6fSEmmanuel Vadot
189*84943d6fSEmmanuel Vadot		port@8 {
190*84943d6fSEmmanuel Vadot			status = "disabled";
191*84943d6fSEmmanuel Vadot		};
192f126890aSEmmanuel Vadot	};
193f126890aSEmmanuel Vadot};
194