mbox series

[can-next,v5,00/20] can: rockchip_canfd: add support for CAN-FD IP core found on Rockchip RK3568

Message ID 20240904-rockchip-canfd-v5-0-8ae22bcb27cc@pengutronix.de (mailing list archive)
Headers show
Series can: rockchip_canfd: add support for CAN-FD IP core found on Rockchip RK3568 | expand

Message

Marc Kleine-Budde Sept. 4, 2024, 8:12 a.m. UTC
This series adds support for the CAN-FD IP core found on the Rockchip
RK3568.

The IP core is a bit complicated and has several documented errata.
The driver is added in several stages, first the base driver including
the RX-path. Then several workarounds for errata and the TX-path, and
finally features like hardware time stamping, loop-back mode and
bus error reporting.

regards,
Marc

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes in v5:
- MAINTAINERS: fix dt-bindings filename (also noted by kernel test robot <lkp@intel.com>)
- dt-bindings: added Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
- Link to v4: https://patch.msgid.link/20240903-rockchip-canfd-v4-0-1dc3f3f32856@pengutronix.de

Changes in v4:
- dt-bindings: renamed to rockchip,rk3568v2-canfd.yaml to match the
  first compatible
- dt-bindings: fix "$id" in yaml (thanks Rob's bot)
- all: add Tested-by: Alibek Omarov <a1ba.omarov@gmail.com>
- Link to v3: https://patch.msgid.link/20240830-rockchip-canfd-v3-0-d426266453fa@pengutronix.de

Changes in v3:
- dt-bindings: renamed file to rockchip,rk3568-canfd.yaml (thanks Rob)
- dt-bindings: reworked compatibles (thanks Rob)
- Link to v2: https://lore.kernel.org/all/20240731-rockchip-canfd-v2-0-d9604c5b4be8@pengutronix.de

Changes in v2:
- dt-bindings: remove redundant words from subject and patch
  description (thanks Rob)
- dt-bindings: clean up clock- and reset-names (thanks Rob)
- base driver: add missing bitfield.h header
- base driver: rkcanfd_handle_rx_int_one(): initialize header to avoid
  uninitialzied variable warning on m68k
- base driver: rkcanfd_get_berr_counter_raw(): don't add assigned only
  variable (bec_raw), move to 14/20 (thanks Simon)
- CAN-FD frame equal check + TX-path: squash, to avoid unused
  functions (thanks Simon)
- TX-path: rkcanfd_handle_tx_done_one(): don't add assigned only
  variable (skb), move to 18/20 (thanks Simon)
- HW-timetamping: add missing timecounter.h header (thanks Simon)
- Link to v1: https://lore.kernel.org/all/20240729-rockchip-canfd-v1-0-fa1250fd6be3@pengutronix.de

---
David Jander (2):
      arm64: dts: rockchip: add CAN-FD controller nodes to rk3568
      arm64: dts: rockchip: mecsbc: add CAN0 and CAN1 interfaces

Marc Kleine-Budde (18):
      dt-bindings: can: rockchip_canfd: add rockchip CAN-FD controller
      can: rockchip_canfd: add driver for Rockchip CAN-FD controller
      can: rockchip_canfd: add quirks for errata workarounds
      can: rockchip_canfd: add quirk for broken CAN-FD support
      can: rockchip_canfd: add support for rk3568v3
      can: rockchip_canfd: add notes about known issues
      can: rockchip_canfd: rkcanfd_handle_rx_int_one(): implement workaround for erratum 5: check for empty FIFO
      can: rockchip_canfd: rkcanfd_register_done(): add warning for erratum 5
      can: rockchip_canfd: add TX PATH
      can: rockchip_canfd: implement workaround for erratum 6
      can: rockchip_canfd: implement workaround for erratum 12
      can: rockchip_canfd: rkcanfd_get_berr_counter_corrected(): work around broken {RX,TX}ERRORCNT register
      can: rockchip_canfd: add stats support for errata workarounds
      can: rockchip_canfd: prepare to use full TX-FIFO depth
      can: rockchip_canfd: enable full TX-FIFO depth of 2
      can: rockchip_canfd: add hardware timestamping support
      can: rockchip_canfd: add support for CAN_CTRLMODE_LOOPBACK
      can: rockchip_canfd: add support for CAN_CTRLMODE_BERR_REPORTING

 .../bindings/net/can/rockchip,rk3568v2-canfd.yaml  |  74 ++
 MAINTAINERS                                        |   8 +
 arch/arm64/boot/dts/rockchip/rk3568-mecsbc.dts     |  14 +
 arch/arm64/boot/dts/rockchip/rk3568.dtsi           |  39 +
 drivers/net/can/Kconfig                            |   1 +
 drivers/net/can/Makefile                           |   1 +
 drivers/net/can/rockchip/Kconfig                   |   9 +
 drivers/net/can/rockchip/Makefile                  |  10 +
 drivers/net/can/rockchip/rockchip_canfd-core.c     | 969 +++++++++++++++++++++
 drivers/net/can/rockchip/rockchip_canfd-ethtool.c  |  73 ++
 drivers/net/can/rockchip/rockchip_canfd-rx.c       | 299 +++++++
 .../net/can/rockchip/rockchip_canfd-timestamp.c    | 105 +++
 drivers/net/can/rockchip/rockchip_canfd-tx.c       | 167 ++++
 drivers/net/can/rockchip/rockchip_canfd.h          | 553 ++++++++++++
 14 files changed, 2322 insertions(+)
---
base-commit: 3d4d0fa4fc32f03f615bbf0ac384de06ce0005f5
change-id: 20240729-rockchip-canfd-4233c71f0cc6

Best regards,

Comments

Heiko Stübner Sept. 4, 2024, 8:55 a.m. UTC | #1
Hi Marc,

Am Mittwoch, 4. September 2024, 10:12:44 CEST schrieb Marc Kleine-Budde:
> This series adds support for the CAN-FD IP core found on the Rockchip
> RK3568.
> 
> The IP core is a bit complicated and has several documented errata.
> The driver is added in several stages, first the base driver including
> the RX-path. Then several workarounds for errata and the TX-path, and
> finally features like hardware time stamping, loop-back mode and
> bus error reporting.
> 
> regards,
> Marc
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

I have neither CAN knowledge, nor hardware to test, but the integration
itself looks pretty easy and straight-forward.

Not sure how much it helps, but at this moment I assume you know what
you're doing with respect to the CAN controller ;-)

Rest of the series (that hasn't got a Rb):

Acked-by: Heiko Stuebner <heiko@sntech.de>


How/when are you planning on applying stuff?

I.e. if you're going to apply things still for 6.12, you could simply take
the whole series if the dts patches still apply to your tree ;-)


Heiko
Marc Kleine-Budde Sept. 4, 2024, 9:19 a.m. UTC | #2
On 04.09.2024 10:55:21, Heiko Stübner wrote:
> Hi Marc,
> 
> Am Mittwoch, 4. September 2024, 10:12:44 CEST schrieb Marc Kleine-Budde:
> > This series adds support for the CAN-FD IP core found on the Rockchip
> > RK3568.
> > 
> > The IP core is a bit complicated and has several documented errata.
> > The driver is added in several stages, first the base driver including
> > the RX-path. Then several workarounds for errata and the TX-path, and
> > finally features like hardware time stamping, loop-back mode and
> > bus error reporting.
> > 
> > regards,
> > Marc
> > 
> > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> I have neither CAN knowledge, nor hardware to test, but the integration
> itself looks pretty easy and straight-forward.
> 
> Not sure how much it helps, but at this moment I assume you know what
> you're doing with respect to the CAN controller ;-)

I hope so :) The controller has some flaws :/

> Rest of the series (that hasn't got a Rb):
> 
> Acked-by: Heiko Stuebner <heiko@sntech.de>

Thanks.

> How/when are you planning on applying stuff?
> 
> I.e. if you're going to apply things still for 6.12, you could simply take
> the whole series if the dts patches still apply to your tree ;-)

Actually I've already started my PR workflow, but I'll address your
review feedback, add your tags and send a new PR today. This will go via
net-next into v6.12.

regards,
Marc
Marc Kleine-Budde Sept. 4, 2024, 3:10 p.m. UTC | #3
On 04.09.2024 10:55:21, Heiko Stübner wrote:
[...]
> How/when are you planning on applying stuff?
> 
> I.e. if you're going to apply things still for 6.12, you could simply take
> the whole series if the dts patches still apply to your tree ;-)

The DTS changes should not go via any driver subsystem upstream, so
here's a dedicated PR:

https://patch.msgid.link/20240904-rk3568-canfd-v1-0-73bda5fb4e03@pengutronix.de

regards,
Marc
Heiko Stübner Sept. 4, 2024, 4:43 p.m. UTC | #4
Am Mittwoch, 4. September 2024, 17:10:08 CEST schrieb Marc Kleine-Budde:
> On 04.09.2024 10:55:21, Heiko Stübner wrote:
> [...]
> > How/when are you planning on applying stuff?
> > 
> > I.e. if you're going to apply things still for 6.12, you could simply take
> > the whole series if the dts patches still apply to your tree ;-)
> 
> The DTS changes should not go via any driver subsystem upstream, so
> here's a dedicated PR:
> 
> https://patch.msgid.link/20240904-rk3568-canfd-v1-0-73bda5fb4e03@pengutronix.de

