diff options
| author | Olof Johansson <olof@lixom.net> | 2013-12-04 16:38:20 -0500 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2013-12-04 16:38:20 -0500 |
| commit | d167e1f0c109555b4d2c57ea51eae0eb40527979 (patch) | |
| tree | db89a17d78e51ce9c9f9f80f276005c3ac737d09 | |
| parent | 5c748225889c0128dd8f48c45e115b0e8cc3db58 (diff) | |
| parent | 3faecea70b0d6d050e0ae911032ec340341dc389 (diff) | |
Merge tag 's3c64xx-dmaengine' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc into next/drivers
From Tomasz Figa via Mark Brown:
ARM: s3c64xx: Convert to dmaengine
This series of commits from Tomasz converting s3c64xx to use dmaengine
rather than the old s3c-dma API missed the v3.13 merge window - Kukjin
said that he'd applied it (which should mean it's OK from a review point
of view) but it didn't make it into -next or a pull request.
Since a s3c64xx based system is one of my primary development platforms
it'd be really helpful if I could merge this into both ASoC and SPI,
I've got some patches for ASoC ready to go converting to use dmaengine
directly which help with multiplatform and there's some other dmaengine
work for SPI in progress too. I've therefore made this signed tag, it'd
be great if it could be merged into both arm-soc and those two trees.
* tag 's3c64xx-dmaengine' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc:
spi: s3c64xx: Always select S3C64XX_PL080 when ARCH_S3C64XX is enabled
clk: samsung: s3c64xx: Remove clock aliases of old DMA driver
ARM: s3c64xx: Remove legacy DMA driver
clk: samsung: s3c64xx: Add aliases for DMA clocks
ARM: s3c64xx: Add support for DMA using generic amba-pl08x driver
spi: s3c64xx: Do not require legacy DMA API in case of S3C64XX
Signed-off-by: Olof Johansson <olof@lixom.net>
| -rw-r--r-- | arch/arm/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/mach-s3c64xx/Kconfig | 7 | ||||
| -rw-r--r-- | arch/arm/mach-s3c64xx/Makefile | 2 | ||||
| -rw-r--r-- | arch/arm/mach-s3c64xx/common.h | 5 | ||||
| -rw-r--r-- | arch/arm/mach-s3c64xx/dma.c | 762 | ||||
| -rw-r--r-- | arch/arm/mach-s3c64xx/include/mach/dma.h | 144 | ||||
| -rw-r--r-- | arch/arm/mach-s3c64xx/pl080.c | 244 | ||||
| -rw-r--r-- | arch/arm/plat-samsung/devs.c | 10 | ||||
| -rw-r--r-- | arch/arm/plat-samsung/dma-ops.c | 8 | ||||
| -rw-r--r-- | drivers/clk/samsung/clk-s3c64xx.c | 4 | ||||
| -rw-r--r-- | drivers/spi/Kconfig | 2 |
11 files changed, 315 insertions, 874 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c1f1a7eee953..ba0e23234ecf 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -723,6 +723,7 @@ config ARCH_S3C64XX | |||
| 723 | bool "Samsung S3C64XX" | 723 | bool "Samsung S3C64XX" |
| 724 | select ARCH_HAS_CPUFREQ | 724 | select ARCH_HAS_CPUFREQ |
| 725 | select ARCH_REQUIRE_GPIOLIB | 725 | select ARCH_REQUIRE_GPIOLIB |
| 726 | select ARM_AMBA | ||
| 726 | select ARM_VIC | 727 | select ARM_VIC |
| 727 | select CLKDEV_LOOKUP | 728 | select CLKDEV_LOOKUP |
| 728 | select CLKSRC_SAMSUNG_PWM | 729 | select CLKSRC_SAMSUNG_PWM |
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 2cb8dc55b50e..7094bccbae91 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig | |||
| @@ -17,9 +17,10 @@ config CPU_S3C6410 | |||
| 17 | help | 17 | help |
| 18 | Enable S3C6410 CPU support | 18 | Enable S3C6410 CPU support |
| 19 | 19 | ||
| 20 | config S3C64XX_DMA | 20 | config S3C64XX_PL080 |
| 21 | bool "S3C64XX DMA" | 21 | bool "S3C64XX DMA using generic PL08x driver" |
| 22 | select S3C_DMA | 22 | select AMBA_PL08X |
| 23 | select SAMSUNG_DMADEV | ||
| 23 | 24 | ||
| 24 | config S3C64XX_SETUP_SDHCI | 25 | config S3C64XX_SETUP_SDHCI |
| 25 | bool | 26 | bool |
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index 6faedcffce04..58069a702a43 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile | |||
| @@ -26,7 +26,7 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o | |||
| 26 | 26 | ||
| 27 | # DMA support | 27 | # DMA support |
| 28 | 28 | ||
| 29 | obj-$(CONFIG_S3C64XX_DMA) += dma.o | 29 | obj-$(CONFIG_S3C64XX_PL080) += pl080.o |
| 30 | 30 | ||
| 31 | # Device support | 31 | # Device support |
| 32 | 32 | ||
diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h index bd3bd562011e..7043e7a3a67e 100644 --- a/arch/arm/mach-s3c64xx/common.h +++ b/arch/arm/mach-s3c64xx/common.h | |||
| @@ -58,4 +58,9 @@ int __init s3c64xx_pm_late_initcall(void); | |||
| 58 | static inline int s3c64xx_pm_late_initcall(void) { return 0; } | 58 | static inline int s3c64xx_pm_late_initcall(void) { return 0; } |
| 59 | #endif | 59 | #endif |
| 60 | 60 | ||
| 61 | #ifdef CONFIG_S3C64XX_PL080 | ||
| 62 | extern struct pl08x_platform_data s3c64xx_dma0_plat_data; | ||
| 63 | extern struct pl08x_platform_data s3c64xx_dma1_plat_data; | ||
| 64 | #endif | ||
| 65 | |||
| 61 | #endif /* __ARCH_ARM_MACH_S3C64XX_COMMON_H */ | 66 | #endif /* __ARCH_ARM_MACH_S3C64XX_COMMON_H */ |
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c deleted file mode 100644 index 7e22c2113816..000000000000 --- a/arch/arm/mach-s3c64xx/dma.c +++ /dev/null | |||
| @@ -1,762 +0,0 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c64xx/dma.c | ||
| 2 | * | ||
| 3 | * Copyright 2009 Openmoko, Inc. | ||
| 4 | * Copyright 2009 Simtec Electronics | ||
| 5 | * Ben Dooks <ben@simtec.co.uk> | ||
| 6 | * http://armlinux.simtec.co.uk/ | ||
| 7 | * | ||
| 8 | * S3C64XX DMA core | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /* | ||
| 16 | * NOTE: Code in this file is not used when booting with Device Tree support. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <linux/kernel.h> | ||
| 20 | #include <linux/module.h> | ||
| 21 | #include <linux/interrupt.h> | ||
| 22 | #include <linux/dmapool.h> | ||
| 23 | #include <linux/device.h> | ||
| 24 | #include <linux/errno.h> | ||
| 25 | #include <linux/slab.h> | ||
| 26 | #include <linux/delay.h> | ||
| 27 | #include <linux/clk.h> | ||
| 28 | #include <linux/err.h> | ||
| 29 | #include <linux/io.h> | ||
| 30 | #include <linux/amba/pl080.h> | ||
| 31 | #include <linux/of.h> | ||
| 32 | |||
| 33 | #include <mach/dma.h> | ||
| 34 | #include <mach/map.h> | ||
| 35 | #include <mach/irqs.h> | ||
| 36 | |||
| 37 | #include "regs-sys.h" | ||
| 38 | |||
| 39 | /* dma channel state information */ | ||
| 40 | |||
| 41 | struct s3c64xx_dmac { | ||
| 42 | struct device dev; | ||
| 43 | struct clk *clk; | ||
| 44 | void __iomem *regs; | ||
| 45 | struct s3c2410_dma_chan *channels; | ||
| 46 | enum dma_ch chanbase; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* pool to provide LLI buffers */ | ||
| 50 | static struct dma_pool *dma_pool; | ||
| 51 | |||
| 52 | /* Debug configuration and code */ | ||
| 53 | |||
| 54 | static unsigned char debug_show_buffs = 0; | ||
| 55 | |||
| 56 | static void dbg_showchan(struct s3c2410_dma_chan *chan) | ||
| 57 | { | ||
| 58 | pr_debug("DMA%d: %08x->%08x L %08x C %08x,%08x S %08x\n", | ||
| 59 | chan->number, | ||
| 60 | readl(chan->regs + PL080_CH_SRC_ADDR), | ||
| 61 | readl(chan->regs + PL080_CH_DST_ADDR), | ||
| 62 | readl(chan->regs + PL080_CH_LLI), | ||
| 63 | readl(chan->regs + PL080_CH_CONTROL), | ||
| 64 | readl(chan->regs + PL080S_CH_CONTROL2), | ||
| 65 | readl(chan->regs + PL080S_CH_CONFIG)); | ||
| 66 | } | ||
| 67 | |||
| 68 | static void show_lli(struct pl080s_lli *lli) | ||
| 69 | { | ||
| 70 | pr_debug("LLI[%p] %08x->%08x, NL %08x C %08x,%08x\n", | ||
| 71 | lli, lli->src_addr, lli->dst_addr, lli->next_lli, | ||
| 72 | lli->control0, lli->control1); | ||
| 73 | } | ||
| 74 | |||
| 75 | static void dbg_showbuffs(struct s3c2410_dma_chan *chan) | ||
| 76 | { | ||
| 77 | struct s3c64xx_dma_buff *ptr; | ||
| 78 | struct s3c64xx_dma_buff *end; | ||
| 79 | |||
| 80 | pr_debug("DMA%d: buffs next %p, curr %p, end %p\n", | ||
| 81 | chan->number, chan->next, chan->curr, chan->end); | ||
| 82 | |||
| 83 | ptr = chan->next; | ||
| 84 | end = chan->end; | ||
| 85 | |||
| 86 | if (debug_show_buffs) { | ||
| 87 | for (; ptr != NULL; ptr = ptr->next) { | ||
| 88 | pr_debug("DMA%d: %08x ", | ||
| 89 | chan->number, ptr->lli_dma); | ||
| 90 | show_lli(ptr->lli); | ||
| 91 | } | ||
| 92 | } | ||
| 93 | } | ||
| 94 | |||
| 95 | /* End of Debug */ | ||
| 96 | |||
| 97 | static struct s3c2410_dma_chan *s3c64xx_dma_map_channel(unsigned int channel) | ||
| 98 | { | ||
| 99 | struct s3c2410_dma_chan *chan; | ||
| 100 | unsigned int start, offs; | ||
| 101 | |||
| 102 | start = 0; | ||
| 103 | |||
| 104 | if (channel >= DMACH_PCM1_TX) | ||
| 105 | start = 8; | ||
| 106 | |||
| 107 | for (offs = 0; offs < 8; offs++) { | ||
| 108 | chan = &s3c2410_chans[start + offs]; | ||
| 109 | if (!chan->in_use) | ||
| 110 | goto found; | ||
| 111 | } | ||
| 112 | |||
| 113 | return NULL; | ||
| 114 | |||
| 115 | found: | ||
| 116 | s3c_dma_chan_map[channel] = chan; | ||
| 117 | return chan; | ||
| 118 | } | ||
| 119 | |||
| 120 | int s3c2410_dma_config(enum dma_ch channel, int xferunit) | ||
| 121 | { | ||
| 122 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | ||
| 123 | |||
