Skip to contentSkip to conversation

Add support for standard D_CAN module RAM Init Bit

PATCH New [email protected] 1 participant 2 messages Apr 18, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add support for standard D_CAN module RAM Init Bit

The standard D_CAN module includes the RAM Init bit in one of the D_CAN registers. This patch will properly initialize the RAM Init bit which is self-clearing when the RAM Init is complete. This patch fixes a boot message reporting an invalid resource as well as the message saying control memory is not used for raminit.

[PATCHv2] net: c_can: Add support for D_CAN RAM Init bit in D_CAN

#1 lore raw

PATCH v2 1/1 net: c_can: Add support for D_CAN Module RAM Init

From: Thor Thayer <[email protected]>

The D_CAN driver was written to support the TI D_CAN implementation which placed the D_CAN RAM reset in a separate register. In the standard D_CAN module the RAM Init is in the D_CAN module so handle the RAM Init differently.
This patch has only been tested on the standard D_CAN module (but not on the TI D_CAN module).

---
Changes in v2:
-Rename raminit_type_flag to raminit_type
-New constants for raminit_type
---

---
 drivers/net/can/c_can/c_can.h          |    3 ++
 drivers/net/can/c_can/c_can_platform.c |   51 +++++++++++++++++++++++++-------
 2 files changed, 44 insertions(+), 10 deletions(-)
drivers/net/can/c_can/c_can.h +3 -0
index faa8404..73c6c88 100644
@@ -88,6 +88,7 @@ enum reg {
 	C_CAN_INTPND2_REG,
 	C_CAN_MSGVAL1_REG,
 	C_CAN_MSGVAL2_REG,
+	C_CAN_FUNCTION_REG,
 };
 
 static const u16 reg_map_c_can[] = {
@@ -139,6 +140,7 @@ static const u16 reg_map_d_can[] = {
 	[C_CAN_BRPEXT_REG]	= 0x0E,
 	[C_CAN_INT_REG]		= 0x10,
 	[C_CAN_TEST_REG]	= 0x14,
+	[C_CAN_FUNCTION_REG]	= 0x18,
 	[C_CAN_TXRQST1_REG]	= 0x88,
 	[C_CAN_TXRQST2_REG]	= 0x8A,
 	[C_CAN_NEWDAT1_REG]	= 0x9C,
@@ -201,6 +203,7 @@ struct c_can_priv {
 	unsigned int instance;
 	void (*raminit) (const struct c_can_priv *priv, bool enable);
 	u32 dlc[C_CAN_MSG_OBJ_TX_NUM];
+	u32 raminit_type;
 };
 
 struct net_device *alloc_c_can_dev(void);
drivers/net/can/c_can/c_can_platform.c +41 -10

85 lines not on this page · raw message

Signature · 1 line
1.7.9.5