scu.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <assert.h>
  8. #include <common/debug.h>
  9. #include <lib/mmio.h>
  10. #include <mcucfg.h>
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <string.h>
  14. void disable_scu(u_register_t mpidr)
  15. {
  16. uintptr_t axi_config = 0;
  17. uint32_t axi_value;
  18. switch (mpidr & MPIDR_CLUSTER_MASK) {
  19. case 0x000:
  20. axi_config = (uintptr_t)&mt8183_mcucfg->mp0_axi_config;
  21. axi_value = MP0_ACINACTM;
  22. break;
  23. case 0x100:
  24. axi_config = (uintptr_t)&mt8183_mcucfg->mp2_axi_config;
  25. axi_value = MP2_ACINACTM;
  26. break;
  27. default:
  28. ERROR("%s: mpidr does not exist\n", __func__);
  29. panic();
  30. }
  31. mmio_setbits_32(axi_config, axi_value);
  32. }
  33. void enable_scu(u_register_t mpidr)
  34. {
  35. uintptr_t axi_config = 0;
  36. uint32_t axi_value;
  37. switch (mpidr & MPIDR_CLUSTER_MASK) {
  38. case 0x000:
  39. axi_config = (uintptr_t)&mt8183_mcucfg->mp0_axi_config;
  40. axi_value = MP0_ACINACTM;
  41. break;
  42. case 0x100:
  43. axi_config = (uintptr_t)&mt8183_mcucfg->mp2_axi_config;
  44. axi_value = MP2_ACINACTM;
  45. break;
  46. default:
  47. ERROR("%s: mpidr does not exist\n", __func__);
  48. panic();
  49. }
  50. mmio_clrbits_32(axi_config, axi_value);
  51. }