Re: [U-Boot] MIPS relocation DT error

2018-01-30 Thread Daniel Schwierzeck
Hi Álvaro,

On 26.01.2018 22:58, Álvaro Fernández Rojas wrote:
> I just found out I was missing OF_EMBED, which confirms that it was
> working because CFE was relocating u-boot and not u-boot itself...
> 
> Sorry for the noise...
> 
> El 26/01/2018 a las 22:53, Álvaro Fernández Rojas escribió:
>> Hello Paul & Daniel,
>>
>>
>> I've finally had some time to do more testing and it appears that the
>> relocation error I saw on BMIPS is due to a DT not found error caused
>> by mips relocation:
>>
>> https://gist.github.com/Noltari/9017b3d28e2109d1de4158e5ad5b1c65
>>
>> Any ideas on how to fix it?
>>
>>
>> BTW, the reason why I think it works if I disable relocation is
>> because CFE relocates .elf before executing them.
>>

I don't think CFE relocates U-Boot because the main purpose is to boot
kernels where only recent ones can be relocated. CFE's tasks should only
be to copy the ELF payload to the link address specified in ELF header,
to invalidate I-Caches and to jump to that address.

I'd rather think the appended DTB is either not correctly linked in
the ELF binary or not copied by CFE. The address of the appended DT blob
is determined with the linker symbol "_end". If CFE would relocate, this
symbol would also point to the relocated memory address.

-- 
- Daniel



signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] MIPS relocation DT error

2018-01-26 Thread Álvaro Fernández Rojas
I just found out I was missing OF_EMBED, which confirms that it was 
working because CFE was relocating u-boot and not u-boot itself...


Sorry for the noise...

El 26/01/2018 a las 22:53, Álvaro Fernández Rojas escribió:

Hello Paul & Daniel,


I've finally had some time to do more testing and it appears that the 
relocation error I saw on BMIPS is due to a DT not found error caused 
by mips relocation:


https://gist.github.com/Noltari/9017b3d28e2109d1de4158e5ad5b1c65

Any ideas on how to fix it?


BTW, the reason why I think it works if I disable relocation is 
because CFE relocates .elf before executing them.



Regards,

Álvaro.



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] MIPS relocation DT error

2018-01-26 Thread Álvaro Fernández Rojas

Hello Paul & Daniel,


I've finally had some time to do more testing and it appears that the 
relocation error I saw on BMIPS is due to a DT not found error caused by 
mips relocation:


https://gist.github.com/Noltari/9017b3d28e2109d1de4158e5ad5b1c65

Any ideas on how to fix it?


BTW, the reason why I think it works if I disable relocation is because 
CFE relocates .elf before executing them.



Regards,

Álvaro.

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] MIPS relocation?

2010-10-04 Thread Wolfgang Denk
Dear Shinya Kuribayashi,

with all the discussion about relocation on ARM going on, Heiko and me
wondered if we had similar problems on MIPS. Unfortunately don't we
have to any MIPS board that could be used for testing.

Could you please tru and check if the current top-of-tree version of
U-Boot still works on MIPS systems? Please check especially if the new
environment commands work, i. e. please try out:

printenvversus  env print
saveenv versus  env save

Thanks in advance!

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: w...@denx.de
When all is said and done, more is said than done.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] MIPS relocation?

2010-10-04 Thread Xiangfu Liu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Wolfgang Denk

since my board (Ben NanoNote) is mips.
so I test the those commands in my board.

printenv, saveenv: works fine.
env print, evn save: make U-Boot hang. (then I must reset the board)

- --
my board patch never touch the common/ folder.

if I have time I will try to debug.

On 10/04/2010 09:03 PM, Wolfgang Denk wrote:
 Dear Shinya Kuribayashi,
 
 with all the discussion about relocation on ARM going on, Heiko and me
 wondered if we had similar problems on MIPS. Unfortunately don't we
 have to any MIPS board that could be used for testing.
 
 Could you please tru and check if the current top-of-tree version of
 U-Boot still works on MIPS systems? Please check especially if the new
 environment commands work, i. e. please try out:
 
   printenvversus  env print
   saveenv versus  env save
 
 Thanks in advance!
 
 Best regards,
 
 Wolfgang Denk
 


- -- 
Best Regards
Xiangfu Liu
http://www.openmobilefree.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyp6DEACgkQRRAEFRxkgLTylQCgkZjmI5Tn3q70/3Lr+NkArWsC
HIkAoInQvU3P/PU1N2CWJML9RKfFE9+h
=0LVF
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] MIPS relocation?

2010-10-04 Thread Heiko Schocher
Hello Xiangfu,

Xiangfu Liu wrote:
 Hi Wolfgang Denk
 
 since my board (Ben NanoNote) is mips.
 so I test the those commands in my board.
 
 printenv, saveenv: works fine.
 env print, evn save: make U-Boot hang. (then I must reset the board)

as I thought ... can you try following patch:

From 276bcedbd581b11665a5424b274ae30d07245e1f Mon Sep 17 00:00:00 2001
From: Heiko Schocher h...@denx.de
Date: Mon, 4 Oct 2010 10:28:58 +0200
Subject: [PATCH] env: fix cmd_env_sub fct pointers if CONFIG_RELOC_FIXUP_WORKS 
is not defined

commit ea882baf9c17cd142c99e3ff640d3ab01daa5cec introduces
a command_sub_table for the env command. On arm, avr32, m68k,
mips and sparc architectures, relocation needs manual fixups,
so add this for this sub command table too.

Tested on the qong board.

Signed-off-by: Heiko Schocher h...@denx.de
---
 common/cmd_nvedit.c |6 ++
 common/env_common.c |5 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index c3d63b8..16f5fb0 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -837,6 +837,12 @@ static cmd_tbl_t cmd_env_sub[] = {
U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, , ),
 };

+#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+void env_reloc(void) {
+   fixup_cmdtable(cmd_env_sub, ARRAY_SIZE(cmd_env_sub));
+}
+#endif
+
 static int do_env (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
cmd_tbl_t *cp;
diff --git a/common/env_common.c b/common/env_common.c
index a415ef8..88f068c 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -227,6 +227,11 @@ int env_import(const char *buf, int check)

 void env_relocate (void)
 {
+#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+   extern void env_reloc(void);
+
+   env_reloc();
+#endif
if (gd-env_valid == 0) {
 #if defined(CONFIG_ENV_IS_NOWHERE) /* Environment not changable */
set_default_env(NULL);
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] MIPS relocation?

2010-10-04 Thread Xiangfu Liu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Heiko

by applied this patch. both works fine. 

On 10/04/2010 10:49 PM, Heiko Schocher wrote:
 Hello Xiangfu,
 
 Xiangfu Liu wrote:
 Hi Wolfgang Denk

 since my board (Ben NanoNote) is mips.
 so I test the those commands in my board.

 printenv, saveenv: works fine.
 env print, evn save: make U-Boot hang. (then I must reset the board)
 
 as I thought ... can you try following patch:
 
 From 276bcedbd581b11665a5424b274ae30d07245e1f Mon Sep 17 00:00:00 2001
 From: Heiko Schocher h...@denx.de
 Date: Mon, 4 Oct 2010 10:28:58 +0200
 Subject: [PATCH] env: fix cmd_env_sub fct pointers if 
 CONFIG_RELOC_FIXUP_WORKS is not defined
 
 commit ea882baf9c17cd142c99e3ff640d3ab01daa5cec introduces
 a command_sub_table for the env command. On arm, avr32, m68k,
 mips and sparc architectures, relocation needs manual fixups,
 so add this for this sub command table too.
 
 Tested on the qong board.
 
 Signed-off-by: Heiko Schocher h...@denx.de
 ---
  common/cmd_nvedit.c |6 ++
  common/env_common.c |5 +
  2 files changed, 11 insertions(+), 0 deletions(-)
 
 diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
 index c3d63b8..16f5fb0 100644
 --- a/common/cmd_nvedit.c
 +++ b/common/cmd_nvedit.c
 @@ -837,6 +837,12 @@ static cmd_tbl_t cmd_env_sub[] = {
   U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, , ),
  };
 
 +#if !defined(CONFIG_RELOC_FIXUP_WORKS)
 +void env_reloc(void) {
 + fixup_cmdtable(cmd_env_sub, ARRAY_SIZE(cmd_env_sub));
 +}
 +#endif
 +
  static int do_env (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  {
   cmd_tbl_t *cp;
 diff --git a/common/env_common.c b/common/env_common.c
 index a415ef8..88f068c 100644
 --- a/common/env_common.c
 +++ b/common/env_common.c
 @@ -227,6 +227,11 @@ int env_import(const char *buf, int check)
 
  void env_relocate (void)
  {
 +#if !defined(CONFIG_RELOC_FIXUP_WORKS)
 + extern void env_reloc(void);
 +
 + env_reloc();
 +#endif
   if (gd-env_valid == 0) {
  #if defined(CONFIG_ENV_IS_NOWHERE)   /* Environment not changable */
   set_default_env(NULL);


- -- 
Best Regards
Xiangfu Liu
http://www.openmobilefree.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyp7I4ACgkQRRAEFRxkgLR/RACgmpYBqc74PeMT3DkngPy9zuD6
bAMAoISoyBKy4A1B3aTmLdg0hFsLRYMS
=hr/V
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] MIPS relocation?

2010-10-04 Thread Wolfgang Denk
Dear Xiangfu Liu,

In message 4ca9ec8e.9080...@openmobilefree.net you wrote:

 by applied this patch. both works fine. 

Thanks a lot for testing. This confirms that we have a more global
issue here, i. e. not only ARM is affected, but also MIPS.

Any MIPS tool chain experts out there to try and follow-up for MIPS
what Albert is doing for ARM right now?

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: w...@denx.de
355/113 -- Not the famous irrational number PI,  but  an  incredible
simulation!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] MIPS relocation?

2010-10-04 Thread Shinya Kuribayashi
On 10/5/2010 2:02 AM, Wolfgang Denk wrote:
 Dear Xiangfu Liu,
 
 In message 4ca9ec8e.9080...@openmobilefree.net you wrote:

 by applied this patch. both works fine. 

Xiangfu, thank for your testing!  I don't have the latest U-Boot ready
for test/debug right now, nor couldn't follow the ongoing discussions
precisely.

 Any MIPS tool chain experts out there to try and follow-up for MIPS
 what Albert is doing for ARM right now?

I'll have a look at what's discussed, then think about what to do.
-- 
Shinya Kuribayashi
Renesas Electronics
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot