summaryrefslogtreecommitdiff
path: root/include/asm-ppc/4xx_pcie.h
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2007-10-05 09:18:23 +0200
committerStefan Roese <sr@denx.de>2007-10-31 21:20:49 +0100
commit97923770cb52b64d69eec958a11b2eda8d46e0f7 (patch)
tree6d473eb7e4f4ab0ef76d989e21930b3fc3e7278c /include/asm-ppc/4xx_pcie.h
parent4dbee8a90df613eb517aadbecebd70f168913d30 (diff)
downloadu-boot-imx-97923770cb52b64d69eec958a11b2eda8d46e0f7.zip
u-boot-imx-97923770cb52b64d69eec958a11b2eda8d46e0f7.tar.gz
u-boot-imx-97923770cb52b64d69eec958a11b2eda8d46e0f7.tar.bz2
ppc4xx: 4xx_pcie: More general cleanup and 405EX PCIe support added
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'include/asm-ppc/4xx_pcie.h')
-rw-r--r--include/asm-ppc/4xx_pcie.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/include/asm-ppc/4xx_pcie.h b/include/asm-ppc/4xx_pcie.h
index 1bb8fc7..17ac57b 100644
--- a/include/asm-ppc/4xx_pcie.h
+++ b/include/asm-ppc/4xx_pcie.h
@@ -16,14 +16,29 @@
#define DCRN_SDR0_CFGDATA 0x00f
#if defined(CONFIG_440SPE)
+#define CFG_PCIE_NR_PORTS 3
+
+#define CFG_PCIE_ADDR_HIGH 0x0000000d
+
#define DCRN_PCIE0_BASE 0x100
#define DCRN_PCIE1_BASE 0x120
#define DCRN_PCIE2_BASE 0x140
+
+#define PCIE0_SDR 0x300
+#define PCIE1_SDR 0x340
+#define PCIE2_SDR 0x370
#endif
#if defined(CONFIG_405EX)
+#define CFG_PCIE_NR_PORTS 2
+
+#define CFG_PCIE_ADDR_HIGH 0x00000000
+
#define DCRN_PCIE0_BASE 0x040
#define DCRN_PCIE1_BASE 0x060
+
+#define PCIE0_SDR 0x400
+#define PCIE1_SDR 0x440
#endif
#define PCIE0 DCRN_PCIE0_BASE
@@ -53,17 +68,6 @@
#define PESDR0_PLLLCT2 0x03a1
#define PESDR0_PLLLCT3 0x03a2
-#if defined(CONFIG_440SPE)
-#define PCIE0_SDR 0x300
-#define PCIE1_SDR 0x340
-#define PCIE2_SDR 0x370
-#endif
-
-#if defined(CONFIG_405EX)
-#define PCIE0_SDR 0x400
-#define PCIE1_SDR 0x440
-#endif
-
/* common regs, at least for 405EX and 440SPe */
#define SDRN_PESDR_UTLSET1(n) (sdr_base(n) + 0x00)
#define SDRN_PESDR_UTLSET2(n) (sdr_base(n) + 0x01)
@@ -237,6 +241,9 @@
#define GPL_DMER_MASK_DISA 0x02000000
+#define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL))
+#define U64_TO_U32_HIGH(val) ((u32)((val) >> 32))
+
int ppc4xx_init_pcie(void);
int ppc4xx_init_pcie_rootport(int port);
int ppc4xx_init_pcie_endport(int port);
@@ -260,7 +267,7 @@ static inline u32 sdr_base(int port)
return PCIE0_SDR;
case 1:
return PCIE1_SDR;
-#if defined(PCIE2_SDR)
+#if CFG_PCIE_NR_PORTS > 2
case 2:
return PCIE2_SDR;
#endif