linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
	Stefano Babic <sbabic@denx.de>,
	linux-can@vger.kernel.org
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	Wolfgang Grandegger <wg@grandegger.com>
Subject: Re: [PATCH v5 1/2] Add documentation for SPI to CAN driver
Date: Thu, 30 Oct 2014 17:21:24 +0100	[thread overview]
Message-ID: <54526584.3060300@denx.de> (raw)
In-Reply-To: <54514F2C.10108@hartkopp.net>

Hi Oliver,

On 29/10/2014 21:33, Oliver Hartkopp wrote:
> Hi Stefano,
> 
> sorry that I did not find some time to review your driver again :-(

Do not worry, I understand ;-)

> 
> I found some small issues:
> 
> On 28.07.2014 18:38, Stefano Babic wrote:
>> Signed-off-by: Stefano Babic <sbabic@denx.de>
> 
> 
>> +The CFG_MSG_GET is sent at the start up to query the CAN controller
>> about its
>> +internal timing, making them available to the netlink interface. CAN
>> drivers
>> +have usually fest values for can_bittiming_const.
> 
> fest -> fixed

ooppps...wrong language, I fix it !

> 
>> In case of a remote
>> +CAN controller driven via SPI, the Main Controller cannot know the
>> timing
>> +and must ask them to the CAN controller before instantiating a CAN
>> device.
>> +For this reason, the message is sent only once in the probe() entry
>> point.
>> +
>> +The REQ_DATA is sent only by the Main Controller when the Main
>> Controller
>> +signals it has packets to be transfered, but the Main Controller has
>> nothing
>> +to sent.
> 
> ?? Didn't understand this - really ;-)

Well, I read the phrase again and I confess I cannot understand it
myself :-D

I try to rephrase it:

The REQ_DATA is a replacement for the SEND_DATA message. It is sent by
the Main Controller when the Slave Controller has signalled in a
previous frame that it has packets to be transfered, but the Main
Controller has nothing to sent.


> 
> 
>> +8.6 Format of Get Configuration Message
>> +----------------------------------------
>> +
>> +Format of the frame sent by Main Controller:
>> +  _____,________
>> + |     |        ,'''''''''|'''''''''|
>> + |ID=6 | LEN=3  | channel |CHECKSUM |
>> + |_____L________|_________|_________|
>> +
>> +Answer from CAN Controller:
>> +  _____,________
>> + |     |        ,''''''''''''''''''''|''''''''''|'''''''''|'''''''''|..
>> + |ID=6 | LEN=25 | channel |tseg1_min |tseg2_max |tseg2_min|        
>> |CHECKSUM
>> + |_____L________|_________|__________|__________|_________|_________..
>> +
>> +    Offset
>> +    0    0x06 (CFG_MSG_GET)
>> +    1-2    25
>> +    3    channel number
>> +        0xFF = CFG
>> +        0..n = CAN controller CAN channel
>> +    5    tseg1_min
>> +    6    tseg1_max
>> +    7    tseg2_min
>> +    8    tseg2_max
>> +    9    sjw_max
>> +    10-13    brp_min
>> +    14-17    brp_max
>> +    18-21    brp_inc
>> +    22    ctrlmode
> 
> Why is ctrlmode not 32 bit?
> 
>> +    23-27    clock
>> +    28-29    Checksum
> 

I admit this is a limitation on the Slave Controller. I was asked to not
send a configuration frame bigger as 32 bytes, and I have tried to save
space in some ways. Indeed, only some bits in the ctrlmode are used.

Anyway, I was unsure if I can reduce the size for the brp_* fields.
Using 32bit for brp_min looks like excessive, and I could drop its size
instead of ctrlmode. Do you think I can use 8bit values for all brp_*
fields ?

> Some more stuff in the other patch.

I check it, thanks for review !

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

  reply	other threads:[~2014-10-30 16:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 16:38 [PATCH v5 0/2] Adding support for CAN busses via SPI interface Stefano Babic
2014-07-28 16:38 ` [PATCH v5 1/2] Add documentation for SPI to CAN driver Stefano Babic
2014-10-29 20:33   ` Oliver Hartkopp
2014-10-30 16:21     ` Stefano Babic [this message]
2014-10-30 20:41       ` Oliver Hartkopp
2014-11-05 12:19   ` Marc Kleine-Budde
2014-11-06 13:48     ` Stefano Babic
2014-07-28 16:38 ` [PATCH v5 2/2] CAN: CAN driver to support multiple CAN bus on SPI interface Stefano Babic
2014-10-29 20:57   ` Oliver Hartkopp
2014-10-31 10:57     ` Stefano Babic
2014-10-31 18:23       ` Oliver Hartkopp
2014-11-05 13:15   ` Marc Kleine-Budde
2014-11-06 16:13     ` Stefano Babic
2014-08-07  8:06 ` [PATCH v5 0/2] Adding support for CAN busses via " Stefano Babic
2014-09-16 13:01   ` Stefano Babic
2014-10-21 12:25 ` Stefano Babic

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=54526584.3060300@denx.de \
    --to=sbabic@denx.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    --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 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).