[coreboot-gerrit] Change in coreboot[master]: soc/nvidia/tegra210: set up the clock of the chosen UART

Andre Heider (Code Review) gerrit at coreboot.org
Fri Feb 16 13:38:39 CET 2018


Andre Heider has uploaded this change for review. ( https://review.coreboot.org/23796


Change subject: soc/nvidia/tegra210: set up the clock of the chosen UART
......................................................................

soc/nvidia/tegra210: set up the clock of the chosen UART

Don't always set up UARTA, but instead honor
CONFIG_CONSOLE_SERIAL_TEGRA210_UARTx and set up the clock of the
chosen UART.

Now the matching clock for the used UART is set up
(the UART driver uses CONFIG_CONSOLE_SERIAL_TEGRA210_UART_ADDRESS, which
in return is already based on CONFIG_CONSOLE_SERIAL_TEGRA210_UARTx).

Change-Id: Ife209d42af83459136a019c21c2a069396ab36db
Signed-off-by: Andre Heider <a.heider at gmail.com>
---
M src/soc/nvidia/tegra210/clock.c
1 file changed, 7 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/23796/1

diff --git a/src/soc/nvidia/tegra210/clock.c b/src/soc/nvidia/tegra210/clock.c
index cc8af55..ba1efdc 100644
--- a/src/soc/nvidia/tegra210/clock.c
+++ b/src/soc/nvidia/tegra210/clock.c
@@ -21,6 +21,7 @@
 #include <soc/clk_rst.h>
 #include <soc/clock.h>
 #include <soc/clst_clk.h>
+#include <soc/console_uart.h>
 #include <soc/flow.h>
 #include <soc/maincpu.h>
 #include <soc/pmc.h>
@@ -489,12 +490,15 @@
  */
 void clock_early_uart(void)
 {
-	write32(CLK_RST_REG(clk_src_uarta),
-		CLK_SRC_DEV_ID(UARTA, PLLP) << CLK_SOURCE_SHIFT |
+	if (console_uart_get_id() == UART_ID_NONE)
+		return;
+
+	write32(console_uart_clk_rst_reg(),
+		console_uart_clk_src_dev_id() << CLK_SOURCE_SHIFT |
 		CLK_UART_DIV_OVERRIDE |
 		CLK_DIVIDER(TEGRA_PLLP_KHZ, 1843));
 
-	clock_enable_clear_reset_l(CLK_L_UARTA);
+	console_uart_clock_enable_clear_reset();
 }
 
 /* Enable output clock (CLK1~3) for external peripherals. */

-- 
To view, visit https://review.coreboot.org/23796
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife209d42af83459136a019c21c2a069396ab36db
Gerrit-Change-Number: 23796
Gerrit-PatchSet: 1
Gerrit-Owner: Andre Heider <a.heider at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180216/7071c40d/attachment-0001.html>


More information about the coreboot-gerrit mailing list