Re: ram initialization on mcp2518fd

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

 



On 20.06.2022 09:09:09, Rasmus Villemoes wrote:
> >> NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!
> > 
> > Update to a newer kernel. In v5.15 this problem is fixed.
> 
> Oh, great, thanks. I'll try to give 5.15 a quick spin, we're mostly on
> 5.10 because this project started when that was the latest LTS.

We usually start with the latest and greatest kernel when starting a new
project, keep updating and settle for the newest LTS as late as
possible. You don't have anything from LTS if you don't update :) But
that's a different story...

> >> when I start the traffic test. And the dev_id reading still doesn't
> >> work (though it's not really used for anything other than an
> >> informative printk).
> > 
> > What does it read on your board? But still that transfer should work.
> 
> Depending on whether the miso pin has been configured with a weak
> internal pull-up or pull-down, it reads either 0xff or 0x00 - and
> that's also the case when I expand the read to all six e00 through e14
> registers. So the chip isn't really driving miso, and I think that's
> because CS is released between the two elements of the xfer array.

Can you do a measurement of that MCP251XFD_REG_DEVID transfer?

For testing I read the OSC register instead of the DEVID and print the
value:

diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 537335d42d1d..79de59f9c145 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -1796,13 +1796,14 @@ mcp251xfd_register_get_dev_id(const struct mcp251xfd_priv *priv, u32 *dev_id,
        xfer[1].len = sizeof(dev_id);
        xfer[1].speed_hz = priv->spi_max_speed_hz_fast;
 
-       mcp251xfd_spi_cmd_read_nocrc(&buf_tx->cmd, MCP251XFD_REG_DEVID);
+       mcp251xfd_spi_cmd_read_nocrc(&buf_tx->cmd, MCP251XFD_REG_OSC);
 
        err = spi_sync_transfer(priv->spi, xfer, ARRAY_SIZE(xfer));
        if (err)
                goto out_kfree_buf_tx;
 
        *dev_id = be32_to_cpup((__be32 *)buf_rx->data);
+       pr_info("%s: reg_osc=0x%08x\n", __func__, *dev_id);
        *effective_speed_hz_slow = xfer[0].effective_speed_hz;
        *effective_speed_hz_fast = xfer[1].effective_speed_hz;

And it gives me:

| [  171.051636] mcp251xfd_register_get_dev_id: reg_osc=0x68040000

I just noticed the register contents isn't big endian, it's little
endian. I'll send a patch. (The address information is big endian, and
mcp251xfd_spi_cmd_read_nocrc is taking care of this.)

> >> But I'll have to get our hardware guys to help me do some soldering to
> >> capture all four channels at once to see just exactly what is going on
> >> there.
> > 
> > Have a look at these: https://sensepeek.com/pcbite_20
> 
> Yup, they're excellent :) My desk: https://ibb.co/LRdtt7Q . However I
> can't really manage to get more than two probes directly on the mcp2518fd.

Nice, you already have them! With some balancing I usually get all 4
signals connected, until someone touched my desk :)

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 |

Attachment: signature.asc
Description: PGP signature


[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