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.

[参考译文] AM6412:引导 R5F 远程内核问题

Guru**** 2331900 points
Other Parts Discussed in Thread: AM6442, AM6422
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1518247/am6412-issues-with-booting-r5f-remote-cores

器件型号:AM6412
主题中讨论的其他器件:AM6442AM6422

工具/软件:

尊敬的专家:

目前、我们正在尝试使用 Uboot 在 R5F 内核上加载软件。

在 EVM 或通过 JTAG 均能正常工作。

但是、使用我们自己的自定义硬件后、它不再起作用。

中使用的磁芯略有不同

EVM:AM6442 (4-R5F 内核)

定制硬件:AM6422 (2个 R5F 内核)

我们是否需要考虑或更改任何内容以同时为 AM6422启用 Uboot?  

此致、
Alex

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好、

    摘要

    好的、我想我有足够的信息供您在接下来的几天里取得进展。 我没有时间在硬件上运行测试、但对驱动程序的分析使我相信、如果不修改软件、硬件测试将无法正常工作。

    首先、未使用 AM6422等 AM64x 器件型号测试 uboot rproc 驱动程序、仅使用超集器件(AM6442)。 虽然 u-boot 的 SDK 9.2.1.10版本和 u-boot 的 SDK 11.0版本中都定义了 cluster_MODE_SINGLECPU、但它实际上并未使用。 需要修改 U-Boot 驱动程序。 请参阅 Linux 驱动程序的功能。 另外、请告知我们您所做的软件更改、因为我们应该为 uboot 驱动程序打补丁、以便为每个人启用此功能。

    详细信息  

    我们将了解 uboot 驱动程序
    drivers/remoteproc/ti_k3_r5f_rproc.c

    以及 Linux 内核6.1驱动程序
    drivers/remoteproc/ti_k3_r5_remoteproc.c

    仪表组模式很重要。 我们将使用 AM64x 特有的单 CPU 模式(即不同于 AM62x 单核模式):

    ti_k3_r5_remoteproc.c
    
    /*
     * All cluster mode values are not applicable on all SoCs. The following
     * are the modes supported on various SoCs:
     *   Split mode       : AM65x, J721E, J7200 and AM64x SoCs
     *   LockStep mode    : AM65x, J721E and J7200 SoCs
     *   Single-CPU mode  : AM64x SoCs only
     *   Single-Core mode : AM62x, AM62A SoCs
     */
    enum cluster_mode {
            CLUSTER_MODE_SPLIT = 0,
            CLUSTER_MODE_LOCKSTEP,
            CLUSTER_MODE_SINGLECPU,
            CLUSTER_MODE_SINGLECORE
    };
    

    此处 Linux 驱动程序中的注释听起来与您在尝试初始化 TCM 存储器时观察到的问题相关:

    ti_k3_r5_remoteproc.c
    
    /*
     * The R5F cores have controls for both a reset and a halt/run. The code
     * execution from DDR requires the initial boot-strapping code to be run
     * from the internal TCMs. This function is used to release the resets on
     * applicable cores to allow loading into the TCMs. The .prepare() ops is
     * invoked by remoteproc core before any firmware loading, and is followed
     * by the .start() ops after loading to actually let the R5 cores run.
     *
     * The Single-CPU mode on applicable SoCs (eg: AM64x) only uses Core0 to
     * execute code, but combines the TCMs from both cores. The resets for both
     * cores need to be released to make this possible, as the TCMs are in general
     * private to each core. Only Core0 needs to be unhalted for running the
     * cluster in this mode. The function uses the same reset logic as LockStep
     * mode for this (though the behavior is agnostic of the reset release order).
     * This callback is invoked only in remoteproc mode.
     */
    static int k3_r5_rproc_prepare(struct rproc *rproc)
    {
    ...
            /* Re-use LockStep-mode reset logic for Single-CPU mode */
            ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP ||
                   cluster->mode == CLUSTER_MODE_SINGLECPU) ?
                    k3_r5_lockstep_release(cluster) : k3_r5_split_release(core);
            if (ret) {
                    dev_err(dev, "unable to enable cores for TCM loading, ret = %d\n",
                            ret);
                    return ret;
            }
    

    您将注意到 u-boot 驱动程序中缺少为单 CPU 模式执行锁步释放的代码。 由于"拆分"版本在实际"锁步"版本是正确选择时使用、可能 TCM 未正确初始化、从而导致您的挂起。

    一旦我们添加用于处理 AM64x 单 CPU 模式的逻辑、我预计您应该能够在 u-boot 器件树中在单 CPU 模式下传递。 然后、TCM 存储器初始化应开始工作。 有关如何将 AM64x R5F 子系统设置为单 CPU 模式的示例、请参阅中的示例补丁

    AM64x Academy > Multiple >禁用 Linux 中的远程内核
    https://dev.ti.com/tirex/explore/node?node=A__AWQEpuVOCljkhxqRi05Qpw__AM64-ACADEMY__WI1KRXP__LATEST 

    此致、

    Nick