plat_console.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright 2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef PLAT_CONSOLE_H
  8. #define PLAT_CONSOLE_H
  9. #include <stdint.h>
  10. #include <drivers/console.h>
  11. #if (NXP_CONSOLE == NS16550)
  12. /*
  13. * NXP specific UART - 16550 configuration
  14. *
  15. * Initialize a NXP 16550 console instance and register it with the console
  16. * framework. The |console| pointer must point to storage that will be valid
  17. * for the lifetime of the console, such as a global or static local variable.
  18. * Its contents will be reinitialized from scratch.
  19. * When |clock| has a value of 0, the UART will *not* be initialised. This
  20. * means the UART should already be enabled and the baudrate and clock setup
  21. * should have been done already, either by platform specific code or by
  22. * previous firmware stages. The |baud| parameter will be ignored in this
  23. * case as well.
  24. */
  25. int nxp_console_16550_register(uintptr_t baseaddr, uint32_t clock,
  26. uint32_t baud, console_t *console);
  27. #endif
  28. /*
  29. * Function to initialize platform's console
  30. * and register with console framework
  31. */
  32. void plat_console_init(uintptr_t nxp_console_addr, uint32_t uart_clk_div,
  33. uint32_t baud);
  34. #endif