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]

 



> -----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)
> >>>
> >>> 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.

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) 
0080 MB0
0090 MB1
00A0 MB2
00B0 MB3
00C0 MB4
00D0 MB5
....
....

Address offset (hex) (16 byte payload) 
0080 MB0
0098 MB1
00B0 MB2
00C8 MB3
00E0 MB4
00F8 MB5
....
....

Address offset (hex) (32 byte payload) 
0080 MB0
00A8 MB1
00D0 MB2
00F8 MB3
0120 MB4
0148 MB5
....
....

Address offset (hex) (64 byte payload) 
0080 MB0
00C8 MB1
0110 MB2
0158 MB3
01A0 MB4
01E8 MB5
....
....

> 
> 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   |

��.n��������+%������w��{.n�����{����*jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[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