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.

PROCESSOR-SDK-AM65X: Sciclient_rmIrqSet() fails with processor SDK 06.03

Part Number: PROCESSOR-SDK-AM65X


Dear TI team,

one variant of our code that is supposed to run on the R5f core of an AM65x implements a PCIe endpoint.

In this variant we used to call Sciclient_rmIrqSet with a request setup like this, in order to route PCIe interrupts to the R5 core:

    req.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST;
    req.src_id = TISCI_DEV_PCIE0; /* gets set to 120 */
    req.src_index = irq->src_index; /* gets set to 5 */

    /* Set the destination interrupt */
    req.valid_params |= TISCI_MSG_VALUE_RM_DST_ID_VALID;
    req.valid_params |= TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID;

    /* Set the destination based on the core */
    req.dst_id       = get_mcu_id(); /* gets set to 159 */
    req.dst_host_irq = irq->host_irq; /* gets set to 194 */

    ret = Sciclient_rmIrqSet(&req, &resp, SCICLIENT_SERVICE_WAIT_FOREVER);

This worked just fine with processor SDK 06.01, but fails with processor SDK 06.03. Inside Sciclient_rmIrqSet the return value from Sciclient_service is CSL_PASS, but the TISCI_MSG_FLAG_ACK flag isn't set in the response, causing Sciclient_rmIrqSet to return an error. Later in our code we're mapping UDMA events to the R5f using Sciclient_rmIrqSet, and that works fine, so the communication with the SYSFW appears to be ok. It looks like the SYSFW doesn't like something about this particular request.

I looked into the configuration of the MAIN2MCU_LVL_INTRTR0 at a point when the SBL is still running, and it looks like the PCIe interrupts are already routed to the R5:

0x00A10004	00000040	00000041	00000042	00000043	00000044	00000045	00000046	00000047
0x00A10024	00000048	00000049	0000004A	0000004B	0000004C	0000004D	0000004E	0000004F
0x00A10044	00000050	00000051	00000052	00000053	00000054	00000055	00000056	00000057
0x00A10064	00000058	00000059	0000005A	0000005B	0000005C	0000005D	0000005E	0000005F
0x00A10084	0000001C	0000001D	00000000	00000000	00000000	00000000	00000000	00000000
0x00A100A4	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000
0x00A100C4	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000
0x00A100E4	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000

Main2Mcu Level Inputs 64-95 (0x40-0x5f) correspond to the PCIe interrupts. Inputs 28 and 29 (0x1c-0x1d) correspond to the MMCSD0/1 interrupts.

With the SYSFW from processor SDK 06.01 the Sciclient_rmIrqSet call would succeed, and the MAIN2MCU_LVL_INTRTR0 configuration looked like this:

0x00A10004	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000
0x00A10024	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000
0x00A10044	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000
0x00A10064	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000
0x00A10084	0000001C	0000001D	00000044	00000000	00000000	00000000	00000000	00000000
0x00A100A4	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000
0x00A100C4	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000
0x00A100E4	00000000	00000000	00000000	00000000	00000000	00000000	00000000	00000000

With the SYSFW from processor SDK 06.03 the Sciclient_rmIrqSet fails and the MAIN2MCU_LVL_INTRTR0 configuration is not changed.

Where does the initial configuration of the MAIN2MCU_LVL_INTRTR0 come from? I was suspecting that this might be the result of Sciclient_boardCfgRm() with the board config compiled into the SBL, but it seems that this configuration is already set when the SBL enters its main, i.e. before the SYSFW is initialized.

Was there something changed in the SYSFW that could explain the different behaviour? For example was there a check added that prevents an already routed input to be assigned to another output? Was the previous behaviour of resetting (part) of the configuration intended or was that a bug?

Can I rely on the initial configuration, i.e. is it specified somewhere that the PCIe interrupts are routed via MAIN2MCU_RTR_LVL_MUX_INTR0-31? Can I query the existing configuration?

Regards,

