public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Becky Bruce <beckyb@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 08/11] mpc8641hpcn: Clean up PCI mapping concepts
Date: Wed,  3 Dec 2008 23:04:44 -0600	[thread overview]
Message-ID: <1228367087-27268-9-git-send-email-beckyb@kernel.crashing.org> (raw)
In-Reply-To: <1228367087-27268-1-git-send-email-beckyb@kernel.crashing.org>

Clean up PCI mapping concepts in the 8641 config - rename _BASE
to _BUS, as it's actually a PCI bus address, separate virtual
and physical addresses into _VIRT and _PHYS, and use each
appopriately.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
 board/freescale/mpc8641hpcn/mpc8641hpcn.c |   10 +++++-----
 include/configs/MPC8641HPCN.h             |   17 +++++++++++------
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
index 9b6b69e..28c1683 100644
--- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
@@ -165,14 +165,14 @@ void pci_init_board(void)
 
 		/* outbound memory */
 		pci_set_region(r++,
-			       CONFIG_SYS_PCI1_MEM_BASE,
+			       CONFIG_SYS_PCI1_MEM_BUS,
 			       CONFIG_SYS_PCI1_MEM_PHYS,
 			       CONFIG_SYS_PCI1_MEM_SIZE,
 			       PCI_REGION_MEM);
 
 		/* outbound io */
 		pci_set_region(r++,
-			       CONFIG_SYS_PCI1_IO_BASE,
+			       CONFIG_SYS_PCI1_IO_BUS,
 			       CONFIG_SYS_PCI1_IO_PHYS,
 			       CONFIG_SYS_PCI1_IO_SIZE,
 			       PCI_REGION_IO);
@@ -195,7 +195,7 @@ void pci_init_board(void)
 		 * Activate ULI1575 legacy chip by performing a fake
 		 * memory access.  Needed to make ULI RTC work.
 		 */
-		in_be32((unsigned *) ((char *)(CONFIG_SYS_PCI1_MEM_BASE
+		in_be32((unsigned *) ((char *)(CONFIG_SYS_PCI1_MEM_VIRT
 				       + CONFIG_SYS_PCI1_MEM_SIZE - 0x1000000)));
 
 	} else {
@@ -214,14 +214,14 @@ void pci_init_board(void)
 
 	/* outbound memory */
 	pci_set_region(r++,
-		       CONFIG_SYS_PCI2_MEM_BASE,
+		       CONFIG_SYS_PCI2_MEM_BUS,
 		       CONFIG_SYS_PCI2_MEM_PHYS,
 		       CONFIG_SYS_PCI2_MEM_SIZE,
 		       PCI_REGION_MEM);
 
 	/* outbound io */
 	pci_set_region(r++,
-		       CONFIG_SYS_PCI2_IO_BASE,
+		       CONFIG_SYS_PCI2_IO_BUS,
 		       CONFIG_SYS_PCI2_IO_PHYS,
 		       CONFIG_SYS_PCI2_IO_SIZE,
 		       PCI_REGION_IO);
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index c25380b..1d287ec 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -341,14 +341,17 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
  * General PCI
  * Addresses are mapped 1-1.
  */
-#define CONFIG_SYS_PCI1_MEM_BASE	0x80000000
+
+#define CONFIG_SYS_PCI1_MEM_VIRT	0x80000000
 #ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_PCI1_MEM_BUS		CONFIG_SYS_PCI1_MEM_VIRT
 #define CONFIG_SYS_PCI1_MEM_PHYS	0x0000000c00000000ULL
 #else
-#define CONFIG_SYS_PCI1_MEM_PHYS	CONFIG_SYS_PCI1_MEM_BASE
+#define CONFIG_SYS_PCI1_MEM_BUS		CONFIG_SYS_PCI1_MEM_VIRT
+#define CONFIG_SYS_PCI1_MEM_PHYS	CONFIG_SYS_PCI1_MEM_VIRT
 #endif
 #define CONFIG_SYS_PCI1_MEM_SIZE	0x20000000	/* 512M */
-#define CONFIG_SYS_PCI1_IO_BASE	0x00000000
+#define CONFIG_SYS_PCI1_IO_BUS	0x00000000
 #define CONFIG_SYS_PCI1_IO_VIRT	0xffc00000
 #define CONFIG_SYS_PCI1_IO_PHYS	(CONFIG_SYS_PCI1_IO_VIRT \
 				 | CONFIG_SYS_PHYS_ADDR_HIGH)
@@ -358,12 +361,14 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define KSEG1ADDR(x)		({u32 _x=le32_to_cpu(*(u32 *)(x)); (&_x);})
 #define _IO_BASE		0x00000000
 
-#define CONFIG_SYS_PCI2_MEM_BASE 	(CONFIG_SYS_PCI1_MEM_BASE \
+#define CONFIG_SYS_PCI2_MEM_BUS		(CONFIG_SYS_PCI1_MEM_BUS \
+					 + CONFIG_SYS_PCI1_MEM_SIZE)
+#define CONFIG_SYS_PCI2_MEM_VIRT 	(CONFIG_SYS_PCI1_MEM_VIRT \
 					 + CONFIG_SYS_PCI1_MEM_SIZE)
 #define CONFIG_SYS_PCI2_MEM_PHYS	(CONFIG_SYS_PCI1_MEM_PHYS \
 					 + CONFIG_SYS_PCI1_MEM_SIZE)
 #define CONFIG_SYS_PCI2_MEM_SIZE	0x20000000	/* 512M */
