diff mbox

[5/5] of/irq: merge of_irq_map_one()

Message ID 20100604212155.10552.19260.stgit@angua (mailing list archive)
State Not Applicable
Headers show

Commit Message

Grant Likely June 4, 2010, 9:21 p.m. UTC
Merge common implementation of of_irq_map_one().  Rename it to
__of_irq_map_one() so that arch code can either use the stock
implementation, or override it to handle platform quirks.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: Michal Simek <monstr@monstr.eu>
CC: Wolfram Sang <w.sang@pengutronix.de>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org
CC: devicetree-discuss@lists.ozlabs.org
---
 arch/microblaze/include/asm/prom.h  |    3 -
 arch/microblaze/kernel/prom_parse.c |   73 ------------------------------
 arch/powerpc/include/asm/prom.h     |    3 -
 arch/powerpc/kernel/prom_parse.c    |   55 -----------------------
 drivers/of/irq.c                    |   85 +++++++++++++++++++++++++++++++++++
 include/linux/of_irq.h              |    6 ++
 6 files changed, 91 insertions(+), 134 deletions(-)

Comments

Benjamin Herrenschmidt June 10, 2010, 6:40 a.m. UTC | #1
On Fri, 2010-06-04 at 15:21 -0600, Grant Likely wrote:
> Merge common implementation of of_irq_map_one().  Rename it to
> __of_irq_map_one() so that arch code can either use the stock
> implementation, or override it to handle platform quirks.

Similar comment to before, I think the breakup of functions causes more
complication and bloat than just keeping the quirks in the generic code.

Cheers,
Ben.

> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> CC: Michal Simek <monstr@monstr.eu>
> CC: Wolfram Sang <w.sang@pengutronix.de>
> CC: Stephen Rothwell <sfr@canb.auug.org.au>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: microblaze-uclinux@itee.uq.edu.au
> CC: linuxppc-dev@ozlabs.org
> CC: devicetree-discuss@lists.ozlabs.org
> ---
>  arch/microblaze/include/asm/prom.h  |    3 -
>  arch/microblaze/kernel/prom_parse.c |   73 ------------------------------
>  arch/powerpc/include/asm/prom.h     |    3 -
>  arch/powerpc/kernel/prom_parse.c    |   55 -----------------------
>  drivers/of/irq.c                    |   85 +++++++++++++++++++++++++++++++++++
>  include/linux/of_irq.h              |    6 ++
>  6 files changed, 91 insertions(+), 134 deletions(-)
> 
> diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
> index 89fca70..3659930 100644
> --- a/arch/microblaze/include/asm/prom.h
> +++ b/arch/microblaze/include/asm/prom.h
> @@ -107,9 +107,6 @@ extern const void *of_get_mac_address(struct device_node *np);
>  struct pci_dev;
>  extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
>  
> -extern int of_irq_to_resource(struct device_node *dev, int index,
> -			struct resource *r);
> -
>  /**
>   * of_iomap - Maps the memory mapped IO for a given device_node
>   * @device:	the device whose io range will be mapped
> diff --git a/arch/microblaze/kernel/prom_parse.c b/arch/microblaze/kernel/prom_parse.c
> index 02ec946..70c0471 100644
> --- a/arch/microblaze/kernel/prom_parse.c
> +++ b/arch/microblaze/kernel/prom_parse.c
> @@ -656,49 +656,7 @@ struct device_node *of_irq_find_parent_by_phandle(phandle p)
>  int of_irq_map_one(struct device_node *device,
>  			int index, struct of_irq *out_irq)
>  {
> -	struct device_node *p;
> -	const u32 *intspec, *tmp, *addr;
> -	u32 intsize, intlen;
> -	int res;
> -
> -	pr_debug("of_irq_map_one: dev=%s, index=%d\n",
> -			device->full_name, index);
> -
> -	/* Get the interrupts property */
> -	intspec = of_get_property(device, "interrupts", (int *) &intlen);
> -	if (intspec == NULL)
> -		return -EINVAL;
> -	intlen /= sizeof(u32);
> -
> -	pr_debug(" intspec=%d intlen=%d\n", *intspec, intlen);
> -
> -	/* Get the reg property (if any) */
> -	addr = of_get_property(device, "reg", NULL);
> -
> -	/* Look for the interrupt parent. */
> -	p = of_irq_find_parent(device);
> -	if (p == NULL)
> -		return -EINVAL;
> -
> -	/* Get size of interrupt specifier */
> -	tmp = of_get_property(p, "#interrupt-cells", NULL);
> -	if (tmp == NULL) {
> -		of_node_put(p);
> -		return -EINVAL;
> -	}
> -	intsize = *tmp;
> -
> -	pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
> -
> -	/* Check index */
> -	if ((index + 1) * intsize > intlen)
> -		return -EINVAL;
> -
> -	/* Get new specifier and map it */
> -	res = of_irq_map_raw(p, intspec + index * intsize, intsize,
> -				addr, out_irq);
> -	of_node_put(p);
> -	return res;
> +	return __of_irq_map_one(device, index, out_irq);
>  }
>  EXPORT_SYMBOL_GPL(of_irq_map_one);
>  
> @@ -740,35 +698,6 @@ const void *of_get_mac_address(struct device_node *np)
>  }
>  EXPORT_SYMBOL(of_get_mac_address);
>  
> -int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
> -{
> -	struct of_irq out_irq;
> -	int irq;
> -	int res;
> -
> -	res = of_irq_map_one(dev, index, &out_irq);
> -
> -	/* Get irq for the device */
> -	if (res) {
> -		pr_debug("IRQ not found... code = %d", res);
> -		return NO_IRQ;
> -	}
> -	/* Assuming single interrupt controller... */
> -	irq = out_irq.specifier[0];
> -
> -	pr_debug("IRQ found = %d", irq);
> -
> -	/* Only dereference the resource if both the
> -	 * resource and the irq are valid. */
> -	if (r && irq != NO_IRQ) {
> -		r->start = r->end = irq;
> -		r->flags = IORESOURCE_IRQ;
> -	}
> -
> -	return irq;
> -}
> -EXPORT_SYMBOL_GPL(of_irq_to_resource);
> -
>  void __iomem *of_iomap(struct device_node *np, int index)
>  {
>  	struct resource res;
> diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
> index 187ef4e..2440984 100644
> --- a/arch/powerpc/include/asm/prom.h
> +++ b/arch/powerpc/include/asm/prom.h
> @@ -136,9 +136,6 @@ extern void of_irq_map_init(unsigned int flags);
>  struct pci_dev;
>  extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
>  
> -extern int of_irq_to_resource(struct device_node *dev, int index,
> -			struct resource *r);
> -
>  /**
>   * of_iomap - Maps the memory mapped IO for a given device_node
>   * @device:	the device whose io range will be mapped
> diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
> index 89ca7b3..ef518e3 100644
> --- a/arch/powerpc/kernel/prom_parse.c
> +++ b/arch/powerpc/kernel/prom_parse.c
> @@ -777,49 +777,11 @@ static int of_irq_map_oldworld(struct device_node *device, int index,
>  
>  int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq)
>  {
> -	struct device_node *p;
> -	const u32 *intspec, *tmp, *addr;
> -	u32 intsize, intlen;
> -	int res = -EINVAL;
> -
> -	DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index);
> -
>  	/* OldWorld mac stuff is "special", handle out of line */
>  	if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
>  		return of_irq_map_oldworld(device, index, out_irq);
>  
> -	/* Get the interrupts property */
> -	intspec = of_get_property(device, "interrupts", &intlen);
> -	if (intspec == NULL)
> -		return -EINVAL;
> -	intlen /= sizeof(u32);
> -
> -	/* Get the reg property (if any) */
> -	addr = of_get_property(device, "reg", NULL);
> -
> -	/* Look for the interrupt parent. */
> -	p = of_irq_find_parent(device);
> -	if (p == NULL)
> -		return -EINVAL;
> -
> -	/* Get size of interrupt specifier */
> -	tmp = of_get_property(p, "#interrupt-cells", NULL);
> -	if (tmp == NULL)
> -		goto out;
> -	intsize = *tmp;
> -
> -	DBG(" intsize=%d intlen=%d\n", intsize, intlen);
> -
> -	/* Check index */
> -	if ((index + 1) * intsize > intlen)
> -		goto out;
> -
> -	/* Get new specifier and map it */
> -	res = of_irq_map_raw(p, intspec + index * intsize, intsize,
> -			     addr, out_irq);
> -out:
> -	of_node_put(p);
> -	return res;
> +	return __of_irq_map_one(device, index, out_irq);
>  }
>  EXPORT_SYMBOL_GPL(of_irq_map_one);
>  
> @@ -861,21 +823,6 @@ const void *of_get_mac_address(struct device_node *np)
>  }
>  EXPORT_SYMBOL(of_get_mac_address);
>  
> -int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
> -{
> -	int irq = irq_of_parse_and_map(dev, index);
> -
> -	/* Only dereference the resource if both the
> -	 * resource and the irq are valid. */
> -	if (r && irq != NO_IRQ) {
> -		r->start = r->end = irq;
> -		r->flags = IORESOURCE_IRQ;
> -	}
> -
> -	return irq;
> -}
> -EXPORT_SYMBOL_GPL(of_irq_to_resource);
> -
>  void __iomem *of_iomap(struct device_node *np, int index)
>  {
>  	struct resource res;
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 351c87a..dd420e5 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -31,7 +31,7 @@
>   * Returns a pointer to the interrupt parent node, or NULL if the interrupt
>   * parent could not be determined.
>   */
> -struct device_node *of_irq_find_parent(struct device_node *child)
> +static struct device_node *of_irq_find_parent(struct device_node *child)
>  {
>  	struct device_node *p;
>  	const phandle *parp;
> @@ -240,6 +240,67 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
>  }
>  EXPORT_SYMBOL_GPL(of_irq_map_raw);
>  
> +/**
> + * of_irq_map_one - Resolve an interrupt for a device
> + * @device: the device whose interrupt is to be resolved
> + * @index: index of the interrupt to resolve
> + * @out_irq: structure of_irq filled by this function
> + *
> + * This function resolves an interrupt, walking the tree, for a given
> + * device-tree node. It's the high level pendant to of_irq_map_raw().
> + *
> + * Architecture code must provide of_irq_map_one() which can simply be a
> + * wrapper around __of_irq_map_one(), or can override it to deal with
> + * arch specific quirks and bugs.
> + */
> +int __of_irq_map_one(struct device_node *device, int index,
> +		     struct of_irq *out_irq)
> +{
> +	struct device_node *p;
> +	const u32 *intspec, *tmp, *addr;
> +	u32 intsize, intlen;
> +	int res = -EINVAL;
> +
> +	pr_debug("of_irq_map_one: dev=%s, index=%d\n",
> +		 device->full_name, index);
> +
> +	/* Get the interrupts property */
> +	intspec = of_get_property(device, "interrupts", &intlen);
> +	if (intspec == NULL)
> +		return -EINVAL;
> +	intlen /= sizeof(u32);
> +
> +	pr_debug(" intspec=%d intlen=%d\n", *intspec, intlen);
> +
> +	/* Get the reg property (if any) */
> +	addr = of_get_property(device, "reg", NULL);
> +
> +	/* Look for the interrupt parent. */
> +	p = of_irq_find_parent(device);
> +	if (p == NULL)
> +		return -EINVAL;
> +
> +	/* Get size of interrupt specifier */
> +	tmp = of_get_property(p, "#interrupt-cells", NULL);
> +	if (tmp == NULL)
> +		goto out;
> +	intsize = *tmp;
> +
> +	pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
> +
> +	/* Check index */
> +	if ((index + 1) * intsize > intlen)
> +		goto out;
> +
> +	/* Get new specifier and map it */
> +	res = of_irq_map_raw(p, intspec + index * intsize, intsize,
> +			     addr, out_irq);
> + out:
> +	of_node_put(p);
> +	return res;
> +}
> +EXPORT_SYMBOL_GPL(__of_irq_map_one);
> +
>  unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
>  {
>  	struct of_irq oirq;
> @@ -251,3 +312,25 @@ unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
>  				     oirq.size);
>  }
>  EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
> +
> +/**
> + * of_irq_to_resource - Decode a node's IRQ and return it as a resource
> + * @dev: pointer to device tree node
> + * @index: zero-based index of the irq
> + * @r: pointer to resource structure to return result into.
> + */
> +unsigned int of_irq_to_resource(struct device_node *dev, int index,
> +				struct resource *r)
> +{
> +	unsigned int irq = irq_of_parse_and_map(dev, index);
> +
> +	/* Only dereference the resource if both the
> +	 * resource and the irq are valid. */
> +	if (r && irq != NO_IRQ) {
> +		r->start = r->end = irq;
> +		r->flags = IORESOURCE_IRQ;
> +	}
> +
> +	return irq;
> +}
> +EXPORT_SYMBOL_GPL(of_irq_to_resource);
> diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
> index 51c520b..935a14d 100644
> --- a/include/linux/of_irq.h
> +++ b/include/linux/of_irq.h
> @@ -5,6 +5,7 @@
>  struct of_irq;
>  #include <linux/types.h>
>  #include <linux/of.h>
> +#include <linux/ioport.h>
>  
>  /*
>   * irq_of_parse_and_map() is used ba all OF enabled platforms; but SPARC
> @@ -31,14 +32,17 @@ struct of_irq {
>  };
>  
>  extern struct device_node *of_irq_find_parent_by_phandle(phandle p);
> -extern struct device_node *of_irq_find_parent(struct device_node *child);
>  extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
>  			 u32 ointsize, const u32 *addr, struct of_irq *out_irq);
> +extern int __of_irq_map_one(struct device_node *device, int index,
> +			    struct of_irq *out_irq);
>  extern int of_irq_map_one(struct device_node *device, int index,
>  			  struct of_irq *out_irq);
>  extern unsigned int irq_create_of_mapping(struct device_node *controller,
>  					  const u32 *intspec,
>  					  unsigned int intsize);
> +extern unsigned int of_irq_to_resource(struct device_node *dev, int index,
> +				       struct resource *r);
>  
>  #endif /* CONFIG_OF_IRQ */
>  #endif /* CONFIG_OF */
Grant Likely June 10, 2010, 11:36 p.m. UTC | #2
On Thu, Jun 10, 2010 at 12:40 AM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Fri, 2010-06-04 at 15:21 -0600, Grant Likely wrote:
>> Merge common implementation of of_irq_map_one().  Rename it to
>> __of_irq_map_one() so that arch code can either use the stock
>> implementation, or override it to handle platform quirks.
>
> Similar comment to before, I think the breakup of functions causes more
> complication and bloat than just keeping the quirks in the generic code.

Okay.  I had been trying to avoid #ifdefs in the common code, but
you're probably right.  I'll rework.

g.
Benjamin Herrenschmidt June 11, 2010, 1:17 a.m. UTC | #3
On Thu, 2010-06-10 at 17:36 -0600, Grant Likely wrote:
> 
> Okay.  I had been trying to avoid #ifdefs in the common code, but
> you're probably right.  I'll rework. 

Not even ifdef's ... just move the quirk map there. You can always
#define the quirk variable to 0 on archs that have no quirks, to
make it compile away if you believe it represents bloat, but they
are simple well localized things so I doubt it matters.

Cheers,
Ben.
jxnuxdy June 11, 2010, 1:30 a.m. UTC | #4
Hi guys,

I encountered a PCIe problem under linux, the two PCIe bus on my board seems work, at least I can access the registers through the PCIe bus, however the dma for the PCIe bus can't work, so I just dumped the pci device, but I am curiously to find there is no regions displayed on PCIe controlers, why? is it relate with my 'dma' issue then?


bash-2.04# cat /proc/pci
PCI devices found:
  Bus  0, device   0, function  0:
    Class 0b20  Header Type 01: PCI device 1957:0032 (rev 17).
  Bus  1, device   0, function  0:
    Class 0580  Header Type 00: PCI device 11ab:db90 (rev 1).
      Prefetchable 64 bit memory at 0x80000000 [0x800fffff].
      Prefetchable 64 bit memory at 0x84000000 [0x87ffffff].
  Bus  9, device   0, function  0:
    Class 0b20  Header Type 01: PCI device 1957:0032 (rev 17).
  Bus 10, device   0, function  0:
    Class 0580  Header Type 00: PCI device 11ab:db90 (rev 1).
      Prefetchable 64 bit memory at 0xa0000000 [0xa00fffff].
      Prefetchable 64 bit memory at 0xa4000000 [0xa7ffffff].
bash-2.04# lspci -vv
00:00.0 Power PC: Unknown device 1957:0032 (rev 11)
        !!! Invalid class 0b20 for header type 01
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0, cache line size 08
        Bus: primary=00, secondary=01, subordinate=06, sec-latency=0
        I/O behind bridge: 00000000-00000fff
        Memory behind bridge: 80000000-9fffffff
        BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
        Capabilities: [44] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [4c] #10 [0041]

01:00.0 Memory controller: Galileo Technology Ltd.: Unknown device db90 (rev 01)
        Subsystem: Galileo Technology Ltd.: Unknown device 11ab
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0, cache line size 08
        Interrupt: pin A routed to IRQ 0
        Region 0: Memory at 80000000 (64-bit, prefetchable) [size=1M]
        Region 2: Memory at 84000000 (64-bit, prefetchable) [size=64M]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
                Address: 0000000000000000  Data: 0000
        Capabilities: [60] #10 [0011]

09:00.0 Power PC: Unknown device 1957:0032 (rev 11)
        !!! Invalid class 0b20 for header type 01
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0, cache line size 08
        Bus: primary=00, secondary=0a, subordinate=0f, sec-latency=0
        I/O behind bridge: 00000000-00000fff
        Memory behind bridge: a0000000-bfffffff
        BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
        Capabilities: [44] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [4c] #10 [0041]

0a:00.0 Memory controller: Galileo Technology Ltd.: Unknown device db90 (rev 01)
        Subsystem: Galileo Technology Ltd.: Unknown device 11ab
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0, cache line size 08
        Interrupt: pin A routed to IRQ 0
        Region 0: Memory at a0000000 (64-bit, prefetchable) [size=1M]
        Region 2: Memory at a4000000 (64-bit, prefetchable) [size=64M]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
                Address: 0000000000000000  Data: 0000
        Capabilities: [60] #10 [0011]

bash-2.04# 

Thanks
Denny
Benjamin Herrenschmidt June 11, 2010, 7:21 a.m. UTC | #5
On Fri, 2010-06-11 at 09:30 +0800, jxnuxdy wrote:
> Hi guys,
> 
> I encountered a PCIe problem under linux, the two PCIe bus on my board seems work, 
> at least I can access the registers through the PCIe bus, however the dma for the
> PCIe bus can't work, so I just dumped the pci device, but I am curiously to find
> there is no regions displayed on PCIe controlers, why? is it relate with my 'dma' issue then?

It would help if you told us a bit more what the HW is, what you are
doing with it, etc...

IE. What is your host, what is your device, what platform, etc...

DMA should work provided that your platform code sets it up properly.
The DMA regions don't appear in /proc/pci or lspci.

Cheers,
Ben.

> 
> bash-2.04# cat /proc/pci
> PCI devices found:
>   Bus  0, device   0, function  0:
>     Class 0b20  Header Type 01: PCI device 1957:0032 (rev 17).
>   Bus  1, device   0, function  0:
>     Class 0580  Header Type 00: PCI device 11ab:db90 (rev 1).
>       Prefetchable 64 bit memory at 0x80000000 [0x800fffff].
>       Prefetchable 64 bit memory at 0x84000000 [0x87ffffff].
>   Bus  9, device   0, function  0:
>     Class 0b20  Header Type 01: PCI device 1957:0032 (rev 17).
>   Bus 10, device   0, function  0:
>     Class 0580  Header Type 00: PCI device 11ab:db90 (rev 1).
>       Prefetchable 64 bit memory at 0xa0000000 [0xa00fffff].
>       Prefetchable 64 bit memory at 0xa4000000 [0xa7ffffff].
> bash-2.04# lspci -vv
> 00:00.0 Power PC: Unknown device 1957:0032 (rev 11)
>         !!! Invalid class 0b20 for header type 01
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 0, cache line size 08
>         Bus: primary=00, secondary=01, subordinate=06, sec-latency=0
>         I/O behind bridge: 00000000-00000fff
>         Memory behind bridge: 80000000-9fffffff
>         BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>         Capabilities: [44] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [4c] #10 [0041]
> 
> 01:00.0 Memory controller: Galileo Technology Ltd.: Unknown device db90 (rev 01)
>         Subsystem: Galileo Technology Ltd.: Unknown device 11ab
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 0, cache line size 08
>         Interrupt: pin A routed to IRQ 0
>         Region 0: Memory at 80000000 (64-bit, prefetchable) [size=1M]
>         Region 2: Memory at 84000000 (64-bit, prefetchable) [size=64M]
>         Capabilities: [40] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
>                 Address: 0000000000000000  Data: 0000
>         Capabilities: [60] #10 [0011]
> 
> 09:00.0 Power PC: Unknown device 1957:0032 (rev 11)
>         !!! Invalid class 0b20 for header type 01
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 0, cache line size 08
>         Bus: primary=00, secondary=0a, subordinate=0f, sec-latency=0
>         I/O behind bridge: 00000000-00000fff
>         Memory behind bridge: a0000000-bfffffff
>         BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>         Capabilities: [44] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [4c] #10 [0041]
> 
> 0a:00.0 Memory controller: Galileo Technology Ltd.: Unknown device db90 (rev 01)
>         Subsystem: Galileo Technology Ltd.: Unknown device 11ab
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 0, cache line size 08
>         Interrupt: pin A routed to IRQ 0
>         Region 0: Memory at a0000000 (64-bit, prefetchable) [size=1M]
>         Region 2: Memory at a4000000 (64-bit, prefetchable) [size=64M]
>         Capabilities: [40] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
>                 Address: 0000000000000000  Data: 0000
>         Capabilities: [60] #10 [0011]
> 
> bash-2.04# 
> 
> Thanks
> Denny
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
jxnuxdy June 15, 2010, 7:05 a.m. UTC | #6
Thanks Benjamin, the regions don't display as what we expect, that's why we suspect if there any configuration probelms in CPU host bridge, but we changed the uboot/linux a lot, seems take no effect on that problems.

We use CPU MPC8544, and connect two PCIE devices to CPU PCIE1 and PCIE2 directly without a  extended PCIE bridge, so we disabled PCIE3 and PCI controlers in uboot level.

More settings pls take a look at the attach file log.txt.


