7a1f19a0029aa97b4dcb24b4187b1769dfc283b1
[openwrt/openwrt.git] / package / boot / arm-trusted-firmware-mvebu / patches / 102-refactor-plat-marvell-uart-de-duplicate-PLAT_MARVELL.patch
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
5 macros
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
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.
12
13 Signed-off-by: Pali Rohár <pali@kernel.org>
14 Change-Id: Iae5daf7cad6a971e6f3dbe561df3d0174106ca7f
15 ---
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(-)
22
23 --- a/plat/marvell/armada/a3k/common/include/platform_def.h
24 +++ b/plat/marvell/armada/a3k/common/include/platform_def.h
25 @@ -163,11 +163,8 @@
26 /*
27 * PL011 related constants
28 */
29 -#define PLAT_MARVELL_BOOT_UART_BASE (MVEBU_REGS_BASE + 0x12000)
30 -#define PLAT_MARVELL_BOOT_UART_CLK_IN_HZ 25000000
31 -
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
36
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);
44
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);
49
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
54 @@ -168,11 +168,8 @@
55 /*
56 * PL011 related constants
57 */
58 -#define PLAT_MARVELL_BOOT_UART_BASE (MVEBU_REGS_BASE + 0x512000)
59 -#define PLAT_MARVELL_BOOT_UART_CLK_IN_HZ 200000000
60 -
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
65
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 * ---------------------------------------------
72 */
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
79 #ifdef PLAT_a3700
80 b console_a3700_core_init
81 @@ -81,7 +81,7 @@ endfunc plat_crash_console_init
82 * ---------------------------------------------
83 */
84 func plat_crash_console_putc
85 - mov_imm x1, PLAT_MARVELL_CRASH_UART_BASE
86 + mov_imm x1, PLAT_MARVELL_UART_BASE
87 #ifdef PLAT_a3700
88
89 b console_a3700_core_putc
90 @@ -99,7 +99,7 @@ endfunc plat_crash_console_putc
91 * ---------------------------------------------
92 */
93 func plat_crash_console_flush
94 - mov_imm x0, PLAT_MARVELL_CRASH_UART_BASE
95 + mov_imm x0, PLAT_MARVELL_UART_BASE
96 #ifdef PLAT_a3700
97 b console_a3700_core_flush
98 #else
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)
103 {
104 int rc =
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);
111 if (rc == 0) {
112 @@ -58,8 +58,8 @@ void marvell_console_boot_end(void)
113 void marvell_console_runtime_init(void)
114 {
115 int rc =
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);
122 if (rc == 0)