kernel: update kernel 4.4 to 4.4.59
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0556-BCM270X_DT-Add-overlay-for-enc28j60-on-SPI2.patch
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
5
6 Works on SPI2 for compute module
7 ---
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
13
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
27
28
29 Name: enc28j60
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)
34
35 speed SPI bus speed (default 12000000)
36
37 +
38 +Name: enc28j60-spi2
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)
42 +
43 + speed SPI bus speed (default 12000000)
44 +
45
46 Name: gpio-ir
47 Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core-
48 --- /dev/null
49 +++ b/arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts
50 @@ -0,0 +1,47 @@
51 +// Overlay for the Microchip ENC28J60 Ethernet Controller - SPI2 Compute Module
52 +// Interrupt pin: 39
53 +/dts-v1/;
54 +/plugin/;
55 +
56 +/ {
57 + compatible = "brcm,bcm2708";
58 +
59 + fragment@0 {
60 + target = <&spi2>;
61 + __overlay__ {
62 + /* needed to avoid dtc warning */
63 + #address-cells = <1>;
64 + #size-cells = <0>;
65 +
66 + status = "okay";
67 +
68 + eth1: enc28j60@0{
69 + compatible = "microchip,enc28j60";
70 + reg = <0>; /* CE0 */
71 + pinctrl-names = "default";
72 + pinctrl-0 = <&eth1_pins>;
73 + interrupt-parent = <&gpio>;
74 + interrupts = <39 0x2>; /* falling edge */
75 + spi-max-frequency = <12000000>;
76 + status = "okay";
77 + };
78 + };
79 + };
80 +
81 + fragment@1 {
82 + target = <&gpio>;
83 + __overlay__ {
84 + eth1_pins: eth1_pins {
85 + brcm,pins = <39>;
86 + brcm,function = <0>; /* in */
87 + brcm,pull = <0>; /* none */
88 + };
89 + };
90 + };
91 +
92 + __overrides__ {
93 + int_pin = <&eth1>, "interrupts:0",
94 + <&eth1_pins>, "brcm,pins:0";
95 + speed = <&eth1>, "spi-max-frequency:0";
96 + };
97 +};