arm: at91/spl: matrix: remove matrix write protection code
[oweals/u-boot.git] / arch / arm / mach-at91 / matrix.c
1 /*
2  * Copyright (C) 2015 Atmel Corporation
3  *                    Wenyou Yang <wenyou.yang@atmel.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <asm/io.h>
10 #include <asm/arch/sama5_matrix.h>
11
12 void matrix_init(void)
13 {
14         struct atmel_matrix *h64mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX0;
15         struct atmel_matrix *h32mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX1;
16         int i;
17
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]);
23         }
24
25         /* CS3 */
26         writel(0x00c0c0c0, &h32mx->ssr[3]);
27         writel(0xff000000, &h32mx->sassr[3]);
28         writel(0xff000000, &h32mx->srtsr[3]);
29
30         /* NFC SRAM */
31         writel(0x00010101, &h32mx->ssr[4]);
32         writel(0x00000001, &h32mx->sassr[4]);
33         writel(0x00000001, &h32mx->srtsr[4]);
34
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]);
39
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]);
43 }