From: Marc Kleine-Budde <mkl@pengutronix.de>
To: David Jander <david@protonic.nl>
Cc: wg@grandegger.com, linux-can@vger.kernel.org
Subject: Re: [PATCH 1/3] can: flexcan.c: Correctly initialize mailboxes
Date: Tue, 02 Sep 2014 16:53:15 +0200 [thread overview]
Message-ID: <5405D9DB.7050101@pengutronix.de> (raw)
In-Reply-To: <5405AC3D.5040508@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]
On 09/02/2014 01:38 PM, Marc Kleine-Budde wrote:
>> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
>> index 3f21142..f028c5d 100644
>> --- a/drivers/net/can/flexcan.c
>> +++ b/drivers/net/can/flexcan.c
>> @@ -62,7 +62,7 @@
>> #define FLEXCAN_MCR_BCC BIT(16)
>> #define FLEXCAN_MCR_LPRIO_EN BIT(13)
>> #define FLEXCAN_MCR_AEN BIT(12)
>> -#define FLEXCAN_MCR_MAXMB(x) ((x) & 0xf)
>> +#define FLEXCAN_MCR_MAXMB(x) ((x) & 0x1f)
>> #define FLEXCAN_MCR_IDAM_A (0 << 8)
>> #define FLEXCAN_MCR_IDAM_B (1 << 8)
>> #define FLEXCAN_MCR_IDAM_C (2 << 8)
>> @@ -735,9 +735,11 @@ static int flexcan_chip_start(struct net_device *dev)
>> *
>> */
>> reg_mcr = flexcan_read(®s->mcr);
>> + reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff);
>> reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT |
>> FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
>> - FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS;
>> + FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS |
>> + FLEXCAN_MCR_MAXMB(FLEXCAN_TX_BUF_ID);
>> netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr);
>> flexcan_write(reg_mcr, ®s->mcr);
>>
>> Eh! This looks wrong! The MAXMB field is 7 bits wide according to the
>> reference manual (bits 0-6)... but the reset default value is supposed to be
>
> ...according to the imx6 reference manual. The size of the MAXMB field
> depends on the actual IP version.
On mcf5213 (some old coldfire, not supported by this driver)
it's 4 bit wide.
On mx25, mx28, mx53 it's 6 bits wide.
On mx6{q,sdl}, vf610 it's 7 bits wide.
I'm not sure about the powerpc based cores as I don't have the data sheets.
I cannot find a data sheet, where it has a width of 5 bit.
I'll prepare a patch to fix it.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2014-09-02 14:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 9:58 [PATCH 0/3] Decrease likelyhood of RX overruns David Jander
2014-08-27 9:58 ` [PATCH 1/3] can: flexcan.c: Correctly initialize mailboxes David Jander
2014-09-02 10:24 ` Marc Kleine-Budde
2014-09-02 10:37 ` David Jander
2014-09-02 10:59 ` Marc Kleine-Budde
2014-09-02 11:15 ` David Jander
2014-09-02 13:54 ` Marc Kleine-Budde
2014-09-02 14:27 ` David Jander
2014-09-02 11:32 ` David Jander
2014-09-02 11:38 ` Marc Kleine-Budde
2014-09-02 14:53 ` Marc Kleine-Budde [this message]
2014-08-27 9:58 ` [PATCH 2/3] can: flexcan.c: Re-write receive path to use MB queue instead of FIFO David Jander
2014-09-02 11:30 ` Marc Kleine-Budde
2014-09-02 12:04 ` David Jander
2014-09-02 14:53 ` Marc Kleine-Budde
2014-09-03 7:19 ` David Jander
2014-09-03 9:12 ` Marc Kleine-Budde
2014-09-03 15:42 ` David Jander
2014-08-27 9:58 ` [PATCH 3/3] can: flexcan.c: Implement last step of workaround for errata ERR005829 David Jander
2014-09-02 11:28 ` Marc Kleine-Budde
2014-09-02 11:36 ` David Jander
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=5405D9DB.7050101@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=david@protonic.nl \
--cc=linux-can@vger.kernel.org \
--cc=wg@grandegger.com \
/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.