diff options
author | jianlonghuang <jianlong.huang@starfivetech.com> | 2022-07-06 16:12:16 +0300 |
---|---|---|
committer | Jianlong Huang <jianlong.huang@starfivetech.com> | 2022-11-03 11:22:14 +0300 |
commit | e67867c5f8062448479b6ae647aa6cfaab6134da (patch) | |
tree | 95600acd32d2c25f785a8f1f82b891d813eb4a4c /board | |
parent | ad9e1dc0ba91125117eb8d2a8474048c9632c530 (diff) | |
download | u-boot-e67867c5f8062448479b6ae647aa6cfaab6134da.tar.xz |
board: starfive: visionfive: Add uart0 and jtag pinmux
Signed-off-by: jianlonghuang <jianlong.huang@starfivetech.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/starfive/visionfive2/spl.c | 19 | ||||
-rwxr-xr-x | board/starfive/visionfive2/starfive_visionfive2.c | 27 |
2 files changed, 46 insertions, 0 deletions
diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c index 6ba7fc7cc3..6a088e05f2 100644 --- a/board/starfive/visionfive2/spl.c +++ b/board/starfive/visionfive2/spl.c @@ -243,6 +243,25 @@ void board_init_f(ulong dummy) /*set GPIO to 3.3v*/ setbits_le32(SYS_SYSCON_BASE + 0xC, 0x0); + /*uart0 tx*/ + SYS_IOMUX_DOEN(41, LOW); + SYS_IOMUX_DOUT(41, 20); + /*uart0 rx*/ + SYS_IOMUX_DOEN(40, HIGH); + SYS_IOMUX_DIN(40, 14); + + /*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); + /*set sdio0 sdcard clk default div to 4*/ clrsetbits_le32(SYS_CRG_BASE + CLK_SDIO0_SDCARD_OFFSET, CLK_SDIO0_SDCARD_MASK, diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c index 2bbacf32a9..f4d8f494c0 100755 --- a/board/starfive/visionfive2/starfive_visionfive2.c +++ b/board/starfive/visionfive2/starfive_visionfive2.c @@ -168,6 +168,31 @@ static void enable_prefetcher(void) } } +static void jh7110_uart0_init(void) +{ + /*uart0 tx*/ + SYS_IOMUX_DOEN(41, LOW); + SYS_IOMUX_DOUT(41, 20); + /*uart0 rx*/ + SYS_IOMUX_DOEN(40, HIGH); + SYS_IOMUX_DIN(40, 14); +} + +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); +} + int board_init(void) { enable_caches(); @@ -175,6 +200,8 @@ int board_init(void) /*enable hart1-hart4 prefetcher*/ enable_prefetcher(); + jh7110_uart0_init(); + jh7110_jtag_init(); jh7110_gmac_init(0); jh7110_gmac_init(1); jh7110_timer_init(); |