LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 19/25] [POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.
From: Kumar Gala @ 2007-07-24  3:41 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <C75BA37F-82D2-4520-9898-D7BE9A0C4F9C@kernel.crashing.org>


On Jul 23, 2007, at 9:47 PM, Kumar Gala wrote:

>
> On Jul 23, 2007, at 8:48 PM, Benjamin Herrenschmidt wrote:
>
>> 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.
>
> Ok, I dropped this one for now.

Just dropped the mpic.c change.

- k

^ permalink raw reply

* Re: Please pull from 'for_paulus' branch
From: Kumar Gala @ 2007-07-24  2:56 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0707231556210.4203@blarg.am.freescale.net>

Please pull from 'for_paulus' branch of

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

Updated with Ben's request change to the indirect runtime patch and
dropped the i8259/mpic patch for now.

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        |   99 ++++++
 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               |   59 ++--
 arch/powerpc/sysdev/mpic.c                       |    1
 arch/powerpc/sysdev/mv64x60_pci.c                |    2
 include/asm-powerpc/pci-bridge.h                 |   17 -
 include/linux/pci_ids.h                          |   17 +
 46 files changed, 1642 insertions(+), 834 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 (4):
      [POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.
      [POWERPC] 85xxCDS: Make sure restart resets the PCI bus.
      [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

* Re: [Cbe-oss-dev] [PATCH][36/37] Clean up duplicate includes in sound/ppc/
From: Masakazu Mokuno @ 2007-07-24  2:47 UTC (permalink / raw)
  To: Jesper Juhl
  Cc: linuxppc-dev, Andrew Morton, Linux Kernel Mailing List,
	cbe-oss-dev
In-Reply-To: <200707211704.07263.jesper.juhl@gmail.com>


On Sat, 21 Jul 2007 17:04:07 +0200
Jesper Juhl <jesper.juhl@gmail.com> wrote:

> Hi,
> 
> This patch cleans up duplicate includes in
> 	XXXX/
> 
> 
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> ---
> 
> diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
> index 1aa0b46..27b6189 100644
> --- a/sound/ppc/snd_ps3.c
> +++ b/sound/ppc/snd_ps3.c
> @@ -33,7 +33,6 @@
>  #include <linux/dmapool.h>
>  #include <linux/dma-mapping.h>
>  #include <asm/firmware.h>
> -#include <linux/io.h>
>  #include <asm/dma.h>
>  #include <asm/lv1call.h>
>  #include <asm/ps3.h>

Acked-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>

--
Masakazu MOKUNO

^ permalink raw reply

* Re: [PATCH 19/25] [POWERPC] 85xxCDS: Allow 8259 cascade to share an MPIC interrupt line.
From: Kumar Gala @ 2007-07-24  2:47 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1185241693.5439.194.camel@localhost.localdomain>


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

> 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.

Ok, I dropped this one for now.

- k

^ permalink raw reply

* Re: [PATCH 14/25] [POWERPC] Make endianess of cfg_addr for indirect pci ops runtime
From: Kumar Gala @ 2007-07-24  2:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1185241404.5439.190.camel@localhost.localdomain>

On Tue, 24 Jul 2007, Benjamin Herrenschmidt wrote:

> 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.
>

How about this version?

---
 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               |   26 +++++++++++-----------
 arch/powerpc/sysdev/mv64x60_pci.c                |    2 +-
 include/asm-powerpc/pci-bridge.h                 |    5 +++-
 12 files changed, 30 insertions(+), 31 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..d7747e0 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,
+		PPC_INDIRECT_TYPE_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..a8ac2df 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -20,12 +20,6 @@
 #include <asm/pci-bridge.h>
 #include <asm/machdep.h>

-#ifdef CONFIG_PPC_INDIRECT_PCI_BE
-#define PCI_CFG_OUT out_be32
-#else
-#define PCI_CFG_OUT out_le32
-#endif
-
 static int
 indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		     int len, u32 *val)
@@ -58,9 +52,12 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 	else
 		reg = offset & 0xfc;

-	PCI_CFG_OUT(hose->cfg_addr,
-		 (0x80000000 | (bus_no << 16)
-		  | (devfn << 8) | reg | cfg_type));
+	if (hose->indirect_type & PPC_INDIRECT_TYPE_BIG_ENDIAN)
+		out_be32(hose->cfg_addr, (0x80000000 | (bus_no << 16) |
+			 (devfn << 8) | reg | cfg_type));
+	else
+		out_le32(hose->cfg_addr, (0x80000000 | (bus_no << 16) |
+			 (devfn << 8) | reg | cfg_type));

 	/*
 	 * Note: the caller has already checked that offset is
@@ -113,9 +110,12 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 	else
 		reg = offset & 0xfc;

-	PCI_CFG_OUT(hose->cfg_addr,
-		 (0x80000000 | (bus_no << 16)
-		  | (devfn << 8) | reg | cfg_type));
+	if (hose->indirect_type & PPC_INDIRECT_TYPE_BIG_ENDIAN)
+		out_be32(hose->cfg_addr, (0x80000000 | (bus_no << 16) |
+			 (devfn << 8) | reg | cfg_type));
+	else
+		out_le32(hose->cfg_addr, (0x80000000 | (bus_no << 16) |
+			 (devfn << 8) | reg | cfg_type));

 	/* surpress setting of PCI_PRIMARY_BUS */
 	if (hose->indirect_type & PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS)
@@ -149,7 +149,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;
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..d7d3bf0 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -49,11 +49,13 @@ struct pci_controller {
 	 *   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.
+	 *  BIG_ENDIAN - cfg_addr is a big endian register
 	 */
 #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)
+#define PPC_INDIRECT_TYPE_BIG_ENDIAN		(0x00000010)
 	u32 indirect_type;

 	/* Currently, we limit ourselves to 1 IO range and 3 mem
@@ -88,7 +90,7 @@ extern int early_find_capability(struct pci_controller *hose, int bus,
 				 int dev_fn, int cap);

 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 +130,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
-- 
1.5.2.2

^ permalink raw reply related

* 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


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