Many thanks,
Denny
----------------------------------------------------------------------------------------------------------------------------
在2010-06-11 15:21:24,"Benjamin Herrenschmidt" <benh@kernel.crashing.org> 写道:
>On Fri, 2010-06-11 at 09:30 +0800, jxnuxdy wrote:
>> Hi guys,
>> 
>> I encountered a PCIe problem under linux, the two PCIe bus on my board seems work, 
>> at least I can access the registers through the PCIe bus, however the dma for the
>> PCIe bus can't work, so I just dumped the pci device, but I am curiously to find
>> there is no regions displayed on PCIe controlers, why? is it relate with my 'dma' issue then?
>
>It would help if you told us a bit more what the HW is, what you are
>doing with it, etc...
>
>IE. What is your host, what is your device, what platform, etc...
>
>DMA should work provided that your platform code sets it up properly.
>The DMA regions don't appear in /proc/pci or lspci.
>
>Cheers,
>Ben.
>
>> 
>> bash-2.04# cat /proc/pci
>> PCI devices found:
>>   Bus  0, device   0, function  0:
>>     Class 0b20  Header Type 01: PCI device 1957:0032 (rev 17).
>>   Bus  1, device   0, function  0:
>>     Class 0580  Header Type 00: PCI device 11ab:db90 (rev 1).
>>       Prefetchable 64 bit memory at 0x80000000 [0x800fffff].
>>       Prefetchable 64 bit memory at 0x84000000 [0x87ffffff].
>>   Bus  9, device   0, function  0:
>>     Class 0b20  Header Type 01: PCI device 1957:0032 (rev 17).
>>   Bus 10, device   0, function  0:
>>     Class 0580  Header Type 00: PCI device 11ab:db90 (rev 1).
>>       Prefetchable 64 bit memory at 0xa0000000 [0xa00fffff].
>>       Prefetchable 64 bit memory at 0xa4000000 [0xa7ffffff].
>> bash-2.04# lspci -vv
>> 00:00.0 Power PC: Unknown device 1957:0032 (rev 11)
>>         !!! Invalid class 0b20 for header type 01
>>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>>         Latency: 0, cache line size 08
>>         Bus: primary=00, secondary=01, subordinate=06, sec-latency=0
>>         I/O behind bridge: 00000000-00000fff
>>         Memory behind bridge: 80000000-9fffffff
>>         BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>>         Capabilities: [44] Power Management version 2
>>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
>>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>>         Capabilities: [4c] #10 [0041]
>> 
>> 01:00.0 Memory controller: Galileo Technology Ltd.: Unknown device db90 (rev 01)
>>         Subsystem: Galileo Technology Ltd.: Unknown device 11ab
>>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>>         Latency: 0, cache line size 08
>>         Interrupt: pin A routed to IRQ 0
>>         Region 0: Memory at 80000000 (64-bit, prefetchable) [size=1M]
>>         Region 2: Memory at 84000000 (64-bit, prefetchable) [size=64M]
>>         Capabilities: [40] Power Management version 2
>>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>>         Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
>>                 Address: 0000000000000000  Data: 0000
>>         Capabilities: [60] #10 [0011]
>> 
>> 09:00.0 Power PC: Unknown device 1957:0032 (rev 11)
>>         !!! Invalid class 0b20 for header type 01
>>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>>         Latency: 0, cache line size 08
>>         Bus: primary=00, secondary=0a, subordinate=0f, sec-latency=0
>>         I/O behind bridge: 00000000-00000fff
>>         Memory behind bridge: a0000000-bfffffff
>>         BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>>         Capabilities: [44] Power Management version 2
>>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
>>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>>         Capabilities: [4c] #10 [0041]
>> 
>> 0a:00.0 Memory controller: Galileo Technology Ltd.: Unknown device db90 (rev 01)
>>         Subsystem: Galileo Technology Ltd.: Unknown device 11ab
>>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>>         Latency: 0, cache line size 08
>>         Interrupt: pin A routed to IRQ 0
>>         Region 0: Memory at a0000000 (64-bit, prefetchable) [size=1M]
>>         Region 2: Memory at a4000000 (64-bit, prefetchable) [size=64M]
>>         Capabilities: [40] Power Management version 2
>>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>>         Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
>>                 Address: 0000000000000000  Data: 0000
>>         Capabilities: [60] #10 [0011]
>> 
>> bash-2.04# 
>> 
>> Thanks
>> Denny
>> 
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
>
>_______________________________________________
>Linuxppc-dev mailing list
>Linuxppc-dev@lists.ozlabs.org
>https://lists.ozlabs.org/listinfo/linuxppc-dev
U-Boot 1.1.3 (Jun 14 2010 - 19:26:53)

CPU:   8544_E, Version: 1.1, (0x803c0111)
Core:  E500, Version: 2.2, (0x80210022)
Clock Configuration:
       CPU: 800 MHz, CCB: 400 MHz,
       DDR: 200 MHz, LBC:  50 MHz
L1:    D-cache 32 kB enabled
       I-cache 32 kB enabled
Board: C48
CPU Board Revision 0.0 (0x0000)
    PCI2: disabled
I2C:   ready
DRAM:  Initializing DDRSDRAM 
memsize = 200 
    DDR: 512 MB
POST RAM test disabled.
Now running in RAM - U-Boot at: 1fb7c000
trap_init : 0x0
system inventory subsystem initialized 
FLASH: 64 MB
L2 cache 256KB: enabled
PCI:
               Scanning PCI bus 00
        01  00  11ab  db90  0580  00
               Scanning PCI bus 02
        03  00  11ab  db90  0580  00
In:    serial
Out:   serial
Err:   serial
Net:   
ENET0: PHY is Marvell 88E1112 (1410c97)

set_bootstatus: BS_LOAD_OS, platform_idx = 11 

Hit ESC to stop autoboot:  0 
## Booting image at fb400000 ...
   Image Name:   Linux-2.6.14.2
   Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
   Data Size:    2506379 Bytes =  2.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Contents:
   Image 0:  1429862 Bytes =  1.4 MB
   Image 1:  1076503 Bytes =  1 MB
   Uncompressing Multi-File Image ... ## Current stack ends at 0x1FB5ABD0 => set upper limit to 0x00800000
## initrd at 0xFB55D1B4 ... 0xFB663ECA (len=1076503=0x106D17)
   Loading Ramdisk to 1fa53000, end 1fb59d17 ... OK
 initrd_start = 1fa53000, initrd_end = 1fb59d17 
## Transferring control to Linux (at address 00000000) ...
Memory CAM mapping: CAM0=256Mb, CAM1=256Mb, CAM2=0Mb residual: 0Mb
tlbcam_index=2
Linux version 2.6.14.2 (dxiao@blc-10-6) (gcc version 3.4.6) #25 Fri Jun 11 17:59:39 PDT 2010
silkworm85xx_setup_arch
mpc85xx_setup: Doing Pcie bridge setup
Scanning PcieBus...
cpld_init: platform (101) not supported
Brocade Silkworm port (C) 2006 Brocade Communications Systems, Inc.
  DMA zone: 131072 pages, LIFO batch:31
  Normal zone: 0 pages, LIFO batch:1
  HighMem zone: 0 pages, LIFO batch:1
Built 1 zonelists
Kernel command line: ip=off console=ttyS1,9600 noinitrd rootfstype=jffs2 root=/dev/mtdblock1 rw
OpenPIC Version 1.2 (1 CPUs and 60 IRQ sources) at fafb9000
PID hash table entries: 4096 (order: 12, 65536 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 514944k available (2280k kernel code, 668k data, 144k init, 0k highmem)
Mount-cache hash table entries: 512
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 1051k freed
softlockup thread 0 started up.
NET: Registered protocol family 16
PCI:: Probing PCI hardware
PCI: 0000:00:00.0: class b20 doesn't match header type 01. Ignoring class.
PCI: 0001:02:00.0: class b20 doesn't match header type 01. Ignoring class.
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
Initializing Cryptographic API
Generic RTC Driver v1.07
SWBD Platform Driver v1.0: [type 101, rev 2].
Config Silkworm 
PowerPC Book-E Watchdog Timer Loaded
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
ttyS0 at MMIO 0xe0004600 (irq = 26) is a 16550A
ttyS1 at MMIO 0xe0004500 (irq = 26) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 32768K size 1024 blocksize
loop: loaded (max 8 devices)
eth0: Gianfar Ethernet Controller Version 1.1, 00:e0:0c:00:00:fd 
eth0: Running with NAPI enabled
eth0: 256/256 RX/TX BD ring size
mtdchar: write-caching enabled
silkworm: Using SWBD101  flash configuration
Boot flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
Boot flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Creating 6 MTD partitions on "Boot flash":
0x00000000-0x00800000 : "unused (mtd0)"
0x00800000-0x03400000 : "filesys: kernel and initrd (mtd1)"
0x03400000-0x03c00000 : "kernel: kernel and initrd (mtd2)"
0x03c00000-0x03c40000 : "bootenv0: boot environment (mtd3)"
0x03c40000-0x03c80000 : "bootenv1: boot environment (mtd4)"
0x03c80000-0x04000000 : "bootimage (mtd5)"
i2c /dev entries driver
MPC adapter: Platform type [101],  Did not register I2C multiplexor callback.
MPC adapter: Platform type [101],  Did not register I2C multiplexor callback.
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 7, 524288 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
ip_conntrack version 2.3 (4096 buckets, 32768 max) - 216 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
arp_tables: (C) 2002 David S. Miller
TCP bic registered
Initializing IPsec netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
ip6_tables: (C) 2000-2002 Netfilter core team
NET: Registered protocol family 17
NET: Registered protocol family 15
VFS: Mounted root (jffs2 filesystem).
Freeing unused kernel memory: 144k init
INIT: version 2.78 booting
INIT: Entering runlevel: 2
Installing dpci dpci_switch_module: module license 'unspecified' taints kernel.
switch module
Installing dgen module
eth0: PHY is Generic MII (ffffffff)
/etc/rc.d/rc2.d/S30diags: /nfabos/bin/diagburnin.sh: No such file or directory
bash-2.04# eth0: Full Duplex
eth0: Speed 100BT
eth0: Link is up

bash-2.04# nfdiag
SWBD: modelId 0x0 extId 0x4e
CHOW48 platform.
slot: 0, bus: 1, dev: 0, size: 4194304, vAddr = 0x0, dmaAddr = 0x0 pciFd 0x4
DMA CPU Address 0xdf000000  PCI Address 0x9f000000 for slot 0 cheetah3 0
slot: 0, bus: 3, dev: 0, size: 4194304, vAddr = 0x0, dmaAddr = 0x0 pciFd 0x4
DMA CPU Address 0xdec00000  PCI Address 0x9ec00000 for slot 0 cheetah3 1

main (lc0)> pci -o read -s 0 -b 0 -u 0 -a 0 -l 0x128


00     BusNo 0     DevNo 0

00000000 1957 0032 0006 0010 0011 0b20 0008 0001              .W.2............
00000010 0000 0000 0000 0000 0100 0006 0000 0000              ................
00000020 8000 9ff0 1001 0001 0000 0000 0000 0000              ................
00000030 0000 0000 0044 0000 0000 0000 0000 0000              .....D..........
00000040 0000 0000 4c01 fe02 0000 0000 0010 0041              ....L..........A
00000050 0001 0000 2810 0000 d481 0003 0008 0011              ....(...........
00000060 07c0 0000 03c0 0040 0000 0000 0000 0000              .......@........
00000070 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000080 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000090 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000F0 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000100 0001 0001 0000 0000 0000 0000 2010 0006              ................
00000110 0000 0000 0000 0000 00a0 0000 0000 0000              ................
00000120 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000130 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000140 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000150 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000160 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000170 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000180 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000190 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001F0 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000200 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000210 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000220 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000230 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000240 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000250 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000260 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000270 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000280 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000290 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002F0 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000300 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000310 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000320 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000330 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000340 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000350 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000360 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000370 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000380 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000390 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003F0 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000400 0000 0000 0016 0000 04e2 0000 0000 0000              ................
00000410 0004 0000 0001 0000 0000 0000 4040 0000              ............@@..
00000420 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000430 0000 0000 0000 0000 8121 009e b04c 0004              .........!...L..
00000440 0010 0000 0000 0000 0000 0000 0000 0000              ................
00000450 d7ce 0014 1e20 01fc 0000 0000 0c5c 0000              .............\..
00000460 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000470 1957 0032 0011 0b20 0000 0000 0001 0000              .W.2............
00000480 3d48 0000 0000 0000 07f0 0000 0000 0000              =H..............
00000490 07c0 0000 0000 0000 0000 0000 0000 0000              ................


main (lc0)> pci -o read -u 0 -s 0 -b 1 -a 0x0 -l 0xff
 

00     BusNo 1     DevNo 0

00000000 11ab db90 0006 0010 0001 0580 0008 0000              ................
00000010 000c 8000 0000 0000 000c 8400 0000 0000              ................
00000020 0000 0000 0000 0000 0000 0000 11ab 11ab              ................
00000030 0000 0000 0040 0000 0000 0000 0100 0000              .....@..........
00000040 5001 0002 0000 0000 0000 0000 0000 0000              P...............
00000050 6005 0080 0000 0000 0000 0000 0000 0000              `...............
00000060 0010 0011 0080 003c 2000 0000 a411 0003              .......<........
00000070 0008 1011 0000 0000 0000 0000 0000 0000              ................
00000080 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000090 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000F0 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000100 0001 0001 0000 0000 0000 0000 0010 0006              ................
00000110 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000120 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000130 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000140 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000150 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000160 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000170 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000180 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000190 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000001F0 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000200 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000210 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000220 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000230 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000240 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000250 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000260 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000270 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000280 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000290 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000002F0 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000300 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000310 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000320 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000330 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000340 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000350 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000360 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000370 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000380 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000390 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000003F0 0000 0000 0000 0000 0000 0000 

main (lc0)> pci -o read -s 0 -u 0 -a 0x0 -b 2 -l 0x40


00     BusNo 2     DevNo 0

00000000 1957 0032 0006 0010 0011 0b20 0008 0001              .W.2............
00000010 0000 0000 0000 0000 0300 000f 0000 0000              ................
00000020 a000 bff0 1001 0001 0000 0000 0000 0000              ................
00000030 0000 0000 0044 0000 0000 0000 0000 0000              .....D..........
00000040 0000 0000 4c01 fe02 0000 0000 0010 0041              ....L..........A
00000050 0001 0000 2810 0000 d481 0003 0008 0011              ....(...........
00000060 07c0 0000 03c0 0040 0000 0000 0000 0000              .......@........
00000070 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000080 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000090 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000F0 0000 0000 0000 0000 0000 0000 0000 0000              ................


main (lc0)> pci -o read -s 0 -u 0 -a 0x0 -b 3 -l 0x40


00     BusNo 3     DevNo 0

00000000 11ab db90 0006 0010 0001 0580 0008 0000              ................
00000010 000c a000 0000 0000 000c a400 0000 0000              ................
00000020 0000 0000 0000 0000 0000 0000 11ab 11ab              ................
00000030 0000 0000 0040 0000 0000 0000 0100 0000              .....@..........
00000040 5001 0002 0000 0000 0000 0000 0000 0000              P...............
00000050 6005 0080 0000 0000 0000 0000 0000 0000              `...............
00000060 0010 0011 0080 003c 2000 0000 a411 0003              .......<........
00000070 0008 1011 0000 0000 0000 0000 0000 0000              ................
00000080 0000 0000 0000 0000 0000 0000 0000 0000              ................
00000090 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000A0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000B0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000C0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000D0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000E0 0000 0000 0000 0000 0000 0000 0000 0000              ................
000000F0 0000 0000 0000 0000 0000 0000 0000 0000              ................


main (lc0)> mem -o read -a 0xe000a000 -l 0x400

E000A000 $830100f8 $00000000 $00000000 $0010ffff                  ................
E000A010 $0400ffff $00000028 $00000000 $00000000                  .......(........
E000A020 $00000000 $00000000 $00000000 $00000000                  ................
E000A030 $00000000 $00000000 $00000000 $00000000                  ................
E000A040 $00000000 $00000000 $00000000 $00000000                  ................
E000A050 $00000000 $00000000 $00000000 $00000000                  ................
E000A060 $00000000 $00000000 $00000000 $00000000                  ................
E000A070 $00000000 $00000000 $00000000 $00000000                  ................
E000A080 $00000000 $00000000 $00000000 $00000000                  ................
E000A090 $00000000 $00000000 $00000000 $00000000                  ................
E000A0A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A0B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A0C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A0D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A0E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A0F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A100 $00000000 $00000000 $00000000 $00000000                  ................
E000A110 $00000000 $00000000 $00000000 $00000000                  ................
E000A120 $00000000 $00000000 $00000000 $00000000                  ................
E000A130 $00000000 $00000000 $00000000 $00000000                  ................
E000A140 $00000000 $00000000 $00000000 $00000000                  ................
E000A150 $00000000 $00000000 $00000000 $00000000                  ................
E000A160 $00000000 $00000000 $00000000 $00000000                  ................
E000A170 $00000000 $00000000 $00000000 $00000000                  ................
E000A180 $00000000 $00000000 $00000000 $00000000                  ................
E000A190 $00000000 $00000000 $00000000 $00000000                  ................
E000A1A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A1B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A1C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A1D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A1E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A1F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A200 $00000000 $00000000 $00000000 $00000000                  ................
E000A210 $00000000 $00000000 $00000000 $00000000                  ................
E000A220 $00000000 $00000000 $00000000 $00000000                  ................
E000A230 $00000000 $00000000 $00000000 $00000000                  ................
E000A240 $00000000 $00000000 $00000000 $00000000                  ................
E000A250 $00000000 $00000000 $00000000 $00000000                  ................
E000A260 $00000000 $00000000 $00000000 $00000000                  ................
E000A270 $00000000 $00000000 $00000000 $00000000                  ................
E000A280 $00000000 $00000000 $00000000 $00000000                  ................
E000A290 $00000000 $00000000 $00000000 $00000000                  ................
E000A2A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A2B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A2C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A2D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A2E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A2F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A300 $00000000 $00000000 $00000000 $00000000                  ................
E000A310 $00000000 $00000000 $00000000 $00000000                  ................
E000A320 $00000000 $00000000 $00000000 $00000000                  ................
E000A330 $00000000 $00000000 $00000000 $00000000                  ................
E000A340 $00000000 $00000000 $00000000 $00000000                  ................
E000A350 $00000000 $00000000 $00000000 $00000000                  ................
E000A360 $00000000 $00000000 $00000000 $00000000                  ................
E000A370 $00000000 $00000000 $00000000 $00000000                  ................
E000A380 $00000000 $00000000 $00000000 $00000000                  ................
E000A390 $00000000 $00000000 $00000000 $00000000                  ................
E000A3A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A3B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A3C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A3D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A3E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A3F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A400 $00000000 $00000000 $00000000 $00000000                  ................
E000A410 $00000000 $00000000 $00000000 $00000000                  ................
E000A420 $00000000 $00000000 $00000000 $00000000                  ................
E000A430 $00000000 $00000000 $00000000 $00000000                  ................
E000A440 $00000000 $00000000 $00000000 $00000000                  ................
E000A450 $00000000 $00000000 $00000000 $00000000                  ................
E000A460 $00000000 $00000000 $00000000 $00000000                  ................
E000A470 $00000000 $00000000 $00000000 $00000000                  ................
E000A480 $00000000 $00000000 $00000000 $00000000                  ................
E000A490 $00000000 $00000000 $00000000 $00000000                  ................
E000A4A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A4B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A4C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A4D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A4E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A4F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A500 $00000000 $00000000 $00000000 $00000000                  ................
E000A510 $00000000 $00000000 $00000000 $00000000                  ................
E000A520 $00000000 $00000000 $00000000 $00000000                  ................
E000A530 $00000000 $00000000 $00000000 $00000000                  ................
E000A540 $00000000 $00000000 $00000000 $00000000                  ................
E000A550 $00000000 $00000000 $00000000 $00000000                  ................
E000A560 $00000000 $00000000 $00000000 $00000000                  ................
E000A570 $00000000 $00000000 $00000000 $00000000                  ................
E000A580 $00000000 $00000000 $00000000 $00000000                  ................
E000A590 $00000000 $00000000 $00000000 $00000000                  ................
E000A5A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A5B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A5C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A5D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A5E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A5F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A600 $00000000 $00000000 $00000000 $00000000                  ................
E000A610 $00000000 $00000000 $00000000 $00000000                  ................
E000A620 $00000000 $00000000 $00000000 $00000000                  ................
E000A630 $00000000 $00000000 $00000000 $00000000                  ................
E000A640 $00000000 $00000000 $00000000 $00000000                  ................
E000A650 $00000000 $00000000 $00000000 $00000000                  ................
E000A660 $00000000 $00000000 $00000000 $00000000                  ................
E000A670 $00000000 $00000000 $00000000 $00000000                  ................
E000A680 $00000000 $00000000 $00000000 $00000000                  ................
E000A690 $00000000 $00000000 $00000000 $00000000                  ................
E000A6A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A6B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A6C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A6D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A6E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A6F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A700 $00000000 $00000000 $00000000 $00000000                  ................
E000A710 $00000000 $00000000 $00000000 $00000000                  ................
E000A720 $00000000 $00000000 $00000000 $00000000                  ................
E000A730 $00000000 $00000000 $00000000 $00000000                  ................
E000A740 $00000000 $00000000 $00000000 $00000000                  ................
E000A750 $00000000 $00000000 $00000000 $00000000                  ................
E000A760 $00000000 $00000000 $00000000 $00000000                  ................
E000A770 $00000000 $00000000 $00000000 $00000000                  ................
E000A780 $00000000 $00000000 $00000000 $00000000                  ................
E000A790 $00000000 $00000000 $00000000 $00000000                  ................
E000A7A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A7B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A7C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A7D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A7E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A7F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A800 $00000000 $00000000 $00000000 $00000000                  ................
E000A810 $00000000 $00000000 $00000000 $00000000                  ................
E000A820 $00000000 $00000000 $00000000 $00000000                  ................
E000A830 $00000000 $00000000 $00000000 $00000000                  ................
E000A840 $00000000 $00000000 $00000000 $00000000                  ................
E000A850 $00000000 $00000000 $00000000 $00000000                  ................
E000A860 $00000000 $00000000 $00000000 $00000000                  ................
E000A870 $00000000 $00000000 $00000000 $00000000                  ................
E000A880 $00000000 $00000000 $00000000 $00000000                  ................
E000A890 $00000000 $00000000 $00000000 $00000000                  ................
E000A8A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A8B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A8C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A8D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A8E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A8F0 $00000000 $00000000 $00000000 $00000000                  ................
E000A900 $00000000 $00000000 $00000000 $00000000                  ................
E000A910 $00000000 $00000000 $00000000 $00000000                  ................
E000A920 $00000000 $00000000 $00000000 $00000000                  ................
E000A930 $00000000 $00000000 $00000000 $00000000                  ................
E000A940 $00000000 $00000000 $00000000 $00000000                  ................
E000A950 $00000000 $00000000 $00000000 $00000000                  ................
E000A960 $00000000 $00000000 $00000000 $00000000                  ................
E000A970 $00000000 $00000000 $00000000 $00000000                  ................
E000A980 $00000000 $00000000 $00000000 $00000000                  ................
E000A990 $00000000 $00000000 $00000000 $00000000                  ................
E000A9A0 $00000000 $00000000 $00000000 $00000000                  ................
E000A9B0 $00000000 $00000000 $00000000 $00000000                  ................
E000A9C0 $00000000 $00000000 $00000000 $00000000                  ................
E000A9D0 $00000000 $00000000 $00000000 $00000000                  ................
E000A9E0 $00000000 $00000000 $00000000 $00000000                  ................
E000A9F0 $00000000 $00000000 $00000000 $00000000                  ................
E000AA00 $00000000 $00000000 $00000000 $00000000                  ................
E000AA10 $00000000 $00000000 $00000000 $00000000                  ................
E000AA20 $00000000 $00000000 $00000000 $00000000                  ................
E000AA30 $00000000 $00000000 $00000000 $00000000                  ................
E000AA40 $00000000 $00000000 $00000000 $00000000                  ................
E000AA50 $00000000 $00000000 $00000000 $00000000                  ................
E000AA60 $00000000 $00000000 $00000000 $00000000                  ................
E000AA70 $00000000 $00000000 $00000000 $00000000                  ................
E000AA80 $00000000 $00000000 $00000000 $00000000                  ................
E000AA90 $00000000 $00000000 $00000000 $00000000                  ................
E000AAA0 $00000000 $00000000 $00000000 $00000000                  ................
E000AAB0 $00000000 $00000000 $00000000 $00000000                  ................
E000AAC0 $00000000 $00000000 $00000000 $00000000                  ................
E000AAD0 $00000000 $00000000 $00000000 $00000000                  ................
E000AAE0 $00000000 $00000000 $00000000 $00000000                  ................
E000AAF0 $00000000 $00000000 $00000000 $00000000                  ................
E000AB00 $00000000 $00000000 $00000000 $00000000                  ................
E000AB10 $00000000 $00000000 $00000000 $00000000                  ................
E000AB20 $00000000 $00000000 $00000000 $00000000                  ................
E000AB30 $00000000 $00000000 $00000000 $00000000                  ................
E000AB40 $00000000 $00000000 $00000000 $00000000                  ................
E000AB50 $00000000 $00000000 $00000000 $00000000                  ................
E000AB60 $00000000 $00000000 $00000000 $00000000                  ................
E000AB70 $00000000 $00000000 $00000000 $00000000                  ................
E000AB80 $00000000 $00000000 $00000000 $00000000                  ................
E000AB90 $00000000 $00000000 $00000000 $00000000                  ................
E000ABA0 $00000000 $00000000 $00000000 $00000000                  ................
E000ABB0 $00000000 $00000000 $00000000 $00000000                  ................
E000ABC0 $00000000 $00000000 $00000000 $00000000                  ................
E000ABD0 $00000000 $00000000 $00000000 $00000000                  ................
E000ABE0 $00000000 $00000000 $00000000 $00000000                  ................
E000ABF0 $00000000 $00000000 $02080100 $00000000                  ................
E000AC00 $00000000 $00000000 $00000000 $00000000                  ................
E000AC10 $80044023 $00000000 $00000000 $00000000                  ..@#............
E000AC20 $00080000 $00000000 $00080000 $00000000                  ................
E000AC30 $8004401c $00000000 $00000000 $00000000                  ..@.............
E000AC40 $00000000 $00000000 $000e3000 $00000000                  ..........0.....
E000AC50 $80088016 $00000000 $00000000 $00000000                  ................
E000AC60 $00000000 $00000000 $00000000 $00000000                  ................
E000AC70 $00044023 $00000000 $00000000 $00000000                  ..@#............
E000AC80 $00000000 $00000000 $00000000 $00000000                  ................
E000AC90 $00044023 $00000000 $00000000 $00000000                  ..@#............
E000ACA0 $00000000 $00000000 $00000000 $00000000                  ................
E000ACB0 $00000000 $00000000 $00000000 $00000000                  ................
E000ACC0 $00000000 $00000000 $00000000 $00000000                  ................
E000ACD0 $00000000 $00000000 $00000000 $00000000                  ................
E000ACE0 $00000000 $00000000 $00000000 $00000000                  ................
E000ACF0 $00000000 $00000000 $00000000 $00000000                  ................
E000AD00 $00000000 $00000000 $00000000 $00000000                  ................
E000AD10 $00000000 $00000000 $00000000 $00000000                  ................
E000AD20 $00000000 $00000000 $00000000 $00000000                  ................
E000AD30 $00000000 $00000000 $00000000 $00000000                  ................
E000AD40 $00000000 $00000000 $00000000 $00000000                  ................
E000AD50 $00000000 $00000000 $00000000 $00000000                  ................
E000AD60 $00000000 $00000000 $00000000 $00000000                  ................
E000AD70 $00000000 $00000000 $00000000 $00000000                  ................
E000AD80 $00000000 $00000000 $00000000 $00000000                  ................
E000AD90 $00000000 $00000000 $00000000 $00000000                  ................
E000ADA0 $00000000 $00000000 $00000000 $00000000                  ................
E000ADB0 $a0f5501e $00000000 $00000000 $00000000                  ..P.............
E000ADC0 $00000000 $00000000 $00000000 $00000000                  ................
E000ADD0 $20f44023 $00000000 $00000000 $00000000                  ..@#............
E000ADE0 $00000000 $00000000 $00000000 $00000000                  ................
E000ADF0 $20f44023 $00000000 $00000000 $00000000                  ..@#............
E000AE00 $80020000 $00000000 $00bdfe00 $00000000                  ................
E000AE10 $00000000 $00000000 $00000000 $00000000                  ................
E000AE20 $00000041 $00000000 $00000800 $00000000                  ...A............
E000AE30 $00000000 $00000000 $00000000 $00000000                  ................
E000AE40 $00000000 $00000000 $00000000 $00000000                  ................
E000AE50 $00000000 $00000000 $00000000 $00000000                  ................
E000AE60 $00000000 $00000000 $00000000 $00000000                  ................
E000AE70 $00000000 $00000000 $00000000 $00000000                  ................
E000AE80 $00000000 $00000000 $00000000 $00000000                  ................
E000AE90 $00000000 $00000000 $00000000 $00000000                  ................
E000AEA0 $00000000 $00000000 $00000000 $00000000                  ................
E000AEB0 $00000000 $00000000 $00000000 $00000000                  ................
E000AEC0 $00000000 $00000000 $00000000 $00000000                  ................
E000AED0 $00000000 $00000000 $00000000 $00000000                  ................
E000AEE0 $00000000 $00000000 $00000000 $00000000                  ................
E000AEF0 $00000000 $00000000 $00000000 $00000000                  ................
E000AF00 $80400080 $00000000 $00000000 $00000000                  .@..............
E000AF10 $c8800000 $a0000000 $00000000 $00000000                  ................
E000AF20 $00008000 $00000000 $00000000 $00000000                  ................
E000AF30 $00000000 $00000000 $00000000 $00000000                  ................
E000AF40 $00000000 $00000000 $00000000 $00000000                  ................
E000AF50 $00000000 $00000000 $00000000 $00000000                  ................
E000AF60 $00000000 $00000000 $00000000 $00000000                  ................
E000AF70 $00000000 $00000000 $00000000 $00000000                  ................
E000AF80 $00000000 $00000000 $00000000 $00000000                  ................
E000AF90 $00000000 $00000000 $00000000 $00000000                  ................
E000AFA0 $00000000 $00000000 $00000000 $00000000                  ................
E000AFB0 $00000000 $00000000 $00000000 $00000000                  ................
E000AFC0 $00000000 $00000000 $00000000 $00000000                  ................
E000AFD0 $00000000 $00000000 $00000000 $00000000                  ................
E000AFE0 $00000000 $00000000 $00000000 $00000000                  ................
E000AFF0 $00000000 $00000000 $00000000 $00000000                  ................


main (lc0)> mem -o read -a 0xe0009000 0x400

Invalid usage

main (lc0)> mem -o read -a 0xe0009000 -l 0x400

E0009000 $800300fc $00000000 $00000000 $0010ffff                  ................
E0009010 $0400ffff $00000028 $00000000 $00000000                  .......(........
E0009020 $00000000 $00000000 $00000000 $00000000                  ................
E0009030 $00000000 $00000000 $00000000 $00000000                  ................
E0009040 $00000000 $00000000 $00000000 $00000000                  ................
E0009050 $00000000 $00000000 $00000000 $00000000                  ................
E0009060 $00000000 $00000000 $00000000 $00000000                  ................
E0009070 $00000000 $00000000 $00000000 $00000000                  ................
E0009080 $00000000 $00000000 $00000000 $00000000                  ................
E0009090 $00000000 $00000000 $00000000 $00000000                  ................
E00090A0 $00000000 $00000000 $00000000 $00000000                  ................
E00090B0 $00000000 $00000000 $00000000 $00000000                  ................
E00090C0 $00000000 $00000000 $00000000 $00000000                  ................
E00090D0 $00000000 $00000000 $00000000 $00000000                  ................
E00090E0 $00000000 $00000000 $00000000 $00000000                  ................
E00090F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009100 $00000000 $00000000 $00000000 $00000000                  ................
E0009110 $00000000 $00000000 $00000000 $00000000                  ................
E0009120 $00000000 $00000000 $00000000 $00000000                  ................
E0009130 $00000000 $00000000 $00000000 $00000000                  ................
E0009140 $00000000 $00000000 $00000000 $00000000                  ................
E0009150 $00000000 $00000000 $00000000 $00000000                  ................
E0009160 $00000000 $00000000 $00000000 $00000000                  ................
E0009170 $00000000 $00000000 $00000000 $00000000                  ................
E0009180 $00000000 $00000000 $00000000 $00000000                  ................
E0009190 $00000000 $00000000 $00000000 $00000000                  ................
E00091A0 $00000000 $00000000 $00000000 $00000000                  ................
E00091B0 $00000000 $00000000 $00000000 $00000000                  ................
E00091C0 $00000000 $00000000 $00000000 $00000000                  ................
E00091D0 $00000000 $00000000 $00000000 $00000000                  ................
E00091E0 $00000000 $00000000 $00000000 $00000000                  ................
E00091F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009200 $00000000 $00000000 $00000000 $00000000                  ................
E0009210 $00000000 $00000000 $00000000 $00000000                  ................
E0009220 $00000000 $00000000 $00000000 $00000000                  ................
E0009230 $00000000 $00000000 $00000000 $00000000                  ................
E0009240 $00000000 $00000000 $00000000 $00000000                  ................
E0009250 $00000000 $00000000 $00000000 $00000000                  ................
E0009260 $00000000 $00000000 $00000000 $00000000                  ................
E0009270 $00000000 $00000000 $00000000 $00000000                  ................
E0009280 $00000000 $00000000 $00000000 $00000000                  ................
E0009290 $00000000 $00000000 $00000000 $00000000                  ................
E00092A0 $00000000 $00000000 $00000000 $00000000                  ................
E00092B0 $00000000 $00000000 $00000000 $00000000                  ................
E00092C0 $00000000 $00000000 $00000000 $00000000                  ................
E00092D0 $00000000 $00000000 $00000000 $00000000                  ................
E00092E0 $00000000 $00000000 $00000000 $00000000                  ................
E00092F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009300 $00000000 $00000000 $00000000 $00000000                  ................
E0009310 $00000000 $00000000 $00000000 $00000000                  ................
E0009320 $00000000 $00000000 $00000000 $00000000                  ................
E0009330 $00000000 $00000000 $00000000 $00000000                  ................
E0009340 $00000000 $00000000 $00000000 $00000000                  ................
E0009350 $00000000 $00000000 $00000000 $00000000                  ................
E0009360 $00000000 $00000000 $00000000 $00000000                  ................
E0009370 $00000000 $00000000 $00000000 $00000000                  ................
E0009380 $00000000 $00000000 $00000000 $00000000                  ................
E0009390 $00000000 $00000000 $00000000 $00000000                  ................
E00093A0 $00000000 $00000000 $00000000 $00000000                  ................
E00093B0 $00000000 $00000000 $00000000 $00000000                  ................
E00093C0 $00000000 $00000000 $00000000 $00000000                  ................
E00093D0 $00000000 $00000000 $00000000 $00000000                  ................
E00093E0 $00000000 $00000000 $00000000 $00000000                  ................
E00093F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009400 $00000000 $00000000 $00000000 $00000000                  ................
E0009410 $00000000 $00000000 $00000000 $00000000                  ................
E0009420 $00000000 $00000000 $00000000 $00000000                  ................
E0009430 $00000000 $00000000 $00000000 $00000000                  ................
E0009440 $00000000 $00000000 $00000000 $00000000                  ................
E0009450 $00000000 $00000000 $00000000 $00000000                  ................
E0009460 $00000000 $00000000 $00000000 $00000000                  ................
E0009470 $00000000 $00000000 $00000000 $00000000                  ................
E0009480 $00000000 $00000000 $00000000 $00000000                  ................
E0009490 $00000000 $00000000 $00000000 $00000000                  ................
E00094A0 $00000000 $00000000 $00000000 $00000000                  ................
E00094B0 $00000000 $00000000 $00000000 $00000000                  ................
E00094C0 $00000000 $00000000 $00000000 $00000000                  ................
E00094D0 $00000000 $00000000 $00000000 $00000000                  ................
E00094E0 $00000000 $00000000 $00000000 $00000000                  ................
E00094F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009500 $00000000 $00000000 $00000000 $00000000                  ................
E0009510 $00000000 $00000000 $00000000 $00000000                  ................
E0009520 $00000000 $00000000 $00000000 $00000000                  ................
E0009530 $00000000 $00000000 $00000000 $00000000                  ................
E0009540 $00000000 $00000000 $00000000 $00000000                  ................
E0009550 $00000000 $00000000 $00000000 $00000000                  ................
E0009560 $00000000 $00000000 $00000000 $00000000                  ................
E0009570 $00000000 $00000000 $00000000 $00000000                  ................
E0009580 $00000000 $00000000 $00000000 $00000000                  ................
E0009590 $00000000 $00000000 $00000000 $00000000                  ................
E00095A0 $00000000 $00000000 $00000000 $00000000                  ................
E00095B0 $00000000 $00000000 $00000000 $00000000                  ................
E00095C0 $00000000 $00000000 $00000000 $00000000                  ................
E00095D0 $00000000 $00000000 $00000000 $00000000                  ................
E00095E0 $00000000 $00000000 $00000000 $00000000                  ................
E00095F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009600 $00000000 $00000000 $00000000 $00000000                  ................
E0009610 $00000000 $00000000 $00000000 $00000000                  ................
E0009620 $00000000 $00000000 $00000000 $00000000                  ................
E0009630 $00000000 $00000000 $00000000 $00000000                  ................
E0009640 $00000000 $00000000 $00000000 $00000000                  ................
E0009650 $00000000 $00000000 $00000000 $00000000                  ................
E0009660 $00000000 $00000000 $00000000 $00000000                  ................
E0009670 $00000000 $00000000 $00000000 $00000000                  ................
E0009680 $00000000 $00000000 $00000000 $00000000                  ................
E0009690 $00000000 $00000000 $00000000 $00000000                  ................
E00096A0 $00000000 $00000000 $00000000 $00000000                  ................
E00096B0 $00000000 $00000000 $00000000 $00000000                  ................
E00096C0 $00000000 $00000000 $00000000 $00000000                  ................
E00096D0 $00000000 $00000000 $00000000 $00000000                  ................
E00096E0 $00000000 $00000000 $00000000 $00000000                  ................
E00096F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009700 $00000000 $00000000 $00000000 $00000000                  ................
E0009710 $00000000 $00000000 $00000000 $00000000                  ................
E0009720 $00000000 $00000000 $00000000 $00000000                  ................
E0009730 $00000000 $00000000 $00000000 $00000000                  ................
E0009740 $00000000 $00000000 $00000000 $00000000                  ................
E0009750 $00000000 $00000000 $00000000 $00000000                  ................
E0009760 $00000000 $00000000 $00000000 $00000000                  ................
E0009770 $00000000 $00000000 $00000000 $00000000                  ................
E0009780 $00000000 $00000000 $00000000 $00000000                  ................
E0009790 $00000000 $00000000 $00000000 $00000000                  ................
E00097A0 $00000000 $00000000 $00000000 $00000000                  ................
E00097B0 $00000000 $00000000 $00000000 $00000000                  ................
E00097C0 $00000000 $00000000 $00000000 $00000000                  ................
E00097D0 $00000000 $00000000 $00000000 $00000000                  ................
E00097E0 $00000000 $00000000 $00000000 $00000000                  ................
E00097F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009800 $00000000 $00000000 $00000000 $00000000                  ................
E0009810 $00000000 $00000000 $00000000 $00000000                  ................
E0009820 $00000000 $00000000 $00000000 $00000000                  ................
E0009830 $00000000 $00000000 $00000000 $00000000                  ................
E0009840 $00000000 $00000000 $00000000 $00000000                  ................
E0009850 $00000000 $00000000 $00000000 $00000000                  ................
E0009860 $00000000 $00000000 $00000000 $00000000                  ................
E0009870 $00000000 $00000000 $00000000 $00000000                  ................
E0009880 $00000000 $00000000 $00000000 $00000000                  ................
E0009890 $00000000 $00000000 $00000000 $00000000                  ................
E00098A0 $00000000 $00000000 $00000000 $00000000                  ................
E00098B0 $00000000 $00000000 $00000000 $00000000                  ................
E00098C0 $00000000 $00000000 $00000000 $00000000                  ................
E00098D0 $00000000 $00000000 $00000000 $00000000                  ................
E00098E0 $00000000 $00000000 $00000000 $00000000                  ................
E00098F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009900 $00000000 $00000000 $00000000 $00000000                  ................
E0009910 $00000000 $00000000 $00000000 $00000000                  ................
E0009920 $00000000 $00000000 $00000000 $00000000                  ................
E0009930 $00000000 $00000000 $00000000 $00000000                  ................
E0009940 $00000000 $00000000 $00000000 $00000000                  ................
E0009950 $00000000 $00000000 $00000000 $00000000                  ................
E0009960 $00000000 $00000000 $00000000 $00000000                  ................
E0009970 $00000000 $00000000 $00000000 $00000000                  ................
E0009980 $00000000 $00000000 $00000000 $00000000                  ................
E0009990 $00000000 $00000000 $00000000 $00000000                  ................
E00099A0 $00000000 $00000000 $00000000 $00000000                  ................
E00099B0 $00000000 $00000000 $00000000 $00000000                  ................
E00099C0 $00000000 $00000000 $00000000 $00000000                  ................
E00099D0 $00000000 $00000000 $00000000 $00000000                  ................
E00099E0 $00000000 $00000000 $00000000 $00000000                  ................
E00099F0 $00000000 $00000000 $00000000 $00000000                  ................
E0009A00 $00000000 $00000000 $00000000 $00000000                  ................
E0009A10 $00000000 $00000000 $00000000 $00000000                  ................
E0009A20 $00000000 $00000000 $00000000 $00000000                  ................
E0009A30 $00000000 $00000000 $00000000 $00000000                  ................
E0009A40 $00000000 $00000000 $00000000 $00000000                  ................
E0009A50 $00000000 $00000000 $00000000 $00000000                  ................
E0009A60 $00000000 $00000000 $00000000 $00000000                  ................
E0009A70 $00000000 $00000000 $00000000 $00000000                  ................
E0009A80 $00000000 $00000000 $00000000 $00000000                  ................
E0009A90 $00000000 $00000000 $00000000 $00000000                  ................
E0009AA0 $00000000 $00000000 $00000000 $00000000                  ................
E0009AB0 $00000000 $00000000 $00000000 $00000000                  ................
E0009AC0 $00000000 $00000000 $00000000 $00000000                  ................
E0009AD0 $00000000 $00000000 $00000000 $00000000                  ................
E0009AE0 $00000000 $00000000 $00000000 $00000000                  ................
E0009AF0 $00000000 $00000000 $00000000 $00000000                  ................
E0009B00 $00000000 $00000000 $00000000 $00000000                  ................
E0009B10 $00000000 $00000000 $00000000 $00000000                  ................
E0009B20 $00000000 $00000000 $00000000 $00000000                  ................
E0009B30 $00000000 $00000000 $00000000 $00000000                  ................
E0009B40 $00000000 $00000000 $00000000 $00000000                  ................
E0009B50 $00000000 $00000000 $00000000 $00000000                  ................
E0009B60 $00000000 $00000000 $00000000 $00000000                  ................
E0009B70 $00000000 $00000000 $00000000 $00000000                  ................
E0009B80 $00000000 $00000000 $00000000 $00000000                  ................
E0009B90 $00000000 $00000000 $00000000 $00000000                  ................
E0009BA0 $00000000 $00000000 $00000000 $00000000                  ................
E0009BB0 $00000000 $00000000 $00000000 $00000000                  ................
E0009BC0 $00000000 $00000000 $00000000 $00000000                  ................
E0009BD0 $00000000 $00000000 $00000000 $00000000                  ................
E0009BE0 $00000000 $00000000 $00000000 $00000000                  ................
E0009BF0 $00000000 $00000000 $02080100 $00000000                  ................
E0009C00 $00000000 $00000000 $00000000 $00000000                  ................
E0009C10 $80044023 $00000000 $00000000 $00000000                  ..@#............
E0009C20 $000a0000 $00000000 $000a0000 $00000000                  ................
E0009C30 $8004401c $00000000 $00000000 $00000000                  ..@.............
E0009C40 $00000000 $00000000 $000e3800 $00000000                  ..........8.....
E0009C50 $80088016 $00000000 $00000000 $00000000                  ................
E0009C60 $00000000 $00000000 $00000000 $00000000                  ................
E0009C70 $00044023 $00000000 $00000000 $00000000                  ..@#............
E0009C80 $00000000 $00000000 $00000000 $00000000                  ................
E0009C90 $00044023 $00000000 $00000000 $00000000                  ..@#............
E0009CA0 $00000000 $00000000 $00000000 $00000000                  ................
E0009CB0 $00000000 $00000000 $00000000 $00000000                  ................
E0009CC0 $00000000 $00000000 $00000000 $00000000                  ................
E0009CD0 $00000000 $00000000 $00000000 $00000000                  ................
E0009CE0 $00000000 $00000000 $00000000 $00000000                  ................
E0009CF0 $00000000 $00000000 $00000000 $00000000                  ................
E0009D00 $00000000 $00000000 $00000000 $00000000                  ................
E0009D10 $00000000 $00000000 $00000000 $00000000                  ................
E0009D20 $00000000 $00000000 $00000000 $00000000                  ................
E0009D30 $00000000 $00000000 $00000000 $00000000                  ................
E0009D40 $00000000 $00000000 $00000000 $00000000                  ................
E0009D50 $00000000 $00000000 $00000000 $00000000                  ................
E0009D60 $00000000 $00000000 $00000000 $00000000                  ................
E0009D70 $00000000 $00000000 $00000000 $00000000                  ................
E0009D80 $00000000 $00000000 $00000000 $00000000                  ................
E0009D90 $00000000 $00000000 $00000000 $00000000                  ................
E0009DA0 $00000000 $00000000 $00000000 $00000000                  ................
E0009DB0 $a0f5501e $00000000 $00000000 $00000000                  ..P.............
E0009DC0 $00000000 $00000000 $00000000 $00000000                  ................
E0009DD0 $20f44023 $00000000 $00000000 $00000000                  ..@#............
E0009DE0 $00000000 $00000000 $00000000 $00000000                  ................
E0009DF0 $20f44023 $00000000 $00000000 $00000000                  ..@#............
E0009E00 $80020000 $00000000 $00bdfe00 $00000000                  ................
E0009E10 $00000000 $00000000 $00000000 $00000000                  ................
E0009E20 $00000041 $00000000 $00000800 $00000000                  ...A............
E0009E30 $00000000 $00000000 $00000000 $00000000                  ................
E0009E40 $00000000 $00000000 $00000000 $00000000                  ................
E0009E50 $00000000 $00000000 $00000000 $00000000                  ................
E0009E60 $00000000 $00000000 $00000000 $00000000                  ................
E0009E70 $00000000 $00000000 $00000000 $00000000                  ................
E0009E80 $00000000 $00000000 $00000000 $00000000                  ................
E0009E90 $00000000 $00000000 $00000000 $00000000                  ................
E0009EA0 $00000000 $00000000 $00000000 $00000000                  ................
E0009EB0 $00000000 $00000000 $00000000 $00000000                  ................
E0009EC0 $00000000 $00000000 $00000000 $00000000                  ................
E0009ED0 $00000000 $00000000 $00000000 $00000000                  ................
E0009EE0 $00000000 $00000000 $00000000 $00000000                  ................
E0009EF0 $00000000 $00000000 $00000000 $00000000                  ................
E0009F00 $80400080 $00000000 $00000000 $00000000                  .@..............
E0009F10 $c8800000 $a0000000 $00000000 $00000000                  ................
E0009F20 $00008000 $00000000 $00000000 $00000000                  ................
E0009F30 $00000000 $00000000 $00000000 $00000000                  ................
E0009F40 $00000000 $00000000 $00000000 $00000000                  ................
E0009F50 $00000000 $00000000 $00000000 $00000000                  ................
E0009F60 $00000000 $00000000 $00000000 $00000000                  ................
E0009F70 $00000000 $00000000 $00000000 $00000000                  ................
E0009F80 $00000000 $00000000 $00000000 $00000000                  ................
E0009F90 $00000000 $00000000 $00000000 $00000000                  ................
E0009FA0 $00000000 $00000000 $00000000 $00000000                  ................
E0009FB0 $00000000 $00000000 $00000000 $00000000                  ................
E0009FC0 $00000000 $00000000 $00000000 $00000000                  ................
E0009FD0 $00000000 $00000000 $00000000 $00000000                  ................
E0009FE0 $00000000 $00000000 $00000000 $00000000                  ................
E0009FF0 $00000000 $00000000 $00000000 $00000000                  ................


main (lc0)>
Benjamin Herrenschmidt June 15, 2010, 7:12 a.m. UTC | #7
On Tue, 2010-06-15 at 15:05 +0800, jxnuxdy wrote:
> Thanks Benjamin, the regions don't display as what we expect, that's why we suspect if there any configuration probelms in CPU host bridge, but we changed the uboot/linux a lot, seems take no effect on that problems.
> 
> We use CPU MPC8544, and connect two PCIE devices to CPU PCIE1 and PCIE2 directly without a  extended PCIE bridge, so we disabled PCIE3 and PCI controlers in uboot level.
> 
> More settings pls take a look at the attach file log.txt.

I'm not familiar with those freescale parts, so I'll let others comment
on your settings since it's most likely to be where the problem is.

Cheers,
Ben.

> 
> Many thanks,
> Denny
> ----------------------------------------------------------------------------------------------------------------------------
> 在2010-06-11 15:21:24,"Benjamin Herrenschmidt" <benh@kernel.crashing.org> 写道:
> >On Fri, 2010-06-11 at 09:30 +0800, jxnuxdy wrote:
> >> Hi guys,
> >> 
> >> I encountered a PCIe problem under linux, the two PCIe bus on my board seems work, 
> >> at least I can access the registers through the PCIe bus, however the dma for the
> >> PCIe bus can't work, so I just dumped the pci device, but I am curiously to find
> >> there is no regions displayed on PCIe controlers, why? is it relate with my 'dma' issue then?
> >
> >It would help if you told us a bit more what the HW is, what you are
> >doing with it, etc...
> >
> >IE. What is your host, what is your device, what platform, etc...
> >
> >DMA should work provided that your platform code sets it up properly.
> >The DMA regions don't appear in /proc/pci or lspci.
> >
> >Cheers,
> >Ben.
> >
> >> 
> >> bash-2.04# cat /proc/pci
> >> PCI devices found:
> >>   Bus  0, device   0, function  0:
> >>     Class 0b20  Header Type 01: PCI device 1957:0032 (rev 17).
> >>   Bus  1, device   0, function  0:
> >>     Class 0580  Header Type 00: PCI device 11ab:db90 (rev 1).
> >>       Prefetchable 64 bit memory at 0x80000000 [0x800fffff].
> >>       Prefetchable 64 bit memory at 0x84000000 [0x87ffffff].
> >>   Bus  9, device   0, function  0:
> >>     Class 0b20  Header Type 01: PCI device 1957:0032 (rev 17).
> >>   Bus 10, device   0, function  0:
> >>     Class 0580  Header Type 00: PCI device 11ab:db90 (rev 1).
> >>       Prefetchable 64 bit memory at 0xa0000000 [0xa00fffff].
> >>       Prefetchable 64 bit memory at 0xa4000000 [0xa7ffffff].
> >> bash-2.04# lspci -vv
> >> 00:00.0 Power PC: Unknown device 1957:0032 (rev 11)
> >>         !!! Invalid class 0b20 for header type 01
> >>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
> >>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
> >>         Latency: 0, cache line size 08
> >>         Bus: primary=00, secondary=01, subordinate=06, sec-latency=0
> >>         I/O behind bridge: 00000000-00000fff
> >>         Memory behind bridge: 80000000-9fffffff
> >>         BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> >>         Capabilities: [44] Power Management version 2
> >>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
> >>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
> >>         Capabilities: [4c] #10 [0041]
> >> 
> >> 01:00.0 Memory controller: Galileo Technology Ltd.: Unknown device db90 (rev 01)
> >>         Subsystem: Galileo Technology Ltd.: Unknown device 11ab
> >>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
> >>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
> >>         Latency: 0, cache line size 08
> >>         Interrupt: pin A routed to IRQ 0
> >>         Region 0: Memory at 80000000 (64-bit, prefetchable) [size=1M]
> >>         Region 2: Memory at 84000000 (64-bit, prefetchable) [size=64M]
> >>         Capabilities: [40] Power Management version 2
> >>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
> >>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
> >>         Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
> >>                 Address: 0000000000000000  Data: 0000
> >>         Capabilities: [60] #10 [0011]
> >> 
> >> 09:00.0 Power PC: Unknown device 1957:0032 (rev 11)
> >>         !!! Invalid class 0b20 for header type 01
> >>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
> >>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
> >>         Latency: 0, cache line size 08
> >>         Bus: primary=00, secondary=0a, subordinate=0f, sec-latency=0
> >>         I/O behind bridge: 00000000-00000fff
> >>         Memory behind bridge: a0000000-bfffffff
> >>         BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> >>         Capabilities: [44] Power Management version 2
> >>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
> >>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
> >>         Capabilities: [4c] #10 [0041]
> >> 
> >> 0a:00.0 Memory controller: Galileo Technology Ltd.: Unknown device db90 (rev 01)
> >>         Subsystem: Galileo Technology Ltd.: Unknown device 11ab
> >>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
> >>         Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
> >>         Latency: 0, cache line size 08
> >>         Interrupt: pin A routed to IRQ 0
> >>         Region 0: Memory at a0000000 (64-bit, prefetchable) [size=1M]
> >>         Region 2: Memory at a4000000 (64-bit, prefetchable) [size=64M]
> >>         Capabilities: [40] Power Management version 2
> >>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
> >>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
> >>         Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
> >>                 Address: 0000000000000000  Data: 0000
> >>         Capabilities: [60] #10 [0011]
> >> 
> >> bash-2.04# 
> >> 
> >> Thanks
> >> Denny
> >> 
> >> _______________________________________________
> >> Linuxppc-dev mailing list
> >> Linuxppc-dev@lists.ozlabs.org
> >> https://lists.ozlabs.org/listinfo/linuxppc-dev
> >
> >
> >_______________________________________________
> >Linuxppc-dev mailing list
> >Linuxppc-dev@lists.ozlabs.org
> >https://lists.ozlabs.org/listinfo/linuxppc-dev
Grant Likely June 17, 2010, 11:11 p.m. UTC | #8
On Thu, Jun 10, 2010 at 7:17 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Thu, 2010-06-10 at 17:36 -0600, Grant Likely wrote:
>>
>> Okay.  I had been trying to avoid #ifdefs in the common code, but
>> you're probably right.  I'll rework.
>
> Not even ifdef's ... just move the quirk map there. You can always
> #define the quirk variable to 0 on archs that have no quirks, to
> make it compile away if you believe it represents bloat, but they
> are simple well localized things so I doubt it matters.

They're pretty small, but powermac32 is the only code that actually
uses the quirk facility.  Everything else parses sanely it would
appear.  I'd rather have them localized to the powermac code and
eliminate the quirks from the common code.

If other platforms show up with bad irq mappings, then I want to take
the approach of fixing the data rather than adding more quirks cases.

Anyway, let me try my hand at reworking to be a lot clearer and see
what it looks like.

g.
Benjamin Herrenschmidt June 17, 2010, 11:57 p.m. UTC | #9
On Thu, 2010-06-17 at 17:11 -0600, Grant Likely wrote:
> On Thu, Jun 10, 2010 at 7:17 PM, Benjamin Herrenschmidt
> <benh@kernel.crashing.org> wrote:
> > On Thu, 2010-06-10 at 17:36 -0600, Grant Likely wrote:
> >>
> >> Okay.  I had been trying to avoid #ifdefs in the common code, but
> >> you're probably right.  I'll rework.
> >
> > Not even ifdef's ... just move the quirk map there. You can always
> > #define the quirk variable to 0 on archs that have no quirks, to
> > make it compile away if you believe it represents bloat, but they
> > are simple well localized things so I doubt it matters.
> 
> They're pretty small, but powermac32 is the only code that actually
> uses the quirk facility.  Everything else parses sanely it would
> appear.  I'd rather have them localized to the powermac code and
> eliminate the quirks from the common code.

Maybe, but the way you end up gutting out some internal functions of the
parser so they can be overriden by the arch is just plain gross :-) And
more bloat than just having a localized quirk test which can easily
compile to nothing when powermac isn't built.

IE. I'd rather you then add some kind of of_irq_map_fixup() or something
like that in the generic code that can be an empty inline when powermac
isn't there, and be defined by powerpc to do the right thing then,
rather than move the core of the function to a separate weak version.

Because the day you fix a bug in the weak variant, or change a calling
convention, you'll forget to also update the "overrides" in the arch.

> If other platforms show up with bad irq mappings, then I want to take
> the approach of fixing the data rather than adding more quirks cases.
> 
> Anyway, let me try my hand at reworking to be a lot clearer and see
> what it looks like.

Ben.
Grant Likely June 18, 2010, 12:39 a.m. UTC | #10
On Thu, Jun 17, 2010 at 5:57 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Thu, 2010-06-17 at 17:11 -0600, Grant Likely wrote:
>> On Thu, Jun 10, 2010 at 7:17 PM, Benjamin Herrenschmidt
>> <benh@kernel.crashing.org> wrote:
>> > On Thu, 2010-06-10 at 17:36 -0600, Grant Likely wrote:
>> >>
>> >> Okay.  I had been trying to avoid #ifdefs in the common code, but
>> >> you're probably right.  I'll rework.
>> >
>> > Not even ifdef's ... just move the quirk map there. You can always
>> > #define the quirk variable to 0 on archs that have no quirks, to
>> > make it compile away if you believe it represents bloat, but they
>> > are simple well localized things so I doubt it matters.
>>
>> They're pretty small, but powermac32 is the only code that actually
>> uses the quirk facility.  Everything else parses sanely it would
>> appear.  I'd rather have them localized to the powermac code and
>> eliminate the quirks from the common code.
>
> Maybe, but the way you end up gutting out some internal functions of the
> parser so they can be overriden by the arch is just plain gross :-)

Heh, I won't dispute that.  Give me a day or so.  If I can't come up
with anything better, then I'll just move it all over.

g.
diff mbox

Patch

diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index 89fca70..3659930 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -107,9 +107,6 @@  extern const void *of_get_mac_address(struct device_node *np);
 struct pci_dev;
 extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
 
-extern int of_irq_to_resource(struct device_node *dev, int index,
-			struct resource *r);
-
 /**
  * of_iomap - Maps the memory mapped IO for a given device_node
  * @device:	the device whose io range will be mapped
diff --git a/arch/microblaze/kernel/prom_parse.c b/arch/microblaze/kernel/prom_parse.c
index 02ec946..70c0471 100644
--- a/arch/microblaze/kernel/prom_parse.c
+++ b/arch/microblaze/kernel/prom_parse.c
@@ -656,49 +656,7 @@  struct device_node *of_irq_find_parent_by_phandle(phandle p)
 int of_irq_map_one(struct device_node *device,
 			int index, struct of_irq *out_irq)
 {
-	struct device_node *p;
-	const u32 *intspec, *tmp, *addr;
-	u32 intsize, intlen;
-	int res;
-
-	pr_debug("of_irq_map_one: dev=%s, index=%d\n",
-			device->full_name, index);
-
-	/* Get the interrupts property */
-	intspec = of_get_property(device, "interrupts", (int *) &intlen);
-	if (intspec == NULL)
-		return -EINVAL;
-	intlen /= sizeof(u32);
-
-	pr_debug(" intspec=%d intlen=%d\n", *intspec, intlen);
-
-	/* Get the reg property (if any) */
-	addr = of_get_property(device, "reg", NULL);
-
-	/* Look for the interrupt parent. */
-	p = of_irq_find_parent(device);
-	if (p == NULL)
-		return -EINVAL;
-
-	/* Get size of interrupt specifier */
-	tmp = of_get_property(p, "#interrupt-cells", NULL);
-	if (tmp == NULL) {
-		of_node_put(p);
-		return -EINVAL;
-	}
-	intsize = *tmp;
-
-	pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
-
-	/* Check index */
-	if ((index + 1) * intsize > intlen)
-		return -EINVAL;
-
-	/* Get new specifier and map it */
-	res = of_irq_map_raw(p, intspec + index * intsize, intsize,
-				addr, out_irq);
-	of_node_put(p);
-	return res;
+	return __of_irq_map_one(device, index, out_irq);
 }
 EXPORT_SYMBOL_GPL(of_irq_map_one);
 
@@ -740,35 +698,6 @@  const void *of_get_mac_address(struct device_node *np)
 }
 EXPORT_SYMBOL(of_get_mac_address);
 
-int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
-{
-	struct of_irq out_irq;
-	int irq;
-	int res;
-
-	res = of_irq_map_one(dev, index, &out_irq);
-
-	/* Get irq for the device */
-	if (res) {
-		pr_debug("IRQ not found... code = %d", res);
-		return NO_IRQ;
-	}
-	/* Assuming single interrupt controller... */
-	irq = out_irq.specifier[0];
-
-	pr_debug("IRQ found = %d", irq);
-
-	/* Only dereference the resource if both the
-	 * resource and the irq are valid. */
-	if (r && irq != NO_IRQ) {
-		r->start = r->end = irq;
-		r->flags = IORESOURCE_IRQ;
-	}
-
-	return irq;
-}
-EXPORT_SYMBOL_GPL(of_irq_to_resource);
-
 void __iomem *of_iomap(struct device_node *np, int index)
 {
 	struct resource res;
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 187ef4e..2440984 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -136,9 +136,6 @@  extern void of_irq_map_init(unsigned int flags);
 struct pci_dev;
 extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
 
-extern int of_irq_to_resource(struct device_node *dev, int index,
-			struct resource *r);
-
 /**
  * of_iomap - Maps the memory mapped IO for a given device_node
  * @device:	the device whose io range will be mapped
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 89ca7b3..ef518e3 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -777,49 +777,11 @@  static int of_irq_map_oldworld(struct device_node *device, int index,
 
 int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq)
 {
-	struct device_node *p;
-	const u32 *intspec, *tmp, *addr;
-	u32 intsize, intlen;
-	int res = -EINVAL;
-
-	DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index);
-
 	/* OldWorld mac stuff is "special", handle out of line */
 	if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
 		return of_irq_map_oldworld(device, index, out_irq);
 
-	/* Get the interrupts property */
-	intspec = of_get_property(device, "interrupts", &intlen);
-	if (intspec == NULL)
-		return -EINVAL;
-	intlen /= sizeof(u32);
-
-	/* Get the reg property (if any) */
-	addr = of_get_property(device, "reg", NULL);
-
-	/* Look for the interrupt parent. */
-	p = of_irq_find_parent(device);
-	if (p == NULL)
-		return -EINVAL;
-
-	/* Get size of interrupt specifier */
-	tmp = of_get_property(p, "#interrupt-cells", NULL);
-	if (tmp == NULL)
-		goto out;
-	intsize = *tmp;
-
-	DBG(" intsize=%d intlen=%d\n", intsize, intlen);
-
-	/* Check index */
-	if ((index + 1) * intsize > intlen)
-		goto out;
-
-	/* Get new specifier and map it */
-	res = of_irq_map_raw(p, intspec + index * intsize, intsize,
-			     addr, out_irq);
-out:
-	of_node_put(p);
-	return res;
+	return __of_irq_map_one(device, index, out_irq);
 }
 EXPORT_SYMBOL_GPL(of_irq_map_one);
 
