Patchwork [U-Boot,BUGFIX] mips: serial: Fix busted manual relocation

login
register
mail settings
Submitter Joe Hershberger
Date Dec. 12, 2012, 3:52 a.m.
Message ID <1355284370-18117-1-git-send-email-joe.hershberger@ni.com>
Download mbox | patch
Permalink /patch/205355/
State Superseded
Delegated to: Daniel Schwierzeck
Headers show

Comments

Joe Hershberger - Dec. 12, 2012, 3:52 a.m.
serial_initialize() must be called after relocation to adjust the
pointers to putc(), getc(), etc.  This is busted ever since the
serial driver-model-ification series.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---
 arch/mips/lib/board.c | 2 ++
 1 file changed, 2 insertions(+)
Daniel Schwierzeck - Dec. 12, 2012, 12:12 p.m.
Hi Joe,

2012/12/12 Joe Hershberger <joe.hershberger@ni.com>:
> serial_initialize() must be called after relocation to adjust the
> pointers to putc(), getc(), etc.  This is busted ever since the
> serial driver-model-ification series.
>
> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
> ---
>  arch/mips/lib/board.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
> index 7ddd778..e47989b 100644
> --- a/arch/mips/lib/board.c
> +++ b/arch/mips/lib/board.c
> @@ -262,6 +262,8 @@ void board_init_r(gd_t *id, ulong dest_addr)
>
>         monitor_flash_len = (ulong)&uboot_end_data - dest_addr;
>
> +       serial_initialize();
> +
>  #if defined(CONFIG_NEEDS_MANUAL_RELOC)
>         /*
>          * We have to relocate the command table manually
> --

good catch, thanks.

gcc-4.7 raises a warning:

board.c: In function 'board_init_r':
board.c:265:2: warning: implicit declaration of function
'serial_initialize' [-Wimplicit-function-declaration]

But if I include serial.h (which includes asm/io.h) I get following error:

board.c:50:15: error: conflicting type qualifiers for 'mips_io_port_base'
In file included from /work/git-trees/u-boot-mips/include/post.h:32:0,
                 from /work/git-trees/u-boot-mips/include/serial.h:4,
                 from board.c:27:
/work/git-trees/u-boot-mips/build/qemu_mipsel/include2/asm/io.h:74:28:
note: previous declaration of 'mips_io_port_base' was here

I will fix it in the MIPS tree and send new patches today.

Patch

diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 7ddd778..e47989b 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -262,6 +262,8 @@  void board_init_r(gd_t *id, ulong dest_addr)
 
 	monitor_flash_len = (ulong)&uboot_end_data - dest_addr;
 
+	serial_initialize();
+
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
 	/*
 	 * We have to relocate the command table manually