public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] ipu common: reset ipuv3 correctly
Date: Sat, 06 Oct 2012 11:00:02 -0700	[thread overview]
Message-ID: <507071A2.8070805@boundarydevices.com> (raw)
In-Reply-To: <1349532964-8480-1-git-send-email-Ying.liu@freescale.com>

Hi Liu Ying,

On 10/06/2012 07:16 AM, Liu Ying wrote:
> From: Liu Ying<Ying.Liu@freescale.com>
>
> This patch checks self-clear sw_ipu_rst bit in
> SCR register of SRC controller to be cleared
> after setting it to high to reset IPUv3. This
> makes sure that IPUv3 finishes sofware reset.
> A timeout mechanism is added to stop polling
> on the bit status in case the bit could not be
> cleared by the hardware automatically within
> 10 millisecond.
>
> Signed-off-by: Liu Ying<Ying.Liu@freescale.com>
> ---
>   drivers/video/ipu_common.c |   10 ++++++++++
>   1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c
> index 2020da9..fcc1745 100644
> --- a/drivers/video/ipu_common.c
> +++ b/drivers/video/ipu_common.c
> @@ -94,6 +94,7 @@ struct ipu_ch_param {
>   	temp1; \
>   })
>
> +#define IPU_SW_RST_TOUT_USEC	(10000)
>
>   void clk_enable(struct clk *clk)
>   {
> @@ -392,11 +393,20 @@ void ipu_reset(void)
>   {
>   	u32 *reg;
>   	u32 value;
> +	int timeout = IPU_SW_RST_TOUT_USEC;
>
>   	reg = (u32 *)SRC_BASE_ADDR;
>   	value = __raw_readl(reg);
>   	value = value | SW_IPU_RST;
>   	__raw_writel(value, reg);
> +
> +	while (__raw_readl(reg)&  SW_IPU_RST) {
> +		udelay(1);
> +		if (!(timeout--)) {
> +			printf("ipu software reset timeout\n");
> +			break;
> +		}
> +	};
>   }
>
>   /*

Tested in the normal (successful) case on SABRE Lite.

Is there a situation under which this is known to fail or
is that a hypothetical?

  reply	other threads:[~2012-10-06 18:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-06 14:16 [U-Boot] [PATCH 1/1] ipu common: reset ipuv3 correctly Liu Ying
2012-10-06 18:00 ` Eric Nelson [this message]
2012-10-19 23:58 ` Anatolij Gustschin
  -- strict thread matches above, loose matches on Subject: below --
2012-10-06 10:32 Liu Ying
2012-10-06 12:59 ` Fabio Estevam
2012-10-06 12:59   ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=507071A2.8070805@boundarydevices.com \
    --to=eric.nelson@boundarydevices.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox