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.

TDA4VM: Can we start main R5f0_0 & r5f0_1 in uboot on psdkla sdk7.2?

Part Number: TDA4VM


Hi, 

   This case is following the old case https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1029131/tda4vm-how-to-disalbe-auto-boot-to-boot-core0-and-core1-from-userspace-in-that-order/3806064?tisearch=e2e-sitesearch&keymatch=%20user%3A478089#3806064.

   We hope to start the SRV application as early as possible. The SRV  depends on the main r5f0_0,   According to the source code , the r5f0_0 boot up by k3_r5_rproc_start who called by rproc firmwork. 

Below is our startup timeline:

0s        :start kernel

0.9s     : systemd[1]: Starting Coldplug All udev Devices...

1.3s     :k3-dsp-rproc and k3_r5_rproc

1.6       :remote processor 5c00000.r5f is now up

1.9       :virtio_rpmsg_bus virtio3: creating channel rpmsg-kdrv addr 0x1a

3.6       :virtio_rpmsg_bus virtio3: creating channel ti.ipc4.ping-pong addr 0xe

virtio3 is for r5f0_1 5c00000.r5f .

The fw of r5f0_0 and r5f0_1 are loaded in uboot by ipc-only mode,  the c66 c71 dsp fw are loaded by remoteproc driver in remoteproc mode. 

Our linux do init with systemd,   please give us some suggestions about: 

1. could we start r5 in uboot to save time ?

2. how to boot r5 as early as possible in kernel?

Thanks.

The following the our dmesg log:

