tegra124: Seperate out the non-UART specific hardcoded init in the bootblock.

The hardcoded init in the test function in the bootblock is actually useful
generally because it doesn't belong in the UART driver itself but is necessary
for the UART to work. Until we have real implementations for the pinmux, etc.,
we can use that code to get the UART and console going.

BUG=None
TEST=Built and booted into the bootblock on nyan with and without the test
function enabled. When it was, saw the "!"s on the console.
BRANCH=None

Change-Id: I2efe0b571d8b022eb2a2e5569620558540b28373
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/171334
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
diff --git a/src/soc/nvidia/tegra124/bootblock.c b/src/soc/nvidia/tegra124/bootblock.c
index fb5ddea..cd3d5d5 100644
--- a/src/soc/nvidia/tegra124/bootblock.c
+++ b/src/soc/nvidia/tegra124/bootblock.c
@@ -36,9 +36,8 @@
 	write8(val, (void *)(0x70000000 + 0x6000 + 4 * reg));
 }
 
-static int test_func(void)
+static void hacky_hardcoded_uart_setup_function(void)
 {
-	unsigned divisor = 221;
 	int i;
 
 	/*
@@ -82,6 +81,11 @@
 
 	// De-assert reset to UART.
 	clrbits_le32((void *)(0x60006000 + 4 + 0), 1 << 6);
+}
+
+static void test_func(void)
+{
+	const unsigned divisor = 221;
 
 	while (!(readr(5) & 0x40));
 
@@ -99,13 +103,14 @@
 	for (;;) {
 		writer(0, '!');
 	}
-	return 0;
 }
 
 void main(void)
 {
 	void *entry;
 
+	hacky_hardcoded_uart_setup_function();
+
 	if (UART_TEST)
 		test_func();