* [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform
2007-07-08 11:44 [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform Stefan Roese
@ 2007-07-08 13:55 ` Grant Likely
2007-07-08 19:53 ` Wolfgang Denk
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Grant Likely @ 2007-07-08 13:55 UTC (permalink / raw)
To: u-boot
On 7/8/07, Stefan Roese <sr@denx.de> wrote:
> The relocation fixup didn't handle the malloc pointer initialization
> correctly. This patch fixes this problem. Tested successfully on 4xx.
> The relocation fixup patches for 4xx will follow soon.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
>
> ---
> commit 3a1e66ba75172959973377d6069f1d12e1a4ecb3
> tree 6fdde574dd5328b805e0e438ebb32cc7e7de8f4d
> parent dcc0264878406d52b879d2e5a63d3d793371434e
> author Stefan Roese <sr@denx.de> Sun, 08 Jul 2007 13:42:52 +0200
> committer Stefan Roese <sr@denx.de> Sun, 08 Jul 2007 13:42:52 +0200
>
> lib_ppc/board.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib_ppc/board.c b/lib_ppc/board.c
> index 8bb885d..5e156ab 100644
> --- a/lib_ppc/board.c
> +++ b/lib_ppc/board.c
> @@ -139,10 +139,10 @@ static ulong mem_malloc_brk = 0;
> */
> static void mem_malloc_init (void)
> {
> - ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
> -
> - mem_malloc_end = dest_addr;
> - mem_malloc_start = dest_addr - TOTAL_MALLOC_LEN;
> +#if !defined(CONFIG_RELOC_FIXUP_WORKS)
> + mem_malloc_end = CFG_MONITOR_BASE + gd->reloc_off;
> +#endif
> + mem_malloc_start = mem_malloc_end - TOTAL_MALLOC_LEN;
> mem_malloc_brk = mem_malloc_start;
>
> memset ((void *) mem_malloc_start,
> @@ -623,6 +623,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
>
> #if defined(CONFIG_RELOC_FIXUP_WORKS)
> gd->reloc_off = 0;
> + mem_malloc_end = dest_addr;
> #else
> gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
> #endif
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 7+ messages in thread* [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform
2007-07-08 11:44 [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform Stefan Roese
2007-07-08 13:55 ` Grant Likely
@ 2007-07-08 19:53 ` Wolfgang Denk
2007-07-08 20:38 ` Grant Likely
2007-07-09 5:30 ` Stefan Roese
2007-07-09 9:57 ` [U-Boot-Users] Is there somebody using the AmigaOneG3SE board? Jin Zhengxiong-R64188
2007-07-10 22:43 ` [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform Wolfgang Denk
3 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Denk @ 2007-07-08 19:53 UTC (permalink / raw)
To: u-boot
Dear Stefan,
in message <200707081344.27628.sr@denx.de> you wrote:
> The relocation fixup didn't handle the malloc pointer initialization
> correctly. This patch fixes this problem. Tested successfully on 4xx.
> The relocation fixup patches for 4xx will follow soon.
Thanks.
I hiess you only tested this with CONFIG_RELOC_FIXUP_WORKS undefined?
> --- a/lib_ppc/board.c
> +++ b/lib_ppc/board.c
> @@ -139,10 +139,10 @@ static ulong mem_malloc_brk = 0;
> */
> static void mem_malloc_init (void)
> {
> - ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
Here you delte the declaration of dest_addr ...
> @@ -623,6 +623,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
>
> #if defined(CONFIG_RELOC_FIXUP_WORKS)
> gd->reloc_off = 0;
> + mem_malloc_end = dest_addr;
...and here you try to use it again?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
No question is too silly to ask. Of course, some questions are too
silly to to answer... - L. Wall & R. L. Schwartz, _Programming Perl_
^ permalink raw reply [flat|nested] 7+ messages in thread* [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform
2007-07-08 19:53 ` Wolfgang Denk
@ 2007-07-08 20:38 ` Grant Likely
2007-07-09 5:30 ` Stefan Roese
1 sibling, 0 replies; 7+ messages in thread
From: Grant Likely @ 2007-07-08 20:38 UTC (permalink / raw)
To: u-boot
On 7/8/07, Wolfgang Denk <wd@denx.de> wrote:
> > --- a/lib_ppc/board.c
> > +++ b/lib_ppc/board.c
> > @@ -139,10 +139,10 @@ static ulong mem_malloc_brk = 0;
> > */
> > static void mem_malloc_init (void)
> > {
> > - ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
>
> Here you delte the declaration of dest_addr ...
>
> > @@ -623,6 +623,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
> >
> > #if defined(CONFIG_RELOC_FIXUP_WORKS)
> > gd->reloc_off = 0;
> > + mem_malloc_end = dest_addr;
>
> ...and here you try to use it again?
These two references are in different functions; mem_malloc_init
(where it is an automatic variable) and board_init_r (where it is a
parameter to the function).
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 7+ messages in thread* [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform
2007-07-08 19:53 ` Wolfgang Denk
2007-07-08 20:38 ` Grant Likely
@ 2007-07-09 5:30 ` Stefan Roese
1 sibling, 0 replies; 7+ messages in thread
From: Stefan Roese @ 2007-07-09 5:30 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
On Sunday 08 July 2007, Wolfgang Denk wrote:
> in message <200707081344.27628.sr@denx.de> you wrote:
> > The relocation fixup didn't handle the malloc pointer initialization
> > correctly. This patch fixes this problem. Tested successfully on 4xx.
> > The relocation fixup patches for 4xx will follow soon.
>
> Thanks.
>
> I hiess you only tested this with CONFIG_RELOC_FIXUP_WORKS undefined?
No, I tested both versions. And with this patch both versions work. At least
on the 2 4xx platforms I tested on. The patches for the 4xx relocation fixup
will follow later. This patch is generic and needed on all ppc platforms.
> > --- a/lib_ppc/board.c
> > +++ b/lib_ppc/board.c
> > @@ -139,10 +139,10 @@ static ulong mem_malloc_brk = 0;
> > */
> > static void mem_malloc_init (void)
> > {
> > - ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
>
> Here you delte the declaration of dest_addr ...
>
> > @@ -623,6 +623,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
> >
> > #if defined(CONFIG_RELOC_FIXUP_WORKS)
> > gd->reloc_off = 0;
> > + mem_malloc_end = dest_addr;
>
> ...and here you try to use it again?
As Grant already mentionend, there are two different variables.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] Is there somebody using the AmigaOneG3SE board?
2007-07-08 11:44 [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform Stefan Roese
2007-07-08 13:55 ` Grant Likely
2007-07-08 19:53 ` Wolfgang Denk
@ 2007-07-09 9:57 ` Jin Zhengxiong-R64188
2007-07-10 22:43 ` [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform Wolfgang Denk
3 siblings, 0 replies; 7+ messages in thread
From: Jin Zhengxiong-R64188 @ 2007-07-09 9:57 UTC (permalink / raw)
To: u-boot
Hi,
Is there somebody using the AmigaOneG3SE board or has this board in
hand?
I found some issues for this board and need some helps from those who
have this board in hand.
There's a quite complex bios emulator in this board directory, and seems
like have some crap in it. I tried to compile u-boot for this board but
failed. The bios emulator and the code for the board both can not pass
compile.
My questions is:
Is there somebody have this board and have used the u-boot code for this
board? Or is there some special configuration for this board?
I ported a bios emulator to drivers directory and wish can be used by
every board. The original code of the bios emulator is similar with the
code of the MAI board(but more clean and small). This bios emulator has
been tested on some freescale boards.
I made a patch to make the MAI board to use the bios emulator in drivers
directory, removed the bios emulator in MAI board directory, and also
fix the compile issue of the board. But I can not test these changes as
I have no board in hand. If somebody have this board in hand and want to
test this on the board, please feel free to contact me.
Thanks
Jason
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform
2007-07-08 11:44 [U-Boot-Users] Fix malloc problem introduced with the relocation fixup for the PPC platform Stefan Roese
` (2 preceding siblings ...)
2007-07-09 9:57 ` [U-Boot-Users] Is there somebody using the AmigaOneG3SE board? Jin Zhengxiong-R64188
@ 2007-07-10 22:43 ` Wolfgang Denk
3 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2007-07-10 22:43 UTC (permalink / raw)
To: u-boot
In message <200707081344.27628.sr@denx.de> you wrote:
> The relocation fixup didn't handle the malloc pointer initialization
> correctly. This patch fixes this problem. Tested successfully on 4xx.
> The relocation fixup patches for 4xx will follow soon.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
Applied to u-boot-testing.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is a good thing for an uneducated man to read books of quotations.
- Sir Winston Churchill _My Early Life_ ch. 9
^ permalink raw reply [flat|nested] 7+ messages in thread