[U-Boot] Fix the Double defind for setenv on ARM platform

Hi all,
Today, I test s5p_goni board 1. I have found two issue: (1) Double defind setenv I found setenv defind in the file of include/common.h and arch/arm/include/asm/u-boot-arm.h. At the same time, common.h include u-boot-arm.h head file. (2) The type of parameters is inconsistent for the setenv: arch/arm/include/asm/u-boot-arm.h: setenv(char *,char *)
include/common.h: setenv(const char *,const char *)
When everyone build the board, the error information will be display as following: /home/seedshope/work/home-project/obj/u-boot/include2/asm/u-boot-arm.h:66: error: conflicting types for 'setenv'
I have test the patch for armv7 cpu to use command "./MAKEALL -a arm -c armv7". 2. The reproduce step as following (1) The build enviroment: u-boot is the source PATH and /home/seedshope/work/home-project/obj/u-boot is my object path. The cross compile version as following:
/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc -v
Using built-in specs. Target: arm-none-linux-gnueabi Configured with: /scratch/julian/2009q3-respin-linux-lite/src/gcc-4.4/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --disable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q3-67' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/jul ian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/bin Thread model: posix gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67)
(2) configure s5p_goni_board
make -C u-boot O=/home/seedshope/work/home-project/obj/u-boot CROSS_COMPILE=/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi- distclean
make: Entering directory `/home/seedshope/work/home-project/u-boot' rm -rf /home/seedshope/work/home-project/obj/u-boot/* make: Leaving directory `/home/seedshope/work/home-project/u-boot'
(3) build s5p_goni board
make -C u-boot O=/home/seedshope/work/home-project/obj/u-boot CROSS_COMPILE=/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-
make: Entering directory `/home/seedshope/work/home-project/u-boot' Generating /home/seedshope/work/home-project/obj/u-boot/include/autoconf.mk Generating /home/seedshope/work/home-project/obj/u-boot/include/autoconf.mk.dep make: Leaving directory `/home/seedshope/work/home-project/u-boot' make: Entering directory `/home/seedshope/work/home-project/u-boot' /usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc -DDO_DEPS_ONLY \ -g -Os -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x34800000 -I/home/seedshope/work/home-project/obj/u-boot/include2 -I/home/seedshope/work/home-project/obj/u-boot/include -I/home/seedshope/work/home-project/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/arm/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/include -pipe -DCONFIG_ARM -D__ARM__ -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security \ -o /home/seedshope/work/home-project/obj/u-boot/lib/asm-offsets.s /home/seedshope/work/home-project/u-boot/lib/asm-offsets.c -c -S In file included from /home/seedshope/work/home-project/u-boot/include/common.h:276, from /home/seedshope/work/home-project/u-boot/lib/asm-offsets.c:18: /home/seedshope/work/home-project/obj/u-boot/include2/asm/u-boot-arm.h:66: error: conflicting types for 'setenv' /home/seedshope/work/home-project/u-boot/include/common.h:271: note: previous declaration of 'setenv' was here make: *** [/home/seedshope/work/home-project/obj/u-boot/lib/asm-offsets.s] Error 1 make: Leaving directory `/home/seedshope/work/home-project/u-boot'

From: seedshope bocui107@gmail.com
setenv is defined common.h. We do not need re-defined it
Zhong hongbo bocui107@gmail.com --- arch/arm/include/asm/u-boot-arm.h | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h index 3904027..e3fbb53 100644 --- a/arch/arm/include/asm/u-boot-arm.h +++ b/arch/arm/include/asm/u-boot-arm.h @@ -57,14 +57,6 @@ void dram_init_banksize (void); void setup_serial_tag (struct tag **params); void setup_revision_tag (struct tag **params);
-/* ------------------------------------------------------------ */ -/* Here is a list of some prototypes which are incompatible to */ -/* the U-Boot implementation */ -/* To be fixed! */ -/* ------------------------------------------------------------ */ -/* common/cmd_nvedit.c */ -int setenv (char *, char *); - /* cpu/.../interrupt.c */ int arch_interrupt_init (void); void reset_timer_masked (void);

Dear Zhong Hongbo,
In message 1312046929-10260-2-git-send-email-bocui107@gmail.com you wrote:
From: seedshope bocui107@gmail.com
setenv is defined common.h. We do not need re-defined it
Thanks, but there are some more function prototypes in this block which are actually bogus. I have a more complete cleanup patch ready, I'm running MAKEALL to test it right now.
Best regards,
Wolfgang Denk

Also remove bogus comment.
Signed-off-by: Zhong hongbo bocui107@gmail.com Changed commit message Signed-off-by: Wolfgang Denk wd@denx.de Cc: Albert Aribaud albert.aribaud@free.fr --- arch/arm/include/asm/u-boot-arm.h | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h index 3904027..e3fbb53 100644 --- a/arch/arm/include/asm/u-boot-arm.h +++ b/arch/arm/include/asm/u-boot-arm.h @@ -57,14 +57,6 @@ void dram_init_banksize (void); void setup_serial_tag (struct tag **params); void setup_revision_tag (struct tag **params);
-/* ------------------------------------------------------------ */ -/* Here is a list of some prototypes which are incompatible to */ -/* the U-Boot implementation */ -/* To be fixed! */ -/* ------------------------------------------------------------ */ -/* common/cmd_nvedit.c */ -int setenv (char *, char *); - /* cpu/.../interrupt.c */ int arch_interrupt_init (void); void reset_timer_masked (void);

Clean up some duplicated prototype declarations. Get rid of now useless AVR32 initcalls.h file.
Signed-off-by: Wolfgang Denk wd@denx.de Cc: Albert Aribaud albert.aribaud@free.fr Cc: Haavard Skinnemoen haavard.skinnemoen@atmel.com Cc: Graeme Russ graeme.russ@gmail.com --- arch/arm/include/asm/u-boot-arm.h | 3 --- arch/avr32/include/asm/initcalls.h | 30 ------------------------------ arch/avr32/lib/board.c | 1 - arch/x86/include/asm/u-boot-x86.h | 1 - include/common.h | 3 +++ 5 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 arch/avr32/include/asm/initcalls.h
diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h index e3fbb53..d3308f7 100644 --- a/arch/arm/include/asm/u-boot-arm.h +++ b/arch/arm/include/asm/u-boot-arm.h @@ -63,7 +63,4 @@ void reset_timer_masked (void); ulong get_timer_masked (void); void udelay_masked (unsigned long usec);
-/* cpu/.../timer.c */ -int timer_init (void); - #endif /* _U_BOOT_ARM_H_ */ diff --git a/arch/avr32/include/asm/initcalls.h b/arch/avr32/include/asm/initcalls.h deleted file mode 100644 index 57a278b..0000000 --- a/arch/avr32/include/asm/initcalls.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2005, 2006 Atmel Corporation - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ -#ifndef __ASM_AVR32_INITCALLS_H__ -#define __ASM_AVR32_INITCALLS_H__ - -#include <config.h> - -extern int cpu_init(void); -extern int timer_init(void); - -#endif /* __ASM_AVR32_INITCALLS_H__ */ diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index e69f8d1..65473a1 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -30,7 +30,6 @@ #include <miiphy.h> #endif
-#include <asm/initcalls.h> #include <asm/sections.h> #include <asm/arch/mmu.h>
diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 944e1a2..4f0d2c7 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -36,7 +36,6 @@ typedef void (timer_fnc_t) (void); int register_timer_isr (timer_fnc_t *isr_func);
/* Architecture specific - can be in arch/x86/cpu/, arch/x86/lib/, or $(BOARD)/ */ -int timer_init(void); int dram_init_f(void);
/* cpu/.../interrupts.c */ diff --git a/include/common.h b/include/common.h index b994e70..12a1074 100644 --- a/include/common.h +++ b/include/common.h @@ -222,6 +222,9 @@ typedef void (interrupt_handler_t)(void *);
void hang (void) __attribute__ ((noreturn));
+int timer_init(void); +int cpu_init(void); + /* */ phys_size_t initdram (int); int display_options (void);

Dear Wolfgang Denk,
In message 1312065165-23322-1-git-send-email-wd@denx.de you wrote:
Clean up some duplicated prototype declarations. Get rid of now useless AVR32 initcalls.h file.
Signed-off-by: Wolfgang Denk wd@denx.de Cc: Albert Aribaud albert.aribaud@free.fr Cc: Haavard Skinnemoen haavard.skinnemoen@atmel.com Cc: Graeme Russ graeme.russ@gmail.com
arch/arm/include/asm/u-boot-arm.h | 3 --- arch/avr32/include/asm/initcalls.h | 30 ------------------------------ arch/avr32/lib/board.c | 1 - arch/x86/include/asm/u-boot-x86.h | 1 - include/common.h | 3 +++ 5 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 arch/avr32/include/asm/initcalls.h
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Albert,
In message 1312064965-23212-1-git-send-email-wd@denx.de I wrote:
Also remove bogus comment.
Signed-off-by: Zhong hongbo bocui107@gmail.com Changed commit message Signed-off-by: Wolfgang Denk wd@denx.de Cc: Albert Aribaud albert.aribaud@free.fr
arch/arm/include/asm/u-boot-arm.h | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
I applied this directly, it is causing too much trouble to delay it any longer.
Hope this is OK with you.
Best regards,
Wolfgang Denk

On Saturday, July 30, 2011 13:28:49 Zhong Hongbo wrote:
From: seedshope bocui107@gmail.com
setenv is defined common.h. We do not need re-defined it
Zhong hongbo bocui107@gmail.com
please fix your git env. it is setting the author field to "seedshope" which clearly is incorrect. it should be your name. -mike
participants (3)
-
Mike Frysinger
-
Wolfgang Denk
-
Zhong Hongbo