This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3358: Building custom zImage with PRU support with buildroot for AM335x SoC

Part Number: AM3358

Tool/software: Linux

I am building custom config zImage for BeagleBone Black compatible board. Can't get something in /sys/class/remoteproc/, it is always empty (though I think I've enabled everything in buildroot, linux and device tree).

lsmod shows:

rpmsg_pru              16384  0
rpmsg_core             16384  1 rpmsg_pru
pru_rproc              20480  0
pruss_intc             16384  1 pru_rproc
pruss                  16384  1 pru_rproc
remoteproc             36864  1 pru_rproc
virtio                 16384  1 remoteproc
virtio_ring            24576  1 remoteproc

My device tree source file fragments responsible for PRUSS:

               pruss_ocp_gclk {
                    #clock-cells = <0x0>;
                    compatible = "ti,mux-clock";
                    clocks = <0x10 0x11>;
                    reg = <0x530>;
                };


                mbox_pru0 {
                    ti,mbox-tx = <0x2 0x0 0x0>;
                    ti,mbox-rx = <0x3 0x0 0x0>;
                    linux,phandle = <0x4a>;
                    phandle = <0x4a>;
                 };

                 mbox_pru1 {
                     ti,mbox-tx = <0x4 0x0 0x0>;
                     ti,mbox-rx = <0x5 0x0 0x0>;
                     linux,phandle = <0x4b>;
                     phandle = <0x4b>;
                 };

pruss@4a300000 {
            compatible = "ti,am3352-pruss";
            ti,hwmods = "pruss";
            reg = <0x4a300000 0x2000 0x4a302000 0x2000 0x4a310000 0x3000 0x4a320000 0x2000 0x4a326000 0x2000>;
            reg-names = "dram0", "dram1", "shrdram2", "intc", "cfg";
            interrupts = <0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b>;
            #address-cells = <0x1>;
            #size-cells = <0x1>;
            ranges;

        mdio@4a332400 {
            reg = <0x4a332400 0x90>;
            compatible = "ti,davinci_mdio";
            clock-names = "fck";
            clocks = <0x12>;
            status = "disabled";
            #address-cells = <0x1>;
            bus_freq = <0xf4240>;
            phandle = <0xd5>;
            #size-cells = <0x0>;
            linux,phandle = <0xd5>;
          };


          intc@4a320000 {
            reg = <0x4a320000 0x2000>;
            interrupts = <0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b>;
            reg-names = "intc";
            compatible = "ti,am3352-pruss-intc";
            interrupt-names = "host2", "host3", "host4", "host5", "host6", "host7", "host8", "host9";
            #interrupt-cells = <0x1>;
            phandle = <0xd1>;
            interrupt-controller;
            linux,phandle = <0xd1>;
          };

        pru@4a334000 {
            compatible = "ti,am3352-pru-rproc";
            reg = <0x4a334000 0x2000 0x4a322000 0x400 0x4a322400 0x100>;
            reg-names = "iram", "control", "debug";
            mboxes = <0x27 0x4a>;
        };

        pru@4a338000 {
            compatible = "ti,am3352-pru-rproc";
            reg = <0x4a338000 0x2000 0x4a324000 0x400 0x4a324400 0x100>;
            reg-names = "iram", "control", "debug";
            mboxes = <0x27 0x4b>;
        };
    };

find /lib/ -name rpm shows:

/lib/modules/4.14.40/kernel/drivers/rpmsg
/lib/modules/4.14.40/kernel/drivers/rpmsg/rpmsg_char.ko
/lib/modules/4.14.40/kernel/drivers/rpmsg/virtio_rpmsg_bus.ko
/lib/modules/4.14.40/kernel/drivers/rpmsg/qcom_glink_rpm.ko
/lib/modules/4.14.40/kernel/drivers/rpmsg/rpmsg_core.ko
/lib/modules/4.14.40/kernel/drivers/rpmsg/rpmsg_pru.ko
/lib/modules/4.14.40/kernel/drivers/rpmsg/rpmsg-rpc.ko

find /lib/ -name pru shows:

/lib/modules/4.14.40/kernel/drivers/rpmsg/rpmsg_pru.ko
/lib/modules/4.14.40/kernel/drivers/uio/uio_pruss.ko
/lib/modules/4.14.40/kernel/drivers/net/ethernet/ti/ti_prueth.ko
/lib/modules/4.14.40/kernel/drivers/remoteproc/pruss_intc.ko
/lib/modules/4.14.40/kernel/drivers/remoteproc/pru_rproc.ko
/lib/modules/4.14.40/kernel/drivers/remoteproc/pruss_soc_bus.ko
/lib/modules/4.14.40/kernel/drivers/remoteproc/pruss.ko
/lib/firmware/pru

ls /sys/firmware/devicetree/base/ocp/pruss@4a300000/pru@4a338000/ shows:

#address-cells  compatible      interrupts      name            pru@4a338000    reg             ti,hwmods
#size-cells     intc@4a320000   mdio@4a332400   pru@4a334000    ranges          reg-names

I tried to use prebuild images from TI processor SDK for am335x SoC and compare the settings, but I didn't manage to start the images. Any suggestions of how to overcome this issue?

  • Hello Andrey,

    In your Linux Processor SDK 5.0, please reference board-support/linux.../arch/arm/boot/dts/am335x-boneblack.dts and the other dts and dtsi files that am335x-boneblack.dts includes. Just from scanning through the files, it looks like you want to enable pruss_soc_bus by setting status = "okay"; as seen in am335x-bone-common.dtsi. pruss also needs to be enabled.

    There might be other things that need to get adjusted in your device tree. Look at those dts files as your template.

    Regards,
    Nick
  • I've tried to start my zImage with am335x-boneblack-pru-adc.dtb from Proccessor SDK, but still no luck... /sys/class/remoteproc is empty... I also tried to start all the kernel modules that listed in the question, it didn't help... So the problem seems to be in my zImage?
  • I've solved the problem!) You were right, I was lack of proper pruss definition in the device tree, I used one from am335x-boneblack-pru-adc.dts and I also needed to start pruss_soc_bus module and now everything works fine! Thanks!)