arm_fpga: Use Generic UART

The SCP firmware on the ARM FPGA initialises the UART already. This allows
us to treat the PL011 as an SBSA Generic UART, which does not require
any further setup.

This in particular removes the need for any baudrate and base clock related
settings to be hard coded into the BL31 image.

Change-Id: I16fc943526267356b97166a7068459e06ff77f0f
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
diff --git a/plat/arm/board/arm_fpga/aarch64/fpga_helpers.S b/plat/arm/board/arm_fpga/aarch64/fpga_helpers.S
index f350455..aeed310 100644
--- a/plat/arm/board/arm_fpga/aarch64/fpga_helpers.S
+++ b/plat/arm/board/arm_fpga/aarch64/fpga_helpers.S
@@ -108,8 +108,6 @@
 
 func plat_crash_console_init
 	mov_imm	x0, PLAT_FPGA_CRASH_UART_BASE
-	mov_imm	x1, PLAT_FPGA_CRASH_UART_CLK_IN_HZ
-	mov_imm	x2, PLAT_FPGA_CONSOLE_BAUDRATE
 	b	console_pl011_core_init
 endfunc plat_crash_console_init
 
diff --git a/plat/arm/board/arm_fpga/fpga_console.c b/plat/arm/board/arm_fpga/fpga_console.c
index b4ebf34..a1fdb78 100644
--- a/plat/arm/board/arm_fpga/fpga_console.c
+++ b/plat/arm/board/arm_fpga/fpga_console.c
@@ -13,9 +13,7 @@
 
 void fpga_console_init(void)
 {
-	(void)console_pl011_register(PLAT_FPGA_BOOT_UART_BASE,
-		PLAT_FPGA_BOOT_UART_CLK_IN_HZ,
-		PLAT_FPGA_CONSOLE_BAUDRATE,
+	(void)console_pl011_register(PLAT_FPGA_BOOT_UART_BASE, 0, 0,
 		&console);
 
 	console_set_scope(&console, CONSOLE_FLAG_BOOT |
diff --git a/plat/arm/board/arm_fpga/fpga_def.h b/plat/arm/board/arm_fpga/fpga_def.h
index dbdbe6f..6092637 100644
--- a/plat/arm/board/arm_fpga/fpga_def.h
+++ b/plat/arm/board/arm_fpga/fpga_def.h
@@ -23,17 +23,13 @@
 #define FPGA_MAX_PE_PER_CPU			4
 
 #define FPGA_PRIMARY_CPU			0x0
-
 /*******************************************************************************
  * FPGA image memory map related constants
  ******************************************************************************/
 
-/* UART base address and clock frequency, as configured by the image */
+/* UART base address, as configured by the image */
 #define PLAT_FPGA_BOOT_UART_BASE 		0x7ff80000
-#define PLAT_FPGA_BOOT_UART_CLK_IN_HZ 		10000000
-
 #define PLAT_FPGA_CRASH_UART_BASE		PLAT_FPGA_BOOT_UART_BASE
-#define PLAT_FPGA_CRASH_UART_CLK_IN_HZ		PLAT_FPGA_BOOT_UART_CLK_IN_HZ
 
 #define FPGA_TIMER_FREQUENCY			10000000
 
diff --git a/plat/arm/board/arm_fpga/include/platform_def.h b/plat/arm/board/arm_fpga/include/platform_def.h
index 5c8aff6..37f3d8a 100644
--- a/plat/arm/board/arm_fpga/include/platform_def.h
+++ b/plat/arm/board/arm_fpga/include/platform_def.h
@@ -87,6 +87,4 @@
 #define PLAT_FPGA_HOLD_STATE_WAIT	0
 #define PLAT_FPGA_HOLD_STATE_GO		1
 
-#define PLAT_FPGA_CONSOLE_BAUDRATE	38400
-
 #endif
diff --git a/plat/arm/board/arm_fpga/platform.mk b/plat/arm/board/arm_fpga/platform.mk
index 302aabf..3350000 100644
--- a/plat/arm/board/arm_fpga/platform.mk
+++ b/plat/arm/board/arm_fpga/platform.mk
@@ -38,6 +38,8 @@
 # This can be overridden depending on CPU(s) used in the FPGA image
 HW_ASSISTED_COHERENCY	:=	1
 
+PL011_GENERIC_UART	:=	1
+
 FPGA_CPU_LIBS	:=	lib/cpus/${ARCH}/aem_generic.S
 
 # select a different set of CPU files, depending on whether we compile for