51 C_CAN_IF1_MSGCTRL_REG,
62 C_CAN_IF2_MSGCTRL_REG,
81static const u16 reg_map_c_can[] = {
82 [C_CAN_CTRL_REG] = 0x00,
83 [C_CAN_STS_REG] = 0x02,
84 [C_CAN_ERR_CNT_REG] = 0x04,
85 [C_CAN_BTR_REG] = 0x06,
86 [C_CAN_INT_REG] = 0x08,
87 [C_CAN_TEST_REG] = 0x0A,
88 [C_CAN_BRPEXT_REG] = 0x0C,
89 [C_CAN_IF1_COMREQ_REG] = 0x10,
90 [C_CAN_IF1_COMMSK_REG] = 0x12,
91 [C_CAN_IF1_MASK1_REG] = 0x14,
92 [C_CAN_IF1_MASK2_REG] = 0x16,
93 [C_CAN_IF1_ARB1_REG] = 0x18,
94 [C_CAN_IF1_ARB2_REG] = 0x1A,
95 [C_CAN_IF1_MSGCTRL_REG] = 0x1C,
96 [C_CAN_IF1_DATA1_REG] = 0x1E,
97 [C_CAN_IF1_DATA2_REG] = 0x20,
98 [C_CAN_IF1_DATA3_REG] = 0x22,
99 [C_CAN_IF1_DATA4_REG] = 0x24,
100 [C_CAN_IF2_COMREQ_REG] = 0x40,
101 [C_CAN_IF2_COMMSK_REG] = 0x42,
102 [C_CAN_IF2_MASK1_REG] = 0x44,
103 [C_CAN_IF2_MASK2_REG] = 0x46,
104 [C_CAN_IF2_ARB1_REG] = 0x48,
105 [C_CAN_IF2_ARB2_REG] = 0x4A,
106 [C_CAN_IF2_MSGCTRL_REG] = 0x4C,
107 [C_CAN_IF2_DATA1_REG] = 0x4E,
108 [C_CAN_IF2_DATA2_REG] = 0x50,
109 [C_CAN_IF2_DATA3_REG] = 0x52,
110 [C_CAN_IF2_DATA4_REG] = 0x54,
111 [C_CAN_TXRQST1_REG] = 0x80,
112 [C_CAN_TXRQST2_REG] = 0x82,
113 [C_CAN_NEWDAT1_REG] = 0x90,
114 [C_CAN_NEWDAT2_REG] = 0x92,
115 [C_CAN_INTPND1_REG] = 0xA0,
116 [C_CAN_INTPND2_REG] = 0xA2,
117 [C_CAN_MSGVAL1_REG] = 0xB0,
118 [C_CAN_MSGVAL2_REG] = 0xB2,
121static const u16 reg_map_d_can[] = {
122 [C_CAN_CTRL_REG] = 0x00,
123 [C_CAN_CTRL_EX_REG] = 0x02,
124 [C_CAN_STS_REG] = 0x04,
125 [C_CAN_ERR_CNT_REG] = 0x08,
126 [C_CAN_BTR_REG] = 0x0C,
127 [C_CAN_BRPEXT_REG] = 0x0E,
128 [C_CAN_INT_REG] = 0x10,
129 [C_CAN_TEST_REG] = 0x14,
130 [C_CAN_FUNCTION_REG] = 0x18,
131 [C_CAN_TXRQST1_REG] = 0x88,
132 [C_CAN_TXRQST2_REG] = 0x8A,
133 [C_CAN_TXRQST3_REG] = 0x8C,
134 [C_CAN_TXRQST4_REG] = 0x8E,
135 [C_CAN_NEWDAT1_REG] = 0x9C,
136 [C_CAN_NEWDAT2_REG] = 0x9E,
137 [C_CAN_INTPND1_REG] = 0xB0,
138 [C_CAN_INTPND2_REG] = 0xB2,
139 [C_CAN_INTPND3_REG] = 0xB4,
140 [C_CAN_MSGVAL1_REG] = 0xC4,
141 [C_CAN_MSGVAL2_REG] = 0xC6,
142 [C_CAN_IF1_COMREQ_REG] = 0x100,
143 [C_CAN_IF1_COMMSK_REG] = 0x102,
144 [C_CAN_IF1_MASK1_REG] = 0x104,
145 [C_CAN_IF1_MASK2_REG] = 0x106,
146 [C_CAN_IF1_ARB1_REG] = 0x108,
147 [C_CAN_IF1_ARB2_REG] = 0x10A,
148 [C_CAN_IF1_MSGCTRL_REG] = 0x10C,
149 [C_CAN_IF1_DATA1_REG] = 0x110,
150 [C_CAN_IF1_DATA2_REG] = 0x112,
151 [C_CAN_IF1_DATA3_REG] = 0x114,
152 [C_CAN_IF1_DATA4_REG] = 0x116,
153 [C_CAN_IF2_COMREQ_REG] = 0x120,
154 [C_CAN_IF2_COMMSK_REG] = 0x122,
155 [C_CAN_IF2_MASK1_REG] = 0x124,
156 [C_CAN_IF2_MASK2_REG] = 0x126,
157 [C_CAN_IF2_ARB1_REG] = 0x128,
158 [C_CAN_IF2_ARB2_REG] = 0x12A,
159 [C_CAN_IF2_MSGCTRL_REG] = 0x12C,
160 [C_CAN_IF2_DATA1_REG] = 0x130,
161 [C_CAN_IF2_DATA2_REG] = 0x132,
162 [C_CAN_IF2_DATA3_REG] = 0x134,
163 [C_CAN_IF2_DATA4_REG] = 0x136,
167 BOSCH_C_CAN_PLATFORM,
177struct c_can_driver_data {
178 enum c_can_dev_id id;
183 const struct raminit_bits *raminit_bits;
189struct c_can_raminit {
190 struct regmap *syscon;
192 struct raminit_bits bits;
196#define DEV_NAME "rtcan%d"
197#define DRV_NAME "c_can"
201 struct rtcan_device *dev;
205 struct device *device;
212 u16 (*read_reg)(
const struct c_can_priv *priv,
enum reg index);
213 void (*write_reg)(
const struct c_can_priv *priv,
enum reg index,
215 u32 (*read_reg32)(
const struct c_can_priv *priv,
enum reg index);
216 void (*write_reg32)(
const struct c_can_priv *priv,
enum reg index,
220 unsigned long irq_flags;
224 unsigned long tx_dir;
227 enum c_can_dev_id type;
231 int msg_obj_rx_first;
233 int msg_obj_rx_low_last;
236 int msg_obj_tx_first;
238 int msg_obj_tx_next_mask;
241 struct c_can_raminit raminit_sys;
242 u32 __iomem *raminit_ctrlreg;
243 unsigned int instance;
244 void (*raminit)(
const struct c_can_priv *priv,
bool enable);
247struct rtcan_device *rtcan_c_can_dev_alloc(
int msg_obj_num);
248void rtcan_c_can_dev_free(
struct rtcan_device *dev);
250int rtcan_c_can_register(
struct rtcan_device *dev);
251void rtcan_c_can_unregister(
struct rtcan_device *dev);
253void rtcan_c_can_set_ethtool_ops(
struct rtcan_device *dev);
pipeline_spinlock_t rtdm_lock_t
Lock variable.
Definition driver.h:552
Copyright © 2011 Gilles Chanteperdrix gilles.chanteperdrix@xenomai.org.
Definition atomic.h:24
Custom CAN bit-time definition.
Definition can.h:151