Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Wenyou Yang | f33c116 | 2015-11-05 16:37:49 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Atmel Corporation |
| 4 | * Wenyou Yang <wenyou.yang@atmel.com> |
Wenyou Yang | f33c116 | 2015-11-05 16:37:49 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Wenyou Yang | d19b901 | 2017-09-14 11:07:42 +0800 | [diff] [blame] | 8 | #include <asm/hardware.h> |
Wenyou Yang | f33c116 | 2015-11-05 16:37:49 +0800 | [diff] [blame] | 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 | |
Wenyou Yang | 335cdff | 2015-11-05 16:37:52 +0800 | [diff] [blame] | 18 | /* DDR port 1 ~ port 7 */ |
| 19 | for (i = H64MX_SLAVE_DDRC_PORT1; i <= H64MX_SLAVE_DDRC_PORT7; i++) { |
Wenyou Yang | f33c116 | 2015-11-05 16:37:49 +0800 | [diff] [blame] | 20 | writel(0x000f0f0f, &h64mx->ssr[i]); |
| 21 | writel(0x0000ffff, &h64mx->sassr[i]); |
| 22 | writel(0x0000000f, &h64mx->srtsr[i]); |
| 23 | } |
| 24 | |
Wenyou Yang | 335cdff | 2015-11-05 16:37:52 +0800 | [diff] [blame] | 25 | /* EBI CS3 (NANDFlash 128M) and NFC Command Registers(128M) */ |
| 26 | writel(0x00c0c0c0, &h32mx->ssr[H32MX_SLAVE_EBI]); |
| 27 | writel(0xff000000, &h32mx->sassr[H32MX_SLAVE_EBI]); |
| 28 | writel(0xff000000, &h32mx->srtsr[H32MX_SLAVE_EBI]); |
Wenyou Yang | f33c116 | 2015-11-05 16:37:49 +0800 | [diff] [blame] | 29 | |
| 30 | /* NFC SRAM */ |
Wenyou Yang | 335cdff | 2015-11-05 16:37:52 +0800 | [diff] [blame] | 31 | writel(0x00010101, &h32mx->ssr[H32MX_SLAVE_NFC_SRAM]); |
| 32 | writel(0x00000001, &h32mx->sassr[H32MX_SLAVE_NFC_SRAM]); |
| 33 | writel(0x00000001, &h32mx->srtsr[H32MX_SLAVE_NFC_SRAM]); |
Wenyou Yang | f33c116 | 2015-11-05 16:37:49 +0800 | [diff] [blame] | 34 | } |