[PATCH 1/2] ARM i.MX51: setup mipi

Shawn Guo shawn.guo at linaro.org
Wed Jun 6 22:59:51 EDT 2012


Hi Sascha,

On Tue, Jun 05, 2012 at 11:30:29AM +0200, Sascha Hauer wrote:
> The mipi unit has to be brought to a sane default state. This
> unit is not present on i.MX53, so we add the setup here instead
> of the ipu driver.
> 
Can't we do some detection in IPU driver to have the setup done in
IPU driver?  To me, this (as well as the reset in patch #2) is not
really the material for soc specific initialization.  If I'm running
a system without IPU driver enabled, why do I have to go through these
setup at all?

Regards,
Shawn

> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
> ---
>  arch/arm/mach-imx/mm-imx5.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
> index feeee17..a4cb441 100644
> --- a/arch/arm/mach-imx/mm-imx5.c
> +++ b/arch/arm/mach-imx/mm-imx5.c
> @@ -194,6 +194,26 @@ void __init imx50_soc_init(void)
>  					ARRAY_SIZE(imx50_audmux_res));
>  }
>  
> +/*
> + * The MIPI HSC unit has been removed from the i.MX51 Reference Manual by
> + * the Freescale marketing division. However this did not remove the
> + * hardware from the chip which still needs to be configured for proper
> + * IPU support.
> + */
> +static void __init imx51_ipu_mipi_setup(void)
> +{
> +	void __iomem *hsc_addr;
> +
> +	hsc_addr = MX51_IO_ADDRESS(MX51_MIPI_HSC_BASE_ADDR);
> +
> +	/* setup MIPI module to legacy mode */
> +	__raw_writel(0xf00, hsc_addr);
> +
> +	/* CSI mode: reserved; DI control mode: legacy (from Freescale BSP) */
> +	__raw_writel(__raw_readl(hsc_addr + 0x800) | 0x30ff,
> +		hsc_addr + 0x800);
> +}
> +
>  void __init imx51_soc_init(void)
>  {
>  	/* i.mx51 has the i.mx31 type gpio */
> @@ -212,6 +232,7 @@ void __init imx51_soc_init(void)
>  	/* i.mx51 has the i.mx31 type audmux */
>  	platform_device_register_simple("imx31-audmux", 0, imx51_audmux_res,
>  					ARRAY_SIZE(imx51_audmux_res));
> +	imx51_ipu_mipi_setup();
>  }
>  
>  void __init imx53_soc_init(void)
> -- 
> 1.7.10
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



More information about the linux-arm-kernel mailing list