linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dong Aisheng <b29396@freescale.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Subject: Re: M_CAN message RAM initialization AppNote  - was: Re: [PATCH V3 3/3] can: m_can: workaround for transmit data less than 4 bytes
Date: Fri, 7 Nov 2014 16:15:09 +0800	[thread overview]
Message-ID: <20141107081448.GA8037@shlinux1.ap.freescale.net> (raw)
In-Reply-To: <545BA039.7080108@hartkopp.net>

On Thu, Nov 06, 2014 at 05:22:17PM +0100, Oliver Hartkopp wrote:
> Hello all, (reduced the CC list a bit)
> 
> thankfully Mr. Hartwich from Bosch followed the mail threads I forwarded to
> him. It turns out that there's only ONE message RAM containing TX Buffers, RX
> Buffers and all the acceptance filter elements.
> 
> Due to our discussion the next M_CAN user manual will contain the attached
> application note (see marked lines in attached PDF).
> 
> Mr Hartwich wrote:
> 
> ---8<--- snip!
> 
> The RAM initialization issue is not limited to Tx Buffers, all RAM words need
> an initialization before they are read. If e.g. the CPU reads an uninitialized
> Rx Buffer before the M_CAN has stored a message into the buffer, that may
> trigger a RAM access error.
> 
> There is only one single Message RAM attached to the M_CAN,  which buffers
> are found where is configured via the registers SIDFC.FLSSA, XIDFC.FLESA,
> RXF0C.F0SA, RXF1C.F1SA, TXBC.TBSA, TXEFC.EFSA. The size of the area needed
> e.g. for the Tx Buffers depends on the number of Buffers and on the size of
> the buffers. Larger buffers are needed for the longer FD frames.
> 
> The M_CAN does not check whether the RAM areas overlap, so this check needs to
> be done in software. It is also possible that several M_CANs share one single
> RAM, so the overlap-check needs to consider also that case.
> 
> RAMs usually do not have a hardware-reset, so the RAM-cells, including the
> parity/ECC-bits (if exist) may be at invalid values. Any write to a RAM word
> will set the parity/ECC-bits to valid values. Therefore the entire RAM should
> be initialized by software after power-on, e.g. (simplistic):
> 
> for (i=RAM_start; i<=RAM_end; i++) RAM[i] = 0x00000000;
> 
> The size of the RAM may differ in different M_CAN implementations, the
> RAM is not part of the M_CAN IP module. There may be RAMs with parity,
> with ECC, or without protection. There may even be RAMs with hardware-reset.
> 
> ---8<--- snip!
> 
> So the recommendation is to initialize the entire message RAM (see PDF).
> 

Thanks for this information.
By the description i agree that it's reasonable and more safe to initialize
the entire message RAM.

Regards
Dong Aisheng

> Regards,
> Oliver
> 



  parent reply	other threads:[~2014-11-07  8:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 13:16 [PATCH V3 1/3] can: add can_is_canfd_skb() API Dong Aisheng
2014-11-05 13:16 ` [PATCH V3 2/3] can: m_can: update to support CAN FD features Dong Aisheng
2014-11-05 14:31   ` Marc Kleine-Budde
2014-11-05 14:42     ` Oliver Hartkopp
2014-11-05 13:16 ` [PATCH V3 3/3] can: m_can: workaround for transmit data less than 4 bytes Dong Aisheng
2014-11-05 14:29   ` Marc Kleine-Budde
2014-11-05 18:15     ` M_CAN message RAM initialization AppNote - was: " Oliver Hartkopp
2014-11-06  1:57       ` Dong Aisheng
2014-11-06  7:04         ` Oliver Hartkopp
2014-11-06  8:09           ` Dong Aisheng
2014-11-06 12:33             ` Oliver Hartkopp
2014-11-06 12:47               ` Marc Kleine-Budde
     [not found]                 ` <545BA039.7080108@hartkopp.net>
2014-11-07  8:15                   ` Dong Aisheng [this message]
2015-02-05 19:04                   ` new M_CAN IP rev 3.2.x documentation available - was: Re: M_CAN message RAM initialization AppNote Oliver Hartkopp
2014-11-07  8:40                 ` M_CAN message RAM initialization AppNote - was: Re: [PATCH V3 3/3] can: m_can: workaround for transmit data less than 4 bytes Dong Aisheng
2014-11-07  8:34               ` Dong Aisheng
2014-11-06  9:00           ` Marc Kleine-Budde
2014-11-05 16:22 ` [PATCH V3 1/3] can: add can_is_canfd_skb() API Eric Dumazet
2014-11-05 17:33   ` Oliver Hartkopp
2014-11-06  1:52     ` Dong Aisheng

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=20141107081448.GA8037@shlinux1.ap.freescale.net \
    --to=b29396@freescale.com \
    --cc=linux-can@vger.kernel.org \
    --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 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 NNTP newsgroup(s).