rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

[SOLVED] ENC28J60 on SPI1

Tue Oct 16, 2018 4:05 pm

Hello all!

I have one Compute Module and want to use the SPI1 interface wich are the GPIOS 17,18,19,20 and 21. However the SPI1 interface is ALT4 for these GPIOS. My question is: i want to know how to make these GPIO use their ALT4.

Thank you all!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Tue Oct 16, 2018 4:18 pm

There isn't an overlay that supports this yet, but there is one for spi2: https://github.com/raspberrypi/linux/bl ... verlay.dts
A simple search and replace of spi2 to spi1, and a change of the default irq pin (I'm guessing), and you should have a functional overlay. Assuming you called it enc28j60-spi1-overlay.dts, compile it with:

Code: Select all

$ dtc [email protected] -I dts -O dtb -o enc28j60-spi1.dtbo enc28j60-spi1-overlay.dts
Don't worry if you get a few warnings - the dtc tool doesn't understand overlays so well.

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Tue Oct 16, 2018 4:38 pm

PhilE wrote:
Tue Oct 16, 2018 4:18 pm
There isn't an overlay that supports this yet, but there is one for spi2: https://github.com/raspberrypi/linux/bl ... verlay.dts
A simple search and replace of spi2 to spi1, and a change of the default irq pin (I'm guessing), and you should have a functional overlay. Assuming you called it enc28j60-spi1-overlay.dts, compile it with:

Code: Select all

$ dtc [email protected] -I dts -O dtb -o enc28j60-spi1.dtbo enc28j60-spi1-overlay.dts
Don't worry if you get a few warnings - the dtc tool doesn't understand overlays so well.

Code: Select all

{
	compatible = "brcm,bcm2708";

	[email protected] {
		target = <&spi1>; //<&spi2>
		__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 = <&eth1_pins>;
				interrupt-parent = <&gpio>;
				interrupts = <39 0x2>; /* falling edge */
				spi-max-frequency = <12000000>;
				status = "okay";
			};
		};
	};
Like this?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Tue Oct 16, 2018 5:17 pm

Yes - that looks good so far. Now change the default interrupt pin if you want to, compile it, copy it to /boot/overlays and add dtoverlay=enc28j60-spi1 to config.txt.

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 9:07 am

PhilE wrote:
Tue Oct 16, 2018 5:17 pm
Yes - that looks good so far. Now change the default interrupt pin if you want to, compile it, copy it to /boot/overlays and add dtoverlay=enc28j60-spi1 to config.txt.
The command line you suggested

Code: Select all

 dtc [email protected] -I dts -O dtb -o enc28j60-spi1.dtbo enc28j60-spi1-overlay.dts
i belive the correct is

Code: Select all

 dtc [email protected] -I dtb -O dts -o enc28j60-spi1.dtbo enc28j60-spi1-overlay.dts
. Your is giving me the error: Blob has incorrect magic number.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 9:22 am

No, the command is correct:

Code: Select all

# Copy spi2 overlay source to a new file, changing spi2 to spi1 along the way
[email protected]:~$ sed -e 's/spi2/spi1/' enc28j60-spi2-overlay.dts > enc28j60-spi1-overlay.dts
# Now compile it
[email protected]:~$ dtc [email protected] -I dts -O dtb -o enc28j60-spi1.dtbo enc28j60-spi1-overlay.dts
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
'-I dts' tells dtc that the input file is in DTS (Device Tree source) format. '-O dtb' asks for the output to be in DTB format (Device Tree binary). ''-o enc28j60-spi1.dtbo' tells it where to write the output, and the final parameter is the source file.

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 9:59 am

PhilE wrote:
Wed Oct 17, 2018 9:22 am
No, the command is correct:

Code: Select all

# Copy spi2 overlay source to a new file, changing spi2 to spi1 along the way
[email protected]:~$ sed -e 's/spi2/spi1/' enc28j60-spi2-overlay.dts > enc28j60-spi1-overlay.dts
# Now compile it
[email protected]:~$ dtc [email protected] -I dts -O dtb -o enc28j60-spi1.dtbo enc28j60-spi1-overlay.dts
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
'-I dts' tells dtc that the input file is in DTS (Device Tree source) format. '-O dtb' asks for the output to be in DTB format (Device Tree binary). ''-o enc28j60-spi1.dtbo' tells it where to write the output, and the final parameter is the source file.
Ok i did the all the step but nothing working... Im using the pins SPI1 :
18 SPI1 CE0
19 SPI1 MISO PWM1
20 SPI1 MOSI GPCLK0
21 SPI1 SCLK

Im also using the SPI0:

8 SPI0 CE0 N
9 SPI0 MISO
10 SPI0 MOSI
11 SPI0 SCLK

The last one is working without problem.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 10:10 am

Show the output of "raspi-gpio get 18-21" and "lsmod" when using the enc28j60-spi1 overlay.

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 10:16 am

PhilE wrote:
Wed Oct 17, 2018 10:10 am
Show the output of "raspi-gpio get 18-21" and "lsmod" when using the enc28j60-spi1 overlay.
lsmod give me this

Module Size Used by
cfg80211 527100 0
rfkill 21373 2 cfg80211
spidev 7034 0
snd_bcm2835 23131 0
snd_pcm 97825 1 snd_bcm2835
snd_timer 22706 1 snd_pcm
spi_bcm2835aux 5235 0
snd 68784 3 snd_timer,snd_bcm2835,snd_pcm
spi_bcm2835 7424 0
bcm2835_gpiomem 3791 0
fixed 3029 0
uio_pdrv_genirq 3718 0
uio 10166 1 uio_pdrv_genirq
ip_tables 12512 0
x_tables 20921 1 ip_tables
ipv6 384613 16

I didnt installed gpio-get but i wil dot it and give you the output. Thanks for your help!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 10:16 am

Code: Select all

 sudo apt-get install raspi-gpio

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 10:19 am

I suspect your overlay is failing to load. "sudo vcdbg log msg" will show you the log messages from the firmware - they are sent to stderr, so if you want to put them in a file you will need "sudo vcdbg log msg >& vcdbg.txt" (or "sudo vcdbg log msg > vcdbg.txt 2>&1" for a simpler shell).

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 11:04 am

PhilE wrote:
Wed Oct 17, 2018 10:19 am
I suspect your overlay is failing to load. "sudo vcdbg log msg" will show you the log messages from the firmware - they are sent to stderr, so if you want to put them in a file you will need "sudo vcdbg log msg >& vcdbg.txt" (or "sudo vcdbg log msg > vcdbg.txt 2>&1" for a simpler shell).
My gpio get :

BANK0 (GPIO 0 to 27):
GPIO 0: level=1 fsel=0 func=INPUT
GPIO 1: level=1 fsel=0 func=INPUT
GPIO 2: level=1 fsel=0 func=INPUT
GPIO 3: level=1 fsel=0 func=INPUT
GPIO 4: level=1 fsel=0 func=INPUT
GPIO 5: level=1 fsel=0 func=INPUT
GPIO 6: level=1 fsel=0 func=INPUT
GPIO 7: level=1 fsel=1 func=OUTPUT
GPIO 8: level=1 fsel=1 func=OUTPUT
GPIO 9: level=0 fsel=4 alt=0 func=SPI0_MISO
GPIO 10: level=0 fsel=4 alt=0 func=SPI0_MOSI
GPIO 11: level=0 fsel=4 alt=0 func=SPI0_SCLK
GPIO 12: level=0 fsel=0 func=INPUT
GPIO 13: level=0 fsel=0 func=INPUT
GPIO 14: level=0 fsel=4 alt=0 func=TXD0
GPIO 15: level=1 fsel=4 alt=0 func=RXD0
GPIO 16: level=0 fsel=0 func=INPUT
GPIO 17: level=0 fsel=0 func=INPUT
GPIO 18: level=1 fsel=1 func=OUTPUT
GPIO 19: level=0 fsel=3 alt=4 func=SPI1_MISO
GPIO 20: level=0 fsel=3 alt=4 func=SPI1_MOSI
GPIO 21: level=0 fsel=3 alt=4 func=SPI1_SCLK
GPIO 22: level=0 fsel=0 func=INPUT
GPIO 23: level=0 fsel=0 func=INPUT
GPIO 24: level=0 fsel=0 func=INPUT
GPIO 25: level=0 fsel=0 func=INPUT
GPIO 26: level=0 fsel=0 func=INPUT
GPIO 27: level=0 fsel=0 func=INPUT
BANK1 (GPIO 28 to 45):
GPIO 28: level=0 fsel=0 func=INPUT
GPIO 29: level=0 fsel=0 func=INPUT
GPIO 30: level=0 fsel=0 func=INPUT
GPIO 31: level=0 fsel=0 func=INPUT
GPIO 32: level=0 fsel=0 func=INPUT
GPIO 33: level=0 fsel=0 func=INPUT
GPIO 34: level=1 fsel=0 func=INPUT
GPIO 35: level=1 fsel=0 func=INPUT
GPIO 36: level=1 fsel=0 func=INPUT
GPIO 37: level=0 fsel=0 func=INPUT
GPIO 38: level=0 fsel=0 func=INPUT
GPIO 39: level=0 fsel=0 func=INPUT
GPIO 40: level=0 fsel=0 func=INPUT
GPIO 41: level=0 fsel=0 func=INPUT
GPIO 42: level=0 fsel=0 func=INPUT
GPIO 43: level=0 fsel=0 func=INPUT
GPIO 44: level=0 fsel=0 func=INPUT
GPIO 45: level=0 fsel=0 func=INPUT
BANK2 (GPIO 46 to 53):
GPIO 46: level=1 fsel=0 func=INPUT
GPIO 47: level=0 fsel=1 func=OUTPUT
GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3

The output of sudo vcdbg log msg :

001849.674: brfs: File read: 142 bytes
002236.935: brfs: File read: /mfs/sd/kernel.img
002236.960: Loading 'kernel.img' to 0x8000 size 0x42d210
002237.002: No kernel trailer - assuming DT-capable
002237.030: brfs: File read: 4379152 bytes
002239.802: brfs: File read: /mfs/sd/bcm2708-rpi-cm.dtb
002239.826: Loading 'bcm2708-rpi-cm.dtb' to 0x435210 size 0x3aee
002249.656: gpioman: gpioman_get_pin_num: pin NUM_CAMERAS not defined
002302.302: gpioman: gpioman_get_pin_num: pin POWER_LOW not defined
002304.595: brfs: File read: 15086 bytes
002306.526: brfs: File read: /mfs/sd/config.txt
002306.840: dtparam: spi=on
002311.529: dtparam: audio=on
002319.106: brfs: File read: 1633 bytes
002325.114: brfs: File read: /mfs/sd/overlays/enc28j60-spi1.dtbo
002331.854: Loaded overlay 'enc28j60-spi1'
002351.774: brfs: File read: 1317 bytes
002357.087: brfs: File read: /mfs/sd/overlays/spi1-1cs.dtbo
002365.671: Loaded overlay 'spi1-1cs'
003284.835: gpioman: gpioman_get_pin_num: pin PWML not defined
003284.855: gpioman: gpioman_get_pin_num: pin PWMR not defined
003291.931: gpioman: gpioman_get_pin_num: pin PWML not defined
003291.951: gpioman: gpioman_get_pin_num: pin PWMR not defined
003296.317: Device tree loaded to 0x1bfebe00 (size 0x41cf)
003297.590: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
004954.263: vchiq_core: vchiq_init_state: slot_zero = 0x5b580000, is_master = 1
004959.373: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 11:15 am

You may need to disable spidev on spi1.0 because the enc28j60 has a kernel driver - use "dtoverlay=spi1-1cs,cs0_spidev=off".

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 11:30 am

PhilE wrote:
Wed Oct 17, 2018 11:15 am
You may need to disable spidev on spi1.0 because the enc28j60 has a kernel driver - use "dtoverlay=spi1-1cs,cs0_spidev=off".
Nothing... I check ifconfig :

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

However the SPI seems to be ok

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 11:33 am

Did you change the interrupt pin assignment?

What does "dmesg" report?

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 11:41 am

PhilE wrote:
Wed Oct 17, 2018 11:33 am
Did you change the interrupt pin assignment?

What does "dmesg" report?
Im not using the INT pin, i really need it?

0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.59+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1047 Sun Oct 29 11:47:10 GMT 2017
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] OF: fdt:Machine model: Raspberry Pi Compute Module Rev 1.0
[ 0.000000] cma: Reserved 8 MiB at 0x1b400000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] On node 0 totalpages: 114688
[ 0.000000] free_area_init_node: node 0, pgdat c0914e10, node_mem_map db010000
[ 0.000000] Normal zone: 1008 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 114688 pages, LIFO batch:31
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 113680
[ 0.000000] Kernel command line: bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:39:D9:43 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=PARTUUID=bff42074-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 435944K/458752K available (5950K kernel code, 491K rwdata, 1948K rodata, 396K init, 725K bss, 14616K reserved, 8192K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xdc800000 - 0xff800000 ( 560 MB)
lowmem : 0xc0000000 - 0xdc000000 ( 448 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc05d7a48 (5951 kB)
.init : 0xc0841000 - 0xc08a4000 ( 396 kB)
.data : 0xc08a4000 - 0xc091ef48 ( 492 kB)
.bss : 0xc091ef48 - 0xc09d4648 ( 726 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000031] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[ 0.000077] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[ 0.000177] bcm2835: system timer (irq = 27)
[ 0.000650] Console: colour dummy device 80x30
[ 0.001412] console [tty1] enabled
[ 0.001466] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[ 0.060363] pid_max: default: 32768 minimum: 301
[ 0.060828] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.060898] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.062187] Disabling memory control group subsystem
[ 0.062396] CPU: Testing write buffer coherency: ok
[ 0.062498] ftrace: allocating 21715 entries in 64 pages
[ 0.180706] Setting up static identity map for 0x8200 - 0x8238
[ 0.182783] devtmpfs: initialized
[ 0.192500] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[ 0.193014] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.193114] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.194428] pinctrl core: initialized pinctrl subsystem
[ 0.195934] NET: Registered protocol family 16
[ 0.198401] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.207996] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[ 0.208090] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.208231] Serial: AMBA PL011 UART driver
[ 0.211193] bcm2835-mbox 2000b880.mailbox: mailbox enabled
[ 0.212747] irq: no irq domain found for /soc/[email protected] !
[ 0.262428] bcm2835-dma 20007000.dma: DMA legacy API manager at dc80d000, dmachans=0x1
[ 0.265198] SCSI subsystem initialized
[ 0.265569] usbcore: registered new interface driver usbfs
[ 0.265749] usbcore: registered new interface driver hub
[ 0.265990] usbcore: registered new device driver usb
[ 0.270781] raspberrypi-firmware soc:firmware: Attached to firmware from 2017-10-24 17:09
[ 0.272737] clocksource: Switched to clocksource timer
[ 0.326903] VFS: Disk quotas dquot_6.6.0
[ 0.327105] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.327478] FS-Cache: Loaded
[ 0.327876] CacheFiles: Loaded
[ 0.347281] NET: Registered protocol family 2
[ 0.348724] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.348882] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.349015] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.349155] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.349223] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.349569] NET: Registered protocol family 1
[ 0.350381] RPC: Registered named UNIX socket transport module.
[ 0.350459] RPC: Registered udp transport module.
[ 0.350499] RPC: Registered tcp transport module.
[ 0.350535] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.351692] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[ 0.354361] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 0.375139] FS-Cache: Netfs 'nfs' registered for caching
[ 0.376991] NFS: Registering the id_resolver key type
[ 0.377103] Key type id_resolver registered
[ 0.377147] Key type id_legacy registered
[ 0.381651] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.382121] io scheduler noop registered
[ 0.382187] io scheduler deadline registered (default)
[ 0.382704] io scheduler cfq registered
[ 0.388705] BCM2708FB: allocated DMA memory 5b500000
[ 0.388838] BCM2708FB: allocated DMA channel 0 @ dc80d000
[ 0.397157] Console: switching to colour frame buffer device 82x26
[ 0.407638] bcm2835-rng 20104000.rng: hwrng registered
[ 0.410455] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[ 0.416898] vc-sm: Videocore shared memory driver
[ 0.444485] brd: module loaded
[ 0.459783] loop: module loaded
[ 0.462548] Loading iSCSI transport class v2.0-870.
[ 0.466243] usbcore: registered new interface driver smsc95xx
[ 0.468982] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 0.699891] Core Release: 2.80a
[ 0.702553] Setting default values for core params
[ 0.705259] Finished setting default values for core params
[ 0.908372] Using Buffer DMA mode
[ 0.910980] Periodic Transfer Interrupt Enhancement - disabled
[ 0.913625] Multiprocessor Interrupt Enhancement - disabled
[ 0.916274] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 0.918951] Dedicated Tx FIFOs mode
[ 0.922160] WARN::dwc_otg_hcd_init:1032: FIQ DMA bounce buffers: virt = 0xdb514000 dma = 0x5b514000 len=9024
[ 0.927798] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[ 0.940981] dwc_otg: Microframe scheduler enabled
[ 0.941119] WARN::hcd_init_fiq:459: FIQ on core 0 at 0xc0451694
[ 0.943752] WARN::hcd_init_fiq:460: FIQ ASM at 0xc0451970 length 36
[ 0.946378] WARN::hcd_init_fiq:486: MPHI regs_base at 0xdc8a5000
[ 0.949164] dwc_otg 20980000.usb: DWC OTG Controller
[ 0.951874] dwc_otg 20980000.usb: new USB bus registered, assigned bus number 1
[ 0.954736] dwc_otg 20980000.usb: irq 56, io mem 0x00000000
[ 0.957420] Init: Port Power? op_state=1
[ 0.959963] Init: Power Port (0)
[ 0.962882] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.965566] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.968186] usb usb1: Product: DWC OTG Controller
[ 0.970753] usb usb1: Manufacturer: Linux 4.9.59+ dwc_otg_hcd
[ 0.973390] usb usb1: SerialNumber: 20980000.usb
[ 0.977139] hub 1-0:1.0: USB hub found
[ 0.979751] hub 1-0:1.0: 1 port detected
[ 0.983163] dwc_otg: FIQ enabled
[ 0.983173] dwc_otg: NAK holdoff enabled
[ 0.983179] dwc_otg: FIQ split-transaction FSM enabled
[ 0.983200] Module dwc_common_port init
[ 0.983719] usbcore: registered new interface driver usb-storage
[ 0.986697] mousedev: PS/2 mouse device common for all mice
[ 0.990874] bcm2835-wdt 20100000.watchdog: Broadcom BCM2835 watchdog timer
[ 0.994145] bcm2835-cpufreq: min=700000 max=700000
[ 0.997415] sdhci: Secure Digital Host Controller Interface driver
[ 1.000101] sdhci: Copyright(c) Pierre Ossman
[ 1.003245] sdhost-bcm2835 20202000.sdhost: could not get clk, deferring probe
[ 1.006368] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.009674] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.012592] hidraw: raw HID events driver (C) Jiri Kosina
[ 1.015863] usbcore: registered new interface driver usbhid
[ 1.018667] usbhid: USB HID core driver
[ 1.022609] vchiq: vchiq_init_state: slot_zero = 0xdb580000, is_master = 0
[ 1.027470] [vc_sm_connected_init]: start
[ 1.037831] [vc_sm_connected_init]: end - returning 0
[ 1.041275] Initializing XFRM netlink socket
[ 1.044152] NET: Registered protocol family 17
[ 1.047015] Key type dns_resolver registered
[ 1.051467] registered taskstats version 1
[ 1.061573] uart-pl011 20201000.serial: cts_event_workaround enabled
[ 1.064808] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 1.899177] console [ttyAMA0] enabled
[ 1.908241] sdhost: log_buf @ db513000 (5b513000)
[ 1.992822] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 2.001282] of_cfs_init
[ 2.026813] of_cfs_init: OK
[ 2.033231] Waiting for root device PARTUUID=bff42074-02...
[ 2.043465] random: fast init done
[ 2.223726] mmc0: new high speed MMC card at address 0001
[ 2.233055] mmcblk0: mmc0:0001 4FEACB 3.64 GiB
[ 2.240733] mmcblk0boot0: mmc0:0001 4FEACB partition 1 4.00 MiB
[ 2.249980] mmcblk0boot1: mmc0:0001 4FEACB partition 2 4.00 MiB
[ 2.259113] mmcblk0rpmb: mmc0:0001 4FEACB partition 3 512 KiB
[ 2.269397] mmcblk0: p1 p2
[ 2.404148] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 2.417682] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 2.435694] devtmpfs: mounted
[ 2.442821] Freeing unused kernel memory: 396K
[ 2.449976] This architecture does not have kernel memory protection.
[ 2.923344] systemd[1]: System time before build time, advancing clock.
[ 3.058755] NET: Registered protocol family 10
[ 3.087089] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 3.134572] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[ 3.162433] systemd[1]: Detected architecture arm.
[ 3.182655] systemd[1]: Set hostname to <raspberrypi>.
[ 3.523509] uart-pl011 20201000.serial: no DMA platform data
[ 4.177387] systemd[1]: Listening on udev Control Socket.
[ 4.191305] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 4.206684] systemd[1]: Listening on Journal Socket.
[ 4.219231] systemd[1]: Reached target Swap.
[ 4.231098] systemd[1]: Listening on Syslog Socket.
[ 4.245000] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[ 4.265346] systemd[1]: Listening on fsck to fsckd communication Socket.
[ 16.415493] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 16.790231] systemd-journald[101]: Received request to flush runtime journal from PID 1
[ 18.582685] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[ 24.171979] Adding 102396k swap on /var/swap. Priority:-1 extents:1 across:102396k SSFS
[ 24.523838] enc28j60 spi1.0: enc28j60 Ethernet driver 1.02 loaded
[ 24.542097] net eth0: enc28j60 driver registered

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 11:46 am

