All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Marc Kleine-Budde <mkl@pengutronix.de>,
	Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Kazuhiro Takagi <kazuhiro.takagi.hh@hitachi-solutions.com>,
	Duy Nguyen <duy.nguyen.rh@renesas.com>,
	linux-can@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH v2 00/10] can: rcar_canfd: Add support for Transceiver Delay Compensation
Date: Wed, 11 Jun 2025 17:37:29 +0200	[thread overview]
Message-ID: <cover.1749655315.git.geert+renesas@glider.be> (raw)

	Hi all,

This patch series adds CAN-FD Transceiver Delay Compensation support to
the R-Car CAN-FD driver, after the customary cleanups and refactorings.

Changes compared to v1:
  - Dropped patch "can: rcar_canfd: Use ndev parameter in
    rcar_canfd_set_bittiming()",
  - New patch "[PATCH v2 02/10] can: rcar_canfd: Remove bittiming debug
    prints",
  - New patch "[PATCH v2 07/10] can: rcar_canfd: Rename
    rcar_canfd_setrnc() to rcar_canfd_set_rnc()",
  - Add Reviewed-by,
  - Replace function-like RCANFD_F_*() macros by rcar_canfd_f_*()
    inline functions,
  - Replace function-like macro RCANFD_FDSTS_TDCR() by bitmask
    RCANFD_FDSTS_TDCR and helper function rcar_canfd_get_tdcr(),
  - Replace function-like macro RCANFD_FDSTS_TDCVF() by two bit
    definitions,
  - Drop debug print of tdc mode and tdco value.

This has been tested on R-Car V4H (White Hawk), V4M (Gray Hawk Single),
and E3 (Ebisu-4D[2]), using various data bit rates.  Without proper TDC
configuration, transmitting at 8 Mbps makes the CAN-FD controller enter
BUS-OFF state.  The TDCV value as measured by the CAN-FD controller is 4
on all boards tested (base clock 40 MHz, i.e. 25 ns period), and ca. 90
ns as measured by a logic analyzer on Gray Hawk Single.

Note that the BSP (predating upstream TDC support), uses a much simpler
method: for transfer rates >= 5 Mbps on R-Car Gen4, it enables TDC with
a hardcoded (hardware) TDCO value of 2 (i.e. actual 3), which matches
the behavior of this series at 8 Mbps.

Thanks for your comments!

[1] "[PATCH 0/9] can: rcar_canfd: Add support for Transceiver Delay Compensation"
    https://lore.kernel.org/cover.1748863848.git.geert+renesas@glider.be

[2] r8a77990.dtsi configures the CANFD core clock to 40 MHz, limiting
    transfer rates to 4 Mbps.  Enable support for 8 Mbps by adding to
    ebisu.dtsi:

	&canfd {
		assigned-clock-rates = <80000000>;
	}

    I plan to send patches to update this on all R-Car Gen3 and RZ/G2
    SoCs once this series has reached upstream.

Geert Uytterhoeven (10):
  can: rcar_canfd: Consistently use ndev for net_device pointers
  can: rcar_canfd: Remove bittiming debug prints
  can: rcar_canfd: Add helper variable ndev to rcar_canfd_rx_pkt()
  can: rcar_canfd: Add helper variable dev to
    rcar_canfd_reset_controller()
  can: rcar_canfd: Simplify data access in rcar_canfd_{ge,pu}t_data()
  can: rcar_canfd: Repurpose f_dcfg base for other registers
  can: rcar_canfd: Rename rcar_canfd_setrnc() to rcar_canfd_set_rnc()
  can: rcar_canfd: Share config code in rcar_canfd_set_bittiming()
  can: rcar_canfd: Return early in rcar_canfd_set_bittiming() when not
    FD
  can: rcar_canfd: Add support for Transceiver Delay Compensation

 drivers/net/can/rcar/rcar_canfd.c | 228 ++++++++++++++++++++----------
 1 file changed, 156 insertions(+), 72 deletions(-)

-- 
2.43.0

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

             reply	other threads:[~2025-06-11 15:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 15:37 Geert Uytterhoeven [this message]
2025-06-11 15:37 ` [PATCH v2 01/10] can: rcar_canfd: Consistently use ndev for net_device pointers Geert Uytterhoeven
2025-06-11 15:37 ` [PATCH v2 02/10] can: rcar_canfd: Remove bittiming debug prints Geert Uytterhoeven
2025-06-12  4:02   ` Vincent Mailhol
2025-06-11 15:37 ` [PATCH v2 03/10] can: rcar_canfd: Add helper variable ndev to rcar_canfd_rx_pkt() Geert Uytterhoeven
2025-06-11 15:37 ` [PATCH v2 04/10] can: rcar_canfd: Add helper variable dev to rcar_canfd_reset_controller() Geert Uytterhoeven
2025-06-11 15:37 ` [PATCH v2 05/10] can: rcar_canfd: Simplify data access in rcar_canfd_{ge,pu}t_data() Geert Uytterhoeven
2025-06-11 15:37 ` [PATCH v2 06/10] can: rcar_canfd: Repurpose f_dcfg base for other registers Geert Uytterhoeven
2025-06-12  4:00   ` Vincent Mailhol
2025-06-12 11:33     ` Geert Uytterhoeven
2025-06-12 12:31       ` Vincent Mailhol
2025-06-11 15:37 ` [PATCH v2 07/10] can: rcar_canfd: Rename rcar_canfd_setrnc() to rcar_canfd_set_rnc() Geert Uytterhoeven
2025-06-12  4:04   ` Vincent Mailhol
2025-06-11 15:37 ` [PATCH v2 08/10] can: rcar_canfd: Share config code in rcar_canfd_set_bittiming() Geert Uytterhoeven
2025-06-11 15:37 ` [PATCH v2 09/10] can: rcar_canfd: Return early in rcar_canfd_set_bittiming() when not FD Geert Uytterhoeven
2025-06-11 15:37 ` [PATCH v2 10/10] can: rcar_canfd: Add support for Transceiver Delay Compensation Geert Uytterhoeven
2025-06-13  7:40 ` [PATCH v2 00/10] " Marc Kleine-Budde
2025-06-13 12:20   ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1749655315.git.geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=duy.nguyen.rh@renesas.com \
    --cc=kazuhiro.takagi.hh@hitachi-solutions.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=mkl@pengutronix.de \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.