From 2b1c6b21b5e6c82ebb55d7fb7df90e60e88cbb14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 10 Sep 2016 14:54:26 +0200 Subject: brcm2708: update linux 4.4 patches to latest version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As usual these patches were extracted and rebased from the raspberry pi repo: https://github.com/raspberrypi/linux/tree/rpi-4.4.y Also adds support for Raspberry Pi Compute Module 3 (untested). Signed-off-by: Álvaro Fernández Rojas --- ...cm2835-Load-driver-early-and-support-lega.patch | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch (limited to 'target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch') diff --git a/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch new file mode 100644 index 0000000000..f8ad8f3229 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch @@ -0,0 +1,89 @@ +From 479b918cb9511d5044cc660f0c74d42952a87910 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Sat, 3 Oct 2015 22:22:55 +0200 +Subject: [PATCH] dmaengine: bcm2835: Load driver early and support legacy API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Load driver early since at least bcm2708_fb doesn't support deferred +probing and even if it did, we don't want the video driver deferred. + +Support the legacy DMA API which is needed by bcm2708_fb +(but only using the dedicated dma channel 0). + +Signed-off-by: Noralf Trønnes +Signed-off-by: Martin Sperl +--- + drivers/dma/Kconfig | 2 +- + drivers/dma/bcm2835-dma.c | 27 ++++++++++++++++++++++++++- + 2 files changed, 27 insertions(+), 2 deletions(-) + +--- a/drivers/dma/Kconfig ++++ b/drivers/dma/Kconfig +@@ -108,7 +108,7 @@ config COH901318 + + config DMA_BCM2835 + tristate "BCM2835 DMA engine support" +- depends on ARCH_BCM2835 ++ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1021,6 +1022,14 @@ static int bcm2835_dma_probe(struct plat + + dev_dbg(&pdev->dev, "Load BCM2835 DMA engine driver\n"); + ++ /* load the legacy api if bit 0 in the mask is cleared */ ++ if ((chans_available & BIT(0)) == 0) { ++ rc = bcm_dmaman_probe(pdev, base, BIT(0)); ++ if (rc) ++ dev_err(&pdev->dev, ++ "Failed to initialize the legacy API\n"); ++ } ++ + return 0; + + err_no_dma: +@@ -1032,6 +1041,7 @@ static int bcm2835_dma_remove(struct pla + { + struct bcm2835_dmadev *od = platform_get_drvdata(pdev); + ++ bcm_dmaman_remove(pdev); + dma_async_device_unregister(&od->ddev); + bcm2835_dma_free(od); + +@@ -1047,7 +1057,22 @@ static struct platform_driver bcm2835_dm + }, + }; + +-module_platform_driver(bcm2835_dma_driver); ++static int bcm2835_dma_init(void) ++{ ++ return platform_driver_register(&bcm2835_dma_driver); ++} ++ ++static void bcm2835_dma_exit(void) ++{ ++ platform_driver_unregister(&bcm2835_dma_driver); ++} ++ ++/* ++ * Load after serial driver (arch_initcall) so we see the messages if it fails, ++ * but before drivers (module_init) that need a DMA channel. ++ */ ++subsys_initcall(bcm2835_dma_init); ++module_exit(bcm2835_dma_exit); + + MODULE_ALIAS("platform:bcm2835-dma"); + MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -- cgit v1.2.3