GPT_0 owned by ATF partition

cancel
Showing results for 
Search instead for 
Did you mean: 

GPT_0 owned by ATF partition

601 Views
thierry_durand
Contributor II

Hi all,

Our imx8qm application requires that an M4 core uses the LSIO GPT_0 timer together with its CAPTURE input. I'm currently unable to assign this timer to an M4 partition. It's the only peripheral in this case as I've been able to get hold of almost any other resource either at boot-time or run-time.

After some investigation (rm_dump and others), I've discovered that the GPT_0 (but not its pads) is assigned to the ATF partition (ID 1) very early in the boot process. By very early, I mean earlier than I've been able to trace. I've found an inline comment basically saying that this GPT_0 is reserved "for use by Linux".

More investigation: the GPT_0 is declared in the Linux device tree, but I've been unable to identify which specific feature uses it. As far as I can tell, the timer is reserved but left alone.

So this raises a series of questions:

- what specific Linux feature uses GPT_0?

- when/where is GPT_0 assigned to partition 1 (ATF)?

- where is the best place to modify this behavior and be let GPT_0 be used by an M4?

There are other unused timers in our application, e.g. GPT_2 which could possibly be swapped with GPT_0 if a timer is really needed somewhere.

Thank you for shedding some light on this issue which is critical to our application.

Best regards,

--

TD

0 Kudos
6 Replies

528 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Thierry

gpt0 is used by m4 in SDK MEK-MIMX8QM available on Welcome | MCUXpresso SDK Builder 

for example in ..driver_examples/sai/interrupt/cm4_core0/sai_interrupt.c

So one can use appropriate dts with m4:

fsl-imx8qm-mek-m4.dts\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

528 Views
thierry_durand
Contributor II

Hi Igor,

Thank you for your feedback.

In the sai demo that you are referring to, the M4 doesn't actually use the GPT_0. It just configures a pad mux remotely related to GPT_0.

Indeed, I've not been able to find any GPT_0 example in the entire SDK.

Best regards,

--

TD

0 Kudos

528 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Thierry

one can try to follow "Modifying default configuration"

System Controller Firmware 101 - Resource management service 

and SCFW Porting Kit

Best regards
igor

0 Kudos

528 Views
thierry_durand
Contributor II

Hi Igor,

Already tried that. It looks like the GPT_0 is assigned to the ATF partition very early in the boot process. Possibly in a portion of the SCFW which we do not have the source of. Would you confirm this?

Thank you.

--

TD

0 Kudos

528 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Thierry

it is used in atf

imx8qm_bl31_setup.c\imx8qm\imx\plat - imx-atf - i.MX ARM Trusted firmware 

GPT0 s listed as resource "SC_R_GPT_0" in

Chapter 5 Resource List  sc_fw_api_qm_b0.pdf in SCFW Porting Kit

so you can follow examples in suggested links to assign

it to necessary partition.

There is only fsl_gpt.c driver in SDK MEK-MIMX8QM, in SDK MEK-MIMX8QXP

there are also examples with gpt.

Best regards
igor

0 Kudos

528 Views
thierry_durand
Contributor II

Some more details:

- The SCFW is left unchanged. Its source never refers to GPT_0. Attempts to customize the SCFW to make GPT_0 movable or assigned to the M4 fail. Possibly because the resource already assigned to a secure partition (1, ATF);

- The ATF manages the power of GPT_0 but is not involved in resource reservation.

--

TD

0 Kudos