[RFC PATCH 0/6] can: esd: add CAN-FD for esd GmbH PCIe/402 CAN interface family

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

 



This patch adds support for CAN-FD in the existing esd_402_pci
driver for the PCI based PCIe/402 CAN interface family from
esd GmbH.

The patch is sent as RFC because the driver needs some
extensions in the netlink interface and user API.

@Vincent: I see that it conflicts with your changes for
   CAN-XL support in netlink.h but I send it as RFC
   to show what I have now.

The esdACC CAN controller has only a single bitrate prescaler
for both the nominal and data bitrate. The hardware was
designed this way to follow CiA recommendations for the
bitrate configuration.

The detailed recommendations of the CiA can be found here:
https://www.can-cia.org/fileadmin/cia/documents/publications/cnlm/march_2018/18-1_p28_recommendation_for_the_canfd_bit-timing_holger_zeltwanger_cia.pdf

The current bit rate calculation in the kernel is done independently
for the nominal and the data bitrate. This can lead to the fact
that the selected nominal (NBRP) and data bitrate prescalers (DBRP)
differ. This kind of configuration is not supported by the esdACC.

In a first step to avoid this I propose to add a new control mode
CAN_CTRLMODE_FD_COMMON_BRP that tells the bitrate check logic
to reject bitrate settings with different NBRP and DBRP values.

This CAN_CTRLMODE_FD_COMMON_BRP is set statically by the driver
to tell that it needs a common BRP (see patch 0005).

The netlink part of this is done in the patches marked with
"DO NOT MERGE" in this patchset. 

In a second step the bitrate calculation should be changed to
prefer to use a common BRP at least if CAN_CTRLMODE_FD_COMMON_BRP
is set. This could be based on the bitrate calculation
algorithm of my colleague Oliver Thimm that I will present
in a follow up email. This email will then also discuss the
advantages of this approach in more detail.

Unfortunately I have no patches yet.

I will send a patch set for the iproute2 tool to add the
capability to set the CAN_CTRLMODE_FD_COMMON_BRP using
"fd-common-brp" with the ip command.


Stefan Mätje (6):
  can: esd_402_pci: Add basic support for CAN-FD
  can: esd_402_pci: Add support to control TDC mode and settings
  can: esd_402_pci: Add support for esdACC CAN-FD versions below 0.72
  !!! DO NOT MERGE !!! can: netlink: add CAN_CTRLMODE_FD_COMMON_BRP user api
  can: esd_402_pci: add request to provide a common BRP
  !!! DO NOT MERGE !!! can: netlink: Reject bitrate if CAN_CTRLMODE_FD_COMMON_BRP
    is not obeyed

 drivers/net/can/dev/netlink.c          |  11 +-
 drivers/net/can/esd/esd_402_pci-core.c |  99 ++++++-
 drivers/net/can/esd/esdacc.c           | 340 +++++++++++++++++++++++--
 drivers/net/can/esd/esdacc.h           |  57 ++++-
 include/uapi/linux/can/netlink.h       |   3 +-
 5 files changed, 470 insertions(+), 40 deletions(-)


base-commit: 38f83a57aa8e644f37a88d4771d756303cfa7365
-- 
2.34.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