LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Mark A. Greer" <mgreer@mvista.com>
To: linuxppc-dev <Linuxppc-dev@ozlabs.org>
Subject: [PATCH 2/3] powerpc: prpmc2800 - Use new mv64x60_config_pci_windows() interface
Date: Wed, 7 Nov 2007 18:57:00 -0700	[thread overview]
Message-ID: <20071108015700.GA15174@mag.az.mvista.com> (raw)
In-Reply-To: <20071108015415.GA14900@mag.az.mvista.com>

From: Mark A. Greer <mgreer@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@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@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 */

  reply	other threads:[~2007-11-08  1:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08  1:54 [PATCH 1/3] powerpc: mv64x60 - Fix PCI MEM->System Mem window setup Mark A. Greer
2007-11-08  1:57 ` Mark A. Greer [this message]
2007-11-08  1:58 ` [PATCH 3/3] powerpc: mv64x60 - Aesthetic fixups for bootwrapper code Mark A. Greer
2007-11-13  2:59 ` [PATCH 1/3] powerpc: mv64x60 - Fix PCI MEM->System Mem window setup Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071108015700.GA15174@mag.az.mvista.com \
    --to=mgreer@mvista.com \
    --cc=Linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox