xref: /freebsd-src/sys/contrib/device-tree/src/arm/intel/ixp/intel-ixp42x-linksys-wrv54g.dts (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1f126890aSEmmanuel Vadot// SPDX-License-Identifier: ISC
2f126890aSEmmanuel Vadot/*
3f126890aSEmmanuel Vadot * Device Tree file for the Linksys WRV54G router
4f126890aSEmmanuel Vadot * Also known as Gemtek GTWX5715
5f126890aSEmmanuel Vadot * Based on a board file by George T. Joseph and other patches.
6f126890aSEmmanuel Vadot * This machine is based on IXP425.
7f126890aSEmmanuel Vadot */
8f126890aSEmmanuel Vadot
9f126890aSEmmanuel Vadot/dts-v1/;
10f126890aSEmmanuel Vadot
11f126890aSEmmanuel Vadot#include "intel-ixp42x.dtsi"
12f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h>
13f126890aSEmmanuel Vadot
14f126890aSEmmanuel Vadot/ {
15f126890aSEmmanuel Vadot	model = "Linksys WRV54G / Gemtek GTWX5715";
16*84943d6fSEmmanuel Vadot	compatible = "linksys,wrv54g", "intel,ixp42x";
17f126890aSEmmanuel Vadot	#address-cells = <1>;
18f126890aSEmmanuel Vadot	#size-cells = <1>;
19f126890aSEmmanuel Vadot
20f126890aSEmmanuel Vadot	memory@0 {
21f126890aSEmmanuel Vadot		/* 32 MB memory */
22f126890aSEmmanuel Vadot		device_type = "memory";
23f126890aSEmmanuel Vadot		reg = <0x00000000 0x2000000>;
24f126890aSEmmanuel Vadot	};
25f126890aSEmmanuel Vadot
26f126890aSEmmanuel Vadot	chosen {
27f126890aSEmmanuel Vadot		bootargs = "console=ttyS0,115200n8";
28f126890aSEmmanuel Vadot		stdout-path = "uart1:115200n8";
29f126890aSEmmanuel Vadot	};
30f126890aSEmmanuel Vadot
31f126890aSEmmanuel Vadot	aliases {
32f126890aSEmmanuel Vadot		/* UART2 is the primary console */
33f126890aSEmmanuel Vadot		serial0 = &uart1;
34f126890aSEmmanuel Vadot		serial1 = &uart0;
35f126890aSEmmanuel Vadot	};
36f126890aSEmmanuel Vadot
37f126890aSEmmanuel Vadot	/* There is an unpopulated LED slot (3) connected to GPIO 8 */
38f126890aSEmmanuel Vadot	leds {
39f126890aSEmmanuel Vadot		compatible = "gpio-leds";
40f126890aSEmmanuel Vadot		led-power {
41f126890aSEmmanuel Vadot			label = "wrv54g:yellow:power";
42f126890aSEmmanuel Vadot			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
43f126890aSEmmanuel Vadot			default-state = "on";
44f126890aSEmmanuel Vadot			linux,default-trigger = "heartbeat";
45f126890aSEmmanuel Vadot		};
46f126890aSEmmanuel Vadot		led-wireless {
47f126890aSEmmanuel Vadot			label = "wrv54g:yellow:wireless";
48f126890aSEmmanuel Vadot			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
49f126890aSEmmanuel Vadot			default-state = "on";
50f126890aSEmmanuel Vadot		};
51f126890aSEmmanuel Vadot		led-internet {
52f126890aSEmmanuel Vadot			label = "wrv54g:yellow:internet";
53f126890aSEmmanuel Vadot			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
54f126890aSEmmanuel Vadot			default-state = "on";
55f126890aSEmmanuel Vadot		};
56f126890aSEmmanuel Vadot		led-dmz {
57f126890aSEmmanuel Vadot			label = "wrv54g:green:dmz";
58f126890aSEmmanuel Vadot			gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
59f126890aSEmmanuel Vadot			default-state = "on";
60f126890aSEmmanuel Vadot		};
61f126890aSEmmanuel Vadot	};
62f126890aSEmmanuel Vadot
63f126890aSEmmanuel Vadot	/* This set-up comes from an OpenWrt patch */
64f126890aSEmmanuel Vadot	spi {
65f126890aSEmmanuel Vadot		compatible = "spi-gpio";
66f126890aSEmmanuel Vadot		#address-cells = <1>;
67f126890aSEmmanuel Vadot		#size-cells = <0>;
68f126890aSEmmanuel Vadot
69f126890aSEmmanuel Vadot		sck-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
70f126890aSEmmanuel Vadot		miso-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
71f126890aSEmmanuel Vadot		mosi-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
72f126890aSEmmanuel Vadot		cs-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
73f126890aSEmmanuel Vadot		num-chipselects = <1>;
74f126890aSEmmanuel Vadot
75f126890aSEmmanuel Vadot		switch@0 {
76f126890aSEmmanuel Vadot			compatible = "micrel,ks8995";
77f126890aSEmmanuel Vadot			reg = <0>;
78f126890aSEmmanuel Vadot			spi-max-frequency = <50000000>;
79f126890aSEmmanuel Vadot		};
80f126890aSEmmanuel Vadot	};
81f126890aSEmmanuel Vadot
82f126890aSEmmanuel Vadot	soc {
83f126890aSEmmanuel Vadot		bus@c4000000 {
84f126890aSEmmanuel Vadot			flash@0,0 {
85f126890aSEmmanuel Vadot				compatible = "intel,ixp4xx-flash", "cfi-flash";
86f126890aSEmmanuel Vadot				bank-width = <2>;
87f126890aSEmmanuel Vadot				/* Enable writes on the expansion bus */
88f126890aSEmmanuel Vadot				intel,ixp4xx-eb-write-enable = <1>;
89f126890aSEmmanuel Vadot				/* 8 MB of Flash mapped in at CS0 */
90f126890aSEmmanuel Vadot				reg = <0 0x00000000 0x00800000>;
91f126890aSEmmanuel Vadot
92f126890aSEmmanuel Vadot				partitions {
93f126890aSEmmanuel Vadot					compatible = "fixed-partitions";
94f126890aSEmmanuel Vadot					/*
95f126890aSEmmanuel Vadot					 * Partition info from a boot log
96f126890aSEmmanuel Vadot					 * CHECKME: not using redboot? FIS index 0x3f @7e00000?
97f126890aSEmmanuel Vadot					 */
98f126890aSEmmanuel Vadot					#address-cells = <1>;
99f126890aSEmmanuel Vadot					#size-cells = <1>;
100f126890aSEmmanuel Vadot					partition@0 {
101f126890aSEmmanuel Vadot						label = "boot";
102f126890aSEmmanuel Vadot						reg = <0x0 0x140000>;
103f126890aSEmmanuel Vadot						read-only;
104f126890aSEmmanuel Vadot					};
105f126890aSEmmanuel Vadot					partition@140000 {
106f126890aSEmmanuel Vadot						label = "linux";
107f126890aSEmmanuel Vadot						reg = <0x140000 0x100000>;
108f126890aSEmmanuel Vadot						read-only;
109f126890aSEmmanuel Vadot					};
110f126890aSEmmanuel Vadot					partition@240000 {
111f126890aSEmmanuel Vadot						label = "root";
112f126890aSEmmanuel Vadot						reg = <0x240000 0x480000>;
113f126890aSEmmanuel Vadot						read-write;
114f126890aSEmmanuel Vadot					};
115f126890aSEmmanuel Vadot				};
116f126890aSEmmanuel Vadot			};
117f126890aSEmmanuel Vadot		};
118f126890aSEmmanuel Vadot
119f126890aSEmmanuel Vadot		pci@c0000000 {
120f126890aSEmmanuel Vadot			status = "okay";
121f126890aSEmmanuel Vadot
122f126890aSEmmanuel Vadot			/*
123f126890aSEmmanuel Vadot			 * We have up to 2 slots (IDSEL) with 2 swizzled IRQs.
124f126890aSEmmanuel Vadot			 * Derived from the GTWX5715 PCI boardfile.
125f126890aSEmmanuel Vadot			 */
126f126890aSEmmanuel Vadot			#interrupt-cells = <1>;
127f126890aSEmmanuel Vadot			interrupt-map-mask = <0xf800 0 0 7>;
128f126890aSEmmanuel Vadot			interrupt-map =
129f126890aSEmmanuel Vadot			/* IDSEL 0 */
130f126890aSEmmanuel Vadot			<0x0000 0 0 1 &gpio0 10 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 0 is irq 10 */
131f126890aSEmmanuel Vadot			<0x0000 0 0 2 &gpio0 11 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 0 is irq 11 */
132f126890aSEmmanuel Vadot			/* IDSEL 1 */
133f126890aSEmmanuel Vadot			<0x0800 0 0 1 &gpio0 11 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 1 is irq 11 */
134f126890aSEmmanuel Vadot			<0x0800 0 0 2 &gpio0 10 IRQ_TYPE_LEVEL_LOW>; /* INT B on slot 1 is irq 10 */
135f126890aSEmmanuel Vadot		};
136f126890aSEmmanuel Vadot
137f126890aSEmmanuel Vadot		/*
138f126890aSEmmanuel Vadot		 * EthB - connected to the KS8995 switch ports 1-4
139f126890aSEmmanuel Vadot		 * FIXME: the boardfile defines .phy_mask = 0x1e for this port to enable output to
140f126890aSEmmanuel Vadot		 * all four switch ports, also using an out of tree multiphy patch.
141f126890aSEmmanuel Vadot		 * Do we need a new binding and property for this?
142f126890aSEmmanuel Vadot		 */
143f126890aSEmmanuel Vadot		ethernet@c8009000 {
144f126890aSEmmanuel Vadot			status = "okay";
145f126890aSEmmanuel Vadot			queue-rx = <&qmgr 3>;
146f126890aSEmmanuel Vadot			queue-txready = <&qmgr 20>;
147f126890aSEmmanuel Vadot			phy-mode = "rgmii";
148f126890aSEmmanuel Vadot			phy-handle = <&phy4>;
149f126890aSEmmanuel Vadot
150f126890aSEmmanuel Vadot			mdio {
151f126890aSEmmanuel Vadot				#address-cells = <1>;
152f126890aSEmmanuel Vadot				#size-cells = <0>;
153f126890aSEmmanuel Vadot
154f126890aSEmmanuel Vadot				/* Should be ports 1-4 on the KS8995 switch */
155f126890aSEmmanuel Vadot				phy4: ethernet-phy@4 {
156f126890aSEmmanuel Vadot					reg = <4>;
157f126890aSEmmanuel Vadot				};
158f126890aSEmmanuel Vadot
159f126890aSEmmanuel Vadot				/* Should be port 5 on the KS8995 switch */
160f126890aSEmmanuel Vadot				phy5: ethernet-phy@5 {
161f126890aSEmmanuel Vadot					reg = <5>;
162f126890aSEmmanuel Vadot				};
163f126890aSEmmanuel Vadot			};
164f126890aSEmmanuel Vadot		};
165f126890aSEmmanuel Vadot
166f126890aSEmmanuel Vadot		/* EthC - connected to KS8995 switch port 5 */
167f126890aSEmmanuel Vadot		ethernet@c800a000 {
168f126890aSEmmanuel Vadot			status = "okay";
169f126890aSEmmanuel Vadot			queue-rx = <&qmgr 4>;
170f126890aSEmmanuel Vadot			queue-txready = <&qmgr 21>;
171f126890aSEmmanuel Vadot			phy-mode = "rgmii";
172f126890aSEmmanuel Vadot			phy-handle = <&phy5>;
173f126890aSEmmanuel Vadot		};
174f126890aSEmmanuel Vadot	};
175f126890aSEmmanuel Vadot};
176