drivers: can: mcux: mcan: move register definition to implementation
Move definition of the NXP LPC MCAN specific Message RAM Base Address register (MRBA) to the front-end driver implementation. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
a781ccde0f
commit
89f4330f94
2 changed files with 6 additions and 8 deletions
|
@ -592,12 +592,6 @@
|
||||||
#define CAN_MCAN_TXEFA_EFAI GENMASK(4, 0)
|
#define CAN_MCAN_TXEFA_EFAI GENMASK(4, 0)
|
||||||
#endif /* !CONFIG_CAN_STM32FD */
|
#endif /* !CONFIG_CAN_STM32FD */
|
||||||
|
|
||||||
/* Message RAM Base Address register */
|
|
||||||
#ifdef CONFIG_CAN_MCUX_MCAN
|
|
||||||
#define CAN_MCAN_MRBA 0x200
|
|
||||||
#define CAN_MCAN_MRBA_BA GENMASK(31, 16)
|
|
||||||
#endif /* CONFIG_CAN_MCUX_MCAN */
|
|
||||||
|
|
||||||
#ifdef CONFIG_CAN_MCUX_MCAN
|
#ifdef CONFIG_CAN_MCUX_MCAN
|
||||||
#define MCAN_DT_PATH DT_NODELABEL(can0)
|
#define MCAN_DT_PATH DT_NODELABEL(can0)
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -17,6 +17,10 @@ LOG_MODULE_REGISTER(can_mcux_mcan, CONFIG_CAN_LOG_LEVEL);
|
||||||
|
|
||||||
#define DT_DRV_COMPAT nxp_lpc_mcan
|
#define DT_DRV_COMPAT nxp_lpc_mcan
|
||||||
|
|
||||||
|
/* Message RAM Base Address register */
|
||||||
|
#define MCUX_MCAN_MRBA 0x200
|
||||||
|
#define MCUX_MCAN_MRBA_BA GENMASK(31, 16)
|
||||||
|
|
||||||
struct mcux_mcan_config {
|
struct mcux_mcan_config {
|
||||||
mm_reg_t base;
|
mm_reg_t base;
|
||||||
const struct device *clock_dev;
|
const struct device *clock_dev;
|
||||||
|
@ -60,7 +64,7 @@ static int mcux_mcan_init(const struct device *dev)
|
||||||
const struct mcux_mcan_config *mcux_config = mcan_config->custom;
|
const struct mcux_mcan_config *mcux_config = mcan_config->custom;
|
||||||
struct can_mcan_data *mcan_data = dev->data;
|
struct can_mcan_data *mcan_data = dev->data;
|
||||||
struct mcux_mcan_data *mcux_data = mcan_data->custom;
|
struct mcux_mcan_data *mcux_data = mcan_data->custom;
|
||||||
const uintptr_t mrba = POINTER_TO_UINT(&mcux_data->msg_ram) & CAN_MCAN_MRBA_BA;
|
const uintptr_t mrba = POINTER_TO_UINT(&mcux_data->msg_ram) & MCUX_MCAN_MRBA_BA;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (!device_is_ready(mcux_config->clock_dev)) {
|
if (!device_is_ready(mcux_config->clock_dev)) {
|
||||||
|
@ -79,7 +83,7 @@ static int mcux_mcan_init(const struct device *dev)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = can_mcan_write_reg(dev, CAN_MCAN_MRBA, (uint32_t)mrba);
|
err = can_mcan_write_reg(dev, MCUX_MCAN_MRBA, (uint32_t)mrba);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue