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

RT700 update #444

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lucien-nxp
Copy link
Contributor

  1. add RT700 sdk files
  2. add RT700 pin header files

@lucien-nxp lucien-nxp changed the title Rt700 update RT700 update Oct 3, 2024
# driver_dsp
config MCUX_USE_driver_dsp
bool "dsp Driver"
select MCUX_USE_driver_power
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we include the fsl_power for the DSP?
The driver has a lot of ARM specific registers or functions.
When compiling for HiFi4 I get:


In file included from /opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:8:
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.h: In function 'POWER_EnableDeepSleep':
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.h:735:5: error: 'SCB' undeclared (first use in this function)
  735 |     SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
      |     ^~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.h:735:5: note: each undeclared identifier is reported only once for each function it appears in
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.h:735:17: error: 'SCB_SCR_SLEEPDEEP_Msk' undeclared (first use in this function)
  735 |     SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
      |                 ^~~~~~~~~~~~~~~~~~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.h: In function 'POWER_DisableDeepSleep':
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.h:743:5: error: 'SCB' undeclared (first use in this function)
  743 |     SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
      |     ^~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.h:743:18: error: 'SCB_SCR_SLEEPDEEP_Msk' undeclared (first use in this function)
  743 |     SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
      |                  ^~~~~~~~~~~~~~~~~~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c: In function 'POWER_SetPmicMode':
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:226:5: warning: implicit declaration of function '__disable_irq'; did you mean 'DisableIRQ'? [-Wimplicit-function-declaration]
  226 |     __disable_irq();
      |     ^~~~~~~~~~~~~
      |     DisableIRQ
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:231:5: warning: implicit declaration of function '__enable_irq' [-Wimplicit-function-declaration]
  231 |     __enable_irq();
      |     ^~~~~~~~~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c: In function 'POWER_EnterSleep':
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:385:12: warning: implicit declaration of function '__get_PRIMASK' [-Wimplicit-function-declaration]
  385 |     pmsk = __get_PRIMASK();
      |            ^~~~~~~~~~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:387:5: error: 'SCB' undeclared (first use in this function)
  387 |     SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
      |     ^~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:387:18: error: 'SCB_SCR_SLEEPDEEP_Msk' undeclared (first use in this function)
  387 |     SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
      |                  ^~~~~~~~~~~~~~~~~~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:388:5: warning: implicit declaration of function '__WFI' [-Wimplicit-function-declaration]
  388 |     __WFI();
      |     ^~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:389:5: warning: implicit declaration of function '__set_PRIMASK' [-Wimplicit-function-declaration]
  389 |     __set_PRIMASK(pmsk);
      |     ^~~~~~~~~~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c: In function 'POWER_EnableAutoWake':
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:396:24: error: 'PMC_IRQn' undeclared (first use in this function); did you mean 'PMC0_IRQn'?
  396 |     EnableDeepSleepIRQ(PMC_IRQn);
      |                        ^~~~~~~~
      |                        PMC0_IRQn
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c: In function 'initXSPI':
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:822:5: warning: implicit declaration of function '__DSB' [-Wimplicit-function-declaration]
  822 |     __DSB();
      |     ^~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:823:5: warning: implicit declaration of function '__ISB' [-Wimplicit-function-declaration]
  823 |     __ISB();
      |     ^~~~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c: In function 'POWER_EnterLowPower_FullConfig':
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:988:5: error: 'SCB' undeclared (first use in this function)
  988 |     SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
      |     ^~~
/opt/samba/nxa06898/zephyrproject/modules/hal/nxp/mcux/mcux-sdk/devices/MIMXRT798S/drivers/fsl_power.c:988:17: error: 'SCB_SCR_SLEEPDEEP_Msk' undeclared (first use in this function)
  988 |     SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
      |                 ^~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

If I want to overpass this I need to put a lot of ifdef in the fsl_power.h and fsl_power.c
Can we have a power driver just for DSP?

How do you see these errors fixed?

Copy link
Contributor

@iuliana-prodan iuliana-prodan Oct 15, 2024

Choose a reason for hiding this comment

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

@lucien-nxp can you please add the following restriction for fsl_power.c?

diff --git a/mcux/CMakeLists.txt b/mcux/CMakeLists.txt
index 94de25cb..bf627074 100644
--- a/mcux/CMakeLists.txt
+++ b/mcux/CMakeLists.txt
@@ -48,7 +48,10 @@ zephyr_compile_definitions(${MCUX_CPU})
 # build scripts for every mcux device.
 zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_clock.c)
 if (${MCUX_DEVICE} MATCHES "LPC|MIMXRT6|MIMXRT5|MIMXRT7|RW6|MCXN.4.")
-  zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_power.c)
+  # fsl_power.c contains ARM specific symbols, which shouldn't be included for Xtensa cores
+  if (NOT ${MCUX_DEVICE} MATCHES "_dsp|_hifi1|_hifi4")
+    zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_power.c)
+  endif()
   zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_reset.c)
   zephyr_library_sources_ifdef(CONFIG_HWINFO_RW61X mcux-sdk/devices/${MCUX_DEVICE}/drivers/fsl_ocotp.c)
 endif()

This will fix the compilation for HiFi1 and HiFi4 on i.MXRT700.

I want to use this PR in west.yml for nxp_hal, for DSP support - which will be posted on Zephyr repo in the next few days.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing the solutions. Sorry I ignored HIFI core support before, I have updated the code.

@lucien-nxp
Copy link
Contributor Author

Only rebase to master's newest commit point.

@lucien-nxp
Copy link
Contributor Author

Use device_system_MIMXRT798S_cm33_core0/device_system_MIMXRT798S_cm33_core1 to distinguish two different cm33 cores.
This request is from zephyr side, need to fix in hal_nxp.cmake

@iuliana-prodan
Copy link
Contributor

iuliana-prodan commented Oct 23, 2024

@lucien-nxp can you please rebase this on top of latest nxp_hal, because now on my Zephyr PR a test is falling because in nxp_hal is missing the following commit: 683c007, actually in this PR is missing that commit (becase my PR uses this as hal_nxp version).

In my PR the failing test is: west twister -p s32z2xxdc2@B/s32z270/rtu1 -s tests/drivers/spi/spi_loopback/drivers.spi.s32z_dspi.loopback - see https://github.com/zephyrproject-rtos/zephyr/actions/runs/11480096263/job/31951547309?pr=79954#step:12:483

cc: @dleach02 @Dat-NguyenDuy @mmahadevan108 @manuargue @tunguyen4585

add RT700 files from sdk github main branch

Signed-off-by: Lucien Zhao <[email protected]>
update script to adapt RT700
generate rt700 pin header files

Signed-off-by: Lucien Zhao <[email protected]>
@lucien-nxp
Copy link
Contributor Author

lucien-nxp commented Oct 24, 2024

@lucien-nxp can you please rebase this on top of latest nxp_hal, because now on my Zephyr PR a test is falling because in nxp_hal is missing the following commit: 683c007, actually in this PR is missing that commit (becase my PR uses this as hal_nxp version).

In my PR the failing test is: west twister -p s32z2xxdc2@B/s32z270/rtu1 -s tests/drivers/spi/spi_loopback/drivers.spi.s32z_dspi.loopback - see https://github.com/zephyrproject-rtos/zephyr/actions/runs/11480096263/job/31951547309?pr=79954#step:12:483

cc: @dleach02 @Dat-NguyenDuy @mmahadevan108 @manuargue @tunguyen4585

Updated. Please rebase your PR on zephyr side and re-test on CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants