1 From ea006f68522d82b294094fd29585b16290758d29 Mon Sep 17 00:00:00 2001
2 From: Alan Yiding Wang <y2366wan@uwaterloo.ca>
3 Date: Sat, 3 Dec 2016 23:22:02 -0500
4 Subject: [PATCH] BCM270X_DT: Add overlay for enc28j60 on SPI2
6 Works on SPI2 for compute module
8 arch/arm/boot/dts/overlays/Makefile | 1 +
9 arch/arm/boot/dts/overlays/README | 10 ++++-
10 .../boot/dts/overlays/enc28j60-spi2-overlay.dts | 47 ++++++++++++++++++++++
11 3 files changed, 57 insertions(+), 1 deletion(-)
12 create mode 100644 arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts
14 --- a/arch/arm/boot/dts/overlays/Makefile
15 +++ b/arch/arm/boot/dts/overlays/Makefile
16 @@ -28,6 +28,7 @@ dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo
17 dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo
18 dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo
19 dtbo-$(RPI_DT_OVERLAYS) += enc28j60.dtbo
20 +dtbo-$(RPI_DT_OVERLAYS) += enc28j60-spi2.dtbo
21 dtbo-$(RPI_DT_OVERLAYS) += gpio-ir.dtbo
22 dtbo-$(RPI_DT_OVERLAYS) += gpio-poweroff.dtbo
23 dtbo-$(RPI_DT_OVERLAYS) += hifiberry-amp.dtbo
24 --- a/arch/arm/boot/dts/overlays/README
25 +++ b/arch/arm/boot/dts/overlays/README
26 @@ -344,12 +344,20 @@ Params: dr_mode Dual rol
30 -Info: Overlay for the Microchip ENC28J60 Ethernet Controller (SPI)
31 +Info: Overlay for the Microchip ENC28J60 Ethernet Controller on SPI0
32 Load: dtoverlay=enc28j60,<param>=<val>
33 Params: int_pin GPIO used for INT (default 25)
35 speed SPI bus speed (default 12000000)
39 +Info: Overlay for the Microchip ENC28J60 Ethernet Controller on SPI2
40 +Load: dtoverlay=enc28j60-spi2,<param>=<val>
41 +Params: int_pin GPIO used for INT (default 39)
43 + speed SPI bus speed (default 12000000)
47 Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core-
49 +++ b/arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts
51 +// Overlay for the Microchip ENC28J60 Ethernet Controller - SPI2 Compute Module
57 + compatible = "brcm,bcm2708";
62 + /* needed to avoid dtc warning */
63 + #address-cells = <1>;
69 + compatible = "microchip,enc28j60";
70 + reg = <0>; /* CE0 */
71 + pinctrl-names = "default";
72 + pinctrl-0 = <ð1_pins>;
73 + interrupt-parent = <&gpio>;
74 + interrupts = <39 0x2>; /* falling edge */
75 + spi-max-frequency = <12000000>;
84 + eth1_pins: eth1_pins {
86 + brcm,function = <0>; /* in */
87 + brcm,pull = <0>; /* none */
93 + int_pin = <ð1>, "interrupts:0",
94 + <ð1_pins>, "brcm,pins:0";
95 + speed = <ð1>, "spi-max-frequency:0";