Patchwork [U-Boot,v2,2/8] arm/km: remove last_stage_init and unneeded printouts

login
register
mail settings
Submitter Valentin Longchamp
Date May 3, 2011, 2:13 p.m.
Message ID <1304431996-24058-3-git-send-email-valentin.longchamp@keymile.com>
Download mbox | patch
Permalink /patch/93799/
State Changes Requested
Headers show

Comments

Valentin Longchamp - May 3, 2011, 2:13 p.m.
From: Holger Brunck <holger.brunck@keymile.com>

last_stage_init is not available for arm platforms. So move
the calls to set_km_var and set_bootcount_addr to misc_init_r
and remove this function.

Additionally some unneeded printouts were removed.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
---
Changes for v2:
   - split up first large patch series to three independent smaller
     patch series

 board/keymile/km_arm/km_arm.c |   20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)
Prafulla Wadaskar - May 4, 2011, 7:30 a.m.
> -----Original Message-----
> From: Valentin Longchamp [mailto:valentin.longchamp@keymile.com]
> Sent: Tuesday, May 03, 2011 7:43 PM
> To: u-boot@lists.denx.de
> Cc: Prafulla Wadaskar; holger.brunck@keymile.com; Valentin Longchamp;
> Wolfgang Denk; Detlev Zundel
> Subject: [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded
> printouts
> 
> From: Holger Brunck <holger.brunck@keymile.com>
> 
> last_stage_init is not available for arm platforms. So move
> the calls to set_km_var and set_bootcount_addr to misc_init_r
> and remove this function.
> 
> Additionally some unneeded printouts were removed.
> 
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> cc: Prafulla Wadaskar <prafulla@marvell.com>
> cc: Wolfgang Denk <wd@denx.de>
> cc: Detlev Zundel <dzu@denx.de>
> ---
> Changes for v2:
>    - split up first large patch series to three independent smaller
>      patch series
> 
>  board/keymile/km_arm/km_arm.c |   20 ++++----------------
>  1 files changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/board/keymile/km_arm/km_arm.c
> b/board/keymile/km_arm/km_arm.c
> index f147f1f..4049a4e 100644
> --- a/board/keymile/km_arm/km_arm.c
> +++ b/board/keymile/km_arm/km_arm.c
> @@ -161,11 +161,6 @@ int misc_init_r(void)
>  	char *str;
>  	int mach_type;
> 
> -	puts("Piggy:");
> -	if (ethernet_present() == 0)
> -		puts (" not");
> -	puts(" present\n");
> -
>  	str = getenv("mach_type");
>  	if (str != NULL) {
>  		mach_type = simple_strtoul(str, NULL, 10);
> @@ -174,7 +169,10 @@ int misc_init_r(void)
>  	}
> 
>  	initialize_unit_leds();
> -
> +	set_km_env();
> +#if defined(CONFIG_BOOTCOUNT_LIMIT)
> +	set_bootcount_addr();
> +#endif
>  	return 0;
>  }
> 
> @@ -193,7 +191,6 @@ int board_early_init_f(void)
>  	writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
>  	tmp = readl(KW_GPIO0_BASE + 4);
>  	writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
> -	printf("KM: setting NAND mode\n");
> 
>  #if defined(CONFIG_SOFT_I2C)
>  	/* init the GPIO for I2C Bitbang driver */
> @@ -223,15 +220,6 @@ int board_init(void)
>  	return 0;
>  }
> 
> -int last_stage_init(void)
> -{
> -	set_km_env();
> -#if defined(CONFIG_BOOTCOUNT_LIMIT)
> -	set_bootcount_addr();
> -#endif
> -	return 0;
> -}

This patch can be merged with 1/8 since you are undoing the changes done there. BTW: what is purpose?

Regards..
Prafulla ..
Valentin Longchamp - May 4, 2011, 7:43 a.m.
Prafulla Wadaskar wrote:
> 
>> -----Original Message-----
>> From: Valentin Longchamp [mailto:valentin.longchamp@keymile.com]
>> Sent: Tuesday, May 03, 2011 7:43 PM
>> To: u-boot@lists.denx.de
>> Cc: Prafulla Wadaskar; holger.brunck@keymile.com; Valentin Longchamp;
>> Wolfgang Denk; Detlev Zundel
>> Subject: [PATCH v2 2/8] arm/km: remove last_stage_init and unneeded
>> printouts
>>
>> From: Holger Brunck <holger.brunck@keymile.com>
>>
>> last_stage_init is not available for arm platforms. So move
>> the calls to set_km_var and set_bootcount_addr to misc_init_r
>> and remove this function.
>>
>> Additionally some unneeded printouts were removed.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> Acked-by: Heiko Schocher <hs@denx.de>
>> cc: Prafulla Wadaskar <prafulla@marvell.com>
>> cc: Wolfgang Denk <wd@denx.de>
>> cc: Detlev Zundel <dzu@denx.de>
>> ---
>> Changes for v2:
>>    - split up first large patch series to three independent smaller
>>      patch series
>>
>>  board/keymile/km_arm/km_arm.c |   20 ++++----------------
>>  1 files changed, 4 insertions(+), 16 deletions(-)
>>
>> diff --git a/board/keymile/km_arm/km_arm.c
>> b/board/keymile/km_arm/km_arm.c
>> index f147f1f..4049a4e 100644
>> --- a/board/keymile/km_arm/km_arm.c
>> +++ b/board/keymile/km_arm/km_arm.c
>> @@ -161,11 +161,6 @@ int misc_init_r(void)
>>  	char *str;
>>  	int mach_type;
>>
>> -	puts("Piggy:");
>> -	if (ethernet_present() == 0)
>> -		puts (" not");
>> -	puts(" present\n");
>> -
>>  	str = getenv("mach_type");
>>  	if (str != NULL) {
>>  		mach_type = simple_strtoul(str, NULL, 10);
>> @@ -174,7 +169,10 @@ int misc_init_r(void)
>>  	}
>>
>>  	initialize_unit_leds();
>> -
>> +	set_km_env();
>> +#if defined(CONFIG_BOOTCOUNT_LIMIT)
>> +	set_bootcount_addr();
>> +#endif
>>  	return 0;
>>  }
>>
>> @@ -193,7 +191,6 @@ int board_early_init_f(void)
>>  	writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
>>  	tmp = readl(KW_GPIO0_BASE + 4);
>>  	writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
>> -	printf("KM: setting NAND mode\n");
>>
>>  #if defined(CONFIG_SOFT_I2C)
>>  	/* init the GPIO for I2C Bitbang driver */
>> @@ -223,15 +220,6 @@ int board_init(void)
>>  	return 0;
>>  }
>>
>> -int last_stage_init(void)
>> -{
>> -	set_km_env();
>> -#if defined(CONFIG_BOOTCOUNT_LIMIT)
>> -	set_bootcount_addr();
>> -#endif
>> -	return 0;
>> -}
> 
> This patch can be merged with 1/8 since you are undoing the changes done there. BTW: what is purpose?
> 

Yes I agree, they can be merged. You mean the purpose of the bootcounter 
env variable ? Well, we have a bootcounter that is placed at a certain 
reserved memory address, and we compute the address so that we can give 
it to the kernel as a parameter (that's how we have done it on kirkwood 
since we don't have a reserved SRAM for such things).

Regards

Patch

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index f147f1f..4049a4e 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -161,11 +161,6 @@  int misc_init_r(void)
 	char *str;
 	int mach_type;
 
-	puts("Piggy:");
-	if (ethernet_present() == 0)
-		puts (" not");
-	puts(" present\n");
-
 	str = getenv("mach_type");
 	if (str != NULL) {
 		mach_type = simple_strtoul(str, NULL, 10);
@@ -174,7 +169,10 @@  int misc_init_r(void)
 	}
 
 	initialize_unit_leds();
-
+	set_km_env();
+#if defined(CONFIG_BOOTCOUNT_LIMIT)
+	set_bootcount_addr();
+#endif
 	return 0;
 }
 
@@ -193,7 +191,6 @@  int board_early_init_f(void)
 	writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
 	tmp = readl(KW_GPIO0_BASE + 4);
 	writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
-	printf("KM: setting NAND mode\n");
 
 #if defined(CONFIG_SOFT_I2C)
 	/* init the GPIO for I2C Bitbang driver */
@@ -223,15 +220,6 @@  int board_init(void)
 	return 0;
 }
 
-int last_stage_init(void)
-{
-	set_km_env();
-#if defined(CONFIG_BOOTCOUNT_LIMIT)
-	set_bootcount_addr();
-#endif
-	return 0;
-}
-
 #if defined(CONFIG_CMD_SF)
 int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {