RE: [PATCH 0/4] net: can: flexcan: can FD Format (FDF) changes

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

 



Hi Pankaj Bansal,

I noticed the issue which you mentioned in "[PATCH 3/4] can: flexcan: modify the interrupt register handling", I also reported and Marc has
fixed it in linux-can-next.

And I noticed the range of a bit time may not correct:
+static const struct can_bittiming_const extended_flexcan_bittiming_const = {
+	.name = DRV_NAME,
+	.tseg1_min = 2,
+	.tseg1_max = *96*,
+	.tseg2_min = 2,
+	.tseg2_max = 32,
+	.sjw_max = 16,
+	.brp_min = 1,
+	.brp_max = 1024,
+	.brp_inc = 1,
+};
+
+static const struct can_bittiming_const flexcan_data_bittiming_const = {
+	.name = DRV_NAME,
+	.tseg1_min = 2,
+	.tseg1_max = *39*,
+	.tseg2_min = 2,
+	.tseg2_max = 8,
+	.sjw_max = 4,
+	.brp_min = 1,
+	.brp_max = 1024,
+	.brp_inc = 1,
+};

I do not know how many bits of PROPSEG and PSEG1 are LX2160A realized. 
But in i.MX8QM/QXP:
CBT register: EPROPSEG(6 bit), EPSEG(5 bit) but is can't reach 96
FDCBT register: FPROPSEG(5 bit), EPSEG(3 bit) but is can't reach 39

You can check the code in /drivers/net/can/dev.c for the reason:
Can_cal_bittiming:
|     211         bt->prop_seg = tseg1 / 2;
|     212         bt->phase_seg1 = tseg1 - bt->prop_seg;
|     213         bt->phase_seg2 = tseg2;

Now I am also upstreaming the CAN FD feature for i.MX8, I will send out the V3.
The way is not the same, shall we discuss which is better? This may speed up the process.

Best Regards,
Joakim Zhang

> -----Original Message-----
> From: linux-can-owner@xxxxxxxxxxxxxxx <linux-can-owner@xxxxxxxxxxxxxxx>
> On Behalf Of Pankaj Bansal
> Sent: 2019年5月10日 13:34
> To: Wolfgang Grandegger <wg@xxxxxxxxxxxxxx>; Marc Kleine-Budde
> <mkl@xxxxxxxxxxxxxx>
> Cc: linux-can@xxxxxxxxxxxxxxx; Varun Sethi <V.Sethi@xxxxxxx>
> Subject: RE: [PATCH 0/4] net: can: flexcan: can FD Format (FDF) changes
> 
> Hi Marc et. Al,
> 
> These changes are pending from a long time and the regular changes to flexcan
> code make it very hard to maintain these changes. I request you to please
> review these changes and merge. I will promply reply to any queries you have.
> 
> Regards,
> Pankaj Bansal
> 
> > -----Original Message-----
> > From: Pankaj Bansal
> > Sent: Friday, 10 May, 2019 10:58 AM
> > To: Wolfgang Grandegger <wg@xxxxxxxxxxxxxx>; Marc Kleine-Budde
> > <mkl@xxxxxxxxxxxxxx>
> > Cc: linux-can@xxxxxxxxxxxxxxx; Pankaj Bansal <pankaj.bansal@xxxxxxx>;
> > Varun Sethi <V.Sethi@xxxxxxx>
> > Subject: [PATCH 0/4] net: can: flexcan: can FD Format (FDF) changes
> >
> > This is my second attempt to add FD support in flexcan. my earlier
> > patches can be referred here:
> >
> > [1]
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> >
> spinics.net%2Flists%2Flinux-can%2Fmsg00348.html&amp;data=02%7C01%7C
> qia
> >
> ngqing.zhang%40nxp.com%7C041eb587964148921bbc08d6d509245f%7C68
> 6ea1d3bc
> >
> 2b4c6fa92cd99c5c301635%7C0%7C0%7C636930632570755870&amp;sdata=
> 0DY3hiWb
> > VgXMfZwW%2B0gbAfkSXvIFvtOyaka33E1uEbs%3D&amp;reserved=0
> >
> > Some of the patches from above series have already been merged.
> >
> > There has been a significant change in flexcan code since i sent above
> > patches
> > namely:
> >
> > commit cbffaf7aa09e ("can: flexcan: Always use last mailbox for TX")
> >
> > with this patch, the flexcan FD supports breaks (if one were to apply
> > the above
> > patches[1])
> >
> > To fix FD supprt with above patch, i have added changes in this series:
> >
> > 3/4: can: flexcan: modify the interrupt register handling
> >
> > The rest of the patches are from old patch series.
> >
> > Cc: Varun Sethi <V.Sethi@xxxxxxx>
> >
> > Pankaj Bansal (4):
> >   net: can: flexcan: use CAN FD frames for Tx/Rx
> >   can: flexcan: move can set bititings after module control
> >   can: flexcan: modify the interrupt register handling
> >   net: can: flexcan: can FD Format (FDF) changes
> >
> >  drivers/net/can/flexcan.c      | 316 ++++++++++++++++++++++++++-------
> >  drivers/net/can/rx-offload.c   |  32 +++-
> >  include/linux/can/rx-offload.h |   6 +-
> >  3 files changed, 276 insertions(+), 78 deletions(-)
> >
> > --
> > 2.17.1





[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