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>
1 parent 0595abc commit cc5859ca19ff546c35eb0331000dae090b6eabcf
@Soby Mathew Soby Mathew authored on 10 Oct 2018
Showing 10 changed files
View
drivers/arm/pl011/aarch32/pl011_console.S
View
drivers/arm/pl011/aarch64/pl011_console.S
View
drivers/cadence/uart/aarch64/cdns_console.S
View
drivers/console/aarch64/skeleton_console.S
View
drivers/coreboot/cbmem_console/aarch64/cbmem_console.S
View
drivers/ti/uart/aarch64/16550_console.S
View
include/common/aarch32/console_macros.S
View
include/common/aarch64/console_macros.S
View
plat/imx/common/lpuart_console.S
View
plat/layerscape/common/aarch64/ls_console.S