Browse Source

E500 update: repoint IVPR to RAM when code is relocated
Patch by Kylo Ginsberg, 13 Apr 2005

Wolfgang Denk 19 years ago
parent
commit
7d314992a8
3 changed files with 12 additions and 0 deletions
  1. 3 0
      CHANGELOG
  2. 5 0
      cpu/mpc85xx/start.S
  3. 4 0
      lib_ppc/board.c

+ 3 - 0
CHANGELOG

@@ -2,6 +2,9 @@
 Changes for U-Boot 1.1.4:
 Changes for U-Boot 1.1.4:
 ======================================================================
 ======================================================================
 
 
+* E500 update: repoint IVPR to RAM when code is relocated
+  Patch by Kylo Ginsberg, 13 Apr 2005
+
 * Fix loop end test in lib_generic/string.c:strswab()
 * Fix loop end test in lib_generic/string.c:strswab()
   Patch by Andrew Dyer, October 10, 2005
   Patch by Andrew Dyer, October 10, 2005
   Signed-off-by: Andrew Dyer <amdyer@gmail.com>
   Signed-off-by: Andrew Dyer <amdyer@gmail.com>

+ 5 - 0
cpu/mpc85xx/start.S

@@ -995,6 +995,11 @@ relocate_code:
 7:	sync			/* Wait for all icbi to complete on bus */
 7:	sync			/* Wait for all icbi to complete on bus */
 	isync
 	isync
 
 
+	/*
+	 * Re-point the IVPR at RAM
+	 */
+	mtspr	IVPR,r10
+	
 /*
 /*
  * We are done. Do not return, instead branch to second part of board
  * We are done. Do not return, instead branch to second part of board
  * initialization, now running from RAM.
  * initialization, now running from RAM.

+ 4 - 0
lib_ppc/board.c

@@ -429,6 +429,10 @@ void board_init_f (ulong bootflag)
 	 */
 	 */
 	addr -= len;
 	addr -= len;
 	addr &= ~(4096 - 1);
 	addr &= ~(4096 - 1);
+#ifdef CONFIG_E500
+	/* round down to next 64 kB limit so that IVPR stays aligned */
+	addr &= ~(65536 - 1);
+#endif
 
 
 	debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
 	debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);