cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
393 Views
Registered: ‎08-10-2018

[2019.1] UG1186 Ch 2 demo - Client does not receive kick from Server

Jump to solution

All my testing is done on a ZCU104 board.

I have previously successfully completed the entire UG1186 with the 2018.2 tools.

Now I must migrate to 2019.1 due to product support reasons.

I understand the device tree has changed in 2019.1

First of all, the 2019.1 version of UG1186 still shows the old device tree definition.  I copied in the new openamp.dtsi template from the project-spec/meta-user/recipes-bsp/device-tree/files directory.  Using just this overlay, the IPI and SHM devices did not get created.  So, I created an amba section.  My complete system-user.dtsi file follows:

/include/ "system-conf.dtsi"
/ {
  reserved-memory {
    #address-cells = <2>;
    #size-cells = <2>;
    ranges;
    rproc_0_dma: rproc@3ed800000 {
      no-map;
      compatible = "shared-dma-pool";
      reg = <0x0 0x3ed80000 0x0 0x1000000>;
    };
    rproc_0_reserved: rproc@3ed000000 {
      no-map; 
      reg = <0x0 0x3ed00000 0x0 0x80000>;
    };
  };
    
  zynqmp-rpu {
    compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
    #address-cells = <2>;
    #size-cells = <2>;
    ranges;
    core_conf = "split";
    r5_0: r5@0 {
      #address-cells = <2>;
      #size-cells = <2>;
      ranges;
      memory-region = <&rproc_0_reserved>, <&rproc_0_dma>;
      pnode-id = <0x7>;
      mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
      mbox-names = "tx", "rx";
      tcm_0_a: tcm_0@0 {
        reg = <0x0 0xFFE00000 0x0 0x10000>;
        pnode-id = <0xf>;
      };
      tcm_0_b: tcm_0@1 {
        reg = <0x0 0xFFE20000 0x0 0x10000>;
        pnode-id = <0x10>;
      };
    };
  };
    
  zynqmp_ipi1 {
    compatible = "xlnx,zynqmp-ipi-mailbox";
    interrupt-parent = <&gic>;
    interrupts = <0 29 4>;
    xlnx,ipi-id = <7>;
    #address-cells = <1>;
    #size-cells = <1>;
    ranges; 
    /* APU(PL0)<->RPU0 IPI mailbox controller */
    /* p326 UG1085 */
    ipi_mailbox_rpu0: mailbox@ff90600 {
      reg = <0xff990600 0x20>,
            <0xff990620 0x20>,
            <0xff9902c0 0x20>,
            <0xff9902e0 0x20>;
      reg-names = "local_request_region",
            "local_response_region",
            "remote_request_region",
            "remote_response_region";
      #mbox-cells = <1>;
      xlnx,ipi-id = <1>; 
    };
  };
  zynqmp_ipi2 {
    compatible = "xlnx,zynqmp-ipi-mailbox";
    interrupt-parent = <&gic>;
    interrupts = <0 30 4>;
    xlnx,ipi-id = <8>;
    #address-cells = <1>;
    #size-cells = <1>;
    ranges;
    /* APU(PL1)<->RPU1 IPI mailbox controller */
    ipi_mailbox_rpu1: mailbox@ff990800 {
      reg = <0xff990800 0x20>,
            <0xff990820 0x20>,
            <0xff990440 0x20>,
            <0xff990460 0x20>;
      reg-names = "local_request_region",
            "local_response_region",
            "remote_request_region",
            "remote_response_region";
      #mbox-cells = <1>;
      xlnx,ipi-id = <2>;
    };
  };

  amba {
    /* Shared memory */
    shm0: shm@0 {
      compatible = "shm_uio";
      reg = <0x0 0x3ed80000 0x0 0x1000000>;
    };
    /* IPI device, PL0 */
    ipi_amp: ipi@ff340000 {
      compatible = "ipi_uio";
      reg = <0x0 0xff340000 0x0 0x1000>;
      interrupt-parent = <&gic>;
      interrupts = <0 31 4>;
    };
  };
};
&ttc0 {
  compatible = "ttc0";
  status = "okay";
};

First question - Is this the correct way to get the IPI and SHM devices created in 2019.1 ?

Second question - The IPI mailboxes.  Based on the values I read out of Table 13-3 in UG1085, I changed the values in red text from what came in the openamp overlay.  Are my changes actually correct?  (The demo hangs in the same place both before and after my changes.)

 

When I run the demo, the first "shared memory" demo runs successfully, but then the demos requiring IPI hang where the Client is waiting to be kicked by the Server.  So far I've tried the first 2 IPI demos the "atomic operation over shared memory" and the "IPI and shared memory" demo.

I've added enough diagnostics to know the demos hang where the Client is sitting in the wait_for_notified() function.  The Client's interrupt service routines never get called.

So, that means that the Server does get the kicks from the Client, so the IPI does work in this direction.

I've checked and re-checked the addresses I've used for the IPI - and other associated values.  I don't understand why the Client doesn't receive the Server's kick.  I can see the Server issue the kick.

Here are the relevant defines from the Client/APU's common.h:

#define BUS_NAME        "platform"
#define IPI_DEV_NAME    "ff340000.ipi"
#define SHM_DEV_NAME    "3ed80000.shm"
#define TTC_DEV_NAME    "ff110000.timer"

#define IPI_MASK        0x100 /* IPI mask for kick from RPU. */

and from the Server/RPU's common.h:

#define BUS_NAME        "generic"
#define IPI_DEV_NAME    "ff310000.ipi"
#define SHM_DEV_NAME    "3ed80000.shm"
#define TTC_DEV_NAME    "ff110000.ttc"

#define IPI_MASK        0x1000000 /* IPI mask for kick from APU.
				     We use PL0 IPI in this demo. */

I know the Device Names are important for the APU.  It seems to me the Device Names have no particular value for the RPU - it's the addresses in the device table used in sys_init.c that matter, speaking of which, here are the relevant defines from the RPU sys_init.c:

#define INTC_DEVICE_ID		XPAR_SCUGIC_0_DEVICE_ID

// IRQ number for IPI_Ch1, the default channel for RPU0
#define IPI_IRQ_VECT_ID         65

#define SHM_BASE_ADDR   0x3ED80000
#define TTC0_BASE_ADDR  0xFF110000
#define IPI_BASE_ADDR   0xFF310000

If it matters, I actually have 2019.1.3 of the Vivado Suite to go with 2019.1 of Petalinux.

 

Is there anything else that changed between 2018.2 and 2019.1 that I need to be aware of?

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
329 Views
Registered: ‎05-10-2017

Re: [2019.1] UG1186 Ch 2 demo - Client does not receive kick from Server

Jump to solution

It seems like you are trying to run the libmetal demo. The device-tree for that is shown below

 

/include/ "system-conf.dtsi"
/{
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
rproc_0_reserved: rproc@3ed000000 {
no-map;
reg = <0x0 0x3ed00000 0x0 0x2000000>;
};
};
amba {
/* Shared memory */
shm0: shm@0 {
compatible = "shm_uio";
reg = <0x0 0x3ed80000 0x0 0x1000000>;
};
/* IPI device */
ipi_amp: ipi@ff340000 {
compatible = "ipi_uio";
reg = <0x0 0xff340000 0x0 0x1000>;
interrupt-parent = <&gic>;
interrupts = <0 29 4>;
};
zynqmp-rpu {
compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
#address-cells = <2>;
#size-cells = <2>;
ranges;
core_conf = "split";

r5_0: r5@0 {
#address-cells = <2>;
#size-cells = <2>;
ranges;
pnode-id = <0x7>;

tcm_0_a: tcm_0@0 {
reg = <0x0 0xFFE00000 0x0 0x10000>;
pnode-id = <0xf>;
};
tcm_0_b: tcm_0@1 {
reg = <0x0 0xFFE20000 0x0 0x10000>;
pnode-id = <0x10>;
};
};
};
};
};
&ttc0 {
compatible = "ttc0";
status = "okay";
};

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

