lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 10 Nov 2013 06:57:08 +0000
From:	Bharat Bhushan <Bharat.Bhushan@...escale.com>
To:	Guangyu Chen <guangyu.chen@...escale.com>,
	"vinod.koul@...el.com" <vinod.koul@...el.com>,
	"dan.j.williams@...el.com" <dan.j.williams@...el.com>,
	"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
	"timur@...i.org" <timur@...i.org>,
	"shawn.guo@...aro.org" <shawn.guo@...aro.org>,
	"broonie@...nel.org" <broonie@...nel.org>
CC:	"mark.rutland@....com" <mark.rutland@....com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
	"pawel.moll@....com" <pawel.moll@....com>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"swarren@...dotorg.org" <swarren@...dotorg.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"rob.herring@...xeda.com" <rob.herring@...xeda.com>,
	"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
	"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
	"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH v4 1/4] dma: imx-sdma: Add sdma firmware version 2
 support



> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-
> bounces+bharat.bhushan=freescale.com@...ts.ozlabs.org] On Behalf Of Nicolin Chen
> Sent: Friday, November 08, 2013 4:20 PM
> To: vinod.koul@...el.com; dan.j.williams@...el.com; s.hauer@...gutronix.de;
> timur@...i.org; shawn.guo@...aro.org; broonie@...nel.org
> Cc: mark.rutland@....com; devicetree@...r.kernel.org; alsa-devel@...a-
> project.org; pawel.moll@....com; linux-doc@...r.kernel.org;
> swarren@...dotorg.org; linux-kernel@...r.kernel.org; rob.herring@...xeda.com;
> dmaengine@...r.kernel.org; ijc+devicetree@...lion.org.uk; linuxppc-
> dev@...ts.ozlabs.org; linux-arm-kernel@...ts.infradead.org
> Subject: [PATCH v4 1/4] dma: imx-sdma: Add sdma firmware version 2 support
> 
> On i.MX5/6 series, SDMA is using new version firmware to support SSI dual FIFO
> feature and HDMI Audio (i.MX6Q/DL only). Thus add it.
> 
> Signed-off-by: Nicolin Chen <b42378@...escale.com>
> ---
>  drivers/dma/imx-sdma.c                     | 15 ++++++++++++++-
>  include/linux/platform_data/dma-imx-sdma.h |  5 +++++
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index
> fc43603..c7ece8d 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -323,6 +323,7 @@ struct sdma_engine {
>  	struct clk			*clk_ipg;
>  	struct clk			*clk_ahb;
>  	spinlock_t			channel_0_lock;
> +	u32				script_number;
>  	struct sdma_script_start_addrs	*script_addrs;
>  	const struct sdma_driver_data	*drvdata;
>  };
> @@ -1238,6 +1239,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
> 
>  static void sdma_add_scripts(struct sdma_engine *sdma,
>  		const struct sdma_script_start_addrs *addr) @@ -1246,7 +1248,7 @@
> static void sdma_add_scripts(struct sdma_engine *sdma,
>  	s32 *saddr_arr = (u32 *)sdma->script_addrs;
>  	int i;
> 
> -	for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++)
> +	for (i = 0; i < sdma->script_number; i++)
>  		if (addr_arr[i] > 0)
>  			saddr_arr[i] = addr_arr[i];
>  }
> @@ -1272,6 +1274,17 @@ static void sdma_load_firmware(const struct firmware *fw,
> void *context)
>  		goto err_firmware;
>  	if (header->ram_code_start + header->ram_code_size > fw->size)
>  		goto err_firmware;
> +	switch (header->version_major) {
> +		case 1:
> +			sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1;
> +			break;
> +		case 2:
> +			sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2;
> +			break;
> +		default:
> +			dev_err(sdma->dev, "unknown firmware version\n");
> +			return;

Why return and not "goto err_firmware" ?

-Bharat

> +	}
> 
>  	addr = (void *)header + header->script_addrs_start;
>  	ram_code = (void *)header + header->ram_code_start; diff --git
> a/include/linux/platform_data/dma-imx-sdma.h b/include/linux/platform_data/dma-
> imx-sdma.h
> index 3a39428..eabac4e 100644
> --- a/include/linux/platform_data/dma-imx-sdma.h
> +++ b/include/linux/platform_data/dma-imx-sdma.h
> @@ -43,6 +43,11 @@ struct sdma_script_start_addrs {
>  	s32 dptc_dvfs_addr;
>  	s32 utra_addr;
>  	s32 ram_code_start_addr;
> +	/* End of v1 array */
> +	s32 mcu_2_ssish_addr;
> +	s32 ssish_2_mcu_addr;
> +	s32 hdmi_dma_addr;
> +	/* End of v2 array */
>  };
> 
>  /**
> --
> 1.8.4
> 
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@...ts.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists