[PATCH v3 4/7] board: rock5b-rk3588: enable USB-C in operating system

Sebastian Reichel sebastian.reichel at collabora.com
Fri Aug 2 19:59:34 CEST 2024


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. Currently existing upstream kernel DTs do
not yet have the USB-C controller at all, so we ignore any
failures.

Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
---
 board/radxa/rock5b-rk3588/rock5b-rk3588.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/board/radxa/rock5b-rk3588/rock5b-rk3588.c b/board/radxa/rock5b-rk3588/rock5b-rk3588.c
index 1c17ae93c76c..4e926ebf2cb0 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
@@ -33,3 +35,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
-- 
2.43.0



More information about the U-Boot mailing list