errata_a008850.c 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #include <cci.h>
  8. #include <common/debug.h>
  9. #include <ls_interconnect.h>
  10. #include <mmio.h>
  11. #include <platform_def.h>
  12. void erratum_a008850_early(void)
  13. {
  14. /* part 1 of 2 */
  15. uintptr_t cci_base = NXP_CCI_ADDR;
  16. uint32_t val = mmio_read_32(cci_base + CTRL_OVERRIDE_REG);
  17. /* enabling forced barrier termination on CCI400 */
  18. mmio_write_32(cci_base + CTRL_OVERRIDE_REG,
  19. (val | CCI_TERMINATE_BARRIER_TX));
  20. }
  21. void erratum_a008850_post(void)
  22. {
  23. /* part 2 of 2 */
  24. uintptr_t cci_base = NXP_CCI_ADDR;
  25. uint32_t val = mmio_read_32(cci_base + CTRL_OVERRIDE_REG);
  26. /* Clear the BARRIER_TX bit */
  27. val = val & ~(CCI_TERMINATE_BARRIER_TX);
  28. /*
  29. * Disable barrier termination on CCI400, allowing
  30. * barriers to propagate across CCI
  31. */
  32. mmio_write_32(cci_base + CTRL_OVERRIDE_REG, val);
  33. INFO("SoC workaround for Errata A008850 Post-Phase was applied\n");
  34. }