-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENC28J60 module doesn't work on SPI2 interface for compute module #1735
Comments
Yes, you will need a new overlay for that. Are you up for having go yourself? I'm happy to guide you through it, but start by copying the existing one and changing all spi0 references to say spi2. Then you will probably need to merge in some of the spi2 overlay, but you can omit all references to spidev2 - those that add it and those that disable it. |
@pelwell That would be great and thanks for the help. Do you have the ENC28J60.dts file for SPI0 by any chance? I could not find it in my /boot/ directory or online |
The source is in the kernel tree, here. |
@pelwell I am assuming I need to include |
Yes you do, but add ",cs0_spidev=no" to prevent the spidev nicre from being enabled. |
Sorry, that should say node - Swype error. |
@pelwell OK so I modified the original .dts file and changed all the reference to spi2, all the interrupt pin from 25 to 39. I also added what you told me to spi2-1cs. It's still not working and when I run Any idea of what's causing the issue here? |
I'm going to have to continue this in the morning, but can you post the output from raspi-gpio? Sometimes those deferring probe messages are just a transient hiccup in the dependencies that gets resolved when another driver is loaded. |
@pelwell sure no rush. Appreciate your help
|
One more: |
@pelwell for reference, I named the new overlay file as "enc28j60-spi2" |
Using a fresh kernel and a hacked enc28j60-spi2 overlay it gets as far as probing the enc28j60 and not finding it - not surprising since I don't have one. My overlay has only two differences to the original - <&spi0> is now <&spi2>, and I deleted fragment 1 that disabled spidev0, renaming the following fragment to be the new fragment 1. I wonder if you are having problems because your kernel and DTBs are too old - what does To save time you can upload your overlay and config.txt and I can try with them. By the way, what is your reason for using the mmc overlay? Once you have updated to a current kernel it should no longer be necessary - I found the reason for the unreliability using the sdhost driver with eMMC, and now it is solid (and quicker). |
@pelwell I am not sure why we are using mmc overlay since I didn't configure that, so are you suggesting I could comment that line out if I update to a current kernal? my config.txt:
and my enc28j60-spi2.dts (I included your change plus changed the int pin):
Also, when i compiled the .dts to .dtbo, I got this warning not sure if it's something wrong:
|
I think it's working now. After deleting the old fragment 1 and changed the old 2 to 1, the Ethernet module starts working now. Thanks a lot With regards to the mmc overlay that you mentioned earlier, how do I change that? @pelwell |
Cool - good job. The warnings are currently a fact of life - the overlay syntax doesn't obey some of the newer rules the DT compiler is trying to enforce. Overlay support in dtc is currently going through the upstreaming process, so I'm hoping that will change. The sdhost driver was made standard for CM back in kernel 4.4.19, but that is newer than the one you have (which doesn't look like an RPF build). You can either run rpi-update to get a new firmware and kernel - there are no known problems with the current version - or you can go back to the supplier of your kernel and see what they have. |
ok cool I will do that, btw is there a need for a PR for this spi2 overlay file? |
It's unfortunate that we are accumulating an n by m matrix of SPI devices and their buses, but there isn't an alternative at the moment. Feel free to create a PR. |
Actually there is an alternative, but it's ugly: see https://github.com/raspberrypi/linux/blob/rpi-4.4.y/arch/arm/boot/dts/overlays/mcp23s17-overlay.dts |
@pelwell do you happen to know if there is an existing .dts file for decawave DWM1000 module on SPI0? |
All the overlays are listed in /boot/overlays/README. |
kernel: Revert HID: dragonrise: fix HID Descriptor for 0x0006 PID See: raspberrypi/linux#1755 kernel: BCM270X_DT: Add i2c-sensor overlay See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=167207 kernel: lirc_rpi: Delete vestigial gpio_in_pull parameter See: raspberrypi/linux#1711 kernel: BCM270X_DT: Add overlay for enc28j60 on SPI2 See: raspberrypi/linux#1735 kernel: bcm2835-rng: Avoid initialising if already enabled bootcode: Enable the RNG as early as possible firmware: rng: Avoid initialising if already enabled powerman: Force a PVT calibration if aphy/dphy settings don't seem correct See: #684
kernel: Revert HID: dragonrise: fix HID Descriptor for 0x0006 PID See: raspberrypi/linux#1755 kernel: BCM270X_DT: Add i2c-sensor overlay See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=167207 kernel: lirc_rpi: Delete vestigial gpio_in_pull parameter See: raspberrypi/linux#1711 kernel: BCM270X_DT: Add overlay for enc28j60 on SPI2 See: raspberrypi/linux#1735 kernel: bcm2835-rng: Avoid initialising if already enabled bootcode: Enable the RNG as early as possible firmware: rng: Avoid initialising if already enabled powerman: Force a PVT calibration if aphy/dphy settings don't seem correct See: raspberrypi/firmware#684
kernel: Revert HID: dragonrise: fix HID Descriptor for 0x0006 PID See: raspberrypi/linux#1755 kernel: BCM270X_DT: Add i2c-sensor overlay See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=167207 kernel: lirc_rpi: Delete vestigial gpio_in_pull parameter See: raspberrypi/linux#1711 kernel: BCM270X_DT: Add overlay for enc28j60 on SPI2 See: raspberrypi/linux#1735 kernel: bcm2835-rng: Avoid initialising if already enabled bootcode: Enable the RNG as early as possible firmware: rng: Avoid initialising if already enabled powerman: Force a PVT calibration if aphy/dphy settings don't seem correct See: raspberrypi#684
I am testing to see if ENC28J60(Ethernet module) works on SPI2 interface, and I am having some issues. Basically the wire connections will be:
INT - GPIO39
MISO - GPIO40
MOSI - GPIO41
SCLK - GPIO42
CE - GPIO43
I have it working with Pi zero, and SPI0 on compute module, but didn't work on SPI2 for compute module. It is always trying to access SPI0 during the bootup and therefore it wouldn't pick up the ethernet. The current enc28j60 overlay file is for SPI0 apparently, and I am wondering if I need to create my own overlay .dts file specifically tailored to SPI2, or does it already exist? If not, are there any alternatives or shortcut that allows me to access SPI2 right away instead of creating a new dts file(for example one line of change in /boot/config.txt)?
This is the boot time message and you can tell it's accessing SPI0 although I already connected my module to SPI2
Any help and insights will be appreciated
The text was updated successfully, but these errors were encountered: