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

Jailhouse GPIO #1

Open
majidBahmanigbt opened this issue Oct 18, 2023 · 2 comments
Open

Jailhouse GPIO #1

majidBahmanigbt opened this issue Oct 18, 2023 · 2 comments

Comments

@majidBahmanigbt
Copy link

Hi,

Hope you are all well.

I am working on the jailhouse of IMX8MP-EVK. I can enable the jailhouse and test the sample binary files. However, when I add GPIO to the code, the jailhouse enables properly but it doesn't work. Could you please tell me if there is any code modification requires in this regard?

I use:
    RTOS : freertos
    LINUX DEVICE TREE :   imx8mp-evk-harpoon.dtb, imx8mp-evk-harpoon-industrial.dtb
    PIN: GPIO5_9  

code: https://github.com/majidBahmanigbt/Jailhouse_GPIO_Test/blob/master/freertos/main.c
harpoon_set_configuration.sh: https://github.com/majidBahmanigbt/Jailhouse_GPIO_Test/blob/master/harpoon_set_configuration.sh

Thank you in advance for your help.

@sviaunxp
Copy link
Contributor

Hi @majidBahmanigbt,

You may want to raise your question to community.nxp.com for a proper support from NXP.

In the meantime, note that if you want to use a peripheral such as GPIO5, this peripheral must be

  1. accessible in the RTOS cell
  2. MMU-mapped within the RTOS cell's config
  3. (eventually disabled in the Linux DTB to avoid conflict)

In your case,
(1) should be OK because you seem to use the imx8mp-harpoon-freertos-industrial.cell config, which allows the GPIO5 access from the RTOS cell at the hypervisor level:

$ grep -e INDUS_MEMORY_REGIONS -e GPIO5 configs/arm64/imx8mp-rtos.h
#define RTOS_INDUS_MEMORY_REGIONS \
        MMIO_REGION_RWS(0x30240000, 0x30240000, KB(64)),   /* GPIO5 */  \

(2) doesn't seem to be respected. I do not see in your code any reference to GPIO5 base address MMU mapping. You may take the industrial application MMU_Init() function as example:
BOARD_InitMemory() -> MMU_init() --> uses MMU_REGIONS --> uses APP_MMU_ENTRIES

Looking forward to helping you in the NXP Community portal!

Thanks,
Stephane.

@majidBahmanigbt
Copy link
Author

Thank you very much. Now it works.

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

No branches or pull requests

2 participants