gtbus_sun9i.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * GTBUS initialisation for sun9i
  4. *
  5. * (C) Copyright 2016 Theobroma Systems Design und Consulting GmbH
  6. * Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
  7. */
  8. #include <common.h>
  9. #include <asm/io.h>
  10. #include <asm/arch/gtbus_sun9i.h>
  11. #include <asm/arch/sys_proto.h>
  12. #ifdef CONFIG_SPL_BUILD
  13. void gtbus_init(void)
  14. {
  15. struct sunxi_gtbus_reg * const gtbus =
  16. (struct sunxi_gtbus_reg *)SUNXI_GTBUS_BASE;
  17. /*
  18. * We use the same setting that Allwinner used in Boot0 for now.
  19. * It may be advantageous to adjust these for various workloads
  20. * (e.g. headless use cases that focus on IO throughput).
  21. */
  22. writel((GT_PRIO_HIGH << GT_PORT_FE0) |
  23. (GT_PRIO_HIGH << GT_PORT_BE1) |
  24. (GT_PRIO_HIGH << GT_PORT_BE2) |
  25. (GT_PRIO_HIGH << GT_PORT_IEP0) |
  26. (GT_PRIO_HIGH << GT_PORT_FE1) |
  27. (GT_PRIO_HIGH << GT_PORT_BE0) |
  28. (GT_PRIO_HIGH << GT_PORT_FE2) |
  29. (GT_PRIO_HIGH << GT_PORT_IEP1),
  30. &gtbus->mst_read_prio_cfg[0]);
  31. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_FE0]);
  32. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_FE0]);
  33. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_BE1]);
  34. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_BE2]);
  35. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_IEP0]);
  36. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_FE1]);
  37. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_BE0]);
  38. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_FE2]);
  39. writel(GP_MST_CFG_DEFAULT, &gtbus->mst_cfg[GT_PORT_IEP1]);
  40. }
  41. #endif