LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 04/25] [POWERPC] Added indirect quirk to handle PCIe PHB that have issue w/no link
From: Kumar Gala @ 2007-07-24  2:28 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1185241179.5439.185.camel@localhost.localdomain>


On Jul 23, 2007, at 8:39 PM, Benjamin Herrenschmidt wrote:

> On Mon, 2007-07-23 at 15:49 -0500, Kumar Gala wrote:
>> Added PPC_INDIRECT_TYPE_NO_PCIE_LINK flag to the indirect pci  
>> handling
>> code to ensure that we don't talk to any device other than the PHB
>> if we don't have PCIe link.  Some controllers will lockup if they try
>> to do a config cycle to any device on the bus except the PHB.
>>
>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>
> I would name the quirk a bit more generically, something like
> "ACCESS_PHB_ONLY" maybe ? If you don't want to change it, that's fair.

Will deal with this change after the current patchset.

>
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> Ben.

- k

^ permalink raw reply

* Re: [PATCH] Use resource_size_t for serial port IO addresses
From: David Gibson @ 2007-07-24  1:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Russell King, paulus
In-Reply-To: <20070723123411.07fc6568.akpm@linux-foundation.org>

On Mon, Jul 23, 2007 at 12:34:11PM -0700, Andrew Morton wrote:
> On Mon, 23 Jul 2007 09:08:37 -0500
> Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:
> 
> > On Sun, 2007-07-15 at 12:06 +0100, Russell King wrote:
> > > > This is something we should do, but I have recollections of Russell
> > > > identifying problems with this patch, or at least an earlier version of it?
> > > 
> > > Basically, there's two patches.  This one (let's call this patch A)
> > > and another to prevent users being surprised (let's call that patch B).
> > > 
> > > I didn't have any real objections to patch A, provided something like
> > > patch B was merged.  I did have objections against patch B, and I was
> > > intermittently working on a revised solution.
> > > 
> > > However, for whatever reason [*], during the last merge window patch B
> > > got merged and patch A got dropped, and as a result I've now given up
> > > with my revised solution, and TBH, I no longer care.
> > 
> > Patch B in this case was commit abb4a2390.  Since that has already been
> > merged, can we please merge this patch into 2.6.23?  I'd really like to
> > avoid 44x not working in yet another kernel, so if this patch can't be
> > merged I'll have to come up with some alternate solution soon.
> > 
> 
> I still have a large pile of not-completely-obviously-ready patches to go
> through, of which this is one.
> 
> There _were_ issues with this patch when it first turned up, but I failed
> to record what they were.

Heh.  Nor did I ever hear what they might be.

> 
> Oh well, here's hoping it got fixed.
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH 19/25] [POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.
From: Benjamin Herrenschmidt @ 2007-07-24  1:48 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <11852238411823-git-send-email-galak@kernel.crashing.org>

On Mon, 2007-07-23 at 15:50 -0500, Kumar Gala wrote:
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -836,6 +836,7 @@ static struct irq_chip mpic_irq_chip = {
>         .mask           = mpic_mask_irq,
>         .unmask         = mpic_unmask_irq,
>         .eoi            = mpic_end_irq,
> +       .end            = mpic_unmask_irq,
>         .set_type       = mpic_set_irq_type,
>  }; 

Nope, that doesn't look correct and shouldn't be in this patch in the
first place.

end() is flow control business, not chip business, so it's really
something that needs to be fixed in the fasteoi handler for -rt I
suppose.

Ben.

^ permalink raw reply

* Re: [PATCH 16/25] [POWERPC] Provide ability to setup P2P bridge registers from struct resource
From: Benjamin Herrenschmidt @ 2007-07-24  1:45 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <11852238362041-git-send-email-galak@kernel.crashing.org>

On Mon, 2007-07-23 at 15:50 -0500, Kumar Gala wrote:
> We need the ability to set P2P bridge registers to properly setup the virtual
> P2P bridges that exist in PCIe controllers for some of the embedded setups.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  arch/powerpc/kernel/pci_32.c     |   18 ++++++++++++------
>  include/asm-powerpc/pci-bridge.h |    2 ++
>  2 files changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
> index bfcfa14..721a694 100644
> --- a/arch/powerpc/kernel/pci_32.c
> +++ b/arch/powerpc/kernel/pci_32.c
> @@ -415,15 +415,13 @@ probe_resource(struct pci_bus *parent, struct resource *pr,
>  	return 0;
>  }
>  
> -static void __init
> -update_bridge_base(struct pci_bus *bus, int i)
> +void __init
> +update_bridge_resource(struct pci_dev *dev, struct resource *res)
>  {
> -	struct resource *res = bus->resource[i];
>  	u8 io_base_lo, io_limit_lo;
>  	u16 mem_base, mem_limit;
>  	u16 cmd;
>  	unsigned long start, end, off;
> -	struct pci_dev *dev = bus->self;
>  	struct pci_controller *hose = dev->sysdata;
>  
>  	if (!hose) {
> @@ -467,12 +465,20 @@ update_bridge_base(struct pci_bus *bus, int i)
>  		pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
>  
>  	} else {
> -		DBG(KERN_ERR "PCI: ugh, bridge %s res %d has flags=%lx\n",
> -		    pci_name(dev), i, res->flags);
> +		DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n",
> +		    pci_name(dev), res->flags);
>  	}
>  	pci_write_config_word(dev, PCI_COMMAND, cmd);
>  }
>  
> +static void __init
> +update_bridge_base(struct pci_bus *bus, int i)
> +{
> +	struct resource *res = bus->resource[i];
> +	struct pci_dev *dev = bus->self;
> +	update_bridge_resource(dev, res);
> +}
> +
>  static inline void alloc_resource(struct pci_dev *dev, int idx)
>  {
>  	struct resource *pr, *r = &dev->resource[idx];
> diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
> index 435bfe8..b7d2ea4 100644
> --- a/include/asm-powerpc/pci-bridge.h
> +++ b/include/asm-powerpc/pci-bridge.h
> @@ -93,6 +93,8 @@ extern int early_find_capability(struct pci_controller *hose, int bus,
>  extern void setup_indirect_pci(struct pci_controller* hose,
>  			       u32 cfg_addr, u32 cfg_data, u32 flags);
>  extern void setup_grackle(struct pci_controller *hose);
> +extern void __init update_bridge_resource(struct pci_dev *dev,
> +					  struct resource *res);
>  
>  #else
>  

^ permalink raw reply

* Re: [PATCH 14/25] [POWERPC] Make endianess of cfg_addr for indirect pci ops runtime
From: Benjamin Herrenschmidt @ 2007-07-24  1:43 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <11852238333649-git-send-email-galak@kernel.crashing.org>

On Mon, 2007-07-23 at 15:50 -0500, Kumar Gala wrote:
> Make it so we do a runtime check to know if we need to write cfg_addr
> as big or little endian.  This is needed if we want to allow 86xx support
> to co-exist in the same kernel as other 6xx PPCs.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Nack on that one. Don't add this function pointer. Just have the
indirect read/write routines test the flag and do the right endian,
possibly with an inline or a macro if you want to be clean. A function
ointer is probably slower anyway and I don't want to add more cruft to
struct pci_controller.

Cheers,
Ben

> ---
>  arch/powerpc/Kconfig                             |    5 -----
>  arch/powerpc/platforms/82xx/mpc82xx_ads.c        |    3 ++-
>  arch/powerpc/platforms/83xx/pci.c                |    4 ++--
>  arch/powerpc/platforms/85xx/Kconfig              |    1 -
>  arch/powerpc/platforms/86xx/Kconfig              |    1 -
>  arch/powerpc/platforms/chrp/pci.c                |    7 ++++---
>  arch/powerpc/platforms/embedded6xx/linkstation.c |    2 +-
>  arch/powerpc/sysdev/fsl_pci.c                    |    3 ++-
>  arch/powerpc/sysdev/grackle.c                    |    2 +-
>  arch/powerpc/sysdev/indirect_pci.c               |   20 +++++++++++++++++---
>  arch/powerpc/sysdev/mv64x60_pci.c                |    2 +-
>  include/asm-powerpc/pci-bridge.h                 |    6 +++++-
>  12 files changed, 35 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 3ff90f0..00099ef 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -411,11 +411,6 @@ config PPC_INDIRECT_PCI
>  	default y if 40x || 44x
>  	default n
>  
> -config PPC_INDIRECT_PCI_BE
> -	bool
> -	depends PPC_INDIRECT_PCI
> -	default n
> -
>  config EISA
>  	bool
>  
> diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
> index da20832..2d1b05b 100644
> --- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c
> +++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
> @@ -553,7 +553,8 @@ static void __init mpc82xx_add_bridge(struct device_node *np)
>  
>  	setup_indirect_pci(hose,
>  			   r.start + offsetof(pci_cpm2_t, pci_cfg_addr),
> -			   r.start + offsetof(pci_cpm2_t, pci_cfg_data));
> +			   r.start + offsetof(pci_cpm2_t, pci_cfg_data),
> +			   0);
>  
>  	pci_process_bridge_OF_ranges(hose, np, 1);
>  }
> diff --git a/arch/powerpc/platforms/83xx/pci.c b/arch/powerpc/platforms/83xx/pci.c
> index c0e2b89..9206946 100644
> --- a/arch/powerpc/platforms/83xx/pci.c
> +++ b/arch/powerpc/platforms/83xx/pci.c
> @@ -74,11 +74,11 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
>  	 */
>  	/* PCI 1 */
>  	if ((rsrc.start & 0xfffff) == 0x8500) {
> -		setup_indirect_pci(hose, immr + 0x8300, immr + 0x8304);
> +		setup_indirect_pci(hose, immr + 0x8300, immr + 0x8304, 0);
>  	}
>  	/* PCI 2 */
>  	if ((rsrc.start & 0xfffff) == 0x8600) {
> -		setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384);
> +		setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384, 0);
>  		primary = 0;
>  	}
>  
> diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
> index 526ddde..4661fcc 100644
> --- a/arch/powerpc/platforms/85xx/Kconfig
> +++ b/arch/powerpc/platforms/85xx/Kconfig
> @@ -51,7 +51,6 @@ config MPC85xx
>  	bool
>  	select PPC_UDBG_16550
>  	select PPC_INDIRECT_PCI if PCI
> -	select PPC_INDIRECT_PCI_BE if PCI
>  	select MPIC
>  	select FSL_PCI if PCI
>  	select SERIAL_8250_SHARE_IRQ if SERIAL_8250
> diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
> index d1c8115..343b76d 100644
> --- a/arch/powerpc/platforms/86xx/Kconfig
> +++ b/arch/powerpc/platforms/86xx/Kconfig
> @@ -14,7 +14,6 @@ endchoice
>  
>  config MPC8641
>  	bool
> -	select PPC_INDIRECT_PCI_BE if PCI
>  	select FSL_PCI if PCI
>  	select PPC_UDBG_16550
>  	select MPIC
> diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
> index 3690624..28d1647 100644
> --- a/arch/powerpc/platforms/chrp/pci.c
> +++ b/arch/powerpc/platforms/chrp/pci.c
> @@ -181,7 +181,7 @@ setup_python(struct pci_controller *hose, struct device_node *dev)
>  	}
>  	iounmap(reg);
>  
> -	setup_indirect_pci(hose, r.start + 0xf8000, r.start + 0xf8010);
> +	setup_indirect_pci(hose, r.start + 0xf8000, r.start + 0xf8010, 0);
>  }
>  
>  /* Marvell Discovery II based Pegasos 2 */
> @@ -277,13 +277,14 @@ chrp_find_bridges(void)
>  			hose->cfg_data = p;
>  			gg2_pci_config_base = p;
>  		} else if (is_pegasos == 1) {
> -			setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc);
> +			setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc, 0);
>  		} else if (is_pegasos == 2) {
>  			setup_peg2(hose, dev);
>  		} else if (!strncmp(model, "IBM,CPC710", 10)) {
>  			setup_indirect_pci(hose,
>  					   r.start + 0x000f8000,
> -					   r.start + 0x000f8010);
> +					   r.start + 0x000f8010,
> +					   0);
>  			if (index == 0) {
>  				dma = of_get_property(dev, "system-dma-base",
>  							&len);
> diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
> index f4d0a7a..bd5ca58 100644
> --- a/arch/powerpc/platforms/embedded6xx/linkstation.c
> +++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
> @@ -73,7 +73,7 @@ static int __init linkstation_add_bridge(struct device_node *dev)
>  		return -ENOMEM;
>  	hose->first_busno = bus_range ? bus_range[0] : 0;
>  	hose->last_busno = bus_range ? bus_range[1] : 0xff;
> -	setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
> +	setup_indirect_pci(hose, 0xfec00000, 0xfee00000, 0);
>  
>  	/* Interpret the "ranges" property */
>  	/* This also maps the I/O region and sets isa_io/mem_base */
> diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
> index c6a30f9..1426642 100644
> --- a/arch/powerpc/sysdev/fsl_pci.c
> +++ b/arch/powerpc/sysdev/fsl_pci.c
> @@ -185,7 +185,8 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
>  	hose->first_busno = bus_range ? bus_range[0] : 0x0;
>  	hose->last_busno = bus_range ? bus_range[1] : 0xff;
>  
> -	setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4);
> +	setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4,
> +		INDIRECT_PCI_BIG_ENDIAN);
>  	setup_pci_cmd(hose);
>  
>  	/* check PCI express link status */
> diff --git a/arch/powerpc/sysdev/grackle.c b/arch/powerpc/sysdev/grackle.c
> index 4205362..11ad562 100644
> --- a/arch/powerpc/sysdev/grackle.c
> +++ b/arch/powerpc/sysdev/grackle.c
> @@ -55,7 +55,7 @@ static inline void grackle_set_loop_snoop(struct pci_controller *bp, int enable)
>  
>  void __init setup_grackle(struct pci_controller *hose)
>  {
> -	setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
> +	setup_indirect_pci(hose, 0xfec00000, 0xfee00000, 0);
>  	if (machine_is_compatible("PowerMac1,1"))
>  		pci_assign_all_buses = 1;
>  	if (machine_is_compatible("AAPL,PowerBook1998"))
> diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
> index ad341f5..33b9b69 100644
> --- a/arch/powerpc/sysdev/indirect_pci.c
> +++ b/arch/powerpc/sysdev/indirect_pci.c
> @@ -26,6 +26,16 @@
>  #define PCI_CFG_OUT out_le32
>  #endif
>  
> +static void pci_cfg_out_le(volatile u32 __iomem *addr, u32 val)
> +{
> +	out_le32(addr, val);
> +}
> +
> +static void pci_cfg_out_be(volatile u32 __iomem *addr, u32 val)
> +{
> +	out_be32(addr, val);
> +}
> +
>  static int
>  indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
>  		     int len, u32 *val)
> @@ -58,7 +68,7 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
>  	else
>  		reg = offset & 0xfc;
>  
> -	PCI_CFG_OUT(hose->cfg_addr,
> +	hose->pci_cfg_out(hose->cfg_addr,
>  		 (0x80000000 | (bus_no << 16)
>  		  | (devfn << 8) | reg | cfg_type));
>  
> @@ -113,7 +123,7 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
>  	else
>  		reg = offset & 0xfc;
>  
> -	PCI_CFG_OUT(hose->cfg_addr,
> +	hose->pci_cfg_out(hose->cfg_addr,
>  		 (0x80000000 | (bus_no << 16)
>  		  | (devfn << 8) | reg | cfg_type));
>  
> @@ -149,7 +159,7 @@ static struct pci_ops indirect_pci_ops =
>  };
>  
>  void __init
> -setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
> +setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data, u32 flags)
>  {
>  	unsigned long base = cfg_addr & PAGE_MASK;
>  	void __iomem *mbase;
> @@ -160,4 +170,8 @@ setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
>  		mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE);
>  	hose->cfg_data = mbase + (cfg_data & ~PAGE_MASK);
>  	hose->ops = &indirect_pci_ops;
> +	if (flags & INDIRECT_PCI_BIG_ENDIAN)
> +		hose->pci_cfg_out = pci_cfg_out_be;
> +	else
> +		hose->pci_cfg_out = pci_cfg_out_le;
>  }
> diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
> index 45db86c..9b3baa7 100644
> --- a/arch/powerpc/sysdev/mv64x60_pci.c
> +++ b/arch/powerpc/sysdev/mv64x60_pci.c
> @@ -144,7 +144,7 @@ static int __init mv64x60_add_bridge(struct device_node *dev)
>  	hose->first_busno = bus_range ? bus_range[0] : 0;
>  	hose->last_busno = bus_range ? bus_range[1] : 0xff;
>  
> -	setup_indirect_pci(hose, rsrc.start, rsrc.start + 4);
> +	setup_indirect_pci(hose, rsrc.start, rsrc.start + 4, 0);
>  	hose->self_busno = hose->first_busno;
>  
>  	printk(KERN_INFO "Found MV64x60 PCI host bridge at 0x%016llx. "
> diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
> index 13cb0a9..435bfe8 100644
> --- a/include/asm-powerpc/pci-bridge.h
> +++ b/include/asm-powerpc/pci-bridge.h
> @@ -36,6 +36,7 @@ struct pci_controller {
>  	struct pci_ops *ops;
>  	volatile unsigned int __iomem *cfg_addr;
>  	volatile void __iomem *cfg_data;
> +	void (*pci_cfg_out)(volatile u32 __iomem *cfg_addr, u32 val);
>  
>  	/*
>  	 * Used for variants of PCI indirect handling and possible quirks:
> @@ -87,8 +88,10 @@ int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
>  extern int early_find_capability(struct pci_controller *hose, int bus,
>  				 int dev_fn, int cap);
>  
> +/* Set this for a big-endian cfg_addr */
> +#define INDIRECT_PCI_BIG_ENDIAN			0x00000001
>  extern void setup_indirect_pci(struct pci_controller* hose,
> -			       u32 cfg_addr, u32 cfg_data);
> +			       u32 cfg_addr, u32 cfg_data, u32 flags);
>  extern void setup_grackle(struct pci_controller *hose);
>  
>  #else
> @@ -128,6 +131,7 @@ struct pci_controller {
>  	struct pci_ops *ops;
>  	volatile unsigned int __iomem *cfg_addr;
>  	volatile void __iomem *cfg_data;
> +	void (*pci_cfg_out)(volatile u32 __iomem *cfg_addr, u32 val);
>  
>  	/* Currently, we limit ourselves to 1 IO range and 3 mem
>  	 * ranges since the common pci_bus structure can't handle more

^ permalink raw reply

* Re: [PATCH 13/25] [POWERPC] Removed setup_indirect_pci_nomap
From: Benjamin Herrenschmidt @ 2007-07-24  1:40 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <11852238322319-git-send-email-galak@kernel.crashing.org>

On Mon, 2007-07-23 at 15:50 -0500, Kumar Gala wrote:
> We don't use setup_indirect_pci_nomap in arch/powerpc and it appears
> the users that needed it from arch/ppc are now using setup_indirect_pci.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Good riddance !

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  arch/powerpc/sysdev/indirect_pci.c |   17 ++++-------------
>  include/asm-powerpc/pci-bridge.h   |    2 --
>  2 files changed, 4 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
> index bc5b4e2..ad341f5 100644
> --- a/arch/powerpc/sysdev/indirect_pci.c
> +++ b/arch/powerpc/sysdev/indirect_pci.c
> @@ -149,24 +149,15 @@ static struct pci_ops indirect_pci_ops =
>  };
>  
>  void __init
> -setup_indirect_pci_nomap(struct pci_controller* hose, void __iomem * cfg_addr,
> -	void __iomem * cfg_data)
> -{
> -	hose->cfg_addr = cfg_addr;
> -	hose->cfg_data = cfg_data;
> -	hose->ops = &indirect_pci_ops;
> -}
> -
> -void __init
>  setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
>  {
>  	unsigned long base = cfg_addr & PAGE_MASK;
> -	void __iomem *mbase, *addr, *data;
> +	void __iomem *mbase;
>  
>  	mbase = ioremap(base, PAGE_SIZE);
> -	addr = mbase + (cfg_addr & ~PAGE_MASK);
> +	hose->cfg_addr = mbase + (cfg_addr & ~PAGE_MASK);
>  	if ((cfg_data & PAGE_MASK) != base)
>  		mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE);
> -	data = mbase + (cfg_data & ~PAGE_MASK);
> -	setup_indirect_pci_nomap(hose, addr, data);
> +	hose->cfg_data = mbase + (cfg_data & ~PAGE_MASK);
> +	hose->ops = &indirect_pci_ops;
>  }
> diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
> index 9754357..13cb0a9 100644
> --- a/include/asm-powerpc/pci-bridge.h
> +++ b/include/asm-powerpc/pci-bridge.h
> @@ -87,8 +87,6 @@ int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
>  extern int early_find_capability(struct pci_controller *hose, int bus,
>  				 int dev_fn, int cap);
>  
> -extern void setup_indirect_pci_nomap(struct pci_controller* hose,
> -			       void __iomem *cfg_addr, void __iomem *cfg_data);
>  extern void setup_indirect_pci(struct pci_controller* hose,
>  			       u32 cfg_addr, u32 cfg_data);
>  extern void setup_grackle(struct pci_controller *hose);

^ permalink raw reply

* Re: [PATCH 04/25] [POWERPC] Added indirect quirk to handle PCIe PHB that have issue w/no link
From: Benjamin Herrenschmidt @ 2007-07-24  1:39 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1185223818821-git-send-email-galak@kernel.crashing.org>

On Mon, 2007-07-23 at 15:49 -0500, Kumar Gala wrote:
> Added PPC_INDIRECT_TYPE_NO_PCIE_LINK flag to the indirect pci handling
> code to ensure that we don't talk to any device other than the PHB
> if we don't have PCIe link.  Some controllers will lockup if they try
> to do a config cycle to any device on the bus except the PHB.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

I would name the quirk a bit more generically, something like
"ACCESS_PHB_ONLY" maybe ? If you don't want to change it, that's fair.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Ben.

>  arch/powerpc/sysdev/indirect_pci.c |   16 +++++++++++++++-
>  include/asm-powerpc/pci-bridge.h   |    5 +++++
>  2 files changed, 20 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
> index c7e6e85..bc5b4e2 100644
> --- a/arch/powerpc/sysdev/indirect_pci.c
> +++ b/arch/powerpc/sysdev/indirect_pci.c
> @@ -35,10 +35,17 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
>  	u8 cfg_type = 0;
>  	u32 bus_no, reg;
>  
> +	if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
> +		if (bus->number != hose->first_busno)
> +			return PCIBIOS_DEVICE_NOT_FOUND;
> +		if (devfn != 0)
> +			return PCIBIOS_DEVICE_NOT_FOUND;
> +	}
> +
>  	if (ppc_md.pci_exclude_device)
>  		if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
>  			return PCIBIOS_DEVICE_NOT_FOUND;
> -	
> +
>  	if (hose->indirect_type & PPC_INDIRECT_TYPE_SET_CFG_TYPE)
>  		if (bus->number != hose->first_busno)
>  			cfg_type = 1;
> @@ -83,6 +90,13 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
>  	u8 cfg_type = 0;
>  	u32 bus_no, reg;
>  
> +	if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
> +		if (bus->number != hose->first_busno)
> +			return PCIBIOS_DEVICE_NOT_FOUND;
> +		if (devfn != 0)
> +			return PCIBIOS_DEVICE_NOT_FOUND;
> +	}
> +
>  	if (ppc_md.pci_exclude_device)
>  		if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
>  			return PCIBIOS_DEVICE_NOT_FOUND;
> diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
> index 7a00b8e..9754357 100644
> --- a/include/asm-powerpc/pci-bridge.h
> +++ b/include/asm-powerpc/pci-bridge.h
> @@ -45,10 +45,15 @@ struct pci_controller {
>  	 *   on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS
>  	 *   to determine which bus number to match on when generating type0
>  	 *   config cycles
> +	 *  NO_PCIE_LINK - the Freescale PCI-e controllers have issues with
> +	 *   hanging if we don't have link and try to do config cycles to
> +	 *   anything but the PHB.  Only allow talking to the PHB if this is
> +	 *   set.
>  	 */
>  #define PPC_INDIRECT_TYPE_SET_CFG_TYPE		(0x00000001)
>  #define PPC_INDIRECT_TYPE_EXT_REG		(0x00000002)
>  #define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS	(0x00000004)
> +#define PPC_INDIRECT_TYPE_NO_PCIE_LINK		(0x00000008)
>  	u32 indirect_type;
>  
>  	/* Currently, we limit ourselves to 1 IO range and 3 mem

^ permalink raw reply

* Re: [PATCH 03/25] [POWERPC] Add the ability to find PCI capabilities early on
From: Benjamin Herrenschmidt @ 2007-07-24  1:37 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <11852238161546-git-send-email-galak@kernel.crashing.org>

On Mon, 2007-07-23 at 15:49 -0500, Kumar Gala wrote:
> Added early_find_capability that wraps pci_bus_find_capability and uses
> fake_pci_bus() to allow us to call it before we've fully setup the
> pci_controller.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

I want to try to get rid of the early stuff at one point, but that will
not happen before some major rework of powerpc PCI code so for now,
that's good to go.

Ben.

> ---
>  arch/powerpc/kernel/pci_32.c     |    7 +++++++
>  include/asm-powerpc/pci-bridge.h |    3 +++
>  2 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
> index 0adf077..bfcfa14 100644
> --- a/arch/powerpc/kernel/pci_32.c
> +++ b/arch/powerpc/kernel/pci_32.c
> @@ -1468,3 +1468,10 @@ EARLY_PCI_OP(read, dword, u32 *)
>  EARLY_PCI_OP(write, byte, u8)
>  EARLY_PCI_OP(write, word, u16)
>  EARLY_PCI_OP(write, dword, u32)
> +
> +extern int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
> +int early_find_capability(struct pci_controller *hose, int bus, int devfn,
> +			  int cap)
> +{
> +	return pci_bus_find_capability(fake_pci_bus(hose, bus), devfn, cap);
> +}
> diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
> index e72c2a6..7a00b8e 100644
> --- a/include/asm-powerpc/pci-bridge.h
> +++ b/include/asm-powerpc/pci-bridge.h
> @@ -79,6 +79,9 @@ int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn,
>  int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
>  			     int where, u32 val);
>  
> +extern int early_find_capability(struct pci_controller *hose, int bus,
> +				 int dev_fn, int cap);
> +
>  extern void setup_indirect_pci_nomap(struct pci_controller* hose,
>  			       void __iomem *cfg_addr, void __iomem *cfg_data);
>  extern void setup_indirect_pci(struct pci_controller* hose,

^ permalink raw reply

* Re: [patch 1/3] m68k/mac: Make mac_hid_mouse_emulate_buttons() declaration visible
From: Dmitry Torokhov @ 2007-07-24  0:45 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-m68k, linux-kernel, Adrian Bunk, linuxppc-dev, linux-input,
	Andrew Morton
In-Reply-To: <Pine.LNX.4.64.0707221451140.18493@anakin>

On Sunday 22 July 2007 08:51, Geert Uytterhoeven wrote:
> On Sun, 22 Jul 2007, Dmitry Torokhov wrote:
> > On Saturday 21 July 2007 04:27, Geert Uytterhoeven wrote:
> > > On Fri, 20 Jul 2007, Dmitry Torokhov wrote:
> > > > I am OK with adding a new header file. I was just saying that placing
> > > > that declaration in linux/hid.h makes about the same sense as putting
> > > > it into linux/scsi.h
> > > 
> > > At first I just wanted to move it. Then I thought about the angry
> > > comments I would get about not moving it to a header file ;-)
> > > 
> > > <linux/hid.h> looked like the best candidate. <linux/kbd_kern.h> is
> > > another option.
> > > 
> > 
> > linux/kbd_kern.h sounds much better.
> 
> And so it will be.

Applied to 'for-linus' branch of input tree, thank you.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH] Re: 2.6.22-git hangs during boot on PowerBook G3 in 0.0 seconds
From: Benjamin Herrenschmidt @ 2007-07-23 23:55 UTC (permalink / raw)
  To: Kim Phillips; +Cc: linuxppc-dev, Rutger Nijlunsing
In-Reply-To: <20070723172725.b1c14885.kim.phillips@freescale.com>


> > After hours of fun git bisecting, finally found the commit to revert
> > to make my PowerBook G3 Lombard boot again. This does not result in
> > the complains the reverted commit was revering to.
> 
> ..but it does on my MPC8360.

In which circumstances are you trying to translate an address with no
size cell ?

I also wonder why it hangs on the powerbook... Rutger, I would expect to
see that complaint warning with the reverted patch, what does it say ?

My Wallstreet (also based on Grackle) doesn't have the problem. Also can
you send me a tarball of /proc/device-tree ?

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 1/3] Add a new member name to structure irq_host
From: Benjamin Herrenschmidt @ 2007-07-23 23:36 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev, Chen Gong, paulus
In-Reply-To: <1185232974.13740.11.camel@concordia.ozlabs.ibm.com>

On Tue, 2007-07-24 at 09:22 +1000, Michael Ellerman wrote:
> On Tue, 2007-07-24 at 08:04 +1000, Benjamin Herrenschmidt wrote:
> > On Mon, 2007-07-23 at 19:13 +0800, Chen Gong wrote:
> > > This patch adds a new member 'name' for irq host's name to
> > > structure irq_host and modifies the definition of the
> > > function irq_alloc_host(). The assignment to the
> > > irq host's name is also added to irq_alloc_host().
> > 
> > I would instead prefer adding a irq_name callback to host, which would
> > return a per-irq name. In some cases, they could return the OF path to
> > the host for example.
> 
> The pity is, for the 75% [1] of irq_hosts that have a device_node, they
> will all have to implement the name callback, because they all store the
> of node differently.
> 
> Which makes me think (again) that we should have an optional device_node
> pointer in irq_host. I know you said you wanted the irq stuff to be OF
> agnostic, but the reality is most of the implementations do have an OF
> node. And all of the newer irq_host implementations do, with the
> exception of PS3 and celleb - which are special.

Won't work well in practice due to things like:

 - Cell iic -> one node per core, but one global host
 - xics -> one node per source controller (lots of them in the tree) but
one global host

Ben.

^ permalink raw reply

* Re: [PATCH 1/3] Add a new member name to structure irq_host
From: Michael Ellerman @ 2007-07-23 23:22 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Chen Gong, paulus
In-Reply-To: <1185228277.5439.141.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

On Tue, 2007-07-24 at 08:04 +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2007-07-23 at 19:13 +0800, Chen Gong wrote:
> > This patch adds a new member 'name' for irq host's name to
> > structure irq_host and modifies the definition of the
> > function irq_alloc_host(). The assignment to the
> > irq host's name is also added to irq_alloc_host().
> 
> I would instead prefer adding a irq_name callback to host, which would
> return a per-irq name. In some cases, they could return the OF path to
> the host for example.

The pity is, for the 75% [1] of irq_hosts that have a device_node, they
will all have to implement the name callback, because they all store the
of node differently.

Which makes me think (again) that we should have an optional device_node
pointer in irq_host. I know you said you wanted the irq stuff to be OF
agnostic, but the reality is most of the implementations do have an OF
node. And all of the newer irq_host implementations do, with the
exception of PS3 and celleb - which are special.

cheers

[1] Yes I counted :)

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCH] Re: 2.6.22-git hangs during boot on PowerBook G3 in 0.0 seconds
From: Kim Phillips @ 2007-07-23 22:27 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Rutger Nijlunsing, linuxppc-dev
In-Reply-To: <20070721212845.GA30977@nospam.com>

On Sat, 21 Jul 2007 23:28:45 +0200
Rutger Nijlunsing <rutger@nospam.com> wrote:

> On Sat, Jul 21, 2007 at 09:21:43PM +0200, Rutger Nijlunsing wrote:
> > Hi,
> > 
> > I'm trying to boot a new git kernel (2.6.22-g589f1e81), but it hangs
> > very early (the timestamp is still on 0.000000).
> 
> After hours bisecting, I found the one-liner which results in the
> hang. Now it takes someone else to find out _why_ it causes a hang :)
> 

hmm..I hadn't seen this of_translate_address comment:

 * Note: We consider that crossing any level with #size-cells == 0 to mean
 * that translation is impossible (that is we are not dealing with a value
 * that can be mapped to a cpu physical address). This is not really specified
 * that way, but this is traditionally the way IBM at least do things

so I guess even though size-cells can == 0, of_translate_address should
remain oblivious.

> 
> From 6c13e1b55c1f87ed19f3c4623de3df881779edd7 Mon Sep 17 00:00:00 2001
> From: Rutger Nijlunsing <git-commit@tux.tmfweb.nl>
> Date: Sat, 21 Jul 2007 23:01:22 +0200
> Subject: [PATCH] Revert "[POWERPC] Don't complain if size-cells == 0 in prom_parse()"
> Status: RO
> Content-Length: 866
> Lines: 24
> 
> After hours of fun git bisecting, finally found the commit to revert
> to make my PowerBook G3 Lombard boot again. This does not result in
> the complains the reverted commit was revering to.

..but it does on my MPC8360.

> 
> This reverts commit fd6e9d3945ee122eb513ada8b17296d243c1ce5e.
> ---
>  arch/powerpc/kernel/prom_parse.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
> index 3786dcc..b5c96af 100644
> --- a/arch/powerpc/kernel/prom_parse.c
> +++ b/arch/powerpc/kernel/prom_parse.c
> @@ -24,7 +24,7 @@
>  /* Max address size we deal with */
>  #define OF_MAX_ADDR_CELLS	4
>  #define OF_CHECK_COUNTS(na, ns)	((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
> -			(ns) >= 0)
> +			(ns) > 0)
>  
>  static struct of_bus *of_match_bus(struct device_node *np);
>  static int __of_address_to_resource(struct device_node *dev,
> -- 
> 1.5.2.2

yes, we can revert it, and perhaps do something like:

diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 3786dcc..92b7177 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -503,7 +503,7 @@ u64 of_translate_address(struct device_node *dev, const u32 
        /* Cound address cells & copy address locally */
        bus->count_cells(dev, &na, &ns);
        if (!OF_CHECK_COUNTS(na, ns)) {
-               printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
+               DBG("prom_parse: Bad cell count for %s\n",
                       dev->full_name);
                goto bail;
        }
@@ -531,7 +531,7 @@ u64 of_translate_address(struct device_node *dev, const u32 
                pbus = of_match_bus(parent);
                pbus->count_cells(dev, &pna, &pns);
                if (!OF_CHECK_COUNTS(pna, pns)) {
-                       printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
+                       DBG("prom_parse: Bad cell count for %s\n",
                               dev->full_name);
                        break;
                }

Ben?

Kim

^ permalink raw reply related

* Re: 2.6.23-rc1 breaks on JS20 w/SLOF
From: Benjamin Herrenschmidt @ 2007-07-23 22:06 UTC (permalink / raw)
  To: Adrian Reber; +Cc: linuxppc-dev
In-Reply-To: <20070723144745.GA31329@lisas.de>

On Mon, 2007-07-23 at 16:47 +0200, Adrian Reber wrote:
> On a JS20 with SLOF (pretending to be Maple) 2.6.23-rc1 breaks with
> following oops. 2.6.22 is working. Let me know if I can help debug this.

That would be my fault... looks like it tries to access IO ports before
the IO space is mapped by the PCI code, and without a legacy ISA range.
The later is now the only case where IO ports are available before the
main PCI setup.

I can add some tweak to the maple code to map the ISA stuff even when
the "isa" node is missing...

Ben.


> Maple: Found RTC at IO 0x1070
> Unable to handle kernel paging request for data at address 0xd000080000001070
> Faulting instruction address: 0xc00000000004d948
> Oops: Kernel access of bad area, sig: 11 [#1]
> SMP NR_CPUS=32 Maple
> Modules linked in:
> NIP: c00000000004d948 LR: c00000000004d8e4 CTR: c000000000029308
> REGS: c00000000088b8e0 TRAP: 0300   Not tainted  (2.6.23-rc1)
> MSR: 9000000000001032 <ME,IR,DR>  CR: 24000022  XER: 000fffff
> DAR: d000080000001070, DSISR: 0000000042000000
> TASK = c00000000079db50[0] 'swapper' THREAD: c000000000888000 CPU: 0
> GPR00: d000080000000000 c00000000088bb60 c0000000008884a8 000000000000000a 
> GPR04: d000080000001070 0000000000000001 0000000000000000 0000000000000001 
> GPR08: 0000000000001070 d000080000001070 0000000000000000 c0000000008b33b0 
> GPR12: c00000000088bab4 c00000000079e480 0000000000000000 0000000000000000 
> GPR16: 0000000004000000 0000000000000000 0000000000000000 4000000001400000 
> GPR20: c000000000752370 0000000001b525e0 0000000000000000 c0000000008b47f0 
> GPR24: c00000000088be70 c0000000008b4820 000000003b9aca00 c0000000008b47f8 
> GPR28: 0000000000000000 000000000000000a c000000000821af8 c00000000088bcf0 
> NIP [c00000000004d948] .maple_clock_read+0x88/0x17c
> LR [c00000000004d8e4] .maple_clock_read+0x24/0x17c
> Call Trace:
> [c00000000088bb60] [c00000000088bbe0] init_thread_union+0x3be0/0x4000 (unreliable)
> [c00000000088bbf0] [c00000000004dc40] .maple_get_rtc_time+0x28/0x174
> [c00000000088bc80] [c000000000731000] .maple_get_boot_time+0xe4/0x12c
> [c00000000088bd60] [c000000000022694] .get_boot_time+0x3c/0xb8
> [c00000000088be00] [c000000000721088] .time_init+0x290/0x46c
> [c00000000088bee0] [c000000000716c18] .start_kernel+0x23c/0x3e4
> [c00000000088bf90] [c000000000008524] .start_here_common+0x54/0xb0
> Instruction dump:
> 419e0024 e80a0000 f8410028 7c0903a6 e96a0010 e84a0008 4e800421 e8410028 
> 4800001c 78892300 7929e002 7c0004ac <98690000> 38000001 980d01dc e97e8008 
> Kernel panic - not syncing: Attempted to kill the idle task!
> ------------[ cut here ]------------
> Badness at arch/powerpc/kernel/smp.c:202
> NIP: c000000000028ae0 LR: c000000000069410 CTR: c000000000029308
> REGS: c00000000088b2b0 TRAP: 0700   Tainted: G      D  (2.6.23-rc1)
> MSR: 9000000000021032 <ME,IR,DR>  CR: 28000022  XER: 000fffff
> TASK = c00000000079db50[0] 'swapper' THREAD: c000000000888000 CPU: 0
> GPR00: 0000000000000001 c00000000088b530 c0000000008884a8 c000000000841418 
> GPR04: 0000000000000000 0000000000000001 0000000000000000 0000000000000001 
> GPR08: 0000000000000001 c0000000008b4b88 c0000000008c1af8 c000000000841418 
> GPR12: c000000000008524 c00000000079e480 0000000000000000 0000000000000000 
> GPR16: 0000000004000000 0000000000000000 0000000000000000 4000000001400000 
> GPR20: c000000000752370 0000000001b525e0 0000000000000000 c0000000008b47f0 
> GPR24: c00000000088be70 000000000000000b 000000003b9aca00 000000000000000b 
> GPR28: c0000000006778f0 0000000000000000 c000000000822a98 0000000000000000 
> NIP [c000000000028ae0] .smp_call_function_map+0x30/0x2a4
> LR [c000000000069410] .panic+0x98/0x1b0
> Call Trace:
> [c00000000088b530] [c00000000082ebe8] gss_kerberos_pfs+0x16e18/0x25ff0 (unreliable)
> [c00000000088b5e0] [c000000000069410] .panic+0x98/0x1b0
> [c00000000088b680] [c00000000006dffc] .do_exit+0x8c/0xa60
> [c00000000088b750] [c000000000023dcc] .die+0x238/0x264
> [c00000000088b7f0] [c00000000002d2a8] .bad_page_fault+0xb8/0xd4
> [c00000000088b870] [c000000000005418] handle_page_fault+0x3c/0x58
> --- Exception: 300 at .maple_clock_read+0x88/0x17c
>     LR = .maple_clock_read+0x24/0x17c
> [c00000000088bb60] [c00000000088bbe0] init_thread_union+0x3be0/0x4000 (unreliable)
> [c00000000088bbf0] [c00000000004dc40] .maple_get_rtc_time+0x28/0x174
> [c00000000088bc80] [c000000000731000] .maple_get_boot_time+0xe4/0x12c
> [c00000000088bd60] [c000000000022694] .get_boot_time+0x3c/0xb8
> [c00000000088be00] [c000000000721088] .time_init+0x290/0x46c
> [c00000000088bee0] [c000000000716c18] .start_kernel+0x23c/0x3e4
> [c00000000088bf90] [c000000000008524] .start_here_common+0x54/0xb0
> Instruction dump:
> 7c0802a6 fba1ffe8 fbc1fff0 fbe1fff8 7c6b1b78 f8010010 f821ff51 7cdd3378 
> f8e10100 880d01da 7c000074 7800d182 <0b000000> e922a900 3860ffff e8090000 
> Rebooting in 180 seconds..
> 
> 
> 		Adrian
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH 1/3] Add a new member name to structure irq_host
From: Benjamin Herrenschmidt @ 2007-07-23 22:04 UTC (permalink / raw)
  To: Chen Gong; +Cc: linuxppc-dev, paulus
In-Reply-To: <11851892311178-git-send-email-g.chen@freescale.com>

On Mon, 2007-07-23 at 19:13 +0800, Chen Gong wrote:
> This patch adds a new member 'name' for irq host's name to
> structure irq_host and modifies the definition of the
> function irq_alloc_host(). The assignment to the
> irq host's name is also added to irq_alloc_host().

I would instead prefer adding a irq_name callback to host, which would
return a per-irq name. In some cases, they could return the OF path to
the host for example.

Ben.

> Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> Signed-off-by: Chen Gong <G.Chen@freescale.com>
> ---
>  arch/powerpc/kernel/irq.c |    4 +++-
>  include/asm-powerpc/irq.h |    4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index 2fc8786..2c46c6d 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -421,7 +421,8 @@ EXPORT_SYMBOL_GPL(virq_to_hw);
>  struct irq_host *irq_alloc_host(unsigned int revmap_type,
>  				unsigned int revmap_arg,
>  				struct irq_host_ops *ops,
> -				irq_hw_number_t inval_irq)
> +				irq_hw_number_t inval_irq,
> +				const char *name)
>  {
>  	struct irq_host *host;
>  	unsigned int size = sizeof(struct irq_host);
> @@ -446,6 +447,7 @@ struct irq_host *irq_alloc_host(unsigned int revmap_type,
>  	host->revmap_type = revmap_type;
>  	host->inval_irq = inval_irq;
>  	host->ops = ops;
> +	host->name = name;
>  
>  	spin_lock_irqsave(&irq_big_lock, flags);
>  
> diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
> index 0485c53..cd0ba2d 100644
> --- a/include/asm-powerpc/irq.h
> +++ b/include/asm-powerpc/irq.h
> @@ -124,6 +124,7 @@ struct irq_host {
>  	struct irq_host_ops	*ops;
>  	void			*host_data;
>  	irq_hw_number_t		inval_irq;
> +	const char		*name;
>  };
>  
>  /* The main irq map itself is an array of NR_IRQ entries containing the
> @@ -159,7 +160,8 @@ extern irq_hw_number_t virq_to_hw(unsigned int virq);
>  extern struct irq_host *irq_alloc_host(unsigned int revmap_type,
>  				       unsigned int revmap_arg,
>  				       struct irq_host_ops *ops,
> -				       irq_hw_number_t inval_irq);
> +				       irq_hw_number_t inval_irq,
> +				       const char *name);
>  
> 
>  /**

^ permalink raw reply

* Re: [PATCH 23/25] [POWERPC] 85xxCDS: MPC8548 DTS cleanup.
From: Scott Wood @ 2007-07-23 21:30 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <11852238472931-git-send-email-galak@kernel.crashing.org>

Kumar Gala wrote:
> +			pci_bridge@1c {

The OF PCI specification recommends "pci" here rather than "pci_bridge".
In any case, we should prefer dashes to underscores in device trees.

-Scott

^ permalink raw reply

* Please pull from 'for_paulus' branch
From: Kumar Gala @ 2007-07-23 21:01 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Please pull from 'for_paulus' branch of

	master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git for_paulus

Sorry I wasn't able to get this pull request out before -rc1 got released,
but had some issues w/accessing email/accounts this weekend.

to receive the following updates:

 arch/powerpc/Kconfig                             |    9
 arch/powerpc/boot/dts/mpc8313erdb.dts            |    2
 arch/powerpc/boot/dts/mpc832x_mds.dts            |    2
 arch/powerpc/boot/dts/mpc832x_rdb.dts            |    2
 arch/powerpc/boot/dts/mpc8349emitx.dts           |    4
 arch/powerpc/boot/dts/mpc8349emitxgp.dts         |    2
 arch/powerpc/boot/dts/mpc834x_mds.dts            |    4
 arch/powerpc/boot/dts/mpc836x_mds.dts            |    2
 arch/powerpc/boot/dts/mpc8540ads.dts             |    2
 arch/powerpc/boot/dts/mpc8541cds.dts             |    4
 arch/powerpc/boot/dts/mpc8544ds.dts              |  211 ++++++++++++++
 arch/powerpc/boot/dts/mpc8548cds.dts             |  250 ++++++++++++-----
 arch/powerpc/boot/dts/mpc8555cds.dts             |    4
 arch/powerpc/boot/dts/mpc8560ads.dts             |    2
 arch/powerpc/boot/dts/mpc8568mds.dts             |   54 +++
 arch/powerpc/boot/dts/mpc8641_hpcn.dts           |    8
 arch/powerpc/configs/mpc8544_ds_defconfig        |  333 ++++++++++++++---------
 arch/powerpc/configs/mpc8568mds_defconfig        |  292 ++++++++++++--------
 arch/powerpc/kernel/pci_32.c                     |   25 +
 arch/powerpc/platforms/82xx/mpc82xx_ads.c        |    3
 arch/powerpc/platforms/83xx/pci.c                |    4
 arch/powerpc/platforms/85xx/Kconfig              |    6
 arch/powerpc/platforms/85xx/Makefile             |    2
 arch/powerpc/platforms/85xx/mpc8544_ds.c         |  241 ++++++++++++++++
 arch/powerpc/platforms/85xx/mpc85xx.h            |    1
 arch/powerpc/platforms/85xx/mpc85xx_ads.c        |    3
 arch/powerpc/platforms/85xx/mpc85xx_cds.c        |  122 +++++++-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c        |    7
 arch/powerpc/platforms/85xx/pci.c                |   91 ------
 arch/powerpc/platforms/86xx/Kconfig              |    3
 arch/powerpc/platforms/86xx/Makefile             |    1
 arch/powerpc/platforms/86xx/mpc86xx.h            |    5
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c       |   13
 arch/powerpc/platforms/86xx/pci.c                |  238 ----------------
 arch/powerpc/platforms/chrp/pci.c                |    7
 arch/powerpc/platforms/embedded6xx/linkstation.c |    2
 arch/powerpc/sysdev/Makefile                     |    1
 arch/powerpc/sysdev/fsl_pci.c                    |  257 +++++++++++++++++
 arch/powerpc/sysdev/fsl_pci.h                    |   88 ++++++
 arch/powerpc/sysdev/fsl_pcie.h                   |   94 ------
 arch/powerpc/sysdev/grackle.c                    |    2
 arch/powerpc/sysdev/indirect_pci.c               |   53 ++-
 arch/powerpc/sysdev/mpic.c                       |    1
 arch/powerpc/sysdev/mv64x60_pci.c                |    2
 include/asm-powerpc/pci-bridge.h                 |   18 +
 include/linux/pci_ids.h                          |   17 +
 46 files changed, 1664 insertions(+), 830 deletions(-)

Jon Loeliger (1):
      [POWERPC] Add Freescale PCI VENDOR ID and 8641 device IDs

Kumar Gala (12):
      [POWERPC] Add the ability to find PCI capabilities early on
      [POWERPC] Added indirect quirk to handle PCIe PHB that have issue w/no link
      [POWERPC] FSL: Cleanup how we detect if we are a PCIe controller
      [POWERPC] Fixup resources on pci_bus for PCIe PHB when no device is connected
      [POWERPC] 85xx: Added 8568 PCIe support
      [POWERPC] 85xx: Add quirk to ignore bogus FPGA on CDS
      [POWERPC] Removed setup_indirect_pci_nomap
      [POWERPC] Make endianess of cfg_addr for indirect pci ops runtime
      [POWERPC] Provide ability to setup P2P bridge registers from struct resource
      [POWERPC] Make sure virtual P2P bridge registers are setup on PCIe PHB
      [POWERPC] FSL: Add support for PCI-X controllers
      [POWERPC] 85xx: Added needed MPC85xx PCI device IDs

Randy Vinson (5):
      [POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.
      [POWERPC] 85xxCDS: Make sure restart resets the PCI bus.
      [POWERPC] 85xxCDS: Delay 8259 cascade hookup.
      [POWERPC] 85xxCDS: Misc 8548 PCI Corrections.
      [POWERPC] 85xxCDS: MPC8548 DTS cleanup.

Roy Zang (6):
      [POWERPC] Create common fsl pci/e files based on 86xx platforms
      [POWERPC] Add 8548 CDS PCI express controller node and PCI-X device node
      [POWERPC] Update PCI nodes in the 83xx/85xx boards device tree
      [POWERPC] Use Freescale pci/pcie common code for 85xx boards
      [POWERPC] Add basic PCI node for mpc8568mds board
      [POWERPC] Add basic PCI/PCI Express support for 8544DS board

Zang Roy-r61911 (1):
      [POWERPC] Rewrite Freescale PCI/PCIe support for 8{3,5,6}xx

^ permalink raw reply

* [PATCH 24/25] [POWERPC] Add Freescale PCI VENDOR ID and 8641 device IDs
From: Kumar Gala @ 2007-07-23 20:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <11852238472931-git-send-email-galak@kernel.crashing.org>

From: Jon Loeliger <jdl@freescale.com>

Also add 8641/8641D device IDs as well.
All of which already exist or have been submitted to
The Linux PCI ID Repository at:
    http://pci-ids.ucw.cz/

CC-to: pci-ids@ucw.cz
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/sysdev/fsl_pci.c |    4 ++--
 include/linux/pci_ids.h       |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 06a2a9b..267edbd 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -253,5 +253,5 @@ DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0024, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0025, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0030, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0031, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x7010, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x7011, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_transparent);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index cbabb9c..3c870f1 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2075,6 +2075,10 @@
 #define PCI_VENDOR_ID_TDI               0x192E
 #define PCI_DEVICE_ID_TDI_EHCI          0x0101
 
+#define PCI_VENDOR_ID_FREESCALE		0x1957
+#define PCI_DEVICE_ID_MPC8641		0x7010
+#define PCI_DEVICE_ID_MPC8641D		0x7011
+
 #define PCI_VENDOR_ID_PASEMI		0x1959
 
 #define PCI_VENDOR_ID_ATTANSIC		0x1969
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 23/25] [POWERPC] 85xxCDS: MPC8548 DTS cleanup.
From: Kumar Gala @ 2007-07-23 20:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <11852238452609-git-send-email-galak@kernel.crashing.org>

From: Randy Vinson <rvinson@mvista.com>

Added the P2P bridge present on the Arcadia base board and moved the VIA
Southbridge behind the bridge to reflect its actual position in the bus
organization. Added the RTC that's in the VIA Southbridge and expanded
the ranges array for the SOC node to allow proper address translation of
the RTC registers.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/boot/dts/mpc8548cds.dts |  124 ++++++++++++++++++++++++----------
 1 files changed, 89 insertions(+), 35 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index 4770a5b..d215d21 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -44,8 +44,14 @@
 		#size-cells = <1>;
 		#interrupt-cells = <2>;
 		device_type = "soc";
-		ranges = <0 e0000000 00100000>;
-		reg = <e0000000 00100000>;	// CCSRBAR 1M
+		ranges = <00001000 e0001000 000ff000
+			  80000000 80000000 10000000
+			  e2000000 e2000000 00800000
+			  90000000 90000000 10000000
+			  e2800000 e2800000 00800000
+			  a0000000 a0000000 20000000
+		          e3000000 e3000000 01000000>;
+		reg = <e0000000 00001000>;	// CCSRBAR
 		bus-frequency = <0>;
 
 		memory-controller@2000 {
@@ -162,8 +168,8 @@
 		serial@4500 {
 			device_type = "serial";
 			compatible = "ns16550";
-			reg = <4500 100>; 	// reg base, size
-			clock-frequency = <0>; 	// should we fill in in uboot?
+			reg = <4500 100>;	// reg base, size
+			clock-frequency = <0>;	// should we fill in in uboot?
 			interrupts = <2a 2>;
 			interrupt-parent = <&mpic>;
 		};
@@ -172,7 +178,7 @@
 			device_type = "serial";
 			compatible = "ns16550";
 			reg = <4600 100>;	// reg base, size
-			clock-frequency = <0>; 	// should we fill in in uboot?
+			clock-frequency = <0>;	// should we fill in in uboot?
 			interrupts = <2a 2>;
 			interrupt-parent = <&mpic>;
 		};
@@ -183,8 +189,8 @@
 			fsl,has-rstcr;
 		};
 
-		pci1: pci@8000 {
-			interrupt-map-mask = <1f800 0 0 7>;
+		pci@8000 {
+			interrupt-map-mask = <f800 0 0 7>;
 			interrupt-map = <
 				/* IDSEL 0x4 (PCIX Slot 2) */
 				02000 0 0 1 &mpic 0 1
@@ -244,19 +250,7 @@
 				0E000 0 0 1 &mpic 0 1
 				0E000 0 0 2 &mpic 1 1
 				0E000 0 0 3 &mpic 2 1
-				0E000 0 0 4 &mpic 3 1
-
-				/* bus 1 , idsel 0x2 Tsi310 bridge secondary */
-				11000 0 0 1 &mpic 2 1
-				11000 0 0 2 &mpic 3 1
-				11000 0 0 3 &mpic 0 1
-				11000 0 0 4 &mpic 1 1
-
-				/* VIA chip */
-				12000 0 0 1 &mpic 0 1
-				12000 0 0 2 &mpic 1 1
-				12000 0 0 3 &mpic 2 1
-				12000 0 0 4 &mpic 3 1>;
+				0E000 0 0 4 &mpic 3 1>;
 
 			interrupt-parent = <&mpic>;
 			interrupts = <18 2>;
@@ -271,18 +265,78 @@
 			compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
 			device_type = "pci";
 
-			i8259@4 {
-				clock-frequency = <0>;
-				interrupt-controller;
-				device_type = "interrupt-controller";
-				reg = <12000 0 0 0 1>;
-				#address-cells = <0>;
-				#interrupt-cells = <2>;
-				built-in;
-				compatible = "chrp,iic";
-				big-endian;
-				interrupts = <1>;
-				interrupt-parent = <&pci1>;
+			pci_bridge@1c {
+				interrupt-map-mask = <f800 0 0 7>;
+				interrupt-map = <
+
+					/* IDSEL 0x00 (PrPMC Site) */
+					0000 0 0 1 &mpic 0 1
+					0000 0 0 2 &mpic 1 1
+					0000 0 0 3 &mpic 2 1
+					0000 0 0 4 &mpic 3 1
+
+					/* IDSEL 0x04 (VIA chip) */
+					2000 0 0 1 &mpic 0 1
+					2000 0 0 2 &mpic 1 1
+					2000 0 0 3 &mpic 2 1
+					2000 0 0 4 &mpic 3 1
+
+					/* IDSEL 0x05 (8139) */
+					2800 0 0 1 &mpic 1 1
+
+					/* IDSEL 0x06 (Slot 6) */
+					3000 0 0 1 &mpic 2 1
+					3000 0 0 2 &mpic 3 1
+					3000 0 0 3 &mpic 0 1
+					3000 0 0 4 &mpic 1 1
+
+					/* IDESL 0x07 (Slot 7) */
+					3800 0 0 1 &mpic 3 1
+					3800 0 0 2 &mpic 0 1
+					3800 0 0 3 &mpic 1 1
+					3800 0 0 4 &mpic 2 1>;
+
+				reg = <e000 0 0 0 0>;
+				#interrupt-cells = <1>;
+				#size-cells = <2>;
+				#address-cells = <3>;
+				ranges = <02000000 0 80000000
+					  02000000 0 80000000
+					  0 20000000
+					  01000000 0 00000000
+					  01000000 0 00000000
+					  0 00080000>;
+				clock-frequency = <1fca055>;
+
+				isa@4 {
+					device_type = "isa";
+					#interrupt-cells = <2>;
+					#size-cells = <1>;
+					#address-cells = <2>;
+					reg = <2000 0 0 0 0>;
+					ranges = <1 0 01000000 0 0 00001000>;
+					interrupt-parent = <&i8259>;
+
+					i8259: interrupt-controller@20 {
+						clock-frequency = <0>;
+						interrupt-controller;
+						device_type = "interrupt-controller";
+						reg = <1 20 2
+						       1 a0 2
+						       1 4d0 2>;
+						#address-cells = <0>;
+						#interrupt-cells = <2>;
+						built-in;
+						compatible = "chrp,iic";
+						interrupts = <0 1>;
+						interrupt-parent = <&mpic>;
+					};
+
+					rtc@70 {
+						compatible = "pnpPNP,b00";
+						reg = <1 70 2>;
+					};
+				};
 			};
 		};
 
@@ -292,9 +346,9 @@
 
 				/* IDSEL 0x15 */
 				a800 0 0 1 &mpic b 1
-				a800 0 0 2 &mpic b 1
-				a800 0 0 3 &mpic b 1
-				a800 0 0 4 &mpic b 1>;
+				a800 0 0 2 &mpic 1 1
+				a800 0 0 3 &mpic 2 1
+				a800 0 0 4 &mpic 3 1>;
 
 			interrupt-parent = <&mpic>;
 			interrupts = <19 2>;
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 22/25] [POWERPC] 85xxCDS: Misc 8548 PCI Corrections.
From: Kumar Gala @ 2007-07-23 20:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <11852238432011-git-send-email-galak@kernel.crashing.org>

From: Randy Vinson <rvinson@mvista.com>

Setting the host bridge @8000 as primary. Also fixing a bug in
setting the USB interrupt numbers.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 902a61a..3421d60 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -129,7 +129,7 @@ static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
 		/* There are two USB controllers.
 		 * Identify them by functon number
 		 */
-			if (PCI_FUNC(dev->devfn))
+			if (PCI_FUNC(dev->devfn) == 3)
 				dev->irq = 11;
 			else
 				dev->irq = 10;
@@ -297,10 +297,10 @@ static void __init mpc85xx_cds_setup_arch(void)
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
 		struct resource rsrc;
 		of_address_to_resource(np, 0, &rsrc);
-		if ((rsrc.start & 0xfffff) == 0x9000)
-			fsl_add_bridge(np, 0);
-		else
+		if ((rsrc.start & 0xfffff) == 0x8000)
 			fsl_add_bridge(np, 1);
+		else
+			fsl_add_bridge(np, 0);
 	}
 	ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
 	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 21/25] [POWERPC] 85xxCDS: Delay 8259 cascade hookup.
From: Kumar Gala @ 2007-07-23 20:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <11852238421611-git-send-email-galak@kernel.crashing.org>

From: Randy Vinson <rvinson@mvista.com>

The interrupts of an E100 card inserted in PCI slot 4 may be on at bootup.
The resulting interrupt flood interacts with the 8259 cascade handler and
prevents proper boot up. There is a quirk for the E100 that will disable
the E100's interrupts but to use it, the 8259 cascade hookup must be
delayed until after the quirk has run. This patch delays the 8259 cascade
hookup by registering a device_initcall() which runs after the PCI quirk
for the E100.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |   33 +++++++++++++++++++---------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index e77c869..902a61a 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -183,10 +183,6 @@ static void __init mpc85xx_cds_pic_init(void)
 	struct mpic *mpic;
 	struct resource r;
 	struct device_node *np = NULL;
-#if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
-	struct device_node *cascade_node = NULL;
-	int cascade_irq;
-#endif
 
 	np = of_find_node_by_type(np, "open-pic");
 
@@ -210,8 +206,16 @@ static void __init mpc85xx_cds_pic_init(void)
 	of_node_put(np);
 
 	mpic_init(mpic);
+}
 
 #if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
