From 0d2b1a862fd6aa9b9f6fdf84e2267e85c9991dd2 Mon Sep 17 00:00:00 2001 From: Ziv Xu Date: Thu, 27 Jun 2024 10:59:32 +0800 Subject: board :starfive: devkits: add jtag support Signed-off-by: Ziv Xu --- board/starfive/devkits/spl.c | 11 +++++++++++ board/starfive/devkits/starfive_devkits.c | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/board/starfive/devkits/spl.c b/board/starfive/devkits/spl.c index d20c74b3a5..0e31c14fd8 100644 --- a/board/starfive/devkits/spl.c +++ b/board/starfive/devkits/spl.c @@ -112,6 +112,17 @@ void board_init_f(ulong dummy) clrsetbits_le32(SYS_IOMUX_BASE + 0x274, 0x3, BIT(0) & 0x3); clrsetbits_le32(SYS_IOMUX_BASE + 0x278, 0x3, BIT(0) & 0x3); clrsetbits_le32(SYS_IOMUX_BASE + 0x27c, 0x3, BIT(0) & 0x3); + /*jtag*/ + SYS_IOMUX_DOEN(36, HIGH); + SYS_IOMUX_DIN(36, 4); + SYS_IOMUX_DOEN(61, HIGH); + SYS_IOMUX_DIN(61, 19); + SYS_IOMUX_DOEN(63, HIGH); + SYS_IOMUX_DIN(63, 20); + SYS_IOMUX_DOEN(60, HIGH); + SYS_IOMUX_DIN(60, 29); + SYS_IOMUX_DOEN(44, 8); + SYS_IOMUX_DOUT(44, 22); SYS_IOMUX_DOEN(62, LOW); SYS_IOMUX_DOUT(62, 19); diff --git a/board/starfive/devkits/starfive_devkits.c b/board/starfive/devkits/starfive_devkits.c index 8fd1cb4784..df8ad6982f 100644 --- a/board/starfive/devkits/starfive_devkits.c +++ b/board/starfive/devkits/starfive_devkits.c @@ -91,6 +91,21 @@ static void jh7110_i2c_init (int id) } } +static void jh7110_jtag_init(void) +{ + /*jtag*/ + SYS_IOMUX_DOEN(36, HIGH); + SYS_IOMUX_DIN(36, 4); + SYS_IOMUX_DOEN(61, HIGH); + SYS_IOMUX_DIN(61, 19); + SYS_IOMUX_DOEN(63, HIGH); + SYS_IOMUX_DIN(63, 20); + SYS_IOMUX_DOEN(60, HIGH); + SYS_IOMUX_DIN(60, 29); + SYS_IOMUX_DOEN(44, 8); + SYS_IOMUX_DOUT(44, 22); +} + static void jh7110_gmac_sel_tx_to_rgmii(int id) { switch (id) { @@ -320,6 +335,7 @@ int board_init(void) { enable_caches(); + jh7110_jtag_init(); jh7110_timer_init(); jh7110_usb_init(true); jh7110_gmac_init(0); -- cgit v1.2.3