1 From cb9a896a799393b3cb5947bef3c95eb5ffb44776 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Thu, 10 Oct 2019 09:08:47 +0100
4 Subject: [PATCH] overlays: Add w5500 overlay
6 Add an overlay to configure the Wiznet W5500 Ethernet controller on
7 SPI0. The 'cs' parameter chooses the Chip Select (default 0).
9 See: https://github.com/raspberrypi/linux/issues/3276
11 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
13 arch/arm/boot/dts/overlays/Makefile | 1 +
14 arch/arm/boot/dts/overlays/README | 10 ++++
15 arch/arm/boot/dts/overlays/w5500-overlay.dts | 63 ++++++++++++++++++++
16 3 files changed, 74 insertions(+)
17 create mode 100644 arch/arm/boot/dts/overlays/w5500-overlay.dts
19 --- a/arch/arm/boot/dts/overlays/Makefile
20 +++ b/arch/arm/boot/dts/overlays/Makefile
21 @@ -183,6 +183,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
28 targets += dtbs dtbs_install
29 --- a/arch/arm/boot/dts/overlays/README
30 +++ b/arch/arm/boot/dts/overlays/README
31 @@ -2538,6 +2538,16 @@ Params: gpiopin GPIO for
32 pullup Now enabled by default (ignored)
36 +Info: Overlay for the Wiznet W5500 Ethernet Controller on SPI0
37 +Load: dtoverlay=w5500,<param>=<val>
38 +Params: int_pin GPIO used for INT (default 25)
40 + speed SPI bus speed (default 30000000)
42 + cs SPI bus Chip Select (default 0)
46 Info: Configures the wittypi RTC module.
47 Load: dtoverlay=wittypi,<param>=<val>
49 +++ b/arch/arm/boot/dts/overlays/w5500-overlay.dts
51 +// Overlay for the Wiznet w5500 Ethernet Controller
56 + compatible = "brcm,bcm2835";
59 + target = <&spidev0>;
61 + status = "disabled";
66 + target = <&spidev1>;
68 + status = "disabled";
75 + /* needed to avoid dtc warning */
76 + #address-cells = <1>;
82 + compatible = "wiznet,w5500";
83 + reg = <0>; /* CE0 */
84 + pinctrl-names = "default";
85 + pinctrl-0 = <ð1_pins>;
86 + interrupt-parent = <&gpio>;
87 + interrupts = <25 0x8>;
88 + spi-max-frequency = <30000000>;
89 +// local-mac-address = [aa bb cc dd ee ff];
98 + eth1_pins: eth1_pins {
100 + brcm,function = <0>; /* in */
101 + brcm,pull = <0>; /* none */
107 + int_pin = <ð1>, "interrupts:0",
108 + <ð1_pins>, "brcm,pins:0";
109 + speed = <ð1>, "spi-max-frequency:0";
110 + cs = <ð1>, "reg:0",