LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] p1010rdb: gianfar config does not have queues.
From: Aggrwal Poonam-B10812 @ 2012-03-17  5:37 UTC (permalink / raw)
  To: Kumar Gala, Chauhan Pankaj-B32944, Srivastava Rajan-B34330
  Cc: PPC list, U Bhaskar-B22300, Robin Holt, Eric Dumazet
In-Reply-To: <22426CFF-79AE-4F2B-86C2-EB90F70630B0@kernel.crashing.org>

Hello Pankaj, Rajan

DO you have any comments on the below patch of gianfar?
> > -			fsl,num_rx_queues =3D <0x8>;
> > -			fsl,num_tx_queues =3D <0x8>;
Have been removed from P1010RDB device tree to avoid a kernel panic.

Kumar, as such I see this is the old dts format. Also in the latest sdk tre=
e these properties are defined, not sure it is working on P1010RDB.
I can check on this and get back.


Regards
Poonam

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Friday, March 16, 2012 8:50 PM
> To: Aggrwal Poonam-B10812
> Cc: Robin Holt; U Bhaskar-B22300; PPC list; Eric Dumazet
> Subject: Re: [PATCH] p1010rdb: gianfar config does not have queues.
>=20
>=20
> On Aug 11, 2011, at 9:25 AM, Robin Holt wrote:
>=20
> > If I have the the fsl,num_rx_queues and fsl,num_tx_queues properties
> > defined in the p1010's device tree file, I get a kernel panic very
> > shortly after boot.  The failure indicates we are configuring the
> > gianfar.c driver for a queue depth greater than actual.  Removing the
> > properties got the problem resolved.
> >
> > Signed-off-by: Robin Holt <holt@sgi.com>
> > To: U Bhaskar-B22300 <B22300@freescale.com>
> > Cc: PPC list <linuxppc-dev@lists.ozlabs.org>
> > Cc: Eric Dumazet <eric.dumazet@gmail.com>
>=20
> Poonam,
>=20
> Can you comment on this patch, does it look correct?
>=20
> - k
>=20
> >
> > diff --git a/arch/powerpc/boot/dts/p1010si.dtsi
> > b/arch/powerpc/boot/dts/p1010si.dtsi
> > index 7f51104..91566aa 100644
> > --- a/arch/powerpc/boot/dts/p1010si.dtsi
> > +++ b/arch/powerpc/boot/dts/p1010si.dtsi
> > @@ -258,8 +258,6 @@
> > 			device_type =3D "network";
> > 			model =3D "eTSEC";
> > 			compatible =3D "fsl,etsec2";
> > -			fsl,num_rx_queues =3D <0x8>;
> > -			fsl,num_tx_queues =3D <0x8>;
> > 			local-mac-address =3D [ 00 00 00 00 00 00 ];
> > 			interrupt-parent =3D <&mpic>;
> >
> > @@ -280,8 +278,6 @@
> > 			device_type =3D "network";
> > 			model =3D "eTSEC";
> > 			compatible =3D "fsl,etsec2";
> > -			fsl,num_rx_queues =3D <0x8>;
> > -			fsl,num_tx_queues =3D <0x8>;
> > 			local-mac-address =3D [ 00 00 00 00 00 00 ];
> > 			interrupt-parent =3D <&mpic>;
> >
> > @@ -302,8 +298,6 @@
> > 			device_type =3D "network";
> > 			model =3D "eTSEC";
> > 			compatible =3D "fsl,etsec2";
> > -			fsl,num_rx_queues =3D <0x8>;
> > -			fsl,num_tx_queues =3D <0x8>;
> > 			local-mac-address =3D [ 00 00 00 00 00 00 ];
> > 			interrupt-parent =3D <&mpic>;
> >
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/linuxppc-dev
>=20

^ permalink raw reply

* RE: [PATCH] powerpc/85xx:Add BSC9131 RDB Support
From: Kushwaha Prabhakar-B32579 @ 2012-03-17  3:42 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Aggrwal Poonam-B10812, Srivastava Rajan-B34330,
	Mehresh Ramneek-B31383, Goyal Akhil-B35197,
	linuxppc-dev@lists.ozlabs.org,
	devicetree-discuss@lists.ozlabs.org, Jain Priyanka-B32167
In-Reply-To: <F0619813-5CAC-4D15-9D9E-827A609DD573@kernel.crashing.org>

Thanks Kumar for reviewing this patch.
Please find my response in-lined..

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Saturday, March 17, 2012 1:43 AM
> To: Kushwaha Prabhakar-B32579
> Cc: linuxppc-dev@lists.ozlabs.org; devicetree-discuss@lists.ozlabs.org;
> Mehresh Ramneek-B31383; Jain Priyanka-B32167; Goyal Akhil-B35197; Aggrwal
> Poonam-B10812; Srivastava Rajan-B34330
> Subject: Re: [PATCH] powerpc/85xx:Add BSC9131 RDB Support
>=20
> >
> >
> > diff --git a/arch/powerpc/boot/dts/bsc9131rdb.dtsi
> > b/arch/powerpc/boot/dts/bsc9131rdb.dtsi
> > new file mode 100644
> > index 0000000..d274c014
> > --- /dev/null
> > +++ b/arch/powerpc/boot/dts/bsc9131rdb.dtsi
> > @@ -0,0 +1,179 @@
> > +/*
> > + * BSC9131 RDB Device Tree Source stub (no addresses or top-level
> > +ranges)
> > + *
> > + * Copyright 2011-2012 Freescale Semiconductor Inc.
> > + *
> > + * Redistribution and use in source and binary forms, with or without
> > + * modification, are permitted provided that the following conditions
> are met:
> > + *     * Redistributions of source code must retain the above
> copyright
> > + *       notice, this list of conditions and the following disclaimer.
> > + *     * Redistributions in binary form must reproduce the above
> copyright
> > + *       notice, this list of conditions and the following disclaimer
> in the
> > + *       documentation and/or other materials provided with the
> distribution.
> > + *     * Neither the name of Freescale Semiconductor nor the
> > + *       names of its contributors may be used to endorse or promote
> products
> > + *       derived from this software without specific prior written
> permission.
> > + *
> > + *
> > + * ALTERNATIVELY, this software may be distributed under the terms of
> > +the
> > + * GNU General Public License ("GPL") as published by the Free
> > +Software
> > + * Foundation, either version 2 of that License or (at your option)
> > +any
> > + * later version.
> > + *
> > + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND
> > +ANY
> > + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> > +IMPLIED
> > + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> > +ARE
> > + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE
> > +FOR ANY
> > + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> > +DAMAGES
> > + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > +SERVICES;
> > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
> > +CAUSED AND
> > + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> > +OR TORT
> > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
> > +USE OF THIS
> > + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > + */
> > +
> > +&board_ifc {
> > +
> > +	nand@0,0 {
> > +		#address-cells =3D <1>;
> > +		#size-cells =3D <1>;
> > +		compatible =3D "fsl,ifc-nand";
> > +		reg =3D <0x0 0x0 0x4000>;
> > +
> > +		partition@0 {
> > +			/* This location must not be altered  */
> > +			/* 3MB for u-boot Bootloader Image */
> > +			reg =3D <0x0 0x00300000>;
> > +			label =3D "NAND U-Boot Image";
> > +			read-only;
> > +		};
> > +
> > +		partition@300000 {
> > +			/* 1MB for DTB Image */
> > +			reg =3D <0x00300000 0x00100000>;
> > +			label =3D "NAND DTB Image";
> > +		};
> > +
> > +		partition@400000 {
> > +			/* 8MB for Linux Kernel Image */
> > +			reg =3D <0x00400000 0x00800000>;
> > +			label =3D "NAND Linux Kernel Image";
> > +		};
> > +
> > +		partition@c00000 {
> > +			/* Rest space for Root file System Image */
> > +			reg =3D <0x00c00000 0x07400000>;
> > +			label =3D " NAND RFS Image";
> > +		};
> > +	};
> > +};
> > +
> > +&board_soc {
> > +	i2c@3000 {
> > +		gpio3: gpio@21 {
> > +			compatible =3D "nxp,pca9555";
>=20
> Is there any binding spec for nxp,


These is no binding for nxp,pca9555. I will send a separate patch for this.=
=20
will this binging be part of Documentation/devicetree/bindings/i2c/trivial-=
devices.txt?


> > +			reg =3D <0x21>;
> > +			#gpio-cells =3D <2>;
> > +			gpio-controller;
> > +			polarity =3D <0x00>;
> > +		};
> > +		gpio4: gpio@23 {
> > +			compatible =3D "nxp,pca9555";
> > +			reg =3D <0x23>;
> > +			#gpio-cells =3D <2>;
> > +			gpio-controller;
> > +			polarity =3D <0x00>;
> > +		};
> > +		gpio5: gpio@27 {
> > +			compatible =3D "nxp,pca9555";
> > +			reg =3D <0x27>;
> > +			#gpio-cells =3D <2>;
> > +			gpio-controller;
> > +			polarity =3D <0x00>;
> > +		};
> > +		hwmon@4c {
> > +			compatible =3D "adi,adt7461";
> > +			reg =3D <0x4c>;
> > +		};
> > +		eeprom@52 {
> > +			compatible =3D "st-micro,24c02";
>=20
> should this have a compatible with atmel,24c02?

I will check this point


>=20
> > +			reg =3D <0x52>;
> > +		};
> > +	};
> > +
> > +	/* BSC9131RDB does not have any device on i2c@3100 */
> > +	i2c@3100 {
> > +		status =3D "disabled";
> > +	};
> > +
> > +	spi@7000 {
> > +		flash@0 {
> > +			#address-cells =3D <1>;
> > +			#size-cells =3D <1>;
> > +			compatible =3D "spansion,s25sl12801";
> > +			reg =3D <0>;
> > +			spi-max-frequency =3D <50000000>;
> > +
> > +			/* 512KB for u-boot Bootloader Image */
> > +			partition@0 {
> > +				reg =3D <0x0 0x00080000>;
> > +				label =3D "SPI Flash U-Boot Image";
> > +				read-only;
> > +			};
> > +
> > +			/* 512KB for DTB Image */
> > +			partition@80000 {
> > +				reg =3D <0x00080000 0x00080000>;
> > +				label =3D "SPI Flash DTB Image";
> > +			};
> > +
> > +			/* 4MB for Linux Kernel Image */
> > +			partition@100000 {
> > +				reg =3D <0x00100000 0x00400000>;
> > +				label =3D "SPI Flash Kernel Image";
> > +			};
> > +
> > +			/* 4MB for Compressed RFS Image */
> > +			partition@500000 {
> > +				reg =3D <0x00500000 0x00400000>;
> > +				label =3D "SPI Flash Compressed RFS Image";
> > +			};
> > +
> > +			/* 7MB for JFFS2 based RFS */
> > +			partition@900000 {
> > +				reg =3D <0x00900000 0x00700000>;
> > +				label =3D "SPI Flash JFFS2 RFS Image";
> > +			};
> > +		};
> > +	};
> > +
> > +	usb@22000 {
> > +		phy_type =3D "ulpi";
> > +	};
> > +
> > +	mdio@24000 {
> > +		phy0: ethernet-phy@0 {
> > +			interrupts =3D <3 1 0 0>;
> > +			reg =3D <0x0>;
> > +		};
> > +
> > +		phy1: ethernet-phy@1 {
> > +			interrupts =3D <2 1 0 0>;
> > +			reg =3D <0x3>;
> > +		};
> > +	};
> > +
> > +	sdhci@2e000 {
> > +		status =3D "disabled";
> > +	};
> > +
> > +	enet0: ethernet@b0000 {
> > +		phy-handle =3D <&phy0>;
> > +		phy-connection-type =3D "rgmii-id";
> > +	};
> > +
> > +	enet1: ethernet@b1000 {
> > +		phy-handle =3D <&phy1>;
> > +		phy-connection-type =3D "rgmii-id";
> > +	};
> > +};
>=20
>=20
> > diff --git a/arch/powerpc/platforms/85xx/bsc913x_board.c
> > b/arch/powerpc/platforms/85xx/bsc913x_board.c
>=20
> should be bsc913x_rdb.c
>=20

Yes. I will do.

> > new file mode 100644
> > index 0000000..934c3b5
> > --- /dev/null
> > +++ b/arch/powerpc/platforms/85xx/bsc913x_board.c
> > @@ -0,0 +1,96 @@
> > +/*
> > + * BSC9131RDB Board Setup
> > + *
> > + * Author: Priyanka Jain <Priyanka.Jain@freescale.com>
> > + *
> > + * Copyright 2011-2012 Freescale Semiconductor Inc.
> > + *
> > + * This program is free software; you can redistribute  it and/or
> > +modify it
> > + * under  the terms of  the GNU General  Public License as published
> > +by the
> > + * Free Software Foundation;  either version 2 of the  License, or
> > +(at your
> > + * option) any later version.
> > + */
> > +
> > +#include <linux/of_platform.h>
> > +#include <linux/pci.h>
> > +#include <asm/mpic.h>
> > +#include <sysdev/fsl_soc.h>
> > +#include <asm/udbg.h>
> > +
> > +void __init bsc913x_board_pic_init(void) {
> > +	struct mpic *mpic;
> > +	struct resource r;
> > +	struct device_node *np;
> > +
> > +	np =3D of_find_node_by_type(NULL, "open-pic");
> > +	if (!np) {
> > +		pr_err("bsc913x: Could not find open-pic node\n");
> > +		return;
> > +	}
> > +
> > +	if (of_address_to_resource(np, 0, &r)) {
> > +		pr_err("bsc913x: Failed to map mpic register space\n");
> > +		of_node_put(np);
> > +		return;
> > +	}
> > +
> > +	mpic =3D mpic_alloc(np, r.start, MPIC_WANTS_RESET |
> > +	  MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU,
> > +	  0, 256, " OpenPIC  ");
> > +
> > +	of_node_put(np);
> > +
> > +	if (!mpic)
> > +		pr_err("bsc913x: Failed to allocate MPIC structure\n");
> > +	else
> > +		mpic_init(mpic);
>=20
>=20
> Please update to match current board code
>=20

Sure.

> > +}
> > +
> > +/*
> > + * Setup the architecture
> > + */
> > +static void __init bsc913x_board_setup_arch(void) {
> > +	if (ppc_md.progress)
> > +		ppc_md.progress("bsc913x_board_setup_arch()", 0);
> > +
> > +	pr_info("bsc913x board from Freescale Semiconductor\n"); }
> > +
> > +static struct of_device_id __initdata bsc913x_board_ids[] =3D {
> > +	{ .type =3D "soc", },
> > +	{ .type =3D "dsp", },
>=20
> remove dsp, doesn't show up anywhere else
>=20

I will remove

> > +	{ .compatible =3D "soc", },
> > +	{ .compatible =3D "simple-bus", },
> > +	{ .compatible =3D "gianfar", },
> > +	{},
> > +};
> > +
> > +static int __init bsc913x_board_publish_devices(void)
> > +{
> > +	return of_platform_bus_probe(NULL, bsc913x_board_ids, NULL); }
> > +machine_device_initcall(bsc9131_rdb, bsc913x_board_publish_devices);
> > +
> > +/*
> > + * Called very early, device-tree isn't unflattened  */
> > +
> > +static int __init bsc9131_rdb_probe(void) {
> > +	unsigned long root =3D of_get_flat_dt_root();
> > +
> > +	return of_flat_dt_is_compatible(root, "fsl,bsc9131rdb"); }
> > +
> > +define_machine(bsc9131_rdb) {
> > +	.name			=3D "BSC9131 RDB",
> > +	.probe			=3D bsc9131_rdb_probe,
> > +	.setup_arch		=3D bsc913x_board_setup_arch,
> > +	.init_IRQ		=3D bsc913x_board_pic_init,
> > +	.get_irq		=3D mpic_get_irq,
> > +	.restart		=3D fsl_rstcr_restart,
> > +	.calibrate_decr		=3D generic_calibrate_decr,
> > +	.progress		=3D udbg_progress,
> > +};
> > --
> > 1.7.5.4
> >
> >
>=20

Regards,
Prabhakar

^ permalink raw reply

* Re: [PATCH v2 5/7] powerpc/PCI: allow reallocation on PA Semi
From: Benjamin Herrenschmidt @ 2012-03-17  3:33 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Olof Johansson, linux-pci, linuxppc-dev, Jesse Barnes
In-Reply-To: <20120316234819.6649.55979.stgit@bhelgaas.mtv.corp.google.com>

On Fri, 2012-03-16 at 17:48 -0600, Bjorn Helgaas wrote:
> We believe there's no reason to prevent reallocation on PA Semi, so
> revert to the default of "allow reallocation if necessary."
> 

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: linuxppc-dev@lists.ozlabs.org
> Tested-by: Olof Johansson <olof@lixom.net>
> Acked-by: Olof Johansson <olof@lixom.net>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  arch/powerpc/platforms/pasemi/pci.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
> index b27d886..aa86271 100644
> --- a/arch/powerpc/platforms/pasemi/pci.c
> +++ b/arch/powerpc/platforms/pasemi/pci.c
> @@ -229,9 +229,6 @@ void __init pas_pci_init(void)
>  
>  	/* Setup the linkage between OF nodes and PHBs */
>  	pci_devs_phb_init();
> -
> -	/* Use the common resource allocation mechanism */
> -	pci_add_flags(PCI_PROBE_ONLY);
>  }
>  
>  void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)

^ permalink raw reply

* Re: [PATCH v2 4/7] powerpc/PCI: convert devtree bus addresses to resource
From: Benjamin Herrenschmidt @ 2012-03-17  3:33 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linuxppc-dev, Anton Blanchard, Jesse Barnes
In-Reply-To: <20120316234814.6649.47469.stgit@bhelgaas.mtv.corp.google.com>

On Fri, 2012-03-16 at 17:48 -0600, Bjorn Helgaas wrote:
> Normal PCI enumeration via PCI config space uses __pci_read_base(), where
> the PCI core applies any bus-to-resource offset.  But powerpc doesn't use
> that path when enumerating via the device tree.
> 
> In 6c5705fec63d, I converted powerpc to use the PCI core bus-to-resource
> conversion, but I missed these powerpc-specific paths.  Some powerpc
> platforms fail to boot ("Cannot allocate resource region," "device not
> available," etc.) between that commit and this one.
> 
> This adds the corresponding bus-to-resource conversion in the paths that
> read BAR values from the OF device tree.
> 
> CC: Anton Blanchard <anton@samba.org>

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

> CC: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  arch/powerpc/kernel/pci_of_scan.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
> index b37d0b5..89dde17 100644
> --- a/arch/powerpc/kernel/pci_of_scan.c
> +++ b/arch/powerpc/kernel/pci_of_scan.c
> @@ -75,6 +75,7 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
>  {
>  	u64 base, size;
>  	unsigned int flags;
> +	struct pci_bus_region region;
>  	struct resource *res;
>  	const u32 *addrs;
>  	u32 i;
> @@ -106,10 +107,11 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
>  			printk(KERN_ERR "PCI: bad cfg reg num 0x%x\n", i);
>  			continue;
>  		}
> -		res->start = base;
> -		res->end = base + size - 1;
>  		res->flags = flags;
>  		res->name = pci_name(dev);
> +		region.start = base;
> +		region.end = base + size - 1;
> +		pcibios_bus_to_resource(dev, res, &region);
>  	}
>  }
>  
> @@ -209,6 +211,7 @@ void __devinit of_scan_pci_bridge(struct pci_dev *dev)
>  	struct pci_bus *bus;
>  	const u32 *busrange, *ranges;
>  	int len, i, mode;
> +	struct pci_bus_region region;
>  	struct resource *res;
>  	unsigned int flags;
>  	u64 size;
> @@ -270,9 +273,10 @@ void __devinit of_scan_pci_bridge(struct pci_dev *dev)
>  			res = bus->resource[i];
>  			++i;
>  		}
> -		res->start = of_read_number(&ranges[1], 2);
> -		res->end = res->start + size - 1;
>  		res->flags = flags;
> +		region.start = of_read_number(&ranges[1], 2);
> +		region.end = region.start + size - 1;
> +		pcibios_bus_to_resource(dev, res, &region);
>  	}
>  	sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
>  		bus->number);

^ permalink raw reply

* [PATCH v2 5/7] powerpc/PCI: allow reallocation on PA Semi
From: Bjorn Helgaas @ 2012-03-16 23:48 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: Olof Johansson, linux-pci, linuxppc-dev
In-Reply-To: <20120316234653.6649.59492.stgit@bhelgaas.mtv.corp.google.com>

We believe there's no reason to prevent reallocation on PA Semi, so
revert to the default of "allow reallocation if necessary."

CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: linuxppc-dev@lists.ozlabs.org
Tested-by: Olof Johansson <olof@lixom.net>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/powerpc/platforms/pasemi/pci.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index b27d886..aa86271 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -229,9 +229,6 @@ void __init pas_pci_init(void)
 
 	/* Setup the linkage between OF nodes and PHBs */
 	pci_devs_phb_init();
-
-	/* Use the common resource allocation mechanism */
-	pci_add_flags(PCI_PROBE_ONLY);
 }
 
 void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)

^ permalink raw reply related

* [PATCH v2 4/7] powerpc/PCI: convert devtree bus addresses to resource
From: Bjorn Helgaas @ 2012-03-16 23:48 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-pci, linuxppc-dev, Anton Blanchard
In-Reply-To: <20120316234653.6649.59492.stgit@bhelgaas.mtv.corp.google.com>

Normal PCI enumeration via PCI config space uses __pci_read_base(), where
the PCI core applies any bus-to-resource offset.  But powerpc doesn't use
that path when enumerating via the device tree.

In 6c5705fec63d, I converted powerpc to use the PCI core bus-to-resource
conversion, but I missed these powerpc-specific paths.  Some powerpc
platforms fail to boot ("Cannot allocate resource region," "device not
available," etc.) between that commit and this one.

This adds the corresponding bus-to-resource conversion in the paths that
read BAR values from the OF device tree.

CC: Anton Blanchard <anton@samba.org>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/powerpc/kernel/pci_of_scan.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index b37d0b5..89dde17 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -75,6 +75,7 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
 {
 	u64 base, size;
 	unsigned int flags;
+	struct pci_bus_region region;
 	struct resource *res;
 	const u32 *addrs;
 	u32 i;
@@ -106,10 +107,11 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
 			printk(KERN_ERR "PCI: bad cfg reg num 0x%x\n", i);
 			continue;
 		}
-		res->start = base;
-		res->end = base + size - 1;
 		res->flags = flags;
 		res->name = pci_name(dev);
+		region.start = base;
+		region.end = base + size - 1;
+		pcibios_bus_to_resource(dev, res, &region);
 	}
 }
 
@@ -209,6 +211,7 @@ void __devinit of_scan_pci_bridge(struct pci_dev *dev)
 	struct pci_bus *bus;
 	const u32 *busrange, *ranges;
 	int len, i, mode;
+	struct pci_bus_region region;
 	struct resource *res;
 	unsigned int flags;
 	u64 size;
@@ -270,9 +273,10 @@ void __devinit of_scan_pci_bridge(struct pci_dev *dev)
 			res = bus->resource[i];
 			++i;
 		}
-		res->start = of_read_number(&ranges[1], 2);
-		res->end = res->start + size - 1;
 		res->flags = flags;
+		region.start = of_read_number(&ranges[1], 2);
+		region.end = region.start + size - 1;
+		pcibios_bus_to_resource(dev, res, &region);
 	}
 	sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
 		bus->number);

^ permalink raw reply related

* [git pull] Please pull powerpc.git next branch
From: Kumar Gala @ 2012-03-16 21:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

The following changes since commit aba0eb84c87928992c021d33ef3ea59c931086b9:

  Merge branch 'eeh' into next (2012-03-13 10:15:35 +1100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git next

Claudiu Manoil (2):
      powerpc/85xx: Fix compiler error with THIS_MODULE and related
      powerpc/85xx: Add missing config option for CACHE SRAM code

Diana CRACIUN (1):
      powerpc/fsl: Added aliased MSIIR register address to MSI node in dts

Gustavo Zacarias (1):
      powerpc/85xx: fix typo in p1010rdb.dtsi

Jerry Huang (2):
      powerpc/85xx: add P1020MBG-PC platform support
      powerpc/85xx: add P1020UTM-PC platform support

Jia Hongtao (3):
      powerpc/85xx: Clean up partition nodes in dts for MPC8572DS
      powerpc: add support for MPIC message register API
      powerpc: document the FSL MPIC message register binding

Kumar Gala (2):
      powerpc/fsl-booke: Fixup calc_cam_sz to support MMU v2
      powerpc: Add initial e6500 cpu support

Liu Gang (2):
      powerpc/srio: Fix the relocation errors when building with 64bit
      powerpc/srio: Fix the compile errors when building with 64bit

Liu Shuo (2):
      powerpc/fsl_msi: return proper error value when ioremap failed.
      powerpc/dts: fix the compatible string of sec 4.0

Martyn Welch (4):
      powerpc: Add GE FPGA config option
      gpio: Move GE GPIO driver to reside within GPIO subsystem
      powerpc: Move GE PIC drivers
      powerpc/85xx: Board support for GE IMP3A

Paul Gortmaker (2):
      powerpc/85xx: fix Kconfig warning about missing 8250 dependency
      powerpc/83xx: mpc836x - fix failed phy detection for ucc ethernet on MDS

Prabhakar Kushwaha (1):
      NAND Machine support for Integrated Flash Controller

Ramneek Mehresh (1):
      powerpc/85xx: Add usb controller version info

Sebastian Andrzej Siewior (2):
      powerpc/85xx: p2020rdb - move the NAND address.
      powerpc/85xx: p2020rdb & p1010rdb - lower spi flash freq to 40Mhz

Tang Yuantian (2):
      powerpc/85xx: Adds Support for P2020RDB-PC board
      powerpc/85xx: Add p2020rdb-pc dts support

Timur Tabi (4):
      powerpc/85xx: create 32-bit DTS for the P1022DS
      powerpc/85xx: p1022ds: disable the NOR flash node if video is enabled
      powerpc/85xx: p1022ds: enable monitor switching via pixis indirect mode
      powerpc/85xx: allow CONFIG_PHYS_64BIT to be selectable

Xie Xiaobo (2):
      powerpc/85xx: Add some DTS nodes and attributes for mpc8536ds
      powerpc/85xx: Add magic-packet properties for etsec

Xu Jiucheng (2):
      powerpc/85xx: Added dts for P1021RDB-PC board
      powerpc/85xx: Added P1021RDB-PC Platform support

Zhao Chenhui (3):
      powerpc/85xx: mpc8548cds - fix alias in mpc8548si-pre.dtsi
      powerpc/85xx: Refactor mpc8548cds device tree
      powerpc/85xx: mpc8548cds - add 36-bit dts

Zhicheng Fan (6):
      powerpc/85xx: Add p1025rdb platform support
      powerpc/85xx: Add dts for p1025rdb board
      powerpc/85xx: Add p1020rdb-pc platform support
      powerpc/85xx: Add dts for p1020rdb-pc board
      powerpc/85xx: Abstract common define of signal multiplex control for qe
      powerpc/85xx: Add Quicc Engine support for p1025rdb

chenhui zhao (5):
      powerpc/85xx: l2sram - Add compatible entry for mpc8548 L2 controller
      powerpc/85xx: mpc85xxcds - Fix PCI I/O space resource of PCI bridge
      powerpc/85xx: mpc8548cds - Add NOR flash node to dts
      powerpc/85xx: mpc8548cds - Add RapidIO node to dts
      powerpc/85xx: mpc8548cds - Add FPGA node to dts

 .../devicetree/bindings/powerpc/fsl/mpic-msgr.txt  |   63 ++
 .../devicetree/bindings/powerpc/fsl/msi-pic.txt    |    6 +-
 arch/powerpc/boot/Makefile                         |    2 +-
 arch/powerpc/boot/dts/fsl/mpc8536si-post.dtsi      |    4 +-
 arch/powerpc/boot/dts/fsl/mpc8548si-post.dtsi      |   16 +
 arch/powerpc/boot/dts/fsl/mpc8548si-pre.dtsi       |    4 +-
 arch/powerpc/boot/dts/fsl/p1010si-post.dtsi        |    3 +
 arch/powerpc/boot/dts/fsl/p1020si-post.dtsi        |    6 +
 arch/powerpc/boot/dts/fsl/p1021si-post.dtsi        |    7 +
 arch/powerpc/boot/dts/fsl/p1022si-post.dtsi        |   12 +-
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi        |    3 +
 arch/powerpc/boot/dts/fsl/p2020si-post.dtsi        |    3 +
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi        |    2 +
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi        |    2 +
 arch/powerpc/boot/dts/fsl/p3060si-post.dtsi        |    6 +
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi        |    2 +
 arch/powerpc/boot/dts/fsl/pq3-etsec1-0.dtsi        |    3 +-
 arch/powerpc/boot/dts/fsl/pq3-etsec1-1.dtsi        |    3 +-
 arch/powerpc/boot/dts/fsl/pq3-etsec1-2.dtsi        |    3 +-
 arch/powerpc/boot/dts/fsl/pq3-etsec1-3.dtsi        |    3 +-
 arch/powerpc/boot/dts/fsl/pq3-sec4.4-0.dtsi        |   10 +-
 arch/powerpc/boot/dts/fsl/qoriq-mpic.dtsi          |    6 +-
 arch/powerpc/boot/dts/ge_imp3a.dts                 |  255 +++++
 arch/powerpc/boot/dts/mpc836x_mds.dts              |    4 +
 arch/powerpc/boot/dts/mpc8536ds.dts                |    6 +-
 arch/powerpc/boot/dts/mpc8536ds.dtsi               |   93 ++
 arch/powerpc/boot/dts/mpc8536ds_36b.dts            |    8 +-
 arch/powerpc/boot/dts/mpc8548cds.dts               |  306 ------
 arch/powerpc/boot/dts/mpc8548cds.dtsi              |  306 ++++++
 arch/powerpc/boot/dts/mpc8548cds_32b.dts           |   86 ++
 arch/powerpc/boot/dts/mpc8548cds_36b.dts           |   86 ++
 arch/powerpc/boot/dts/mpc8572ds.dtsi               |   50 +-
 arch/powerpc/boot/dts/p1010rdb.dtsi                |    4 +-
 arch/powerpc/boot/dts/p1020rdb-pc.dtsi             |  247 +++++
 arch/powerpc/boot/dts/p1020rdb-pc_32b.dts          |   90 ++
 arch/powerpc/boot/dts/p1020rdb-pc_36b.dts          |   90 ++
 arch/powerpc/boot/dts/p1020rdb-pc_camp_core0.dts   |   64 ++
 arch/powerpc/boot/dts/p1020rdb-pc_camp_core1.dts   |  142 +++
 arch/powerpc/boot/dts/p1021rdb.dts                 |   96 ++
 arch/powerpc/boot/dts/p1021rdb.dtsi                |  236 +++++
 arch/powerpc/boot/dts/p1021rdb_36b.dts             |   96 ++
 arch/powerpc/boot/dts/p1022ds.dts                  |  274 -----
 arch/powerpc/boot/dts/p1022ds.dtsi                 |  234 +++++
 arch/powerpc/boot/dts/p1022ds_32b.dts              |  103 ++
 arch/powerpc/boot/dts/p1022ds_36b.dts              |  103 ++
 arch/powerpc/boot/dts/p1025rdb.dtsi                |  286 ++++++
 arch/powerpc/boot/dts/p1025rdb_32b.dts             |  135 +++
 arch/powerpc/boot/dts/p1025rdb_36b.dts             |   88 ++
 arch/powerpc/boot/dts/p2020rdb-pc.dtsi             |  241 +++++
 arch/powerpc/boot/dts/p2020rdb-pc_32b.dts          |   96 ++
 arch/powerpc/boot/dts/p2020rdb-pc_36b.dts          |   96 ++
 arch/powerpc/boot/dts/p2020rdb.dts                 |    4 +-
 arch/powerpc/configs/85xx/ge_imp3a_defconfig       |  257 +++++
 arch/powerpc/configs/86xx/gef_ppc9a_defconfig      |    1 +
 arch/powerpc/configs/86xx/gef_sbc310_defconfig     |    1 +
 arch/powerpc/configs/86xx/gef_sbc610_defconfig     |    2 +
 arch/powerpc/configs/mpc85xx_defconfig             |    1 +
 arch/powerpc/configs/mpc85xx_smp_defconfig         |    1 +
 arch/powerpc/include/asm/cputable.h                |   12 +-
 arch/powerpc/include/asm/fsl_guts.h                |    6 +-
 arch/powerpc/include/asm/mpic_msgr.h               |  132 +++
 arch/powerpc/include/asm/reg_booke.h               |    1 +
 arch/powerpc/kernel/cputable.c                     |   18 +
 arch/powerpc/mm/fsl_booke_mmu.c                    |   19 +-
 arch/powerpc/platforms/85xx/Kconfig                |   27 +-
 arch/powerpc/platforms/85xx/Makefile               |    1 +
 arch/powerpc/platforms/85xx/ge_imp3a.c             |  246 +++++
 arch/powerpc/platforms/85xx/mpc85xx_cds.c          |   81 ++-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c          |   35 +-
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |  215 ++++-
 arch/powerpc/platforms/85xx/p1022_ds.c             |  203 ++++-
 arch/powerpc/platforms/86xx/Kconfig                |    3 +
 arch/powerpc/platforms/86xx/Makefile               |    7 +-
 arch/powerpc/platforms/86xx/gef_ppc9a.c            |    2 +-
 arch/powerpc/platforms/86xx/gef_sbc310.c           |    2 +-
 arch/powerpc/platforms/86xx/gef_sbc610.c           |    2 +-
 arch/powerpc/platforms/Kconfig                     |    8 +
 arch/powerpc/sysdev/Kconfig                        |    4 +
 arch/powerpc/sysdev/Makefile                       |    4 +
 arch/powerpc/sysdev/fsl_85xx_cache_sram.c          |    1 +
 arch/powerpc/sysdev/fsl_85xx_l2ctlr.c              |    4 +
 arch/powerpc/sysdev/fsl_msi.c                      |    1 +
 arch/powerpc/sysdev/fsl_rio.c                      |    4 +-
 arch/powerpc/sysdev/fsl_rmu.c                      |   42 +-
 arch/powerpc/sysdev/ge/Makefile                    |    1 +
 .../86xx/gef_pic.c => sysdev/ge/ge_pic.c}          |    2 +-
 .../86xx/gef_pic.h => sysdev/ge/ge_pic.h}          |    0
 arch/powerpc/sysdev/mpic_msgr.c                    |  282 +++++
 drivers/gpio/Kconfig                               |   11 +
 drivers/gpio/Makefile                              |    1 +
 .../86xx/gef_gpio.c => drivers/gpio/gpio-ge.c      |   30 +-
 drivers/mtd/nand/Kconfig                           |   10 +
 drivers/mtd/nand/Makefile                          |    1 +
 drivers/mtd/nand/fsl_ifc_nand.c                    | 1072 ++++++++++++++++++++
 drivers/watchdog/Kconfig                           |    2 +-
 95 files changed, 6119 insertions(+), 730 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt
 create mode 100644 arch/powerpc/boot/dts/ge_imp3a.dts
 delete mode 100644 arch/powerpc/boot/dts/mpc8548cds.dts
 create mode 100644 arch/powerpc/boot/dts/mpc8548cds.dtsi
 create mode 100644 arch/powerpc/boot/dts/mpc8548cds_32b.dts
 create mode 100644 arch/powerpc/boot/dts/mpc8548cds_36b.dts
 create mode 100644 arch/powerpc/boot/dts/p1020rdb-pc.dtsi
 create mode 100644 arch/powerpc/boot/dts/p1020rdb-pc_32b.dts
 create mode 100644 arch/powerpc/boot/dts/p1020rdb-pc_36b.dts
 create mode 100644 arch/powerpc/boot/dts/p1020rdb-pc_camp_core0.dts
 create mode 100644 arch/powerpc/boot/dts/p1020rdb-pc_camp_core1.dts
 create mode 100644 arch/powerpc/boot/dts/p1021rdb.dts
 create mode 100644 arch/powerpc/boot/dts/p1021rdb.dtsi
 create mode 100644 arch/powerpc/boot/dts/p1021rdb_36b.dts
 delete mode 100644 arch/powerpc/boot/dts/p1022ds.dts
 create mode 100644 arch/powerpc/boot/dts/p1022ds.dtsi
 create mode 100644 arch/powerpc/boot/dts/p1022ds_32b.dts
 create mode 100644 arch/powerpc/boot/dts/p1022ds_36b.dts
 create mode 100644 arch/powerpc/boot/dts/p1025rdb.dtsi
 create mode 100644 arch/powerpc/boot/dts/p1025rdb_32b.dts
 create mode 100644 arch/powerpc/boot/dts/p1025rdb_36b.dts
 create mode 100644 arch/powerpc/boot/dts/p2020rdb-pc.dtsi
 create mode 100644 arch/powerpc/boot/dts/p2020rdb-pc_32b.dts
 create mode 100644 arch/powerpc/boot/dts/p2020rdb-pc_36b.dts
 create mode 100644 arch/powerpc/configs/85xx/ge_imp3a_defconfig
 create mode 100644 arch/powerpc/include/asm/mpic_msgr.h
 create mode 100644 arch/powerpc/platforms/85xx/ge_imp3a.c
 create mode 100644 arch/powerpc/sysdev/ge/Makefile
 rename arch/powerpc/{platforms/86xx/gef_pic.c => sysdev/ge/ge_pic.c} (99%)
 rename arch/powerpc/{platforms/86xx/gef_pic.h => sysdev/ge/ge_pic.h} (100%)
 create mode 100644 arch/powerpc/sysdev/mpic_msgr.c
 rename arch/powerpc/platforms/86xx/gef_gpio.c => drivers/gpio/gpio-ge.c (83%)
 create mode 100644 drivers/mtd/nand/fsl_ifc_nand.c