0 Kudos
5 Replies
Highlighted
Moderator
Moderator
330 Views
Registered: ‎05-10-2017

Re: [2019.1] UG1186 Ch 2 demo - Client does not receive kick from Server

Jump to solution

It seems like you are trying to run the libmetal demo. The device-tree for that is shown below

 

/include/ "system-conf.dtsi"
/{
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
rproc_0_reserved: rproc@3ed000000 {
no-map;
reg = <0x0 0x3ed00000 0x0 0x2000000>;
};
};
amba {
/* Shared memory */
shm0: shm@0 {
compatible = "shm_uio";
reg = <0x0 0x3ed80000 0x0 0x1000000>;
};
/* IPI device */
ipi_amp: ipi@ff340000 {
compatible = "ipi_uio";
reg = <0x0 0xff340000 0x0 0x1000>;
interrupt-parent = <&gic>;
interrupts = <0 29 4>;
};
zynqmp-rpu {
compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
#address-cells = <2>;
#size-cells = <2>;
ranges;
core_conf = "split";

r5_0: r5@0 {
#address-cells = <2>;
#size-cells = <2>;
ranges;
pnode-id = <0x7>;

tcm_0_a: tcm_0@0 {
reg = <0x0 0xFFE00000 0x0 0x10000>;
pnode-id = <0xf>;
};
tcm_0_b: tcm_0@1 {
reg = <0x0 0xFFE20000 0x0 0x10000>;
pnode-id = <0x10>;
};
};
};
};
};
&ttc0 {
compatible = "ttc0";
status = "okay";
};

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

0 Kudos
Highlighted
Adventurer
Adventurer
323 Views
Registered: ‎08-10-2018

Re: [2019.1] UG1186 Ch 2 demo - Client does not receive kick from Server

Jump to solution

That is the device tree for the 2018 version of Petalinux.

I did try it first.  The remoteproc directory does not get populated when you use that definition of the device tree.

 

0 Kudos
Highlighted
Moderator
Moderator
312 Views
Registered: ‎05-10-2017

Re: [2019.1] UG1186 Ch 2 demo - Client does not receive kick from Server

Jump to solution

Could you share our boot log please? I see it come up in 2019.1

root@xilinx-zcu102-2019_1:~# dmesg | grep remoteproc
[    6.389981] zynqmp_r5_remoteproc amba:zynqmp-rpu: RPU core_conf: split
[    6.410611] remoteproc remoteproc0: r5@0 is available

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Adventurer
Adventurer
287 Views
Registered: ‎08-10-2018

Re: [2019.1] UG1186 Ch 2 demo - Client does not receive kick from Server

Jump to solution

I need to apologize.  The dtsi file you posted was not the one from 2018.  I just saw the giant amba section and the old reserved-memory section and didn't look further.

Your dtsi file is indeed the correct one for the Ch 2 demo.  It now works.

I do need to point out, however, that that combination of devices layed out in that fashion is nowhere to be found, certainly not in the 2019.1 version of UG1186.  It's not even in the OpenAMP 2019.1 wiki.

 

It took me so long to respond because flashing my qspi from the SDK is not finishing the verify anymore, when the only change I made was changing to your dtsi file and re-packaging BOOT.bin.  Ultimately, I ran the demo without waiting for the verify to complete.

I am rebuilding my petalinux after doing a mrproper now.  Hopefully that'll fix the verify of the flash.

0 Kudos
Highlighted
Adventurer
Adventurer
238 Views
Registered: ‎08-10-2018

Re: [2019.1] UG1186 Ch 2 demo - Client does not receive kick from Server

Jump to solution

Is there a document which describes manually writing dtsi files?

I've found some information on the DTG, but that's not what I'm after, since the automatic device tree generation does not know what the user's intent with the PL is.

Where is it described how to build a proper device definition?  Where is it described how the device tree has changed from iteration to iteration of Petalinux?

 

0 Kudos