@@ -861,21 +823,6 @@  const void *of_get_mac_address(struct device_node *np)
 }
 EXPORT_SYMBOL(of_get_mac_address);
 
-int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
-{
-	int irq = irq_of_parse_and_map(dev, index);
-
-	/* Only dereference the resource if both the
-	 * resource and the irq are valid. */
-	if (r && irq != NO_IRQ) {
-		r->start = r->end = irq;
-		r->flags = IORESOURCE_IRQ;
-	}
-
-	return irq;
-}
-EXPORT_SYMBOL_GPL(of_irq_to_resource);
-
 void __iomem *of_iomap(struct device_node *np, int index)
 {
 	struct resource res;
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 351c87a..dd420e5 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -31,7 +31,7 @@ 
  * Returns a pointer to the interrupt parent node, or NULL if the interrupt
  * parent could not be determined.
  */
-struct device_node *of_irq_find_parent(struct device_node *child)
+static struct device_node *of_irq_find_parent(struct device_node *child)
 {
 	struct device_node *p;
 	const phandle *parp;
@@ -240,6 +240,67 @@  int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
 }
 EXPORT_SYMBOL_GPL(of_irq_map_raw);
 
+/**
+ * of_irq_map_one - Resolve an interrupt for a device
+ * @device: the device whose interrupt is to be resolved
+ * @index: index of the interrupt to resolve
+ * @out_irq: structure of_irq filled by this function
+ *
+ * This function resolves an interrupt, walking the tree, for a given
+ * device-tree node. It's the high level pendant to of_irq_map_raw().
+ *
+ * Architecture code must provide of_irq_map_one() which can simply be a
+ * wrapper around __of_irq_map_one(), or can override it to deal with
+ * arch specific quirks and bugs.
+ */
+int __of_irq_map_one(struct device_node *device, int index,
+		     struct of_irq *out_irq)
+{
+	struct device_node *p;
+	const u32 *intspec, *tmp, *addr;
+	u32 intsize, intlen;
+	int res = -EINVAL;
+
+	pr_debug("of_irq_map_one: dev=%s, index=%d\n",
+		 device->full_name, index);
+
+	/* Get the interrupts property */
+	intspec = of_get_property(device, "interrupts", &intlen);
+	if (intspec == NULL)
+		return -EINVAL;
+	intlen /= sizeof(u32);
+
+	pr_debug(" intspec=%d intlen=%d\n", *intspec, intlen);
+
+	/* Get the reg property (if any) */
+	addr = of_get_property(device, "reg", NULL);
+
+	/* Look for the interrupt parent. */
+	p = of_irq_find_parent(device);
+	if (p == NULL)
+		return -EINVAL;
+
+	/* Get size of interrupt specifier */
+	tmp = of_get_property(p, "#interrupt-cells", NULL);
+	if (tmp == NULL)
+		goto out;
+	intsize = *tmp;
+
+	pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
+
+	/* Check index */
+	if ((index + 1) * intsize > intlen)
+		goto out;
+
+	/* Get new specifier and map it */
+	res = of_irq_map_raw(p, intspec + index * intsize, intsize,
+			     addr, out_irq);
+ out:
+	of_node_put(p);
+	return res;
+}
+EXPORT_SYMBOL_GPL(__of_irq_map_one);
+
 unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
 {
 	struct of_irq oirq;
@@ -251,3 +312,25 @@  unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
 				     oirq.size);
 }
 EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