^ permalink raw reply

* Re: issues calling of_platform_bus_probe() twice
From: Benjamin Herrenschmidt @ 2012-03-16 21:23 UTC (permalink / raw)
  To: Kumar Gala
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list, Timur Tabi
In-Reply-To: <31B4E554-FA95-431D-B353-92680CD14A0A@kernel.crashing.org>

On Fri, 2012-03-16 at 16:21 -0500, Kumar Gala wrote:
> Guys,
> 
> Are you aware of any reason that we can't call of_platform_bus_probe()
> or multiple times.  Timur's run into an issue in which all devices
> don't get registered properly if we call of_platform_bus_probe() times
> with different of_device_id struct's.

Nothing comes to mind... Grant ?

Cheers,
Ben.

^ permalink raw reply

* issues calling of_platform_bus_probe() twice
From: Kumar Gala @ 2012-03-16 21:21 UTC (permalink / raw)
  To: Grant Likely, Benjamin Herrenschmidt
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list, Timur Tabi

Guys,

Are you aware of any reason that we can't call of_platform_bus_probe() =
or multiple times.  Timur's run into an issue in which all devices don't =
get registered properly if we call of_platform_bus_probe() times with =
different of_device_id struct's.

- k=

^ permalink raw reply

* fsl pci edac patches
From: Kumar Gala @ 2012-03-16 21:13 UTC (permalink / raw)
  To: Lan Chunhe-B25806, Dmitry Eremin-Solenikov
  Cc: linuxppc-dev@lists.ozlabs.org list

Guys,

I'm not sure what the state of the EDAC patches and latest kernel are.. =
I'm going to mark the ones in patch works as 'dead' and hopefully you =
guys will resend if there is still an interest.

- k=

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
From: Kumar Gala @ 2012-03-16 21:03 UTC (permalink / raw)
  To: <shuo.liu@freesacle.com>
  Cc: Zhao Chenhui, Liu Shuo, r61911, Liu Shuo, scottwood, linuxppc-dev
In-Reply-To: <1328861387-31390-1-git-send-email-shuo.liu@freesacle.com>


On Feb 10, 2012, at 2:09 AM, <shuo.liu@freesacle.com> =
<shuo.liu@freesacle.com> wrote:

> From: Liu Shuo <shuo.liu@freescale.com>
>=20
> A PCIe erratum of mpc85xx may causes a core hang when a link of PCIe
> goes down. when the link goes down, Non-posted transactions issued
> via the ATMU requiring completion result in an instruction stall.
> At the same time a machine-check exception is generated to the core
> to allow further processing by the handler. We implements the handler
> which skips the instruction caused the stall.
>=20
> Signed-off-by: Zhao Chenhui <b35336@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Liu Shuo <b35362@freescale.com>
> ---
> arch/powerpc/kernel/cpu_setup_fsl_booke.S |    2 +-
> arch/powerpc/kernel/traps.c               |    3 ++
> arch/powerpc/sysdev/fsl_pci.c             |   36 =
+++++++++++++++++++++++++++++
> arch/powerpc/sysdev/fsl_pci.h             |    6 +++++
> 4 files changed, 46 insertions(+), 1 deletions(-)

Should we have a check to make sure the hose is for PCIe and not PCI?

- k=

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
From: Kumar Gala @ 2012-03-16 21:03 UTC (permalink / raw)
  To: Scott Wood
  Cc: linuxppc-dev, r61911, <shuo.liu@freesacle.com>,
	Zhao Chenhui
In-Reply-To: <4F63A5BD.1090207@freescale.com>


On Mar 16, 2012, at 3:42 PM, Scott Wood wrote:

