[U-Boot-Users] Runtime switch from uart0 to uart1?
Travis Sawyer
tsawyer+u-boot at sandburst.com
Wed Sep 15 15:41:00 CEST 2004
On Wed, 2004-09-15 at 04:21, Wolfgang Denk wrote:
> > However, I think this is going to add a little bit of text space even if
> > CONFIG_SERIAL_MULTI is not defined.
>
> You know the reply: I don't like this idea ;-)
>
> > There are several functions that will need to have this done, thus
> > adding 1 layer of indirection to the current code to allow for multiple
> > serial channels.
>
> Maybe we can use function pointers instead which can be overloaded?
> [Just be careful and remember that function pointers don't get
> relocated automagically.]
>
Hmmm... Wouldn't this also increase the text and data space?
Regardless, I've gotten multiple serial to work on the ocotea board.
I'll attempt to change the code so as to keep the non multi code the
same size. However, for maintenance I think it will be more of a
problem than what I currently have. I did an objdump of the original
object file, the new one both with and with out multi turned on:
Original:
Idx Name Size VMA LMA File off Algn
0 .text 00000610 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 00000644 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 00000644 2**0
ALLOC
3 .debug_abbrev 000001e6 00000000 00000000 00000644 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_info 00004c3e 00000000 00000000 0000082a 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
5 .debug_line 000005ce 00000000 00000000 00005468 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
6 .debug_frame 00000160 00000000 00000000 00005a38 2**2
CONTENTS, RELOC, READONLY, DEBUGGING
7 .debug_pubnames 000000d2 00000000 00000000 00005b98 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
8 .debug_aranges 00000020 00000000 00000000 00005c6a 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
9 .debug_str 0000003d 00000000 00000000 00005c8a 2**0
CONTENTS, READONLY, DEBUGGING
10 .comment 0000003d 00000000 00000000 00005cc7 2**0
CONTENTS, READONLY
NEW (MULTI OFF)
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000638 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 0000066c 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 0000066c 2**0
ALLOC
3 .debug_abbrev 0000020a 00000000 00000000 0000066c 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_info 00004cb2 00000000 00000000 00000876 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
5 .debug_line 00000689 00000000 00000000 00005528 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
6 .debug_frame 000001e8 00000000 00000000 00005bb4 2**2
CONTENTS, RELOC, READONLY, DEBUGGING
7 .debug_pubnames 0000014c 00000000 00000000 00005d9c 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
8 .debug_aranges 00000020 00000000 00000000 00005ee8 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
9 .debug_str 0000003d 00000000 00000000 00005f08 2**0
CONTENTS, READONLY, DEBUGGING
10 .comment 0000003d 00000000 00000000 00005f45 2**0
CONTENTS, READONLY
New (MULTI ON):
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000768 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000068 00000000 00000000 0000079c 2**2
CONTENTS, ALLOC, LOAD, RELOC, DATA
2 .bss 00000000 00000000 00000000 00000804 2**0
ALLOC
3 .debug_abbrev 00000236 00000000 00000000 00000804 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_info 00004ec9 00000000 00000000 00000a3a 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
5 .debug_line 00000809 00000000 00000000 00005903 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
6 .debug_frame 00000274 00000000 00000000 0000610c 2**2
CONTENTS, RELOC, READONLY, DEBUGGING
7 .debug_pubnames 000001e0 00000000 00000000 00006380 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
8 .debug_aranges 00000020 00000000 00000000 00006560 2**0
CONTENTS, RELOC, READONLY, DEBUGGING
9 .debug_str 0000003d 00000000 00000000 00006580 2**0
CONTENTS, READONLY, DEBUGGING
10 .comment 0000003d 00000000 00000000 000065bd 2**0
CONTENTS, READONLY
So, as you can see, the new source with MULTI OFF is a little larger.
If it is preferred to _*ABSOLUTELY*_ keep the size the same I'll try
some surgery.
Thanx
Travis
More information about the U-Boot
mailing list