matrix.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2015 Atmel Corporation
  4. * Wenyou Yang <wenyou.yang@atmel.com>
  5. */
  6. #include <common.h>
  7. #include <asm/hardware.h>
  8. #include <asm/io.h>
  9. #include <asm/arch/sama5_matrix.h>
  10. void matrix_init(void)
  11. {
  12. struct atmel_matrix *h64mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX0;
  13. struct atmel_matrix *h32mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX1;
  14. int i;
  15. /* DDR port 1 ~ port 7 */
  16. for (i = H64MX_SLAVE_DDRC_PORT1; i <= H64MX_SLAVE_DDRC_PORT7; i++) {
  17. writel(0x000f0f0f, &h64mx->ssr[i]);
  18. writel(0x0000ffff, &h64mx->sassr[i]);
  19. writel(0x0000000f, &h64mx->srtsr[i]);
  20. }
  21. /* EBI CS3 (NANDFlash 128M) and NFC Command Registers(128M) */
  22. writel(0x00c0c0c0, &h32mx->ssr[H32MX_SLAVE_EBI]);
  23. writel(0xff000000, &h32mx->sassr[H32MX_SLAVE_EBI]);
  24. writel(0xff000000, &h32mx->srtsr[H32MX_SLAVE_EBI]);
  25. /* NFC SRAM */
  26. writel(0x00010101, &h32mx->ssr[H32MX_SLAVE_NFC_SRAM]);
  27. writel(0x00000001, &h32mx->sassr[H32MX_SLAVE_NFC_SRAM]);
  28. writel(0x00000001, &h32mx->srtsr[H32MX_SLAVE_NFC_SRAM]);
  29. }