All of lore.kernel.org
 help / color / mirror / Atom feed
From: Drew Fustini <drew@beagleboard.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Patrick Menschel <menschel.p@posteo.de>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	linux-can@vger.kernel.org, Josh S <josh@macchina.cc>
Subject: Re: mcp251xfd on RPi 5.4 downstream
Date: Tue, 27 Oct 2020 22:47:40 -0500	[thread overview]
Message-ID: <CAPgEAj4W61tCSkdrCP2J4dL7WwQ1NKzFCUGjY9o4_qj+NG5KEA@mail.gmail.com> (raw)
In-Reply-To: <CAPgEAj5JheUirqr2kLrjJpwCaK3+HZyo8r8uKk25zMREVXWT3Q@mail.gmail.com>

On Tue, Oct 27, 2020 at 8:57 PM Drew Fustini <drew@beagleboard.org> wrote:
>
> On Tue, Oct 27, 2020 at 1:23 PM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> >
> > On 10/27/20 7:18 PM, Patrick Menschel wrote:
> > >
> > >>> It is different but I'm having trouble understanding why it works and
> > >>> the new overlay for the newer driver does not.
> > >>
> > >> Have you actually tested the waveshare driver and overlay with your setup?
> > >>
> > >> If you have a scope or logic analyser attach it to SPI bus (MISO, MOSI, Clock,
> > >> Chipselect and the IRQ Line of the Chip) and check what's going on there.
> > >>
> > >> Marc
> > >>
> > >
> > > Is the target path for clocks correct?
> > >
> > > I mean "/clocks"
> >
> > It doesn't matter where you put them...
> >
> > > https://gist.github.com/pdp7/784d0ba8b9648d20ab055747ec945225#file-2xmcp2517fd-overlay-dts-L49
> > >
> > > instead of "/"
> > >
> > > https://github.com/marckleinebudde/linux/blob/v5.4-rpi/mcp251xfd-20201022-54/arch/arm/boot/dts/overlays/mcp251xfd-spi0-0-overlay.dts#L38
> >
> > The mcp251xfd node references them via the label ("<&can_osc>"):
> >
> > https://github.com/marckleinebudde/linux/blob/v5.4-rpi/mcp251xfd-20201022-54/arch/arm/boot/dts/overlays/mcp251xfd-spi0-0-overlay.dts#L61
> >
> > The driver will bail out even earlier if no clock is found:
> >
> > https://github.com/marckleinebudde/linux/blob/v5.4-rpi/mcp251xfd-20201022-54/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c#L2764
> >
> > regards
> > 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 |
> >
>
> Thank you for the suggestions.  I've not been as multi-tasking as I
> hoped during ELC-E :)
>
> I assumed the Waveshare instructions work but that is error on my part
> for not actually reproducing.  That is what I will do first.
> Ultimately, I want the freshly upstreamed driver working but I should
> check if their driver tarball works.
>
> thanks,
> drew

The Waveshare installer uses the 4.19 kernel with the mcp25xxfd
driver.  However, it also fails, sio I think I need to dig deeper:

pi@raspberrypi:~ $ dmesg | grep -Ei spi\|can
[    4.263765] CAN device driver interface
[    4.286258] mcp25xxfd_can: loading out-of-tree module taints kernel.
[    5.477511] mcp25xxfd spi1.0: Cannot initialize MCP2517. Wrong
wiring? (oscilator register reads as 00000000)
[    5.477530] mcp25xxfd spi1.0: Probe failed, err=19
[    5.490325] mcp25xxfd spi0.0: Cannot initialize MCP2517. Wrong
wiring? (oscilator register reads as 00000000)
[    5.490352] mcp25xxfd spi0.0: Probe failed, err=19
[    5.490459] spi-bcm2835 fe204000.spi: chipselect 0 already in use
[    5.490479] spi_master spi0: spi_device register error
/soc/spi@7e204000/mcp251xfd@0
[    5.490497] spi_master spi0: Failed to create SPI device for
/soc/spi@7e204000/mcp251xfd@0

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019
armv7l GNU/Linux
pi@raspberrypi:~ $ modinfo
/lib/modules/4.19.75-v7l+/kernel/drivers/net/can/spi/mcp25xxfd-can.ko
filename:
/lib/modules/4.19.75-v7l+/kernel/drivers/net/can/spi/mcp25xxfd-can.ko
license:        GPL v2
description:    Microchip 25XXFD CAN driver
author:         Martin Sperl <kernel@martin.sperl.org>
srcversion:     EE1DD0B30B5F99540B43858
alias:          of:N*T*Cmicrochip,mcp2517fdC*
alias:          of:N*T*Cmicrochip,mcp2517fd
alias:          spi:mcp2517fd
depends:        can-dev
name:           mcp25xxfd_can
vermagic:       4.19.75-v7l+ SMP mod_unload modversions ARMv7 p2v8
parm:           rx_prefetch_bytes:number of bytes to blindly prefetch
when reading a rx-fifo (uint)
parm:           reschedule_int_thread_after:Reschedule the interrupt
thread after this many loops
 (uint)
