public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] Make MPC83xx one step closer to full relocation.
@ 2008-03-28 14:41 Joakim Tjernlund
  2008-03-28 23:33 ` Kim Phillips
  0 siblings, 1 reply; 27+ messages in thread
From: Joakim Tjernlund @ 2008-03-28 14:41 UTC (permalink / raw)
  To: u-boot

Remove a few absolute references to CFG_MONITOR_BASE for ppc/mpc83xx
and use GOT relative reference.
---
 cpu/mpc83xx/start.S |   11 +++++++----
 lib_ppc/board.c     |    3 ++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S
index 1dfbf62..56fd7ec 100644
--- a/cpu/mpc83xx/start.S
+++ b/cpu/mpc83xx/start.S
@@ -172,8 +172,11 @@ boot_warm: /* time t 5 */
 	/* there and deflate the flash size back to minimal size      */
 	/*------------------------------------------------------------*/
 	bl map_flash_by_law1
-	lis r4, (CFG_MONITOR_BASE)@h
-	ori r4, r4, (CFG_MONITOR_BASE)@l
+
+	GET_GOT			/* initialize GOT access	*/
+	lwz r4, GOT(_start)	
+	addi r4, r4, -EXC_OFF_SYS_RESET
+
 	addi r5, r4, in_flash - _start + EXC_OFF_SYS_RESET
 	mtlr r5
 	blr
@@ -906,8 +909,8 @@ relocate_code:
 	mr	r10, r5		/* Save copy of Destination Address */
 
 	mr	r3,  r5				/* Destination Address */
-	lis	r4, CFG_MONITOR_BASE at h		/* Source      Address */
-	ori	r4, r4, CFG_MONITOR_BASE at l
+	lwz	r4, GOT(_start)
+	addi	r4, r4, -EXC_OFF_SYS_RESET	
 	lwz	r5, GOT(__init_end)
 	sub	r5, r5, r4
 	li	r6, CFG_CACHELINE_SIZE		/* Cache Line Size */
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 45d1328..8a18350 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -117,6 +117,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define	TOTAL_MALLOC_LEN	CFG_MALLOC_LEN
 #endif
 
+extern ulong _start;
 extern ulong __init_end;
 extern ulong _end;
 ulong monitor_flash_len;
@@ -417,7 +418,7 @@ void board_init_f (ulong bootflag)
 	 *  - monitor code
 	 *  - board info struct
 	 */
-	len = (ulong)&_end - CFG_MONITOR_BASE;
+	len = (ulong)&_end - (ulong)&_start + EXC_OFF_SYS_RESET;
 
 #ifndef	CONFIG_VERY_BIG_RAM
 	addr = CFG_SDRAM_BASE + gd->ram_size;
-- 
1.5.3.8

^ permalink raw reply related	[flat|nested] 27+ messages in thread
* [U-Boot-Users] [PATCH] Make MPC83xx one step closer to full relocation.
@ 2008-02-02 19:44 Joakim Tjernlund
  0 siblings, 0 replies; 27+ messages in thread
From: Joakim Tjernlund @ 2008-02-02 19:44 UTC (permalink / raw)
  To: u-boot

Remove a few absolute references to CFG_MONITOR_BASE for ppc/mpc83xx
and use GOT relative reference.
---
 cpu/mpc83xx/start.S |   11 +++++++----
 lib_ppc/board.c     |    3 ++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S
index 1dfbf62..56fd7ec 100644
--- a/cpu/mpc83xx/start.S
+++ b/cpu/mpc83xx/start.S
@@ -172,8 +172,11 @@ boot_warm: /* time t 5 */
 	/* there and deflate the flash size back to minimal size      */
 	/*------------------------------------------------------------*/
 	bl map_flash_by_law1
-	lis r4, (CFG_MONITOR_BASE)@h
-	ori r4, r4, (CFG_MONITOR_BASE)@l
+
+	GET_GOT			/* initialize GOT access	*/
+	lwz r4, GOT(_start)	
+	addi r4, r4, -EXC_OFF_SYS_RESET
+
 	addi r5, r4, in_flash - _start + EXC_OFF_SYS_RESET
 	mtlr r5
 	blr
@@ -906,8 +909,8 @@ relocate_code:
 	mr	r10, r5		/* Save copy of Destination Address */
 
 	mr	r3,  r5				/* Destination Address */
-	lis	r4, CFG_MONITOR_BASE at h		/* Source      Address */
-	ori	r4, r4, CFG_MONITOR_BASE at l
+	lwz	r4, GOT(_start)
+	addi	r4, r4, -EXC_OFF_SYS_RESET	
 	lwz	r5, GOT(__init_end)
 	sub	r5, r5, r4
 	li	r6, CFG_CACHELINE_SIZE		/* Cache Line Size */
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 45d1328..8a18350 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -117,6 +117,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define	TOTAL_MALLOC_LEN	CFG_MALLOC_LEN
 #endif
 
+extern ulong _start;
 extern ulong __init_end;
 extern ulong _end;
 ulong monitor_flash_len;
@@ -417,7 +418,7 @@ void board_init_f (ulong bootflag)
 	 *  - monitor code
 	 *  - board info struct
 	 */
-	len = (ulong)&_end - CFG_MONITOR_BASE;
+	len = (ulong)&_end - (ulong)&_start + EXC_OFF_SYS_RESET;
 
 #ifndef	CONFIG_VERY_BIG_RAM
 	addr = CFG_SDRAM_BASE + gd->ram_size;
-- 
1.5.3.8

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

end of thread, other threads:[~2008-04-09 12:36 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 14:41 [U-Boot-Users] [PATCH] Make MPC83xx one step closer to full relocation Joakim Tjernlund
2008-03-28 23:33 ` Kim Phillips
2008-03-28 23:47   ` Joakim Tjernlund
2008-03-29  0:01     ` Kim Phillips
2008-03-29  0:04       ` Joakim Tjernlund
2008-04-08  8:58     ` Stefan Roese
2008-04-08  9:31       ` Joakim Tjernlund
2008-04-08 10:06         ` Stefan Roese
2008-04-08 10:50           ` Joakim Tjernlund
2008-04-08 11:58             ` Wolfgang Denk
2008-04-08 13:07               ` Joakim Tjernlund
2008-04-08 13:25                 ` Stefan Roese
2008-04-08 14:04                   ` Joakim Tjernlund
2008-04-08 19:52                     ` Stefan Roese
2008-04-08 20:30                       ` Joakim Tjernlund
2008-04-08 20:41                     ` Wolfgang Denk
2008-04-08 20:52                       ` Joakim Tjernlund
2008-04-08 21:09                         ` Wolfgang Denk
2008-04-08 21:51                           ` Joakim Tjernlund
2008-04-08 22:17                             ` David Hawkins
2008-04-09  9:40                             ` Stefan Roese
2008-04-09 10:44                               ` Wolfgang Denk
2008-04-09 11:14                                 ` Joakim Tjernlund
2008-04-09 11:45                                   ` Stefan Roese
2008-04-09 12:36                                   ` Wolfgang Denk
2008-04-08 11:52         ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2008-02-02 19:44 Joakim Tjernlund

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