-
Notifications
You must be signed in to change notification settings - Fork 54.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
can: sun4i_can: Add support for the Allwinner D1
The controllers present in the D1 are extremely similar to the R40 and require the same reset quirks, but An extra quirk is needed to support receiving packets. Signed-off-by: John Watts <[email protected]> Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
- Loading branch information
1 parent
8cda0c6
commit 8abb952
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,8 @@ | |
#define SUN4I_REG_BUF12_ADDR 0x0070 /* CAN Tx/Rx Buffer 12 */ | ||
#define SUN4I_REG_ACPC_ADDR 0x0040 /* CAN Acceptance Code 0 */ | ||
#define SUN4I_REG_ACPM_ADDR 0x0044 /* CAN Acceptance Mask 0 */ | ||
#define SUN4I_REG_ACPC_ADDR_D1 0x0028 /* CAN Acceptance Code 0 on the D1 */ | ||
#define SUN4I_REG_ACPM_ADDR_D1 0x002C /* CAN Acceptance Mask 0 on the D1 */ | ||
#define SUN4I_REG_RBUF_RBACK_START_ADDR 0x0180 /* CAN transmit buffer start */ | ||
#define SUN4I_REG_RBUF_RBACK_END_ADDR 0x01b0 /* CAN transmit buffer end */ | ||
|
||
|
@@ -779,6 +781,11 @@ static const struct sun4ican_quirks sun4ican_quirks_r40 = { | |
.acp_offset = 0, | ||
}; | ||
|
||
static const struct sun4ican_quirks sun4ican_quirks_d1 = { | ||
.has_reset = true, | ||
.acp_offset = (SUN4I_REG_ACPC_ADDR_D1 - SUN4I_REG_ACPC_ADDR), | ||
}; | ||
|
||
static const struct of_device_id sun4ican_of_match[] = { | ||
{ | ||
.compatible = "allwinner,sun4i-a10-can", | ||
|
@@ -789,6 +796,9 @@ static const struct of_device_id sun4ican_of_match[] = { | |
}, { | ||
.compatible = "allwinner,sun8i-r40-can", | ||
.data = &sun4ican_quirks_r40 | ||
}, { | ||
.compatible = "allwinner,sun20i-d1-can", | ||
.data = &sun4ican_quirks_d1 | ||
}, { | ||
/* sentinel */ | ||
}, | ||
|
@@ -913,4 +923,4 @@ module_platform_driver(sun4i_can_driver); | |
MODULE_AUTHOR("Peter Chen <[email protected]>"); | ||
MODULE_AUTHOR("Gerhard Bertelsmann <[email protected]>"); | ||
MODULE_LICENSE("Dual BSD/GPL"); | ||
MODULE_DESCRIPTION("CAN driver for Allwinner SoCs (A10/A20)"); | ||
MODULE_DESCRIPTION("CAN driver for Allwinner SoCs (A10/A20/D1)"); |