Re: [PATCH] dmaengine: imx-sdma: Add i.MX7 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2016-08-10 09:05, Fabio Estevam wrote:
> Allow i.MX7 to work with the imx-sdma driver.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxx>

Works for me on a Colibri iMX7 Dual, thx Fabio!

Tested-by: Stefan Agner <stefan@xxxxxxxx>

--
Stefan

> ---
>  .../devicetree/bindings/dma/fsl-imx-sdma.txt       |  1 +
>  drivers/dma/imx-sdma.c                             | 26 ++++++++++++++++++++++
>  2 files changed, 27 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> index 175f0e4..3c9a57a 100644
> --- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> +++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> @@ -8,6 +8,7 @@ Required properties:
>        "fsl,imx51-sdma"
>        "fsl,imx53-sdma"
>        "fsl,imx6q-sdma"
> +      "fsl,imx7d-sdma"
>    The -to variants should be preferred since they allow to determine the
>    correct ROM script addresses needed for the driver to work without additional
>    firmware.
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 03ec76f..e6dc01e 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -479,6 +479,24 @@ static struct sdma_driver_data sdma_imx6q = {
>  	.script_addrs = &sdma_script_imx6q,
>  };
>  
> +static struct sdma_script_start_addrs sdma_script_imx7d = {
> +	.ap_2_ap_addr = 644,
> +	.uart_2_mcu_addr = 819,
> +	.mcu_2_app_addr = 749,
> +	.uartsh_2_mcu_addr = 1034,
> +	.mcu_2_shp_addr = 962,
> +	.app_2_mcu_addr = 685,
> +	.shp_2_mcu_addr = 893,
> +	.spdif_2_mcu_addr = 1102,
> +	.mcu_2_spdif_addr = 1136,
> +};
> +
> +static struct sdma_driver_data sdma_imx7d = {
> +	.chnenbl0 = SDMA_CHNENBL0_IMX35,
> +	.num_events = 48,
> +	.script_addrs = &sdma_script_imx7d,
> +};
> +
>  static const struct platform_device_id sdma_devtypes[] = {
>  	{
>  		.name = "imx25-sdma",
> @@ -499,6 +517,9 @@ static const struct platform_device_id sdma_devtypes[] = {
>  		.name = "imx6q-sdma",
>  		.driver_data = (unsigned long)&sdma_imx6q,
>  	}, {
> +		.name = "imx7d-sdma",
> +		.driver_data = (unsigned long)&sdma_imx7d,
> +	}, {
>  		/* sentinel */
>  	}
>  };
> @@ -511,6 +532,7 @@ static const struct of_device_id sdma_dt_ids[] = {
>  	{ .compatible = "fsl,imx35-sdma", .data = &sdma_imx35, },
>  	{ .compatible = "fsl,imx31-sdma", .data = &sdma_imx31, },
>  	{ .compatible = "fsl,imx25-sdma", .data = &sdma_imx25, },
> +	{ .compatible = "fsl,imx7d-sdma", .data = &sdma_imx7d, },
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, sdma_dt_ids);
> @@ -1375,6 +1397,7 @@ static void sdma_issue_pending(struct dma_chan *chan)
>  #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1	34
>  #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2	38
>  #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3	41
> +#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V4	42
>  
>  static void sdma_add_scripts(struct sdma_engine *sdma,
>  		const struct sdma_script_start_addrs *addr)
> @@ -1424,6 +1447,9 @@ static void sdma_load_firmware(const struct
> firmware *fw, void *context)
>  	case 3:
>  		sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3;
>  		break;
> +	case 4:
> +		sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V4;
> +		break;
>  	default:
>  		dev_err(sdma->dev, "unknown firmware version\n");
>  		goto err_firmware;
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux