summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c19
-rw-r--r--configs/jaguar-rk3588_defconfig1
2 files changed, 20 insertions, 0 deletions
diff --git a/board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c b/board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c
index a6d44f10db3..3f484646701 100644
--- a/board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c
+++ b/board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c
@@ -51,3 +51,22 @@ int rockchip_early_misc_init_r(void)
return 0;
}
+
+#define GPIO0B7_PU_EN BIT(15)
+
+void spl_board_init(void)
+{
+ /*
+ * GPIO0_B7 is routed to CAN TX. This SoC pin has a pull-down per default.
+ * So on power-up, we block the CAN bus with a dominant zero. We want to keep
+ * this blocking time to a minimum, so we want to get this pin high in SPL.
+ *
+ * The CAN driver in Linux disables the pull-down and sets the pin to
+ * output high. We don't have a CAN driver in U-Boot and don't need one,
+ * so we just use the easiest way to get the pin high, which is setting a
+ * pull-up.
+ */
+ struct rk3588_pmu2_ioc * const ioc = (void *)PMU2_IOC_BASE;
+
+ rk_setreg(&ioc->gpio0b_p, GPIO0B7_PU_EN);
+}
diff --git a/configs/jaguar-rk3588_defconfig b/configs/jaguar-rk3588_defconfig
index 18006467dde..3d0c017c0c6 100644
--- a/configs/jaguar-rk3588_defconfig
+++ b/configs/jaguar-rk3588_defconfig
@@ -27,6 +27,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_CYCLIC=y
CONFIG_SPL_MAX_SIZE=0x40000
CONFIG_SPL_PAD_TO=0x7f8000
+CONFIG_SPL_BOARD_INIT=y
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
CONFIG_SPL_ATF=y
# CONFIG_BOOTM_NETBSD is not set