diff options
| author | Marek Vasut <marek.vasut+renesas@mailbox.org> | 2026-01-06 23:13:08 +0100 |
|---|---|---|
| committer | Marek Vasut <marek.vasut+renesas@mailbox.org> | 2026-01-10 03:08:34 +0100 |
| commit | 4a6b037d87199ea63602be38e41272ab0d00172f (patch) | |
| tree | f9198408d21243f3bb836b5f8e8361a035ab8331 | |
| parent | 656a8564ec06a4f737c2eeb9fd6e580e8f002c14 (diff) | |
| download | arm-trusted-firmware-4a6b037d87199ea63602be38e41272ab0d00172f.tar.gz arm-trusted-firmware-4a6b037d87199ea63602be38e41272ab0d00172f.zip | |
feat(rcar): fold console_rcar_* functions into rcar_printf.c
The three console_rcar_{init,putc,flush}() no-op functions can
easily be C functions, they do not need assembler wrappers. Move
the functions into rcar_printf.c which is part of the custom
R-Car Gen3 memory logging console. Remove rcar_printf.c from
BL2 builds, as it is not useful there. Rename rcar_set_log_data()
to console_rcar_putc() and update its signature, it is no longer
necessary to have such a wrapper around C function.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Change-Id: Ia7a1c37b2151f6217cde70ffd2b367643d3184e4
| -rw-r--r-- | drivers/renesas/common/console/rcar_console.S | 49 | ||||
| -rw-r--r-- | drivers/renesas/common/console/rcar_printf.c | 16 | ||||
| -rw-r--r-- | drivers/renesas/common/console/rcar_printf.h | 3 | ||||
| -rw-r--r-- | plat/renesas/common/common.mk | 1 |
4 files changed, 16 insertions, 53 deletions
diff --git a/drivers/renesas/common/console/rcar_console.S b/drivers/renesas/common/console/rcar_console.S index b683d7bfb..40ebe1a01 100644 --- a/drivers/renesas/common/console/rcar_console.S +++ b/drivers/renesas/common/console/rcar_console.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021, Renesas Electronics Corporation. All rights reserved. + * Copyright (c) 2018-2026, Renesas Electronics Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -10,12 +10,8 @@ #include <drivers/renesas/rcar/console/console.h> .globl console_rcar_register - .globl console_rcar_init - .globl console_rcar_putc - .globl console_rcar_flush .extern rcar_log_init - .extern rcar_set_log_data /* ----------------------------------------------- * int console_rcar_register( @@ -48,46 +44,3 @@ func console_rcar_register register_fail: ret x7 endfunc console_rcar_register - - /* --------------------------------------------- - * int console_rcar_init(unsigned long base_addr, - * unsigned int uart_clk, unsigned int baud_rate) - * Function to initialize the console without a - * C Runtime to print debug information. This - * function will be accessed by crash reporting. - * In: x0 - console base address - * w1 - Uart clock in Hz - * w2 - Baud rate - * Out: return 1 on success - * Clobber list : x1, x2 - * --------------------------------------------- - */ -func console_rcar_init - mov w0, #1 - ret -endfunc console_rcar_init - - /* -------------------------------------------------------- - * int console_rcar_putc(int c, console_t *console) - * Function to output a character over the console. It - * returns the character printed on success or -1 on error. - * In : w0 - character to be printed - * x1 - pointer to console_t structure - * Out : return -1 on error else return character. - * Clobber list : x2 - * -------------------------------------------------------- - */ -func console_rcar_putc - b rcar_set_log_data -endfunc console_rcar_putc - - /* --------------------------------------------- - * void console_rcar_flush(void) - * Function to force a write of all buffered - * data that hasn't been output. It returns void - * Clobber list : x0, x1 - * --------------------------------------------- - */ -func console_rcar_flush - ret -endfunc console_rcar_flush diff --git a/drivers/renesas/common/console/rcar_printf.c b/drivers/renesas/common/console/rcar_printf.c index 6af10eeca..f0fac43d9 100644 --- a/drivers/renesas/common/console/rcar_printf.c +++ b/drivers/renesas/common/console/rcar_printf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2020, Renesas Electronics Corporation. All rights reserved. + * Copyright (c) 2015-2026, Renesas Electronics Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -43,7 +43,7 @@ typedef struct log_map { uint8_t res_data[RCAR_LOG_RES_SIZE]; } logmap_t; -int32_t rcar_set_log_data(int32_t c) +int console_rcar_putc(int c, console_t *pconsole) { logmap_t *t_log; @@ -106,3 +106,15 @@ int32_t rcar_log_init(void) return 1; } + +int console_rcar_flush(console_t *pconsole) +{ + /* Nothing to do */ + return 0; +} + +int console_rcar_init(uintptr_t base_addr, uint32_t uart_clk, + uint32_t baud_rate) +{ + return 1; +} diff --git a/drivers/renesas/common/console/rcar_printf.h b/drivers/renesas/common/console/rcar_printf.h index 5da70e636..125881308 100644 --- a/drivers/renesas/common/console/rcar_printf.h +++ b/drivers/renesas/common/console/rcar_printf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019, Renesas Electronics Corporation. All rights reserved. + * Copyright (c) 2015-2026, Renesas Electronics Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -9,7 +9,6 @@ #include <string.h> -int32_t rcar_set_log_data(int32_t c); int32_t rcar_log_init(void); #endif /* RCAR_PRINTF_H */ diff --git a/plat/renesas/common/common.mk b/plat/renesas/common/common.mk index a9ff0fdc9..4ed1142e0 100644 --- a/plat/renesas/common/common.mk +++ b/plat/renesas/common/common.mk @@ -101,7 +101,6 @@ BL2_SOURCES += ${RCAR_GIC_SOURCES} \ plat/renesas/common/bl2_plat_mem_params_desc.c \ plat/renesas/common/plat_image_load.c \ plat/renesas/common/bl2_cpg_init.c \ - drivers/renesas/common/console/rcar_printf.c \ drivers/renesas/common/scif/scif-common.c \ drivers/renesas/common/scif/scif.c \ drivers/renesas/common/scif/scif_helpers.S \ |
