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

nxp: imx8ulp: add NXP HAL binding support #70219

Merged

Conversation

LaurentiuM1234
Copy link
Collaborator

No description provided.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Mar 14, 2024

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
sof zephyrproject-rtos/sof@3e70d03 zephyrproject-rtos/sof@1c1dd3d (zephyr) zephyrproject-rtos/sof@3e70d036..1c1dd3d8

Note: This message is automatically posted and updated by the Manifest GitHub Action.

iuliana-prodan
iuliana-prodan previously approved these changes Mar 20, 2024
@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Mar 20, 2024
iuliana-prodan
iuliana-prodan previously approved these changes Mar 20, 2024
@@ -13,7 +13,7 @@ config SOC_MIMX8ULP
select SOC_SERIES_IMX8ULP

config SOC
default "imx8ulp" if SOC_MIMX8ULP
default "mimx8ud7" if SOC_MIMX8ULP
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
default "mimx8ud7" if SOC_MIMX8ULP
default "mimx8ud7" if SOC_MIMX8UD7

We need to rename SOC_MIMX8ULP to SOC_MIMX8UD7 elsewhere as well

Copy link
Collaborator

@iuliana-prodan iuliana-prodan Mar 20, 2024

Choose a reason for hiding this comment

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

@danieldegrasse Is this mandatory? I believe not.
We can name the CONFIG_SOC_XYZ as suggestive as possible, and SOC_MIMX8ULP is more appropriate then SOC_MIMX8UD7, IMO. (8ULP is the board name).
I agree we have to have the right value set for it - in this case mimx8ud7 (set correctly here), to link it with our NXP_HAL.

Is this CONFIG_SOC_XYZ somewhere parsed and the "XYZ" is used?
IIUC only the value of CONFIG_SOC_XYZ is used.

PS: We did the same for 8MPlus - https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/nxp/imx/imx8m/Kconfig.soc#L27 or others (8QXP or 8QM).

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm going off (my understanding) of the guidance for HWMv2, that the CONFIG_SOC_xxx suffix needs to match the SOC name in the YAML- @nordicjm, is this correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My 2 cents here: switching to SOC-based (e.g: for ULP use MIMX8UD7 and so on) naming scheme should be addressed in another patch series (if required, of course). This is because:

  1. We have multiple SoCs that don't abide by this rule (there's also MP, QM, and QXP as @iuliana-prodan pointed out). Doing this in a separate patch with its only scope being fixing such irregularities should be more "clean" and easy to follow.
  2. Doing this change also implies making even more changes on SOF side, which is not ideal. We should strive to make such changes incrementally to minimize the chance of breaking stuff. We're also in the process of transitioning to Zephyr drivers with a couple of patches that are still in review due to some Zephyr patches still being in review and having to also take the renaming into account would just make the process more prone to errors.
  3. The scope of this PR is to just add the HAL binding. Having to modify the SOC name is just a side effect of this, not the main goal. The old imx8ulp name has just been a "placeholder" since we didn't need the HAL binding up until now so this was long overdue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Keys and values for SOC, SOC_SERIES and SOC_FAMILY need to match (SOC can additionally contain the CPU cluster). Whilst this is not enforced by CI at the present time, it needs to be followed as in future lots of these Kconfig options will be generated automatically by the build system and at that point mismatches will suddenly cause entire SoCs to just break.

Copy link
Collaborator

@iuliana-prodan iuliana-prodan Mar 21, 2024

Choose a reason for hiding this comment

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

@nordicjm @danieldegrasse can we leave this as is now (as @LaurentiuM1234 suggested here) and I'll follow up with a PR next week?

@nordicjm I want to understand what does it have to match exactly?

If my SOC value is mimx8ml8, the key for SOC_IMX8MP should be SOC_MIMX8ML8?
Why is this mandatory? Since the SOC_IMX8MP is just a bool - is defined or not.

Also, what should match in the SOC_SERIES or SOC_FAMILY?
What is wrong here, for example?

config SOC_SERIES
	default "imx8m" if SOC_SERIES_IMX8M

or

config SOC_FAMILY
	default "nxp_imx" if SOC_FAMILY_NXP_IMX

Thanks!

Copy link
Collaborator

@nordicjm nordicjm Mar 21, 2024

Choose a reason for hiding this comment

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

No it needs to be updated here.
For:

config SOC_SERIES
	default "imx8m" if SOC_SERIES_IMX8M

then the imx8m part must match in the format SOC_SERIES_<part>. For:

config SOC_FAMILY
	default "nxp_imx" if SOC_FAMILY_NXP_IMX

then the nxp_imx part must match in the format SOC_FAMILY_<family>. For:

config SOC
	default "mimx8ud7" if SOC_MIMX8ULP

then the mimx8ud7 part must match in the format SOC_FAMILY_<soc> or SOC_FAMILY_<soc>_<cpucluster>, so this is invalid and needs fixing. And all of these must match the text entries in the soc.yml file

@@ -13,7 +13,7 @@ config SOC_MIMX8ULP
select SOC_SERIES_IMX8ULP

config SOC
default "imx8ulp" if SOC_MIMX8ULP
default "mimx8ud7" if SOC_MIMX8ULP
Copy link
Collaborator

@nordicjm nordicjm Mar 21, 2024

Choose a reason for hiding this comment

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

No it needs to be updated here.
For:

config SOC_SERIES
	default "imx8m" if SOC_SERIES_IMX8M

then the imx8m part must match in the format SOC_SERIES_<part>. For:

config SOC_FAMILY
	default "nxp_imx" if SOC_FAMILY_NXP_IMX

then the nxp_imx part must match in the format SOC_FAMILY_<family>. For:

config SOC
	default "mimx8ud7" if SOC_MIMX8ULP

then the mimx8ud7 part must match in the format SOC_FAMILY_<soc> or SOC_FAMILY_<soc>_<cpucluster>, so this is invalid and needs fixing. And all of these must match the text entries in the soc.yml file

@LaurentiuM1234
Copy link
Collaborator Author

V2 changes

  1. All SOC-related configurations now use the MIMX8UD7-based naming. Hopefully I didn't miss something?
  2. New SOF dependency: zephyr: CMakeLists.txt: use new CONFIG_SOC_ for 8ULP sof#44

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this manifest update needs to be in the same commit where you rename the SOC to preserve bisectability

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, you're right. Will update once zephyrproject-rtos/sof#44 is merged.

@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Mar 25, 2024
@LaurentiuM1234
Copy link
Collaborator Author

Dependencies merged and CI is now green. @danieldegrasse @nordicjm can you please have another look?

danieldegrasse
danieldegrasse previously approved these changes Mar 25, 2024
nordicjm
nordicjm previously approved these changes Mar 25, 2024
iuliana-prodan
iuliana-prodan previously approved these changes Mar 25, 2024
dbaluta
dbaluta previously approved these changes Mar 26, 2024
@dbaluta
Copy link
Collaborator

dbaluta commented Mar 26, 2024

@LaurentiuM1234 needs to fix the conflicts and we are ready to merge.

@LaurentiuM1234
Copy link
Collaborator Author

Removed NXP HAL hash bump. The changes should be pulled in by the hash bump performed in #70392.

The SOC name `imx8ulp` has been just a placeholder until
support for the SOC's ADSP (since this is the only core
that's supported in Zephyr) could be added to the NXP HAL.
Now that the support has been added, to make use of it, the
SOC name `imx8ulp` has to be changed to `mimx8ud7`. As such,
this commit does the following:
	1) Introduces SOC part number configuration - needed
	by some HAL headers.
	2) Replaces all occurrences of `imx8ulp` (as the SOC
	name) with `mimx8ud7`.
	3) Enables `CONFIG_HAS_MCUX`.
	4) Aligns all `CONFIG_SOC_` configurations with the
	new SOC name.
	5) Updates SOF hash. This is needed to fix build issues
	caused by this name change. This is not done in a separate
	commit to preserve bisectability.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The SOC name for the `imx8ulp_evk` board has been changed
to `mimx8ud7`. As such, update `deprecated.cmake` to reflect
this change.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Copy link
Collaborator

@danieldegrasse danieldegrasse left a comment

Choose a reason for hiding this comment

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

@dleach02 can you take a look?

@fabiobaltieri fabiobaltieri merged commit 24471f5 into zephyrproject-rtos:main Mar 28, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants