diff mbox

[U-Boot,4/4] arm/km: remove duplicate code

Message ID 1351851310-8463-4-git-send-email-holger.brunck@keymile.com
State Accepted
Delegated to: Prafulla Wadaskar
Headers show

Commit Message

Holger Brunck Nov. 2, 2012, 10:15 a.m. UTC
From: Valentin Longchamp <valentin.longchamp@keymile.com>

This patch removes 2 small portions of board specific code that are
duplicated with common ARM code and thus unnecessary. These 2 portions
of code concern the mach id that is given by u-boot to the Linux kernel
to identify the system's MACH.

The first one was the possibility to change the MACH thanks to the
'mach_id' enviroment variable. This is possible thanks to the 'machid'
env variable (see arch/arm/lib/bootm.c:boot_jump_linux()).

The seconde one is the setting of the bi_arch_number. This is already
done in arch/arm/lib/board.c:board_init_f() since km_arm.h does #define
CONFIG_MACH_TYPE.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
---
 board/keymile/km_arm/km_arm.c |   14 --------------
 1 files changed, 0 insertions(+), 14 deletions(-)

Comments

Prafulla Wadaskar Nov. 10, 2012, 7:21 a.m. UTC | #1
> -----Original Message-----
> From: Holger Brunck [mailto:holger.brunck@keymile.com]
> Sent: 02 November 2012 15:45
> To: u-boot@lists.denx.de
> Cc: Valentin Longchamp; Holger Brunck; Prafulla Wadaskar
> Subject: [PATCH 4/4] arm/km: remove duplicate code
> 
> From: Valentin Longchamp <valentin.longchamp@keymile.com>
> 
> This patch removes 2 small portions of board specific code that are
> duplicated with common ARM code and thus unnecessary. These 2 portions
> of code concern the mach id that is given by u-boot to the Linux
> kernel
> to identify the system's MACH.
> 
> The first one was the possibility to change the MACH thanks to the
> 'mach_id' enviroment variable. This is possible thanks to the 'machid'
> env variable (see arch/arm/lib/bootm.c:boot_jump_linux()).
> 
> The seconde one is the setting of the bi_arch_number. This is already
> done in arch/arm/lib/board.c:board_init_f() since km_arm.h does
> #define
> CONFIG_MACH_TYPE.
> 
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> cc: Holger Brunck <holger.brunck@keymile.com>
> cc: Prafulla Wadaskar <prafulla@marvell.com>
> ---
>  board/keymile/km_arm/km_arm.c |   14 --------------
>  1 files changed, 0 insertions(+), 14 deletions(-)
> 
> diff --git a/board/keymile/km_arm/km_arm.c
> b/board/keymile/km_arm/km_arm.c
> index 0c4dddc..262b8d2 100644
> --- a/board/keymile/km_arm/km_arm.c
> +++ b/board/keymile/km_arm/km_arm.c
> @@ -193,15 +193,6 @@ void set_bootcount_addr(void)
> 
>  int misc_init_r(void)
>  {
> -	char *str;
> -	int mach_type;
> -
> -	str = getenv("mach_type");
> -	if (str != NULL) {
> -		mach_type = simple_strtoul(str, NULL, 10);
> -		printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
> -		gd->bd->bi_arch_number = mach_type;
> -	}
>  #if defined(CONFIG_KM_MGCOGE3UN)
>  	char *wait_for_ne;
>  	wait_for_ne = getenv("waitforne");
> @@ -258,11 +249,6 @@ int board_early_init_f(void)
> 
>  int board_init(void)
>  {
> -	/*
> -	 * arch number of board
> -	 */
> -	gd->bd->bi_arch_number = MACH_TYPE_KM_KIRKWOOD;
> -
>  	/* address of boot parameters */
>  	gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
> 
> --


Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>

Regards...
Prafulla . . .
Prafulla Wadaskar Dec. 20, 2012, 6:39 a.m. UTC | #2
> -----Original Message-----
> From: Holger Brunck [mailto:holger.brunck@keymile.com]
> Sent: 02 November 2012 15:45
> To: u-boot@lists.denx.de
> Cc: Valentin Longchamp; Holger Brunck; Prafulla Wadaskar
> Subject: [PATCH 4/4] arm/km: remove duplicate code
> 
> From: Valentin Longchamp <valentin.longchamp@keymile.com>
> 
> This patch removes 2 small portions of board specific code that are
> duplicated with common ARM code and thus unnecessary. These 2 portions
> of code concern the mach id that is given by u-boot to the Linux
> kernel
> to identify the system's MACH.
> 
> The first one was the possibility to change the MACH thanks to the
> 'mach_id' enviroment variable. This is possible thanks to the 'machid'
> env variable (see arch/arm/lib/bootm.c:boot_jump_linux()).
> 
> The seconde one is the setting of the bi_arch_number. This is already
> done in arch/arm/lib/board.c:board_init_f() since km_arm.h does
> #define
> CONFIG_MACH_TYPE.
> 
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> cc: Holger Brunck <holger.brunck@keymile.com>
> cc: Prafulla Wadaskar <prafulla@marvell.com>
> ---
>  board/keymile/km_arm/km_arm.c |   14 --------------
>  1 files changed, 0 insertions(+), 14 deletions(-)
> 
> diff --git a/board/keymile/km_arm/km_arm.c
> b/board/keymile/km_arm/km_arm.c
> index 0c4dddc..262b8d2 100644
> --- a/board/keymile/km_arm/km_arm.c
> +++ b/board/keymile/km_arm/km_arm.c
> @@ -193,15 +193,6 @@ void set_bootcount_addr(void)
> 
>  int misc_init_r(void)
>  {
> -	char *str;
> -	int mach_type;
> -
> -	str = getenv("mach_type");
> -	if (str != NULL) {
> -		mach_type = simple_strtoul(str, NULL, 10);
> -		printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
> -		gd->bd->bi_arch_number = mach_type;
> -	}
>  #if defined(CONFIG_KM_MGCOGE3UN)
>  	char *wait_for_ne;
>  	wait_for_ne = getenv("waitforne");
> @@ -258,11 +249,6 @@ int board_early_init_f(void)
> 
>  int board_init(void)
>  {
> -	/*
> -	 * arch number of board
> -	 */
> -	gd->bd->bi_arch_number = MACH_TYPE_KM_KIRKWOOD;
> -
>  	/* address of boot parameters */
>  	gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
> 
> --
> 1.7.1

Applied to u-boot-marvell.git master branch

Regards...
Prafulla . . .
diff mbox

Patch

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 0c4dddc..262b8d2 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -193,15 +193,6 @@  void set_bootcount_addr(void)
 
 int misc_init_r(void)
 {
-	char *str;
-	int mach_type;
-
-	str = getenv("mach_type");
-	if (str != NULL) {
-		mach_type = simple_strtoul(str, NULL, 10);
-		printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
-		gd->bd->bi_arch_number = mach_type;
-	}
 #if defined(CONFIG_KM_MGCOGE3UN)
 	char *wait_for_ne;
 	wait_for_ne = getenv("waitforne");
@@ -258,11 +249,6 @@  int board_early_init_f(void)
 
 int board_init(void)
 {
-	/*
-	 * arch number of board
-	 */
-	gd->bd->bi_arch_number = MACH_TYPE_KM_KIRKWOOD;
-
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;