public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 0/2] README.arm-relocation: debugging options update
@ 2011-04-28 21:03 Ben Gardiner
  2011-04-28 21:03 ` [U-Boot] [PATCH v3 1/2] README.arm-relocation: get relocated address from bdinfo Ben Gardiner
  2011-04-28 21:03 ` [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb Ben Gardiner
  0 siblings, 2 replies; 7+ messages in thread
From: Ben Gardiner @ 2011-04-28 21:03 UTC (permalink / raw)
  To: u-boot

As Wolfgang pointed out, bdinfo can be used to get the relocation address
so update the README to indicate that this can be done instead of suggesting
that u-boot get rebuilt with debugging enabled.

Since gd is always addressable, descibe also a method whereby the relocation
address is obtained from a it using gdb.

Ben Gardiner (2):
  README.arm-relocation: get relocated address from bdinfo
  README.arm-relocation: get relocated address in gdb

 doc/README.arm-relocation |   61 ++++++++++++++++++++++-----------------------
 1 files changed, 30 insertions(+), 31 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH v3 1/2] README.arm-relocation: get relocated address from bdinfo
  2011-04-28 21:03 [U-Boot] [PATCH v3 0/2] README.arm-relocation: debugging options update Ben Gardiner
@ 2011-04-28 21:03 ` Ben Gardiner
  2011-04-29  5:39   ` Heiko Schocher
  2011-05-12 21:34   ` Wolfgang Denk
  2011-04-28 21:03 ` [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb Ben Gardiner
  1 sibling, 2 replies; 7+ messages in thread
From: Ben Gardiner @ 2011-04-28 21:03 UTC (permalink / raw)
  To: u-boot

The bdinfo command prints the relocaddr on ARM as it does
on PPC.

Update the debugging instructions for arm relocation to
reflect this fact rather than requiring that the user
rebuild the u-boot image using -DDEBUG.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
CC: Wolfgang Denk <wd@denx.de>

---

Changes since V1: none; introduced in V2

 doc/README.arm-relocation |   53 ++++++++++++++++++--------------------------
 1 files changed, 22 insertions(+), 31 deletions(-)

diff --git a/doc/README.arm-relocation b/doc/README.arm-relocation
index c0957c2..8bfb500 100644
--- a/doc/README.arm-relocation
+++ b/doc/README.arm-relocation
@@ -106,13 +106,9 @@ TBC
 Debugging u-boot in RAM:
 (example on the qong board)
 
-a) add in config.mk:
-
-PLATFORM_CPPFLAGS += -DDEBUG
-
 -----------------
 
-b) start debugger
+a) start debugger
 
 arm-linux-gdb u-boot
 
@@ -130,7 +126,7 @@ The target architecture is set automatically (currently arm)
 
 -----------------
 
-c) connect to target
+b) connect to target
 
 target remote bdi10:2001
 
@@ -141,7 +137,7 @@ Remote debugging using bdi10:2001
 
 -----------------
 
-d) discard symbol-file
+c) discard symbol-file
 
 (gdb) symbol-file
 Discard symbol table from `/home/hs/celf/u-boot/u-boot'? (y or n) y
@@ -150,7 +146,7 @@ No symbol file now.
 
 -----------------
 
-e) load new symbol table:
+d) load new symbol table:
 
 (gdb) add-symbol-file u-boot 0x8ff08000
 add symbol table from file "u-boot" at
@@ -167,28 +163,23 @@ Program received signal SIGSTOP, Stopped (signal).
 
 add-symbol-file u-boot 0x8ff08000
 		       ^^^^^^^^^^
-		       get this address from u-boot debug printfs
-
-U-Boot 2010.06-rc2-00009-gf77b8b8-dirty (Jun 22 2010 - 09:43:46)
-
-U-Boot code: A0000000 -> A0058BAC  BSS: -> A0061F10
-CPU:   Freescale i.MX31 at 398 MHz
-Board: DAVE/DENX Qong
-mon: FFFFFFFF gd->monLen: 00061F10
-Top of RAM usable for U-Boot at: 90000000
-LCD panel info: 640 x 480, 16 bit/pix
-Reserving 600k for LCD Framebuffer at: 8ff6a000
-Reserving 391k for U-Boot at: 8ff08000
-			      ^^^^^^^^
-Reserving 1280k for malloc() at: 8fdc8000
-Reserving 24 Bytes for Board Info at: 8fdc7fe8
-Reserving 52 Bytes for Global Data at: 8fdc7fb4
-New Stack Pointer is: 8fdc7fb0
-RAM Configuration:
-Bank #0: 80000000 256 MiB
-relocation Offset is: eff08000
-mon: 00058BAC gd->monLen: 00061F10
-Now running in RAM - U-Boot at: 8ff08000
-				^^^^^^^^
+		       get this address from u-boot bdinfo command
+
+ => bdinfo
+rch_number = XXXXXXXXXX
+boot_params = XXXXXXXXXX
+DRAM bank   = XXXXXXXXXX
+-> start    = XXXXXXXXXX
+-> size     = XXXXXXXXXX
+ethaddr     = XXXXXXXXXX
+ip_addr     = XXXXXXXXXX
+baudrate    = XXXXXXXXXX
+TLB addr    = XXXXXXXXXX
+relocaddr   = 0x8ff08000
+              ^^^^^^^^^^
+reloc off   = XXXXXXXXXX
+irq_sp      = XXXXXXXXXX
+sp start    = XXXXXXXXXX
+FB base     = XXXXXXXXXX
 
 Now you can use gdb as usual :-)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb
  2011-04-28 21:03 [U-Boot] [PATCH v3 0/2] README.arm-relocation: debugging options update Ben Gardiner
  2011-04-28 21:03 ` [U-Boot] [PATCH v3 1/2] README.arm-relocation: get relocated address from bdinfo Ben Gardiner
