[U-Boot-Users] [PATCH] SPI relocation fix

David Ho davidho at nanometrics.ca
Thu Mar 30 23:07:07 CEST 2006


Signed-off-by: David Ho <davidho at nanometrics.ca>

---

 cpu/mpc8xx/spi.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

3f60ba612e16635f35bf00e91fa821d36f294534
diff --git a/cpu/mpc8xx/spi.c b/cpu/mpc8xx/spi.c
index e318ed0..cb3469b 100644
--- a/cpu/mpc8xx/spi.c
+++ b/cpu/mpc8xx/spi.c
@@ -153,8 +153,11 @@ void spi_init_f (void)
 	spi  = (spi_t *)&cp->cp_dpmem[spi->spi_rpbase];
 #else
 	spi  = (spi_t *)&cp->cp_dparam[PROFF_SPI];
-	/* Disable relocation */
-	spi->spi_rpbase = 0;
+
+	if (!mpc8xx_new_core()) {
+		/* Disable relocation */
+		spi->spi_rpbase = 0;
+	}
 #endif
 
 /* 1 */
@@ -306,8 +309,11 @@ void spi_init_r (void)
 	spi  = (spi_t *)&cp->cp_dpmem[spi->spi_rpbase];
 #else
 	spi  = (spi_t *)&cp->cp_dparam[PROFF_SPI];
-	/* Disable relocation */
-	spi->spi_rpbase = 0;
+
+	if (!mpc8xx_new_core()) {
+		/* Disable relocation */
+		spi->spi_rpbase = 0;
+	}
 #endif
 
 	/* tx and rx buffer descriptors */
@@ -399,8 +405,11 @@ ssize_t spi_xfer (size_t count)
 	spi  = (spi_t *)&cp->cp_dpmem[spi->spi_rpbase];
 #else
 	spi  = (spi_t *)&cp->cp_dparam[PROFF_SPI];
-	/* Disable relocation */
-	spi->spi_rpbase = 0;
+
+	if (!mpc8xx_new_core()) {
+		/* Disable relocation */
+		spi->spi_rpbase = 0;
+	}
 #endif
 
 	tbdf = (cbd_t *) & cp->cp_dpmem[spi->spi_tbase];
-- 
1.2.4.g79f5-dirty






More information about the U-Boot mailing list