> On 03/16/2012 03:35 PM, Kumar Gala wrote:
>> On Feb 10, 2012, at 2:09 AM, <shuo.liu@freesacle.com> =
<shuo.liu@freesacle.com> wrote:
>>> +static int is_in_pci_mem_space(phys_addr_t addr)
>>> +{
>>> +	struct pci_controller *hose;
>>> +	struct resource *res;
>>> +	int i;
>>> +
>>> +	list_for_each_entry(hose, &hose_list, list_node) {
>>> +		for (i =3D 0; i < 3; i++) {
>>> +			res =3D &hose->mem_resources[i];
>>> +			if ((res->flags & IORESOURCE_MEM) &&
>>> +				addr >=3D res->start && addr <=3D =
res->end)
>>> +				return 1;
>>> +		}
>>> +	}
>>> +	return 0;
>>=20
>> just move this into fsl_pci_mcheck_exception() no need for a separate =
function.
>=20
> A separate function increases readability.
>=20
> -Scott

I'll accept that.

- k=

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: don't call of_platform_bus_probe() twice
From: Timur Tabi @ 2012-03-16 20:50 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Scott Wood, Dmitry Eremin-Solenikov, linuxppc-dev list
In-Reply-To: <F8C3451C-1B14-4C30-A194-B15B6C10B0A7@kernel.crashing.org>

Kumar Gala wrote:

> This seems like paper taping over the real issue.  We should be able to call of_platform_bus_probe() multiple times.

I tried debugging it, but I couldn't figure it out.  My guess is that the
nodes probed by of_platform_bus_probe() are somehow "reserved", so that
the second time it's called, they're skipped.  I figured that this was
just a side-effect of the way the OF layer works.

If someone more familiar with the OF layer wants to look at it, that's
great.  Until then, my patch is the only one that allows the audio and
async DMA drivers to work, and any other drivers that probe on nodes that
are grandchildren of the root node.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: don't call of_platform_bus_probe() twice
From: Kumar Gala @ 2012-03-16 20:46 UTC (permalink / raw)
  To: Timur Tabi; +Cc: Scott Wood, Dmitry Eremin-Solenikov, linuxppc-dev list
In-Reply-To: <1322669957-8259-1-git-send-email-timur@freescale.com>


On Nov 30, 2011, at 10:19 AM, Timur Tabi wrote:

> Commit 46d026ac ("powerpc/85xx: consolidate of_platform_bus_probe =
calls")
> replaced platform-specific of_device_id tables with a single function
> that probes the most of the busses in 85xx device trees.  If a =
specific
> platform needed additional busses probed, then it could call
> of_platform_bus_probe() again.  Typically, the additional =
platform-specific
> busses are children of existing busses that have already been probed.
> of_platform_bus_probe() does not handle those child busses =
automatically.
>=20
> Unfortunately, this doesn't actually work.  The second =
(platform-specific)
> call to of_platform_bus_probe() never finds any of the busses it's =
asked
> to find.
>=20
> To remedy this, the platform-specific of_device_id tables are =
eliminated,
> and their entries are merged into mpc85xx_common_ids[], so that all =
busses
> are probed at once.
>=20
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> arch/powerpc/platforms/85xx/common.c      |    6 ++++++
> arch/powerpc/platforms/85xx/mpc85xx_mds.c |   11 +----------
> arch/powerpc/platforms/85xx/p1022_ds.c    |   13 +------------
> 3 files changed, 8 insertions(+), 22 deletions(-)

This seems like paper taping over the real issue.  We should be able to =
call of_platform_bus_probe() multiple times.

- k=

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
From: Scott Wood @ 2012-03-16 20:42 UTC (permalink / raw)
  To: Kumar Gala
  Cc: linuxppc-dev, r61911, <shuo.liu@freesacle.com>,
	Zhao Chenhui
In-Reply-To: <2F2A8FBF-BD4D-4A53-A293-F5426F8C5BAA@kernel.crashing.org>

On 03/16/2012 03:35 PM, Kumar Gala wrote:
> On Feb 10, 2012, at 2:09 AM, <shuo.liu@freesacle.com> <shuo.liu@freesacle.com> wrote:
>> +static int is_in_pci_mem_space(phys_addr_t addr)
>> +{
>> +	struct pci_controller *hose;
>> +	struct resource *res;
>> +	int i;
>> +
>> +	list_for_each_entry(hose, &hose_list, list_node) {
>> +		for (i = 0; i < 3; i++) {
>> +			res = &hose->mem_resources[i];
>> +			if ((res->flags & IORESOURCE_MEM) &&
>> +				addr >= res->start && addr <= res->end)
>> +				return 1;
>> +		}
>> +	}
>> +	return 0;
> 
> just move this into fsl_pci_mcheck_exception() no need for a separate function.

A separate function increases readability.

-Scott

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: check the return value of fsl_add_bridge
From: Kumar Gala @ 2012-03-16 20:41 UTC (permalink / raw)
  To: <r66093@freescale.com>; +Cc: Jerry Huang, linuxppc-dev
In-Reply-To: <1326087931-2515-1-git-send-email-r66093@freescale.com>


On Jan 8, 2012, at 11:45 PM, <r66093@freescale.com> =
<r66093@freescale.com> wrote:

> From: Jerry Huang <Chang-Ming.Huang@freescale.com>
>=20
> For all mpc85xx DS/MDS boards, we should check the return value from
> function "fsl_add_bridge", otherwise, when pcie node status is =
disabled,
> the kernel will panic when perform the function =
"pci_find_hose_for_OF_device"
> because the hose controller is NULL.
>=20
> below is the call trace log:
> NIP: c05bca80 LR: c05bca78 CTR: c000ec54
> REGS: c0615eb0 TRAP: 0300   Not tainted  =
(3.2.0-rc3-00090-gfa8cbaa-dirty)
> MSR: 00021000 <CE,ME>  CR: 84044022  XER: 20000000
> DEAR: 00000110, ESR: 00000000
> TASK =3D c05e8380[0] 'swapper' THREAD: c0614000
> GPR00: c05bca70 c0615f60 c05e8380 00000000 c0550a08 ffffffff c0613140 =
c061314c
> GPR08: 00000000 00000000 00000286 c0620000 84044022 1009d368 00000000 =
00000000
> GPR16: c0000a00 00000014 3fffffff 03ff9000 00000015 7ff3a724 c0614000 =
00000000
> GPR24: 00000000 00000000 00008000 c0550a08 c0534808 efbe3834 00000000 =
ffffffff
> NIP [c05bca80] p1022_ds_setup_arch+0xa8/0x1ac
> LR [c05bca78] p1022_ds_setup_arch+0xa0/0x1ac
> Call Trace:
> [c0615f60] [c05bca70] p1022_ds_setup_arch+0x98/0x1ac (unreliable)
> [c0615fb0] [c05b88e0] setup_arch+0x1e8/0x224
> [c0615fc0] [c05b4524] start_kernel+0x84/0x2d8
> [c0615ff0] [c00003c4] skpinv+0x2b0/0x2ec
> Instruction dump:
> 5400033e 7f80d000 7fa3eb78 40be0010 38800001 4bffedf1 48000008 =
4bffede9
> 7fa3eb78 4ba53119 7f64db78 7c691b78
> 81830114 7f85e378 8149010c
> ---[ end trace 31fd0ba7d8756001 ]---
> Kernel panic - not syncing: Attempted to kill the idle task!
> Call Trace:
> [c0615d90] [c0007b74] show_stack+0x44/0x154 (unreliable)
> [c0615dd0] [c04495b8] panic+0xa4/0x1d4
> [c0615e20] [c003e7b8] do_exit+0x588/0x614
> [c0615e70] [c000a00c] die+0xc8/0x198
> [c0615e90] [c0011a1c] bad_page_fault+0xb4/0xfc
> [c0615ea0] [c000e2e0] handle_page_fault+0x7c/0x80
> --- Exception: 300 at p1022_ds_setup_arch+0xa8/0x1ac
>    LR =3D p1022_ds_setup_arch+0xa0/0x1ac
> [c0615f60] [c05bca70] p1022_ds_setup_arch+0x98/0x1ac (unreliable)
> [c0615fb0] [c05b88e0] setup_arch+0x1e8/0x224
> [c0615fc0] [c05b4524] start_kernel+0x84/0x2d8
> [c0615ff0] [c00003c4] skpinv+0x2b0/0x2ec
>=20
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> ---
> arch/powerpc/platforms/85xx/corenet_ds.c   |    5 ++++-
> arch/powerpc/platforms/85xx/mpc8536_ds.c   |   13 +++++++++----
> arch/powerpc/platforms/85xx/mpc85xx_ds.c   |   13 +++++++++----
> arch/powerpc/platforms/85xx/mpc85xx_mds.c  |   13 +++++++++----
> arch/powerpc/platforms/85xx/p1022_ds.c     |   13 +++++++++----
> arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   14 ++++++++++----
> 6 files changed, 50 insertions(+), 21 deletions(-)

We need to fixup 85xx/ge_imp3a.c as well.

>=20
> diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c =
b/arch/powerpc/platforms/85xx/corenet_ds.c
> index c48b661..9d72e3a 100644
> --- a/arch/powerpc/platforms/85xx/corenet_ds.c
> +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
> @@ -85,8 +85,11 @@ void __init corenet_ds_setup_arch(void)
> 	for_each_node_by_type(np, "pci") {
> 		if (of_device_is_compatible(np, "fsl,p4080-pcie") ||
> 		    of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2")) =
{
> -			fsl_add_bridge(np, 0);
> +			if (fsl_add_bridge(np, 0) < 0)
> +				continue;
> 			hose =3D pci_find_hose_for_OF_device(np);
> +			if (!hose)
> +				continue;
> 			max =3D min(max, hose->dma_window_base_cur +
> 					hose->dma_window_size);
> 		}

Can we just make this:

	fsl_add_bridge()
	hose =3D pci_find_hose_for_OF_device(np);
	if (hose)
		max =3D min(...);

?

- k

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
From: Kumar Gala @ 2012-03-16 20:35 UTC (permalink / raw)
  To: <shuo.liu@freesacle.com>
  Cc: Zhao Chenhui, Liu Shuo, r61911, Liu Shuo, scottwood, linuxppc-dev
In-Reply-To: <1328861387-31390-1-git-send-email-shuo.liu@freesacle.com>


On Feb 10, 2012, at 2:09 AM, <shuo.liu@freesacle.com> =
<shuo.liu@freesacle.com> wrote:

> From: Liu Shuo <shuo.liu@freescale.com>
>=20
> A PCIe erratum of mpc85xx may causes a core hang when a link of PCIe
> goes down. when the link goes down, Non-posted transactions issued
> via the ATMU requiring completion result in an instruction stall.
> At the same time a machine-check exception is generated to the core
> to allow further processing by the handler. We implements the handler
> which skips the instruction caused the stall.
>=20
> Signed-off-by: Zhao Chenhui <b35336@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Liu Shuo <b35362@freescale.com>
> ---
> arch/powerpc/kernel/cpu_setup_fsl_booke.S |    2 +-
> arch/powerpc/kernel/traps.c               |    3 ++
> arch/powerpc/sysdev/fsl_pci.c             |   36 =
+++++++++++++++++++++++++++++
> arch/powerpc/sysdev/fsl_pci.h             |    6 +++++
> 4 files changed, 46 insertions(+), 1 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S =
b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
> index 2c03ac2..beef028 100644
> --- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S
> +++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
> @@ -64,7 +64,7 @@ _GLOBAL(__setup_cpu_e500v2)
> 	bl	__e500_icache_setup
> 	bl	__e500_dcache_setup
> 	bl	__setup_e500_ivors
> -#ifdef CONFIG_FSL_RIO
> +#if defined(CONFIG_FSL_RIO) || defined(CONFIG_FSL_PCI)
> 	/* Ensure that RFXE is set */
> 	mfspr	r3,SPRN_HID1
> 	oris	r3,r3,HID1_RFXE@h
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index 343c46b..1d6bcc0 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -57,6 +57,7 @@
> #include <asm/kexec.h>
> #include <asm/ppc-opcode.h>
> #include <asm/rio.h>
> +#include <sysdev/fsl_pci.h>
>=20
> #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
> int (*__debugger)(struct pt_regs *regs) __read_mostly;
> @@ -525,6 +526,8 @@ int machine_check_e500(struct pt_regs *regs)
> 	if (reason & MCSR_BUS_RBERR) {
> 		if (fsl_rio_mcheck_exception(regs))
> 			return 1;
> +		if (fsl_pci_mcheck_exception(regs))
> +			return 1;
> 	}
>=20
> 	printk("Machine check in kernel mode.\n");
> diff --git a/arch/powerpc/sysdev/fsl_pci.c =
b/arch/powerpc/sysdev/fsl_pci.c
> index 6bc3bfd..8ea23f0 100644
> --- a/arch/powerpc/sysdev/fsl_pci.c
> +++ b/arch/powerpc/sysdev/fsl_pci.c
> @@ -30,6 +30,7 @@
> #include <asm/io.h>
> #include <asm/prom.h>
> #include <asm/pci-bridge.h>
> +#include <asm/ppc-pci.h>
> #include <asm/machdep.h>
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
> @@ -727,3 +728,38 @@ u64 fsl_pci_immrbar_base(struct pci_controller =
*hose)
>=20
> 	return 0;
> }
> +
> +static int is_in_pci_mem_space(phys_addr_t addr)
> +{
> +	struct pci_controller *hose;
> +	struct resource *res;
> +	int i;
> +
> +	list_for_each_entry(hose, &hose_list, list_node) {
> +		for (i =3D 0; i < 3; i++) {
> +			res =3D &hose->mem_resources[i];
> +			if ((res->flags & IORESOURCE_MEM) &&
> +				addr >=3D res->start && addr <=3D =
res->end)
> +				return 1;
> +		}
> +	}
> +	return 0;

just move this into fsl_pci_mcheck_exception() no need for a separate =
function.

> +}
> +
> +int fsl_pci_mcheck_exception(struct pt_regs *regs)
> +{
> +	phys_addr_t addr =3D 0;
> +
> +#ifdef CONFIG_PHYS_64BIT
> +	addr =3D mfspr(SPRN_MCARU);
> +	addr <<=3D 32;
> +#endif
> +	addr +=3D mfspr(SPRN_MCAR);
> +
> +	if (is_in_pci_mem_space(addr)) {
> +		regs->nip +=3D 4;
> +		return 1;
> +	}
> +
> +	return 0;
> +}
> diff --git a/arch/powerpc/sysdev/fsl_pci.h =
b/arch/powerpc/sysdev/fsl_pci.h
> index a39ed5c..96b07ce 100644
> --- a/arch/powerpc/sysdev/fsl_pci.h
> +++ b/arch/powerpc/sysdev/fsl_pci.h
> @@ -93,5 +93,11 @@ extern void fsl_pcibios_fixup_bus(struct pci_bus =
*bus);
> extern int mpc83xx_add_bridge(struct device_node *dev);
> u64 fsl_pci_immrbar_base(struct pci_controller *hose);
>=20
> +#ifdef CONFIG_FSL_PCI
> +extern int fsl_pci_mcheck_exception(struct pt_regs *);
> +#else
> +static inline int fsl_pci_mcheck_exception(struct pt_regs *regs) =
{return 0; }

Add space after {

> +#endif
> +
> #endif /* __POWERPC_FSL_PCI_H */
> #endif /* __KERNEL__ */
> --=20
> 1.7.1
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH 9/9] powerpc/mpc8548cds: add 36-bit dts
From: Kumar Gala @ 2012-03-16 20:23 UTC (permalink / raw)
  To: Zhao Chenhui; +Cc: linuxppc-dev
In-Reply-To: <1331024805-15926-8-git-send-email-chenhui.zhao@freescale.com>


On Mar 6, 2012, at 3:06 AM, Zhao Chenhui wrote:

> Create mpc8548cds_36b.dts. Support 36-bit mode.
>=20
> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/boot/dts/mpc8548cds_36b.dts |   86 =
++++++++++++++++++++++++++++++
> 1 files changed, 86 insertions(+), 0 deletions(-)
> create mode 100644 arch/powerpc/boot/dts/mpc8548cds_36b.dts

applied

- k=

^ permalink raw reply

* Re: [PATCH 8/9] powerpc/mpc8548cds: rename mpc8548cds.dts to mpc8548cds_32b.dts and create mpc8548cds.dtsi
From: Kumar Gala @ 2012-03-16 20:23 UTC (permalink / raw)
  To: Zhao Chenhui; +Cc: linuxppc-dev
In-Reply-To: <1331024805-15926-7-git-send-email-chenhui.zhao@freescale.com>


On Mar 6, 2012, at 3:06 AM, Zhao Chenhui wrote:

> * Create mpc8548cds.dtsi.
> * Move lbc, soc and pci0 nodes to mpc8548cds_32b.dtsi.
> * Change cuImage.mpc8548cds to cuImage.mpc8548cds_32b.
> * Rename mpc8548cds.dts to mpc8548cds_32b.dts.
>=20
> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> arch/powerpc/boot/Makefile               |    2 +-
> arch/powerpc/boot/dts/mpc8548cds.dts     |  357 =
------------------------------
> arch/powerpc/boot/dts/mpc8548cds.dtsi    |  306 =
+++++++++++++++++++++++++
> arch/powerpc/boot/dts/mpc8548cds_32b.dts |   86 +++++++
> 4 files changed, 393 insertions(+), 358 deletions(-)
> delete mode 100644 arch/powerpc/boot/dts/mpc8548cds.dts
> create mode 100644 arch/powerpc/boot/dts/mpc8548cds.dtsi
> create mode 100644 arch/powerpc/boot/dts/mpc8548cds_32b.dts

applied

- k=

^ permalink raw reply

* Re: [PATCH 7/9] powerpc/mpc8548cds: fix alias in mpc8548si-pre.dtsi
From: Kumar Gala @ 2012-03-16 20:23 UTC (permalink / raw)
  To: Zhao Chenhui; +Cc: linuxppc-dev
In-Reply-To: <1331024805-15926-6-git-send-email-chenhui.zhao@freescale.com>


On Mar 6, 2012, at 3:06 AM, Zhao Chenhui wrote:

> Correct ethernet1 and add ethernet2 and ethernet3.
> 
> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/boot/dts/fsl/mpc8548si-pre.dtsi |    4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)

applied

- k

^ permalink raw reply

* Re: [PATCH 5/9] powerpc/mpc8548cds: Add RapidIO node to dts
From: Kumar Gala @ 2012-03-16 20:23 UTC (permalink / raw)
  To: Zhao Chenhui; +Cc: linuxppc-dev
In-Reply-To: <1331024805-15926-4-git-send-email-chenhui.zhao@freescale.com>


On Mar 6, 2012, at 3:06 AM, Zhao Chenhui wrote:

> From: chenhui zhao <chenhui.zhao@freescale.com>
> 
> Enable RapidIO and add rapidio and rmu nodes to dts.
> 
> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/boot/dts/fsl/mpc8548si-post.dtsi |   16 ++++++++++++++++
> arch/powerpc/boot/dts/mpc8548cds.dts          |    7 +++++++
> arch/powerpc/platforms/85xx/Kconfig           |    1 +
> 3 files changed, 24 insertions(+), 0 deletions(-)

applied

- k

^ permalink raw reply

* Re: [PATCH 4/9] powerpc/mpc8548cds: Add NOR flash node to dts
From: Kumar Gala @ 2012-03-16 20:22 UTC (permalink / raw)
  To: Zhao Chenhui; +Cc: linuxppc-dev
In-Reply-To: <1331024805-15926-3-git-send-email-chenhui.zhao@freescale.com>


On Mar 6, 2012, at 3:06 AM, Zhao Chenhui wrote:

> From: chenhui zhao <chenhui.zhao@freescale.com>
>=20
> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/boot/dts/mpc8548cds.dts |   40 =
+++++++++++++++++++++++++++++++++-
> 1 files changed, 39 insertions(+), 1 deletions(-)

applied

- k=

^ permalink raw reply

* Re: [PATCH 2/9 v2] powerpc/mpc85xxcds: Fix PCI I/O space resource of PCI bridge
From: Kumar Gala @ 2012-03-16 20:22 UTC (permalink / raw)
  To: Zhao Chenhui; +Cc: linuxppc-dev
In-Reply-To: <1331720127-16012-1-git-send-email-chenhui.zhao@freescale.com>


On Mar 14, 2012, at 5:15 AM, Zhao Chenhui wrote:

> From: chenhui zhao <chenhui.zhao@freescale.com>
> 
> There is a PCI bridge(Tsi310) between the MPC8548 and a VIA
> southbridge chip.
> 
> The bootloader sets the PCI bridge to open a window from 0x0000
> to 0x1fff on the PCI I/O space. But the kernel can't set the I/O
> resource. In the routine pci_read_bridge_io(), if the base which
> is read from PCI_IO_BASE is equal to zero, the routine don't set
> the I/O resource of the child bus.
> 
> To allow the legacy I/O space on the VIA southbridge to be accessed,
> use the fixup to fix the PCI I/O space of the PCI bridge.
> 
> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> Changes for v2:
> * merge patch 1/9 and 2/9
> * rename PCI_DEVICE_ID_IBM_PCIX_BRIDGE to PCI_DEVICE_ID_IDT_TSI310

applied

- k

^ permalink raw reply

* Re: [PATCH 6/9] powerpc/mpc8548cds: Add FPGA node to dts
From: Kumar Gala @ 2012-03-16 20:22 UTC (permalink / raw)
  To: Zhao Chenhui; +Cc: linuxppc-dev
In-Reply-To: <1331024805-15926-5-git-send-email-chenhui.zhao@freescale.com>


On Mar 6, 2012, at 3:06 AM, Zhao Chenhui wrote:

> From: chenhui zhao <chenhui.zhao@freescale.com>
>=20
> Remove FPGA(CADMUS) macros in code. Move it to dts.
>=20
> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/boot/dts/mpc8548cds.dts      |    8 ++++-
> arch/powerpc/platforms/85xx/mpc85xx_cds.c |   50 =
+++++++++++++++++++---------
> 2 files changed, 41 insertions(+), 17 deletions(-)

applied

- k=

^ permalink raw reply

* Re: [PATCH] powerpc/85xx:Add BSC9131 RDB Support
From: Kumar Gala @ 2012-03-16 20:12 UTC (permalink / raw)
  To: Prabhakar Kushwaha
  Cc: Poonam Aggrwal, Priyanka Jain, devicetree-discuss,
	Ramneek Mehresh, Rajan Srivastava, linuxppc-dev, Akhil Goyal
In-Reply-To: <1331789851-19213-1-git-send-email-prabhakar@freescale.com>

>=20
>=20
> diff --git a/arch/powerpc/boot/dts/bsc9131rdb.dtsi =
b/arch/powerpc/boot/dts/bsc9131rdb.dtsi
> new file mode 100644
> index 0000000..d274c014
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/bsc9131rdb.dtsi
> @@ -0,0 +1,179 @@
> +/*
> + * BSC9131 RDB Device Tree Source stub (no addresses or top-level =
ranges)
> + *
> + * Copyright 2011-2012 Freescale Semiconductor Inc.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions =
are met:
> + *     * Redistributions of source code must retain the above =
copyright
> + *       notice, this list of conditions and the following =
disclaimer.
> + *     * Redistributions in binary form must reproduce the above =
copyright
> + *       notice, this list of conditions and the following disclaimer =
in the
> + *       documentation and/or other materials provided with the =
distribution.
> + *     * Neither the name of Freescale Semiconductor nor the
> + *       names of its contributors may be used to endorse or promote =
products
> + *       derived from this software without specific prior written =
permission.
> + *
> + *
> + * ALTERNATIVELY, this software may be distributed under the terms of =
the
> + * GNU General Public License ("GPL") as published by the Free =
Software
> + * Foundation, either version 2 of that License or (at your option) =
any
> + * later version.
> + *
> + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND =
ANY
> + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE =
IMPLIED
> + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE =
ARE
> + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE =
FOR ANY
> + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL =
DAMAGES
> + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR =
SERVICES;
> + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER =
CAUSED AND
> + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, =
OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE =
USE OF THIS
> + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +&board_ifc {
> +
> +	nand@0,0 {
> +		#address-cells =3D <1>;
> +		#size-cells =3D <1>;
> +		compatible =3D "fsl,ifc-nand";
> +		reg =3D <0x0 0x0 0x4000>;
> +
> +		partition@0 {
> +			/* This location must not be altered  */
> +			/* 3MB for u-boot Bootloader Image */
> +			reg =3D <0x0 0x00300000>;
> +			label =3D "NAND U-Boot Image";
> +			read-only;
> +		};
> +
> +		partition@300000 {
> +			/* 1MB for DTB Image */
> +			reg =3D <0x00300000 0x00100000>;
> +			label =3D "NAND DTB Image";
> +		};
> +
> +		partition@400000 {
> +			/* 8MB for Linux Kernel Image */
> +			reg =3D <0x00400000 0x00800000>;
> +			label =3D "NAND Linux Kernel Image";
> +		};
> +
> +		partition@c00000 {
> +			/* Rest space for Root file System Image */
> +			reg =3D <0x00c00000 0x07400000>;
> +			label =3D " NAND RFS Image";
> +		};
> +	};
> +};
> +
> +&board_soc {
> +	i2c@3000 {
> +		gpio3: gpio@21 {
> +			compatible =3D "nxp,pca9555";

Is there any binding spec for nxp,

> +			reg =3D <0x21>;
> +			#gpio-cells =3D <2>;
> +			gpio-controller;
> +			polarity =3D <0x00>;
> +		};
> +		gpio4: gpio@23 {
> +			compatible =3D "nxp,pca9555";
> +			reg =3D <0x23>;
> +			#gpio-cells =3D <2>;
> +			gpio-controller;
> +			polarity =3D <0x00>;
> +		};
> +		gpio5: gpio@27 {
> +			compatible =3D "nxp,pca9555";
> +			reg =3D <0x27>;
> +			#gpio-cells =3D <2>;
> +			gpio-controller;
> +			polarity =3D <0x00>;
> +		};
> +		hwmon@4c {
> +			compatible =3D "adi,adt7461";
> +			reg =3D <0x4c>;
> +		};
> +		eeprom@52 {
> +			compatible =3D "st-micro,24c02";

should this have a compatible with atmel,24c02?

> +			reg =3D <0x52>;
> +		};
> +	};
> +
> +	/* BSC9131RDB does not have any device on i2c@3100 */
> +	i2c@3100 {
> +		status =3D "disabled";
> +	};
> +
> +	spi@7000 {
> +		flash@0 {
> +			#address-cells =3D <1>;
> +			#size-cells =3D <1>;
> +			compatible =3D "spansion,s25sl12801";
> +			reg =3D <0>;
> +			spi-max-frequency =3D <50000000>;
> +
> +			/* 512KB for u-boot Bootloader Image */
> +			partition@0 {
> +				reg =3D <0x0 0x00080000>;
> +				label =3D "SPI Flash U-Boot Image";
> +				read-only;
> +			};
> +
> +			/* 512KB for DTB Image */
> +			partition@80000 {
> +				reg =3D <0x00080000 0x00080000>;
> +				label =3D "SPI Flash DTB Image";
> +			};
> +
> +			/* 4MB for Linux Kernel Image */
> +			partition@100000 {
> +				reg =3D <0x00100000 0x00400000>;
> +				label =3D "SPI Flash Kernel Image";
> +			};
> +
> +			/* 4MB for Compressed RFS Image */
> +			partition@500000 {
> +				reg =3D <0x00500000 0x00400000>;
> +				label =3D "SPI Flash Compressed RFS =
Image";
> +			};
> +
> +			/* 7MB for JFFS2 based RFS */
> +			partition@900000 {
> +				reg =3D <0x00900000 0x00700000>;
> +				label =3D "SPI Flash JFFS2 RFS Image";
> +			};
> +		};
> +	};
> +
> +	usb@22000 {
> +		phy_type =3D "ulpi";
> +	};
> +
> +	mdio@24000 {
> +		phy0: ethernet-phy@0 {
> +			interrupts =3D <3 1 0 0>;
> +			reg =3D <0x0>;
> +		};
> +
> +		phy1: ethernet-phy@1 {
> +			interrupts =3D <2 1 0 0>;
> +			reg =3D <0x3>;
> +		};
> +	};
> +
> +	sdhci@2e000 {
> +		status =3D "disabled";
> +	};
> +
> +	enet0: ethernet@b0000 {
> +		phy-handle =3D <&phy0>;
> +		phy-connection-type =3D "rgmii-id";
> +	};
> +
> +	enet1: ethernet@b1000 {
> +		phy-handle =3D <&phy1>;
> +		phy-connection-type =3D "rgmii-id";
> +	};
> +};


> diff --git a/arch/powerpc/platforms/85xx/bsc913x_board.c =
b/arch/powerpc/platforms/85xx/bsc913x_board.c

should be bsc913x_rdb.c

> new file mode 100644
> index 0000000..934c3b5
> --- /dev/null
> +++ b/arch/powerpc/platforms/85xx/bsc913x_board.c
> @@ -0,0 +1,96 @@
> +/*
> + * BSC9131RDB Board Setup
> + *
> + * Author: Priyanka Jain <Priyanka.Jain@freescale.com>
> + *
> + * Copyright 2011-2012 Freescale Semiconductor Inc.
> + *
> + * This program is free software; you can redistribute  it and/or =
modify it
> + * under  the terms of  the GNU General  Public License as published =
by the
> + * Free Software Foundation;  either version 2 of the  License, or =
(at your
> + * option) any later version.
> + */
> +
> +#include <linux/of_platform.h>
> +#include <linux/pci.h>
> +#include <asm/mpic.h>
> +#include <sysdev/fsl_soc.h>
> +#include <asm/udbg.h>
> +
> +void __init bsc913x_board_pic_init(void)
> +{
> +	struct mpic *mpic;
> +	struct resource r;
> +	struct device_node *np;
> +
> +	np =3D of_find_node_by_type(NULL, "open-pic");
> +	if (!np) {
> +		pr_err("bsc913x: Could not find open-pic node\n");
> +		return;
> +	}
> +
> +	if (of_address_to_resource(np, 0, &r)) {
> +		pr_err("bsc913x: Failed to map mpic register space\n");
> +		of_node_put(np);
> +		return;
> +	}
> +
> +	mpic =3D mpic_alloc(np, r.start, MPIC_WANTS_RESET |
> +	  MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | =
MPIC_SINGLE_DEST_CPU,
> +	  0, 256, " OpenPIC  ");
> +
> +	of_node_put(np);
> +
> +	if (!mpic)
> +		pr_err("bsc913x: Failed to allocate MPIC structure\n");
> +	else
> +		mpic_init(mpic);


Please update to match current board code

> +}
> +
> +/*
> + * Setup the architecture
> + */
> +static void __init bsc913x_board_setup_arch(void)
> +{
> +	if (ppc_md.progress)
> +		ppc_md.progress("bsc913x_board_setup_arch()", 0);
> +
> +	pr_info("bsc913x board from Freescale Semiconductor\n");
> +}
> +
> +static struct of_device_id __initdata bsc913x_board_ids[] =3D {
> +	{ .type =3D "soc", },
> +	{ .type =3D "dsp", },

remove dsp, doesn't show up anywhere else

> +	{ .compatible =3D "soc", },
> +	{ .compatible =3D "simple-bus", },
> +	{ .compatible =3D "gianfar", },
> +	{},
> +};
> +
> +static int __init bsc913x_board_publish_devices(void)
> +{
> +	return of_platform_bus_probe(NULL, bsc913x_board_ids, NULL);
> +}
> +machine_device_initcall(bsc9131_rdb, bsc913x_board_publish_devices);
> +
> +/*
> + * Called very early, device-tree isn't unflattened
> + */
> +
> +static int __init bsc9131_rdb_probe(void)
> +{
> +	unsigned long root =3D of_get_flat_dt_root();
> +
> +	return of_flat_dt_is_compatible(root, "fsl,bsc9131rdb");
> +}
> +
> +define_machine(bsc9131_rdb) {
> +	.name			=3D "BSC9131 RDB",
> +	.probe			=3D bsc9131_rdb_probe,
> +	.setup_arch		=3D bsc913x_board_setup_arch,
> +	.init_IRQ		=3D bsc913x_board_pic_init,
> +	.get_irq		=3D mpic_get_irq,
> +	.restart		=3D fsl_rstcr_restart,
> +	.calibrate_decr		=3D generic_calibrate_decr,
> +	.progress		=3D udbg_progress,
> +};
> --=20
> 1.7.5.4
>=20
>=20

^ permalink raw reply


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