2 * Copyright (C) 2015 Atmel Corporation
3 * Wenyou Yang <wenyou.yang@atmel.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/sama5_matrix.h>
12 void matrix_init(void)
14 struct atmel_matrix *h64mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX0;
15 struct atmel_matrix *h32mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX1;
18 /* DDR port 1 ~ poart 7, slave number is: 4 ~ 10 */
19 for (i = 4; i <= 10; i++) {
20 writel(0x000f0f0f, &h64mx->ssr[i]);
21 writel(0x0000ffff, &h64mx->sassr[i]);
22 writel(0x0000000f, &h64mx->srtsr[i]);
26 writel(0x00c0c0c0, &h32mx->ssr[3]);
27 writel(0xff000000, &h32mx->sassr[3]);
28 writel(0xff000000, &h32mx->srtsr[3]);
31 writel(0x00010101, &h32mx->ssr[4]);
32 writel(0x00000001, &h32mx->sassr[4]);
33 writel(0x00000001, &h32mx->srtsr[4]);
35 /* Configure Programmable Security peripherals on matrix 64 */
36 writel(readl(&h64mx->spselr[0]) | 0x00080000, &h64mx->spselr[0]);
37 writel(readl(&h64mx->spselr[1]) | 0x00180000, &h64mx->spselr[1]);
38 writel(readl(&h64mx->spselr[2]) | 0x00000008, &h64mx->spselr[2]);
40 /* Configure Programmable Security peripherals on matrix 32 */
41 writel(readl(&h32mx->spselr[0]) | 0xFFC00000, &h32mx->spselr[0]);
42 writel(readl(&h32mx->spselr[1]) | 0x60E3FFFF, &h32mx->spselr[1]);