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>
This commit is contained in:
parent
049f95cfcb
commit
ae7d4d890b
1 changed files with 8 additions and 3 deletions
|
|
@ -36,9 +36,8 @@ static void writer(int reg, uint8_t val)
|
|||
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 @@ static int test_func(void)
|
|||
|
||||
// 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 @@ static int test_func(void)
|
|||
for (;;) {
|
||||
writer(0, '!');
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
void *entry;
|
||||
|
||||
hacky_hardcoded_uart_setup_function();
|
||||
|
||||
if (UART_TEST)
|
||||
test_func();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue