Isaac Christensen (isaac.christensen@se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6860
-gerrit
commit c366b9eb95409b25a113a25cff89c70aa3567883 Author: Gabe Black gabeblack@google.com Date: Fri Oct 4 06:17:22 2013 -0700
nyan: Use the new pinmux functions as part of UART setup.
The pins for the UART had been configured manually using hardcoded offsets and values. Now that we have pinmux functions for that sort of thing, we should use that instead. This also provides a very simple test for the pinmux code.
Ultimately this code should be wrapped in a function which handles setting up any of the UARTs which is appropriately parameterized and which would be called from the bootblock main instead of being in it, but for now this is sufficient.
Change-Id: I69e36fa5fc9b6f3f5ef7f1be3e9f18cdbfdd7fe9 Signed-off-by: Gabe Black gabeblack@google.com Reviewed-on: https://chromium-review.googlesource.com/171807 Reviewed-by: Ronald Minnich rminnich@chromium.org Reviewed-by: David Hendricks dhendrix@chromium.org Commit-Queue: Gabe Black gabeblack@chromium.org Tested-by: Gabe Black gabeblack@chromium.org (cherry picked from commit d29e655b68143e86199ab1d74f89e125b16b67cc) Signed-off-by: Isaac Christensen isaac.christensen@se-eng.com --- src/soc/nvidia/tegra124/bootblock.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/src/soc/nvidia/tegra124/bootblock.c b/src/soc/nvidia/tegra124/bootblock.c index cd7ea34..3461c25 100644 --- a/src/soc/nvidia/tegra124/bootblock.c +++ b/src/soc/nvidia/tegra124/bootblock.c @@ -22,6 +22,8 @@ #include <cbfs.h> #include <console/console.h>
+#include "pinmux.h" + static void hacky_hardcoded_uart_setup_function(void) { int i; @@ -39,19 +41,6 @@ static void hacky_hardcoded_uart_setup_function(void) for (i = 0; i < 0x10000; i++) __asm__ __volatile__("");
- // Set function. - setbits_le32((void *)(0x70000000 + 0x3000 + 0x2e0), 3 << 0); - setbits_le32((void *)(0x70000000 + 0x3000 + 0x2e4), 3 << 0); - - // Output. - clrbits_le32((void *)(0x70000000 + 0x3000 + 0x2e0), 1 << 5); - // Input. - setbits_le32((void *)(0x70000000 + 0x3000 + 0x2e4), 1 << 5); - - // Disable tristate. - clrbits_le32((void *)(0x70000000 + 0x3000 + 0x2e0), 1 << 4); - clrbits_le32((void *)(0x70000000 + 0x3000 + 0x2e4), 1 << 4); - // Assert UART reset and enable clock. setbits_le32((void *)(0x60006000 + 4 + 0), 1 << 6);
@@ -75,6 +64,13 @@ void main(void)
hacky_hardcoded_uart_setup_function();
+ // Serial out, tristate off. + pinmux_set_config(PINMUX_KB_ROW9_INDEX, PINMUX_KB_ROW9_FUNC_UA3); + // Serial in, tristate_on. + pinmux_set_config(PINMUX_KB_ROW10_INDEX, PINMUX_KB_ROW10_FUNC_UA3 | + PINMUX_TRISTATE | + PINMUX_INPUT_ENABLE); + if (CONFIG_BOOTBLOCK_CONSOLE) console_init();