summaryrefslogtreecommitdiff
path: root/plat/layerscape
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2018-10-10 16:03:09 +0100
committerSoby Mathew <soby.mathew@arm.com>2018-10-19 17:34:52 +0100
commitcc5859ca19ff546c35eb0331000dae090b6eabcf (patch)
tree8f19e77c7dd002e401dfbf026078a7e033e9dc68 /plat/layerscape
parent0595abceba85bee8d6c27e6e122722f816610df7 (diff)
Multi-console: Deprecate the `finish_console_register` macro
The `finish_console_register` macro is used by the multi console framework to register the `console_t` driver callbacks. It relied on weak references to the `ldr` instruction to populate 0 to the callback in case the driver has not defined the appropriate function. Use of `ldr` instruction to load absolute address to a reference makes the binary position dependant. These instructions should be replaced with adrp/adr instruction for position independant executable(PIE). But adrp/adr instructions don't work well with weak references as described in GNU ld bugzilla issue 22589. This patch defines a new version of `finish_console_register` macro which can spcify which driver callbacks are valid and deprecates the old one. If any of the argument is not specified, then the macro populates 0 for that callback. Hence the functionality of the previous deprecated macro is preserved. The USE_FINISH_CONSOLE_REG_2 define is used to select the new variant of the macro and will be removed once the deprecated variant is removed. All the upstream console drivers have been migrated to use the new macro in this patch. NOTE: Platforms be aware that the new variant of the `finish_console_register` should be used and the old variant is deprecated. Change-Id: Ia6a67aaf2aa3ba93932992d683587bbd0ad25259 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Diffstat (limited to 'plat/layerscape')
-rw-r--r--plat/layerscape/common/aarch64/ls_console.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/plat/layerscape/common/aarch64/ls_console.S b/plat/layerscape/common/aarch64/ls_console.S
index 5c87465e..ec4390a6 100644
--- a/plat/layerscape/common/aarch64/ls_console.S
+++ b/plat/layerscape/common/aarch64/ls_console.S
@@ -6,6 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
+#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
#include <assert_macros.S>
#include "ls_16550.h"
@@ -106,7 +107,7 @@ func console_ls_16550_register
mov x0, x6
mov x30, x7
- finish_console_register ls_16550
+ finish_console_register ls_16550 putc=1, getc=1, flush=1
register_fail:
ret x7