[2021-08-31 10:59:34.526] [    0.309486] Run /sbin/init as init process
[2021-08-31 10:59:34.567] [    0.427866] systemd[1]: System time before build time, advancing clock.
[2021-08-31 10:59:34.567] [    0.458901] NET: Registered protocol family 10
[2021-08-31 10:59:34.567] [    0.459262] Segment Routing with IPv6
[2021-08-31 10:59:34.567] [    0.471653] systemd[1]: systemd 246 running in system mode. (-PAM -AUDIT -SELINUX -IMA -APPARMOR -SMACK -SYSVINIT -UTMP -LIBCRYPTSETUP +GCRYPT +GNUTLS -ACL +XZ -L)
[2021-08-31 10:59:34.568] [    0.471819] systemd[1]: Detected architecture arm64.
[2021-08-31 10:59:34.610] [    0.509922] systemd[1]: Set hostname to <buildroot>.
[2021-08-31 10:59:34.610] [    0.578604] systemd[1]: multi-user.target: Wants dependency dropin /etc/systemd/system/multi-user.target.wants/daemon_watch.service_original is not a symlink, ign.
[2021-08-31 10:59:34.611] [    0.594425] systemd[1]: sysinit.target: Wants dependency dropin /etc/systemd/system/sysinit.target.wants/daemon_watch.service is not a symlink, ignoring.
[2021-08-31 10:59:34.612] [    0.630805] systemd[1]: Configuration file /etc/systemd/system/daemon_watch.service is marked executable. Please remove executable permission bits. Proceeding any.
[2021-08-31 10:59:34.653] [    0.631153] systemd[1]: /etc/systemd/system/daemon_watch.service:10: Support for option SysVStartPriority= has been removed and it is ignored
[2021-08-31 10:59:34.654] [    0.631339] systemd[1]: Configuration file /etc/systemd/system/boot_test.service is marked executable. Please remove executable permission bits. Proceeding anyway.
[2021-08-31 10:59:34.655] [    0.631344] systemd[1]: Configuration file /etc/systemd/system/boot_test.service is marked world-writable. Please remove world writability permission bits. Procee.
[2021-08-31 10:59:34.696] [    0.631696] systemd[1]: /etc/systemd/system/boot_test.service:12: Support for option SysVStartPriority= has been removed and it is ignored
[2021-08-31 10:59:34.697] [    0.639800] systemd[1]: Queued start job for default target Multi-User System.
[2021-08-31 10:59:34.697] [    0.640155] random: systemd: uninitialized urandom read (16 bytes read)
[2021-08-31 10:59:34.698] [    0.640213] systemd[1]: system-serial\x2dgetty.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[2021-08-31 10:59:34.739] [    0.640217] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[2021-08-31 10:59:34.740] [    0.641393] systemd[1]: Created slice system-serial\x2dgetty.slice.
[2021-08-31 10:59:34.740] [    0.653617] random: systemd: uninitialized urandom read (16 bytes read)
[2021-08-31 10:59:34.740] [    0.653706] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[2021-08-31 10:59:34.741] [    0.669519] random: systemd: uninitialized urandom read (16 bytes read)
[2021-08-31 10:59:34.741] [    0.669591] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[2021-08-31 10:59:34.782] [    0.685623] systemd[1]: Reached target Paths.
[2021-08-31 10:59:34.782] [    0.697528] systemd[1]: Reached target Remote File Systems.
[2021-08-31 10:59:34.783] [    0.709520] systemd[1]: Reached target Slices.
[2021-08-31 10:59:34.783] [    0.721533] systemd[1]: Reached target Swap.
[2021-08-31 10:59:34.783] [    0.733748] systemd[1]: Listening on Syslog Socket.
[2021-08-31 10:59:34.784] [    0.751160] systemd[1]: Condition check resulted in Journal Audit Socket being skipped.
[2021-08-31 10:59:34.784] [    0.751499] systemd[1]: Listening on Journal Socket (/dev/log).
[2021-08-31 10:59:34.784] [    0.761732] systemd[1]: Listening on Journal Socket.
[2021-08-31 10:59:34.825] [    0.773752] systemd[1]: Listening on udev Control Socket.
[2021-08-31 10:59:34.825] [    0.785659] systemd[1]: Listening on udev Kernel Socket.
[2021-08-31 10:59:34.826] [    0.799298] systemd[1]: Mounting Huge Pages File System...
[2021-08-31 10:59:34.826] [    0.815478] systemd[1]: Mounting POSIX Message Queue File System...
[2021-08-31 10:59:34.826] [    0.831649] systemd[1]: Mounting Kernel Debug File System...
[2021-08-31 10:59:34.827] [    0.841758] systemd[1]: Condition check resulted in Kernel Trace File System being skipped.
[2021-08-31 10:59:34.827] [    0.844482] systemd[1]: Mounting Temporary Directory (/tmp)...
[2021-08-31 10:59:34.868] [    0.853962] systemd[1]: Condition check resulted in /opt/gaia/test_boot_performance.sh Compatibility being skipped.
[2021-08-31 10:59:34.869] [    0.855963] systemd[1]: Starting Create list of static device nodes for the current kernel...
[2021-08-31 10:59:34.869] [    0.875956] systemd[1]: Starting Journal Service...
[2021-08-31 10:59:34.870] [    0.896523] systemd[1]: Starting Load Kernel Modules...
[2021-08-31 10:59:34.870] [    0.911529] systemd[1]: Starting Remount Root and Kernel File Systems...
[2021-08-31 10:59:34.870] [    0.924168] systemd[1]: Starting Coldplug All udev Devices...
[2021-08-31 10:59:34.871] [    0.936080] systemd[1]: Started Journal Service.
[2021-08-31 10:59:34.911] [    1.321959] k3-dsp-rproc 4d80800000.dsp: assigned reserved memory node c66-dma-memory@a7000000
[2021-08-31 10:59:34.912] [    1.322166] k3-dsp-rproc 4d80800000.dsp: configured DSP for remoteproc mode
[2021-08-31 10:59:34.912] [    1.322330] remoteproc remoteproc0: 4d80800000.dsp is available
[2021-08-31 10:59:34.913] [    1.323021] k3-dsp-rproc 4d81800000.dsp: assigned reserved memory node c66-dma-memory@a6000000
[2021-08-31 10:59:34.913] [    1.323260] k3-dsp-rproc 4d81800000.dsp: configured DSP for remoteproc mode
[2021-08-31 10:59:34.914] [    1.323434] remoteproc remoteproc1: 4d81800000.dsp is available
[2021-08-31 10:59:34.954] [    1.323927] k3-dsp-rproc 64800000.dsp: assigned reserved memory node c71-dma-memory@a8000000
[2021-08-31 10:59:34.955] [    1.324198] k3-dsp-rproc 64800000.dsp: configured DSP for remoteproc mode
[2021-08-31 10:59:34.955] [    1.324253] remoteproc remoteproc2: 64800000.dsp is available
[2021-08-31 10:59:34.956] [    1.380577] remoteproc remoteproc0: powering up 4d80800000.dsp
[2021-08-31 10:59:34.956] [    1.380590] remoteproc remoteproc0: Booting fw image j7-c66_0-fw, size 2590432
[2021-08-31 10:59:34.956] [    1.382238] k3-dsp-rproc 4d80800000.dsp: booting DSP core using boot addr = 0xa6200000
[2021-08-31 10:59:34.997] [    1.382687]  remoteproc0#vdev0buffer: assigned reserved memory node c66-dma-memory@a7000000
[2021-08-31 10:59:34.998] [    1.382764]  remoteproc0#vdev0buffer: registered virtio0 (type 7)
[2021-08-31 10:59:34.998] [    1.382768] remoteproc remoteproc0: remote processor 4d80800000.dsp is now up
[2021-08-31 10:59:34.999] [    1.384241] platform 41000000.r5f: ti-sci processor request failed: -19
[2021-08-31 10:59:34.999] [    1.384246] platform 41000000.r5f: ti_sci_proc_request failed, ret = -19
[2021-08-31 10:59:34.999] [    1.384262] k3_r5_rproc bus@100000:bus@28380000:r5fss@41000000: k3_r5_core_of_init failed, ret = -19
[2021-08-31 10:59:35.040] [    1.384265] k3_r5_rproc bus@100000:bus@28380000:r5fss@41000000: k3_r5_cluster_of_init failed, ret = -19
[2021-08-31 10:59:35.041] [    1.386376] platform 5c00000.r5f: configured R5F for IPC-only mode
[2021-08-31 10:59:35.041] [    1.386824] platform 5c00000.r5f: assigned reserved memory node vision_apps-r5f-dma-memory@a1000000
[2021-08-31 10:59:35.042] [    1.392486] remoteproc remoteproc3: 5c00000.r5f is available
[2021-08-31 10:59:35.042] [    1.406577] platform 5d00000.r5f: configured R5F for IPC-only mode
[2021-08-31 10:59:35.042] [    1.406614] platform 5d00000.r5f: assigned reserved memory node r5f-dma-memory@a3000000
[2021-08-31 10:59:35.083] [    1.406708] remoteproc remoteproc4: 5d00000.r5f is available
[2021-08-31 10:59:35.084] [    1.407737] remoteproc remoteproc1: powering up 4d81800000.dsp
[2021-08-31 10:59:35.084] [    1.407747] remoteproc remoteproc1: Booting fw image j7-c66_1-fw, size 2590432
[2021-08-31 10:59:35.085] [    1.409280] k3-dsp-rproc 4d81800000.dsp: booting DSP core using boot addr = 0xa7200000
[2021-08-31 10:59:35.085] [    1.409715]  remoteproc1#vdev0buffer: assigned reserved memory node c66-dma-memory@a6000000
[2021-08-31 10:59:35.086] [    1.409786]  remoteproc1#vdev0buffer: registered virtio1 (type 7)
[2021-08-31 10:59:35.126] [    1.409790] remoteproc remoteproc1: remote processor 4d81800000.dsp is now up
[2021-08-31 10:59:35.127] [    1.535293] remoteproc remoteproc4: powering up 5d00000.r5f
[2021-08-31 10:59:35.127] [    1.535303] remoteproc remoteproc4: Booting fw image j7-main-r5f0_1-fw, size 1923072
[2021-08-31 10:59:35.128] [    1.535434] platform 5d00000.r5f: R5F core initialized in IPC-only mode
[2021-08-31 10:59:35.128] [    1.535443]  remoteproc4#vdev0buffer: assigned reserved memory node r5f-dma-memory@a3000000
[2021-08-31 10:59:35.128] [    1.535492]  remoteproc4#vdev0buffer: registered virtio2 (type 7)
[2021-08-31 10:59:35.169] [    1.535495] remoteproc remoteproc4: remote processor 5d00000.r5f is now up
[2021-08-31 10:59:35.170] [    1.585175] virtio_rpmsg_bus virtio0: rpmsg host is online
[2021-08-31 10:59:35.170] [    1.585639] virtio_rpmsg_bus virtio1: rpmsg host is online
[2021-08-31 10:59:35.170] [    1.586040] virtio_rpmsg_bus virtio2: rpmsg host is online
[2021-08-31 10:59:35.171] [    1.591650] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xd
[2021-08-31 10:59:35.171] [    1.592317] virtio_rpmsg_bus virtio1: creating channel rpmsg_chrdev addr 0xd
[2021-08-31 10:59:35.171] [    1.592578] virtio_rpmsg_bus virtio2: creating channel rpmsg_chrdev addr 0xd
[2021-08-31 10:59:35.212] [    1.597199] remoteproc remoteproc3: powering up 5c00000.r5f
[2021-08-31 10:59:35.213] [    1.597210] remoteproc remoteproc3: Booting fw image j7-main-r5f0_0-fw, size 4712792
[2021-08-31 10:59:35.213] [    1.597318] platform 5c00000.r5f: R5F core initialized in IPC-only mode
[2021-08-31 10:59:35.214] [    1.597326]  remoteproc3#vdev0buffer: assigned reserved memory node vision_apps-r5f-dma-memory@a1000000
[2021-08-31 10:59:35.214] [    1.597821] virtio_rpmsg_bus virtio3: rpmsg host is online
[2021-08-31 10:59:35.215] [    1.597852]  remoteproc3#vdev0buffer: registered virtio3 (type 7)
[2021-08-31 10:59:35.255] [    1.597856] remoteproc remoteproc3: remote processor 5c00000.r5f is now up
[2021-08-31 10:59:35.256] [    1.603365] virtio_rpmsg_bus virtio3: creating channel rpmsg_chrdev addr 0xd
[2021-08-31 10:59:35.256] [    1.675309] omap_rng 4e10000.rng: Random Number Generator ver. 241b34c
[2021-08-31 10:59:35.256] [    1.675776] random: crng init done
[2021-08-31 10:59:35.256] [    1.675780] random: 7 urandom warning(s) missed due to ratelimiting
[2021-08-31 10:59:35.257] [    1.757987] remoteproc remoteproc2: powering up 64800000.dsp
[2021-08-31 10:59:35.257] [    1.757998] remoteproc remoteproc2: Booting fw image j7-c71_0-fw, size 12473064
[2021-08-31 10:59:35.298] [    1.761236] k3-dsp-rproc 64800000.dsp: booting DSP core using boot addr = 0xa8200000
[2021-08-31 10:59:35.299] [    1.762656]  remoteproc2#vdev0buffer: assigned reserved memory node c71-dma-memory@a8000000
[2021-08-31 10:59:35.299] [    1.763120] virtio_rpmsg_bus virtio4: rpmsg host is online
[2021-08-31 10:59:35.299] [    1.763214]  remoteproc2#vdev0buffer: registered virtio4 (type 7)
[2021-08-31 10:59:35.300] [    1.763218] remoteproc remoteproc2: remote processor 64800000.dsp is now up
[2021-08-31 10:59:35.300] [    1.793281] virtio_rpmsg_bus virtio4: creating channel rpmsg_chrdev addr 0xd
[2021-08-31 10:59:35.301] [    1.793543] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0x15
[2021-08-31 10:59:35.342] [    1.793661] virtio_rpmsg_bus virtio1: creating channel rpmsg_chrdev addr 0x15
[2021-08-31 10:59:35.342] [    1.793952] virtio_rpmsg_bus virtio3: creating channel rpmsg_chrdev addr 0x15
[2021-08-31 10:59:35.342] [    1.794128] virtio_rpmsg_bus virtio2: creating channel rpmsg_chrdev addr 0x15
[2021-08-31 10:59:35.343] [    1.794277] virtio_rpmsg_bus virtio4: creating channel rpmsg_chrdev addr 0x15
[2021-08-31 10:59:35.343] [    1.794832] virtio_rpmsg_bus virtio4: creating channel ti.ipc4.ping-pong addr 0xe
[2021-08-31 10:59:35.344] [    1.809514] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xe
[2021-08-31 10:59:35.385] [    1.809619] virtio_rpmsg_bus virtio1: creating channel ti.ipc4.ping-pong addr 0xe
[2021-08-31 10:59:35.385] [    1.875052] virtio_rpmsg_bus virtio2: creating channel ti.ipc4.ping-pong addr 0xe
[2021-08-31 10:59:35.386] [    1.975669] virtio_rpmsg_bus virtio3: creating channel ti.ethfw.notifyservice addr 0x1e
[2021-08-31 10:59:35.386] [    1.976845] virtio_rpmsg_bus virtio3: creating channel rpmsg-kdrv addr 0x1a
[2021-08-31 10:59:35.386] [    1.978102] rpmsg-kdrv-eth-switch rpmsg-kdrv-2-mpu_1_0_ethswitch-device-0: Device info: permissions: 07FFFFFF uart_id: 6
[2021-08-31 10:59:35.428] [    1.978108] rpmsg-kdrv-eth-switch rpmsg-kdrv-2-mpu_1_0_ethswitch-device-0: FW ver 0.1 (rev 1) 26/Aug/2021 SHA:25c3a738
[2021-08-31 10:59:35.428] [    1.986836] j721e-cpsw-virt-mac main_r5fss_cpsw9g_virt_mac0: virt_cpsw_nuss mac loaded
[2021-08-31 10:59:35.429] [    1.986843] j721e-cpsw-virt-mac main_r5fss_cpsw9g_virt_mac0: rdev_features:00000003 rdev_mtu:1522 flow_id:172 tx_psil_dst_id:4A00
[2021-08-31 10:59:35.429] [    1.986847] j721e-cpsw-virt-mac main_r5fss_cpsw9g_virt_mac0: local_mac_addr:00:00:00:00:00:00 rdev_mac_addr:70:ff:76:1d:92:c1

  • Hi Wang,

    1. I am not sure I understand your question. If you are booting the R5F in U-Boot, you have already started the processor. R5F should already be executing code. Linux remoteproc driver detects this as IPC-only mode. The k3_r5_rproc_start() function is a common function, it is not really starting the processor in IPC-only mode.

    Only the IPC with A72 is established once the kernel driver has initialized the processor in IPC-only mode

    NOTE: You don't need the previous disabling auto-boot patch if you are booting the R5Fs from U-Boot, it is only needed if you are booting the R5Fs from kernel.

    2. If you wish to have the IPC established earlier during your kernel boot, you can make the K3 R5F remoteproc driver and other related IPC drivers (virtio_rpmsg_bus, rpmsg_char etc) as built-in. The K3 R5F remoteproc driver still relies on firmware_class to request the firmware for retrieving the resource table in SDK 7.x, so you need use an initramfs and place the firmwares in the initramfs. The driver is updated in 8.x to not read the firmware again (but required resource_table section at the base of the second memory-region DDR), so this restriction is gone.

    regards

    Suman

  • Hi,  Suman, 

        Thanks very much, your comments is very useful , and I am very interested in your point 2.  

        As my understanding, the k3_r5_rproc load the firmware by function rproc_trigger_auto_boot ,  it use firmware framework to start a work to load the firmware , and call rproc_boot in callback function rproc_auto_boot_callback. If we use the ipc-only mode, the firmware will be loaded by uboot, that means we don't need firmware framework and initramfs. 

        Is the following solution feasible?

        1.  ipc-only mode to load r5f firmware

        2.  build k3_r5_proc as kernel build-in

        3.  set rproc->auto_boot as false and rproc->skip_firmware_request = 1

        4. call rproc_boot after rproc_add.

    I do a simple test , don't build those driver as build-in, just try to skip auto_boot and load firmware, add rproc_boot after rproc_add.
    The thread oops , it seems that the problem in the follow ops functions 

    	/* Default to ELF loader if no load function is specified */
    	if (!rproc->ops->load) {
    		rproc->ops->load = rproc_elf_load_segments;
    		rproc->ops->parse_fw = rproc_elf_load_rsc_table;
    		rproc->ops->find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table;
    		rproc->ops->sanity_check = rproc_elf_sanity_check;
    		rproc->ops->get_boot_addr = rproc_elf_get_boot_addr;
    	}

    the log as below,

    [2021-09-01 12:09:32.966] [    1.782040] platform 5c00000.r5f: configured R5F for IPC-only mode
    [2021-09-01 12:09:32.966] [    1.782074] platform 5c00000.r5f: assigned reserved memory node vision_apps-r5f-dma-memory@a1000000
    [2021-09-01 12:09:33.007] [    1.782225] remoteproc remoteproc3: 5c00000.r5f is available
    [2021-09-01 12:09:33.008] [    1.782252] remoteproc remoteproc3: powering up 5c00000.r5f
    [2021-09-01 12:09:33.008] [    1.782254] remoteproc remoteproc3: Booting unspecified pre-loaded fw image
    [2021-09-01 12:09:33.008] [    1.782262] Unable to handle kernel paging request at virtual address ffff8000ba7ef8e0
    [2021-09-01 12:09:33.009] [    1.782264] Mem abort info:
    [2021-09-01 12:09:33.009] [    1.782266]   ESR = 0x96000006
    [2021-09-01 12:09:33.009] [    1.782268]   EC = 0x25: DABT (current EL), IL = 32 bits
    [2021-09-01 12:09:33.010] [    1.782269]   SET = 0, FnV = 0
    [2021-09-01 12:09:33.050] [    1.782271]   EA = 0, S1PTW = 0
    [2021-09-01 12:09:33.050] [    1.782272] Data abort info:
    [2021-09-01 12:09:33.050] [    1.782274]   ISV = 0, ISS = 0x00000006
    [2021-09-01 12:09:33.051] [    1.782275]   CM = 0, WnR = 0
    [2021-09-01 12:09:33.051] [    1.782278] swapper pgtable: 64k pages, 48-bit VAs, pgdp=0000000082db0000
    [2021-09-01 12:09:33.051] [    1.782279] [ffff8000ba7ef8e0] pgd=00000008ffff0003, pud=00000008ffff0003, pmd=0000000000000000
    [2021-09-01 12:09:33.052] [    1.782284] Internal error: Oops: 96000006 [#1] PREEMPT SMP
    [2021-09-01 12:09:33.052] [    1.782286] Modules linked in: ti_k3_r5_remoteproc(+) sha512_generic authenc ti_k3_dsp_remoteproc sch_fq_codel rpmsg_kdrv_switch ip_tables x_tables ipv6
    [2021-09-01 12:09:33.093] [    1.782298] CPU: 0 PID: 155 Comm: systemd-udevd Not tainted 5.4.74-ACU-1.3.28.1 #8
    [2021-09-01 12:09:33.094] [    1.782300] Hardware name: Texas Instruments K3 J721E SoC (DT)
    [2021-09-01 12:09:33.094] [    1.782303] pstate: 40000005 (nZcv daif -PAN -UAO)
    [2021-09-01 12:09:33.095] [    1.782311] pc : find_table+0x2c/0x1a8
    [2021-09-01 12:09:33.095] [    1.782313] lr : rproc_elf_load_rsc_table+0x20/0x80
    [2021-09-01 12:09:33.095] [    1.782314] sp : ffff80001248f7a0
    [2021-09-01 12:09:33.095] [    1.782316] x29: ffff80001248f7a0 x28: ffff000849dc1b18
    [2021-09-01 12:09:33.096] [    1.782318] x27: ffff000849dc1800 x26: ffff000849dc1c48
    [2021-09-01 12:09:33.136] [    1.782320] x25: ffff000847ef2010 x24: ffff80001248f8b0
    [2021-09-01 12:09:33.137] [    1.782322] x23: ffff000849dc1838 x22: ffff000849dc1b20
    [2021-09-01 12:09:33.137] [    1.782324] x21: ffff0008479f6200 x20: ffff8000ba774f90
    [2021-09-01 12:09:33.137] [    1.782326] x19: ffff000849dc1800 x18: 0000000000000000
    [2021-09-01 12:09:33.138] [    1.782328] x17: 0000000000000000 x16: 0000000000000000
    [2021-09-01 12:09:33.138] [    1.782330] x15: ffff800010faa000 x14: ffff8000110674e0
    [2021-09-01 12:09:33.138] [    1.782332] x13: 0000000000000000 x12: ffff800011066000
    [2021-09-01 12:09:33.138] [    1.782334] x11: ffff800010faa000 x10: ffff800011066b30
    [2021-09-01 12:09:33.179] [    1.782336] x9 : 0000000000000000 x8 : 0000000000000000
    [2021-09-01 12:09:33.180] [    1.782338] x7 : 0000000000000000 x6 : 000000000000018e
    [2021-09-01 12:09:33.180] [    1.782340] x5 : ffff00087faa1848 x4 : 0000000000000028
    [2021-09-01 12:09:33.180] [    1.782342] x3 : 000000000000167f x2 : ffff80001248f990
    [2021-09-01 12:09:33.181] [    1.782344] x1 : ffff800010634bb0 x0 : ffff8000ba7ef8d0
    [2021-09-01 12:09:33.181] [    1.782347] Call trace:
    [2021-09-01 12:09:33.181] [    1.782350]  find_table+0x2c/0x1a8
    [2021-09-01 12:09:33.181] [    1.782352]  rproc_elf_load_rsc_table+0x20/0x80
    [2021-09-01 12:09:33.181] [    1.782354]  rproc_boot+0x2f4/0x510
    [2021-09-01 12:09:33.222] [    1.782362]  k3_r5_probe+0x3e8/0xca0 [ti_k3_r5_remoteproc]
    [2021-09-01 12:09:33.222] [    1.782367]  platform_drv_probe+0x50/0xa0
    [2021-09-01 12:09:33.223] [    1.782370]  really_probe+0xd4/0x318
    [2021-09-01 12:09:33.223] [    1.782372]  driver_probe_device+0x54/0xe8
    [2021-09-01 12:09:33.223] [    1.782374]  device_driver_attach+0x6c/0x78
    [2021-09-01 12:09:33.223] [    1.782377]  __driver_attach+0x54/0xd0
    [2021-09-01 12:09:33.224] [    1.782379]  bus_for_each_dev+0x6c/0xc0
    [2021-09-01 12:09:33.224] [    1.782381]  driver_attach+0x20/0x28
    [2021-09-01 12:09:33.224] [    1.782383]  bus_add_driver+0x140/0x1e8
    [2021-09-01 12:09:33.224] [    1.782386]  driver_register+0x60/0x110
    [2021-09-01 12:09:33.225] [    1.782388]  __platform_driver_register+0x44/0x50
    [2021-09-01 12:09:33.265] [    1.782392]  k3_r5_rproc_driver_init+0x1c/0x10000 [ti_k3_r5_remoteproc]
    [2021-09-01 12:09:33.266] [    1.782396]  do_one_initcall+0x50/0x1a8
    [2021-09-01 12:09:33.267] [    1.782399]  do_init_module+0x50/0x208
    [2021-09-01 12:09:33.267] [    1.782401]  load_module+0x1d8c/0x2380
    [2021-09-01 12:09:33.267] [    1.782403]  __do_sys_finit_module+0xd0/0xe8
    [2021-09-01 12:09:33.267] [    1.782406]  __arm64_sys_finit_module+0x1c/0x28
    [2021-09-01 12:09:33.267] [    1.782410]  el0_svc_common.constprop.0+0x68/0x160
    [2021-09-01 12:09:33.267] [    1.782412]  el0_svc_handler+0x20/0x80
    [2021-09-01 12:09:33.267] [    1.782414]  el0_svc+0x8/0x204
    [2021-09-01 12:09:33.267] [    1.782419] Code: 79406420 8b140034 79406023 9ba45000 (b9401018)
    [2021-09-01 12:09:33.308] [    1.782422] ---[ end trace 4576f72127a98faf ]---
    

    could you give me suggestions about it?

    Thanks
    Wang Hongjie

  • Hi Wang,

    If we use the ipc-only mode, the firmware will be loaded by uboot, that means we don't need firmware framework and initramfs. 

    Your steps won't work on SDK 7.x. The driver needs the resource_table to create the virtio devices that form the IPC transport. Please look at my comment in the earlier response regarding "retrieving the resource table".

    Regarding your steps,

    3. rproc->auto_boot still needs to be set without which it will wait for userspace to start. This will defeat your early-boot purpose. Your step #4 is to mitigate this. rproc->skip_firmware_request also needs to be set, without which the driver will never be able to retrieve the resource table in the rproc_boot step. 

    4. This is moot, and will mostly interfere with the ref-counting balancing in remoteproc state-machine. You are better off with auto-boot set. The patch I provided in the previous thread only set auto-boot to false in remoteproc mode.

    Bottomline, on 7.x, the kernel retrieves the resource_table by using the firmware_class. It requests the firmware only to get the resource_table, it does not actually load the other segments.  

    regards

    Suman 

  • Hi Anna,

       Could you please introduce the design in sdk 8.x,  and Is it possible to change this part to follow it?

    Regards

  • Hi Wang,

    SDK 8.x already doesn't do a request firmware for IPC-only mode. It follows a design-by-contract approach and expects the .resource_table section to be at the base of the second reserved-memory node assigned to the remoteproc (through memory-region DT property). The SDK is already available if you want to try it.

    You will still have to enable the built-in. We cannot enable this by default for reference since not every customer will use early-boot or using initramfs.

    Also, note that there can be multiple remoteprocs supported by the same driver, so all remoteprocs should be early-booted or should have their firmwares in initramfs if they are booting in remoteproc mode.

    regards

    Suman