blob: 08659c87d46a8a30b2a18d6ed33720ff5690e994 [file] [log] [blame]
Wenyou Yang5cb9dfa2015-11-05 16:37:49 +08001/*
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>
Wenyou Yange61ed482017-09-14 11:07:42 +08009#include <asm/hardware.h>
Wenyou Yang5cb9dfa2015-11-05 16:37:49 +080010#include <asm/io.h>
11#include <asm/arch/sama5_matrix.h>
12
13void matrix_init(void)
14{
15 struct atmel_matrix *h64mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX0;
16 struct atmel_matrix *h32mx = (struct atmel_matrix *)ATMEL_BASE_MATRIX1;
17 int i;
18
Wenyou Yangb5665bf2015-11-05 16:37:52 +080019 /* DDR port 1 ~ port 7 */
20 for (i = H64MX_SLAVE_DDRC_PORT1; i <= H64MX_SLAVE_DDRC_PORT7; i++) {
Wenyou Yang5cb9dfa2015-11-05 16:37:49 +080021 writel(0x000f0f0f, &h64mx->ssr[i]);
22 writel(0x0000ffff, &h64mx->sassr[i]);
23 writel(0x0000000f, &h64mx->srtsr[i]);
24 }
25
Wenyou Yangb5665bf2015-11-05 16:37:52 +080026 /* EBI CS3 (NANDFlash 128M) and NFC Command Registers(128M) */
27 writel(0x00c0c0c0, &h32mx->ssr[H32MX_SLAVE_EBI]);
28 writel(0xff000000, &h32mx->sassr[H32MX_SLAVE_EBI]);
29 writel(0xff000000, &h32mx->srtsr[H32MX_SLAVE_EBI]);
Wenyou Yang5cb9dfa2015-11-05 16:37:49 +080030
31 /* NFC SRAM */
Wenyou Yangb5665bf2015-11-05 16:37:52 +080032 writel(0x00010101, &h32mx->ssr[H32MX_SLAVE_NFC_SRAM]);
33 writel(0x00000001, &h32mx->sassr[H32MX_SLAVE_NFC_SRAM]);
34 writel(0x00000001, &h32mx->srtsr[H32MX_SLAVE_NFC_SRAM]);
Wenyou Yang5cb9dfa2015-11-05 16:37:49 +080035}