+static int mpc85xx_cds_8259_attach(void)
+{
+	int ret;
+	struct device_node *np = NULL;
+	struct device_node *cascade_node = NULL;
+	int cascade_irq;
+
 	/* Initialize the i8259 controller */
 	for_each_node_by_type(np, "interrupt-controller")
 		if (of_device_is_compatible(np, "chrp,iic")) {
@@ -221,13 +225,13 @@ static void __init mpc85xx_cds_pic_init(void)
 
 	if (cascade_node == NULL) {
 		printk(KERN_DEBUG "Could not find i8259 PIC\n");
-		return;
+		return -ENODEV;
 	}
 
 	cascade_irq = irq_of_parse_and_map(cascade_node, 0);
 	if (cascade_irq == NO_IRQ) {
 		printk(KERN_ERR "Failed to map cascade interrupt\n");
-		return;
+		return -ENXIO;
 	}
 
 	i8259_init(cascade_node, 0);
@@ -239,14 +243,21 @@ static void __init mpc85xx_cds_pic_init(void)
 	 *  disabled when the last user of the shared IRQ line frees their
 	 *  interrupt.
 	 */
-	if (setup_irq(cascade_irq, &mpc85xxcds_8259_irqaction))
+	if ((ret = setup_irq(cascade_irq, &mpc85xxcds_8259_irqaction))) {
 		printk(KERN_ERR "Failed to setup cascade interrupt\n");
-	else
-		/* Success. Connect our low-level cascade handler. */
-		set_irq_handler(cascade_irq, mpc85xx_8259_cascade_handler);
-#endif /* CONFIG_PPC_I8259 */
+		return ret;
+	}
+
+	/* Success. Connect our low-level cascade handler. */
+	set_irq_handler(cascade_irq, mpc85xx_8259_cascade_handler);
+
+	return 0;
 }
 
+device_initcall(mpc85xx_cds_8259_attach);
+
+#endif /* CONFIG_PPC_I8259 */
+
 /*
  * Setup the architecture
  */
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 20/25] [POWERPC] 85xxCDS: Make sure restart resets the PCI bus.
From: Kumar Gala @ 2007-07-23 20:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <11852238411823-git-send-email-galak@kernel.crashing.org>

