xref: /linux/drivers/misc/lan966x_pci.dtso (revision 25768de50b1f2dbb6ea44bd5148a87fe2c9c3688)
1185686beSHerve Codina// SPDX-License-Identifier: GPL-2.0
2185686beSHerve Codina/*
3185686beSHerve Codina * Copyright (C) 2022 Microchip UNG
4185686beSHerve Codina */
5185686beSHerve Codina
6185686beSHerve Codina#include <dt-bindings/clock/microchip,lan966x.h>
7185686beSHerve Codina#include <dt-bindings/gpio/gpio.h>
8185686beSHerve Codina#include <dt-bindings/interrupt-controller/irq.h>
9185686beSHerve Codina#include <dt-bindings/mfd/atmel-flexcom.h>
10185686beSHerve Codina#include <dt-bindings/phy/phy-lan966x-serdes.h>
11185686beSHerve Codina
12185686beSHerve Codina/dts-v1/;
13185686beSHerve Codina/plugin/;
14185686beSHerve Codina
15185686beSHerve Codina/ {
16185686beSHerve Codina	fragment@0 {
17185686beSHerve Codina		target-path = "";
18*cf3e10ccSHerve Codina
19*cf3e10ccSHerve Codina		/*
20*cf3e10ccSHerve Codina		 * These properties allow to avoid a dtc warnings.
21*cf3e10ccSHerve Codina		 * The real interrupt controller is the PCI device itself. It
22*cf3e10ccSHerve Codina		 * is the node on which the device tree overlay will be applied.
23*cf3e10ccSHerve Codina		 * This node has those properties.
24*cf3e10ccSHerve Codina		 */
25*cf3e10ccSHerve Codina		#interrupt-cells = <1>;
26*cf3e10ccSHerve Codina		interrupt-controller;
27*cf3e10ccSHerve Codina
28185686beSHerve Codina		__overlay__ {
29185686beSHerve Codina			#address-cells = <3>;
30185686beSHerve Codina			#size-cells = <2>;
31185686beSHerve Codina
32344ea0d3SHerve Codina			cpu_clk: clock-600000000 {
33344ea0d3SHerve Codina				compatible = "fixed-clock";
34344ea0d3SHerve Codina				#clock-cells = <0>;
35344ea0d3SHerve Codina				clock-frequency = <600000000>;  /* CPU clock = 600MHz */
36344ea0d3SHerve Codina			};
37344ea0d3SHerve Codina
38344ea0d3SHerve Codina			ddr_clk: clock-30000000 {
39344ea0d3SHerve Codina				compatible = "fixed-clock";
40344ea0d3SHerve Codina				#clock-cells = <0>;
41344ea0d3SHerve Codina				clock-frequency = <30000000>;  /* Fabric clock = 30MHz */
42344ea0d3SHerve Codina			};
43344ea0d3SHerve Codina
44344ea0d3SHerve Codina			sys_clk: clock-15625000 {
45344ea0d3SHerve Codina				compatible = "fixed-clock";
46344ea0d3SHerve Codina				#clock-cells = <0>;
47344ea0d3SHerve Codina				clock-frequency = <15625000>;  /* System clock = 15.625MHz */
48344ea0d3SHerve Codina			};
49344ea0d3SHerve Codina
50185686beSHerve Codina			pci-ep-bus@0 {
51185686beSHerve Codina				compatible = "simple-bus";
52185686beSHerve Codina				#address-cells = <1>;
53185686beSHerve Codina				#size-cells = <1>;
54185686beSHerve Codina
55185686beSHerve Codina				/*
56185686beSHerve Codina				 * map @0xe2000000 (32MB) to BAR0 (CPU)
57185686beSHerve Codina				 * map @0xe0000000 (16MB) to BAR1 (AMBA)
58185686beSHerve Codina				 */
59185686beSHerve Codina				ranges = <0xe2000000 0x00 0x00 0x00 0x2000000
60185686beSHerve Codina				          0xe0000000 0x01 0x00 0x00 0x1000000>;
61185686beSHerve Codina
62185686beSHerve Codina				oic: oic@e00c0120 {
63185686beSHerve Codina					compatible = "microchip,lan966x-oic";
64185686beSHerve Codina					#interrupt-cells = <2>;
65185686beSHerve Codina					interrupt-controller;
66185686beSHerve Codina					interrupts = <0>; /* PCI INTx assigned interrupt */
67185686beSHerve Codina					reg = <0xe00c0120 0x190>;
68185686beSHerve Codina				};
69185686beSHerve Codina
70185686beSHerve Codina				cpu_ctrl: syscon@e00c0000 {
71185686beSHerve Codina					compatible = "microchip,lan966x-cpu-syscon", "syscon";
72185686beSHerve Codina					reg = <0xe00c0000 0xa8>;
73185686beSHerve Codina				};
74185686beSHerve Codina
75185686beSHerve Codina				reset: reset@e200400c {
76185686beSHerve Codina					compatible = "microchip,lan966x-switch-reset";
77185686beSHerve Codina					reg = <0xe200400c 0x4>, <0xe00c0000 0xa8>;
78185686beSHerve Codina					reg-names = "gcb","cpu";
79185686beSHerve Codina					#reset-cells = <1>;
80185686beSHerve Codina					cpu-syscon = <&cpu_ctrl>;
81185686beSHerve Codina				};
82185686beSHerve Codina
83185686beSHerve Codina				gpio: pinctrl@e2004064 {
84185686beSHerve Codina					compatible = "microchip,lan966x-pinctrl";
85185686beSHerve Codina					reg = <0xe2004064 0xb4>,
86185686beSHerve Codina					      <0xe2010024 0x138>;
87185686beSHerve Codina					resets = <&reset 0>;
88185686beSHerve Codina					reset-names = "switch";
89185686beSHerve Codina					gpio-controller;
90185686beSHerve Codina					#gpio-cells = <2>;
91185686beSHerve Codina					gpio-ranges = <&gpio 0 0 78>;
92185686beSHerve Codina					interrupt-parent = <&oic>;
93185686beSHerve Codina					interrupt-controller;
94185686beSHerve Codina					interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
95185686beSHerve Codina					#interrupt-cells = <2>;
96185686beSHerve Codina
97185686beSHerve Codina					tod_pins: tod_pins {
98185686beSHerve Codina						pins = "GPIO_36";
99185686beSHerve Codina						function = "ptpsync_1";
100185686beSHerve Codina					};
101185686beSHerve Codina
102185686beSHerve Codina					fc0_a_pins: fcb4-i2c-pins {
103185686beSHerve Codina						/* RXD, TXD */
104185686beSHerve Codina						pins = "GPIO_9", "GPIO_10";
105185686beSHerve Codina						function = "fc0_a";
106185686beSHerve Codina					};
107185686beSHerve Codina
108185686beSHerve Codina				};
109185686beSHerve Codina
110185686beSHerve Codina				serdes: serdes@e202c000 {
111185686beSHerve Codina					compatible = "microchip,lan966x-serdes";
112185686beSHerve Codina					reg = <0xe202c000 0x9c>,
113185686beSHerve Codina					      <0xe2004010 0x4>;
114185686beSHerve Codina					#phy-cells = <2>;
115185686beSHerve Codina				};
116185686beSHerve Codina
117185686beSHerve Codina				mdio1: mdio@e200413c {
118185686beSHerve Codina					#address-cells = <1>;
119185686beSHerve Codina					#size-cells = <0>;
120185686beSHerve Codina					compatible = "microchip,lan966x-miim";
121185686beSHerve Codina					reg = <0xe200413c 0x24>,
122185686beSHerve Codina					      <0xe2010020 0x4>;
123185686beSHerve Codina
124185686beSHerve Codina					resets = <&reset 0>;
125185686beSHerve Codina					reset-names = "switch";
126185686beSHerve Codina
127185686beSHerve Codina					lan966x_phy0: ethernet-lan966x_phy@1 {
128185686beSHerve Codina						reg = <1>;
129185686beSHerve Codina					};
130185686beSHerve Codina
131185686beSHerve Codina					lan966x_phy1: ethernet-lan966x_phy@2 {
132185686beSHerve Codina						reg = <2>;
133185686beSHerve Codina					};
134185686beSHerve Codina				};
135185686beSHerve Codina
136185686beSHerve Codina				switch: switch@e0000000 {
137185686beSHerve Codina					compatible = "microchip,lan966x-switch";
138185686beSHerve Codina					reg = <0xe0000000 0x0100000>,
139185686beSHerve Codina					      <0xe2000000 0x0800000>;
140185686beSHerve Codina					reg-names = "cpu", "gcb";
141185686beSHerve Codina
142185686beSHerve Codina					interrupt-parent = <&oic>;
143185686beSHerve Codina					interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
144185686beSHerve Codina						     <9 IRQ_TYPE_LEVEL_HIGH>;
145185686beSHerve Codina					interrupt-names = "xtr", "ana";
146185686beSHerve Codina
147185686beSHerve Codina					resets = <&reset 0>;
148185686beSHerve Codina					reset-names = "switch";
149185686beSHerve Codina
150185686beSHerve Codina					pinctrl-names = "default";
151185686beSHerve Codina					pinctrl-0 = <&tod_pins>;
152185686beSHerve Codina
153185686beSHerve Codina					ethernet-ports {
154185686beSHerve Codina						#address-cells = <1>;
155185686beSHerve Codina						#size-cells = <0>;
156185686beSHerve Codina
157185686beSHerve Codina						port0: port@0 {
158185686beSHerve Codina							phy-handle = <&lan966x_phy0>;
159185686beSHerve Codina
160185686beSHerve Codina							reg = <0>;
161185686beSHerve Codina							phy-mode = "gmii";
162185686beSHerve Codina							phys = <&serdes 0 CU(0)>;
163185686beSHerve Codina						};
164185686beSHerve Codina
165185686beSHerve Codina						port1: port@1 {
166185686beSHerve Codina							phy-handle = <&lan966x_phy1>;
167185686beSHerve Codina
168185686beSHerve Codina							reg = <1>;
169185686beSHerve Codina							phy-mode = "gmii";
170185686beSHerve Codina							phys = <&serdes 1 CU(1)>;
171185686beSHerve Codina						};
172185686beSHerve Codina					};
173185686beSHerve Codina				};
174185686beSHerve Codina			};
175185686beSHerve Codina		};
176185686beSHerve Codina	};
177185686beSHerve Codina};
178