Dominic

  • Hi Jian,

    when can Dominic (my customer) expect an answer?

    Regards, Bernd

  • Posting this response on behalf of Piyali

    Hi Dominic,

     Thank you for the clear explanation of the problem.

     Please find my inputs below:

     Where does the initial configuration of the MAIN2MCU_LVL_INTRTR0 come from? 

    [Piyali]: This comes from ROM. The SYSFW will clear the configuration during boot and also during configuration of the corresponding interrupt number for the ROM. Based on the register snapshots it looks like the configuration is not getting cleared.

     Was there something changed in the SYSFW that could explain the different behaviour?

    [Piyali]: Between 6.1 and 6.3 there was an update for the Interrupt router configuration being done in the PDK Sciclient driver versus the SYSFW running on DMSC. It looks like this logic introduced this issue. I will look at the code a bit more in the next few days to see where the logic has deviated from expectation.

     Can I rely on the initial configuration, i.e. is it specified somewhere that the PCIe interrupts are routed via MAIN2MCU_RTR_LVL_MUX_INTR0-31? Can I query the existing configuration?

    [Piyali]: You can refer to the file pdk/packages/ti/drv/sciclient/soc/V0/sciclient_irq_rm.c to see the initial mapping which ROM maps. See the "rom_usage" field in the structures.

    Thanks and Regards

    Piyali

  • Dominic,

    I debugged the issue further and found that there are two things going on here:

    1. Mismatch between the board configuration and what you are trying to set.

    Based on the parameters you are setting the interrupt router output you are trying to set is 34.

    According to the board configuration pdk\packages\ti\drv\sciclient\soc\V0\sciclient_defaultBoardcfg_rm.c, the following is the map:

            {
                .type = TISCI_RESASG_UTYPE(TISCI_DEV_MAIN2MCU_LVL_INTRTR0, TISCI_RESASG_SUBTYPE_IR_OUTPUT),
                .start_resource = 0U,
                .num_resource = 32U,
                .host_id = TISCI_HOST_ID_R5_0,
            },
            {
                .type = TISCI_RESASG_UTYPE(TISCI_DEV_MAIN2MCU_LVL_INTRTR0, TISCI_RESASG_SUBTYPE_IR_OUTPUT),
                .start_resource = 32U,
                .num_resource = 32U,
                .host_id = TISCI_HOST_ID_R5_2,
            },

    So this does not fall in the board configuration and the API fails.

    So to avoid the failure, there are 2 options:

    1. Change board configuration to match what you would like to use.
    2. Change the interrupt number for the R5F from 194 to something which falls in the range of 160 to 191 (both numbers included)

    I tried this with 191 and the code passed.

    2. The software state handling in the Sciclient has a bug which finds the input from the table is used and ignores that the output is also used by ROM. The fix for the same will be available in 7.2 SDK. For now the quick fix is to force clear the ROM mapping.

    Thanks and Regards
    Piyali

  • Dominic,

    Here is the link to the bug for further reference: https://sir.ext.ti.com/jira/browse/EXT_EP-10176

    Regards

    Karthik

  • Hello Piyali,

    thanks a lot for your explanation.

    Regarding 1) board config mismatch:

    It wasn't (and to some degree still isn't) obvious to me how the static board configuration and the runtime configuration interact.

    I'm assuming that the static board configuration defines permitted assignments, that I still have to request via the corresponding Sciclient call, and SYSFW is going to ensure that a) only allowed hosts request a resource and b) no two hosts request the same resource? Am I allowed to configure these interrupts as TISCI_HOST_ID_ALL?

    Regarding 2) software state handling in Sciclient:

    How should I "force clear" the ROM mapping?

    Regards,

    Dominic

  • Dominic

    You are right the board configuration is a gate for a host to define which resources
    can be requested by which host.
    It will set the region based firewalls for each host, if there is a region based
    firewall available in front of the resource.
    You would have to still request the resource via Sciclient call. At that time the
    resource is programmed and channelized firewalls are set.

    If you set TISCI_HOST_ID_ALL then any host can request for the resources and the
    SYSFW does not gate the request.
    The firewalls are set for any one to access.

    By force clear I mean basically doing a direct register write to the region by setting it to 0.

    Regards
    Piyali