cdns_uart.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CDNS_UART_H
  7. #define CDNS_UART_H
  8. #include <drivers/console.h>
  9. /* This is very minimalistic and will only work in QEMU. */
  10. /* CADENCE Registers */
  11. #define R_UART_CR 0
  12. #define R_UART_CR_RXRST (1 << 0) /* RX logic reset */
  13. #define R_UART_CR_TXRST (1 << 1) /* TX logic reset */
  14. #define R_UART_CR_RX_EN (1 << 2) /* RX enabled */
  15. #define R_UART_CR_TX_EN (1 << 4) /* TX enabled */
  16. #define R_UART_SR 0x2C
  17. #define UART_SR_INTR_REMPTY_BIT 1
  18. #define UART_SR_INTR_TFUL_BIT 4
  19. #define UART_SR_INTR_TEMPTY_BIT 3
  20. #define R_UART_TX 0x30
  21. #define R_UART_RX 0x30
  22. #ifndef __ASSEMBLER__
  23. #include <stdint.h>
  24. /*
  25. * Initialize a new Cadence console instance and register it with the console
  26. * framework. The |console| pointer must point to storage that will be valid
  27. * for the lifetime of the console, such as a global or static local variable.
  28. * Its contents will be reinitialized from scratch.
  29. */
  30. int console_cdns_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
  31. console_t *console);
  32. #endif /*__ASSEMBLER__*/
  33. #endif /* CDNS_UART_H */