Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328953
b: refs/heads/master
c: 461b6f0
h: refs/heads/master
i:
  328951: ecd5c68
v: v3
  • Loading branch information
Marek Szyprowski committed Oct 2, 2012
1 parent 5ec7eb4 commit 23e7582
Show file tree
Hide file tree
Showing 11 changed files with 271 additions and 79 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 75c5971614932ca53009cbbdfd6c8f96eab9e46f
refs/heads/master: 461b6f0d3d7d4e556035463b531136b034b7433e
3 changes: 3 additions & 0 deletions trunk/Documentation/devicetree/bindings/ata/ahci-platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Required properties:
- interrupts : <interrupt mapping for SATA IRQ>
- reg : <registers mapping>

Optional properties:
- dma-coherent : Present if dma operations are coherent

Example:
sata@ffe08000 {
compatible = "calxeda,hb-ahci";
Expand Down
3 changes: 3 additions & 0 deletions trunk/Documentation/devicetree/bindings/dma/arm-pl330.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Required properties:
region.
- interrupts: interrupt number to the cpu.

Optional properties:
- dma-coherent : Present if dma operations are coherent

Example:

pdma0: pdma@12680000 {
Expand Down
3 changes: 3 additions & 0 deletions trunk/Documentation/devicetree/bindings/net/calxeda-xgmac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Required properties:
- interrupts : Should contain 3 xgmac interrupts. The 1st is main interrupt.
The 2nd is pwr mgt interrupt. The 3rd is low power state interrupt.

Optional properties:
- dma-coherent : Present if dma operations are coherent

Example:

ethernet@fff50000 {
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/boot/dts/highbank.dts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
compatible = "calxeda,hb-ahci";
reg = <0xffe08000 0x10000>;
interrupts = <0 83 4>;
dma-coherent;
};

sdhci@ffe0e000 {
Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/arm/include/asm/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@
#define rmb() dsb()
#define wmb() mb()
#else
#include <asm/memory.h>
#define mb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
#define rmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
#define wmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
#define mb() barrier()
#define rmb() barrier()
#define wmb() barrier()
#endif

#ifndef CONFIG_SMP
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#define DMA_ERROR_CODE (~0)
extern struct dma_map_ops arm_dma_ops;
extern struct dma_map_ops arm_coherent_dma_ops;

static inline struct dma_map_ops *get_dma_ops(struct device *dev)
{
Expand Down
8 changes: 0 additions & 8 deletions trunk/arch/arm/include/asm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)

/*
* Optional coherency support. Currently used only by selected
* Intel XSC3-based systems.
*/
#ifndef arch_is_coherent
#define arch_is_coherent() 0
#endif

#endif

#include <asm-generic/memory_model.h>
Expand Down
52 changes: 52 additions & 0 deletions trunk/arch/arm/mach-highbank/highbank.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
Expand All @@ -23,6 +24,7 @@
#include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/smp.h>
#include <linux/amba/bus.h>

#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
Expand Down Expand Up @@ -149,10 +151,60 @@ static void highbank_power_off(void)
cpu_do_idle();
}

static int highbank_platform_notifier(struct notifier_block *nb,
unsigned long event, void *__dev)
{
struct resource *res;
int reg = -1;
struct device *dev = __dev;

if (event != BUS_NOTIFY_ADD_DEVICE)
return NOTIFY_DONE;

if (of_device_is_compatible(dev->of_node, "calxeda,hb-ahci"))
reg = 0xc;
else if (of_device_is_compatible(dev->of_node, "calxeda,hb-sdhci"))
reg = 0x18;
else if (of_device_is_compatible(dev->of_node, "arm,pl330"))
reg = 0x20;
else if (of_device_is_compatible(dev->of_node, "calxeda,hb-xgmac")) {
res = platform_get_resource(to_platform_device(dev),
IORESOURCE_MEM, 0);
if (res) {
if (res->start == 0xfff50000)
reg = 0;
else if (res->start == 0xfff51000)
reg = 4;
}
}

if (reg < 0)
return NOTIFY_DONE;

if (of_property_read_bool(dev->of_node, "dma-coherent")) {
writel(0xff31, sregs_base + reg);
set_dma_ops(dev, &arm_coherent_dma_ops);
} else
writel(0, sregs_base + reg);

return NOTIFY_OK;
}

static struct notifier_block highbank_amba_nb = {
.notifier_call = highbank_platform_notifier,
};

static struct notifier_block highbank_platform_nb = {
.notifier_call = highbank_platform_notifier,
};

static void __init highbank_init(void)
{
pm_power_off = highbank_power_off;

bus_register_notifier(&platform_bus_type, &highbank_platform_nb);
bus_register_notifier(&amba_bustype, &highbank_amba_nb);

of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}

Expand Down
Loading

0 comments on commit 23e7582

Please sign in to comment.