diff mbox

[U-Boot] arm:board:trats2:FIX: Clear INFORM4 and INFORM5 registers at correct boot

Message ID 1397047297-15781-1-git-send-email-l.majewski@samsung.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Łukasz Majewski April 9, 2014, 12:41 p.m. UTC
During switch to device tree, commit 1ecab0f has removed this code.

INFORM4 and INFORM5 registers are used by TRATS2 first stage bootloader for
providing recovery. For normal operation, those two must be cleared out.

This error emerges when one force reset from u-boot's command line for
three times.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
---
 board/samsung/trats2/trats2.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Minkyu Kang April 9, 2014, 12:59 p.m. UTC | #1
Dear Lukasz Majewski,

On 09/04/14 21:41, Lukasz Majewski wrote:
> During switch to device tree, commit 1ecab0f has removed this code.
> 
> INFORM4 and INFORM5 registers are used by TRATS2 first stage bootloader for
> providing recovery. For normal operation, those two must be cleared out.
> 
> This error emerges when one force reset from u-boot's command line for
> three times.
> 
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>  board/samsung/trats2/trats2.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
> index 2a6c9f9..75a6c7b 100644
> --- a/board/samsung/trats2/trats2.c
> +++ b/board/samsung/trats2/trats2.c
> @@ -150,9 +150,22 @@ static int pmic_init_max77686(void);
>  
>  int exynos_init(void)
>  {
> +	struct exynos4_power *pwr =
> +		(struct exynos4_power *)samsung_get_base_power();
> +
>  	check_hw_revision();
>  	printf("HW Revision:\t0x%04x\n", board_rev);
>  
> +	/*
> +	 * First bootloader on the TRATS2 platform uses
> +	 * INFORM4 and INFORM5 registers for recovery
> +	 *
> +	 * To indicate correct boot chain - those two
> +	 * registers must be cleared out
> +	 */
> +	writel(0, (unsigned int)&pwr->inform4);
> +	writel(0, (unsigned int)&pwr->inform5);

I think, you don't have to do type casting.

> +
>  	return 0;
>  }
>  
> 

Thanks,
Minkyu Kang.
Łukasz Majewski April 9, 2014, 1:02 p.m. UTC | #2
Hi Minkyu,

> Dear Lukasz Majewski,
> 
> On 09/04/14 21:41, Lukasz Majewski wrote:
> > During switch to device tree, commit 1ecab0f has removed this code.
> > 
> > INFORM4 and INFORM5 registers are used by TRATS2 first stage
> > bootloader for providing recovery. For normal operation, those two
> > must be cleared out.
> > 
> > This error emerges when one force reset from u-boot's command line
> > for three times.
> > 
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Cc: Minkyu Kang <mk7.kang@samsung.com>
> > ---
> >  board/samsung/trats2/trats2.c |   13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/board/samsung/trats2/trats2.c
> > b/board/samsung/trats2/trats2.c index 2a6c9f9..75a6c7b 100644
> > --- a/board/samsung/trats2/trats2.c
> > +++ b/board/samsung/trats2/trats2.c
> > @@ -150,9 +150,22 @@ static int pmic_init_max77686(void);
> >  
> >  int exynos_init(void)
> >  {
> > +	struct exynos4_power *pwr =
> > +		(struct exynos4_power *)samsung_get_base_power();
> > +
> >  	check_hw_revision();
> >  	printf("HW Revision:\t0x%04x\n", board_rev);
> >  
> > +	/*
> > +	 * First bootloader on the TRATS2 platform uses
> > +	 * INFORM4 and INFORM5 registers for recovery
> > +	 *
> > +	 * To indicate correct boot chain - those two
> > +	 * registers must be cleared out
> > +	 */
> > +	writel(0, (unsigned int)&pwr->inform4);
> > +	writel(0, (unsigned int)&pwr->inform5);
> 
> I think, you don't have to do type casting.

You are right, thanks for pointing out.

> 
> > +
> >  	return 0;
> >  }
> >  
> > 
> 
> Thanks,
> Minkyu Kang.
diff mbox

Patch

diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index 2a6c9f9..75a6c7b 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -150,9 +150,22 @@  static int pmic_init_max77686(void);
 
 int exynos_init(void)
 {
+	struct exynos4_power *pwr =
+		(struct exynos4_power *)samsung_get_base_power();
+
 	check_hw_revision();
 	printf("HW Revision:\t0x%04x\n", board_rev);
 
+	/*
+	 * First bootloader on the TRATS2 platform uses
+	 * INFORM4 and INFORM5 registers for recovery
+	 *
+	 * To indicate correct boot chain - those two
+	 * registers must be cleared out
+	 */
+	writel(0, (unsigned int)&pwr->inform4);
+	writel(0, (unsigned int)&pwr->inform5);
+
 	return 0;
 }