Re: mcp251xfd on RPi 5.4 downstream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you the feedback.

I think it may be any issue with spi interface and/or chip select config.

[    6.812079] DEBUG mcp251xfd mcp251xfd_probe(): ENTER
[    6.812174] mcp251xfd spi0.0: DEBUG mcp251xfd mcp251xfd_probe():
devm_clk_get()
[    6.812208] mcp251xfd spi0.0: DEBUG mcp251xfd mcp251xfd_probe():
feq=0x2625a00
[    6.850106] mcp251xfd spi0.0 (unnamed net_device) (uninitialized):
Failed to detect MCP251xFD (osc=0x00000000).

This proves that the driver is getting the 40 MHz from the device tree
properties.  The board does have a 40 MHz osc.

It is the Waveshare CANFD Hat [1].  They have their own tarball for
download [2] with a mcp25xxfd driver that is copyright 2019 by Martin
Sperl <kernel@xxxxxxxxxxxxxxxx>.  I'm looking at that to see why it
works and the newer, proper driver does not.

Thanks,
Drew

[1] https://www.waveshare.com/wiki/2-CH_CAN_FD_HAT
[2] https://www.waveshare.com/wiki/File:2-CH-CAN-FD-HAT-Demo.7z


On Mon, Oct 26, 2020 at 12:00 PM Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote:
>
> On 10/26/20 5:51 PM, Patrick Menschel wrote:
> >> On 10/26/20 3:50 AM, Drew Fustini wrote:
> >>> I'm seeing this message which makes me think my issue is that I am not
> >>> setting the oscillator as a dtoverlay param.
> >>>
> >>> [    6.873081] CAN device driver interface
> >>> [    6.879904] DEBUG mcp251xfd mcp251xfd_probe(): ENTER
> >>> [    6.880068] spi_master spi0: will run message pump with realtime priority
> >>> [    6.921312] mcp251xfd spi0.0 (unnamed net_device) (uninitialized):
> >>> Failed to detect MCP251xFD (osc=0x00000000).
>                                     ^^^^^^^^^^
>
> Contents of OSC register.
>
> >>> [pi4]
> >>> dtoverlay=mcp251xfd-spi0-0
> >>
> >> Are you using CS0 of spi0?
> >> What's the frequency of your OSC?
> >
> > mcp251xfd_osc_invalid(osc) is true according to the string.
> >
> > https://github.com/marckleinebudde/linux/blob/v5.4-rpi/mcp251xfd-20201022-54/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c#L552
>
> ACK
>
> The OSC register would never contain 0x0. So when reading 0x0 (or 0xff) you have
> not read anything. This is what the "invalid" test does.
>
> This could have several reasons, e.g. mcp2518fd is not on SPI0 CS0, or the OSC
> is 20 MHz, but the DT specifies an OSC of 40 MHz.
>
> Marc
>
> --
> Pengutronix e.K.                 | Marc Kleine-Budde           |
> Embedded Linux                   | https://www.pengutronix.de  |
> Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
>



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux