aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mvebu
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 12:27:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 12:27:54 -0500
commit878ba61aa98cbb97a513757800e77613f856a029 (patch)
treec03b8373cdb7163f81141a867c9cda1a9f71e73e /arch/arm/mach-mvebu
parentea7531ac4a9d0b39edce43472147dc41cc2b7a34 (diff)
parentdf1a66812535e04bfd960e15d5be4893853b6730 (diff)
Merge tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC platform changes from Olof Johansson: "New and updated SoC support. Also included are some cleanups where the platform maintainers hadn't separated cleanups from new developent in separate branches. Some of the larger things worth pointing out: - A large set of changes from Alexandre Belloni and Nicolas Ferre preparing at91 platforms for multiplatform and cleaning up quite a bit in the process. - Removal of CSR's "Marco" SoC platform that never made it out to the market. We love seeing these since it means the vendor published support before product was out, which is exactly what we want! New platforms this release are: - Conexant Digicolor (CX92755 SoC) - Hisilicon HiP01 SoC - CSR/sirf Atlas7 SoC - ST STiH418 SoC - Common code changes for Nvidia Tegra132 (64-bit SoC) We're seeing more and more platforms having a harder time labelling changes as cleanups vs new development -- which is a good sign that we've come quite far on the cleanup effort. So over time we might start combining the cleanup and new-development branches more" * tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (124 commits) ARM: at91/trivial: unify functions and machine names ARM: at91: remove at91_dt_initialize and machine init_early() ARM: at91: change board files into SoC files ARM: at91: remove at91_boot_soc ARM: at91: move alternative initial mapping to board-dt-sama5.c ARM: at91: merge all SOC_AT91SAM9xxx ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init() ARM: digicolor: select syscon and timer ARM: zynq: Simplify SLCR initialization ARM: zynq: PM: Fixed simple typo. ARM: zynq: Setup default gpio number for Xilinx Zynq ARM: digicolor: add low level debug support ARM: initial support for Conexant Digicolor CX92755 SoC ARM: OMAP2+: Add dm816x hwmod support ARM: OMAP2+: Add clock domain support for dm816x ARM: OMAP2+: Add board-generic.c entry for ti81xx ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage ARM: at91: remove unused mach/system_rev.h ARM: at91: stop using HAVE_AT91_DBGUx ARM: at91: fix ordering of SRAM and PM initialization ...
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r--arch/arm/mach-mvebu/coherency.c58
-rw-r--r--arch/arm/mach-mvebu/mvebu-soc-id.h18
2 files changed, 21 insertions, 55 deletions
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index ccef8806bb58..b5895f040caa 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -33,6 +33,7 @@
33#include <asm/smp_plat.h> 33#include <asm/smp_plat.h>
34#include <asm/cacheflush.h> 34#include <asm/cacheflush.h>
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36#include <asm/dma-mapping.h>
36#include "coherency.h" 37#include "coherency.h"
37#include "mvebu-soc-id.h" 38#include "mvebu-soc-id.h"
38 39
@@ -76,54 +77,6 @@ int set_cpu_coherent(void)
76 return ll_enable_coherency(); 77 return ll_enable_coherency();
77} 78}
78 79
79static inline void mvebu_hwcc_sync_io_barrier(void)
80{
81 writel(0x1, coherency_cpu_base + IO_SYNC_BARRIER_CTL_OFFSET);
82 while (readl(coherency_cpu_base + IO_SYNC_BARRIER_CTL_OFFSET) & 0x1);
83}
84
85static dma_addr_t mvebu_hwcc_dma_map_page(struct device *dev, struct page *page,
86 unsigned long offset, size_t size,
87 enum dma_data_direction dir,
88 struct dma_attrs *attrs)
89{
90 if (dir != DMA_TO_DEVICE)
91 mvebu_hwcc_sync_io_barrier();
92 return pfn_to_dma(dev, page_to_pfn(page)) + offset;
93}
94
95
96static void mvebu_hwcc_dma_unmap_page(struct device *dev, dma_addr_t dma_handle,
97 size_t size, enum dma_data_direction dir,
98 struct dma_attrs *attrs)
99{
100 if (dir != DMA_TO_DEVICE)
101 mvebu_hwcc_sync_io_barrier();
102}
103
104static void mvebu_hwcc_dma_sync(struct device *dev, dma_addr_t dma_handle,
105 size_t size, enum dma_data_direction dir)
106{
107 if (dir != DMA_TO_DEVICE)
108 mvebu_hwcc_sync_io_barrier();
109}
110
111static struct dma_map_ops mvebu_hwcc_dma_ops = {
112 .alloc = arm_dma_alloc,
113 .free = arm_dma_free,
114 .mmap = arm_dma_mmap,
115 .map_page = mvebu_hwcc_dma_map_page,
116 .unmap_page = mvebu_hwcc_dma_unmap_page,
117 .get_sgtable = arm_dma_get_sgtable,
118 .map_sg = arm_dma_map_sg,
119 .unmap_sg = arm_dma_unmap_sg,
120 .sync_single_for_cpu = mvebu_hwcc_dma_sync,
121 .sync_single_for_device = mvebu_hwcc_dma_sync,
122 .sync_sg_for_cpu = arm_dma_sync_sg_for_cpu,
123 .sync_sg_for_device = arm_dma_sync_sg_for_device,
124 .set_dma_mask = arm_dma_set_mask,
125};
126
127static int mvebu_hwcc_notifier(struct notifier_block *nb, 80static int mvebu_hwcc_notifier(struct notifier_block *nb,
128 unsigned long event, void *__dev) 81 unsigned long event, void *__dev)
129{ 82{
@@ -131,7 +84,7 @@ static int mvebu_hwcc_notifier(struct notifier_block *nb,
131 84
132 if (event != BUS_NOTIFY_ADD_DEVICE) 85 if (event != BUS_NOTIFY_ADD_DEVICE)
133 return NOTIFY_DONE; 86 return NOTIFY_DONE;
134 set_dma_ops(dev, &mvebu_hwcc_dma_ops); 87 set_dma_ops(dev, &arm_coherent_dma_ops);
135 88
136 return NOTIFY_OK; 89 return NOTIFY_OK;
137} 90}
@@ -253,14 +206,9 @@ static int coherency_type(void)
253 return type; 206 return type;
254} 207}
255 208
256/*
257 * As a precaution, we currently completely disable hardware I/O
258 * coherency, until enough testing is done with automatic I/O
259 * synchronization barriers to validate that it is a proper solution.
260 */
261int coherency_available(void) 209int coherency_available(void)
262{ 210{
263 return false; 211 return coherency_type() != COHERENCY_FABRIC_TYPE_NONE;
264} 212}
265 213
266int __init coherency_init(void) 214int __init coherency_init(void)
diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.h b/arch/arm/mach-mvebu/mvebu-soc-id.h
index c16bb68ca81f..e124a0b82a3e 100644
--- a/arch/arm/mach-mvebu/mvebu-soc-id.h
+++ b/arch/arm/mach-mvebu/mvebu-soc-id.h
@@ -20,10 +20,28 @@
20#define MV78XX0_A0_REV 0x1 20#define MV78XX0_A0_REV 0x1
21#define MV78XX0_B0_REV 0x2 21#define MV78XX0_B0_REV 0x2
22 22
23/* Amada 370 ID */
24#define ARMADA_370_DEV_ID 0x6710
25
26/* Amada 370 Revision */
27#define ARMADA_370_A1_REV 0x1
28
29/* Armada 375 ID */
30#define ARMADA_375_DEV_ID 0x6720
31
23/* Armada 375 */ 32/* Armada 375 */
24#define ARMADA_375_Z1_REV 0x0 33#define ARMADA_375_Z1_REV 0x0
25#define ARMADA_375_A0_REV 0x3 34#define ARMADA_375_A0_REV 0x3
26 35
36/* Armada 38x ID */
37#define ARMADA_380_DEV_ID 0x6810
38#define ARMADA_385_DEV_ID 0x6820
39#define ARMADA_388_DEV_ID 0x6828
40
41/* Armada 38x Revision */
42#define ARMADA_38x_Z1_REV 0x0
43#define ARMADA_38x_A0_REV 0x4
44
27#ifdef CONFIG_ARCH_MVEBU 45#ifdef CONFIG_ARCH_MVEBU
28int mvebu_get_soc_id(u32 *dev, u32 *rev); 46int mvebu_get_soc_id(u32 *dev, u32 *rev);
29#else 47#else