rpi1/rpi2: Use PL011 UART fallback in loader.

* Adjust UART base locations to reflect ARM pref base.
* We have a working haiku_loader_u-boot on Raspberry Pi 2!:q
This commit is contained in:
Alexander von Gluck IV
2015-03-07 13:42:18 -06:00
parent db24244df1
commit deb4929b9a
5 changed files with 14 additions and 11 deletions
@@ -17,7 +17,7 @@
#include <arch/arm/bcm283X.h>
// UART Settings
#define BOARD_UART_AMBA_PL011 1
#define BOARD_UART_PL011 1
#define BOARD_UART1_BASE UART0_BASE
// PL011 UART
@@ -26,7 +26,7 @@
#define BOARD_UART3_BASE 0
// N/A
#define BOARD_UART_DEBUG BOARD_UART1_BASE
#define BOARD_UART_DEBUG DEVICE_BASE + BOARD_UART1_BASE
#define BOARD_UART_CLOCK 3000000
/* 3Mhz */
@@ -17,7 +17,7 @@
#include <arch/arm/bcm283X.h>
// UART Settings
#define BOARD_UART_AMBA_PL011 1
#define BOARD_UART_PL011 1
#define BOARD_UART1_BASE UART0_BASE
// PL011 UART
@@ -26,7 +26,7 @@
#define BOARD_UART3_BASE 0
// N/A
#define BOARD_UART_DEBUG BOARD_UART1_BASE
#define BOARD_UART_DEBUG DEVICE_BASE + BOARD_UART1_BASE
#define BOARD_UART_CLOCK 3000000
/* 3Mhz */
@@ -88,8 +88,7 @@ serial_cleanup(void)
extern "C" void
serial_init(void)
{
gUART = arch_get_uart_pl011(gPeripheralBase + BOARD_UART_DEBUG,
BOARD_UART_CLOCK);
gUART = arch_get_uart_pl011(BOARD_UART_DEBUG, BOARD_UART_CLOCK);
gUART->InitEarly();
gUART->InitPort(9600);
+8 -4
View File
@@ -10,6 +10,7 @@
#include "serial.h"
#include <debug_uart_8250.h>
#include <arch_uart_pl011.h>
#include <board_config.h>
#include <boot/platform.h>
#include <arch/cpu.h>
@@ -83,10 +84,8 @@ extern "C" void
serial_enable(void)
{
/* should already be initialized by U-Boot */
/*
gUART->InitEarly();
gUART->InitPort(9600);
*/
gUART->InitPort(115200);
sSerialEnabled++;
}
@@ -113,8 +112,13 @@ serial_init(const void *fdt)
#ifdef BOARD_UART_DEBUG
// fallback to hardcoded board UART
if (gUART == NULL)
if (gUART == NULL) {
#if defined(BOARD_UART_PL011)
gUART = arch_get_uart_pl011(BOARD_UART_DEBUG, BOARD_UART_CLOCK);
#else
gUART = arch_get_uart_8250(BOARD_UART_DEBUG, BOARD_UART_CLOCK);
#endif
}
#endif
if (gUART == NULL)
@@ -95,7 +95,7 @@ arch_debug_serial_early_boot_message(const char *string)
status_t
arch_debug_console_init(kernel_args *args)
{
#if defined(BOARD_UART_AMBA_PL011)
#if defined(BOARD_UART_PL011)
gArchDebugUART = arch_get_uart_pl011(BOARD_UART_DEBUG, BOARD_UART_CLOCK);
#else
// More Generic 8250