@ 2011-04-28 21:03 ` Ben Gardiner
  2011-04-29  5:36   ` Heiko Schocher
  2011-05-12 21:34   ` Wolfgang Denk
  1 sibling, 2 replies; 7+ messages in thread
From: Ben Gardiner @ 2011-04-28 21:03 UTC (permalink / raw)
  To: u-boot

When your emulator is connected at reset (or is used to load u-boot)
it is possible to get the relocation address from the gd->relocaddr
since gd is always in r8 (on ARM) it is addressable before the
gdb has remapped symbols.

Document this alternate method in-line with the original method
written by Heiko Schocher.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
CC: Heiko Schocher <hs@denx.de>
CC: Wolfgang Denk <wd@denx.de>

---
Changes since V2:
 * add gd->relocaddr as a secondary method of obtaining the symbol-file
   gdb argument
Changes since V1:
 * update to reflect proposed changes to existing debug instructions:
   renumber steps, remove note about -DDEBUG
---
 doc/README.arm-relocation |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/doc/README.arm-relocation b/doc/README.arm-relocation
index 8bfb500..45f5ea7 100644
--- a/doc/README.arm-relocation
+++ b/doc/README.arm-relocation
@@ -164,6 +164,7 @@ Program received signal SIGSTOP, Stopped (signal).
 add-symbol-file u-boot 0x8ff08000
 		       ^^^^^^^^^^
 		       get this address from u-boot bdinfo command
+		       or get it from gd->relocaddr in gdb
 
  => bdinfo
 rch_number = XXXXXXXXXX
@@ -182,4 +183,11 @@ irq_sp      = XXXXXXXXXX
 sp start    = XXXXXXXXXX
 FB base     = XXXXXXXXXX
 
+or interrupt execution by any means and re-load the symbols at the location
+specified by gd->relocaddr -- this is only valid after board_init_f.
+
+(gdb) set $s = gd->relocaddr
+(gdb) symbol-file
+(gdb) add-symbol-file u-boot $s
+
 Now you can use gdb as usual :-)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb
  2011-04-28 21:03 ` [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb Ben Gardiner
@ 2011-04-29  5:36   ` Heiko Schocher
  2011-05-12 21:34   ` Wolfgang Denk
  1 sibling, 0 replies; 7+ messages in thread
From: Heiko Schocher @ 2011-04-29  5:36 UTC (permalink / raw)
  To: u-boot

Hello Ben,

Ben Gardiner wrote:
> When your emulator is connected at reset (or is used to load u-boot)
> it is possible to get the relocation address from the gd->relocaddr
> since gd is always in r8 (on ARM) it is addressable before the
> gdb has remapped symbols.
> 
> Document this alternate method in-line with the original method
> written by Heiko Schocher.
> 
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
> CC: Heiko Schocher <hs@denx.de>
> CC: Wolfgang Denk <wd@denx.de>
> 
> ---
> Changes since V2:
>  * add gd->relocaddr as a secondary method of obtaining the symbol-file
>    gdb argument
> Changes since V1:
>  * update to reflect proposed changes to existing debug instructions:
>    renumber steps, remove note about -DDEBUG
> ---
>  doc/README.arm-relocation |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)

