public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* USB PD TYPEC - FUSB302B port controller hard reset issue
@ 2024-01-09  7:17 Suniel Mahesh
  2024-01-09  9:18 ` Gábor Stefanik
  2024-01-09 15:47 ` Guenter Roeck
  0 siblings, 2 replies; 8+ messages in thread
From: Suniel Mahesh @ 2024-01-09  7:17 UTC (permalink / raw)
  To: Guenter Roeck, Heikki Krogerus, Greg Kroah-Hartman, linux-kernel,
	USB list
  Cc: Jagan Teki, Da Xue, Da Xue, Da Xue, Kyle Tso, RD Babiera

Hi Guenter/Heikki/Greg and all,

This email is a narrowed version of the earlier discussion at:
https://lore.kernel.org/all/CAM+7aWt7hJSmJQ78Fes0jMcrF9E8yhN=sDgYuU-hBxO0+1Uj0g@mail.gmail.com/T/

Please guide/suggest on why the FUSB302B port controller on a target board
is getting reset(hard reset) on reception of a 0x0 packet from source(PD Wall
charger 100W - 20V@5A).

log when reset:

[    1.599049] FUSB302: IRQ: 0x80, a: 0x00, b: 0x00, status0: 0x83
[    1.602836] FUSB302: IRQ: 0x00, a: 0x40, b: 0x00, status0: 0x83
[    1.606210] TCPM: tcpm_pd_event_handler: in TCPM_CC_EVENT
[    1.968179] FUSB302: IRQ: 0x80, a: 0x00, b: 0x00, status0: 0x83
[    2.133140] FUSB302: IRQ: 0x41, a: 0x04, b: 0x00, status0: 0x93
[    2.133704] FUSB302: IRQ: PD tx success
[    2.136046] FUSB302: PD message header: 161
[    2.136392] FUSB302: PD message len: 0
[    2.136845] TCPM: PD TX complete, status: 0
[    2.139382] FUSB302: IRQ: 0x51, a: 0x00, b: 0x00, status0: 0x93
[    2.142192] FUSB302: IRQ: 0x51, a: 0x00, b: 0x01, status0: 0x93
[    2.142804] FUSB302: IRQ: PD sent good CRC
[    2.145274] FUSB302: PD message header: 1a3
[    2.145674] FUSB302: PD message len: 0
[    2.146072] FUSB302: fusb302_pd_read_message: to tcpm_pd_receive
[    2.146478] TCPM: PD RX, header: 0x1a3 [1]
[    2.147042] TCPM: tcpm_pd_ctrl_request: type:0x3
[    2.147435] TCPM: tcpm_pd_ctrl_request: case PD_CTRL_ACCEPT
[    2.146309] TCPM: tcpm_pd_ctrl_request: case SOFT_RESET_SEND
[    2.148266] TCPM: tcpm_pd_rx_handler: done
[    2.158196] FUSB302: IRQ: 0x51, a: 0x00, b: 0x01, status0: 0x93
[    2.158600] FUSB302: IRQ: PD sent good CRC
[    2.161283] FUSB302: PD message header: 0
[    2.161710] FUSB302: PD message len: 0
[    2.162092] FUSB302: fusb302_pd_read_message: to tcpm_pd_receive
[    2.162608] TCPM: PD RX, header: 0x0 [1]
[    2.163181] TCPM: tcpm_pd_rx_handler: done
[    2.179843] FUSB302: IRQ: 0x41, a: 0x01, b: 0x00, status0: 0x83
[    2.180314] FUSB302: IRQ: PD received hardreset: interrupta: 1
[    2.181125] FUSB302: fusb302_pd_reset:
[    2.182597] TCPM: tcpm_pd_event_handler:
[    2.182937] TCPM: tcpm_pd_event_handler: TCPM_RESET_EVENT
[    2.183292] TCPM: _tcpm_pd_hard_reset: Received hard reset
[    2.183770] TCPM: _tcpm_pd_hard_reset:

Let me know if you need anymore details.

Thanks and Regards
-- 
Suniel Mahesh
Embedded Linux and Kernel Engineer
Amarula Solutions India

^ permalink raw reply	[flat|nested] 8+ messages in thread
* USB PD TYPEC - FUSB302B port controller hard reset issue
@ 2023-12-26 10:48 Suniel Mahesh
  0 siblings, 0 replies; 8+ messages in thread
From: Suniel Mahesh @ 2023-12-26 10:48 UTC (permalink / raw)
  To: Guenter Roeck, Heikki Krogerus, Jagan Teki, Kyle Tso,
	linux-kernel, USB list

Hi Guenter Roeck / Heikki Krogerus and all,

1.
I am testing USB TYPEC PD on a Rockchip Rk3399 SOC based target which
has a FUSB302B TYPEC port controller.

2.
My source is a wall charger which is based on Gallium Nitride (GaN II)
technology and has four ports as follows:

USB-C1: 100W PD3.0, 5V/3A, 9V/3A, 12V/3A, 15V/3A. 20V/5A. PPS: 3.3V-11V/4A
USB-C2: 100W PD3.0. 5V/3A. 9V/3A. 12V/3A, 15V/3A. 20V/5A PPS:3.3-11V/4A
USB-C3: 20W PD3.0, 5V/3A, 9V/2.22A, 12V/1.67A
USB-A: 18W QC3.0. 5V/3A, 9V/2A, 12V/1.5A

3.
i am using latest linux-next and enabled all the relevant configs, especially:
CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_FUSB302=y

4.
DT node is as follows when i use USB-C1 of wall charger:

 connector {
                        compatible = "usb-c-connector";
                        label = "USB-C";
                        data-role = "dual";
                        power-role = "sink";
                        try-power-role = "sink";
                        op-sink-microwatt = <1000000>;
                        sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
                                    PDO_FIXED(12000, 3000, PDO_FIXED_USB_COMM)>;
                };

Issue:
The board power well most of the time, but may be in 1 out of 5 cold
boots, FUSB302B is getting a hard reset, as
FUSB302B INTERRUPTA register bit I_HARDRST is getting set.

After some digging, found out that the above behaviour is accounted to
when something is wrong with the CRC of
the received packet (SOP - Start of Packet)

This behaviour is seen i.e. FUSB302B getting a hard reset more on the
USB-C3 port.

Any pointers on how to solve this issue.

Thanks and Regards
-- 
Suniel Mahesh
Embedded Linux and Kernel Engineer
Amarula Solutions India

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-09 15:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAM+7aWvGerEdUnsKboUg9+EoL=66k3nULHCnQgHyxsWQhUwmpw@mail.gmail.com>
2024-01-02  9:46 ` USB PD TYPEC - FUSB302B port controller hard reset issue Heikki Krogerus
2024-01-02 17:09   ` Guenter Roeck
2024-01-03 14:30     ` Suniel Mahesh
2024-01-03 14:26   ` Suniel Mahesh
2024-01-09  7:17 Suniel Mahesh
2024-01-09  9:18 ` Gábor Stefanik
2024-01-09 15:47 ` Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2023-12-26 10:48 Suniel Mahesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox