[U-Boot] [PATCH 0/3] Get AVR32 boards working with partial linking

This patch series make avr32 boards compile again. They where broken by partial linking changes.
Additionally two warnings fixed. MAKEALL complained broken boards cause of these warnings.
In my opinion these changes are fixes and should go into v2011.03. Some more changes will follow for AVR32/AT91 rework branch.
All patches tested with atstk1002 and one selfmade board not in official tree.
Andreas Bießmann (3): cmd_nvedit: use explicit typecast for printf avr32: fix linking common/cmd_bdinfo.c: fix do_bdinfo() for AVR32
arch/avr32/config.mk | 2 +- board/atmel/atngw100/config.mk | 1 - board/atmel/atstk1000/config.mk | 1 - board/earthlcd/favr-32-ezkit/config.mk | 1 - board/mimc/mimc200/config.mk | 1 - board/miromico/hammerhead/config.mk | 1 - common/cmd_bdinfo.c | 2 +- common/cmd_nvedit.c | 4 ++-- 8 files changed, 4 insertions(+), 9 deletions(-)

This patch fixes warnings in MAKEALL for avr32:
---8<--- cmd_nvedit.c: In function 'do_env_export': cmd_nvedit.c:663: warning: format '%zX' expects type 'size_t', but argument 3 has type 'ssize_t' --->8---
Signed-off-by: Andreas Bießmann biessmann@corscience.de --- common/cmd_nvedit.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index fb69c24..6d8512a 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -659,7 +659,7 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv errno); return 1; } - sprintf(buf, "%zX", len); + sprintf(buf, "%zX", (size_t)len); setenv("filesize", buf);
return 0; @@ -685,7 +685,7 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv envp->flags = ACTIVE_FLAG; #endif } - sprintf(buf, "%zX", len + offsetof(env_t,data)); + sprintf(buf, "%zX", (size_t)(len + offsetof(env_t,data))); setenv("filesize", buf);
return 0;

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
In message 1297260631-13864-2-git-send-email-biessmann@corscience.de you wrote:
This patch fixes warnings in MAKEALL for avr32:
---8<--- cmd_nvedit.c: In function 'do_env_export': cmd_nvedit.c:663: warning: format '%zX' expects type 'size_t', but argument 3 has type 'ssize_t' --->8---
Signed-off-by: Andreas Bießmann biessmann@corscience.de
common/cmd_nvedit.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

This patch fixes following error:
---8<--- avr32-linux-ld: --gc-sections and -r may not be used together --->8---
Since 8aba9dceebb14144e07d19593111ee3a999c37fc all avr32 boards are broken due to linking error as seen above.
Signed-off-by: Andreas Bießmann biessmann@corscience.de --- arch/avr32/config.mk | 2 +- board/atmel/atngw100/config.mk | 1 - board/atmel/atstk1000/config.mk | 1 - board/earthlcd/favr-32-ezkit/config.mk | 1 - board/mimc/mimc200/config.mk | 1 - board/miromico/hammerhead/config.mk | 1 - 6 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk index 1121ca1..51b9995 100644 --- a/arch/avr32/config.mk +++ b/arch/avr32/config.mk @@ -26,4 +26,4 @@ CROSS_COMPILE ?= avr32-linux- STANDALONE_LOAD_ADDR = 0x00000000
PLATFORM_RELFLAGS += -ffixed-r5 -fPIC -mno-init-got -mrelax -PLATFORM_LDFLAGS += --relax +LDFLAGS_u-boot = --gc-sections --relax diff --git a/board/atmel/atngw100/config.mk b/board/atmel/atngw100/config.mk index ea76d05..c3c7433 100644 --- a/board/atmel/atngw100/config.mk +++ b/board/atmel/atngw100/config.mk @@ -1,3 +1,2 @@ CONFIG_SYS_TEXT_BASE = 0x00000000 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections -PLATFORM_LDFLAGS += --gc-sections diff --git a/board/atmel/atstk1000/config.mk b/board/atmel/atstk1000/config.mk index 8c03b77..bec7b7d 100644 --- a/board/atmel/atstk1000/config.mk +++ b/board/atmel/atstk1000/config.mk @@ -1,4 +1,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections -PLATFORM_LDFLAGS += --gc-sections CONFIG_SYS_TEXT_BASE = 0x00000000 LDSCRIPT = $(src)board/atmel/atstk1000/u-boot.lds diff --git a/board/earthlcd/favr-32-ezkit/config.mk b/board/earthlcd/favr-32-ezkit/config.mk index f8bc88d..eb607ee 100644 --- a/board/earthlcd/favr-32-ezkit/config.mk +++ b/board/earthlcd/favr-32-ezkit/config.mk @@ -1,4 +1,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections -PLATFORM_LDFLAGS += --gc-sections CONFIG_SYS_TEXT_BASE = 0x00000000 LDSCRIPT = $(src)board/earthlcd/favr-32-ezkit/u-boot.lds diff --git a/board/mimc/mimc200/config.mk b/board/mimc/mimc200/config.mk index ea76d05..c3c7433 100644 --- a/board/mimc/mimc200/config.mk +++ b/board/mimc/mimc200/config.mk @@ -1,3 +1,2 @@ CONFIG_SYS_TEXT_BASE = 0x00000000 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections -PLATFORM_LDFLAGS += --gc-sections diff --git a/board/miromico/hammerhead/config.mk b/board/miromico/hammerhead/config.mk index ea76d05..c3c7433 100644 --- a/board/miromico/hammerhead/config.mk +++ b/board/miromico/hammerhead/config.mk @@ -1,3 +1,2 @@ CONFIG_SYS_TEXT_BASE = 0x00000000 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections -PLATFORM_LDFLAGS += --gc-sections

Dear Andreas Bießmann:
This patch fixes following error:
---8<--- avr32-linux-ld: --gc-sections and -r may not be used together --->8---
Since 8aba9dceebb14144e07d19593111ee3a999c37fc all avr32 boards are broken due to linking error as seen above.
Signed-off-by: Andreas Bießmann biessmann@corscience.de
arch/avr32/config.mk | 2 +- board/atmel/atngw100/config.mk | 1 - board/atmel/atstk1000/config.mk | 1 - board/earthlcd/favr-32-ezkit/config.mk | 1 - board/mimc/mimc200/config.mk | 1 - board/miromico/hammerhead/config.mk | 1 - 6 files changed, 1 insertions(+), 6 deletions(-)
Applied to u-boot-atmel/next, thanks.
Reinhard

This patch fixes following warning message:
---8<--- cmd_bdinfo.c:458: warning: initialization from incompatible pointer type --->8---
There was a prototype change in 54841ab50c20d6fa6c9cc3eb826989da3a22d934 for argv[] pointer type to const. This change was not made for AVR32 cause this code came in later by a merge.
Signed-off-by: Andreas Bießmann biessmann@corscience.de --- common/cmd_bdinfo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index bba7374..1d76ffa 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -304,7 +304,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_AVR32)
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { bd_t *bd = gd->bd;

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
In message 1297260631-13864-4-git-send-email-biessmann@corscience.de you wrote:
This patch fixes following warning message:
---8<--- cmd_bdinfo.c:458: warning: initialization from incompatible pointer type --->8---
There was a prototype change in 54841ab50c20d6fa6c9cc3eb826989da3a22d934 for argv[] pointer type to const. This change was not made for AVR32 cause this code came in later by a merge.
Signed-off-by: Andreas BieÃmann biessmann@corscience.de
common/cmd_bdinfo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Andreas Bießmann,
This patch series make avr32 boards compile again. They where broken by partial linking changes.
Additionally two warnings fixed. MAKEALL complained broken boards cause of these warnings.
In my opinion these changes are fixes and should go into v2011.03. Some more changes will follow for AVR32/AT91 rework branch.
Ok, yes it should be a bug fix.
All patches tested with atstk1002 and one selfmade board not in official tree.
Andreas Bießmann (3): cmd_nvedit: use explicit typecast for printf avr32: fix linking common/cmd_bdinfo.c: fix do_bdinfo() for AVR32
arch/avr32/config.mk | 2 +- board/atmel/atngw100/config.mk | 1 - board/atmel/atstk1000/config.mk | 1 - board/earthlcd/favr-32-ezkit/config.mk | 1 - board/mimc/mimc200/config.mk | 1 - board/miromico/hammerhead/config.mk | 1 -
I can take those through u-boot-atmel.
common/cmd_bdinfo.c | 2 +- common/cmd_nvedit.c | 4 ++--
Shall I also handle those, or is someone else going to handle them? Wolfgang?
Best Regards, Reinhard

Dear Reinhard Meyer,
In message 4D52AE98.3020707@emk-elektronik.de you wrote:
common/cmd_bdinfo.c | 2 +- common/cmd_nvedit.c | 4 ++--
Shall I also handle those, or is someone else going to handle them? Wolfgang?
I took these, thanks.
Best regards,
Wolfgang Denk
participants (3)
-
Andreas Bießmann
-
Reinhard Meyer
-
Wolfgang Denk