wrap_iocsr_config.c 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2015 Marek Vasut <marex@denx.de>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <errno.h>
  8. #include <asm/arch/clock_manager.h>
  9. /*
  10. * Yes, dear reader, we're including a C file here, this is no mistake :-)
  11. */
  12. #include <qts/iocsr_config.c>
  13. int iocsr_get_config_table(const unsigned int chain_id,
  14. const unsigned long **table,
  15. unsigned int *table_len)
  16. {
  17. switch (chain_id) {
  18. case 0:
  19. *table = iocsr_scan_chain0_table;
  20. *table_len = CONFIG_HPS_IOCSR_SCANCHAIN0_LENGTH;
  21. break;
  22. case 1:
  23. *table = iocsr_scan_chain1_table;
  24. *table_len = CONFIG_HPS_IOCSR_SCANCHAIN1_LENGTH;
  25. break;
  26. case 2:
  27. *table = iocsr_scan_chain2_table;
  28. *table_len = CONFIG_HPS_IOCSR_SCANCHAIN2_LENGTH;
  29. break;
  30. case 3:
  31. *table = iocsr_scan_chain3_table;
  32. *table_len = CONFIG_HPS_IOCSR_SCANCHAIN3_LENGTH;
  33. break;
  34. default:
  35. return -EINVAL;
  36. }
  37. return 0;
  38. }