drivers: ipm: remove nxp,imx-mu-rev2 compatible

Remove nxp,imx-mu-rev2 compatible. This IP block is the same as the
nxp,imx-mu device, and should be handled by the same compatible

Instead, use CONFIG_HAS_MCUX to determine which HAL APIs should be used
to interact with the messaging unit IP.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2023-10-31 14:14:20 -05:00 committed by Carles Cufí
parent c76d5b882c
commit 8d5322b8ff
7 changed files with 15 additions and 34 deletions

View file

@ -1,9 +1,10 @@
/*
* Copyright (c) 2018, NXP
* Copyright 2018,2023 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT nxp_imx_mu
#include <errno.h>
#include <string.h>
@ -12,11 +13,11 @@
#include <zephyr/drivers/ipm.h>
#include <zephyr/irq.h>
#include <zephyr/sys/barrier.h>
#if defined(CONFIG_IPM_IMX_REV2)
#define DT_DRV_COMPAT nxp_imx_mu_rev2
#ifdef CONFIG_HAS_MCUX
/* MCUX HAL uses a different header file than the i.MX HAL for this IP block */
#include "fsl_mu.h"
#else
#define DT_DRV_COMPAT nxp_imx_mu
#include <mu_imx.h>
#endif
@ -38,7 +39,7 @@ struct imx_mu_data {
void *user_data;
};
#if defined(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_HAS_MCUX)
/*!
* @brief Check RX full status.
*
@ -127,7 +128,7 @@ static void imx_mu_isr(const struct device *dev)
}
if (all_registers_full) {
for (i = 0; i < IMX_IPM_DATA_REGS; i++) {
#if defined(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_HAS_MCUX)
data32[i] = MU_ReceiveMsg(base,
(id * IMX_IPM_DATA_REGS) + i);
#else
@ -166,7 +167,7 @@ static int imx_mu_ipm_send(const struct device *dev, int wait, uint32_t id,
const struct imx_mu_config *config = dev->config;
MU_Type *base = MU(config);
uint32_t data32[IMX_IPM_DATA_REGS] = {0};
#if !IS_ENABLED(CONFIG_IPM_IMX_REV2)
#if !IS_ENABLED(CONFIG_HAS_MCUX)
mu_status_t status;
#endif
int i;
@ -182,7 +183,7 @@ static int imx_mu_ipm_send(const struct device *dev, int wait, uint32_t id,
/* Actual message is passing using 32 bits registers */
memcpy(data32, data, size);
#if defined(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_HAS_MCUX)
if (wait) {
for (i = 0; i < IMX_IPM_DATA_REGS; i++) {
MU_SendMsgNonBlocking(base, id * IMX_IPM_DATA_REGS + i,
@ -249,7 +250,7 @@ static int imx_mu_ipm_set_enabled(const struct device *dev, int enable)
{
const struct imx_mu_config *config = dev->config;
MU_Type *base = MU(config);
#if defined(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_HAS_MCUX)
#if CONFIG_IPM_IMX_MAX_DATA_SIZE_4
if (enable) {
MU_EnableInterrupts(base, kMU_Rx0FullInterruptEnable);

View file

@ -54,7 +54,7 @@
};
mailbox_b: mailbox@40c4c000 {
compatible = "nxp,imx-mu-rev2";
compatible = "nxp,imx-mu";
reg = <0x40c4c000 0x4000>;
interrupts = <118 0>;
rdc = <0>;

View file

@ -77,7 +77,7 @@
};
mailbox_a: mailbox@40c48000 {
compatible = "nxp,imx-mu-rev2";
compatible = "nxp,imx-mu";
reg = <0x40c48000 0x4000>;
interrupts = <118 0>;
rdc = <0>;

View file

@ -1,20 +0,0 @@
# Copyright (c) 2018, NXP
# SPDX-License-Identifier: Apache-2.0
description: i.MX Messaging Unit
compatible: "nxp,imx-mu-rev2"
include: base.yaml
properties:
reg:
required: true
interrupts:
required: true
rdc:
type: int
required: true
description: Set the RDC permission for this peripheral

View file

@ -69,7 +69,7 @@
};
mailbox0: mailbox@30e70000 {
compatible = "nxp,imx-mu-rev2";
compatible = "nxp,imx-mu";
reg = <0x30e70000 0x10000>;
interrupts = <7 0>;
rdc = <0>;

View file

@ -37,13 +37,13 @@
#include <cmsis_core.h>
#define DUAL_CORE_MU_ENABLED \
(CONFIG_SECOND_CORE_MCUX && CONFIG_IPM && CONFIG_IPM_IMX_REV2)
(CONFIG_SECOND_CORE_MCUX && CONFIG_IPM && CONFIG_IPM_IMX)
#if DUAL_CORE_MU_ENABLED
/* Dual core mode is enabled, and messaging unit is present */
#include <fsl_mu.h>
#define BOOT_FLAG 0x1U
#define MU_BASE (MU_Type *)DT_REG_ADDR(DT_INST(0, nxp_imx_mu_rev2))
#define MU_BASE (MU_Type *)DT_REG_ADDR(DT_INST(0, nxp_imx_mu))
#endif
#if CONFIG_USB_DC_NXP_EHCI /* USB PHY configuration */