+
+/**
+ * of_irq_to_resource - Decode a node's IRQ and return it as a resource
+ * @dev: pointer to device tree node
+ * @index: zero-based index of the irq
+ * @r: pointer to resource structure to return result into.
+ */
+unsigned int of_irq_to_resource(struct device_node *dev, int index,
+				struct resource *r)
+{
+	unsigned int irq = irq_of_parse_and_map(dev, index);
+
+	/* Only dereference the resource if both the
+	 * resource and the irq are valid. */
+	if (r && irq != NO_IRQ) {
+		r->start = r->end = irq;
+		r->flags = IORESOURCE_IRQ;
+	}
+
+	return irq;
+}
+EXPORT_SYMBOL_GPL(of_irq_to_resource);
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index 51c520b..935a14d 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -5,6 +5,7 @@ 
 struct of_irq;
 #include <linux/types.h>
 #include <linux/of.h>
+#include <linux/ioport.h>
 
 /*
  * irq_of_parse_and_map() is used ba all OF enabled platforms; but SPARC
@@ -31,14 +32,17 @@  struct of_irq {
 };
 
 extern struct device_node *of_irq_find_parent_by_phandle(phandle p);
-extern struct device_node *of_irq_find_parent(struct device_node *child);
 extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
 			 u32 ointsize, const u32 *addr, struct of_irq *out_irq);
+extern int __of_irq_map_one(struct device_node *device, int index,
+			    struct of_irq *out_irq);
 extern int of_irq_map_one(struct device_node *device, int index,
 			  struct of_irq *out_irq);
 extern unsigned int irq_create_of_mapping(struct device_node *controller,
 					  const u32 *intspec,
 					  unsigned int intsize);
+extern unsigned int of_irq_to_resource(struct device_node *dev, int index,
+				       struct resource *r);
 
 #endif /* CONFIG_OF_IRQ */
 #endif /* CONFIG_OF */