If you have had the enc28j60 on SPI0 then you may not need it, but I think you might.

The dmesg output shows the driver being loaded and registering, so I'm surprised it didn't show up in the lsmod output. Have you changed something else?

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 11:52 am

PhilE wrote:
Wed Oct 17, 2018 11:46 am
If you have had the enc28j60 on SPI0 then you may not need it, but I think you might.

The dmesg output shows the driver being loaded and registering, so I'm surprised it didn't show up in the lsmod output. Have you changed something else?
I will try to connect the INT pin, but i think the problem is not there. I will give it a try

I followed your steps:

1. Create dts file an compile it for spi1
2. edit config.txt and add the lines:
dtoverlay=enc28j60-spi1
dtoverlay=spi1-1cs,cs0_spidev=off
3.Rebbot system

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 11:55 am

Have you had the enc28j60 working on SPI0, or did you just mean the SPI0 is working for something else?

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 12:03 pm

PhilE wrote:
Wed Oct 17, 2018 11:55 am
Have you had the enc28j60 working on SPI0, or did you just mean the SPI0 is working for something else?
Yeah SPI0 is working for something else

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 1:26 pm

PhilE wrote:
Wed Oct 17, 2018 11:55 am
Have you had the enc28j60 working on SPI0, or did you just mean the SPI0 is working for something else?
Tried on SPI0 with the INT pin and no success...

Code: Select all

[email protected]:~$ dmesg | grep spi
[   15.053446] enc28j60 spi0.0: enc28j60 Ethernet driver 1.02 loaded

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 1:31 pm

Then I am out of ideas for now - sorry.

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 2:26 pm

PhilE wrote:
Wed Oct 17, 2018 1:31 pm
Then I am out of ideas for now - sorry.
The dmesg | grep -e spi0.0 -ie eth output seems correct:

net eth0: enc28j60 driver registered

I believe the problem can be the file /network/interfaces

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1879
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 2:33 pm

You shouldn't need to change anything else in Raspbian.

rego21
Posts: 26
Joined: Fri Feb 16, 2018 4:09 pm

Re: ENC28J60 on SPI1

Wed Oct 17, 2018 3:45 pm

PhilE wrote:
Wed Oct 17, 2018 2:33 pm
You shouldn't need to change anything else in Raspbian.
Now ifconfig show me the eth0 however doesnt assign an inet addr to it

Return to “Compute Module”