I wasn't on Cc for the pull-request so I'll probably not get a notification
when it gets merged?

So if you see your PR with the binding and driver getting merged to
next-next, can you provide a ping please?

Thanks a lot
Heiko
Marc Kleine-Budde Sept. 5, 2024, 6:19 a.m. UTC | #5
On 04.09.2024 18:43:52, Heiko Stübner wrote:
> Am Mittwoch, 4. September 2024, 17:10:08 CEST schrieb Marc Kleine-Budde:
> > On 04.09.2024 10:55:21, Heiko Stübner wrote:
> > [...]
> > > How/when are you planning on applying stuff?
> > > 
> > > I.e. if you're going to apply things still for 6.12, you could simply take
> > > the whole series if the dts patches still apply to your tree ;-)
> > 
> > The DTS changes should not go via any driver subsystem upstream, so
> > here's a dedicated PR:
> > 
> > https://patch.msgid.link/20240904-rk3568-canfd-v1-0-73bda5fb4e03@pengutronix.de
> 
> I wasn't on Cc for the pull-request so I'll probably not get a notification
> when it gets merged?
> 
> So if you see your PR with the binding and driver getting merged to
> next-next, can you provide a ping please?
  ^^^^^^^^^
  net-next?

Will do.

regards,
Marc
Marc Kleine-Budde Sept. 5, 2024, 1:24 p.m. UTC | #6
On 05.09.2024 08:19:10, Marc Kleine-Budde wrote:
> On 04.09.2024 18:43:52, Heiko Stübner wrote:
> > Am Mittwoch, 4. September 2024, 17:10:08 CEST schrieb Marc Kleine-Budde:
> > > On 04.09.2024 10:55:21, Heiko Stübner wrote:
> > > [...]
> > > > How/when are you planning on applying stuff?
> > > > 
> > > > I.e. if you're going to apply things still for 6.12, you could simply take
> > > > the whole series if the dts patches still apply to your tree ;-)
> > > 
> > > The DTS changes should not go via any driver subsystem upstream, so
> > > here's a dedicated PR:
> > > 
> > > https://patch.msgid.link/20240904-rk3568-canfd-v1-0-73bda5fb4e03@pengutronix.de
> > 
> > I wasn't on Cc for the pull-request so I'll probably not get a notification
> > when it gets merged?
> > 
> > So if you see your PR with the binding and driver getting merged to
> > next-next, can you provide a ping please?
>   ^^^^^^^^^
>   net-next?
> 
> Will do.

The driver reached net-next/main:

https://lore.kernel.org/all/172554243626.1687913.5623663966016175191.git-patchwork-notify@kernel.org/

regards,
Marc