fdt_serial_xlnx_uartlite.c 830 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2022 Western Digital Corporation or its affiliates.
  5. *
  6. * Authors:
  7. * Alistair Francis <alistair.francis@wdc.com>
  8. */
  9. #include <sbi_utils/fdt/fdt_helper.h>
  10. #include <sbi_utils/serial/fdt_serial.h>
  11. #include <sbi_utils/serial/xlnx_uartlite.h>
  12. static int serial_xlnx_uartlite_init(void *fdt, int nodeoff,
  13. const struct fdt_match *match)
  14. {
  15. int rc;
  16. struct platform_uart_data uart = { 0 };
  17. rc = fdt_parse_xlnx_uartlite_node(fdt, nodeoff, &uart);
  18. if (rc)
  19. return rc;
  20. return xlnx_uartlite_init(uart.addr);
  21. }
  22. static const struct fdt_match serial_xlnx_uartlite_match[] = {
  23. { .compatible = "xlnx,xps-uartlite-1.00.a" },
  24. { },
  25. };
  26. struct fdt_serial fdt_serial_xlnx_uartlite = {
  27. .match_table = serial_xlnx_uartlite_match,
  28. .init = serial_xlnx_uartlite_init,
  29. };