From: Randy Vinson <rvinson@linuxbox.(none)>

The current 85xxCDS restart code fails to reset the PCI bus which can
lead to odd behavior after the restart. This patch uses the VIA Super
Southbridge to perform a PCI reset which will reset the entire system.
NOTE: Since the VIA chip is behind a PCI-to-PCI bridge which can be
disabled with a switch setting, it may not be possible to perform the
PCI bus reset. In this case, the code defaults to the previous restart
mechanism.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |   35 +++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 81b7062..e77c869 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -69,6 +69,37 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
 		return PCIBIOS_SUCCESSFUL;
 }
 
+static void mpc85xx_cds_restart(char *cmd)
+{
+	struct pci_dev *dev;
+	u_char tmp;
+
+	if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686,
+					NULL))) {
+
+		/* Use the VIA Super Southbridge to force a PCI reset */
+		pci_read_config_byte(dev, 0x47, &tmp);
+		pci_write_config_byte(dev, 0x47, tmp | 1);
+
+		/* Flush the outbound PCI write queues */
+		pci_read_config_byte(dev, 0x47, &tmp);
+
+		/*
+		 *  At this point, the harware reset should have triggered.
+		 *  However, if it doesn't work for some mysterious reason,
+		 *  just fall through to the default reset below.
+		 */
+
+		pci_dev_put(dev);
+	}
+
+	/*
+	 *  If we can't find the VIA chip (maybe the P2P bridge is disabled)
+	 *  or the VIA chip reset didn't work, just use the default reset.
+	 */
+	mpc85xx_restart(NULL);
+}
+
 static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
 {
 	u_char c;
@@ -304,7 +335,11 @@ define_machine(mpc85xx_cds) {
 	.init_IRQ	= mpc85xx_cds_pic_init,
 	.show_cpuinfo	= mpc85xx_cds_show_cpuinfo,
 	.get_irq	= mpic_get_irq,
+#ifdef CONFIG_PCI
+	.restart	= mpc85xx_cds_restart,
+#else
 	.restart	= mpc85xx_restart,
+#endif
 	.calibrate_decr = generic_calibrate_decr,
 	.progress	= udbg_progress,
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 25/25] [POWERPC] 85xx: Added needed MPC85xx PCI device IDs
From: Kumar Gala @ 2007-07-23 20:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <11852238481049-git-send-email-galak@kernel.crashing.org>

Added the MPC85xx PCI device IDs that we need for the quirks we have.

Also, fixed the MPC8567E, MPC8567 device IDs which had the wrong value.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/sysdev/fsl_pci.c |   26 +++++++++++++-------------
 include/linux/pci_ids.h       |   13 +++++++++++++
 2 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 267edbd..9298da8 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -240,18 +240,18 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
 	return 0;
 }
 
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0012, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0013, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0014, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0015, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0018, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0019, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x001a, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0020, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0021, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0024, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0025, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0030, quirk_fsl_pcie_transparent);
-DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0031, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8548E, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8548, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8543E, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8543, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_transparent);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3c870f1..c086a70 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2076,6 +2076,19 @@
 #define PCI_DEVICE_ID_TDI_EHCI          0x0101
 
 #define PCI_VENDOR_ID_FREESCALE		0x1957
+#define PCI_DEVICE_ID_MPC8548E		0x0012
+#define PCI_DEVICE_ID_MPC8548		0x0013
+#define PCI_DEVICE_ID_MPC8543E		0x0014
+#define PCI_DEVICE_ID_MPC8543		0x0015
+#define PCI_DEVICE_ID_MPC8547E		0x0018
+#define PCI_DEVICE_ID_MPC8545E		0x0019
+#define PCI_DEVICE_ID_MPC8545		0x001a
+#define PCI_DEVICE_ID_MPC8568E		0x0020
+#define PCI_DEVICE_ID_MPC8568		0x0021
+#define PCI_DEVICE_ID_MPC8567E		0x0022
+#define PCI_DEVICE_ID_MPC8567		0x0023
+#define PCI_DEVICE_ID_MPC8544E		0x0030
+#define PCI_DEVICE_ID_MPC8544		0x0031
 #define PCI_DEVICE_ID_MPC8641		0x7010
 #define PCI_DEVICE_ID_MPC8641D		0x7011
 
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 19/25] [POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.
From: Kumar Gala @ 2007-07-23 20:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <11852238392809-git-send-email-galak@kernel.crashing.org>

From: Randy Vinson <rvinson@mvista.com>

The Freescale MPC8555CDS and MPC8548CDS reference hardware has a legacy
8259 interrupt controller pair contained within a VIA VT82C686B Southbridge
on the main carrier board. The processor complex plugs into the carrier
card using a PCI slot which limits the available interrupts to the
INTA-INTD PCI interrupts. The output of the 8259 cascade pair is routed
through a gate array and connected to the PCI INTA interrupt line.
The normal interrupt chaining hook (set_irq_chained_handler) does
not allow sharing of the chained interrupt which prevents the
use of PCI INTA by PCI devices. This patch allows the 8259 cascade
pair to share their interrupt line with PCI devices.

NOTE: The addition of the .end routine for the MPIC is not strictly
necessary for this patch. It's there so this code will run from within
the threaded interrupt context used by the Real Time patch.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/85xx/Kconfig       |    1 +
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |   37 ++++++++++++++++++++++++----
 arch/powerpc/sysdev/mpic.c                |    1 +
 3 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 99bb74d..f581840 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -18,6 +18,7 @@ config MPC8560_ADS
 config MPC85xx_CDS
 	bool "Freescale MPC85xx CDS"
 	select DEFAULT_UIMAGE
+	select PPC_I8259
 	help
 	  This option enables support for the MPC85xx CDS board
 
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 71200bd..81b7062 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -24,6 +24,7 @@
 #include <linux/seq_file.h>
 #include <linux/initrd.h>
 #include <linux/module.h>
+#include <linux/interrupt.h>
 #include <linux/fsl_devices.h>
 
 #include <asm/system.h>
@@ -119,16 +120,30 @@ DECLARE_PCI_FIXUP_EARLY(0x3fff, 0x1957, skip_fake_bridge);
 DECLARE_PCI_FIXUP_EARLY(0xff3f, 0x5719, skip_fake_bridge);
 
 #ifdef CONFIG_PPC_I8259
-#warning The i8259 PIC support is currently broken
-static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
+static void mpc85xx_8259_cascade_handler(unsigned int irq,
+					 struct irq_desc *desc)
 {
 	unsigned int cascade_irq = i8259_irq();
 
 	if (cascade_irq != NO_IRQ)
+		/* handle an interrupt from the 8259 */
 		generic_handle_irq(cascade_irq);
 
-	desc->chip->eoi(irq);
+	/* check for any interrupts from the shared IRQ line */
+	handle_fasteoi_irq(irq, desc);
 }
+
+static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id)
+{
+	return IRQ_HANDLED;
+}
+
+static struct irqaction mpc85xxcds_8259_irqaction = {
+	.handler = mpc85xx_8259_cascade_action,
+	.flags = IRQF_SHARED,
+	.mask = CPU_MASK_NONE,
+	.name = "8259 cascade",
+};
 #endif /* PPC_I8259 */
 #endif /* CONFIG_PCI */
 
