Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zephyr opanamp rsc dev 1 #1

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion drivers/ipm/ipm_imx.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018,2023 NXP
* Copyright 2018,2023-2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -108,7 +108,16 @@ static void imx_mu_isr(const struct device *dev)
int32_t i;
bool all_registers_full;

#if defined(CONFIG_SOC_MIMX9352)
status_reg = base->RSR;
status_reg = (status_reg >> MU_RSR_RF0_SHIFT)&0x00000007;
status_reg = (((status_reg>>MU_RSR_RF3_SHIFT)<<MU_RSR_RF0_SHIFT) |
((status_reg>>MU_RSR_RF2_SHIFT)<<MU_RSR_RF1_SHIFT) |
((status_reg>>MU_RSR_RF1_SHIFT)<<MU_RSR_RF2_SHIFT) |
((status_reg>>MU_RSR_RF0_SHIFT)<<MU_RSR_RF3_SHIFT));
#else
status_reg = base->SR >>= MU_SR_RFn_SHIFT;
#endif

for (id = CONFIG_IPM_IMX_MAX_ID_VAL; id >= 0; id--) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a standalone patch explaining that MU register layout has changed or imx93 and we need to reverse the bits in order to work.

This would be the most problematic change to get in. but lets sending it like this and hope for the best.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alxlastur is it possible to do this change in NXP hal - in fsl_mu.c?
When taking the status_reg this should be already shifted for i.mx93.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iuliana-prodan , as far as I see I don't think so. The isr is defined in ipx_imx.c:
image
I see no ISR in fsl_mu.c or fsl_mu.h

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking to get the status register from fsl_mu by writing a function that does what you have above.
Here, like we have the MU_GetStatusFlags(), something like MU_GetStatusRegister().
I have to take a look on imx93 MU :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. In this case it needs a MU_GetStatusRegister() that works for for all platforms. So MU_GetStatusRegister() should work for imx93 and imx8mp.

if (status_reg & 0x1U) {
Expand Down
6 changes: 6 additions & 0 deletions dts/arm/nxp/nxp_imx93_m33.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
clocks = <&ccm IMX_CCM_LPUART2_CLK 0x6c 24>;
status = "disabled";
};

mu1: mu1@44220000 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be mu1: mu@4422000....

compatible = "nxp,imx-mu";
reg = <0x44220000 DT_SIZE_K(64)>;
interrupts = <21 0>;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved in the same patch with the one adding overlays for imx93 M33 core as it is a change related to DTS.

};
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONFIG_LOG_PRINTK=n
CONFIG_IPM_IMX_MAX_DATA_SIZE_16=n
Copy link
Collaborator

@dbaluta dbaluta Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since 8mp support doesn't depend on other patches lets send this as a separate Pull request.

Commit message should look like this:

sample: open_amp_rsc_table: Add support for imx8mp_evk M7 core

This enables openamp_rsc_table sample for imx8mp_evk on M7 core

CONFIG_IPM_IMX_MAX_DATA_SIZE_4=y
CONFIG_OPENAMP_WITH_DCACHE=y
CONFIG_IPM_IMX_FW_READY_REPLY=y
CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_LOG_MODE_MINIMAL=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
chosen {
/*
* shared memory reserved for the inter-processor communication
*/
zephyr,ipc_shm = &shram;
zephyr,ipc = &mailbox0;
};

shram: memory@55000000 {
compatible = "mmio-sram";
reg = <0x55000000 0x500000>;
};
};

&mailbox0 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONFIG_LOG_PRINTK=n
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message here should be similiar with the one from 8mp_evk

CONFIG_IPM_IMX_MAX_DATA_SIZE_16=n
CONFIG_IPM_IMX_MAX_DATA_SIZE_4=y
CONFIG_OPENAMP_WITH_DCACHE=y
CONFIG_IPM_IMX_FW_READY_REPLY=y
CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_LOG_MODE_MINIMAL=y

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a newline here

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
chosen {
/*
* shared memory reserved for the inter-processor communication
*/
zephyr,ipc_shm = &shram;
zephyr,ipc = &mu1;
};

shram: memory@A4000000 {
compatible = "mmio-sram";
reg = <0xA4000000 0x120000>;
};

mu1{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a space between mu1 and {

status = "okay";
};

};