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.

TPS65987D: PR_swap is made unintentionally

Part Number: TPS65987D
Other Parts Discussed in Thread: TPS65982

Hi, everyone,


We're designing PC by using TPS65987D.
When we detached AC adaptor, PR_swap is made everytime unintentiolally, like attached file.

(We've also designed  PC using TPS65982 recently, but then, PR_swap won't occur)

How can we prevent PR_swap when removing AC adaptor ?

Now, our firmware settings are as follows:


Thank you.


Best Regards,

  • Hi Maurice,

    We would need some more details to figure out the reason of this PR Swap.

    Can you answer below questions:
    1. Where's this adaptor connected?
    2. What was connected to Type-C port which is doing PR Swap and what was it's power role?
    3. Please share the complete configuration settings.

    Thanks,
    Rahul
  • Hi, Rahul-san,



    Thank you for your reply.


    >1. Where's this adaptor connected?

    First, our PC have both of barrel jack & Type-C ports for power supply inlet.
    "This adaptor" in my question is for barrel jack to PC side.

    And our EC changes "externally power bit" according to attachment / detachment of barrel jack AC adaptor,
    so we guess PD controller TPS65987D send PR_swap message to far-end device,
    according to "external power bit."



    >2. What was connected to Type-C port which is doing PR Swap and what was it's power role?

    Type-C multi-port hub.
    (for example, Pluggable tbt3-dp2x-83, Lention C57EHV)
    They're bus-powerd, and operating as Sink, not Source.


    >3. Please share the complete configuration settings.

    I'm very sorry, but as you know, there're many registers settings in firmware.
    So could you tell us which register we should pick up ?
    I'd appreciate if you tell us some registers concerned.

    Or if you need to survey our project file,
    please tell us secure method to share our project file with you.


    Thank you.


    Best Regards,
  • Hi Maurice,

    I have send you a personal message. Please respond to that.

    Thanks,
    Rahul
  • Hi, Rahul-san,


    Thank you for your quick & polite reply.

    I've sent you a personal message.
    I'd appreciate if you check it.


    Thank you.


    Best Regards,
  • Hi Maurice,

    I looked at the configuration settings and I don't see a reason why the PD controller will send a PR Swap request. Also note that the PD controller can't initiate PR Swap as it's disabled in the configuration settings, unless EC is making any changes on top of the configuration settings.

    The PD logs are very small and doesn't tell us who was the source and which was the sink. Can you share the detailed PD logs?

    Thanks,
    Rahul
  • Hi, Lahul-san,


    Thank you for your reply.


    >The PD logs are very small and doesn't tell us who was the source and which was the sink. Can you share the detailed PD logs?

    I'm sorry I didn't make it clear enogh.

    Source (DFP): Our product PC, using TPS65987D
    Sink (UFP): Type-C multiport hub, not self-powered


    >Also note that the PD controller can't initiate PR Swap as it's disabled in the configuration settings
    >unless EC is making any changes on top of the configuration settings.

    Yes. You're right.
    But our EC change externally powered bit only,
    depending on whether barrel jack AC adaptor (PC side) exists or not.
    I've also checked "Port Control register 0x29 register" is same with our FW setting.


    Now our problem is...
    When we remove barrel jack AC adaptor on PC side,
    TPS65987D requests PR_Swap to Sink device (multiport hub),
    even if its Sink device isn't self-powered.

    We want to prevent this PR_Swap, because we want to use our products as DRP.


    Thank you.


    Best Regards,
  • And our EC changes "externally power bit" according to attachment / detachment of barrel jack AC adaptor,
    so we guess PD controller TPS65987D send PR_swap message to far-end device,
    according to "external power bit.

    Hi Maurice,

    If your EC doesn't change "externally power bit" then do you still see PR Swap initiated by PD controller?

    Regards,
    Atiq
  • Hi, Atiq-san,


    Thank you for your reply.


    >If your EC doesn't change "externally power bit" then do you still see PR Swap initiated by PD controller?

    No. We cannnot see PR_Swap
    when we change EC settings so that EC won't change "externally power bit".


    Thank you.


    Best Regards,
  • Hi Maurice,

    That's good to know. I guess this resolves your issue. Do let me know if I am wrong.

    Thanks,
    Rahul
  • Hi, Rahul-san,


    Thank you for your reply.


    But in our PC, battery is detachable from PC.

    And our PC use barrel jack AC adaptor, separately from PD adaptror,
    and then, change "externally powered bit" according to the presence of its AC adaptor.


    Anyways, our products using TPS65982 don't make PR_Swap,
    even when "Externally Powered Bit" is changed.

    Now our current designing products using TPS65987D
    need to design like our past products, too.


    Are there any countermeasures by TPS65987D firmware?


    Thank you.


    Best Regards,
  • Hi, Atiq-san, Rahul-san,


    Thank you for your reply.


    But USBPD specification says,

    >6.4.1.2.2.3 Unconstrained Power
    >The Unconstrained Power bit Shall be set when an external source of power is available that is sufficient to adequately power the system >while charging external devices, or when the device’s primary function is to charge external devices.
    >To set the Unconstrained Power bit as a result of an external source, the external source of power Should be either:
    >• An AC supply, e.g. a wall wart, directly connected to the Sink.
    >• Or, in the case of a PDUSB Hub: o A PD Source with its Unconstrained Power bit set.
    >o Multiple PD Sources all with their Unconstrained Power bits set.


    and it seems that "Externally powered bit" should be 0,
    when barrel jack AC adaptor doesn't exist.


    Now, our question is:

    (1) Doesn't your WA idea
    "Externally powered bit" should be 1 when barrel jack AC adaptor"
    conflict with USBPD spec?

    (2)If our understanding is wrong, please tell us the corresponding item number in the USB PD specification.



    Thank you.


    Best Regards,
  • Hi Maurice,

    I have discussed this with team, you are correct that "Externally powered bit" in Host Interface register represents "Unconstrained Power bit" that is explained in PD spec. I have updated some of the responses to reflect this information correctly.

    So, when you have AC adapter (barrel jack) is connected EC should set this bit and indicate Unconstrained Power to the port partner. In case the bit is clreared by EC, it means laptop doesn't have Unconstrained Power and hence PR_Swap is initiated by PD controller so that laptop can charge it's battery from external source. This is fully aligned with PD spec and this is an improved behavior from our previous generation PD controller devices.

    Note that port partner can always reject the PR_Swap if it is not capable of Sourcing power to the laptop.

    Regards,
    Atiq
  • Hi, Atiq-san,


    Thank you for your reply.


    We think making PR_Swap according to "Externally Powered Bit" is NG.
    Simply, coutermeasure by base firmware is needed.


    Reason:

    [1] As you know, from the viewpoint of our products (ex. PC),
    these 2 operations as follows are NG.
    - "Externally Powered Bit" is fixed to 1 when battery exists.
    - PR_Swap is made according to "Externally Powered Bit."

    And as you've said, "Externally Power Bit" should be renewed
    every time when barrel jack AC adaptor is attached / removed.


    [2] In the viewpoint of use case of customers,
    after all, it isn't adequate that making PR_Swap according to change of "Externally Powered Bit".
    For example, when we remove barrel jack AC adaptor,


    Case 1: mobile phone
    moblile phone supplies power with our product PC.

    Case 2: multi-port hub (HDMI, Display Port, and so on)
    communication between PC & external display stops.
    And about some hubs, USB negotiation won't occur again,
    until we re-connect these hubs.


    Anyway, PR_Swap according to "Externally Powered Bit" isn't good,
    so base firmware needs to be revised.


    Thank you.


    Best Regards,
  • Hi Maurice,

    Could you share the full PD logs of these mobile phone and multi-port hub failure cases?

    Regards,

    Atiq

  • Hi, Atiq-san


    I sent 2 log files to your coworker Yone-san,
    because I cannot send you private mail now.

    Please confirm these 2 files.


    Both of 2 case,
    It is NG that TPS65987D makes PR_Swap according to "Externally Powered Bit".
    So I've said again, base FW needs to be modifiled.

    For detail, refer as follows:

    =========================================

    [log1 our product PC + mobile phone]


    [Procedure]

    On PC (TPS65987D inside) side, battery is present.
    Mobile phone is attached to Type-C port.

    **** Capture Stopped / Started *****

    (1)Attach barrel jack AC adaptor to PC.

    **** Capture Stopped / Started *****

    (2)Remove barrel jack AC adaptor from PC.
    [PC makes PR_Swap.]
    Mobile phone sends SourceCap,
    and our PC request 5V /0.9A PDO to mobile phone.
    Mobile phone supplies 5V /0.9A to PC.


    =========================================

    [log2: our product PC + multi-port hub]

    [Procedure]

    On PC (TPS65987D inside) side, battery is present.
    Multi-port hub is attached to Type-C port.
    Multi-port hub is connected to external display.
    And also, PD adaptor is attached to multi-port hub.

    **** Capture started *****

    (1) Attach barrel jack AC adaptor to PC.
    PC makes PR_Swap, but Hub return "Wait"

    **** Capture stopped / started *****


    (2) Remove barrel jack AC adaptor,
    and attach barrel jack AC adaptor on PC side again.

    [PC makes PR_swap], and multi-port hub accepts.
    Multi-port hub receive 5V from PC.

    **** Capture stopped / started *****

    (3) Remove barrel jack AC adaptor on PC side again.

    [PC makes PR_Swap]
    Hard reset occurs and & data transmission stops (also, external display dims).
    Multi-port hub sends SourceCap and receive 20V.

    =========================================

    Thank you.


    Best Regards,
  • Hi Maurice,

    Thanks for sharing the logs. Our team is reviewing those and working to make the base firmware change that you requested. 

    Regards,

    Atiq

  • Hi, Atiq-san, Rahul-san,


    OK. I understood.
    Thank you for your cooperation.


    Best Regards,