projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mpc85xx: Add support for the MPC8536
[oweals/u-boot.git]
/
cpu
/
mpc8260
/
pci.c
diff --git
a/cpu/mpc8260/pci.c
b/cpu/mpc8260/pci.c
index dc077ed1d5ddc5ae04361641b8bb66abee80a468..82303644b2be6df407b296992f3c251f90e839eb 100644
(file)
--- a/
cpu/mpc8260/pci.c
+++ b/
cpu/mpc8260/pci.c
@@
-2,6
+2,10
@@
* (C) Copyright 2003
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* (C) Copyright 2003
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
+ * Copyright (c) 2005 MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ * Added support for PCI bridge on MPC8272ADS
+ *
* See file CREDITS for list of people who contributed to this
* project.
*
* See file CREDITS for list of people who contributed to this
* project.
*
@@
-29,6
+33,15
@@
#include <mpc8260.h>
#include <asm/m8260_pci.h>
#include <asm/io.h>
#include <mpc8260.h>
#include <asm/m8260_pci.h>
#include <asm/io.h>
+#ifdef CONFIG_OF_LIBFDT
+#include <libfdt.h>
+#include <fdt_support.h>
+#endif
+
+#if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272 || defined CONFIG_PM826
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
/*
* Local->PCI map (from CPU) controlled by
* MPC826x master window
/*
* Local->PCI map (from CPU) controlled by
* MPC826x master window
@@
-230,9
+243,6
@@
static inline void pci_outl (u32 addr, u32 data)
void pci_mpc8250_init (struct pci_controller *hose)
{
void pci_mpc8250_init (struct pci_controller *hose)
{
-#ifdef CONFIG_MPC8266ADS
- DECLARE_GLOBAL_DATA_PTR;
-#endif
u16 tempShort;
volatile immap_t *immap = (immap_t *) CFG_IMMR;
u16 tempShort;
volatile immap_t *immap = (immap_t *) CFG_IMMR;
@@
-248,6
+258,28
@@
void pci_mpc8250_init (struct pci_controller *hose)
immap->im_siu_conf.sc_siumcr =
(immap->im_siu_conf.sc_siumcr & ~SIUMCR_LBPC11)
| SIUMCR_LBPC01;
immap->im_siu_conf.sc_siumcr =
(immap->im_siu_conf.sc_siumcr & ~SIUMCR_LBPC11)
| SIUMCR_LBPC01;
+#elif defined CONFIG_MPC8272
+ immap->im_siu_conf.sc_siumcr = (immap->im_siu_conf.sc_siumcr &
+ ~SIUMCR_BBD &
+ ~SIUMCR_ESE &
+ ~SIUMCR_PBSE &
+ ~SIUMCR_CDIS &
+ ~SIUMCR_DPPC11 &
+ ~SIUMCR_L2CPC11 &
+ ~SIUMCR_LBPC11 &
+ ~SIUMCR_APPC11 &
+ ~SIUMCR_CS10PC11 &
+ ~SIUMCR_BCTLC11 &
+ ~SIUMCR_MMR11)
+ | SIUMCR_DPPC11
+ | SIUMCR_L2CPC01
+ | SIUMCR_LBPC00
+ | SIUMCR_APPC10
+ | SIUMCR_CS10PC00
+ | SIUMCR_BCTLC00
+ | SIUMCR_MMR11;
+#elif defined(CONFIG_TQM8272)
+/* nothing to do for this Board here */
#else
/*
* Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
#else
/*
* Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
@@
-290,9
+322,9
@@
void pci_mpc8250_init (struct pci_controller *hose)
immap->im_memctl.memc_pcimsk0 = PCIMSK0_MASK;
immap->im_memctl.memc_pcibr0 = PCI_MSTR0_LOCAL | PCIBR_ENABLE;
immap->im_memctl.memc_pcimsk0 = PCIMSK0_MASK;
immap->im_memctl.memc_pcibr0 = PCI_MSTR0_LOCAL | PCIBR_ENABLE;
-#if
def CONFIG_MPC8266ADS
- immap->im_memctl.memc_pcimsk
0
= PCIMSK1_MASK;
- immap->im_memctl.memc_pcibr
0
= PCI_MSTR1_LOCAL | PCIBR_ENABLE;
+#if
defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272
+ immap->im_memctl.memc_pcimsk
1
= PCIMSK1_MASK;
+ immap->im_memctl.memc_pcibr
1
= PCI_MSTR1_LOCAL | PCIBR_ENABLE;
#endif
/* Release PCI RST (by default the PCI RST signal is held low) */
#endif
/* Release PCI RST (by default the PCI RST signal is held low) */
@@
-300,7
+332,7
@@
void pci_mpc8250_init (struct pci_controller *hose)
/* give it some time */
{
/* give it some time */
{
-#if
def CONFIG_MPC8266ADS
+#if
defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272
/* Give the PCI cards more time to initialize before query
This might be good for other boards also
*/
/* Give the PCI cards more time to initialize before query
This might be good for other boards also
*/
@@
-344,7
+376,11
@@
void pci_mpc8250_init (struct pci_controller *hose)
immap->im_pci.pci_picmr0 = cpu_to_le32 (PICMR0_MASK_ATTRIB); /* Size & attribute */
/* See above for description - puts PCI request as highest priority */
immap->im_pci.pci_picmr0 = cpu_to_le32 (PICMR0_MASK_ATTRIB); /* Size & attribute */
/* See above for description - puts PCI request as highest priority */
+#ifdef CONFIG_MPC8272
+ immap->im_siu_conf.sc_ppc_alrh = 0x01236745;
+#else
immap->im_siu_conf.sc_ppc_alrh = 0x03124567;
immap->im_siu_conf.sc_ppc_alrh = 0x03124567;
+#endif
/* Park the bus on the PCI */
immap->im_siu_conf.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;
/* Park the bus on the PCI */
immap->im_siu_conf.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;
@@
-370,7
+406,7
@@
void pci_mpc8250_init (struct pci_controller *hose)
hose->last_busno = 0xff;
/* System memory space */
hose->last_busno = 0xff;
/* System memory space */
-#if
def CONFIG_MPC8266ADS
+#if
defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272 || defined CONFIG_PM826
pci_set_region (hose->regions + 0,
PCI_SLV_MEM_BUS,
PCI_SLV_MEM_LOCAL,
pci_set_region (hose->regions + 0,
PCI_SLV_MEM_BUS,
PCI_SLV_MEM_LOCAL,
@@
-383,7
+419,7
@@
void pci_mpc8250_init (struct pci_controller *hose)
#endif
/* PCI memory space */
#endif
/* PCI memory space */
-#if
def CONFIG_MPC8266ADS
+#if
defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272
pci_set_region (hose->regions + 1,
PCI_MSTR_MEMIO_BUS,
PCI_MSTR_MEMIO_LOCAL,
pci_set_region (hose->regions + 1,
PCI_MSTR_MEMIO_BUS,
PCI_MSTR_MEMIO_LOCAL,
@@
-417,4
+453,12
@@
void pci_mpc8250_init (struct pci_controller *hose)
immap->im_pci.pci_emr |= cpu_to_le32 (PCI_ERROR_PCI_NO_RSP);
}
immap->im_pci.pci_emr |= cpu_to_le32 (PCI_ERROR_PCI_NO_RSP);
}
+#if defined(CONFIG_OF_LIBFDT)
+void ft_pci_setup(void *blob, bd_t *bd)
+{
+ do_fixup_by_prop_u32(blob, "device_type", "pci", 4,
+ "clock-frequency", gd->pci_clk, 1);
+}
+#endif
+
#endif /* CONFIG_PCI */
#endif /* CONFIG_PCI */