@@ -137,7 +152,7 @@ static void __init mpc85xx_cds_pic_init(void)
 	struct mpic *mpic;
 	struct resource r;
 	struct device_node *np = NULL;
-#ifdef CONFIG_PPC_I8259
+#if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
 	struct device_node *cascade_node = NULL;
 	int cascade_irq;
 #endif
@@ -165,7 +180,7 @@ static void __init mpc85xx_cds_pic_init(void)
 
 	mpic_init(mpic);
 
-#ifdef CONFIG_PPC_I8259
+#if defined(CONFIG_PPC_I8259) && defined(CONFIG_PCI)
 	/* Initialize the i8259 controller */
 	for_each_node_by_type(np, "interrupt-controller")
 		if (of_device_is_compatible(np, "chrp,iic")) {
@@ -187,7 +202,17 @@ static void __init mpc85xx_cds_pic_init(void)
 	i8259_init(cascade_node, 0);
 	of_node_put(cascade_node);
 
-	set_irq_chained_handler(cascade_irq, mpc85xx_8259_cascade);
+	/*
+	 *  Hook the interrupt to make sure desc->action is never NULL.
+	 *  This is required to ensure that the interrupt does not get
+	 *  disabled when the last user of the shared IRQ line frees their
+	 *  interrupt.
+	 */
+	if (setup_irq(cascade_irq, &mpc85xxcds_8259_irqaction))
+		printk(KERN_ERR "Failed to setup cascade interrupt\n");
+	else
+		/* Success. Connect our low-level cascade handler. */
+		set_irq_handler(cascade_irq, mpc85xx_8259_cascade_handler);
 #endif /* CONFIG_PPC_I8259 */
 }
 
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 74c64c0..17ece50 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -836,6 +836,7 @@ static struct irq_chip mpic_irq_chip = {
 	.mask		= mpic_mask_irq,
 	.unmask		= mpic_unmask_irq,
 	.eoi		= mpic_end_irq,
+	.end		= mpic_unmask_irq,
 	.set_type	= mpic_set_irq_type,
 };
 
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH 15/25] [POWERPC] Add basic PCI/PCI Express support for 8544DS board
From: Kumar Gala @ 2007-07-23 20:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev; +Cc: York Sun
In-Reply-To: <11852238333649-git-send-email-galak@kernel.crashing.org>

