Add ENC28J60 example overlay

This commit is contained in:
zador-blood-stained
2017-08-15 23:49:14 +03:00
parent 97af53d951
commit 665a8a2d2d
2 changed files with 46 additions and 0 deletions

View File

@@ -58,6 +58,14 @@ Compared to the other ones in this repository these are "standalone" - no fixup
- may require changing the interrupt GPIO specifier
### spi-enc28j60
- overlays for a ENC28J60 Ethernet controller connected to the SPI bus
- bindings documentation: [microchip,enc28j60.txt](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/Documentation/devicetree/bindings/net/microchip,enc28j60.txt)
- requires activating the SPI bus device is connected to by a kernel provided overlays (i.e. `overlays=spi0`)
- may require changing the interrupt GPIO specifier
- using external pull-up resistor on the interrupt line is highly recommended if the module doesn't have one
### spi-mcp251x
- overlays for a MCP251x CAN controller connected to the SPI bus
- bindings documentation: [microchip,mcp251x.txt](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/Documentation/devicetree/bindings/net/can/microchip,mcp251x.txt)

38
examples/spi-enc28j60.dts Normal file
View File

@@ -0,0 +1,38 @@
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
/* This fragment is required only if the IRQ pin requires internal pull-up */
fragment@0 {
target = <&pio>;
__overlay__ {
enc28j60_pins: enc28j60_pins {
pins = "PA7";
function = "irq";
bias-pull-up;
};
};
};
fragment@1 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
enc28j60 {
compatible = "microchip,enc28j60";
reg = <0>;
interrupt-parent = <&pio>;
interrupts = <0 7 2>; /* PA7 IRQ_TYPE_EDGE_FALLING */
spi-max-frequency = <12000000>;
status = "okay";
/* These are required only if internal pull-up is used for the IRQ pin */
pinctrl-names = "default";
pinctrl-0 = <&enc28j60_pins>;
};
};
};
};