u-boot/doc/usage/cmd
Sebastian Reichel 1db4c0ac77 usb: tcpm: add core framework
This adds TCPM framework in preparation for fusb302 support, which can
handle USB power delivery messages. This is needed to solve issues with
devices, that are running from a USB-C port supporting USB-PD, but not
having a battery.

Such a device currently boots to the kernel without interacting with
the power-supply at all. If there are no USB-PD message replies within
5 seconds, the power-supply assumes the peripheral is not capable of
USB-PD. It usually takes more than 5 seconds for the system to reach
the kernel and probe the I2C based fusb302 chip driver. Thus the
system always runs into this state. The power-supply's solution to
fix this error state is a hard reset, which involves removing the
power from VBUS. Boards without a battery (or huge capacitors) will
reset at this point resulting in a boot loop.

This imports the TCPM framework from the kernel. The porting has
originally been done by Rockchip using hardware timers and the Linux
kernel's TCPM code from some years ago.

I had a look at upgrading to the latest TCPM kernel code, but that
beast became a lot more complex due to adding more USB-C features.
I believe these features are not needed in U-Boot and with multiple
kthreads and hrtimers being involved it is non-trivial to port them.
Instead I worked on stripping down features from the Rockchip port
to an even more basic level. Also the TCPM code has been reworked
to avoid complete use of any timers (Rockchip used SoC specific
hardware timers + IRQ to implement delayed work mechanism). Instead
the delayed state changes are handled directly from the poll loop.

Note, that (in contrast to the original Rockchip port) the state
machine has the same hard reset quirk, that the kernel has - i.e.
it avoids disabling the CC pin resistors for devices that are not
self-powered. Without that quirk, the Radxa Rock 5B will not just
end up doing a machine reset when a hard reset is triggered, but will
not even recover, because the CPU will loose power and the FUSB302
will keep this state because of leak voltage arriving through the RX
serial pin (assuming a serial adapter is connected).

This also includes a 'tcpm' command, which can be used to get
information about the current state and the negotiated voltage
and current.

Co-developed-by: Wang Jie <dave.wang@rock-chips.com>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Tested-by: Soeren Moch <smoch@web.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2024-10-17 03:12:47 +02:00
..
acpi.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
addrmap.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
armffa.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
askenv.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
base.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
bdinfo.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
bind.rst cmd: bind: Use device sequence instead for driver bind/unbind 2024-08-27 14:30:14 -06:00
blkcache.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
bootd.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
bootdev.rst doc: Move bootstd into its own directory 2024-07-19 13:53:05 +02:00
bootefi.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
bootelf.rst doc: add bootelf command documentation 2024-07-14 09:56:24 +02:00
bootflow.rst doc: Move bootstd into its own directory 2024-07-19 13:53:05 +02:00
booti.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
bootm.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
bootmenu.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
bootmeth.rst bootstd: Add command to enable setting of bootmeth specific properties 2024-10-15 10:24:27 -06:00
bootz.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
button.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
cat.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
cbsysinfo.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
cedit.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
cli.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
cls.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
cmp.rst Documentation: 2024-01-17 09:27:23 -05:00
coninfo.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
conitrace.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
cp.rst Documentation: 2024-01-17 09:27:23 -05:00
cpu.rst doc: cmd: add documentation for cpu command 2024-08-02 15:16:51 -03:00
cyclic.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
dm.rst dm: core: Show device sequence instead in dm_dump_tree() 2024-08-27 14:30:02 -06:00
ebtupdate.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
echo.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
efi.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
eficonfig.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
env.rst env: remove vars that are not in default env 2024-08-15 11:50:47 -06:00
event.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
exception.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
exit.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
extension.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
false.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
fatinfo.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
fatload.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
fdt.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
font.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
for.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
fwu_mdata.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
gpio.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
gpt.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
history.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
host.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
if.rst doc: add reference to itest in if man-page 2024-03-27 09:30:07 +01:00
imxtract.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
itest.rst doc: fix heading level of itest examples 2024-07-14 09:56:24 +02:00
load.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
loadb.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
loadm.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
loads.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
loadx.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
loady.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
mbr.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
md.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
mmc.rst cmd: mmc: Allow using partition name in mmc erase command 2024-09-16 16:45:55 -06:00
mtest.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
mtrr.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
panic.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
part.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
pause.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
pinmux.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
printenv.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
pstore.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
pwm.rst doc: document the pwm command 2024-08-24 11:35:55 +02:00
qfw.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
read.rst doc: document read/write commands 2023-03-17 16:10:42 -04:00
reset.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
rng.rst cmd: rng: Add rng list command 2024-03-13 12:40:43 -04:00
saves.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
sbi.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
scmi.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
scp03.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
seama.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
setexpr.rst cmd: setexpr: fix no matching string in gsub return empty value 2024-03-02 12:26:19 -05:00
sf.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
size.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
sleep.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
sm.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
smbios.rst doc: man-page for smbios command 2024-01-26 14:15:08 +01:00
sound.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
source.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
tcpm.rst usb: tcpm: add core framework 2024-10-17 03:12:47 +02:00
temperature.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
tftpput.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
trace.rst doc: typo Synopis 2024-03-21 07:29:19 +01:00
true.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
ums.rst doc: usage: cmd: ums: fix dependencies 2024-09-21 11:22:42 +02:00
unbind.rst cmd: bind: Use device sequence instead for driver bind/unbind 2024-08-27 14:30:14 -06:00
upl.rst upl: Add initial documentation 2024-08-09 16:03:20 -06:00
ut.rst test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
wdt.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
wget.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
write.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00
xxd.rst doc: create index entries for commands 2024-01-17 08:40:19 +01:00