blob: 3bef5648d4a1ff0350244cb7aff168e12da43bee [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Wenyou Yangf33c1162015-11-05 16:37:49 +08002/*
3 * Copyright (C) 2015 Atmel Corporation
4 * Wenyou Yang <wenyou.yang@atmel.com>
Wenyou Yangf33c1162015-11-05 16:37:49 +08005 */
6
Wenyou Yangd19b9012017-09-14 11:07:42 +08007#include <asm/hardware.h>
Wenyou Yangf33c1162015-11-05 16:37:49 +08008#include <asm/io.h>
9#include <asm/arch/sama5_matrix.h>
10
11void matrix_init(void)
12{
13 struct atmel_matrix *h64mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX0;
14 struct atmel_matrix *h32mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX1;
15 int i;
16
Wenyou Yang335cdff2015-11-05 16:37:52 +080017 /* DDR port 1 ~ port 7 */
18 for (i = H64MX_SLAVE_DDRC_PORT1; i <= H64MX_SLAVE_DDRC_PORT7; i++) {
Wenyou Yangf33c1162015-11-05 16:37:49 +080019 writel(0x000f0f0f, &h64mx->ssr[i]);
20 writel(0x0000ffff, &h64mx->sassr[i]);
21 writel(0x0000000f, &h64mx->srtsr[i]);
22 }
23
Wenyou Yang335cdff2015-11-05 16:37:52 +080024 /* EBI CS3 (NANDFlash 128M) and NFC Command Registers(128M) */
25 writel(0x00c0c0c0, &h32mx->ssr[H32MX_SLAVE_EBI]);
26 writel(0xff000000, &h32mx->sassr[H32MX_SLAVE_EBI]);
27 writel(0xff000000, &h32mx->srtsr[H32MX_SLAVE_EBI]);
Wenyou Yangf33c1162015-11-05 16:37:49 +080028
29 /* NFC SRAM */
Wenyou Yang335cdff2015-11-05 16:37:52 +080030 writel(0x00010101, &h32mx->ssr[H32MX_SLAVE_NFC_SRAM]);
31 writel(0x00000001, &h32mx->sassr[H32MX_SLAVE_NFC_SRAM]);
32 writel(0x00000001, &h32mx->srtsr[H32MX_SLAVE_NFC_SRAM]);
Wenyou Yangf33c1162015-11-05 16:37:49 +080033}