Im using the ENC28j60 to establish connection to my laptop or router. Also im using SPI 1 from the Compute Module so:
CLK - 21
MOSI - 20
MISO - 19
CE0 - 18
I also create one overlay for it:
Code: Select all
// Overlay for the Microchip ENC28J60 Ethernet Controller - SPI1 Compute Module
// Interrupt pin: 39
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
[email protected] {
target = <&spi1>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
eth1: [email protected]{
compatible = "microchip,enc28j60";
reg = <0>; /* CE0 */
pinctrl-names = "default";
pinctrl-0 = <ð1_pins>;
interrupt-parent = <&gpio>;
interrupts = <39 0x2>; /* falling edge */
spi-max-frequency = <12000000>;
status = "okay";
};
};
};
[email protected] {
target = <&gpio>;
__overlay__ {
eth1_pins: eth1_pins {
brcm,pins = <39>;
brcm,function = <0>; /* in */
brcm,pull = <0>; /* none */
};
};
};
__overrides__ {
int_pin = <ð1>, "interrupts:0",
<ð1_pins>, "brcm,pins:0";
speed = <ð1>, "spi-max-frequency:0";
};
};
Code: Select all
dtoverlay=enc28j60-spi1 //One custom overlay to work on SPI1
dtoverlay=spi1_cs1,cs0_spidev=off
Code: Select all
[email protected]:~$ dmesg | grep spi
[ 15.053446] enc28j60 spi1.0: enc28j60 Ethernet driver 1.02 loaded
net eth0: enc28j60 driver registered
Code: Select all
Ipv6 : ADDRCONF(NETDEV_UP) eth0 link not ready