ARM: s3c64xx: Let amba-pl08x driver handle DMA
Subsystems (9)
v2 cover ARM: s3c64xx: Let amba-pl08x driver handle DMA
Since the patches extending support of amba-pl08x DMA engine driver to PL080S DMA engine (PL080 modified by Samsung) found in Samsung S3C64xx SoCs got merged into Linux 3.12, it is a good time to migrate the platform to use this driver and drop the legacy DMA code.
Due to changes scattered across different areas of kernel, patches are based on merged 4 branches:
- for-next of Kukjin Kim's Samsung tree,
- clk-next of Mike Turquette's clock tree,
- for-next of Mark Brown's SPI tree,
- for-next of Mark Brown's ASoC tree.
To ease testing I have prepared a branch in my private tree for anyone willing to check the patches out:
git://github.com/tom3q/linux.git s3c64xx-pl08x-patches
On S3C64xx-based Mini6410 and SMDK6410 boards, with I2S audio playback and capture (including full duplex operation) and also SPI using spidev:
Changes since v1:
- Dropped the now merged patches adding PL080s support amba-pl08x driver,
- Rebased onto current for-next branches of respective trees.
- Stopped hijacking pl330_filter() symbol to plug pl08_filter_id() as channel filtering callback on S3C64xx.
Changes since RFC v2:
- Added clkdev lookups to old clock driver.
- Added patches removing the old DMA driver and any remaining code needed by it.
- Fixed DMA support for SPI.
- Added a word about PL080S to amba-pl08x.c file header.
- Changed definition of LLI words from enums to macros.
- Extended debugging messages to handle PL080S variant as well.
- Little cleanup of LLI dumping code.
- Added check for peripheral flow control, which is unsupported by PL080S to dma_set_runtime_config.
- Corrected transfer size mask of PL080S.
Changes since RFC v1:
- Returned to original way of storing quirks as booleans, as suggested by Russell, Linus and Arnd.
- Added reg_config field to pl08x_phy_chan struct, which stores variant-specific address of channel config register, as suggested by Russell.
- Simplified handling of extended maximum transfer size of PL080S (no more conditional passing of 0 as length to pl08x_cctl_bits()).
- Reworked LLI handling in the driver to stop casting arbitrary memory to a struct and allow different word count of LLI entry, as suggested by Linus.
- Removed AMBA ID override from S3C64xx PL080 initialization code.
- Fixed brokenness of Samsung DMA wrapper API, which caused cyclic buffers to be queued multiple times when DMA engine is used.
- Included patch adding clock aliases for DMA engines (depends on Common Clock Framework driver for S3C64xx).
- Fixed several minor stylistic issues.
Tomasz Figa (8):
spi: s3c64xx: Do not require legacy DMA API in case of S3C64XX
ASoC: Samsung: Do not require legacy DMA API in case of S3C64XX
ARM: s3c64xx: Add support for DMA using generic amba-pl08x driver
clk: samsung: s3c64xx: Add aliases for DMA clocks
ARM: s3c64xx: Remove legacy DMA driver
clk: samsung: s3c64xx: Remove clock aliases of old DMA driver
spi: s3c64xx: Always select S3C64XX_PL080 when ARCH_S3C64XX is enabled
ASoC: Samsung: Always select S3C64XX_PL080 when ARCH_S3C64XX is
enabled
arch/arm/Kconfig | 1 + arch/arm/mach-s3c64xx/Kconfig | 7 +- arch/arm/mach-s3c64xx/Makefile | 2 +- arch/arm/mach-s3c64xx/common.h | 5 + arch/arm/mach-s3c64xx/dma.c | 762 ------------------------------- arch/arm/mach-s3c64xx/include/mach/dma.h | 144 ++---- arch/arm/mach-s3c64xx/pl080.c | 244 ++++++++++ arch/arm/plat-samsung/devs.c | 10 +- arch/arm/plat-samsung/dma-ops.c | 8 +- drivers/clk/samsung/clk-s3c64xx.c | 4 +- drivers/spi/Kconfig | 2 +- sound/soc/samsung/Kconfig | 2 +- 12 files changed, 316 insertions(+), 875 deletions(-) delete mode 100644 arch/arm/mach-s3c64xx/dma.c create mode 100644 arch/arm/mach-s3c64xx/pl080.c
Signature · 1 line
1.8.3.2
PATCH v2 1/8 spi: s3c64xx: Do not require legacy DMA API in case of S3C64XX
With support for amba-pl08x driver, on S3C64xx the generic DMA engine API can be used instead of the private s3c-dma interface.
--- drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +1 -1
@@ -395,7 +395,7 @@ config SPI_S3C24XX_FIQ config SPI_S3C64XX tristate "Samsung S3C64XX series type SPI" depends on PLAT_SAMSUNG - select S3C64XX_DMA if ARCH_S3C64XX + select S3C64XX_DMA if ARCH_S3C64XX && !S3C64XX_PL080 help SPI driver for Samsung S3C64XX and newer SoCs.
Signature · 1 line
1.8.3.2
PATCH v2 2/8 ASoC: Samsung: Do not require legacy DMA API in case of S3C64XX
In reply to Tomasz FigaWith support for amba-pl08x driver, on S3C64xx the generic DMA engine API can be used instead of the private s3c-dma interface.
--- sound/soc/samsung/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/samsung/Kconfig +1 -1
@@ -1,7 +1,7 @@ config SND_SOC_SAMSUNG tristate "ASoC support for Samsung" depends on PLAT_SAMSUNG - select S3C64XX_DMA if ARCH_S3C64XX + select S3C64XX_DMA if ARCH_S3C64XX && !S3C64XX_PL080 select S3C2410_DMA if ARCH_S3C24XX help Say Y or M if you want to add support for codecs attached to
Signature · 1 line
1.8.3.2
PATCH v2 3/8 ARM: s3c64xx: Add support for DMA using generic amba-pl08x driver
In reply to Tomasz FigaThis patch adds all required platform-specific data and initialization code to support the generic amba-pl08x driver on S3C64xx SoCs.
Also some compatibility definitions are added to make the transition from legacy API to DMA engine easier. The biggest hack here is passing const char * pointers through DMA resource, casted to unsigned long, but this is how Samsung DMA wrappers (used to support both s3c-dma and DMA engine in drivers) are designed.
--- arch/arm/Kconfig | 1 + arch/arm/mach-s3c64xx/Kconfig | 8 +- arch/arm/mach-s3c64xx/Makefile | 1 + arch/arm/mach-s3c64xx/common.h | 5 + arch/arm/mach-s3c64xx/include/mach/dma.h | 63 ++++++++ arch/arm/mach-s3c64xx/pl080.c | 244 +++++++++++++++++++++++++++++++ arch/arm/plat-samsung/devs.c | 10 +- arch/arm/plat-samsung/dma-ops.c | 8 +- 8 files changed, 336 insertions(+), 4 deletions(-) create mode 100644 arch/arm/mach-s3c64xx/pl080.c
arch/arm/Kconfig +1 -0
@@ -724,6 +724,7 @@ config ARCH_S3C64XX bool "Samsung S3C64XX" select ARCH_HAS_CPUFREQ select ARCH_REQUIRE_GPIOLIB + select ARM_AMBA select ARM_VIC select CLKDEV_LOOKUP select CLKSRC_SAMSUNG_PWM
arch/arm/mach-s3c64xx/Kconfig +7 -1
@@ -17,9 +17,15 @@ config CPU_S3C6410 help Enable S3C6410 CPU support +config S3C64XX_PL080 + bool "S3C64XX DMA using generic PL08x driver" + select AMBA_PL08X + select SAMSUNG_DMADEV + config S3C64XX_DMA - bool "S3C64XX DMA" + bool "S3C64XX DMA using legacy S3C DMA API" select S3C_DMA + depends on !S3C64XX_PL080 config S3C64XX_SETUP_SDHCI bool
arch/arm/mach-s3c64xx/Makefile +1 -0
@@ -27,6 +27,7 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o # DMA support obj-$(CONFIG_S3C64XX_DMA) += dma.o +obj-$(CONFIG_S3C64XX_PL080) += pl080.o # Device support
arch/arm/mach-s3c64xx/common.h +5 -0
@@ -58,4 +58,9 @@ int __init s3c64xx_pm_late_initcall(void);static inline int s3c64xx_pm_late_initcall (void ) {return 0 ; }#endif +#ifdef CONFIG_S3C64XX_PL080 +extern struct pl08x_platform_data s3c64xx_dma0_plat_data; +extern struct pl08x_platform_data s3c64xx_dma1_plat_data; +#endif +#endif /* __ARCH_ARM_MACH_S3C64XX_COMMON_H */
arch/arm/mach-s3c64xx/include/mach/dma.h +63 -0
73 lines not on this page · raw message
arch/arm/mach-s3c64xx/pl080.c new file +244 -0
244 lines not on this page · raw message
arch/arm/plat-samsung/devs.c +8 -2
@@ -1502,6 +1502,8 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio;#if defined(CONFIG_PL330_DMA ) pd.filter = pl330_filter; +#elif defined(CONFIG_S3C64XX_PL080 ) + pd.filter = pl08x_filter_id;#elif defined(CONFIG_S3C24XX_DMAC ) pd.filter = s3c24xx_dma_filter;#endif
@@ -1543,8 +1545,10 @@ void __init s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, pd.num_cs = num_cs; pd.src_clk_nr = src_clk_nr; pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi1_cfg_gpio; -#ifdef CONFIG_PL330_DMA +#if defined(CONFIG_PL330_DMA ) pd.filter = pl330_filter; +#elif defined(CONFIG_S3C64XX_PL080 ) + pd.filter = pl08x_filter_id;#endif s3c_set_platdata (&pd,sizeof (pd), &s3c64xx_device_spi1);
@@ -1584,8 +1588,10 @@ void __init s3c64xx_spi2_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, pd.num_cs = num_cs; pd.src_clk_nr = src_clk_nr; pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi2_cfg_gpio; -#ifdef CONFIG_PL330_DMA +#if defined(CONFIG_PL330_DMA ) pd.filter = pl330_filter; +#elif defined(CONFIG_S3C64XX_PL080 ) + pd.filter = pl08x_filter_id;#endif s3c_set_platdata (&pd,sizeof (pd), &s3c64xx_device_spi2);
arch/arm/plat-samsung/dma-ops.c +7 -1
@@ -18,6 +18,12 @@#include <mach/dma.h> +#if defined(CONFIG_PL330_DMA ) +#define dma_filter pl330_filter +#elif defined(CONFIG_S3C64XX_PL080 ) +#define dma_filter pl08x_filter_id +#endif +static unsigned samsung_dmadev_request (enum dma_ch dma_ch,struct samsung_dma_req *param,struct device *dev,char *ch_name)
@@ -30,7 +36,7 @@ static unsigned samsung_dmadev_request(enum dma_ch dma_ch,if (dev->of_node)return (unsigned )dma_request_slave_channel (dev, ch_name);else -return (unsigned )dma_request_channel (mask, pl330_filter, +return (unsigned )dma_request_channel (mask, dma_filter, (void *)dma_ch); }
Signature · 1 line
1.8.3.2
PATCH v2 4/8 clk: samsung: s3c64xx: Add aliases for DMA clocks
In reply to Tomasz FigaThis patch adds clkdev aliases for clocks used by PL08x DMA driver.
--- drivers/clk/samsung/clk-s3c64xx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/samsung/clk-s3c64xx.c +2 -0
@@ -332,7 +332,9 @@ static struct samsung_clock_alias s3c64xx_clock_aliases[] = {ALIAS (HCLK_HSMMC0 ,"s3c-sdhci.0" ,"hsmmc" ),ALIAS (HCLK_HSMMC0 ,"s3c-sdhci.0" ,"mmc_busclk.0" ),ALIAS (HCLK_DMA1 ,NULL ,"dma1" ), +ALIAS (HCLK_DMA1 ,"dma-pl080s.1" ,"apb_pclk" ),ALIAS (HCLK_DMA0 ,NULL ,"dma0" ), +ALIAS (HCLK_DMA0 ,"dma-pl080s.0" ,"apb_pclk" ),ALIAS (HCLK_CAMIF ,"s3c-camif" ,"camif" ),ALIAS (HCLK_LCD ,"s3c-fb" ,"lcd" ), ALIAS(PCLK_SPI1, "s3c6410-spi.1", "spi"),
Signature · 1 line
1.8.3.2
PATCH v2 5/8 ARM: s3c64xx: Remove legacy DMA driver
In reply to Tomasz FigaSince support for generic PL08x DMA engine driver has been added, there is no need to keep the old legacy driver, so this patch removes it.
--- arch/arm/mach-s3c64xx/Kconfig | 5 - arch/arm/mach-s3c64xx/Makefile | 1 - arch/arm/mach-s3c64xx/dma.c | 762 ------------------------------- arch/arm/mach-s3c64xx/include/mach/dma.h | 123 ----- 4 files changed, 891 deletions(-) delete mode 100644 arch/arm/mach-s3c64xx/dma.c
arch/arm/mach-s3c64xx/Kconfig +0 -5
@@ -22,11 +22,6 @@ config S3C64XX_PL080 select AMBA_PL08X select SAMSUNG_DMADEV -config S3C64XX_DMA - bool "S3C64XX DMA using legacy S3C DMA API" - select S3C_DMA - depends on !S3C64XX_PL080 - config S3C64XX_SETUP_SDHCI bool select S3C64XX_SETUP_SDHCI_GPIO
arch/arm/mach-s3c64xx/Makefile +0 -1
@@ -26,7 +26,6 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o # DMA support -obj-$(CONFIG_S3C64XX_DMA) += dma.o obj-$(CONFIG_S3C64XX_PL080) += pl080.o # Device support
arch/arm/mach-s3c64xx/dma.c deleted +0 -762
762 lines not on this page · raw message
arch/arm/mach-s3c64xx/include/mach/dma.h +0 -123
133 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH v2 6/8 clk: samsung: s3c64xx: Remove clock aliases of old DMA driver
In reply to Tomasz FigaSince the old DMA driver got removed, these aliases are no longer necessary.
--- drivers/clk/samsung/clk-s3c64xx.c | 2 -- 1 file changed, 2 deletions(-)
drivers/clk/samsung/clk-s3c64xx.c +0 -2
@@ -331,9 +331,7 @@ static struct samsung_clock_alias s3c64xx_clock_aliases[] = {ALIAS (HCLK_HSMMC1 ,"s3c-sdhci.1" ,"mmc_busclk.0" ),ALIAS (HCLK_HSMMC0 ,"s3c-sdhci.0" ,"hsmmc" ),ALIAS (HCLK_HSMMC0 ,"s3c-sdhci.0" ,"mmc_busclk.0" ), -ALIAS (HCLK_DMA1 ,NULL ,"dma1" ),ALIAS (HCLK_DMA1 ,"dma-pl080s.1" ,"apb_pclk" ), -ALIAS (HCLK_DMA0 ,NULL ,"dma0" ),ALIAS (HCLK_DMA0 ,"dma-pl080s.0" ,"apb_pclk" ),ALIAS (HCLK_CAMIF ,"s3c-camif" ,"camif" ), ALIAS(HCLK_LCD, "s3c-fb", "lcd"),
Signature · 1 line
1.8.3.2
PATCH v2 7/8 spi: s3c64xx: Always select S3C64XX_PL080 when ARCH_S3C64XX is enabled
In reply to Tomasz FigaThe legacy S3C64xx DMA driver has been removed, DMA support on S3C64xx is provided only by the generic PL08x driver.
This patch modifies the Kconfig entry of spi-s3c64xx driver, which relies on availability of DMA, to always select the S3C64XX_PL080 symbol.
--- drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +1 -1
@@ -395,7 +395,7 @@ config SPI_S3C24XX_FIQ config SPI_S3C64XX tristate "Samsung S3C64XX series type SPI" depends on PLAT_SAMSUNG - select S3C64XX_DMA if ARCH_S3C64XX && !S3C64XX_PL080 + select S3C64XX_PL080 if ARCH_S3C64XX help SPI driver for Samsung S3C64XX and newer SoCs.
Signature · 1 line
1.8.3.2
PATCH v2 8/8 ASoC: Samsung: Always select S3C64XX_PL080 when ARCH_S3C64XX is enabled
In reply to Tomasz FigaThe legacy S3C64xx DMA driver has been removed, DMA support on S3C64xx is provided only by the generic PL08x driver.
This patch modifies the Kconfig entry of Samsung ASoC subsystem, which relies on availability of DMA, to always select the S3C64XX_PL080 symbol.
--- sound/soc/samsung/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/samsung/Kconfig +1 -1
@@ -1,7 +1,7 @@ config SND_SOC_SAMSUNG tristate "ASoC support for Samsung" depends on PLAT_SAMSUNG - select S3C64XX_DMA if ARCH_S3C64XX && !S3C64XX_PL080 + select S3C64XX_PL080 if ARCH_S3C64XX select S3C2410_DMA if ARCH_S3C24XX help Say Y or M if you want to add support for codecs attached to
Signature · 1 line
1.8.3.2
Quoted 4 lines · Tomasz Figa
Since the patches extending support of amba-pl08x DMA engine driver to PL080S DMA engine (PL080 modified by Samsung) found in Samsung S3C64xx SoCs got merged into Linux 3.12, it is a good time to migrate the platform to use this driver and drop the legacy DMA code.
Re: [PATCH v2 1/8] spi: s3c64xx: Do not require legacy DMA API in case of S3C64XX
In reply to Tomasz FigaQuoted 4 lines · Tomasz Figa
With support for amba-pl08x driver, on S3C64xx the generic DMA engine API can be used instead of the private s3c-dma interface.
Signed-off-by Tomasz Figa <[email protected]>
in case we can get this into v3.13.
Re: [PATCH v2 2/8] ASoC: Samsung: Do not require legacy DMA API in case of S3C64XX
In reply to Tomasz FigaQuoted 4 lines · Tomasz Figa
With support for amba-pl08x driver, on S3C64xx the generic DMA engine API can be used instead of the private s3c-dma interface.
Signed-off-by Tomasz Figa <[email protected]>
in case we can get this into v3.13.
Quoted 6 lines · Mark Brown
Quoted 4 lines · Tomasz Figa
Since the patches extending support of amba-pl08x DMA engine driver to PL080S DMA engine (PL080 modified by Samsung) found in Samsung S3C64xx SoCs got merged into Linux 3.12, it is a good time to migrate the platform to use this driver and drop the legacy DMA code.
Tomasz, very nice :-) Thanks.
Quoted 2 lines
Tested-by Mark Brown<[email protected]>
Mark, thanks for your test.
Applied this whole series.
- Kukjin
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 4/8] clk: samsung: s3c64xx: Add aliases for DMA clocks
In reply to Tomasz FigaQuoting Tomasz Figa (2013-10-16 12:10:55)
Quoted 3 lines
This patch adds clkdev aliases for clocks used by PL08x DMA driver.
Signed-off-by Tomasz Figa <[email protected]>
Quoted 20 lines
--- drivers/clk/samsung/clk-s3c64xx.c | 2 ++ 1 file changed, 2 insertions(+)drivers/clk/samsung/clk-s3c64xx.c +2
-0@@ -332,7 +332,9 @@ static struct samsung_clock_alias s3c64xx_clock_aliases[] = {ALIAS (HCLK_HSMMC0 ,"s3c-sdhci.0" ,"hsmmc" ),ALIAS (HCLK_HSMMC0 ,"s3c-sdhci.0" ,"mmc_busclk.0" ),ALIAS (HCLK_DMA1 ,NULL ,"dma1" ), +ALIAS (HCLK_DMA1 ,"dma-pl080s.1" ,"apb_pclk" ),ALIAS (HCLK_DMA0 ,NULL ,"dma0" ), +ALIAS (HCLK_DMA0 ,"dma-pl080s.0" ,"apb_pclk" ),ALIAS (HCLK_CAMIF ,"s3c-camif" ,"camif" ),ALIAS (HCLK_LCD ,"s3c-fb" ,"lcd" ), ALIAS(PCLK_SPI1, "s3c6410-spi.1", "spi"),Signature · 1 line
1.8.3.2
Mike Turquette
Acked-byRe: [PATCH v2 6/8] clk: samsung: s3c64xx: Remove clock aliases of old DMA driver
In reply to a message not in the archiveQuoting Tomasz Figa (2013-10-16 12:10:57)
Quoted 4 lines
Since the old DMA driver got removed, these aliases are no longer necessary.
Signed-off-by Tomasz Figa <[email protected]>
Quoted 20 lines
--- drivers/clk/samsung/clk-s3c64xx.c | 2 -- 1 file changed, 2 deletions(-)drivers/clk/samsung/clk-s3c64xx.c +0
-2@@ -331,9 +331,7 @@ static struct samsung_clock_alias s3c64xx_clock_aliases[] = {ALIAS (HCLK_HSMMC1 ,"s3c-sdhci.1" ,"mmc_busclk.0" ),ALIAS (HCLK_HSMMC0 ,"s3c-sdhci.0" ,"hsmmc" ),ALIAS (HCLK_HSMMC0 ,"s3c-sdhci.0" ,"mmc_busclk.0" ), -ALIAS (HCLK_DMA1 ,NULL ,"dma1" ),ALIAS (HCLK_DMA1 ,"dma-pl080s.1" ,"apb_pclk" ), -ALIAS (HCLK_DMA0 ,NULL ,"dma0" ),ALIAS (HCLK_DMA0 ,"dma-pl080s.0" ,"apb_pclk" ),ALIAS (HCLK_CAMIF ,"s3c-camif" ,"camif" ), ALIAS(HCLK_LCD, "s3c-fb", "lcd"),Signature · 1 line
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 1 line · Kukjin Kim
Applied this whole series.
This didn't seem to make it into -next or your tree, it'd be really helpful to be able to merge into both ASoC and SPI so they can be used for some framework work (I already have some patches for ASoC). Would it be possible to get the changes published on a separate branch or signed tag so I can pull it into those subsystems for the next merge window?
Quoted 10 lines · Mark Brown
Quoted 1 line · Kukjin Kim
Applied this whole series.
This didn't seem to make it into -next or your tree, it'd be really helpful to be able to merge into both ASoC and SPI so they can be used for some framework work (I already have some patches for ASoC). Would it be possible to get the changes published on a separate branch or signed tag so I can pull it into those subsystems for the next merge window?
Following up here too: I've merged this branch into arm-soc directly now.
-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html