I have followed this example: [mcp2515-can0-overlay.dts][1] and goted this file:
Code: Select all
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
/* disable spi-dev for spi0.0 */
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <&spidev0>;
__overlay__ {
status = "disabled";
};
};
/* the interrupt pin of the usb-controller */
fragment@2 {
target = <&gpio>;
__overlay__ {
usb0_pins: usb0_pins {
brcm,pins = <25>;
brcm,function = <0>; /* input */
};
};
};
/* the clock/oscillator of the usb-controller */
fragment@3 {
target-path = "/clocks";
__overlay__ {
/* external oscillator of max3421 on SPI0.0 */
usb0_osc: usb0_osc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <25000000>;
};
};
};
/* the spi config of the usb-controller itself binding everything together */
fragment@4 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
usb@0 {
compatible = "maxim,max3421";
reg = <0>;
maxim,vbus-en-pin = <3 1>;
spi-max-frequency = <25000000>;
interrupt-parent = <&gpio>;
interrupts = <25 8>;
clocks = <&usb0_osc>;
};
};
};
__overrides__ {
oscillator = <&usb0_osc>,"clock-frequency:0";
spimaxfrequency = <&usb0>,"spi-max-frequency:0";
interrupt = <&usb0_pins>,"brcm,pins:0",<&usb0>,"interrupts:0";
};
};
I'm using this setup to try make MAX3421E work:
- Raspberry Pi 3
- Raspbian GNU/Linux 9
- Kernel Linux raspberrypi 4.15.17-v7+
- With MAX3421-HCB compile as module
- spi0-max3421e.dtbo inside /boot/overlay
- Line dtoverlay=spi0-max3421e in /boot/config.txt
- Printout of command raspi-gpio get 25,8,10,9,11
GPIO 8: level=1 fsel=4 alt=0 func=SPI0_CE0_N
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 25: level=1 fsel=0 func=INPUT
- Sparkfun SPI USB Arduino Shield
D7 (RESET) - connected to 5Vdc
D8 (GPX) - not connected
D9 (INT) - connected to BCM25 (Pin 22)
D10 (SS) - connected to BCM8 (Pin 24)
D11 (MOSI) - connected to BCM10 (Pin 19)
D12 (MISO) - connected to BCM9 (Pin 21)
D13 (SCK) - connected to BCM11 (Pin 23)
VIN - connected to Raspberry Pi Pin 2
On boot the module max3421-hcb do not is load automatically, I believe that it should be, because of dtoverlay=spi0-max3421e
Even with sudo modeprobe max3421-hcb, printout of lsmod:
`root@raspberrypi:~# lsmod`
`Module Size Used by`
`max3421_hcd 20480 0`
`spidev 16384 0`
I get 0 messages inside syslog or dmesg
When I was using the version 4.14 of the kernel I alter the file max3421-hcb.c to be like the one in 4.15 kernel! Now I'm using a full 4.15.y kernel, but no result either.
Best Regards
[1]:
https://github.com/raspberrypi/linux/bl ... verlay.dts "mcp2515-can0-overlay.dts"