Re: [PATCH v2 0/4] usb: typec: tipd: add patch update support for tps6598x

From: Jai Luthra
Date: Thu Jan 04 2024 - 09:22:27 EST


Hi Javier, Greg,

On Dec 14, 2023 at 17:29:08 +0100, Javier Carrasco wrote:
> This series extends the patch update mechanism to support the tps6598x.
>
> Currently there is only support for the tps25750 part and some
> conditional clauses are used to make a special case out of it. Now that
> different parts support patch updates, a more general approach is
> proposed.
>
> The update mechanism differs from the one required by tps25750 and it is
> explained in the commit message as a summary of the application note in
> that respect.
>
> Note that the series makes use of the TPS_SETUP_MS introduced in
> commit 6a4d4a27f986 ("usb: typec: tps6598x: add reset gpio support"),
> which is currently available in usb-next / usb-testing.
>
> A TPS65987D has been used to test this functionality with positive
> results.
>
> Signed-off-by: Javier Carrasco <javier.carrasco@xxxxxxxxxxxxxx>
> ---
> Changes in v2:
> - Remove probe defeferring mechanism and expect the firmware to be
> available (Heikki Krogerus).
> - Link to v1:
> https://lore.kernel.org/r/20231207-tps6598x_update-v1-0-dc21b5301d91@xxxxxxxxxxxxxx
>

FYI, this series breaks boot for TI SK-AM62A and SK-AM62 which use
TPS6598x as the USB-C PD chip.

The platforms stopped booting since next-20240103 [1], and reverting
this series [4] seems to fix the issue [2]

Is there any change needed in the board device-tree [3] and bindings?

We don't specify any firmware in the device-tree node, but seems like
that is an assumption in this series. I tried reverting it (below
change) but that did *not* help with the stuck boot.

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index a956eb976906..fa3bd7349265 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -1139,7 +1139,7 @@ static int tps6598x_apply_patch(struct tps6598x *tps)
ret = device_property_read_string(tps->dev, "firmware-name",
&firmware_name);
if (ret)
- return ret;
+ return 0;

ret = tps_request_firmware(tps, &fw);
if (ret)


[1] https://linux.kernelci.org/soc/ti/job/next/kernel/next-20240103/plan/baseline-nfs/
[2] https://gist.github.com/jailuthra/0c077176585e4df2f8b78f7784087865
[3] https://gitlab.com/linux-kernel/linux-next/-/blob/master/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts#L305
[4] https://github.com/jailuthra/linux/commits/next-20240103-tps6598-fix/

> ---
> Javier Carrasco (4):
> usb: typec: tipd: add init and reset functions to tipd_data
> usb: typec: tipd: add function to request firmware
> usb: typec: tipd: declare in_data in as const in exec_cmd functions
> usb: typec: tipd: add patch update support for tps6598x
>
> drivers/usb/typec/tipd/core.c | 150 ++++++++++++++++++++++++++++++++------
> drivers/usb/typec/tipd/tps6598x.h | 18 +++++
> 2 files changed, 147 insertions(+), 21 deletions(-)
> ---
> base-commit: 51920207674e9e3475a91d2091583889792df99a
> change-id: 20231207-tps6598x_update-632eab69d2ed
>
> Best regards,
> --
> Javier Carrasco <javier.carrasco@xxxxxxxxxxxxxx>
>
>


--
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145

Attachment: signature.asc
Description: PGP signature