Skip to content

Conversation

@MrVan
Copy link
Contributor

@MrVan MrVan commented Feb 26, 2021

This goal is to support Zephyr runs on top of Jailhouse hypervisor.

This patchset is the first step to make Zephyr runs on i.MX8MM A53 core from U-Boot.

Copy link
Contributor

@hakehuang hakehuang left a comment

Choose a reason for hiding this comment

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

suggest to create an issues to explain on how to use this with uboot + jailhouse.

Copy link
Contributor

Choose a reason for hiding this comment

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

need add debugger support
`
board_set_debugger_ifnset(jlink)
board_set_flasher_ifnset(jlink)

board_runner_args(jlink "--device=MIMX8MD6_A53")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure, but I not see this "./boards/arm/bcm958402m2_a72/board.cmake" and "boards/arm/qemu_cortex_a53/board.cmake", Is it really needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

without that you can not use west flash to download the application. how do you program the board now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use U-Boot to load/kick the zephyr.bin or use Linux to load it for hypervisor usage. zephyr.bin is stored in sdcard fat partition.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MrVan the official way is to use west flash

Copy link
Contributor

Choose a reason for hiding this comment

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

then user need extra steps to setup uboot, and as uboot is evovled overtime, this needs some extra documents and efforts.

Copy link
Contributor

@carlocaione carlocaione Mar 11, 2021

Choose a reason for hiding this comment

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

How to use U-Boot is already documented in this commit and that is enough. Fine to me if we can use west flash to flash the board as well but there is no such a thing as "official" way to flash or use the board. @MrVan is it a problem adding support for JLink?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not familar with JLink. To me, we have sdcard to hold zephyr.bin, zephyr.bin is copied to the sdcard by mounting the sdcard to Linux PC. Could west flash support writing fat partition of a sdcard? Actually we have yocto Linux for image generating.

Copy link
Contributor

@hakehuang hakehuang Mar 12, 2021

Choose a reason for hiding this comment

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

@MrVan west does not support fat partition write, it is a different way. It may not be officially defined to use west flash, but basically we expect to have an easy to use solution. Besides if there no debuger tools supported, how users suppose to debug the program? IMHO, it is not a good enough enablement.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MrVan west does not support fat partition write, it is a different way. It may not be officially defined to use west flash, but basically we expect to have an easy to use solution. Besides if there no debuger tools supported, how users suppose to debug the program? IMHO, it is not a good enough enablement.

I disagree. U-Boot + SD is indeed an easy solution to use in this case (and pretty standard when dealing with AArch64 boards, much more common than having a J-Link available) and you cannot expect that everybody has access to a debugger / J-Link or that every board has a debug port easily accessible. So, this enablement is good enough for merging.

Now, that said @MrVan, can you add what suggested here #32694 (comment) so that west flash can be used when a debugger is available? This doesn't prevent the user from using U-Boot and the method you already described.

Please, also update the documentation describing both the methods.

@Mani-Sadhasivam
Copy link
Member

@MrVan FWIW, I worked on this a while ago but never managed to clean it up and submit the PR:
https://github.com/Mani-Sadhasivam/zephyr/commits/jailhouse

I had to modify the GIC driver to support GIC v2.

@MrVan
Copy link
Contributor Author

MrVan commented Mar 8, 2021

@MrVan FWIW, I worked on this a while ago but never managed to clean it up and submit the PR:
https://github.com/Mani-Sadhasivam/zephyr/commits/jailhouse

I had to modify the GIC driver to support GIC v2.

Wow. what usecases you are making zephyr on Jailhouse for?

@MrVan MrVan force-pushed the 8mm-v1 branch 4 times, most recently from 542e890 to 90ca497 Compare March 9, 2021 07:13
@MrVan
Copy link
Contributor Author

MrVan commented Mar 9, 2021

updated, please help check.

@carlocaione
Copy link
Contributor

@MrVan I don't think that's needed. Can you rebase? I'll try to push this.

@carlocaione carlocaione dismissed stale reviews from Mani-Sadhasivam and galak January 24, 2022 08:03

stale

@carlocaione carlocaione self-assigned this Jan 24, 2022
@MaureenHelm
Copy link
Member

@galak,

@MaureenHelm we need to figure out how to handle the drivers for this. I don't think it makes sense to have duplicated HAL & non-HAL drivers. Doubles our support efforts.

Is this comment/block still valid?

This comment has been addressed

Since no response. I am not sure people still happy to review this one year pending PR. I would create a new PR to restart the work.

Agree with @carlocaione , please rebase this PR instead.

Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

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

A few questions

@MrVan MrVan force-pushed the 8mm-v1 branch 2 times, most recently from 93cfa87 to 0cbe1ea Compare February 8, 2022 03:53
@MrVan
Copy link
Contributor Author

MrVan commented Feb 8, 2022

@carlocaione @MaureenHelm sorry for late reply, just back from vocation. I have addressed all the comments.

@carlocaione carlocaione requested a review from gmarull February 8, 2022 08:29
MrVan added 6 commits February 8, 2022 18:41
Add minimal SoC support for the NXP i.MX8M Mini series Cortex-A53 Core.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Add i.MX8MM A53 device tree

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Add i.MX8MM EVK A53 board support.
Zephyr is kicked from NS-EL1 U-Boot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
This is to let zephyr run in an inmate cell on top of Jailhouse
hypervisor.

The step as below:
jailhouse enable imx8mm.cell
ailhouse cell create imx8mm-zephyr.cell
jailhouse cell load 1 zephyr.bin -a 0x93c00000
jailhouse cell start 1

Currently we have not use loader to kick zephyr, later we will
use jailhouse loader to kick zephyr.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Update CODEOWNERS for i.MX8MM

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Because we currently use RAM_CONSOLE for now, and there is actually
no device in the build, so there is twister build failure,
add a dummy file to avoid build failure.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
@MrVan
Copy link
Contributor Author

MrVan commented Feb 9, 2022

@carlocaione @MaureenHelm Ready for merge now?

@carlocaione
Copy link
Contributor

@carlocaione @MaureenHelm Ready for merge now?

Yes, but we are in stabilization period now. This will be merged when 3.0 will be released.

Comment on lines +34 to +41
DT_REG_ADDR(DT_INST(0, nxp_imx_ana)),
DT_REG_SIZE(DT_INST(0, nxp_imx_ana)),
MT_DEVICE_nGnRnE | MT_P_RW_U_RW | MT_NS),

MMU_REGION_FLAT_ENTRY("UART",
DT_REG_ADDR(DT_INST(1, nxp_imx_iuart)),
DT_REG_SIZE(DT_INST(1, nxp_imx_iuart)),
MT_DEVICE_nGnRnE | MT_P_RW_U_RW | MT_NS),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hard-coded instance numbers like this are incorrect to use. Please use an alternate mechanism to specify exactly the nodes you want. Read the DT_INST docstring for more details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could we use a follow up patch to address this? I just follow qemu platform here. @carlocaione do you have any suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

Considering the amount of time this PR has been in an open state (1 year), I think we should merge this and follow up with PRs for fixing issues like this. @mbolivar-nordic what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, sorry, I don't want to see incorrect usage of the instance API merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mbolivar-nordic I am not experts in zephyr, so any suggestions what I should use?

@MrVan
Copy link
Contributor Author

MrVan commented Mar 4, 2022

A bit werid, I have updated my 8mm-v1 branch, but this PR not update automatically.

@MrVan
Copy link
Contributor Author

MrVan commented Mar 4, 2022

A bit werid, I have updated my 8mm-v1 branch, but this PR not update automatically.

I am not sure why PR not update automatically. what could I do here? Close this PR and reopen a new one?

@stephanosio
Copy link
Member

A bit werid, I have updated my 8mm-v1 branch, but this PR not update automatically.

I am not sure why PR not update automatically. what could I do here? Close this PR and reopen a new one?

@MrVan It looks like something broke on the GitHub side -- we have seen the same issue in other PRs lately. Please open a new PR.

@MrVan MrVan mentioned this pull request Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs area: Boards area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree area: Documentation DNM This PR should not be merged (Do Not Merge) manifest manifest-hal_nxp platform: NXP NXP

Projects

None yet

Development

Successfully merging this pull request may close these issues.