ARM: imx: imx8m: Introduce and use UART_BASE_ADDR(n)
authorMarek Vasut <marex@denx.de>
Sun, 24 Apr 2022 21:44:03 +0000 (23:44 +0200)
committerStefano Babic <sbabic@denx.de>
Fri, 20 May 2022 07:03:01 +0000 (09:03 +0200)
commit52b6b480db314d623eba536f390c0dc879900262
treeba7224e1eac1a9b2981a844de1ade9d61b844b89
parent16ee0f2afd710854f8fd049d39c1ae99b0cacab7
ARM: imx: imx8m: Introduce and use UART_BASE_ADDR(n)

Introduce helper macro UART_BASE_ADDR(n), which returns Nth UART base
address. Convert all board configurations to this new macro. This is the
first step toward switching CONFIG_MXC_UART_BASE to Kconfig. This is a
clean up, no functional change.

The new macro contains compile-time test to verify N is in suitable
range. The test works such that it multiplies constant N by constant
double-negation of size of a non-empty structure, i.e. it multiplies
constant N by constant 1 in each successful compilation case.

The non-empty structure may contain C11 _Static_assert(), make use of
this and place the kernel variant of static assert in there, so that
it performs the compile-time check for N in the correct range. Note
that it is not possible to directly use static_assert in compound
statements, hence this convoluted construct.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
22 files changed:
arch/arm/include/asm/arch-imx8m/imx-regs.h
include/configs/imx8mm-cl-iot-gate.h
include/configs/imx8mm_beacon.h
include/configs/imx8mm_evk.h
include/configs/imx8mm_icore_mx8mm.h
include/configs/imx8mm_venice.h
include/configs/imx8mn_beacon.h
include/configs/imx8mn_evk.h
include/configs/imx8mn_var_som.h
include/configs/imx8mn_venice.h
include/configs/imx8mp_evk.h
include/configs/imx8mp_rsb3720.h
include/configs/imx8mq_cm.h
include/configs/imx8mq_evk.h
include/configs/imx8mq_phanbell.h
include/configs/kontron-sl-mx8mm.h
include/configs/kontron_pitx_imx8m.h
include/configs/phycore_imx8mm.h
include/configs/phycore_imx8mp.h
include/configs/pico-imx8mq.h
include/configs/verdin-imx8mm.h
include/configs/verdin-imx8mp.h