Re: [PATCH 4/6] net: can: flexcan: Add provision for variable payload size

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

 



On 07/31/2018 08:23 AM, Pankaj Bansal wrote:
>> -----Original Message-----
>> From: Marc Kleine-Budde [mailto:mkl@xxxxxxxxxxxxxx]
>> Sent: Monday, July 30, 2018 8:51 PM
>> To: Pankaj Bansal <pankaj.bansal@xxxxxxx>; linux-can@xxxxxxxxxxxxxxx
>> Subject: Re: [PATCH 4/6] net: can: flexcan: Add provision for variable
>> payload size
>>
>> On 07/30/2018 05:03 PM, Pankaj Bansal wrote:
>>>>> Till now the flexcan module supported 8 byte payload size as per CAN
>>>>> 2.0 specifications.
>>>>> But now upcoming flexcan module in NXP LX2160A SOC supports CAN
>> FD
>>>>> protocol too.The Message buffers need to be configured to have
>>>>> payload size greater than 8 bytes (if flexcan module supports it)

BTW: please update the "FLEXCAN hardware feature flags" table in the
driver, add a CAN-FD column, too.

>>>>> Therefore, added provision in the driver for payload size to be variable.
>>>>> BUT, limit the only possible payload value to be 8, because the CAN
>>>>> FD changes are not in place yet.
>>>>
>>>> What's the size of a CAN-FD mailbox? Is it fixed or configurable at
>> runtime?
>>>
>>> Flexible mailboxes configurable to store 0 to 8, 16, 32 or 64 bytes
>>> data length
>>
>> Does it make any sense to store less than 64 bytes of data? What's the total
>> size of the mailbox then?
> 
> IMO this makes sense in one scenario: if all the nodes in can network
> transmit data with < 64 bytes payload (say 32 bytes), then it would
> be beneficial to limit the payload size to 32 bytes, as this would
> increase number of RX buffers, which would help in reception speed.

I don't think this will make a big impact in reception speed, but
relaxes the timing constraints instead.

> The total size of mailbox is Payload + 8 bytes (4 bytes for CAN ID
> and 4 bytes for CAN control bits; same as CAN 2.0 MB)

> The mailbox are allocated in memory as below:
> Address offset (hex) (8 byte payload) 
> Address offset (hex) (16 byte payload) 
> Address offset (hex) (32 byte payload) 
> Address offset (hex) (64 byte payload) 

This does look quite complex and could result in ugly code. First thing
is to have a function that converts from mailbox number to mailbox address.

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: signature.asc
Description: OpenPGP digital 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