aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhukar Pappireddy <madhukar.pappireddy@arm.com>2021-06-01 16:13:11 +0200
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2021-06-01 16:13:11 +0200
commit4fe55a2fd8b7dbd00886ff4cc57429e16b99850e (patch)
treec9e7be403227783cd6694e5f913b5cfd70b7f14a
parentfb88c71d2ad9189359cd92253e14d64639318e99 (diff)
parent66a7752834382595d26214783ae4698fd1f00bd6 (diff)
downloadtrusted-firmware-a-4fe55a2fd8b7dbd00886ff4cc57429e16b99850e.tar.gz
Merge "fix(plat/marvell/a3720/uart): fix UART clock rate value and divisor calculation" into integration
-rw-r--r--drivers/marvell/uart/a3700_console.S3
-rw-r--r--plat/marvell/armada/a3k/common/include/platform_def.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/marvell/uart/a3700_console.S b/drivers/marvell/uart/a3700_console.S
index b377321898..ad2ccf216d 100644
--- a/drivers/marvell/uart/a3700_console.S
+++ b/drivers/marvell/uart/a3700_console.S
@@ -45,8 +45,9 @@ func console_a3700_core_init
cbz w2, init_fail
/* Program the baudrate */
- /* Divisor = Uart clock / (16 * baudrate) */
+ /* Divisor = Round(Uartclock / (16 * baudrate)) */
lsl w2, w2, #4
+ add w1, w1, w2, lsr #1
udiv w2, w1, w2
and w2, w2, #0x3ff
diff --git a/plat/marvell/armada/a3k/common/include/platform_def.h b/plat/marvell/armada/a3k/common/include/platform_def.h
index 057ee2eb9b..06a00e4985 100644
--- a/plat/marvell/armada/a3k/common/include/platform_def.h
+++ b/plat/marvell/armada/a3k/common/include/platform_def.h
@@ -164,7 +164,7 @@
* PL011 related constants
*/
#define PLAT_MARVELL_BOOT_UART_BASE (MVEBU_REGS_BASE + 0x12000)
-#define PLAT_MARVELL_BOOT_UART_CLK_IN_HZ 25804800
+#define PLAT_MARVELL_BOOT_UART_CLK_IN_HZ 25000000
#define PLAT_MARVELL_CRASH_UART_BASE PLAT_MARVELL_BOOT_UART_BASE
#define PLAT_MARVELL_CRASH_UART_CLK_IN_HZ PLAT_MARVELL_BOOT_UART_CLK_IN_HZ