diff options
author | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2023-12-23 22:50:04 -0600 |
---|---|---|
committer | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2023-12-23 22:50:04 -0600 |
commit | aae8818fbc80281699f085d0fffbab659f184387 (patch) | |
tree | 31295b343643d33e7f8e60a03a9a15d2eaecc193 | |
parent | 4399fed38456dfa15c57ad0def67e25c40c8338c (diff) |
Select UART function for GPIO 0 and 1
-rw-r--r-- | uart.s | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -19,6 +19,10 @@ .equ UARTLCR_H_OFST, 0x2c .equ UARTCR_OFST, 0x30 +.equ IO_BANK0_BASE, 0x40014000 +.equ GPIO0_CTRL_OFST, 0x04 +.equ GPIO1_CTRL_OFST, 0x0c + .equ ATOMIC_CLEAR, 0x3000 .type setup_uart, %function @@ -26,6 +30,12 @@ setup_uart: + // Configure GPIO 0 and 1 as UART0 + ldr r1, =IO_BANK0_BASE + movs r0, 2 // UART function = 2 + str r0, [r1, GPIO0_CTRL_OFST] + str r0, [r1, GPIO1_CTRL_OFST] + // Deassert the reset ldr r1, =(RESETS_BASE + ATOMIC_CLEAR) movs r0, 1 |