diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-07-19 15:21:26 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-02-22 16:10:28 +0100 |
commit | 53af7f3ab6f4c71b9bd06ef034fed864c5c456e2 (patch) | |
tree | d2b097a1f12b6d0156b163bf2ce923ed0f7c487a /bsps/sparc/leon3/console/printk_support.c | |
parent | 33ea785685745cee337a7af2bd60f2e4ee6bfb73 (diff) |
bsps: Use new APBUART register block API
Diffstat (limited to 'bsps/sparc/leon3/console/printk_support.c')
-rw-r--r-- | bsps/sparc/leon3/console/printk_support.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/bsps/sparc/leon3/console/printk_support.c b/bsps/sparc/leon3/console/printk_support.c index f9cf0b7520..d540e75911 100644 --- a/bsps/sparc/leon3/console/printk_support.c +++ b/bsps/sparc/leon3/console/printk_support.c @@ -16,14 +16,17 @@ */ #include <bsp.h> -#include <leon.h> +#include <bsp/leon3.h> #include <rtems/bspIo.h> #include <rtems/sysinit.h> #include <rtems/score/thread.h> #include <grlib/apbuart.h> +#include <grlib/io.h> + +#include <grlib/ambapp.h> int leon3_debug_uart_index __attribute__((weak)) = 0; -struct apbuart_regs *leon3_debug_uart = NULL; +apbuart *leon3_debug_uart = NULL; static void bsp_debug_uart_init(void); @@ -86,15 +89,18 @@ static void bsp_debug_uart_init(void) ambapp_find_by_idx, (void *)&i); if (adev != NULL) { struct ambapp_apb_info *apb; + uint32_t ctrl; /* * Found a matching debug console, initialize debug UART if present for * printk(). */ apb = (struct ambapp_apb_info *)adev->devinfo; - leon3_debug_uart = (struct apbuart_regs *)apb->start; - leon3_debug_uart->ctrl |= APBUART_CTRL_RE | APBUART_CTRL_TE; - leon3_debug_uart->status = 0; + leon3_debug_uart = (apbuart *)apb->start; + ctrl = grlib_load_32(&leon3_debug_uart->ctrl); + ctrl |= APBUART_CTRL_RE | APBUART_CTRL_TE; + grlib_store_32(&leon3_debug_uart->ctrl, ctrl); + grlib_store_32(&leon3_debug_uart->status, 0); BSP_poll_char = bsp_debug_uart_poll_char; BSP_output_char = bsp_debug_uart_output_char; |