[PATCH 2/3] powerpc: prpmc2800 - Use new mv64x60_config_pci_windows() interface

Mark A. Greer mgreer at mvista.com
Thu Nov 8 12:57:00 EST 2007


From: Mark A. Greer <mgreer at mvista.com>

Make the prpmc2800 bootwrapper code use the new interface to
mv64x60_config_pci_windows().  With that change, some minor code
rearrangement is possible to make things neater.

Signed-off-by: Mark A. Greer <mgreer at mvista.com>

---
 arch/powerpc/boot/prpmc2800.c |   20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index 9614e1d..d72400d 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -315,7 +315,7 @@ static struct prpmc2800_board_info *prpmc2800_get_bip(void)
 	return bip;
 }
 
-static void prpmc2800_bridge_setup(u32 mem_size)
+static void prpmc2800_bridge_setup(void)
 {
 	u32 i, v[12], enables, acc_bits;
 	u32 pci_base_hi, pci_base_lo, size, buf[2];
@@ -340,8 +340,7 @@ static void prpmc2800_bridge_setup(u32 mem_size)
 			| MV64x60_PCI_ACC_CNTL_RDSIZE_256_BYTES;
 
 	mv64x60_config_ctlr_windows(bridge_base, bridge_pbase, is_coherent);
-	mv64x60_config_pci_windows(bridge_base, bridge_pbase, 0, 0, mem_size,
-			acc_bits);
+	mv64x60_config_pci_windows(bridge_base, bridge_pbase, 0, 0, acc_bits);
 
 	/* Get the cpu -> pci i/o & mem mappings from the device tree */
 	devp = finddevice("/mv64x60/pci at 80000000");
@@ -397,20 +396,19 @@ static void prpmc2800_bridge_setup(u32 mem_size)
 
 static void prpmc2800_fixups(void)
 {
-	u32 v[2], l, mem_size;
+	u32 v[2], l;
 	int rc;
 	void *devp;
 	char model[BOARD_MODEL_MAX];
 	struct prpmc2800_board_info *bip;
 
-	bip = prpmc2800_get_bip(); /* Get board info based on VPD */
-
-	mem_size = (bip) ? bip->mem_size : mv64x60_get_mem_size(bridge_base);
-	prpmc2800_bridge_setup(mem_size); /* Do necessary bridge setup */
+	prpmc2800_bridge_setup(); /* Do necessary bridge setup */
 
-	/* If the VPD doesn't match what we know about, just use the
+	/*
+	 * If the VPD doesn't match what we know about, just use the
 	 * defaults already in the device tree.
 	 */
+	bip = prpmc2800_get_bip(); /* Get board info based on VPD */
 	if (!bip)
 		return;
 
@@ -439,8 +437,8 @@ static void prpmc2800_fixups(void)
 	devp = finddevice("/memory");
 	if (devp == NULL)
 		fatal("Error: Missing /memory device tree node\n\r");
-	v[0] = 0;
-	v[1] = bip->mem_size;
+	v[0] = 0; /* Take min of DT's mem size and what mem ctlr is setup for */
+	v[1] = min(mv64x60_get_mem_size(bridge_base), bip->mem_size);
 	setprop(devp, "reg", v, sizeof(v));
 
 	/* Update /mv64x60/model, if this is a mv64362 */



More information about the Linuxppc-dev mailing list