Re: CAN bit time limitation in Flexcan driver

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

 



On 5/5/19 7:18 AM, Joakim Zhang wrote:
> Flexcan driver shows:
> 
> static const struct can_bittiming_const flexcan_bittiming_const = {
>         .name = DRV_NAME,
>         .tseg1_min = 4,
>         .tseg1_max = 16,
>         .tseg2_min = 2,
>         .tseg2_max = 8,
>         .sjw_max = 4,
>         .brp_min = 1,
>         .brp_max = 256,
>         .brp_inc = 1,
> };
> 
> Could you explain briefly why the minimum of TSEG1(Prop_Seg +
> Phase_Seg1) in flexcan driver is 4 ?
> 
> From IMX6DQ RM:

It's set to 4 due to the same or similar picture in the datasheets of:

- mx25
- mx28
- mx35
- mx53
- mx6 (Document Number: IMX6DQRM, Rev. 5, 06/2018,
       Document Number: IMX6SDLRM, Rev. 4, 07/2018)
- vf610

> I have checked with IC guys that the explanation and figure**in IMX6DQ
> RM is *incorrect*. It has been updated like this:

ok - is this datasheet available somewhere?
Is the fix also true for all above mentioned SoCs?

> •Time Segment 1: This segment includes the propagation segment and the
> phase segment 1 of the CAN standard. It
> 
> can be programmed by setting CTRL1[PROPSEG] and CTRL1[PSEG1] so that
> their sum (plus 2) is in the range of 2 to
> 
> 16 time quanta.
> 
> Time Segment 2: This segment represents the phase segment 2 of the CAN
> standard. It can be programmed by setting
> 
> CTRL1[PSEG2] (plus 1) to be 2 to 8 time quanta long.
> 
> And the minimum value can be written into PROPSEG and PSEG1 field in
> CTRL1 register is 0.
> 
> To my understanding, the minimum value of TSEG1 should be 2. Right?

Seems so. Feel free to send a patch mentioning the documentation flaw in
the datasheet.

> Another question is that CAN driver doesn’t ensure the total number of
> time quanta in a bit time programabled at least from 8 to 25 via CAN
> bittiming calculation(CAN_CALC_BITTIMING).

Where does this 8 to 25 limitation come from?

> This should check by user, right?

No, if there is a limitation, we should update the bit rate timing
calculation algorithm to take care of this.

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