Linux-Can Archive mirror
 help / color / mirror / Atom feed
From: petter@ka-long.de
To: linux-can@vger.kernel.org, mkl@pengutronix.de
Subject: mcp251xfd on NXP LX2160A
Date: Mon, 20 Nov 2023 17:11:06 +0100 (CET)	[thread overview]
Message-ID: <20231120161106.AA49E5B00817@dd15738.kasserver.com> (raw)

Hi Folks,

Some time ago I have asked for help for mcp251xfd driver with an IMX7D, so I am somehow familar with the system.
The next iteration is with a NXP LX 2160A ... new hardware platform ... new kernel (6.1.1) ... new problems ;)

What is working : Driver is successfully initialised.
❯ sudo modprobe mcp251xfd
[ 4493.557075] mcp251xfd spi1.2 can2: MCP2518FD rev0.0 (-RX_INT -PLL -MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD o:40.00MHz c:40.00MHz m:8.00MHz rs:8.00MHz es:0.00MHz rf:8.00MHz ef:0.00MHz) successfully initialized.

If I use a "wrong" interrupt for testing purposes (interrupt wont get it to the driver code), I am able to send one CAN Message from SPI CAN to LX2160A internal CAN (cangen/candump). Then the driver stuck.
This is more or less expected.

Enable the interrupt on the right pin (IRQ_LEVEL_LOW) does make some trouble. Driver is successfully initialised. If I bring up the interface (ip link set canx type can bitrate 500000 ; ip link set canx up)
I will get contineous errors:

.
.
. 
[  508.352616] mcp251xfd spi1.2 can2: CRC write error detected. CRC=0x6844.
[  508.362081] mcp251xfd spi1.2 can2: CRC write command format error.
[  508.368956] mcp251xfd spi1.2 can2: CRC write command format error.
[  508.375242] mcp251xfd spi1.2 can2: CRC write command format error.
[  508.381531] mcp251xfd spi1.2 can2: CRC write command format error.
[  508.387822] mcp251xfd spi1.2 can2: CRC write command format error.
[  508.394117] mcp251xfd spi1.2 can2: CRC write command format error.
[  508.400402] mcp251xfd spi1.2 can2: CRC write command format error.
[  508.406700] mcp251xfd spi1.2 can2: CRC write error detected. CRC=0x537f.
.
.
.

Since driver successfully initializes, no CRC read errors and sending a frame is working I assume SPI itself is okay.
/proc/interrupt shows only one additonal interrupt during a down / up cycle. This indicates that the interrupt is never cleared via SPI.
Since the error is a command error assuming the command is the one clearing the interrupt, that makes sense.
What can be the reason for the command format error ? Any ideas how to investigate further ?

BR
Niels



             reply	other threads:[~2023-11-20 16:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 16:11 petter [this message]
2023-11-23  7:08 ` mcp251xfd on NXP LX2160A Thomas.Kopp
2023-11-25 17:14   ` 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=20231120161106.AA49E5B00817@dd15738.kasserver.com \
    --to=petter@ka-long.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).