From: Roy Zang <tie-fei.zang@freescale.com>

Add basic support for the PCIe PHB and enable the ULI bridge.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/boot/dts/mpc8544ds.dts       |  211 ++++++++++++++++++
 arch/powerpc/configs/mpc8544_ds_defconfig |  333 ++++++++++++++++++-----------
 arch/powerpc/platforms/85xx/Kconfig       |    1 +
 arch/powerpc/platforms/85xx/mpc8544_ds.c  |  241 +++++++++++++++++++++-
 arch/powerpc/sysdev/fsl_pci.c             |    2 +
 5 files changed, 662 insertions(+), 126 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index 8285925..4a900c6 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -137,6 +137,217 @@
 			interrupt-parent = <&mpic>;
 		};
 
+		pci@8000 {
+			compatible = "fsl,mpc8540-pci";
+			device_type = "pci";
+			interrupt-map-mask = <f800 0 0 7>;
+			interrupt-map = <
+
+				/* IDSEL 0x11 J17 Slot 1 */
+				8800 0 0 1 &mpic 2 1
+				8800 0 0 2 &mpic 3 1
+				8800 0 0 3 &mpic 4 1
+				8800 0 0 4 &mpic 1 1
+
+				/* IDSEL 0x12 J16 Slot 2 */
+
+				9000 0 0 1 &mpic 3 1
+				9000 0 0 2 &mpic 4 1
+				9000 0 0 3 &mpic 2 1
+				9000 0 0 4 &mpic 1 1>;
+
+			interrupt-parent = <&mpic>;
+			interrupts = <18 2>;
+			bus-range = <0 ff>;
+			ranges = <02000000 0 80000000 80000000 0 10000000
+				  01000000 0 00000000 e2000000 0 00800000>;
+			clock-frequency = <3f940aa>;
+			#interrupt-cells = <1>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			reg = <8000 1000>;
+		};
+
+		pcie@9000 {
+			compatible = "fsl,mpc8548-pcie";
+			device_type = "pci";
+			#interrupt-cells = <1>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			reg = <9000 1000>;
+			bus-range = <0 ff>;
+			ranges = <02000000 0 90000000 90000000 0 10000000
+				  01000000 0 00000000 e3000000 0 00800000>;
+			clock-frequency = <1fca055>;
+			interrupt-parent = <&mpic>;
+			interrupts = <1a 2>;
+			interrupt-map-mask = <f800 0 0 7>;
+			interrupt-map = <
+				/* IDSEL 0x0 */
+				0000 0 0 1 &mpic 4 1
+				0000 0 0 2 &mpic 5 1
+				0000 0 0 3 &mpic 6 1
+				0000 0 0 4 &mpic 7 1
+				>;
+		};
+
+		pcie@a000 {
+			compatible = "fsl,mpc8548-pcie";
+			device_type = "pci";
+			#interrupt-cells = <1>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			reg = <a000 1000>;
+			bus-range = <0 ff>;
+			ranges = <02000000 0 a0000000 a0000000 0 10000000
+				  01000000 0 00000000 e2800000 0 00800000>;
+			clock-frequency = <1fca055>;
+			interrupt-parent = <&mpic>;
+			interrupts = <19 2>;
+			interrupt-map-mask = <f800 0 0 7>;
+			interrupt-map = <
+				/* IDSEL 0x0 */
+				0000 0 0 1 &mpic 0 1
+				0000 0 0 2 &mpic 1 1
+				0000 0 0 3 &mpic 2 1
+				0000 0 0 4 &mpic 3 1
+				>;
+		};
+
+		pcie@b000 {
+			compatible = "fsl,mpc8548-pcie";
+			device_type = "pci";
+			#interrupt-cells = <1>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			reg = <b000 1000>;
+			bus-range = <0 ff>;
+			ranges = <02000000 0 b0000000 b0000000 0 10000000
+				  01000000 0 00000000 e3800000 0 00800000>;
+			clock-frequency = <1fca055>;
+			interrupt-parent = <&mpic>;
+			interrupts = <1b 2>;
+			interrupt-map-mask = <f800 0 0 7>;
+			interrupt-map = <
+
+				// IDSEL 0x1a
+				d000 0 0 1 &i8259 6 2
+				d000 0 0 2 &i8259 3 2
+				d000 0 0 3 &i8259 4 2
+				d000 0 0 4 &i8259 5 2
+
+				// IDSEL 0x1b
+				d800 0 0 1 &i8259 5 2
+				d800 0 0 2 &i8259 0 0
+				d800 0 0 3 &i8259 0 0
+				d800 0 0 4 &i8259 0 0
+
+				// IDSEL 0x1c  USB
+				e000 0 0 1 &i8259 9 2
+				e000 0 0 2 &i8259 a 2
+				e000 0 0 3 &i8259 c 2
+				e000 0 0 4 &i8259 7 2
+
+				// IDSEL 0x1d  Audio
+				e800 0 0 1 &i8259 9 2
+				e800 0 0 2 &i8259 a 2
+				e800 0 0 3 &i8259 b 2
+				e800 0 0 4 &i8259 0 0
+
+				// IDSEL 0x1e Legacy
+				f000 0 0 1 &i8259 c 2
+				f000 0 0 2 &i8259 0 0
+				f000 0 0 3 &i8259 0 0
+				f000 0 0 4 &i8259 0 0
+
+				// IDSEL 0x1f IDE/SATA
+				f800 0 0 1 &i8259 6 2
+				f800 0 0 2 &i8259 0 0
+				f800 0 0 3 &i8259 0 0
+				f800 0 0 4 &i8259 0 0
+			>;
+			uli1575@0 {
+				reg = <0 0 0 0 0>;
+				#size-cells = <2>;
+				#address-cells = <3>;
+				ranges = <02000000 0 b0000000
+					  02000000 0 b0000000
+					  0 10000000
+					  01000000 0 00000000
+					  01000000 0 00000000
+					  0 00080000>;
+
+				pci_bridge@0 {
+					reg = <0 0 0 0 0>;
+					#size-cells = <2>;
+					#address-cells = <3>;
+					ranges = <02000000 0 b0000000
+						  02000000 0 b0000000
+						  0 20000000
+						  01000000 0 00000000
+						  01000000 0 00000000
+						  0 00100000>;
+
+					isa@1e {
+						device_type = "isa";
+						#interrupt-cells = <2>;
+						#size-cells = <1>;
+						#address-cells = <2>;
+						reg = <f000 0 0 0 0>;
+						ranges = <1 0 01000000 0 0
+							  00001000>;
+						interrupt-parent = <&i8259>;
+
+						i8259: interrupt-controller@20 {
+							reg = <1 20 2
+							       1 a0 2
+							       1 4d0 2>;
+							clock-frequency = <0>;
+							interrupt-controller;
+							device_type = "interrupt-controller";
+							#address-cells = <0>;
+							#interrupt-cells = <2>;
+							built-in;
+							compatible = "chrp,iic";
+							interrupts = <9 2>;
+							interrupt-parent =
+								<&mpic>;
+						};
+
+						i8042@60 {
+							#size-cells = <0>;
+							#address-cells = <1>;
+							reg = <1 60 1 1 64 1>;
+							interrupts = <1 3 c 3>;
+							interrupt-parent =
+								<&i8259>;
+
+							keyboard@0 {
+								reg = <0>;
+								compatible = "pnpPNP,303";
+							};
+
+							mouse@1 {
+								reg = <1>;
+								compatible = "pnpPNP,f03";
+							};
+						};
+
+						rtc@70 {
+							compatible =
+								"pnpPNP,b00";
+							reg = <1 70 2>;
+						};
+
+						gpio@400 {
+							reg = <1 400 80>;
+						};
+					};
+				};
+			};
+
+		};
+
 		mpic: pic@40000 {
 			clock-frequency = <0>;
 			interrupt-controller;
diff --git a/arch/powerpc/configs/mpc8544_ds_defconfig b/arch/powerpc/configs/mpc8544_ds_defconfig
index c40a25a..7995231 100644
--- a/arch/powerpc/configs/mpc8544_ds_defconfig
+++ b/arch/powerpc/configs/mpc8544_ds_defconfig
@@ -1,9 +1,26 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc7
-# Sun Jul  1 23:56:58 2007
+# Linux kernel version: 2.6.22
+# Fri Jul 20 14:09:13 2007
 #
 # CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_85xx=y
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
+# CONFIG_SPE is not set
+# CONFIG_PPC_MM_SLICES is not set
 CONFIG_PPC32=y
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
@@ -14,6 +31,7 @@ CONFIG_ARCH_HAS_ILOG2_U32=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
@@ -25,28 +43,8 @@ CONFIG_PPC_UDBG_16550=y
 CONFIG_AUDIT_ARCH=y
 CONFIG_GENERIC_BUG=y
 CONFIG_DEFAULT_UIMAGE=y
-
-#
-# Processor support
-#
-# CONFIG_CLASSIC32 is not set
-# CONFIG_PPC_82xx is not set
-# CONFIG_PPC_83xx is not set
-CONFIG_PPC_85xx=y
-# CONFIG_PPC_86xx is not set
-# CONFIG_PPC_8xx is not set
-# CONFIG_40x is not set
-# CONFIG_44x is not set
-# CONFIG_E200 is not set
-CONFIG_85xx=y
-CONFIG_E500=y
 # CONFIG_PPC_DCR_NATIVE is not set
 # CONFIG_PPC_DCR_MMIO is not set
-CONFIG_BOOKE=y
-CONFIG_FSL_BOOKE=y
-# CONFIG_PHYS_64BIT is not set
-# CONFIG_SPE is not set
-# CONFIG_PPC_MM_SLICES is not set
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -63,13 +61,12 @@ CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-CONFIG_IPC_NS=y
 CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
 CONFIG_AUDIT=y
 # CONFIG_AUDITSYSCALL is not set
 CONFIG_IKCONFIG=y
@@ -86,7 +83,7 @@ CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
-# CONFIG_HOTPLUG is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
@@ -105,24 +102,17 @@ CONFIG_SLAB=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 CONFIG_LBD=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -153,7 +143,7 @@ CONFIG_MPC8544_DS=y
 CONFIG_MPC85xx=y
 CONFIG_MPIC=y
 # CONFIG_MPIC_WEIRD is not set
-# CONFIG_PPC_I8259 is not set
+CONFIG_PPC_I8259=y
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
 # CONFIG_PPC_MPC106 is not set
@@ -191,6 +181,8 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
 CONFIG_PROC_DEVICETREE=y
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="root=/dev/sda3 rw console=ttyS0,115200"
@@ -205,15 +197,21 @@ CONFIG_ISA_DMA_API=y
 #
 CONFIG_ZONE_DMA=y
 CONFIG_PPC_INDIRECT_PCI=y
-CONFIG_PPC_INDIRECT_PCI_BE=y
 CONFIG_FSL_SOC=y
-# CONFIG_PCI is not set
-# CONFIG_PCI_DOMAINS is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_FSL_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_SYSCALL=y
+# CONFIG_PCIEPORTBUS is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+# CONFIG_PCI_MSI is not set
+# CONFIG_PCI_DEBUG is not set
 
 #
 # PCCARD (PCMCIA/CardBus) support
 #
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
 
 #
 # Advanced setup
@@ -254,7 +252,6 @@ CONFIG_ASK_IP_FIB_HASH=y
 CONFIG_IP_FIB_HASH=y
 CONFIG_IP_MULTIPLE_TABLES=y
 CONFIG_IP_ROUTE_MULTIPATH=y
-# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
 CONFIG_IP_ROUTE_VERBOSE=y
 CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
@@ -330,6 +327,7 @@ CONFIG_FIB_RULES=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -340,45 +338,35 @@ CONFIG_FIB_RULES=y
 #
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 CONFIG_BLK_DEV_NBD=y
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=2
 CONFIG_BLK_DEV_RAM_SIZE=16384
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
-# CONFIG_BLINK is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
 # CONFIG_IDE is not set
 
 #
@@ -386,6 +374,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -422,25 +411,120 @@ CONFIG_SCSI_WAIT_SCAN=m
 # SCSI low-level drivers
 #
 # CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIL24 is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
 # CONFIG_PATA_PLATFORM is not set
+# CONFIG_MD is not set
 
 #
-# Multi-device support (RAID and LVM)
+# Fusion MPT device support
 #
-# CONFIG_MD is not set
-# CONFIG_MACINTOSH_DRIVERS is not set
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
 
 #
-# Network device support
+# IEEE 1394 (FireWire) support
 #
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_ARCNET is not set
 CONFIG_PHYLIB=y
 
 #
@@ -454,17 +538,44 @@ CONFIG_PHYLIB=y
 CONFIG_VITESSE_PHY=y
 # CONFIG_SMSC_PHY is not set
 # CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
 # CONFIG_FIXED_PHY is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
 CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
 CONFIG_GIANFAR=y
 CONFIG_GFAR_NAPI=y
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
 CONFIG_NETDEV_10000=y
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TR is not set
 
 #
 # Wireless LAN
@@ -472,21 +583,16 @@ CONFIG_NETDEV_10000=y
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
 # CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -521,6 +627,7 @@ CONFIG_INPUT=y
 CONFIG_SERIO=y
 CONFIG_SERIO_I8042=y
 CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PCIPS2 is not set
 CONFIG_SERIO_LIBPS2=y
 # CONFIG_SERIO_RAW is not set
 # CONFIG_GAMEPORT is not set
@@ -539,6 +646,7 @@ CONFIG_HW_CONSOLE=y
 #
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
 CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
@@ -550,14 +658,11 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_UARTLITE is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
 # CONFIG_SERIAL_OF_PLATFORM is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
 # CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
@@ -565,12 +670,12 @@ CONFIG_NVRAM=y
 CONFIG_GEN_RTC=y
 CONFIG_GEN_RTC_X=y
 # CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
 
 #
@@ -578,11 +683,8 @@ CONFIG_GEN_RTC_X=y
 #
 # CONFIG_SPI is not set
 # CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
 # CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
 
 #
@@ -655,19 +757,14 @@ CONFIG_DUMMY_CONSOLE=y
 # Sound
 #
 # CONFIG_SOUND is not set
-
-#
-# HID Devices
-#
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
-
-#
-# USB support
-#
-# CONFIG_USB_ARCH_HAS_HCD is not set
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -691,14 +788,7 @@ CONFIG_HID=y
 #
 # LED Triggers
 #
-
-#
-# InfiniBand support
-#
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
+# CONFIG_INFINIBAND is not set
 
 #
 # Real Time Clock
@@ -719,19 +809,13 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_DRV_TEST is not set
 
 #
-# I2C RTC drivers
-#
-
-#
-# SPI RTC drivers
-#
-
-#
 # Platform RTC drivers
 #
+# CONFIG_RTC_DRV_CMOS is not set
 # CONFIG_RTC_DRV_DS1553 is not set
 # CONFIG_RTC_DRV_DS1742 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
 # CONFIG_RTC_DRV_V3020 is not set
 
 #
@@ -752,6 +836,11 @@ CONFIG_RTC_INTF_DEV=y
 #
 
 #
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
+#
 # File systems
 #
 CONFIG_EXT2_FS=y
@@ -859,7 +948,6 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
@@ -941,6 +1029,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_PLIST=y
@@ -965,6 +1054,7 @@ CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
@@ -996,10 +1086,6 @@ CONFIG_FORCED_INLINING=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
@@ -1038,7 +1124,4 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
-
-#
-# Hardware crypto devices
-#
+CONFIG_CRYPTO_HW=y
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 4661fcc..99bb74d 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -30,6 +30,7 @@ config MPC85xx_MDS
 
 config MPC8544_DS
 	bool "Freescale MPC8544 DS"
+	select PPC_I8259
 	select DEFAULT_UIMAGE
 	help
 	  This option enables support for the MPC8544 DS board
diff --git a/arch/powerpc/platforms/85xx/mpc8544_ds.c b/arch/powerpc/platforms/85xx/mpc8544_ds.c
index 6fb90aa..4905f6f 100644
--- a/arch/powerpc/platforms/85xx/mpc8544_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8544_ds.c
@@ -2,6 +2,8 @@
  * MPC8544 DS Board Setup
  *
  * Author Xianghua Xiao (x.xiao@freescale.com)
+ * Roy Zang <tie-fei.zang@freescale.com>
+ * 	- Add PCI/PCI Exprees support
  * Copyright 2007 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
@@ -12,13 +14,16 @@
 
 #include <linux/stddef.h>
 #include <linux/kernel.h>
+#include <linux/pci.h>
 #include <linux/kdev_t.h>
 #include <linux/delay.h>
 #include <linux/seq_file.h>
+#include <linux/interrupt.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
 #include <asm/machdep.h>
+#include <asm/pci-bridge.h>
 #include <asm/mpc85xx.h>
 #include <mm/mmu_decl.h>
 #include <asm/prom.h>
@@ -27,6 +32,7 @@
 #include <asm/i8259.h>
 
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 #include "mpc85xx.h"
 
 #undef DEBUG
@@ -37,6 +43,17 @@
 #define DBG(fmt, args...)
 #endif
 
+#ifdef CONFIG_PPC_I8259
+static void mpc8544_8259_cascade(unsigned int irq, struct irq_desc *desc)
+{
+	unsigned int cascade_irq = i8259_irq();
+
+	if (cascade_irq != NO_IRQ) {
+		generic_handle_irq(cascade_irq);
+	}
+	desc->chip->eoi(irq);
+}
+#endif	/* CONFIG_PPC_I8259 */
 
 void __init mpc8544_ds_pic_init(void)
 {
@@ -96,19 +113,240 @@ void __init mpc8544_ds_pic_init(void)
 #endif	/* CONFIG_PPC_I8259 */
 }
 
+#ifdef CONFIG_PCI
+enum pirq { PIRQA = 8, PIRQB, PIRQC, PIRQD, PIRQE, PIRQF, PIRQG, PIRQH };
+
+/*
+ * Value in  table -- IRQ number
+ */
+const unsigned char uli1575_irq_route_table[16] = {
+	0,		/* 0: Reserved */
+	0x8,
+	0,		/* 2: Reserved */
+	0x2,
+	0x4,
+	0x5,
+	0x7,
+	0x6,
+	0,		/* 8: Reserved */
+	0x1,
+	0x3,
+	0x9,
+	0xb,
+	0,		/* 13: Reserved */
+	0xd,
+	0xf,
+};
+
+static int __devinit
+get_pci_irq_from_of(struct pci_controller *hose, int slot, int pin)
+{
+	struct of_irq oirq;
+	u32 laddr[3];
+	struct device_node *hosenode = hose ? hose->arch_data : NULL;
+
+	if (!hosenode)
+		return -EINVAL;
+
+	laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(slot, 0) << 8);
+	laddr[1] = laddr[2] = 0;
+	of_irq_map_raw(hosenode, &pin, 1, laddr, &oirq);
+	DBG("mpc8544_ds: pci irq addr %x, slot %d, pin %d, irq %d\n",
+	    laddr[0], slot, pin, oirq.specifier[0]);
+	return oirq.specifier[0];
+}
+
+/*8259*/
+static void __devinit quirk_uli1575(struct pci_dev *dev)
+{
+	unsigned short temp;
+	struct pci_controller *hose = pci_bus_to_host(dev->bus);
+	unsigned char irq2pin[16];
+	unsigned long pirq_map_word = 0;
+	u32 irq;
+	int i;
+
+	/*
+	 * ULI1575 interrupts route setup
+	 */
+	memset(irq2pin, 0, 16);	/* Initialize default value 0 */
+
+	irq2pin[6]=PIRQA+3;	/* enabled mapping for IRQ6 to PIRQD, used by SATA */
+
+	/*
+	 * PIRQE -> PIRQF mapping set manually
+	 *
+	 * IRQ pin   IRQ#
+	 * PIRQE ---- 9
+	 * PIRQF ---- 10
+	 * PIRQG ---- 11
+	 * PIRQH ---- 12
+	 */
+	for (i = 0; i < 4; i++)
+		irq2pin[i + 9] = PIRQE + i;
+
+	/* Set IRQ-PIRQ Mapping to ULI1575 */
+	for (i = 0; i < 16; i++)
+		if (irq2pin[i])
+			pirq_map_word |= (uli1575_irq_route_table[i] & 0xf)
+			    << ((irq2pin[i] - PIRQA) * 4);
+
+	pirq_map_word |= 1<<26;	/* disable INTx in EP mode*/
+
+	/* ULI1575 IRQ mapping conf register default value is 0xb9317542 */
+	DBG("Setup ULI1575 IRQ mapping configuration register value = 0x%x\n",
+		(int)pirq_map_word);
+	pci_write_config_dword(dev, 0x48, pirq_map_word);
+
+#define ULI1575_SET_DEV_IRQ(slot, pin, reg)				\
+	do {								\
+		int irq;						\
+		irq = get_pci_irq_from_of(hose, slot, pin);		\
+		if (irq > 0 && irq < 16) 				\
+			pci_write_config_byte(dev, reg, irq2pin[irq]);	\
+		else							\
+			printk(KERN_WARNING "ULI1575 device"		\
+				"(slot %d, pin %d) irq %d is invalid.\n", \
+				slot, pin, irq);			\
+	} while(0)
+
+	/* USB 1.1 OHCI controller 1, slot 28, pin 1 */
+	ULI1575_SET_DEV_IRQ(28, 1, 0x86);
+
+	/* USB 1.1 OHCI controller 2, slot 28, pin 2 */
+	ULI1575_SET_DEV_IRQ(28, 2, 0x87);
+
+	/* USB 1.1 OHCI controller 3, slot 28, pin 3 */
+	ULI1575_SET_DEV_IRQ(28, 3, 0x88);
+
+	/* USB 2.0 controller, slot 28, pin 4 */
+	irq = get_pci_irq_from_of(hose, 28, 4);
+	if (irq >= 0 && irq <= 15)
+		pci_write_config_dword(dev, 0x74, uli1575_irq_route_table[irq]);
+
+	/* Audio controller, slot 29, pin 1 */
+	ULI1575_SET_DEV_IRQ(29, 1, 0x8a);
+
+	/* Modem controller, slot 29, pin 2 */
+	ULI1575_SET_DEV_IRQ(29, 2, 0x8b);
+
+	/* HD audio controller, slot 29, pin 3 */
+	ULI1575_SET_DEV_IRQ(29, 3, 0x8c);
+
+	/* SMB interrupt: slot 30, pin 1 */
+	ULI1575_SET_DEV_IRQ(30, 1, 0x8e);
+
+	/* PMU ACPI SCI interrupt: slot 30, pin 2 */
+	ULI1575_SET_DEV_IRQ(30, 2, 0x8f);
+
+	/* Serial ATA interrupt: slot 31, pin 1 */
+	ULI1575_SET_DEV_IRQ(31, 1, 0x8d);
+
+	/* Primary PATA IDE IRQ: 14
+	 * Secondary PATA IDE IRQ: 15
+	 */
+	pci_write_config_byte(dev, 0x44, 0x30 | uli1575_irq_route_table[14]);
+	pci_write_config_byte(dev, 0x75, uli1575_irq_route_table[15]);
+
+	/* Set IRQ14 and IRQ15 to legacy IRQs */
+	pci_read_config_word(dev, 0x46, &temp);
+	temp |= 0xc000;
+	pci_write_config_word(dev, 0x46, temp);
+
+	/* Set i8259 interrupt trigger
+	 * IRQ 3:  Level
+	 * IRQ 4:  Level
+	 * IRQ 5:  Level
+	 * IRQ 6:  Level
+	 * IRQ 7:  Level
+	 * IRQ 9:  Level
+	 * IRQ 10: Level
+	 * IRQ 11: Level
+	 * IRQ 12: Level
+	 * IRQ 14: Edge
+	 * IRQ 15: Edge
+	 */
+	outb(0xfa, 0x4d0);
+	outb(0x1e, 0x4d1);
+
+#undef ULI1575_SET_DEV_IRQ
+}
+
+/* SATA */
+static void __devinit quirk_uli5288(struct pci_dev *dev)
+{
+	unsigned char c;
+
+	pci_read_config_byte(dev, 0x83, &c);
+	c |= 0x80;		/* read/write lock */
+	pci_write_config_byte(dev, 0x83, c);
+
+	pci_write_config_byte(dev, 0x09, 0x01);	/* Base class code: storage */
+	pci_write_config_byte(dev, 0x0a, 0x06);	/* IDE disk */
+
+	pci_read_config_byte(dev, 0x83, &c);
+	c &= 0x7f;
+	pci_write_config_byte(dev, 0x83, c);
+
+	pci_read_config_byte(dev, 0x84, &c);
+	c |= 0x01;				/* emulated PATA mode enabled */
+	pci_write_config_byte(dev, 0x84, c);
+}
+
+/* PATA */
+static void __devinit quirk_uli5229(struct pci_dev *dev)
+{
+	unsigned short temp;
+	pci_write_config_word(dev, 0x04, 0x0405);	/* MEM IO MSI */
+	pci_read_config_word(dev, 0x4a, &temp);
+	temp |= 0x1000;				/* Enable Native IRQ 14/15 */
+	pci_write_config_word(dev, 0x4a, temp);
+}
+
+/*Bridge*/
+static void __devinit early_uli5249(struct pci_dev *dev)
+{
+	unsigned char temp;
+	pci_write_config_word(dev, 0x04, 0x0007);	/* mem access */
+	pci_read_config_byte(dev, 0x7c, &temp);
+	pci_write_config_byte(dev, 0x7c, 0x80);	/* R/W lock control */
+	pci_write_config_byte(dev, 0x09, 0x01);	/* set as pci-pci bridge */
+	pci_write_config_byte(dev, 0x7c, temp);	/* restore pci bus debug control */
+	dev->class |= 0x1;
+}
+
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_uli1575);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
+#endif	/* CONFIG_PCI */
 
 /*
  * Setup the architecture
  */
 static void __init mpc8544_ds_setup_arch(void)
 {
+#ifdef CONFIG_PCI
+	struct device_node *np;
+#endif
+
 	if (ppc_md.progress)
 		ppc_md.progress("mpc8544_ds_setup_arch()", 0);
 
+#ifdef CONFIG_PCI
+	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
+		struct resource rsrc;
+		of_address_to_resource(np, 0, &rsrc);
+		if ((rsrc.start & 0xfffff) == 0xb000)
+			fsl_add_bridge(np, 1);
+		else
+			fsl_add_bridge(np, 0);
+	}
+#endif
+
 	printk("MPC8544 DS board from Freescale Semiconductor\n");
 }
 
-
 /*
  * Called very early, device-tree isn't unflattened
  */
@@ -124,6 +362,7 @@ define_machine(mpc8544_ds) {
 	.probe			= mpc8544_ds_probe,
 	.setup_arch		= mpc8544_ds_setup_arch,
 	.init_IRQ		= mpc8544_ds_pic_init,
+	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
 	.get_irq		= mpic_get_irq,
 	.restart		= mpc85xx_restart,
 	.calibrate_decr		= generic_calibrate_decr,
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 1426642..f51fedf 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -226,5 +226,7 @@ DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0020, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0021, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0024, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0025, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0030, quirk_fsl_pcie_transparent);
+DECLARE_PCI_FIXUP_EARLY(0x1957, 0x0031, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, 0x7010, quirk_fsl_pcie_transparent);
 DECLARE_PCI_FIXUP_EARLY(0x1957, 0x7011, quirk_fsl_pcie_transparent);
-- 
1.5.2.2

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox