amlogic: console: Move console driver to common directory
authorCarlo Caione <ccaione@baylibre.com>
Thu, 5 Sep 2019 11:27:39 +0000 (12:27 +0100)
committerCarlo Caione <ccaione@baylibre.com>
Thu, 12 Sep 2019 18:18:04 +0000 (19:18 +0100)
The code managing the console is the same for all the platforms
currently supported. Since it is unlikely to change in the future move
the code to an external file in the common directory.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Change-Id: I6df555ea82d483b4f08a4a1e2cb0a7488fbaa015

plat/amlogic/common/aml_console.c [new file with mode: 0644]
plat/amlogic/gxbb/gxbb_common.c
plat/amlogic/gxbb/platform.mk
plat/amlogic/gxl/gxl_common.c
plat/amlogic/gxl/platform.mk

diff --git a/plat/amlogic/common/aml_console.c b/plat/amlogic/common/aml_console.c
new file mode 100644 (file)
index 0000000..352279b
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2019, Carlo Caione <ccaione@baylibre.com>
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <common/debug.h>
+#include <meson_console.h>
+#include <platform_def.h>
+
+/*******************************************************************************
+ * Function that sets up the console
+ ******************************************************************************/
+static console_meson_t aml_console;
+
+void aml_console_init(void)
+{
+       int rc = console_meson_register(AML_UART0_AO_BASE,
+                                       AML_UART0_AO_CLK_IN_HZ,
+                                       AML_UART_BAUDRATE,
+                                       &aml_console);
+       if (rc == 0) {
+               /*
+                * The crash console doesn't use the multi console API, it uses
+                * the core console functions directly. It is safe to call panic
+                * and let it print debug information.
+                */
+               panic();
+       }
+
+       console_set_scope(&aml_console.console,
+                         CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME);
+}
index e98748e777a2c1c3a20eaa6ea0b2c5e4d3f0158a..260a347abff09aee42f0b1b67e410aa65e5d21c1 100644 (file)
@@ -7,9 +7,7 @@
 #include <assert.h>
 #include <bl31/interrupt_mgmt.h>
 #include <common/bl_common.h>
-#include <common/debug.h>
 #include <common/ep_info.h>
-#include <drivers/amlogic/meson_console.h>
 #include <lib/mmio.h>
 #include <lib/xlat_tables/xlat_tables_v2.h>
 #include <platform_def.h>
@@ -100,30 +98,6 @@ void aml_setup_page_tables(void)
        init_xlat_tables();
 }
 
-/*******************************************************************************
- * Function that sets up the console
- ******************************************************************************/
-static console_meson_t gxbb_console;
-
-void aml_console_init(void)
-{
-       int rc = console_meson_register(AML_UART0_AO_BASE,
-                                       AML_UART0_AO_CLK_IN_HZ,
-                                       AML_UART_BAUDRATE,
-                                       &gxbb_console);
-       if (rc == 0) {
-               /*
-                * The crash console doesn't use the multi console API, it uses
-                * the core console functions directly. It is safe to call panic
-                * and let it print debug information.
-                */
-               panic();
-       }
-
-       console_set_scope(&gxbb_console.console,
-                         CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME);
-}
-
 /*******************************************************************************
  * Function that returns the system counter frequency
  ******************************************************************************/
index 59c4f3d638c834ad30dacd117499682fe87065f5..57167b077b810bbe5be14aff4934e709e75cdf69 100644 (file)
@@ -32,6 +32,7 @@ BL31_SOURCES          +=      lib/cpus/aarch64/cortex_a53.S                   \
                                ${AML_PLAT_COMMON}/aml_sip_svc.c                \
                                ${AML_PLAT_COMMON}/aml_thermal.c                \
                                ${AML_PLAT_COMMON}/aml_topology.c               \
+                               ${AML_PLAT_COMMON}/aml_console.c                \
                                ${XLAT_TABLES_LIB_SRCS}                         \
                                ${GIC_SOURCES}
 
index 468688538df0c6b44c1243c8adecc8b2df5c977b..e1d7bfb92f44bb6ef15faae4073c4e6192228790 100644 (file)
@@ -7,11 +7,9 @@
 #include <assert.h>
 #include <bl31/interrupt_mgmt.h>
 #include <common/bl_common.h>
-#include <common/debug.h>
 #include <common/ep_info.h>
 #include <lib/mmio.h>
 #include <lib/xlat_tables/xlat_tables_v2.h>
-#include <meson_console.h>
 #include <platform_def.h>
 #include <stdint.h>
 
@@ -100,30 +98,6 @@ void aml_setup_page_tables(void)
        init_xlat_tables();
 }
 
-/*******************************************************************************
- * Function that sets up the console
- ******************************************************************************/
-static console_meson_t gxl_console;
-
-void aml_console_init(void)
-{
-       int rc = console_meson_register(AML_UART0_AO_BASE,
-                                       AML_UART0_AO_CLK_IN_HZ,
-                                       AML_UART_BAUDRATE,
-                                       &gxl_console);
-       if (rc == 0) {
-               /*
-                * The crash console doesn't use the multi console API, it uses
-                * the core console functions directly. It is safe to call panic
-                * and let it print debug information.
-                */
-               panic();
-       }
-
-       console_set_scope(&gxl_console.console,
-                         CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME);
-}
-
 /*******************************************************************************
  * Function that returns the system counter frequency
  ******************************************************************************/
index 80c991ced362ffedf75e83b0af87cddc9f41727c..2e47670f019e49de8322ac40de13967c0a07d267 100644 (file)
@@ -35,6 +35,7 @@ BL31_SOURCES          +=      lib/cpus/aarch64/cortex_a53.S                   \
                                ${AML_PLAT_COMMON}/aml_sip_svc.c                \
                                ${AML_PLAT_COMMON}/aml_thermal.c                \
                                ${AML_PLAT_COMMON}/aml_topology.c               \
+                               ${AML_PLAT_COMMON}/aml_console.c                \
                                drivers/amlogic/crypto/sha_dma.c                \
                                ${XLAT_TABLES_LIB_SRCS}                         \
                                ${GIC_SOURCES}