I am having similar problem when trying to run the program using remoteproc
when I run the sample code of echo str with linker script for internal ram. it loads and run fine.
when trying to run sample code of echo str with linker script for ddr. i get the following message from kernel
bad phdr da 0x80000000 mem 0x240
the dts file is imx8mn-ddr4-evk-rpmsg.dts defintions are:
{
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
m_core_reserved: m_core@80000000 {
no-map;
reg = <0 0x80000000 0 0x1000000>;
};
vdev0vring0: vdev0vring0@b8000000 {
reg = <0 0xb8000000 0 0x8000>;
no-map;
};
vdev0vring1: vdev0vring1@b8008000 {
reg = <0 0xb8008000 0 0x8000>;
no-map;
};
rsc_table: rsc-table@b80ff000 {
reg = <0 0xb80ff000 0 0x1000>;
no-map;
};
vdevbuffer: vdevbuffer@b8400000 {
compatible = "shared-dma-pool";
reg = <0 0xb8400000 0 0x100000>;
no-map;
};
};
I have modified imx_rpmsg.c to align with the linker file and the dts:
static const struct imx_rproc_att imx_rproc_att_imx8mn[] = {
/* dev addr , sys addr , size , flags */
/* ITCM */
{ 0x00000000, 0x007E0000, 0x00020000, ATT_OWN | ATT_IOMEM },
/* OCRAM_S */
{ 0x00180000, 0x00180000, 0x00009000, 0 },
/* OCRAM */
{ 0x00900000, 0x00900000, 0x00020000, 0 },
/* OCRAM */
{ 0x00920000, 0x00920000, 0x00020000, 0 },
/* OCRAM */
{ 0x00940000, 0x00940000, 0x00050000, 0 },
/* QSPI Code - alias */
{ 0x08000000, 0x08000000, 0x08000000, 0 },
/* DDR (Code) - alias */
{ 0x80000000, 0x80000000, 0x1000000, 0 },
/* DTCM */
{ 0x20000000, 0x00800000, 0x00020000, ATT_OWN | ATT_IOMEM },
/* OCRAM_S - alias */
{ 0x20180000, 0x00180000, 0x00008000, ATT_OWN },
/* OCRAM */
{ 0x20200000, 0x00900000, 0x00020000, ATT_OWN },
/* OCRAM */
{ 0x20220000, 0x00920000, 0x00020000, ATT_OWN },
/* OCRAM */
{ 0x20240000, 0x00940000, 0x00040000, ATT_OWN },
/* DDR (Data) */
{ 0x80200000, 0x80200000, 0x00200000, 0 },
I still get the same error. when trying to run the sample with ddr linker script
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x80000000, LENGTH = 0x00000240
m_text (RX) : ORIGIN = 0x80000240, LENGTH = 0x001FFDC0
m_data (RW) : ORIGIN = 0x80200000, LENGTH = 0x00200000
m_data2 (RW) : ORIGIN = 0x80400000, LENGTH = 0x00C00000
}