[U-Boot] [PATCH 1/2] OMAP3: Remove unused board-types

The board-types defined in struct omap3_sysinfo seem to be unused. The function display_board_info() is passed board type as an argument; which is ignored.
This patch removes all uses of board-type, related definitions and functions.
Signed-off-by: Sanjeev Premi premi@ti.com --- board/omap3/beagle/beagle.h | 2 -- board/omap3/evm/evm.h | 2 -- board/omap3/overo/overo.h | 2 -- board/omap3/pandora/pandora.h | 2 -- board/omap3/zoom1/zoom1.h | 2 -- cpu/arm_cortexa8/omap3/board.c | 5 +---- cpu/arm_cortexa8/omap3/sys_info.c | 19 +------------------ include/asm-arm/arch-omap3/omap3.h | 8 -------- include/asm-arm/arch-omap3/sys_proto.h | 5 +---- 9 files changed, 3 insertions(+), 44 deletions(-)
diff --git a/board/omap3/beagle/beagle.h b/board/omap3/beagle/beagle.h index d66f159..5d45f01 100644 --- a/board/omap3/beagle/beagle.h +++ b/board/omap3/beagle/beagle.h @@ -24,8 +24,6 @@ #define _BEAGLE_H_
const omap3_sysinfo sysinfo = { - SDP_3430_V1, - SDP_3430_V2, DDR_STACKED, "OMAP3 Beagle board", #if defined(CONFIG_ENV_IS_IN_ONENAND) diff --git a/board/omap3/evm/evm.h b/board/omap3/evm/evm.h index 199824f..4a82a7f 100644 --- a/board/omap3/evm/evm.h +++ b/board/omap3/evm/evm.h @@ -24,8 +24,6 @@ #define _EVM_H_
const omap3_sysinfo sysinfo = { - OMAP3EVM_V1, - OMAP3EVM_V2, DDR_DISCRETE, "OMAP3 EVM board", #if defined(CONFIG_ENV_IS_IN_ONENAND) diff --git a/board/omap3/overo/overo.h b/board/omap3/overo/overo.h index e8ccc1d..b595f6a 100644 --- a/board/omap3/overo/overo.h +++ b/board/omap3/overo/overo.h @@ -24,8 +24,6 @@ #define _OVERO_H_
const omap3_sysinfo sysinfo = { - SDP_3430_V1, - SDP_3430_V2, DDR_STACKED, "Gumstix Overo board", #if defined(CONFIG_ENV_IS_IN_ONENAND) diff --git a/board/omap3/pandora/pandora.h b/board/omap3/pandora/pandora.h index dd09f12..8f0838c 100644 --- a/board/omap3/pandora/pandora.h +++ b/board/omap3/pandora/pandora.h @@ -24,8 +24,6 @@ #define _PANDORA_H_
const omap3_sysinfo sysinfo = { - SDP_3430_V1, - SDP_3430_V2, DDR_STACKED, "OMAP3 Pandora", "NAND", diff --git a/board/omap3/zoom1/zoom1.h b/board/omap3/zoom1/zoom1.h index bc8fba8..4f49a41 100644 --- a/board/omap3/zoom1/zoom1.h +++ b/board/omap3/zoom1/zoom1.h @@ -28,8 +28,6 @@ #define _BOARD_ZOOM1_H_
const omap3_sysinfo sysinfo = { - SDP_3430_V1, - SDP_3430_V2, DDR_STACKED, "OMAP3 Zoom MDK Rev 1", "NAND", diff --git a/cpu/arm_cortexa8/omap3/board.c b/cpu/arm_cortexa8/omap3/board.c index 15ea936..9318e22 100644 --- a/cpu/arm_cortexa8/omap3/board.c +++ b/cpu/arm_cortexa8/omap3/board.c @@ -272,11 +272,8 @@ int dram_init(void) { DECLARE_GLOBAL_DATA_PTR; unsigned int size0 = 0, size1 = 0; - u32 btype;
- btype = get_board_type(); - - display_board_info(btype); + display_board_info();
/* * If a second bank of DDR is attached to CS1 this is diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c index b385b91..80f6e5e 100644 --- a/cpu/arm_cortexa8/omap3/sys_info.c +++ b/cpu/arm_cortexa8/omap3/sys_info.c @@ -130,23 +130,6 @@ u32 get_sdr_cs_offset(u32 cs) return offset; }
-/*********************************************************************** - * get_board_type() - get board type based on current production stats. - * - NOTE-1-: 2 I2C EEPROMs will someday be populated with proper info. - * when they are available we can get info from there. This should - * be correct of all known boards up until today. - * - NOTE-2- EEPROMs are populated but they are updated very slowly. To - * avoid waiting on them we will use ES version of the chip to get info. - * A later version of the FPGA migth solve their speed issue. - ************************************************************************/ -u32 get_board_type(void) -{ - if (get_cpu_rev() == CPU_3430_ES2) - return sysinfo.board_type_v2; - else - return sysinfo.board_type_v1; -} - /*************************************************************************** * get_gpmc0_base() - Return current address hardware will be * fetching from. The below effectively gives what is correct, its a bit @@ -188,7 +171,7 @@ u32 get_board_rev(void) /********************************************************************* * display_board_info() - print banner with board info. *********************************************************************/ -void display_board_info(u32 btype) +void display_board_info(void) { char *cpu_s, *mem_s, *sec_s;
diff --git a/include/asm-arm/arch-omap3/omap3.h b/include/asm-arm/arch-omap3/omap3.h index 8c9656f..d0d2737 100644 --- a/include/asm-arm/arch-omap3/omap3.h +++ b/include/asm-arm/arch-omap3/omap3.h @@ -177,14 +177,6 @@ typedef struct gpio { #define WIDTH_8BIT 0x0000 #define WIDTH_16BIT 0x1000 /* bit pos for 16 bit in gpmc */
-/* SDP definitions according to FPGA Rev. Is this OK?? */ -#define SDP_3430_V1 0x1 -#define SDP_3430_V2 0x2 - -/* EVM definitions */ -#define OMAP3EVM_V1 0x1 -#define OMAP3EVM_V2 0x2 - /* I2C power management companion definitions */ #define PWRMGT_ADDR_ID1 0x48 #define PWRMGT_ADDR_ID2 0x49 diff --git a/include/asm-arm/arch-omap3/sys_proto.h b/include/asm-arm/arch-omap3/sys_proto.h index 8b554bb..1bcec04 100644 --- a/include/asm-arm/arch-omap3/sys_proto.h +++ b/include/asm-arm/arch-omap3/sys_proto.h @@ -22,8 +22,6 @@ #define _SYS_PROTO_H_
typedef struct { - u32 board_type_v1; - u32 board_type_v2; u32 mtype; char *board_string; char *nand_string; @@ -46,8 +44,7 @@ u32 get_sysboot_value(void); u32 is_gpmc_muxed(void); u32 get_gpmc0_type(void); u32 get_gpmc0_width(void); -u32 get_board_type(void); -void display_board_info(u32); +void display_board_info(void); u32 get_sdr_cs_size(u32); u32 get_sdr_cs_offset(u32); u32 is_running_in_sdram(void);

On 20:21 Fri 24 Apr , Sanjeev Premi wrote:
The board-types defined in struct omap3_sysinfo seem to be unused. The function display_board_info() is passed board type as an argument; which is ignored.
This patch removes all uses of board-type, related definitions and functions.
I've forget to tell you this on the precedent patch but we have print_cpuinfo for printing cpu/soc info and checkboard for board info
could you move the STD API
Tks
Best Regards, J.

Dear Jean-Christophe,
Jean-Christophe PLAGNIOL-VILLARD wrote:
On 20:21 Fri 24 Apr , Sanjeev Premi wrote:
The board-types defined in struct omap3_sysinfo seem to be unused. The function display_board_info() is passed board type as an argument; which is ignored.
This patch removes all uses of board-type, related definitions and functions.
I've forget to tell you this on the precedent patch but we have print_cpuinfo
print_cpuinfo() is marked as 'test only' in lib_arm/board.c:
int print_cpuinfo (void); /* test-only */
Dirk
for printing cpu/soc info and checkboard for board info
could you move the STD API
Tks
Best Regards, J. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

On 18:59 Fri 24 Apr , Dirk Behme wrote:
Dear Jean-Christophe,
Jean-Christophe PLAGNIOL-VILLARD wrote:
On 20:21 Fri 24 Apr , Sanjeev Premi wrote:
The board-types defined in struct omap3_sysinfo seem to be unused. The function display_board_info() is passed board type as an argument; which is ignored.
This patch removes all uses of board-type, related definitions and functions.
I've forget to tell you this on the precedent patch but we have print_cpuinfo
print_cpuinfo() is marked as 'test only' in lib_arm/board.c:
int print_cpuinfo (void); /* test-only */
please remove the commet, as it does not apply anymore for years
Best Regards, J.

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20090424164422.GB2953@game.jcrosoft.org you wrote:
On 20:21 Fri 24 Apr , Sanjeev Premi wrote:
The board-types defined in struct omap3_sysinfo seem to be unused. The function display_board_info() is passed board type as an argument; which is ignored.
This patch removes all uses of board-type, related definitions and functions.
I've forget to tell you this on the precedent patch but we have print_cpuinfo for printing cpu/soc info and checkboard for board info
could you move the STD API
What exactly do you mean by "move the STD API"?
In which way should the "STD API" be moved, and what exactly is the "STD API" you are referring to?
And please, could you *please* be clear about what your comments mean - I have no idea if your comment above means that you reject the patch, or if you request it to be changed (in which case I don;t understand how it should be changed, or why), or if you are going to apply it.
Please make this clear.
Best regards,
Wolfgang Denk

On 21:34 Fri 24 Apr , Wolfgang Denk wrote:
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20090424164422.GB2953@game.jcrosoft.org you wrote:
On 20:21 Fri 24 Apr , Sanjeev Premi wrote:
The board-types defined in struct omap3_sysinfo seem to be unused. The function display_board_info() is passed board type as an argument; which is ignored.
This patch removes all uses of board-type, related definitions and functions.
I've forget to tell you this on the precedent patch but we have print_cpuinfo for printing cpu/soc info and checkboard for board info
could you move the STD API
What exactly do you mean by "move the STD API"?
In which way should the "STD API" be moved, and what exactly is the "STD API" you are referring to?
extract of arm init function
#if defined(CONFIG_DISPLAY_CPUINFO) print_cpuinfo, /* display cpu info (and speed) */ #endif #if defined(CONFIG_DISPLAY_BOARDINFO) checkboard, /* display board info */ #endif
I want we use the current API and not re-invent a new API for an arch only
so Sanjeev please use it
And please, could you *please* be clear about what your comments mean
- I have no idea if your comment above means that you reject the
patch, or if you request it to be changed (in which case I don;t understand how it should be changed, or why), or if you are going to apply it.
Change requested
Best Regards, J.

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20090424200323.GD2953@game.jcrosoft.org you wrote:
What exactly do you mean by "move the STD API"?
In which way should the "STD API" be moved, and what exactly is the "STD API" you are referring to?
extract of arm init function
#if defined(CONFIG_DISPLAY_CPUINFO) print_cpuinfo, /* display cpu info (and speed) */ #endif #if defined(CONFIG_DISPLAY_BOARDINFO) checkboard, /* display board info */ #endif
I want we use the current API and not re-invent a new API for an arch only
Well, if you conside rthis the "standard API", this should (1) be documented somewhere, and (2) it must be fixed - at the moment, the code reads:
lib_arm/board.c:int print_cpuinfo (void); /* test-only */
I would not dare to use such a function in my code given the "test-only" comment.
And please, could you *please* be clear about what your comments mean
- I have no idea if your comment above means that you reject the
patch, or if you request it to be changed (in which case I don;t understand how it should be changed, or why), or if you are going to apply it.
Change requested
That's much better. Now at least we know where we are.
Thanks.
Best regards,
Wolfgang Denk

On 23:01 Fri 24 Apr , Wolfgang Denk wrote:
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20090424200323.GD2953@game.jcrosoft.org you wrote:
What exactly do you mean by "move the STD API"?
In which way should the "STD API" be moved, and what exactly is the "STD API" you are referring to?
extract of arm init function
#if defined(CONFIG_DISPLAY_CPUINFO) print_cpuinfo, /* display cpu info (and speed) */ #endif #if defined(CONFIG_DISPLAY_BOARDINFO) checkboard, /* display board info */ #endif
I want we use the current API and not re-invent a new API for an arch only
Well, if you conside rthis the "standard API", this should (1) be documented somewhere, and (2) it must be fixed - at the moment, the code reads:
lib_arm/board.c:int print_cpuinfo (void); /* test-only */
I would not dare to use such a function in my code given the "test-only" comment.
sorry I've no time to clean every part of the arm as noone else are interrested in old code
so yes it will be cleanup but later asI work on other part of the arm actually which I will finish first
Best Regards, J.

Jean-Christophe PLAGNIOL-VILLARD wrote:
On 23:01 Fri 24 Apr , Wolfgang Denk wrote:
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20090424200323.GD2953@game.jcrosoft.org you wrote:
What exactly do you mean by "move the STD API"?
In which way should the "STD API" be moved, and what exactly is the "STD API" you are referring to?
extract of arm init function
#if defined(CONFIG_DISPLAY_CPUINFO) print_cpuinfo, /* display cpu info (and speed) */ #endif #if defined(CONFIG_DISPLAY_BOARDINFO) checkboard, /* display board info */ #endif
I want we use the current API and not re-invent a new API for an arch only
Well, if you conside rthis the "standard API", this should (1) be documented somewhere, and (2) it must be fixed - at the moment, the code reads:
lib_arm/board.c:int print_cpuinfo (void); /* test-only */
I would not dare to use such a function in my code given the "test-only" comment.
sorry I've no time to clean every part of the arm as noone else are interrested in old code
so yes it will be cleanup but later asI work on other part of the arm actually which I will finish first
Uups :( And this is what I really have a problem with.
We sent a patch which removes only dead code, i.e. which consist only of '-' lines (well, except for the removal of a parameter passed by a function ;) ).
http://lists.denx.de/pipermail/u-boot/2009-April/051338.html
Then we are asked to change other stuff which is touched by this removal, too, to get the patch applied (One could argue that a better way to deal with this would be to apply the code removal patch and ask for sending an *additional* patch to clean up API usage. And not make it dependent. But that's an other topic...)
Then we find that the changes we are asked to do rely on code that is marked with 'test only' and needs documentation.
And the request for this documentation (would it take more than 0.5h?) get the answer above.
And now? What are we supposed to do?
Change our patch based on 'test only' undocumented code?
Or will a trivial 'remove dead code only' patch delayed until e.g. the Kconfig framework or e.g. the new clock framework or e.g. <add what you want> will be ready? And when will this be?
A confused
Dirk

Dear Dirk Behme,
In message 49F3E966.701@googlemail.com you wrote:
I would not dare to use such a function in my code given the "test-only" comment.
sorry I've no time to clean every part of the arm as noone else are interrested in old code
so yes it will be cleanup but later asI work on other part of the arm actually which I will finish first
Uups :( And this is what I really have a problem with.
Problem solved.
I removed this comment. The patch has been checked into mainline,
Then we find that the changes we are asked to do rely on code that is marked with 'test only' and needs documentation.
Actualy I removed only the comment. I left the documentation for those who know better than me what's going on.
And now? What are we supposed to do?
Change our patch based on 'test only' undocumented code?
The test-only has been removed, and the documentation will be added ASAP. Please base your patch on this code as is now (even though the documentation is still missing).
Or will a trivial 'remove dead code only' patch delayed until e.g. the Kconfig framework or e.g. the new clock framework or e.g. <add what you want> will be ready? And when will this be?
No, it will not be delayed. I will take personal care that it goes into this release. If needed I will apply it myself.
Best regards,
Wolfgang Denk

Sanjeev Premi wrote:
The board-types defined in struct omap3_sysinfo seem to be unused. The function display_board_info() is passed board type as an argument; which is ignored.
This patch removes all uses of board-type, related definitions and functions.
Signed-off-by: Sanjeev Premi premi@ti.com
Signed-off-by: Dirk Behme dirk.behme@googlemail.com Tested-by: Dirk Behme dirk.behme@googlemail.com
board/omap3/beagle/beagle.h | 2 -- board/omap3/evm/evm.h | 2 -- board/omap3/overo/overo.h | 2 -- board/omap3/pandora/pandora.h | 2 -- board/omap3/zoom1/zoom1.h | 2 -- cpu/arm_cortexa8/omap3/board.c | 5 +---- cpu/arm_cortexa8/omap3/sys_info.c | 19 +------------------ include/asm-arm/arch-omap3/omap3.h | 8 -------- include/asm-arm/arch-omap3/sys_proto.h | 5 +---- 9 files changed, 3 insertions(+), 44 deletions(-)
diff --git a/board/omap3/beagle/beagle.h b/board/omap3/beagle/beagle.h index d66f159..5d45f01 100644 --- a/board/omap3/beagle/beagle.h +++ b/board/omap3/beagle/beagle.h @@ -24,8 +24,6 @@ #define _BEAGLE_H_
const omap3_sysinfo sysinfo = {
- SDP_3430_V1,
- SDP_3430_V2, DDR_STACKED, "OMAP3 Beagle board",
#if defined(CONFIG_ENV_IS_IN_ONENAND) diff --git a/board/omap3/evm/evm.h b/board/omap3/evm/evm.h index 199824f..4a82a7f 100644 --- a/board/omap3/evm/evm.h +++ b/board/omap3/evm/evm.h @@ -24,8 +24,6 @@ #define _EVM_H_
const omap3_sysinfo sysinfo = {
- OMAP3EVM_V1,
- OMAP3EVM_V2, DDR_DISCRETE, "OMAP3 EVM board",
#if defined(CONFIG_ENV_IS_IN_ONENAND) diff --git a/board/omap3/overo/overo.h b/board/omap3/overo/overo.h index e8ccc1d..b595f6a 100644 --- a/board/omap3/overo/overo.h +++ b/board/omap3/overo/overo.h @@ -24,8 +24,6 @@ #define _OVERO_H_
const omap3_sysinfo sysinfo = {
- SDP_3430_V1,
- SDP_3430_V2, DDR_STACKED, "Gumstix Overo board",
#if defined(CONFIG_ENV_IS_IN_ONENAND) diff --git a/board/omap3/pandora/pandora.h b/board/omap3/pandora/pandora.h index dd09f12..8f0838c 100644 --- a/board/omap3/pandora/pandora.h +++ b/board/omap3/pandora/pandora.h @@ -24,8 +24,6 @@ #define _PANDORA_H_
const omap3_sysinfo sysinfo = {
- SDP_3430_V1,
- SDP_3430_V2, DDR_STACKED, "OMAP3 Pandora", "NAND",
diff --git a/board/omap3/zoom1/zoom1.h b/board/omap3/zoom1/zoom1.h index bc8fba8..4f49a41 100644 --- a/board/omap3/zoom1/zoom1.h +++ b/board/omap3/zoom1/zoom1.h @@ -28,8 +28,6 @@ #define _BOARD_ZOOM1_H_
const omap3_sysinfo sysinfo = {
- SDP_3430_V1,
- SDP_3430_V2, DDR_STACKED, "OMAP3 Zoom MDK Rev 1", "NAND",
diff --git a/cpu/arm_cortexa8/omap3/board.c b/cpu/arm_cortexa8/omap3/board.c index 15ea936..9318e22 100644 --- a/cpu/arm_cortexa8/omap3/board.c +++ b/cpu/arm_cortexa8/omap3/board.c @@ -272,11 +272,8 @@ int dram_init(void) { DECLARE_GLOBAL_DATA_PTR; unsigned int size0 = 0, size1 = 0;
u32 btype;
btype = get_board_type();
display_board_info(btype);
display_board_info();
/*
- If a second bank of DDR is attached to CS1 this is
diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c index b385b91..80f6e5e 100644 --- a/cpu/arm_cortexa8/omap3/sys_info.c +++ b/cpu/arm_cortexa8/omap3/sys_info.c @@ -130,23 +130,6 @@ u32 get_sdr_cs_offset(u32 cs) return offset; }
-/***********************************************************************
- get_board_type() - get board type based on current production stats.
- NOTE-1-: 2 I2C EEPROMs will someday be populated with proper info.
- when they are available we can get info from there. This should
- be correct of all known boards up until today.
- NOTE-2- EEPROMs are populated but they are updated very slowly. To
- avoid waiting on them we will use ES version of the chip to get info.
- A later version of the FPGA migth solve their speed issue.
- ************************************************************************/
-u32 get_board_type(void) -{
- if (get_cpu_rev() == CPU_3430_ES2)
return sysinfo.board_type_v2;
- else
return sysinfo.board_type_v1;
-}
/***************************************************************************
- get_gpmc0_base() - Return current address hardware will be
fetching from. The below effectively gives what is correct, its a bit
@@ -188,7 +171,7 @@ u32 get_board_rev(void) /*********************************************************************
- display_board_info() - print banner with board info.
*********************************************************************/ -void display_board_info(u32 btype) +void display_board_info(void) { char *cpu_s, *mem_s, *sec_s;
diff --git a/include/asm-arm/arch-omap3/omap3.h b/include/asm-arm/arch-omap3/omap3.h index 8c9656f..d0d2737 100644 --- a/include/asm-arm/arch-omap3/omap3.h +++ b/include/asm-arm/arch-omap3/omap3.h @@ -177,14 +177,6 @@ typedef struct gpio { #define WIDTH_8BIT 0x0000 #define WIDTH_16BIT 0x1000 /* bit pos for 16 bit in gpmc */
-/* SDP definitions according to FPGA Rev. Is this OK?? */ -#define SDP_3430_V1 0x1 -#define SDP_3430_V2 0x2
-/* EVM definitions */ -#define OMAP3EVM_V1 0x1 -#define OMAP3EVM_V2 0x2
/* I2C power management companion definitions */ #define PWRMGT_ADDR_ID1 0x48 #define PWRMGT_ADDR_ID2 0x49 diff --git a/include/asm-arm/arch-omap3/sys_proto.h b/include/asm-arm/arch-omap3/sys_proto.h index 8b554bb..1bcec04 100644 --- a/include/asm-arm/arch-omap3/sys_proto.h +++ b/include/asm-arm/arch-omap3/sys_proto.h @@ -22,8 +22,6 @@ #define _SYS_PROTO_H_
typedef struct {
- u32 board_type_v1;
- u32 board_type_v2; u32 mtype; char *board_string; char *nand_string;
@@ -46,8 +44,7 @@ u32 get_sysboot_value(void); u32 is_gpmc_muxed(void); u32 get_gpmc0_type(void); u32 get_gpmc0_width(void); -u32 get_board_type(void); -void display_board_info(u32); +void display_board_info(void); u32 get_sdr_cs_size(u32); u32 get_sdr_cs_offset(u32); u32 is_running_in_sdram(void);
participants (4)
-
Dirk Behme
-
Jean-Christophe PLAGNIOL-VILLARD
-
Sanjeev Premi
-
Wolfgang Denk