u-boot/test
Alper Nebi Yasak 226fce6108 phy: Track power-on and init counts in uclass
On boards using the RK3399 SoC, the USB OHCI and EHCI controllers share
the same PHY device instance. While these controllers are being stopped
they both attempt to power-off and deinitialize it, but trying to
power-off the deinitialized PHY device results in a hang. This usually
happens just before booting an OS, and can be explicitly triggered by
running "usb start; usb stop" in the U-Boot shell.

Implement a uclass-wide counting mechanism for PHY initialization and
power state change requests, so that we don't power-off/deinitialize a
PHY instance until all of its users want it done. The Allwinner A10 USB
PHY driver does this counting in-driver, remove those parts in favour of
this in-uclass implementation.

The sandbox PHY operations test needs some changes since the uclass will
no longer call into the drivers for actions matching its tracked state
(e.g. powering-off a powered-off PHY). Update that test, and add a new
one which simulates multiple users of a single PHY.

The major complication here is that PHY handles aren't deduplicated per
instance, so the obvious idea of putting the counts in the PHY handles
don't immediately work. It seems possible to bind a child udevice per
PHY instance to the PHY provider and deduplicate the handles in each
child's uclass-private areas, like in the CLK framework. An alternative
approach could be to use those bound child udevices themselves as the
PHY handles. Instead, to avoid the architectural changes those would
require, this patch solves things by dynamically allocating a list of
structs (one per instance) in the provider's uclass-private area.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com> - Rock960
2022-01-14 14:36:57 -05:00
..
cmd test: cmd: setexpr: add format string tests 2021-07-27 17:56:13 -04:00
common sandbox: Reduce keyed autoboot delay 2021-08-01 09:05:24 -06:00
dm phy: Track power-on and init counts in uclass 2022-01-14 14:36:57 -05:00
env sandbox: add test of CONFIG_ENV_IMPORT_FDT 2021-05-04 12:52:30 -04:00
fs Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
image sandbox: Support executables for more phases 2021-07-21 10:27:34 -06:00
lib lmb: remove lmb_is_nomap() from include 2021-11-20 10:53:00 +01:00
log log: Allow padding of the function name 2021-07-21 10:27:35 -06:00
optee test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
overlay test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
py test: test_lsblk: Mark as sandbox specific 2022-01-14 12:26:42 -05:00
stdint Remove <inttypes.h> includes and PRI* usages in printf() entirely 2018-09-10 20:48:17 -04:00
trace SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bloblist.c bloblist: Add functions to obtain base address and size 2022-01-13 09:13:41 -07:00
bootm.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
cmd_ut.c test: add first autoboot unit tests 2021-07-23 13:36:20 -04:00
command_ut.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
common.sh Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
compression.c lz4: Use a private header for U-Boot 2021-10-09 13:09:56 -04:00
Kconfig lib: add crypt subsystem 2021-07-23 13:36:14 -04:00
Makefile test: add first autoboot unit tests 2021-07-23 13:36:20 -04:00
nokia_rx51_test.sh Nokia RX-51: Add check for /lib/ld-linux.so.2 in test script 2021-07-15 17:56:05 +05:30
print_ut.c test: test truncation in snprintf() 2021-11-20 10:53:00 +01:00
run test: Run sandbox_spl tests on sandbox_noinst 2021-03-26 17:03:09 +13:00
str_ut.c lib: Allow using 0x when a decimal value is requested 2021-08-02 13:32:14 -04:00
test-main.c test: Avoid a build error with SPL 2021-07-21 10:27:34 -06:00
time_ut.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
unicode_ut.c Prepare v2021.04-rc4 2021-03-15 12:15:38 -04:00
ut.c test: Add a way to skip console checking until a string matches 2021-09-16 14:39:40 -04:00