Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Initialization of ARM Corelink CCI-500 Cache Coherency Interconnect |
| 3 | * |
Masahiro Yamada | fa1f73f | 2016-07-19 21:56:13 +0900 | [diff] [blame] | 4 | * Copyright (C) 2016 Socionext Inc. |
| 5 | * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 6 | * |
| 7 | * SPDX-License-Identifier: GPL-2.0+ |
| 8 | */ |
| 9 | |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 10 | #include <linux/bitops.h> |
| 11 | #include <linux/io.h> |
| 12 | #include <linux/sizes.h> |
| 13 | |
Masahiro Yamada | 5e05c4d | 2017-06-22 16:42:04 +0900 | [diff] [blame] | 14 | #include "../init.h" |
| 15 | |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 16 | #define CCI500_BASE 0x5FD00000 |
| 17 | #define CCI500_SLAVE_OFFSET 0x1000 |
| 18 | |
| 19 | #define CCI500_SNOOP_CTRL |
| 20 | #define CCI500_SNOOP_CTRL_EN_DVM BIT(1) |
| 21 | #define CCI500_SNOOP_CTRL_EN_SNOOP BIT(0) |
| 22 | |
| 23 | void cci500_init(unsigned int nr_slaves) |
| 24 | { |
| 25 | unsigned long slave_base = CCI500_BASE + CCI500_SLAVE_OFFSET; |
| 26 | int i; |
| 27 | |
| 28 | for (i = 0; i < nr_slaves; i++) { |
| 29 | void __iomem *base; |
| 30 | u32 tmp; |
| 31 | |
Masahiro Yamada | fa1f73f | 2016-07-19 21:56:13 +0900 | [diff] [blame] | 32 | base = ioremap(slave_base, SZ_4K); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 33 | |
| 34 | tmp = readl(base); |
| 35 | tmp |= CCI500_SNOOP_CTRL_EN_DVM | CCI500_SNOOP_CTRL_EN_SNOOP; |
| 36 | writel(tmp, base); |
| 37 | |
Masahiro Yamada | fa1f73f | 2016-07-19 21:56:13 +0900 | [diff] [blame] | 38 | iounmap(base); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 39 | |
| 40 | slave_base += CCI500_SLAVE_OFFSET; |
| 41 | } |
| 42 | } |