lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 77/98] can: m_can: fix nominal bitiming tseg2 min for version >= 3.1
    Date
    From: Marc Kleine-Budde <mkl@pengutronix.de>

    [ Upstream commit e3409e4192535fbcc86a84b7a65d9351f46039ec ]

    At lest the revision 3.3.0 of the bosch m_can IP core specifies that valid
    register values for "Nominal Time segment after sample point (NTSEG2)" are from
    1 to 127. As the hardware uses a value of one more than the programmed value,
    mean tseg2_min is 2.

    This patch fixes the tseg2_min value accordingly.

    Cc: Dan Murphy <dmurphy@ti.com>
    Cc: Mario Huettel <mario.huettel@gmx.net>
    Acked-by: Sriram Dash <sriram.dash@samsung.com>
    Link: https://lore.kernel.org/r/20201124190751.3972238-1-mkl@pengutronix.de
    Fixes: b03cfc5bb0e1 ("can: m_can: Enable M_CAN version dependent initialization")
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/can/m_can/m_can.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
    index eafdb4441d441..f9a2a9ecbac9e 100644
    --- a/drivers/net/can/m_can/m_can.c
    +++ b/drivers/net/can/m_can/m_can.c
    @@ -990,7 +990,7 @@ static const struct can_bittiming_const m_can_bittiming_const_31X = {
    .name = KBUILD_MODNAME,
    .tseg1_min = 2, /* Time segment 1 = prop_seg + phase_seg1 */
    .tseg1_max = 256,
    - .tseg2_min = 1, /* Time segment 2 = phase_seg2 */
    + .tseg2_min = 2, /* Time segment 2 = phase_seg2 */
    .tseg2_max = 128,
    .sjw_max = 128,
    .brp_min = 1,
    --
    2.27.0


    \
     
     \ /
      Last update: 2020-12-01 10:40    [W:3.677 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site