summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorJakob Unterwurzacher <jakob.unterwurzacher@cherry.de>2025-06-16 15:54:41 +0200
committerJakob Unterwurzacher <jakob.unterwurzacher@cherry.de>2025-06-17 15:19:29 +0200
commitf124b9112cca09f311364f10669c7fe0fc83900d (patch)
tree7b402f5b91159a4e04e0f10e0b09e2defacffd00 /board
parentda88faf87013cf5e586d75e45cae14e5d20b2c69 (diff)
FROMLIST: board: rockchip: unblock CAN bus in spl_board_init on JaguarHEADv2024.07-puma
GPIO0_B7 is routed to TXI of the on-board CAN transceiver. The line has a pull-down per SoC default. This means the CAN transceiver transmits a dominant zero and blocks the CAN bus until Linux boots and reconfigures the pin. Let's switch to pull-up as soon as we can (i.e. in SPL). This cuts down the "bus is blocked" time from 10 seconds to < 1 second. Of course, to this needs CONFIG_SPL_BOARD_INIT, so enable it the Jaguar defconfig. Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de> Link: https://lore.kernel.org/u-boot/20250617084253.1756035-1-jakob.unterwurzacher@cherry.de/ Relates-to: JAG-403 Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>
Diffstat (limited to 'board')
-rw-r--r--board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c19
1 files changed, 19 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);
+}