Thanks!

Acked-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH v3 1/2] README.arm-relocation: get relocated address from bdinfo
  2011-04-28 21:03 ` [U-Boot] [PATCH v3 1/2] README.arm-relocation: get relocated address from bdinfo Ben Gardiner
@ 2011-04-29  5:39   ` Heiko Schocher
  2011-05-12 21:34   ` Wolfgang Denk
  1 sibling, 0 replies; 7+ messages in thread
From: Heiko Schocher @ 2011-04-29  5:39 UTC (permalink / raw)
  To: u-boot

Hello Ben,

Ben Gardiner wrote:
> The bdinfo command prints the relocaddr on ARM as it does
> on PPC.
> 
> Update the debugging instructions for arm relocation to
> reflect this fact rather than requiring that the user
> rebuild the u-boot image using -DDEBUG.
> 
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
> CC: Wolfgang Denk <wd@denx.de>
> 
> ---
> 
> Changes since V1: none; introduced in V2
> 
>  doc/README.arm-relocation |   53 ++++++++++++++++++--------------------------
>  1 files changed, 22 insertions(+), 31 deletions(-)

Acked-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH v3 1/2] README.arm-relocation: get relocated address from bdinfo
  2011-04-28 21:03 ` [U-Boot] [PATCH v3 1/2] README.arm-relocation: get relocated address from bdinfo Ben Gardiner
  2011-04-29  5:39   ` Heiko Schocher
@ 2011-05-12 21:34   ` Wolfgang Denk
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2011-05-12 21:34 UTC (permalink / raw)
  To: u-boot

Dear Ben Gardiner,

In message <787a04417ee0eb01c6eb3a7a1edff7ee9a8f825e.1304024417.git.bengardiner@nanometrics.ca> you wrote:
> The bdinfo command prints the relocaddr on ARM as it does
> on PPC.
> 
> Update the debugging instructions for arm relocation to
> reflect this fact rather than requiring that the user
> rebuild the u-boot image using -DDEBUG.
> 
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
> CC: Wolfgang Denk <wd@denx.de>
> 
> ---
> 
> Changes since V1: none; introduced in V2
> 
>  doc/README.arm-relocation |   53 ++++++++++++++++++--------------------------
>  1 files changed, 22 insertions(+), 31 deletions(-)

Applied, thanks.

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
"In matrimony, to hesitate is sometimes to be saved."        - Butler

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb
  2011-04-28 21:03 ` [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb Ben Gardiner
  2011-04-29  5:36   ` Heiko Schocher
@ 2011-05-12 21:34   ` Wolfgang Denk
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2011-05-12 21:34 UTC (permalink / raw)
  To: u-boot

Dear Ben Gardiner,

In message <7ed11e02b0db005231f5c6baa299761f3aa04f6f.1304024417.git.bengardiner@nanometrics.ca> you wrote:
> When your emulator is connected at reset (or is used to load u-boot)
> it is possible to get the relocation address from the gd->relocaddr
> since gd is always in r8 (on ARM) it is addressable before the
> gdb has remapped symbols.
> 
> Document this alternate method in-line with the original method
> written by Heiko Schocher.
> 
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
> CC: Heiko Schocher <hs@denx.de>
> CC: Wolfgang Denk <wd@denx.de>
> 
> ---
> Changes since V2:
>  * add gd->relocaddr as a secondary method of obtaining the symbol-file
>    gdb argument
> Changes since V1:
>  * update to reflect proposed changes to existing debug instructions:
>    renumber steps, remove note about -DDEBUG
> ---
>  doc/README.arm-relocation |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)

Applied, thanks.

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
Military secrets are the most fleeting of all.
	-- Spock, "The Enterprise Incident", stardate 5027.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-05-12 21:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28 21:03 [U-Boot] [PATCH v3 0/2] README.arm-relocation: debugging options update Ben Gardiner
2011-04-28 21:03 ` [U-Boot] [PATCH v3 1/2] README.arm-relocation: get relocated address from bdinfo Ben Gardiner
2011-04-29  5:39   ` Heiko Schocher
2011-05-12 21:34   ` Wolfgang Denk
2011-04-28 21:03 ` [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb Ben Gardiner
2011-04-29  5:36   ` Heiko Schocher
2011-05-12 21:34   ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox