-
Notifications
You must be signed in to change notification settings - Fork 81
Commit b03cfc5
can: m_can: Enable M_CAN version dependent initialization
This patch adapts the initialization of the M_CAN. So it can be used
with all versions >= 3.0.x.
Changes:
* Added version element to m_can_priv structure to hold M_CAN version.
* Renamed bittiming structs for version 3.0.x
* Added new bittiming structs for version >= 3.1.x
* Function alloc_m_can_dev takes 2 new arguments. The TX FIFO size and the
base address of the module.
* Chip configuration for CAN_CTRLMODE_LOOPBACK is changed: Enabled
CCCR_MON bit. In combination with TEST_LBCK it activates the internal
loopback mode. Leaving CCCR_MON '0' results in external loopback mode.
* Clocks are temporarily enabled by platform_propbe function in order to
allow read access to the Core Release register and the Control Register.
Registers are used to detect M_CAN version and optional Non-ISO Feature.
Initialization of M_CAN for version >= 3.1.x:
* TX FIFO of M_CAN is used to transmit frames. The driver does not need to
stop the tx queue after each frame sent.
* Initialization of TX Event FIFO is added.
* NON-ISO is fixed for all M_CAN versions < 3.2.x. Version 3.2.x _can_ have
the NISO (Non-ISO) bit which can switch the mode of the M_CAN to Non-ISO
mode. This bit does not have to be writeable. Therefore it is checked.
If it is writable Non-ISO support is added to the controllers supported
CAN modes.
New Functions:
* Function to check the Core Release version. The read value determines the
behaviour of the driver.
* Function to check if the NISO bit for version >= 3.2.x is implemented.
Signed-off-by: Mario Huettel <[email protected]>
Reviewed-by: Oliver Hartkopp <[email protected]>
Tested-by: Quentin Schulz <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>1 parent 5e1bd15 commit b03cfc5Copy full SHA for b03cfc5
File tree
Expand file treeCollapse file tree
1 file changed
+269
-71
lines changedOpen diff view settings
Filter options
- drivers/net/can/m_can
Expand file treeCollapse file tree
1 file changed
+269
-71
lines changedOpen diff view settings
0 commit comments