iMX8MQ Linux Stops U-Boot Loaded M4 Firmware

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX8MQ Linux Stops U-Boot Loaded M4 Firmware

Jump to solution
1,126 Views
onurgoksu
Contributor II

Hi all,

I have an MCUXpresso project to control GPIO1 port and blink some LEDs connected to a custom board. I have built the binary with the default TCM+DDR configuration.

On U-Boot, I have successfully loaded and run the firmware on M4; using bootaux 0x7E00000.

Later, I found out while booting into Linux, the program stops.

There are some discussions about clock sources. So I've checked if their registers are configured correctly. I've also checked M4 SRC RCR register if the CPU is in reset. I tend to use PLL2 DIV5 according to the reference manual since it's arm_m4_core's source clock. MCUXpresso project had PLL1 DIV3 as default. After I checked the reference manual, I've switched to PLL2 DIV5. Maybe there's something to do with AHB and AXI clocks, idk.

0x3039000C: 0xA8 (After running firmware and boot)

0x303809D0: 0x32 (After running firmware and boot)

1) M4 FreeRTOS FW: 

CLOCK_SetRootDivider(kCLOCK_RootM4, 1U, 1U);
CLOCK_SetRootMux(kCLOCK_RootM4, kCLOCK_M4RootmuxSysPll2Div5); 

CLOCK_SetRootDivider(kCLOCK_RootAhb, 1U, 1U);
CLOCK_SetRootMux(kCLOCK_RootAhb, kCLOCK_AhbRootmuxSysPll1Div6);

CLOCK_SetRootDivider(kCLOCK_RootAxi, 3U, 1U);
CLOCK_SetRootMux(kCLOCK_RootAxi, kCLOCK_AxiRootmuxSysPll1); 
 
CLOCK_EnableClock(kCLOCK_Rdc);


2) In the DTS file, I have reserved TCM and DDR memories for M4 for Linux to not interfere with. Here is the imx8mq-cm4 node:

imx8mq-cm4 {
compatible = "fsl,imx8mq-cm4";
rsc-da = <0xb8000000>;
clocks = <&clk IMX8MQ_CLK_M4_DIV>;
mbox-names = "tx", "rx", "rxdb";
mboxes = <&mu 0 1
          &mu 1 1
          &mu 3 1>;
memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>, <&m4_tcm_reserved>, <&m4_ddr_reserved>;
syscon = <&src>;
fsl,startup-delay-ms = <50000>; // Experimental, maybe it could delay the occuring interference with M4
status = "disabled"; // Prevent Linux from interfering with M4
 };


I'm planning to support RPMessage too, that's why I need this configuration.

Basically, I'm going to need to start the M4 firmware on U-boot, check the M4 core's status and communicate with the core on Linux. What am I missing?

Thanks,

Onur

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,053 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Thank you for sharing, please try setting the following variable in uboot:

> setenv mmcargs "${mmcargs} clk_ignore_unused"

After this try to boot into Linux and share if the issue persist.

Best regards/Saludos,
Aldo.

View solution in original post

0 Kudos
Reply
5 Replies
1,071 Views
onurgoksu
Contributor II

I find about a command called "prepare_mcore" on U-Boot according to this document: https://www.nxp.com/docs/en/application-note/AN5317.pdf

Might be the problem?

Regards,

Onur

0 Kudos
Reply
1,100 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

By default, NXP Linux BSP keeps the root clock enabled for the M core when it is started from U-Boot.

Could you share the Linux version that you're using?
When you mentioned that it stops its only the M4 right?
Linux continue to work correctly?
Also, on your device tree did you disable the peripherals being used on the M4?

Best regards/Saludos,
Aldo.

0 Kudos
Reply
1,084 Views
onurgoksu
Contributor II

Hello Aldo,

Thank you for the answer.

1. The kernel version is 6.6.36

2. Yes, it only stops the M4 firmware.

3. Linux continues to run.

4. The firmware is only accessing GPIO1 port and it's disabled in the DTS file.

Regards,

Onur

0 Kudos
Reply
1,054 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Thank you for sharing, please try setting the following variable in uboot:

> setenv mmcargs "${mmcargs} clk_ignore_unused"

After this try to boot into Linux and share if the issue persist.

Best regards/Saludos,
Aldo.

0 Kudos
Reply
941 Views
onurgoksu
Contributor II

Hello Aldo,

Thanks a lot! This indeed solved the issue.

Regards,

Onur