imx_aipstz.c 562 B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright (c) 2019, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <lib/mmio.h>
  7. #include <imx_aipstz.h>
  8. void imx_aipstz_init(const struct aipstz_cfg *aipstz_cfg)
  9. {
  10. const struct aipstz_cfg *aipstz = aipstz_cfg;
  11. while (aipstz->base != 0U) {
  12. mmio_write_32(aipstz->base + AIPSTZ_MPR0, aipstz->mpr0);
  13. mmio_write_32(aipstz->base + AIPSTZ_MPR1, aipstz->mpr1);
  14. for (int i = 0; i < AIPSTZ_OPACR_NUM; i++)
  15. mmio_write_32(aipstz->base + OPACR_OFFSET(i), aipstz->opacr[i]);
  16. aipstz++;
  17. }
  18. }