-#define CONFIG_SYS_PCI2_IO_BASE	0x00000000
+#define CONFIG_SYS_PCI2_IO_BUS	0x00000000
 #define CONFIG_SYS_PCI2_IO_VIRT (CONFIG_SYS_PCI1_IO_VIRT \
 				 + CONFIG_SYS_PCI1_IO_SIZE)
 #define CONFIG_SYS_PCI2_IO_PHYS	(CONFIG_SYS_PCI1_IO_PHYS \
@@ -511,7 +516,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_DBAT2L	(BAT_PHYS_ADDR(CONFIG_SYS_PCI1_MEM_PHYS) \
 				 | BATL_PP_RW | BATL_CACHEINHIBIT \
 				 | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT2U	(CONFIG_SYS_PCI1_MEM_BASE | BATU_BL_1G \
+#define CONFIG_SYS_DBAT2U	(CONFIG_SYS_PCI1_MEM_VIRT | BATU_BL_1G \
 				 | BATU_VS | BATU_VP)
 #define CONFIG_SYS_IBAT2L	(BAT_PHYS_ADDR(CONFIG_SYS_PCI1_MEM_PHYS) \
 				 | BATL_PP_RW | BATL_CACHEINHIBIT)
-- 
1.5.6.5

  parent reply	other threads:[~2008-12-04  5:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04  5:04 [U-Boot] [PATCH 00/11] Allow PCI bus address, PA, and VA to differ Becky Bruce
2008-12-04  5:04 ` [U-Boot] [PATCH 01/11] powerpc: fix io.h build warning with CONFIG_PHYS_64BIT Becky Bruce
2008-12-16 15:55   ` Wolfgang Denk
2008-12-16 22:46     ` Wolfgang Denk
2008-12-04  5:04 ` [U-Boot] [PATCH 02/11] mpc8641hpcn: Set up outbound pci windows before inbound Becky Bruce
2009-02-06 15:45   ` Kumar Gala
2008-12-04  5:04 ` [U-Boot] [PATCH 03/11] drivers/pci: Create pci_map_bar function Becky Bruce
2009-01-28 14:21   ` Kumar Gala
2008-12-04  5:04 ` [U-Boot] [PATCH 04/11] powerpc: Move duplicated BAT defines to mmu.h Becky Bruce
2008-12-04  5:04 ` [U-Boot] [PATCH 05/11] lib_generic/addr_map: Change size to phys_size_t from ulong Becky Bruce
2008-12-13 23:22   ` Kumar Gala
2008-12-04  5:04 ` [U-Boot] [PATCH 06/11] mpc86xx: Add support to populate addr map based on BATs Becky Bruce
2008-12-04  5:04 ` [U-Boot] [PATCH 07/11] flash/cfi_flash: Use virtual sector start address, not phys Becky Bruce
2009-01-14  8:38   ` Kumar Gala
2009-01-14  8:57     ` Kumar Gala
2009-01-14 11:45       ` Haavard Skinnemoen
2009-01-14 11:34     ` Haavard Skinnemoen
2009-01-14 14:38       ` Kumar Gala
2009-01-14 12:12     ` Stefan Roese
2008-12-04  5:04 ` Becky Bruce [this message]
2008-12-04  5:04 ` [U-Boot] [PATCH 09/11] MPC8641HPCN: Enable CONFIG_ADDR_MAP Becky Bruce
2008-12-04  5:04 ` [U-Boot] [PATCH 10/11] drivers/block/ahci: Fix pci mapping bug Becky Bruce
2009-01-28 14:22   ` Kumar Gala
2008-12-04  5:04 ` [U-Boot] [PATCH 11/11] mpc8641hpcn: Change PCI MEM pci bus address Becky Bruce

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=1228367087-27268-9-git-send-email-beckyb@kernel.crashing.org \
    --to=beckyb@kernel.crashing.org \
    --cc=u-boot@lists.denx.de \
    /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