1 From 3133625859b74df42deddd80b705578af6fc2fea Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Fri, 14 May 2021 13:21:56 +0200
4 Subject: [PATCH] refactor(plat/marvell/uart): de-duplicate PLAT_MARVELL_UART
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 Macros PLAT_MARVELL_BOOT_UART* and PLAT_MARVELL_CRASH_UART* are defined
11 to same values. De-duplicate them into PLAT_MARVELL_UART* macros.
13 Signed-off-by: Pali Rohár <pali@kernel.org>
14 Change-Id: Iae5daf7cad6a971e6f3dbe561df3d0174106ca7f
16 plat/marvell/armada/a3k/common/include/platform_def.h | 7 ++-----
17 plat/marvell/armada/a8k/a80x0_puzzle/board/system_power.c | 4 ++--
18 plat/marvell/armada/a8k/common/include/platform_def.h | 7 ++-----
19 plat/marvell/armada/common/aarch64/marvell_helpers.S | 8 ++++----
20 plat/marvell/armada/common/marvell_console.c | 8 ++++----
21 5 files changed, 14 insertions(+), 20 deletions(-)
23 --- a/plat/marvell/armada/a3k/common/include/platform_def.h
24 +++ b/plat/marvell/armada/a3k/common/include/platform_def.h
27 * PL011 related constants
29 -#define PLAT_MARVELL_BOOT_UART_BASE (MVEBU_REGS_BASE + 0x12000)
30 -#define PLAT_MARVELL_BOOT_UART_CLK_IN_HZ 25000000
32 -#define PLAT_MARVELL_CRASH_UART_BASE PLAT_MARVELL_BOOT_UART_BASE
33 -#define PLAT_MARVELL_CRASH_UART_CLK_IN_HZ PLAT_MARVELL_BOOT_UART_CLK_IN_HZ
34 +#define PLAT_MARVELL_UART_BASE (MVEBU_REGS_BASE + 0x12000)
35 +#define PLAT_MARVELL_UART_CLK_IN_HZ 25000000
37 #define PLAT_MARVELL_BL31_RUN_UART_BASE PLAT_MARVELL_BOOT_UART_BASE
38 #define PLAT_MARVELL_BL31_RUN_UART_CLK_IN_HZ PLAT_MARVELL_BOOT_UART_CLK_IN_HZ
39 --- a/plat/marvell/armada/a8k/a80x0_puzzle/board/system_power.c
40 +++ b/plat/marvell/armada/a8k/a80x0_puzzle/board/system_power.c
41 @@ -41,8 +41,8 @@ int system_power_off(void)
42 len = sizeof(system_off_now);
43 system_off_now[len - 1] = add_xor_checksum(system_off_now, len);
45 - console_16550_register(PLAT_MARVELL_BOOT_UART_BASE + 0x100,
46 - PLAT_MARVELL_BOOT_UART_CLK_IN_HZ, 115200, &console);
47 + console_16550_register(PLAT_MARVELL_UART_BASE + 0x100,
48 + PLAT_MARVELL_UART_CLK_IN_HZ, 115200, &console);
50 /* Send system_off_now to console */
51 for (i = 0; i < len; i++) {
52 --- a/plat/marvell/armada/a8k/common/include/platform_def.h
53 +++ b/plat/marvell/armada/a8k/common/include/platform_def.h
56 * PL011 related constants
58 -#define PLAT_MARVELL_BOOT_UART_BASE (MVEBU_REGS_BASE + 0x512000)
59 -#define PLAT_MARVELL_BOOT_UART_CLK_IN_HZ 200000000
61 -#define PLAT_MARVELL_CRASH_UART_BASE PLAT_MARVELL_BOOT_UART_BASE
62 -#define PLAT_MARVELL_CRASH_UART_CLK_IN_HZ PLAT_MARVELL_BOOT_UART_CLK_IN_HZ
63 +#define PLAT_MARVELL_UART_BASE (MVEBU_REGS_BASE + 0x512000)
64 +#define PLAT_MARVELL_UART_CLK_IN_HZ 200000000
66 #define PLAT_MARVELL_BL31_RUN_UART_BASE PLAT_MARVELL_BOOT_UART_BASE
67 #define PLAT_MARVELL_BL31_RUN_UART_CLK_IN_HZ PLAT_MARVELL_BOOT_UART_CLK_IN_HZ
68 --- a/plat/marvell/armada/common/aarch64/marvell_helpers.S
69 +++ b/plat/marvell/armada/common/aarch64/marvell_helpers.S
70 @@ -63,8 +63,8 @@ endfunc plat_marvell_calc_core_pos
71 * ---------------------------------------------
73 func plat_crash_console_init
74 - mov_imm x0, PLAT_MARVELL_CRASH_UART_BASE
75 - mov_imm x1, PLAT_MARVELL_CRASH_UART_CLK_IN_HZ
76 + mov_imm x0, PLAT_MARVELL_UART_BASE
77 + mov_imm x1, PLAT_MARVELL_UART_CLK_IN_HZ
78 mov_imm x2, MARVELL_CONSOLE_BAUDRATE
80 b console_a3700_core_init
81 @@ -81,7 +81,7 @@ endfunc plat_crash_console_init
82 * ---------------------------------------------
84 func plat_crash_console_putc
85 - mov_imm x1, PLAT_MARVELL_CRASH_UART_BASE
86 + mov_imm x1, PLAT_MARVELL_UART_BASE
89 b console_a3700_core_putc
90 @@ -99,7 +99,7 @@ endfunc plat_crash_console_putc
91 * ---------------------------------------------
93 func plat_crash_console_flush
94 - mov_imm x0, PLAT_MARVELL_CRASH_UART_BASE
95 + mov_imm x0, PLAT_MARVELL_UART_BASE
97 b console_a3700_core_flush
99 --- a/plat/marvell/armada/common/marvell_console.c
100 +++ b/plat/marvell/armada/common/marvell_console.c
101 @@ -31,8 +31,8 @@ static console_t marvell_runtime_console
102 void marvell_console_boot_init(void)
105 - console_marvell_register(PLAT_MARVELL_BOOT_UART_BASE,
106 - PLAT_MARVELL_BOOT_UART_CLK_IN_HZ,
107 + console_marvell_register(PLAT_MARVELL_UART_BASE,
108 + PLAT_MARVELL_UART_CLK_IN_HZ,
109 MARVELL_CONSOLE_BAUDRATE,
110 &marvell_boot_console);
112 @@ -58,8 +58,8 @@ void marvell_console_boot_end(void)
113 void marvell_console_runtime_init(void)
116 - console_marvell_register(PLAT_MARVELL_BOOT_UART_BASE,
117 - PLAT_MARVELL_BOOT_UART_CLK_IN_HZ,
118 + console_marvell_register(PLAT_MARVELL_UART_BASE,
119 + PLAT_MARVELL_UART_CLK_IN_HZ,
120 MARVELL_CONSOLE_BAUDRATE,
121 &marvell_runtime_console);