Hi,
I was trying to run IMX7 M4 in DDR memory, I made the following changes in the device tree, MAKEFILE, and m4_ddr_ld files,
Device tree:
memory {
linux,usable-memory = <0x80200000 0x1ff00000>,
<0xa0000000 0x1ff00000>;
};
cortexm4:cortexm4@80000000 {
reg = <0x80000000 0x200000>;
};
};
imx7d-cm4 {
compatible = "fsl,imx7d-cm4";
syscon = <&src>;
clocks = <&clks IMX7D_ARM_M4_ROOT_CLK>;
memory-region = <&cortexm4>;
};
make file:
I edited the make file from this location arch/arm/Makefile
-textofs-y := 0x00008000
+textofs-y := 0x00208000
MCIMX7D_M4_ddr.ld:
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x80000000, LENGTH = 0x00000240
m_text (RX) : ORIGIN = 0x80000240, LENGTH = 0x00007DC0
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
arm gcc version - 7.2.1 20170904
unfortunately, m4 failed to boot and print the following error message,
root@imx7dsabresd:~# echo start > /sys/class/remoteproc/remoteproc0/state
[ 127.772894] remoteproc remoteproc0: powering up imx-rproc
[ 127.779460] remoteproc remoteproc0: Booting fw image hello_world_ddr.elf, size 152084
[ 127.787571] remoteproc remoteproc0: Boot failed: -22
sh: write error: Invalid argument
could anyone help me to make it work !?
Hello,
I don't know which kernel version you’re using for your test, but you may take our i.MX7D SDB device tree as reference
https://github.com/nxp-imx/linux-imx/blob/lf-5.15.y/arch/arm/boot/dts/imx7d-sdb-m4.dtsi
Best regards,
Aldo.
Hi Aldo,
Sorry for the late reply, I am using linux-imx v5.10.72, and my goal is to run M4 binary using DDR memory.
I can load M4 hello world pre-built binary (imx8mq_m4_TCM_hello_world.elf) via remoteproc, it seems this pre-built binary loaded into TCM memory. In the same way, I tried to boot M4 on ddr memory, I changed ld file of helloworld demo and the device tree file to load the M4 binary, but the M4 boot failed with the following error.
root@imx7dsabresd:~# echo start > /sys/class/remoteproc/remoteproc0/state
[ 127.772894] remoteproc remoteproc0: powering up imx-rproc
[ 127.779460] remoteproc remoteproc0: Booting fw image hello_world_ddr.elf, size 152084
[ 127.787571] remoteproc remoteproc0: Boot failed: -22
sh: write error: Invalid argument
ld file changes:
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x80000000, LENGTH = 0x00000240
m_text (RX) : ORIGIN = 0x80000240, LENGTH = 0x00007DC0
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
Regards,
Raveen