[2/2] refactor(imx8m): replace magic number with macros

Message ID 20240724073401.1587434-2-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • [1/2] fix(imx8m): set uart domain permission
Related show

Commit Message

Dario Binacchi July 24, 2024, 7:34 a.m. UTC
Replace the UARTs base addresses with the appropriate constants
previously defined in the file "imx8m_uart.h".

Fammi sapere se hai altre richieste di traduzione o altre domande!
Replace the uart base address using ose RDC config related magic numbers with enum type

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 plat/imx/imx8m/imx8m_ccm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Patch

diff --git a/plat/imx/imx8m/imx8m_ccm.c b/plat/imx/imx8m/imx8m_ccm.c
index 10a00c990031..96b38e2712e1 100644
--- a/plat/imx/imx8m/imx8m_ccm.c
+++ b/plat/imx/imx8m/imx8m_ccm.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <lib/mmio.h>
+#include <imx8m_uart.h>
 #include <platform_def.h>
 
 #define UCR1    		0x80
@@ -17,16 +18,16 @@  static struct imx_uart {
 } imx8m_uart_info[] = {
 	{	/* UART 1 */
 		.ccm_reg = 0x4490,
-		.uart_base = 0x30860000,
+		.uart_base = UART1_BASE_ADDR,
 	}, {	/* UART 2 */
 		.ccm_reg = 0x44a0,
-		.uart_base = 0x30890000,
+		.uart_base = UART2_BASE_ADDR,
 	}, {	/* UART 3 */
 		.ccm_reg = 0x44b0,
-		.uart_base = 0x30880000,
+		.uart_base = UART3_BASE_ADDR,
 	}, {	/* UART 4 */
 		.ccm_reg = 0x44c0,
-		.uart_base = 0x30a60000,
+		.uart_base = UART4_BASE_ADDR,
 	}
 };