aml_console.c 875 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2019, Carlo Caione <ccaione@baylibre.com>
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <common/debug.h>
  7. #include <meson_console.h>
  8. #include <platform_def.h>
  9. /*******************************************************************************
  10. * Function that sets up the console
  11. ******************************************************************************/
  12. static console_t aml_console;
  13. void aml_console_init(void)
  14. {
  15. int rc = console_meson_register(AML_UART0_AO_BASE,
  16. AML_UART0_AO_CLK_IN_HZ,
  17. AML_UART_BAUDRATE,
  18. &aml_console);
  19. if (rc == 0) {
  20. /*
  21. * The crash console doesn't use the multi console API, it uses
  22. * the core console functions directly. It is safe to call panic
  23. * and let it print debug information.
  24. */
  25. panic();
  26. }
  27. console_set_scope(&aml_console,
  28. CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME);
  29. }