parm:           tx_fifos:Number of tx-fifos to configure
 (uint)
parm:           three_shot:Use 3 shots when one-shot is requested (bool)
parm:           bw_sharing_log2bits:Delay between 2 transmissions in
number of arbitration bit times
 (uint)
parm:           enable_edge_filter:Enable ISO11898-1:2015 edge_filtering (bool)
parm:           tdc_mode:Transmitter Delay Mode - 0 = disabled, 1 =
fixed, 2 = auto
 (uint)
parm:           tdc_value:Transmission Delay Value - range: [0:63] SCLK (uint)
parm:           tdc_offset:Transmission Delay offset - range: [-64:63]
SCLK (int)


thanks,
drew

  reply	other threads:[~2020-10-28 23:06 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22  3:10 mcp251xfd on RPi 5.4 downstream Drew Fustini
2020-10-22  6:00 ` Drew Fustini
2020-10-22  6:33   ` Marc Kleine-Budde
2020-10-22 18:42     ` Drew Fustini
2020-10-25  4:30       ` Drew Fustini
2020-10-25  8:49         ` Oliver Hartkopp
2020-10-25 10:58           ` Marc Kleine-Budde
2020-10-25 17:43             ` Patrick Menschel
2020-10-25 18:14               ` Marc Kleine-Budde
2020-10-25 18:42                 ` Patrick Menschel
2020-10-26  1:59                   ` Drew Fustini
2020-10-26  2:50                     ` Drew Fustini
2020-10-26  5:16                       ` Patrick Menschel
2020-10-26  7:45                         ` Marc Kleine-Budde
2020-10-26  9:40                       ` Marc Kleine-Budde
2020-10-26 16:51                         ` Patrick Menschel
2020-10-26 17:00                           ` Marc Kleine-Budde
2020-10-27  2:22                             ` Drew Fustini
2020-10-27  6:35                               ` Drew Fustini
2020-10-27  7:06                                 ` Marc Kleine-Budde
2020-10-27 18:18                                   ` Patrick Menschel
2020-10-27 18:22                                     ` Marc Kleine-Budde
2020-10-28  1:57                                       ` Drew Fustini
2020-10-28  3:47                                         ` Drew Fustini [this message]
2020-10-28  7:57                                           ` Marc Kleine-Budde
2020-10-31 12:27                                             ` Drew Fustini
2020-10-31 15:14                                               ` Patrick Menschel
2020-10-31 15:35                                                 ` Patrick Menschel
2020-10-31 21:57                                                   ` Drew Fustini
2020-11-01 22:49                                                     ` Drew Fustini
2020-11-02  7:25                                                       ` Marc Kleine-Budde
2020-11-02  8:18                                                     ` Marc Kleine-Budde
     [not found]                                                       ` <CAPgEAj7LcX3cb+syhtR1i3Uo1XkYYFQ_wDPV8GniaA-YwPk2Hg@mail.gmail.com>
2020-11-02 11:00                                                         ` Marc Kleine-Budde
     [not found]                                                           ` <CAPgEAj7BTJyiBg4QkKuekYH0zyrA-10dby3Lgb5qj2uiD4ZOYQ@mail.gmail.com>
2020-11-02 14:22                                                             ` mcp251xfd: loopback test on waveshare canfd hat Marc Kleine-Budde
2020-11-02 14:35                                                               ` Drew Fustini
2020-11-02 14:38                                                                 ` Marc Kleine-Budde
2020-11-02 17:34                                                           ` mcp251xfd on RPi 5.4 downstream Patrick Menschel
2020-11-02 18:47                                                             ` Patrick Menschel
2020-11-02 18:57                                                               ` Thomas.Kopp
2020-11-02 19:32                                                                 ` Patrick Menschel
2020-11-04 18:48                                                                   ` Patrick Menschel
2020-11-05  7:15                                                                     ` Marc Kleine-Budde
2020-11-05 18:11                                                                       ` Patrick Menschel
2020-11-06  9:00                                                                         ` Marc Kleine-Budde
2020-11-06 11:31                                                                           ` Patrick Menschel
2020-11-06 11:36                                                                             ` Marc Kleine-Budde
2020-11-06 11:46                                                                               ` Patrick Menschel
2020-11-05  8:08                                                                 ` Marc Kleine-Budde
2020-11-05  8:07                                                               ` Marc Kleine-Budde
2020-11-02  7:55                                                 ` Marc Kleine-Budde
2020-11-02  7:26                                               ` Marc Kleine-Budde
2020-10-26  7:43                     ` Marc Kleine-Budde
2020-11-20 12:32 ` Marc Kleine-Budde
     [not found]   ` <CAEf4M_B68X2T0rkaq0tqahBFPc+Gbvac7-+G0j5jd-g4j+j01g@mail.gmail.com>
2020-11-20 13:16     ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPgEAj4W61tCSkdrCP2J4dL7WwQ1NKzFCUGjY9o4_qj+NG5KEA@mail.gmail.com \
    --to=drew@beagleboard.org \
    --cc=josh@macchina.cc \
    --cc=linux-can@vger.kernel.org \
    --cc=menschel.p@posteo.de \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.