Since older U-Boot releases do not negotiate USB PD, the kernel
DT may not enable the USB-C controller by default to avoid a
regression. The plan is to upstream it with 'status = "fail";'
instead. U-Boot should then mark it as 'status = "okay";' if
it negotiated USB PD.

Signed-off-by: Sebastian Reichel <sebastian.reic...@collabora.com>
---
FWIW, I have not yet send the kernel patch, since I want the following
patch to be applied first:

https://lore.kernel.org/linux-usb/20240523171806.223727-1-sebastian.reic...@collabora.com/
---
 board/radxa/rock5b-rk3588/rock5b-rk3588.c | 11 +++++++++++
 configs/rock5b-rk3588_defconfig           |  1 +
 2 files changed, 12 insertions(+)

diff --git a/board/radxa/rock5b-rk3588/rock5b-rk3588.c 
b/board/radxa/rock5b-rk3588/rock5b-rk3588.c
index 75856ccb1288..d688ef20b79c 100644
--- a/board/radxa/rock5b-rk3588/rock5b-rk3588.c
+++ b/board/radxa/rock5b-rk3588/rock5b-rk3588.c
@@ -3,6 +3,8 @@
  * Copyright (c) 2023-2024 Collabora Ltd.
  */
 
+#include <fdtdec.h>
+#include <fdt_support.h>
 #include <usb/tcpm.h>
 
 #ifdef CONFIG_MISC_INIT_R
@@ -20,3 +22,12 @@ int misc_init_r(void)
        return 0;
 }
 #endif
+
+#ifdef CONFIG_OF_BOARD_SETUP
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+       if (IS_ENABLED(CONFIG_MISC_INIT_R))
+               fdt_status_okay_by_compatible(blob, "fcs,fusb302");
+       return 0;
+}
+#endif
diff --git a/configs/rock5b-rk3588_defconfig b/configs/rock5b-rk3588_defconfig
index e368b0439d1d..f056728d338b 100644
--- a/configs/rock5b-rk3588_defconfig
+++ b/configs/rock5b-rk3588_defconfig
@@ -23,6 +23,7 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_OF_BOARD_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-rock-5b.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-- 
2.43.0

Reply via email to