[FAQ] TDA4AP-Q1: How to Set PCIe0 Transmitter De-emphasis

Part Number: TDA4AP-Q1

Tool/software:

Hi TI Experts,

Customer is working on TDA4AP SDK10.0. They are using SPL boot.

They want to change the De-emphasis to be -3.5dB for PCIe0 for 5.0GT/s to minimize reflection. Please see the below description for details.

We have also found the corresponding setting below.

Could you please suggest coding how could we change De-emphasis to be -3.5dB for PCIe0 ?

Many Thanks,

Kevin

  • Kevin,

    I will defer this to the PCIe expert in our team.

    What you have shown here is likely the way to go about it, and the status bit can be read to make sure that the values are set right.

    My colleague should get back to you soon.

  • Hi Shreyas / Heather,

    Thanks for your reply, I also found an old thread discussing this topic on last generation AM57x shown below.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/574578/am5728-pcie-de-emphasis-and-swing-configuration-registers

    It seems that we do not support to modify it before, however, it also seems that in TDA4 we have these registers and theoretically we should be able to do that.

    Need your help to confirm the feasibility and how should we do that.

    Many Thanks,

    Kevin

  • Hi Shreyas / Heather,

    After discussing with our SW expert, there is a setpci command could be used to change the PCIE register during the runtime.

    https://man7.org/linux/man-pages/man8/setpci.8.html

    However, we do not know if the register of De-emphasis could be changed in this way, which means we are not quite sure this register itself is changeable or not? This may need your help to confirm for us.

    Many Thanks,

    Kevin

  • Hi Kevin,

    Is this still open?

    Regards,

    Brijesh

  • Hi Brijesh,

    Yes, we could close it now, the follow patch makes it work, thanks!

    diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c
    index 8af95e9da7ce..9b64ed738574 100644
    --- a/drivers/pci/controller/cadence/pcie-cadence-host.c
    +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c
    @@ -496,6 +496,20 @@ int cdns_pcie_host_init(struct cdns_pcie_rc *rc)
        return cdns_pcie_host_init_address_translation(rc);
     }
    
    +/*
    + * Default De-Emphasis value is -6dB. The following function
    + * changes it to -3.5dB.
    + */
    +static void cdns_pcie_setup_deemphasis(struct cdns_pcie *pcie)
    +{
    +   u32 pcie_cap_off = CDNS_PCIE_RP_CAP_OFFSET;
    +   u16 lnk_ctl2;
    +
    +   lnk_ctl2 = cdns_pcie_rp_readw(pcie, pcie_cap_off + PCI_EXP_LNKCTL2);
    +   lnk_ctl2 |= BIT(6); /* SD in PCIE_CORE_RP_I_LINK_CTRL_STATUS_2 reg */
    +   cdns_pcie_rp_writew(pcie, pcie_cap_off + PCI_EXP_LNKCTL2, lnk_ctl2);
    +}
    +
     int cdns_pcie_host_link_setup(struct cdns_pcie_rc *rc)
     {
        struct cdns_pcie *pcie = &rc->pcie;
    @@ -505,6 +519,8 @@ int cdns_pcie_host_link_setup(struct cdns_pcie_rc *rc)
        if (rc->quirk_detect_quiet_flag)
           cdns_pcie_detect_quiet_min_delay_set(&rc->pcie);
    
    +   cdns_pcie_setup_deemphasis(pcie);
    +
        cdns_pcie_host_enable_ptm_response(pcie);
    
        ret = cdns_pcie_start_link(pcie); 

    Kevin