summaryrefslogtreecommitdiff
path: root/plat/xilinx
diff options
context:
space:
mode:
authordanh-arm <dan.handley@arm.com>2016-07-04 18:05:15 +0100
committerGitHub <noreply@github.com>2016-07-04 18:05:15 +0100
commit6f511c4782f079c75928a4dae3a4e3e4f6754831 (patch)
treec57761c75cc446f9c4a7efdb822c4dbe69759e23 /plat/xilinx
parent10b93d79752d7818b6bc0cea97a839403f503e5b (diff)
parent7de544ac04848cacb30547d3e95db138896d73a9 (diff)
Merge pull request #651 from Xilinx/zynqmp_uart
zynqmp: Make UART selectable
Diffstat (limited to 'plat/xilinx')
-rw-r--r--plat/xilinx/zynqmp/bl31_zynqmp_setup.c2
-rw-r--r--plat/xilinx/zynqmp/platform.mk3
-rw-r--r--plat/xilinx/zynqmp/tsp/tsp_plat_setup.c2
-rw-r--r--plat/xilinx/zynqmp/zynqmp_def.h17
4 files changed, 21 insertions, 3 deletions
diff --git a/plat/xilinx/zynqmp/bl31_zynqmp_setup.c b/plat/xilinx/zynqmp/bl31_zynqmp_setup.c
index 7b8c5670..6f1a18b1 100644
--- a/plat/xilinx/zynqmp/bl31_zynqmp_setup.c
+++ b/plat/xilinx/zynqmp/bl31_zynqmp_setup.c
@@ -96,7 +96,7 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2,
void *plat_params_from_bl2)
{
/* Initialize the console to provide early debug support */
- console_init(ZYNQMP_UART0_BASE, zynqmp_get_uart_clk(),
+ console_init(ZYNQMP_UART_BASE, zynqmp_get_uart_clk(),
ZYNQMP_UART_BAUDRATE);
/* Initialize the platform config for future decision making */
diff --git a/plat/xilinx/zynqmp/platform.mk b/plat/xilinx/zynqmp/platform.mk
index abbb15a5..ad87cd94 100644
--- a/plat/xilinx/zynqmp/platform.mk
+++ b/plat/xilinx/zynqmp/platform.mk
@@ -53,6 +53,9 @@ ifdef ZYNQMP_BL32_MEM_BASE
$(eval $(call add_define,ZYNQMP_BL32_MEM_SIZE))
endif
+ZYNQMP_CONSOLE ?= cadence
+$(eval $(call add_define_val,ZYNQMP_CONSOLE,ZYNQMP_CONSOLE_ID_${ZYNQMP_CONSOLE}))
+
PLAT_INCLUDES := -Iinclude/plat/arm/common/ \
-Iinclude/plat/arm/common/aarch64/ \
-Iplat/xilinx/zynqmp/include/ \
diff --git a/plat/xilinx/zynqmp/tsp/tsp_plat_setup.c b/plat/xilinx/zynqmp/tsp/tsp_plat_setup.c
index d600450d..58a3e2a1 100644
--- a/plat/xilinx/zynqmp/tsp/tsp_plat_setup.c
+++ b/plat/xilinx/zynqmp/tsp/tsp_plat_setup.c
@@ -68,7 +68,7 @@ void tsp_early_platform_setup(void)
* Initialize a different console than already in use to display
* messages from TSP
*/
- console_init(ZYNQMP_UART0_BASE, zynqmp_get_uart_clk(),
+ console_init(ZYNQMP_UART_BASE, zynqmp_get_uart_clk(),
ZYNQMP_UART_BAUDRATE);
/* Initialize the platform config for future decision making */
diff --git a/plat/xilinx/zynqmp/zynqmp_def.h b/plat/xilinx/zynqmp/zynqmp_def.h
index 4ff1f468..4bb332e0 100644
--- a/plat/xilinx/zynqmp/zynqmp_def.h
+++ b/plat/xilinx/zynqmp/zynqmp_def.h
@@ -33,6 +33,13 @@
#include <common_def.h>
+#define ZYNQMP_CONSOLE_ID_cadence 1
+#define ZYNQMP_CONSOLE_ID_cadence0 1
+#define ZYNQMP_CONSOLE_ID_cadence1 2
+#define ZYNQMP_CONSOLE_ID_dcc 3
+
+#define ZYNQMP_CONSOLE_IS(con) (ZYNQMP_CONSOLE_ID_ ## con == ZYNQMP_CONSOLE)
+
/* Firmware Image Package */
#define ZYNQMP_PRIMARY_CPU 0
@@ -141,7 +148,15 @@
#define ZYNQMP_UART0_BASE 0xFF000000
#define ZYNQMP_UART1_BASE 0xFF001000
-#define PLAT_ARM_CRASH_UART_BASE ZYNQMP_UART0_BASE
+#if ZYNQMP_CONSOLE_IS(cadence)
+# define ZYNQMP_UART_BASE ZYNQMP_UART0_BASE
+#elif ZYNQMP_CONSOLE_IS(cadence1)
+# define ZYNQMP_UART_BASE ZYNQMP_UART1_BASE
+#else
+# error "invalid ZYNQMP_CONSOLE"
+#endif
+
+#define PLAT_ARM_CRASH_UART_BASE ZYNQMP_UART_BASE
/* impossible to call C routine how it is done now - hardcode any value */
#define PLAT_ARM_CRASH_UART_CLK_IN_HZ 100000000 /* FIXME */