LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] ibmveth: Fix more little endian issues
From: Ben Hutchings @ 2013-12-25 10:38 UTC (permalink / raw)
  To: Anton Blanchard
  Cc: Dinar Valeev, linuxppc-dev, Alexander Graf, netdev, Joe Perches,
	Santiago Leon
In-Reply-To: <20131224125529.58970f1b@kryten>


On Tue, 2013-12-24 at 12:55 +1100, Anton Blanchard wrote:
> The hypervisor expects MAC addresses passed in registers to be big
> endian u64. Create a helper function called ibmveth_encode_mac_addr
> which does the right thing in both big and little endian.
> 
> We were storing the MAC address in a long in struct ibmveth_adapter.
> It's never used so remove it - we don't need another place in the
> driver where we create endian issues with MAC addresses.
[...]
> @@ -523,10 +523,20 @@ retry:
>  	return rc;
>  }
>  
> +/* The hypervisor expects MAC addresses passed in registers to be
> + * big endian u64.
> + */
> +static __be64 ibmveth_encode_mac_addr(char *mac)
> +{
> +	unsigned long encoded = 0;

u64

> +	memcpy(((char *)&encoded) + 2, mac, ETH_ALEN);
> +	return cpu_to_be64(encoded);
> +}
[...]

So on big-endian systems the byte order of the result will be:

    0 0 mac0 mac1 mac2 mac3 mac4 mac5

and on little-endian systems it's:

    mac5 mac4 mac3 mac2 mac1 mac0 0 0

It seems to me that 'encoded' is actually in big-endian order and this
function returns the address in CPU order.

So are you sure your explanation isn't backwards, because it looks to me
like the driver was already holding the MAC address in big-endian order
and perhaps the hypercall mechanism does a byte-swap when the guest is
little-endian.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* [PATCH 1/4] powerpc/85xx/dts: add third elo3 dma component
From: Shengzhou Liu @ 2013-12-25 10:06 UTC (permalink / raw)
  To: linuxppc-dev, scottwood; +Cc: Hongbo Zhang, Shengzhou Liu

Add elo3-dma-2.dtsi to support the third DMA controller.
This is used on T2080, T4240, B4860, etc.

FSL MPIC v4.3 adds a new discontiguous address range for internal interrupts,
e.g. internal interrupt 0 is at offset 0x200 and thus interrupt number is:
0x200 >> 5 = 16 in the device tree.  DMA controller 3 channel 0 internal
interrupt 240 is at offset 0x3a00, and thus the corresponding interrupt
number is: 0x3a00 >> 5 = 464, it's similar for other 7 interrupt numbers
of DMA 3 channels.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Hongbo Zhang <hongbo.zhang@freescale.com>
---
 arch/powerpc/boot/dts/fsl/elo3-dma-2.dtsi | 82 +++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100644 arch/powerpc/boot/dts/fsl/elo3-dma-2.dtsi

diff --git a/arch/powerpc/boot/dts/fsl/elo3-dma-2.dtsi b/arch/powerpc/boot/dts/fsl/elo3-dma-2.dtsi
new file mode 100644
index 0000000..d3cc8d0
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/elo3-dma-2.dtsi
@@ -0,0 +1,82 @@
+/*
+ * QorIQ Elo3 DMA device tree stub [ controller @ offset 0x102300 ]
+ *
+ * Copyright 2013 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.
+ */
+
+dma2: dma@102300 {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "fsl,elo3-dma";
+	reg = <0x102300 0x4>,
+	      <0x102600 0x4>;
+	ranges = <0x0 0x102100 0x500>;
+	dma-channel@0 {
+		compatible = "fsl,eloplus-dma-channel";
+		reg = <0x0 0x80>;
+		interrupts = <464 2 0 0>;
+	};
+	dma-channel@80 {
+		compatible = "fsl,eloplus-dma-channel";
+		reg = <0x80 0x80>;
+		interrupts = <465 2 0 0>;
+	};
+	dma-channel@100 {
+		compatible = "fsl,eloplus-dma-channel";
+		reg = <0x100 0x80>;
+		interrupts = <466 2 0 0>;
+	};
+	dma-channel@180 {
+		compatible = "fsl,eloplus-dma-channel";
+		reg = <0x180 0x80>;
+		interrupts = <467 2 0 0>;
+	};
+	dma-channel@300 {
+		compatible = "fsl,eloplus-dma-channel";
+		reg = <0x300 0x80>;
+		interrupts = <468 2 0 0>;
+	};
+	dma-channel@380 {
+		compatible = "fsl,eloplus-dma-channel";
+		reg = <0x380 0x80>;
+		interrupts = <469 2 0 0>;
+	};
+	dma-channel@400 {
+		compatible = "fsl,eloplus-dma-channel";
+		reg = <0x400 0x80>;
+		interrupts = <470 2 0 0>;
+	};
+	dma-channel@480 {
+		compatible = "fsl,eloplus-dma-channel";
+		reg = <0x480 0x80>;
+		interrupts = <471 2 0 0>;
+	};
+};
-- 
1.8.0

^ permalink raw reply related

* [PATCH 2/4] powerpc/fsl_pci: add versionless pci compatible
From: Shengzhou Liu @ 2013-12-25 10:06 UTC (permalink / raw)
  To: linuxppc-dev, scottwood; +Cc: Shengzhou Liu
In-Reply-To: <1387966018-10131-1-git-send-email-Shengzhou.Liu@freescale.com>

There are much pci compatible with version on existing platforms.
To stop putting version numbers in device tree later, we add a
generic compatible 'fsl,qoriq-pcie'.
The version number is readable directly from a register.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4dfd61d..a7c71ff 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1035,6 +1035,7 @@ static const struct of_device_id pci_ids[] = {
 	{ .compatible = "fsl,mpc8548-pcie", },
 	{ .compatible = "fsl,mpc8610-pci", },
 	{ .compatible = "fsl,mpc8641-pcie", },
+	{ .compatible = "fsl,qoriq-pcie", },
 	{ .compatible = "fsl,qoriq-pcie-v2.1", },
 	{ .compatible = "fsl,qoriq-pcie-v2.2", },
 	{ .compatible = "fsl,qoriq-pcie-v2.3", },
-- 
1.8.0

^ permalink raw reply related

* [PATCH 3/4] powerpc/fsl-booke: Add support for T2080/T2081 SoC
From: Shengzhou Liu @ 2013-12-25 10:06 UTC (permalink / raw)
  To: linuxppc-dev, scottwood; +Cc: Shengzhou Liu
In-Reply-To: <1387966018-10131-1-git-send-email-Shengzhou.Liu@freescale.com>

Add support for T2080/T2081 SoC without DPAA components.

The T2080 SoC includes the following function and features:
- Four dual-threaded 64-bit Power architecture e6500 cores, up to 1.8GHz
- 2MB L2 cache and 512KB CoreNet platform cache (CPC)
- Hierarchical interconnect fabric
- One 32-/64-bit DDR3/3L SDRAM memory controllers with ECC and interleaving
- Data Path Acceleration Architecture (DPAA) incorporating acceleration
- 16 SerDes lanes up to 10.3125 GHz
- 8 Ethernet interfaces (multiple 1G/2.5G/10G MACs)
- High-speed peripheral interfaces
  - Four PCI Express controllers (two PCIe 2.0 and two PCIe 3.0)
  - Two Serial RapidIO 2.0 controllers/ports running at up to 5 GHz
- Additional peripheral interfaces
  - Two serial ATA (SATA 2.0) controllers
  - Two high-speed USB 2.0 controllers with integrated PHY
  - Enhanced secure digital host controller (SD/SDXC/eMMC)
  - Enhanced serial peripheral interface (eSPI)
  - Four I2C controllers
  - Four 2-pin UARTs or two 4-pin UARTs
  - Integrated Flash Controller supporting NAND and NOR flash
- Three eight-channel DMA engines
- Support for hardware virtualization and partitioning enforcement
- QorIQ Platform's Trust Architecture 2.0

T2081 is a reduced personality of T2080 without SATA, sRIO, RMan,
Aurora, and with less SerDes lanes and ethernet interfaces.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 arch/powerpc/boot/dts/fsl/t2080si-post.dtsi |  60 +++++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 384 ++++++++++++++++++++++++++++
 arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi  | 100 ++++++++
 arch/powerpc/include/asm/mpc85xx.h          |   2 +
 4 files changed, 546 insertions(+)
 create mode 100644 arch/powerpc/boot/dts/fsl/t2080si-post.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi

diff --git a/arch/powerpc/boot/dts/fsl/t2080si-post.dtsi b/arch/powerpc/boot/dts/fsl/t2080si-post.dtsi
new file mode 100644
index 0000000..1a902fe
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/t2080si-post.dtsi
@@ -0,0 +1,60 @@
+/*
+ * T2080 Silicon/SoC Device Tree Source (post include)
+ *
+ * Copyright 2013 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.
+ */
+
+/include/ "t2081si-post.dtsi"
+
+&soc {
+/include/ "qoriq-sata2-0.dtsi"
+/include/ "qoriq-sata2-1.dtsi"
+};
+
+&rio {
+	compatible = "fsl,srio";
+	interrupts = <16 2 1 11>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+	ranges;
+
+	port1 {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		cell-index = <1>;
+	};
+
+	port2 {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		cell-index = <2>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
new file mode 100644
index 0000000..6495fe9
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
@@ -0,0 +1,384 @@
+/*
+ * T2081 Silicon/SoC Device Tree Source (post include)
+ *
+ * Copyright 2013 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.
+ */
+
+&ifc {
+	#address-cells = <2>;
+	#size-cells = <1>;
+	compatible = "fsl,ifc", "simple-bus";
+	interrupts = <25 2 0 0>;
+};
+
+/* controller at 0x240000 */
+&pci0 {
+	compatible = "fsl,t208x-pcie", "fsl,qoriq-pcie";
+	device_type = "pci";
+	#size-cells = <2>;
+	#address-cells = <3>;
+	bus-range = <0x0 0xff>;
+	interrupts = <20 2 0 0>;
+	pcie@0 {
+		reg = <0 0 0 0 0>;
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		device_type = "pci";
+		interrupts = <20 2 0 0>;
+		interrupt-map-mask = <0xf800 0 0 7>;
+		interrupt-map = <
+			/* IDSEL 0x0 */
+			0000 0 0 1 &mpic 40 1 0 0
+			0000 0 0 2 &mpic 1 1 0 0
+			0000 0 0 3 &mpic 2 1 0 0
+			0000 0 0 4 &mpic 3 1 0 0
+			>;
+	};
+};
+
+/* controller at 0x250000 */
+&pci1 {
+	compatible = "fsl,t208x-pcie", "fsl,qoriq-pcie";
+	device_type = "pci";
+	#size-cells = <2>;
+	#address-cells = <3>;
+	bus-range = <0 0xff>;
+	interrupts = <21 2 0 0>;
+	pcie@0 {
+		reg = <0 0 0 0 0>;
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		device_type = "pci";
+		interrupts = <21 2 0 0>;
+		interrupt-map-mask = <0xf800 0 0 7>;
+		interrupt-map = <
+			/* IDSEL 0x0 */
+			0000 0 0 1 &mpic 41 1 0 0
+			0000 0 0 2 &mpic 5 1 0 0
+			0000 0 0 3 &mpic 6 1 0 0
+			0000 0 0 4 &mpic 7 1 0 0
+			>;
+	};
+};
+
+/* controller at 0x260000 */
+&pci2 {
+	compatible = "fsl,t208x-pcie", "fsl,qoriq-pcie";
+	device_type = "pci";
+	#size-cells = <2>;
+	#address-cells = <3>;
+	bus-range = <0x0 0xff>;
+	interrupts = <22 2 0 0>;
+	pcie@0 {
+		reg = <0 0 0 0 0>;
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		device_type = "pci";
+		interrupts = <22 2 0 0>;
+		interrupt-map-mask = <0xf800 0 0 7>;
+		interrupt-map = <
+			/* IDSEL 0x0 */
+			0000 0 0 1 &mpic 42 1 0 0
+			0000 0 0 2 &mpic 9 1 0 0
+			0000 0 0 3 &mpic 10 1 0 0
+			0000 0 0 4 &mpic 11 1 0 0
+			>;
+	};
+};
+
+/* controller at 0x270000 */
+&pci3 {
+	compatible = "fsl,t208x-pcie", "fsl,qoriq-pcie";
+	device_type = "pci";
+	#size-cells = <2>;
+	#address-cells = <3>;
+	bus-range = <0x0 0xff>;
+	interrupts = <23 2 0 0>;
+	pcie@0 {
+		reg = <0 0 0 0 0>;
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		device_type = "pci";
+		interrupts = <23 2 0 0>;
+		interrupt-map-mask = <0xf800 0 0 7>;
+		interrupt-map = <
+			/* IDSEL 0x0 */
+			0000 0 0 1 &mpic 43 1 0 0
+			0000 0 0 2 &mpic 0 1 0 0
+			0000 0 0 3 &mpic 4 1 0 0
+			0000 0 0 4 &mpic 8 1 0 0
+			>;
+	};
+};
+
+&dcsr {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "fsl,dcsr", "simple-bus";
+
+	dcsr-epu@0 {
+		compatible = "fsl,t208x-dcsr-epu", "fsl,dcsr-epu";
+		interrupts = <52 2 0 0
+			      84 2 0 0
+			      85 2 0 0
+			      94 2 0 0
+			      95 2 0 0>;
+		reg = <0x0 0x1000>;
+	};
+	dcsr-npc {
+		compatible = "fsl,t208x-dcsr-cnpc", "fsl,dcsr-cnpc";
+		reg = <0x1000 0x1000 0x1002000 0x10000>;
+	};
+	dcsr-nxc@2000 {
+		compatible = "fsl,dcsr-nxc";
+		reg = <0x2000 0x1000>;
+	};
+	dcsr-corenet {
+		compatible = "fsl,dcsr-corenet";
+		reg = <0x8000 0x1000 0x1A000 0x1000>;
+	};
+	dcsr-ocn@11000 {
+		compatible = "fsl,t208x-dcsr-ocn", "fsl,dcsr-ocn";
+		reg = <0x11000 0x1000>;
+	};
+	dcsr-ddr@12000 {
+		compatible = "fsl,dcsr-ddr";
+		dev-handle = <&ddr1>;
+		reg = <0x12000 0x1000>;
+	};
+	dcsr-nal@18000 {
+		compatible = "fsl,t208x-dcsr-nal", "fsl,dcsr-nal";
+		reg = <0x18000 0x1000>;
+	};
+	dcsr-rcpm@22000 {
+		compatible = "fsl,t208x-dcsr-rcpm", "fsl,dcsr-rcpm";
+		reg = <0x22000 0x1000>;
+	};
+	dcsr-snpc@30000 {
+		compatible = "fsl,t208x-dcsr-snpc", "fsl,dcsr-snpc";
+		reg = <0x30000 0x1000 0x1022000 0x10000>;
+	};
+	dcsr-snpc@31000 {
+		compatible = "fsl,t208x-dcsr-snpc", "fsl,dcsr-snpc";
+		reg = <0x31000 0x1000 0x1042000 0x10000>;
+	};
+	dcsr-snpc@32000 {
+		compatible = "fsl,t208x-dcsr-snpc", "fsl,dcsr-snpc";
+		reg = <0x32000 0x1000 0x1062000 0x10000>;
+	};
+	dcsr-cpu-sb-proxy@100000 {
+		compatible = "fsl,dcsr-e6500-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
+		cpu-handle = <&cpu0>;
+		reg = <0x100000 0x1000 0x101000 0x1000>;
+	};
+	dcsr-cpu-sb-proxy@108000 {
+		compatible = "fsl,dcsr-e6500-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
+		cpu-handle = <&cpu1>;
+		reg = <0x108000 0x1000 0x109000 0x1000>;
+	};
+	dcsr-cpu-sb-proxy@110000 {
+		compatible = "fsl,dcsr-e6500-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
+		cpu-handle = <&cpu2>;
+		reg = <0x110000 0x1000 0x111000 0x1000>;
+	};
+	dcsr-cpu-sb-proxy@118000 {
+		compatible = "fsl,dcsr-e6500-sb-proxy", "fsl,dcsr-cpu-sb-proxy";
+		cpu-handle = <&cpu3>;
+		reg = <0x118000 0x1000 0x119000 0x1000>;
+	};
+};
+
+&soc {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	device_type = "soc";
+	compatible = "simple-bus";
+
+	soc-sram-error {
+		compatible = "fsl,soc-sram-error";
+		interrupts = <16 2 1 29>;
+	};
+
+	corenet-law@0 {
+		compatible = "fsl,corenet-law";
+		reg = <0x0 0x1000>;
+		fsl,num-laws = <32>;
+	};
+
+	ddr1: memory-controller@8000 {
+		compatible = "fsl,qoriq-memory-controller-v4.7",
+				"fsl,qoriq-memory-controller";
+		reg = <0x8000 0x1000>;
+		interrupts = <16 2 1 23>;
+	};
+
+	cpc: l3-cache-controller@10000 {
+		compatible = "fsl,t208x-l3-cache-controller", "cache";
+		reg = <0x10000 0x1000
+		       0x11000 0x1000
+		       0x12000 0x1000>;
+		interrupts = <16 2 1 27
+			      16 2 1 26
+			      16 2 1 25>;
+	};
+
+	corenet-cf@18000 {
+		compatible = "fsl,corenet2-cf";
+		reg = <0x18000 0x1000>;
+		interrupts = <16 2 1 31>;
+		fsl,ccf-num-csdids = <32>;
+		fsl,ccf-num-snoopids = <32>;
+	};
+
+	iommu@20000 {
+		compatible = "fsl,pamu-v1.0", "fsl,pamu";
+		reg = <0x20000 0x6000>;
+		interrupts = <
+			24 2 0 0
+			16 2 1 30>;
+	};
+
+/include/ "qoriq-mpic4.3.dtsi"
+
+	guts: global-utilities@e0000 {
+		compatible = "fsl,t208x-device-config", "fsl,qoriq-device-config-2.0";
+		reg = <0xe0000 0xe00>;
+		fsl,has-rstcr;
+		fsl,liodn-bits = <12>;
+	};
+
+	clockgen: global-utilities@e1000 {
+		compatible = "fsl,t208x-clockgen", "fsl,qoriq-clockgen-2.0",
+				   "fixed-clock";
+		reg = <0xe1000 0x1000>;
+		clock-output-names = "sysclk";
+		#clock-cells = <0>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pll0: pll0@800 {
+			#clock-cells = <1>;
+			reg = <0x800>;
+			compatible = "fsl,core-pll-clock";
+			clocks = <&clockgen>;
+			clock-output-names = "pll0", "pll0-div2", "pll0-div4";
+		};
+		pll1: pll1@820 {
+			#clock-cells = <1>;
+			reg = <0x820>;
+			compatible = "fsl,core-pll-clock";
+			clocks = <&clockgen>;
+			clock-output-names = "pll1", "pll1-div2", "pll1-div4";
+		};
+		mux0: mux0@0 {
+			#clock-cells = <0>;
+			reg = <0x0>;
+			compatible = "fsl,core-mux-clock";
+			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
+				 <&pll1 0>, <&pll1 1>, <&pll1 2>;
+			clock-names = "pll0_0", "pll0_1", "pll0_2",
+				      "pll1_0", "pll1_1", "pll1_2";
+			clock-output-names = "cmux0";
+		};
+		mux1: mux1@20 {
+			#clock-cells = <0>;
+			reg = <0x20>;
+			compatible = "fsl,core-mux-clock";
+			clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
+				 <&pll1 0>, <&pll1 1>, <&pll1 2>;
+			clock-names = "pll0_0", "pll0_1", "pll0_2",
+				      "pll1_0", "pll1_1", "pll1_2";
+			clock-output-names = "cmux1";
+		};
+	};
+
+	rcpm: global-utilities@e2000 {
+		compatible = "fsl,t208x-rcpm", "fsl,qoriq-rcpm-2.0";
+		reg = <0xe2000 0x1000>;
+	};
+
+	sfp: sfp@e8000 {
+		compatible = "fsl,t208x-sfp";
+		reg = <0xe8000 0x1000>;
+	};
+
+	serdes: serdes@ea000 {
+		compatible = "fsl,t208x-serdes";
+		reg = <0xea000 0x4000>;
+	};
+
+/include/ "elo3-dma-0.dtsi"
+/include/ "elo3-dma-1.dtsi"
+/include/ "elo3-dma-2.dtsi"
+
+/include/ "qoriq-espi-0.dtsi"
+	spi@110000 {
+		fsl,espi-num-chipselects = <4>;
+	};
+
+/include/ "qoriq-esdhc-0.dtsi"
+	sdhc@114000 {
+		compatible = "fsl,t208x-esdhc", "fsl,esdhc";
+		sdhci,auto-cmd12;
+	};
+/include/ "qoriq-i2c-0.dtsi"
+/include/ "qoriq-i2c-1.dtsi"
+/include/ "qoriq-duart-0.dtsi"
+/include/ "qoriq-duart-1.dtsi"
+/include/ "qoriq-gpio-0.dtsi"
+/include/ "qoriq-gpio-1.dtsi"
+/include/ "qoriq-gpio-2.dtsi"
+/include/ "qoriq-gpio-3.dtsi"
+/include/ "qoriq-usb2-mph-0.dtsi"
+	usb0: usb@210000 {
+		compatible = "fsl-usb2-mph-v2.4", "fsl-usb2-mph";
+		phy_type = "utmi";
+		port0;
+	};
+/include/ "qoriq-usb2-dr-0.dtsi"
+	usb1: usb@211000 {
+		compatible = "fsl-usb2-dr-v2.4", "fsl-usb2-dr";
+		dr_mode = "host";
+		phy_type = "utmi";
+	};
+/include/ "qoriq-sec5.2-0.dtsi"
+
+	L2_1: l2-cache-controller@c20000 {
+		/* Cluster 0 L2 cache */
+		compatible = "fsl,t208x-l2-cache-controller";
+		reg = <0xc20000 0x40000>;
+		next-level-cache = <&cpc>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi b/arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi
new file mode 100644
index 0000000..1e5d1a4
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi
@@ -0,0 +1,100 @@
+/*
+ * T2080/T2081 Silicon/SoC Device Tree Source (pre include)
+ *
+ * Copyright 2013 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.
+ */
+
+/dts-v1/;
+
+/include/ "e6500_power_isa.dtsi"
+
+/ {
+	#address-cells = <2>;
+	#size-cells = <2>;
+	interrupt-parent = <&mpic>;
+
+	aliases {
+		ccsr = &soc;
+		dcsr = &dcsr;
+
+		serial0 = &serial0;
+		serial1 = &serial1;
+		serial2 = &serial2;
+		serial3 = &serial3;
+
+		crypto = &crypto;
+		pci0 = &pci0;
+		pci1 = &pci1;
+		pci2 = &pci2;
+		pci3 = &pci3;
+		usb0 = &usb0;
+		usb1 = &usb1;
+		dma0 = &dma0;
+		dma1 = &dma1;
+		dma2 = &dma2;
+		sdhc = &sdhc;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/*
+		 * Temporarily add next-level-cache info in each cpu node so
+		 * that uboot can do L2 cache fixup. This can be removed once
+		 * u-boot can create cpu node with cache info.
+		 */
+		cpu0: PowerPC,e6500@0 {
+			device_type = "cpu";
+			reg = <0 1>;
+			clocks = <&mux0>;
+			next-level-cache = <&L2_1>;
+		};
+		cpu1: PowerPC,e6500@2 {
+			device_type = "cpu";
+			reg = <2 3>;
+			clocks = <&mux0>;
+			next-level-cache = <&L2_1>;
+		};
+		cpu2: PowerPC,e6500@4 {
+			device_type = "cpu";
+			reg = <4 5>;
+			clocks = <&mux0>;
+			next-level-cache = <&L2_1>;
+		};
+		cpu3: PowerPC,e6500@6 {
+			device_type = "cpu";
+			reg = <6 7>;
+			clocks = <&mux0>;
+			next-level-cache = <&L2_1>;
+		};
+	};
+};
diff --git a/arch/powerpc/include/asm/mpc85xx.h b/arch/powerpc/include/asm/mpc85xx.h
index 736d4ac..3bef74a 100644
--- a/arch/powerpc/include/asm/mpc85xx.h
+++ b/arch/powerpc/include/asm/mpc85xx.h
@@ -77,6 +77,8 @@
 #define SVR_T1020	0x852100
 #define SVR_T1021	0x852101
 #define SVR_T1022	0x852102
+#define SVR_T2080	0x853000
+#define SVR_T2081	0x853100
 
 #define SVR_8610	0x80A000
 #define SVR_8641	0x809000
-- 
1.8.0

^ permalink raw reply related

* [PATCH 4/4] powerpc/fsl-booke: Add initial T208x QDS board support
From: Shengzhou Liu @ 2013-12-25 10:06 UTC (permalink / raw)
  To: linuxppc-dev, scottwood; +Cc: Shengzhou Liu
In-Reply-To: <1387966018-10131-1-git-send-email-Shengzhou.Liu@freescale.com>

Add support for Freescale T2080/T2081 QDS Development System Board.
T2081QDS board shares the same PCB with T1040QDS with some differences.

The T2080QDS Development System is a high-performance computing,
evaluation, and development platform that supports T2080 QorIQ
Power Architecture processor, with following major features:

T2080QDS feature overview:
Processor:
 - T2080 SoC integrating four 64-bit dual-threads e6500 cores up to 1.8GHz
Memory:
 - Single memory controller capable of supporting DDR3 and DDR3-LV devices
 - Two DDR3 memory, 4GB, Dual rank @ 1866 Mbps data rate, and ECC support
Ethernet interfaces:
 - Two 1Gbps RGMII on-board ports
 - Four 10Gbps XFI on-board cages
 - 1Gbps/2.5Gbps SGMII Riser card
 - 10Gbps XAUI Riser card
Accelerator:
 - DPAA components consist of FMan, BMan, QMan, PME, DCE and SEC
SerDes:
 - 16 lanes up to 10.3125GHz
 - Supports Aurora debug, PEX, SATA, SGMII, sRIO, HiGig, XFI and XAUI
IFC:
 - 128MB NOR Flash, 512MB NAND Flash, PromJet debug port and FPGA
eSPI:
 - Three SPI flash (16MB N25Q128A + 16MB EN25S64 + 512KB SST25WF040)
USB:
 - Two USB2.0 ports with internal PHY (one Type-A + one micro Type-AB)
PCIE:
 - Four PCI Express controllers (two PCIe 2.0 and two PCIe 3.0 with SR-IOV)
SATA:
 - Two SATA 2.0 ports on-board
SRIO:
 - Two Serial RapidIO 2.0 ports up to 5 GHz
eSDHC:
 - Supports SD/MMC/eMMC Card
DMA:
 - Three 8-channels DMA controllers
I2C:
 - Four I2C controllers.
UART:
 - Dual 4-pins UART serial ports
System Logic:
 - QIXIS-II FPGA system controll

Differences between T2080 and T2081:
  Feature               T2080 T2081
  1G Ethernet numbers:  8     6
  10G Ethernet numbers: 4     2
  SerDes lanes:         16    8
  Serial RapidIO,RMan:  2     no
  SATA Controller:      2     no
  Aurora:               yes   no
  SoC Package:          896-pins 780-pins

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 arch/powerpc/boot/dts/t2080qds.dts            |  57 +++++++
 arch/powerpc/boot/dts/t2081qds.dts            |  46 ++++++
 arch/powerpc/boot/dts/t208xqds.dtsi           | 213 ++++++++++++++++++++++++++
 arch/powerpc/platforms/85xx/Kconfig           |   2 +-
 arch/powerpc/platforms/85xx/corenet_generic.c |   4 +
 5 files changed, 321 insertions(+), 1 deletion(-)
 create mode 100644 arch/powerpc/boot/dts/t2080qds.dts
 create mode 100644 arch/powerpc/boot/dts/t2081qds.dts
 create mode 100644 arch/powerpc/boot/dts/t208xqds.dtsi

diff --git a/arch/powerpc/boot/dts/t2080qds.dts b/arch/powerpc/boot/dts/t2080qds.dts
new file mode 100644
index 0000000..aa1d6d8
--- /dev/null
+++ b/arch/powerpc/boot/dts/t2080qds.dts
@@ -0,0 +1,57 @@
+/*
+ * T2080QDS Device Tree Source
+ *
+ * Copyright 2013 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.
+ */
+
+/include/ "fsl/t208xsi-pre.dtsi"
+/include/ "t208xqds.dtsi"
+
+/ {
+	model = "fsl,T2080QDS";
+	compatible = "fsl,T2080QDS";
+	#address-cells = <2>;
+	#size-cells = <2>;
+	interrupt-parent = <&mpic>;
+
+	rio: rapidio@ffe0c0000 {
+		reg = <0xf 0xfe0c0000 0 0x11000>;
+
+		port1 {
+			ranges = <0 0 0xc 0x20000000 0 0x10000000>;
+		};
+		port2 {
+			ranges = <0 0 0xc 0x30000000 0 0x10000000>;
+		};
+	};
+};
+
+/include/ "fsl/t2080si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/t2081qds.dts b/arch/powerpc/boot/dts/t2081qds.dts
new file mode 100644
index 0000000..8ec80a7
--- /dev/null
+++ b/arch/powerpc/boot/dts/t2081qds.dts
@@ -0,0 +1,46 @@
+/*
+ * T2081QDS Device Tree Source
+ *
+ * Copyright 2013 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.
+ */
+
+/include/ "fsl/t208xsi-pre.dtsi"
+/include/ "t208xqds.dtsi"
+
+/ {
+	model = "fsl,T2081QDS";
+	compatible = "fsl,T2081QDS";
+	#address-cells = <2>;
+	#size-cells = <2>;
+	interrupt-parent = <&mpic>;
+};
+
+/include/ "fsl/t2081si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/t208xqds.dtsi b/arch/powerpc/boot/dts/t208xqds.dtsi
new file mode 100644
index 0000000..54e2a1e
--- /dev/null
+++ b/arch/powerpc/boot/dts/t208xqds.dtsi
@@ -0,0 +1,213 @@
+/*
+ * T2080/T2081 QDS Device Tree Source
+ *
+ * Copyright 2013 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.
+ */
+
+/ {
+	model = "fsl,T2080QDS";
+	compatible = "fsl,T2080QDS";
+	#address-cells = <2>;
+	#size-cells = <2>;
+	interrupt-parent = <&mpic>;
+
+	ifc: localbus@ffe124000 {
+		reg = <0xf 0xfe124000 0 0x2000>;
+		ranges = <0 0 0xf 0xe8000000 0x08000000
+			  2 0 0xf 0xff800000 0x00010000
+			  3 0 0xf 0xffdf0000 0x00008000>;
+
+		nor@0,0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "cfi-flash";
+			reg = <0x0 0x0 0x8000000>;
+			bank-width = <2>;
+			device-width = <1>;
+		};
+
+		nand@2,0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,ifc-nand";
+			reg = <0x2 0x0 0x10000>;
+		};
+
+		boardctrl: board-control@3,0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,fpga-qixis";
+			reg = <3 0 0x300>;
+			ranges = <0 3 0 0x300>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+	};
+
+	dcsr: dcsr@f00000000 {
+		ranges = <0x00000000 0xf 0x00000000 0x01072000>;
+	};
+
+	soc: soc@ffe000000 {
+		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
+		reg = <0xf 0xfe000000 0 0x00001000>;
+		spi@110000 {
+			flash@0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "spansion,s25sl12801";
+				reg = <0>;
+				spi-max-frequency = <40000000>; /* input clock */
+			};
+
+			flash@1 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "sst,sst25wf040";
+				reg = <1>;
+				spi-max-frequency = <40000000>; /* input clock */
+			};
+		};
+
+		i2c@118000 {
+			pca9547@77 {
+				compatible = "nxp,pca9547";
+				reg = <0x77>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				i2c@0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x0>;
+
+					eeprom@50 {
+						compatible = "at24,24c256";
+						reg = <0x50>;
+					};
+
+					eeprom@51 {
+						compatible = "at24,24c02";
+						reg = <0x51>;
+					};
+
+					eeprom@57 {
+						compatible = "at24,24c02";
+						reg = <0x57>;
+					};
+
+					rtc@68 {
+						compatible = "dallas,ds3232";
+						reg = <0x68>;
+						interrupts = <0x1 0x1 0 0>;
+					};
+				};
+
+				i2c@1 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x1>;
+
+					eeprom@55 {
+						compatible = "at24,24c02";
+						reg = <0x55>;
+					};
+				};
+			};
+		};
+
+		sdhc@114000 {
+			voltage-ranges = <1800 1800 3300 3300>;
+		};
+	};
+
+	pci0: pcie@ffe240000 {
+		reg = <0xf 0xfe240000 0 0x10000>;
+		ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000
+			  0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>;
+		pcie@0 {
+			ranges = <0x02000000 0 0xe0000000
+				  0x02000000 0 0xe0000000
+				  0 0x20000000
+
+				  0x01000000 0 0x00000000
+				  0x01000000 0 0x00000000
+				  0 0x00010000>;
+		};
+	};
+
+	pci1: pcie@ffe250000 {
+		reg = <0xf 0xfe250000 0 0x10000>;
+		ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x10000000
+			  0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>;
+		pcie@0 {
+			ranges = <0x02000000 0 0xe0000000
+				  0x02000000 0 0xe0000000
+				  0 0x20000000
+
+				  0x01000000 0 0x00000000
+				  0x01000000 0 0x00000000
+				  0 0x00010000>;
+		};
+	};
+
+	pci2: pcie@ffe260000 {
+		reg = <0xf 0xfe260000 0 0x1000>;
+		ranges = <0x02000000 0 0xe0000000 0xc 0x30000000 0 0x10000000
+			  0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>;
+		pcie@0 {
+			ranges = <0x02000000 0 0xe0000000
+				  0x02000000 0 0xe0000000
+				  0 0x20000000
+
+				  0x01000000 0 0x00000000
+				  0x01000000 0 0x00000000
+				  0 0x00010000>;
+		};
+	};
+
+	pci3: pcie@ffe270000 {
+		reg = <0xf 0xfe270000 0 0x10000>;
+		ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x10000000
+			  0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>;
+		pcie@0 {
+			ranges = <0x02000000 0 0xe0000000
+				  0x02000000 0 0xe0000000
+				  0 0x20000000
+
+				  0x01000000 0 0x00000000
+				  0x01000000 0 0x00000000
+				  0 0x00010000>;
+		};
+	};
+};
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 4d46349..e3578b7 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -259,7 +259,7 @@ config CORENET_GENERIC
 	  For 32bit kernel, the following boards are supported:
 	    P2041 RDB, P3041 DS and P4080 DS
 	  For 64bit kernel, the following boards are supported:
-	    T4240 QDS and B4 QDS
+	    T208x QDS, T4240 QDS and B4 QDS
 	  The following boards are supported for both 32bit and 64bit kernel:
 	    P5020 DS and P5040 DS
 
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
index fbd871e..77fd71f 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -102,6 +102,8 @@ static const char * const boards[] __initconst = {
 	"fsl,P4080DS",
 	"fsl,P5020DS",
 	"fsl,P5040DS",
+	"fsl,T2080QDS",
+	"fsl,T2081QDS",
 	"fsl,T4240QDS",
 	"fsl,B4860QDS",
 	"fsl,B4420QDS",
@@ -115,6 +117,8 @@ static const char * const hv_boards[] __initconst = {
 	"fsl,P4080DS-hv",
 	"fsl,P5020DS-hv",
 	"fsl,P5040DS-hv",
+	"fsl,T2080QDS-hv",
+	"fsl,T2081QDS-hv"
 	"fsl,T4240QDS-hv",
 	"fsl,B4860QDS-hv",
 	"fsl,B4420QDS-hv",
-- 
1.8.0

^ permalink raw reply related

* [PATCH] powerpc/powernv: Remove unnecessary assignment
From: Gavin Shan @ 2013-12-26  1:29 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gavin Shan

We don't have IO ports on PHB3 and the assignment of variable
"iomap_off" on PHB3 is meaningless. The patch just removes the
unnecessary assignment to the variable. The code change should
have been part of commit c35d2a8c ("powerpc/powernv: Needn't IO
segment map for PHB3").

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index aea45fa..703cac9 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1144,7 +1144,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
 {
 	struct pci_controller *hose;
 	struct pnv_phb *phb;
-	unsigned long size, m32map_off, iomap_off, pemap_off;
+	unsigned long size, m32map_off, pemap_off, iomap_off = 0;
 	const __be64 *prop64;
 	const __be32 *prop32;
 	int len;
@@ -1236,7 +1236,6 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
 	size = _ALIGN_UP(phb->ioda.total_pe / 8, sizeof(unsigned long));
 	m32map_off = size;
 	size += phb->ioda.total_pe * sizeof(phb->ioda.m32_segmap[0]);
-	iomap_off = size;
 	if (phb->type == PNV_PHB_IODA1) {
 		iomap_off = size;
 		size += phb->ioda.total_pe * sizeof(phb->ioda.io_segmap[0]);
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH] ASoC: fsl_sai: Fix one bug for hardware limitation.
From: Xiubo Li @ 2013-12-26  2:57 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, lgirdwood, tiwai, linux-kernel, timur, perex,
	shawn.guo, linuxppc-dev, b47053

This is maybe one bug or a limitation of the hardware that the {T,R}CR2's
Synchronous Mode bits must be set as late as possible, or the SAI device
maybe hanged up, and there has not any explaination about this limitation
in the SAI Data Sheet.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/fsl/fsl_sai.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index af80246..59228a10 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -62,6 +62,7 @@ static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai,
 		reg_cr2 = FSL_SAI_RCR2;
 
 	val_cr2 = sai_readl(sai, sai->base + reg_cr2);
+
 	switch (clk_id) {
 	case FSL_SAI_CLK_BUS:
 		val_cr2 &= ~FSL_SAI_CR2_MSEL_MASK;
@@ -82,6 +83,7 @@ static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai,
 	default:
 		return -EINVAL;
 	}
+
 	sai_writel(sai, val_cr2, sai->base + reg_cr2);
 
 	return 0;
@@ -138,14 +140,13 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
 	val_cr4 = sai_readl(sai, sai->base + reg_cr4);
 
 	if (sai->big_endian_data)
-		val_cr4 |= FSL_SAI_CR4_MF;
-	else
 		val_cr4 &= ~FSL_SAI_CR4_MF;
+	else
+		val_cr4 |= FSL_SAI_CR4_MF;
 
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_I2S:
 		val_cr4 |= FSL_SAI_CR4_FSE;
-		val_cr4 |= FSL_SAI_CR4_FSP;
 		break;
 	default:
 		return -EINVAL;
@@ -185,9 +186,6 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
 		return -EINVAL;
 	}
 
-	if (fsl_dir == FSL_FMT_RECEIVER)
-		val_cr2 |= FSL_SAI_CR2_SYNC;
-
 	sai_writel(sai, val_cr2, sai->base + reg_cr2);
 	sai_writel(sai, val_cr4, sai->base + reg_cr4);
 
@@ -253,10 +251,11 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
 	val_cr5 |= FSL_SAI_CR5_WNW(word_width);
 	val_cr5 |= FSL_SAI_CR5_W0W(word_width);
 
+	val_cr5 &= ~FSL_SAI_CR5_FBT_MASK;
 	if (sai->big_endian_data)
-		val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1);
-	else
 		val_cr5 |= FSL_SAI_CR5_FBT(0);
+	else
+		val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1);
 
 	val_cr4 |= FSL_SAI_CR4_FRSZ(channels);
 	val_mr = ~0UL - ((1 << channels) - 1);
@@ -327,8 +326,22 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
 		struct snd_soc_dai *cpu_dai)
 {
 	struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
+	u32 val_cr2;
+	int ret;
+
+	ret = clk_prepare_enable(sai->clk);
+	if (ret)
+		return ret;
+
+	val_cr2 = sai_readl(sai, sai->base + FSL_SAI_TCR2);
+	val_cr2 &= ~FSL_SAI_CR2_SYNC;
+	sai_writel(sai, val_cr2, sai->base + FSL_SAI_TCR2);
 
-	return clk_prepare_enable(sai->clk);
+	val_cr2 = sai_readl(sai, sai->base + FSL_SAI_RCR2);
+	val_cr2 |= FSL_SAI_CR2_SYNC;
+	sai_writel(sai, val_cr2, sai->base + FSL_SAI_RCR2);
+
+	return 0;
 }
 
 static void fsl_sai_shutdown(struct snd_pcm_substream *substream,
-- 
1.8.4

^ permalink raw reply related

* MPC8641 based custom board kernel Bug
From: Ashish Khetan @ 2013-12-26  5:09 UTC (permalink / raw)
  To: kernelnewbies, linuxppc-dev; +Cc: scottwood

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

Hi,
I was trying to port Linux-3.12 for MPC8641 based custom designed board for
evaluation purpose. I have been facing a kernel bug at mpic initialization.
Is somebody have faced this kind of bugs or can give me any pointer for
further steps how to solve kernel bugs will be really helpful. here is the
snapshot for the bug that may be helpful to address the bug.
Using MPC86xx HPCN machine description
Total memory = 512MB; using 1024kB for hash table (at cff00000)
Linux version 3.12.0 (ashish@ashish-VirtualBox) (gcc version 4.7.2 (GCC) )
#2 We
d Dec 25 16:04:36 IST 2013
Found initrd at 0xde975000:0xdfec428a
bootconsole [udbg0] enabled
setup_arch: bootmem
mpc86xx_hpcn_setup_arch()
MPC86xx HPCN board from Freescale Semiconductor
arch: exit
Zone ranges:
  DMA      [mem 0x00000000-0x1fffffff]
  Normal   empty
  HighMem  empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x00000000-0x1fffffff]
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: root=/dev/ram0 rw rootfs console=ttyS0,115200
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Sorting __ex_table...
Memory: 424980K/524288K available (4172K kernel code, 208K rwdata, 1304K
rodata,
 196K init, 149K bss, 99308K reserved, 0K highmem)
Kernel virtual memory layout:
  * 0xfffcf000..0xfffff000  : fixmap
  * 0xff800000..0xffc00000  : highmem PTEs
  * 0xff7fe000..0xff800000  : early ioremap
  * 0xe1000000..0xff7fe000  : vmalloc & ioremap
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:512 nr_irqs:512 16
------------[ cut here ]------------
kernel BUG at arch/powerpc/platforms/86xx/pic.c:42!
Oops: Exception in kernel mode, sig: 5 [#1]
MPC86xx HPCN
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0 #2
task: c05903e0 ti: c05b4000 task.ti: c05b4000
NIP: c0567438 LR: c0567430 CTR: c0567400
REGS: c05b5ee0 TRAP: 0700   Not tainted  (3.12.0)
MSR: 00021032 <ME,IR,DR,RI>  CR: 24000042  XER: 20000000

GPR00: c0567430 c05b5f90 c05903e0 00000000 c04e4ff8 c051e588 0000008f
00000002
GPR08: c042789c 00000001 0000006f 00000000 22000048 bebffffd 11a7b4e5
200c8000
GPR16: ffbeffff ffffffff 00000000 00000024 00000000 1fec56f8 1fec59a7
00000000
GPR24: 00000000 1fff97e8 40000000 1ffcc6a0 c0bff080 c05c2490 c05c2628
c0585b60
NIP [c0567438] mpc86xx_init_irq+0x38/0x108
LR [c0567430] mpc86xx_init_irq+0x30/0x108
Call Trace:
[c05b5f90] [c0567430] mpc86xx_init_irq+0x30/0x108 (unreliable)
[c05b5fb0] [c0562784] init_IRQ+0x24/0x38
[c05b5fc0] [c055fde4] start_kernel+0x1bc/0x2ec
[c05b5ff0] [00003444] 0x3444
Instruction dump:
3d00c04f 38800000 38a01002 38c00000 38e00100 39088f8c 38600000 90010024
bfa10014 4bffec35 7c690034 5529d97e <0f090000> 3fa0c04f 4bfff391 38600000
---[ end trace 31fd0ba7d8756001 ]---

Kernel panic - not syncing: Attempted to kill the idle task!
Rebooting in 180 seconds..


Thanks & Regards
Ashish Khetan

[-- Attachment #2: Type: text/html, Size: 3321 bytes --]

^ permalink raw reply

* Re: MPC8641 based custom board kernel Bug
From: wyang @ 2013-12-26  9:07 UTC (permalink / raw)
  To: Ashish Khetan, kernelnewbies, linuxppc-dev; +Cc: scottwood
In-Reply-To: <CAERE9PrGaOJS3YTBv61=JCEGyPxGnqr_8j=eKrnn7Y9vi8dMug@mail.gmail.com>

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

On 12/26/2013 01:09 PM, Ashish Khetan wrote:
> Hi,
> I was trying to port Linux-3.12 for MPC8641 based custom designed 
> board for evaluation purpose. I have been facing a kernel bug at mpic 
> initialization. Is somebody have faced this kind of bugs or can give 
> me any pointer for further steps how to solve kernel bugs will be 
> really helpful. here is the snapshot for the bug that may be helpful 
> to address the bug.
> Using MPC86xx HPCN machine description
> Total memory = 512MB; using 1024kB for hash table (at cff00000)
> Linux version 3.12.0 (ashish@ashish-VirtualBox) (gcc version 4.7.2 
> (GCC) ) #2 We
> d Dec 25 16:04:36 IST 2013
> Found initrd at 0xde975000:0xdfec428a
> bootconsole [udbg0] enabled
> setup_arch: bootmem
> mpc86xx_hpcn_setup_arch()
> MPC86xx HPCN board from Freescale Semiconductor
> arch: exit
> Zone ranges:
>   DMA      [mem 0x00000000-0x1fffffff]
>   Normal   empty
>   HighMem  empty
> Movable zone start for each node
> Early memory node ranges
>   node   0: [mem 0x00000000-0x1fffffff]
> Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
> Kernel command line: root=/dev/ram0 rw rootfs console=ttyS0,115200
> PID hash table entries: 2048 (order: 1, 8192 bytes)
> Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
> Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
> Sorting __ex_table...
> Memory: 424980K/524288K available (4172K kernel code, 208K rwdata, 
> 1304K rodata,
>  196K init, 149K bss, 99308K reserved, 0K highmem)
> Kernel virtual memory layout:
>   * 0xfffcf000..0xfffff000  : fixmap
>   * 0xff800000..0xffc00000  : highmem PTEs
>   * 0xff7fe000..0xff800000  : early ioremap
>   * 0xe1000000..0xff7fe000  : vmalloc & ioremap
> SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
> NR_IRQS:512 nr_irqs:512 16
> ------------[ cut here ]------------
> kernel BUG at arch/powerpc/platforms/86xx/pic.c:42!

It hints that mpic_alloc() fails. Maybe, you should spend some time 
investigating why it fails.:-)

Thanks
Wei
> Oops: Exception in kernel mode, sig: 5 [#1]
> MPC86xx HPCN
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0 #2
> task: c05903e0 ti: c05b4000 task.ti: c05b4000
> NIP: c0567438 LR: c0567430 CTR: c0567400
> REGS: c05b5ee0 TRAP: 0700   Not tainted  (3.12.0)
> MSR: 00021032 <ME,IR,DR,RI>  CR: 24000042  XER: 20000000
>
> GPR00: c0567430 c05b5f90 c05903e0 00000000 c04e4ff8 c051e588 0000008f 
> 00000002
> GPR08: c042789c 00000001 0000006f 00000000 22000048 bebffffd 11a7b4e5 
> 200c8000
> GPR16: ffbeffff ffffffff 00000000 00000024 00000000 1fec56f8 1fec59a7 
> 00000000
> GPR24: 00000000 1fff97e8 40000000 1ffcc6a0 c0bff080 c05c2490 c05c2628 
> c0585b60
> NIP [c0567438] mpc86xx_init_irq+0x38/0x108
> LR [c0567430] mpc86xx_init_irq+0x30/0x108
> Call Trace:
> [c05b5f90] [c0567430] mpc86xx_init_irq+0x30/0x108 (unreliable)
> [c05b5fb0] [c0562784] init_IRQ+0x24/0x38
> [c05b5fc0] [c055fde4] start_kernel+0x1bc/0x2ec
> [c05b5ff0] [00003444] 0x3444
> Instruction dump:
> 3d00c04f 38800000 38a01002 38c00000 38e00100 39088f8c 38600000 90010024
> bfa10014 4bffec35 7c690034 5529d97e <0f090000> 3fa0c04f 4bfff391 38600000
> ---[ end trace 31fd0ba7d8756001 ]---
>
> Kernel panic - not syncing: Attempted to kill the idle task!
> Rebooting in 180 seconds..
>
>
> Thanks & Regards
> Ashish Khetan
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev


[-- Attachment #2: Type: text/html, Size: 5970 bytes --]

^ permalink raw reply

* [PATCH v3.5 01/19] net: freescale: remove unused compare_addr()
From: Ding Tianhong @ 2013-12-26 11:40 UTC (permalink / raw)
  To: Li Yang, Netdev, linuxppc-dev, linux-kernel@vger.kernel.org

The function did not be used any more, so remove it.

Cc: Li Yang <leoli@freescale.com>
Cc: netdev@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/ethernet/freescale/ucc_geth.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 5548b6d..72291a8 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -435,11 +435,6 @@ static void hw_add_addr_in_hash(struct ucc_geth_private *ugeth,
 		     QE_CR_PROTOCOL_ETHERNET, 0);
 }
 
-static inline int compare_addr(u8 **addr1, u8 **addr2)
-{
-	return memcmp(addr1, addr2, ETH_ALEN);
-}
-
 #ifdef DEBUG
 static void get_statistics(struct ucc_geth_private *ugeth,
 			   struct ucc_geth_tx_firmware_statistics *
-- 
1.8.0

^ permalink raw reply related

* Re: MPC8641 based custom board kernel Bug
From: Ashish Khetan @ 2013-12-26 11:48 UTC (permalink / raw)
  To: wyang; +Cc: scottwood, linuxppc-dev, kernelnewbies
In-Reply-To: <52BBF1CB.3070006@gmail.com>

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

i tried to dig more inside mpic_alloc fails. the function
of_find_matching_node calls inside from mpic_alloc() should return the node
at which pic is connected but it returns NULL. but why? In device tree i am
using the following.. may be it will helpful.
/dts-v1/;

/ {
    model = "MPC8641HPCN";
    compatible = "fsl,mpc8641hpcn";
    #address-cells = <0x1>;
    #size-cells = <0x1>;

    aliases {
        ethernet0 = "/soc8641@f8000000/ethernet@24000";
        ethernet1 = "/soc8641@f8000000/ethernet@25000";
        ethernet2 = "/soc8641@f8000000/ethernet@26000";
        ethernet3 = "/soc8641@f8000000/ethernet@27000";
        serial0 = "/soc8641@f8000000/serial@4500";
    };

    cpus {
        #address-cells = <0x1>;
        #size-cells = <0x0>;

        PowerPC,8641@0 {
            device_type = "cpu";
            reg = <0x0>;
            d-cache-line-size = <0x20>;
            i-cache-line-size = <0x20>;
            d-cache-size = <0x8000>;
            i-cache-size = <0x8000>;
            timebase-frequency = <0x0>;
            bus-frequency = <0x0>;
            clock-frequency = <0x0>;
        };
    };

    memory {
        device_type = "memory";
        reg = <0x0 0x20000000>;
    };

    localbus@f8005000 {
        #address-cells = <0x2>;
        #size-cells = <0x1>;
        compatible = "fsl,mpc8641-localbus", "simple-bus";
        reg = <0xf8005000 0x1000>;
        interrupts = <0x13 0x2>;
        interrupt-parent = <0x1>;
        ranges = <0x0 0x0 0xff000000 0x1000000>;

        flash@0,0 {
            compatible = "cfi-flash";
            reg = <0x0 0x0 0x800000>;
            bank-width = <0x2>;
            device-width = <0x2>;
            #address-cells = <0x1>;
            #size-cells = <0x1>;
        };
    };

    soc8641@f8000000 {
        #address-cells = <0x1>;
        #size-cells = <0x1>;
        device_type = "soc";
        compatible = "simple-bus";
        ranges = <0x0 0xf8000000 0x100000>;
        bus-frequency = <0x0>;

        mcm-law@0 {
            compatible = "fsl,mcm-law";
            reg = <0x0 0x1000>;
            fsl,num-laws = <0xa>;
        };

        mcm@1000 {
            compatible = "fsl,mpc8641-mcm", "fsl,mcm";
            reg = <0x1000 0x1000>;
            interrupts = <0x11 0x2>;
            interrupt-parent = <0x1>;
        };

        dma@21300 {
            #address-cells = <0x1>;
            #size-cells = <0x1>;
            compatible = "fsl,mpc8641-dma", "fsl,eloplus-dma";
            reg = <0x21300 0x4>;
            ranges = <0x0 0x21100 0x200>;
            cell-index = <0x0>;

            dma-channel@0 {
                compatible = "fsl,mpc8641-dma-channel",
"fsl,eloplus-dma-channel";
                reg = <0x0 0x80>;
                cell-index = <0x0>;
                interrupt-parent = <0x1>;
                interrupts = <0x14 0x2>;
            };

            dma-channel@80 {
                compatible = "fsl,mpc8641-dma-channel",
"fsl,eloplus-dma-channel";
                reg = <0x80 0x80>;
                cell-index = <0x1>;
                interrupt-parent = <0x1>;
                interrupts = <0x15 0x2>;
            };

            dma-channel@100 {
                compatible = "fsl,mpc8641-dma-channel",
"fsl,eloplus-dma-channel";
                reg = <0x100 0x80>;
                cell-index = <0x2>;
                interrupt-parent = <0x1>;
                interrupts = <0x16 0x2>;
            };

            dma-channel@180 {
                compatible = "fsl,mpc8641-dma-channel",
"fsl,eloplus-dma-channel";
                reg = <0x180 0x80>;
                cell-index = <0x3>;
                interrupt-parent = <0x1>;
                interrupts = <0x17 0x2>;
            };
        };

        ethernet@24000 {
            #address-cells = <0x1>;
            #size-cells = <0x1>;
            cell-index = <0x0>;
            device_type = "network";
            model = "TSEC";
            compatible = "gianfar";
            reg = <0x24000 0x1000>;
            ranges = <0x0 0x24000 0x1000>;
            local-mac-address = [00 00 00 00 00 00];
            interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
            interrupt-parent = <0x1>;
            tbi-handle = <0x2>;
            phy-handle = <0x3>;
            phy-connection-type = "rgmii-id";

            mdio@520 {
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                compatible = "fsl,gianfar-mdio";
                reg = <0x520 0x20>;

                ethernet-phy@0 {
                    interrupt-parent = <0x1>;
                    interrupts = <0xa 0x1>;
                    reg = <0x0>;
                    device_type = "ethernet-phy";
                    linux,phandle = <0x3>;
                };

                ethernet-phy@1 {
                    interrupt-parent = <0x1>;
                    interrupts = <0xa 0x1>;
                    reg = <0x1>;
                    device_type = "ethernet-phy";
                    linux,phandle = <0x5>;
                };

                ethernet-phy@2 {
                    interrupt-parent = <0x1>;
                    interrupts = <0xa 0x1>;
                    reg = <0x2>;
                    device_type = "ethernet-phy";
                    linux,phandle = <0x7>;
                };

                ethernet-phy@3 {
                    interrupt-parent = <0x1>;
                    interrupts = <0xa 0x1>;
                    reg = <0x3>;
                    device_type = "ethernet-phy";
                    linux,phandle = <0x9>;
                };

                tbi-phy@11 {
                    reg = <0x11>;
                    device_type = "tbi-phy";
                    linux,phandle = <0x2>;
                };
            };
        };

        ethernet@25000 {
            #address-cells = <0x1>;
            #size-cells = <0x1>;
            cell-index = <0x1>;
            device_type = "network";
            model = "TSEC";
            compatible = "gianfar";
            reg = <0x25000 0x1000>;
            ranges = <0x0 0x25000 0x1000>;
            local-mac-address = [00 00 00 00 00 00];
            interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
            interrupt-parent = <0x1>;
            tbi-handle = <0x4>;
            phy-handle = <0x5>;
            phy-connection-type = "rgmii-id";

            mdio@520 {
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                compatible = "fsl,gianfar-tbi";
                reg = <0x520 0x20>;

                tbi-phy@11 {
                    reg = <0x11>;
                    device_type = "tbi-phy";
                    linux,phandle = <0x4>;
                };
            };
        };

        ethernet@26000 {
            #address-cells = <0x1>;
            #size-cells = <0x1>;
            cell-index = <0x2>;
            device_type = "network";
            model = "TSEC";
            compatible = "gianfar";
            reg = <0x26000 0x1000>;
            ranges = <0x0 0x26000 0x1000>;
            local-mac-address = [00 00 00 00 00 00];
            interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
            interrupt-parent = <0x1>;
            tbi-handle = <0x6>;
            phy-handle = <0x7>;
            phy-connection-type = "rgmii-id";

            mdio@520 {
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                compatible = "fsl,gianfar-tbi";
                reg = <0x520 0x20>;

                tbi-phy@11 {
                    reg = <0x11>;
                    device_type = "tbi-phy";
                    linux,phandle = <0x6>;
                };
            };
        };

        ethernet@27000 {
            #address-cells = <0x1>;
            #size-cells = <0x1>;
            cell-index = <0x3>;
            device_type = "network";
            model = "TSEC";
            compatible = "gianfar";
            reg = <0x27000 0x1000>;
            ranges = <0x0 0x27000 0x1000>;
            local-mac-address = [00 00 00 00 00 00];
            interrupts = <0x25 0x2 0x26 0x2 0x27 0x2>;
            interrupt-parent = <0x1>;
            tbi-handle = <0x8>;
            phy-handle = <0x9>;
            phy-connection-type = "rgmii-id";

            mdio@520 {
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                compatible = "fsl,gianfar-tbi";
                reg = <0x520 0x20>;

                tbi-phy@11 {
                    reg = <0x11>;
                    device_type = "tbi-phy";
                    linux,phandle = <0x8>;
                };
            };
        };

        serial@4500 {
            cell-index = <0x0>;
            device_type = "serial";
            compatible = "ns16550";
            reg = <0x4500 0x100>;
            clock-frequency = <0x0>;
            interrupts = <0x2a 0x2>;
            interrupt-parent = <0x1>;
        };

        pic@40000 {
            interrupt-controller;
            #address-cells = <0x0>;
            #interrupt-cells = <0x2>;
            reg = <0x40000 0x40000>;
            compatible = "chrp,open-pic";
            device_type = "open-pic";
            linux,phandle = <0x1>;
            phandle = <0x1>;
        };

        global-utilities@e0000 {
            compatible = "fsl,mpc8641-guts";
            reg = <0xe0000 0x1000>;
            fsl,has-rstcr;
        };
    };

    chosen {
        linux,stdout-path = "/soc8641/serial0: serial@4500";
    };
};




On Thu, Dec 26, 2013 at 2:37 PM, wyang <w90p710@gmail.com> wrote:

>  On 12/26/2013 01:09 PM, Ashish Khetan wrote:
>
>   Hi,
>  I was trying to port Linux-3.12 for MPC8641 based custom designed board
> for evaluation purpose. I have been facing a kernel bug at mpic
> initialization. Is somebody have faced this kind of bugs or can give me any
> pointer for further steps how to solve kernel bugs will be really helpful.
> here is the snapshot for the bug that may be helpful to address the bug.
> Using MPC86xx HPCN machine description
> Total memory = 512MB; using 1024kB for hash table (at cff00000)
> Linux version 3.12.0 (ashish@ashish-VirtualBox) (gcc version 4.7.2 (GCC)
> ) #2 We
> d Dec 25 16:04:36 IST 2013
> Found initrd at 0xde975000:0xdfec428a
> bootconsole [udbg0] enabled
> setup_arch: bootmem
> mpc86xx_hpcn_setup_arch()
> MPC86xx HPCN board from Freescale Semiconductor
> arch: exit
> Zone ranges:
>   DMA      [mem 0x00000000-0x1fffffff]
>   Normal   empty
>   HighMem  empty
> Movable zone start for each node
> Early memory node ranges
>   node   0: [mem 0x00000000-0x1fffffff]
> Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
> Kernel command line: root=/dev/ram0 rw rootfs console=ttyS0,115200
> PID hash table entries: 2048 (order: 1, 8192 bytes)
> Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
> Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
> Sorting __ex_table...
> Memory: 424980K/524288K available (4172K kernel code, 208K rwdata, 1304K
> rodata,
>  196K init, 149K bss, 99308K reserved, 0K highmem)
> Kernel virtual memory layout:
>   * 0xfffcf000..0xfffff000  : fixmap
>   * 0xff800000..0xffc00000  : highmem PTEs
>   * 0xff7fe000..0xff800000  : early ioremap
>   * 0xe1000000..0xff7fe000  : vmalloc & ioremap
> SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
> NR_IRQS:512 nr_irqs:512 16
> ------------[ cut here ]------------
> kernel BUG at arch/powerpc/platforms/86xx/pic.c:42!
>
>
> It hints that mpic_alloc() fails. Maybe, you should spend some time
> investigating why it fails. :-)
>
> Thanks
> Wei
>
>  Oops: Exception in kernel mode, sig: 5 [#1]
> MPC86xx HPCN
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0 #2
> task: c05903e0 ti: c05b4000 task.ti: c05b4000
> NIP: c0567438 LR: c0567430 CTR: c0567400
> REGS: c05b5ee0 TRAP: 0700   Not tainted  (3.12.0)
> MSR: 00021032 <ME,IR,DR,RI>  CR: 24000042  XER: 20000000
>
> GPR00: c0567430 c05b5f90 c05903e0 00000000 c04e4ff8 c051e588 0000008f
> 00000002
> GPR08: c042789c 00000001 0000006f 00000000 22000048 bebffffd 11a7b4e5
> 200c8000
> GPR16: ffbeffff ffffffff 00000000 00000024 00000000 1fec56f8 1fec59a7
> 00000000
> GPR24: 00000000 1fff97e8 40000000 1ffcc6a0 c0bff080 c05c2490 c05c2628
> c0585b60
> NIP [c0567438] mpc86xx_init_irq+0x38/0x108
> LR [c0567430] mpc86xx_init_irq+0x30/0x108
> Call Trace:
> [c05b5f90] [c0567430] mpc86xx_init_irq+0x30/0x108 (unreliable)
> [c05b5fb0] [c0562784] init_IRQ+0x24/0x38
> [c05b5fc0] [c055fde4] start_kernel+0x1bc/0x2ec
> [c05b5ff0] [00003444] 0x3444
> Instruction dump:
> 3d00c04f 38800000 38a01002 38c00000 38e00100 39088f8c 38600000 90010024
> bfa10014 4bffec35 7c690034 5529d97e <0f090000> 3fa0c04f 4bfff391 38600000
> ---[ end trace 31fd0ba7d8756001 ]---
>
> Kernel panic - not syncing: Attempted to kill the idle task!
> Rebooting in 180 seconds..
>
>
>  Thanks & Regards
>  Ashish Khetan
>
>
> _______________________________________________
> Linuxppc-dev mailing listLinuxppc-dev@lists.ozlabs.orghttps://lists.ozlabs.org/listinfo/linuxppc-dev
>
>
>

[-- Attachment #2: Type: text/html, Size: 17833 bytes --]

^ permalink raw reply

* Re: [PATCH RFC v6 4/5] dma: mpc512x: register for device tree channel lookup
From: Gerhard Sittig @ 2013-12-26 12:40 UTC (permalink / raw)
  To: Alexander Popov
  Cc: devicetree, Lars-Peter Clausen, Arnd Bergmann, Vinod Koul,
	dmaengine, Dan Williams, Anatolij Gustschin, linuxppc-dev
In-Reply-To: <1387886789-20249-5-git-send-email-a13xp0p0v88@gmail.com>

On Tue, Dec 24, 2013 at 16:06 +0400, Alexander Popov wrote:
> 
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dma/mpc512x-dma.txt
> @@ -0,0 +1,55 @@
> +* Freescale MPC512x DMA Controller
> +
> +[ ... ]
> +
> +DMA controller node properties:
> +
> +Required properties:
> +- compatible:		should be "fsl,mpc5121-dma"
> +- reg:			address and size of the DMA controller's register set
> +- interrupts:		interrupt spec for the DMA controller
> +
> +Optional properties:
> +- #dma-cells:		must be <1>, describes the number of integer cells
> +			needed to specify the 'dmas' property in client nodes,
> +			strongly recommended since common client helper code
> +			uses this property

Given how time has passed and that we learned something in the
meantime, I guess the device tree documentation would look
different today than what was written back then.

- I'd reference the generic interrupt bindings as well, so DTS
  authors need not guess what an interrupt spec looks like
- the #dma-cells would become less confusing is it referenced the
  generic DMA binding, and just say that the value is "the length
  of the DMA specifier" for this provider
- the property's being recommended should not get hidden in the
  description but should reflect in the group's caption
- the binding doc shold not reference implementation details of
  one specific user (common client helper code)


[ device tree binding doc policy? ]

That one Linux driver handles both MPC5121 and MPC8308 hardware
and implements the same binding in both cases should get
reflected in the documentation as well.  But I'm not certain
whether adding MPC8308 into an MPX5121 document is better than
duplicating MPC5121 information in another MPC8308 document.  But
it might be the lesser evil.

Are there opinions, established preferences?  Is an exhaustive
list of compatible strings good enough since text search will
match regardless of the document's filename in this case?

There must have been this situation before of a component being
used in one SoC and getting re-used in another SoC later, too.
What's the best document to "get inspired from", i.e. how to best
put this into binding document wording as well as filenames?

> +[ ... ]
> +Client node properties:
> +
> +Required properties:
> +- dmas:			list of DMA specifiers, consisting each of a handle
> +			for the DMA controller and integer cells to specify
> +			the channel used within the DMA controller
> +- dma-names:		list of identifier strings for the DMA specifiers,
> +			client device driver code uses these strings to
> +			have DMA channels looked up at the controller

This certainly is wrong (it was before, I just wasn't aware back
then).  The phandle is not part of the specifier.  And the
binding should not discuss what driver code does.  Since the DMA
controller implements the semantics of the common DMA binding,
it's unwise to duplicate the information here.


Let me see how I can improve this document.  Alex, it may be
useful to split the code update and the binding document into
separate patches.  The current status already mixes the code
extension and the binding update with the introduction of the
document which was missing in the first place.  That's why the
binding doc patch is that late in the series.  (Yes, my RFC
"template" was rather dirty, which is why I flagged it as "RFC"
in the first place.)

I guess that I may have to introduce a binding doc reflecting the
given current status, and update it later as new features become
available.

Or -- given that the hardware remains, all the knowledge is there
already, just the implementations' capabilities change -- I might
as well introduce a binding document including OF based DMA
lookup.


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office@denx.de

^ permalink raw reply

* Re: [PATCH RFC v6 4/5] dma: mpc512x: register for device tree channel lookup
From: Gerhard Sittig @ 2013-12-26 12:48 UTC (permalink / raw)
  To: Alexander Popov
  Cc: devicetree, Lars-Peter Clausen, Arnd Bergmann, Vinod Koul,
	dmaengine, Dan Williams, Anatolij Gustschin, linuxppc-dev
In-Reply-To: <1387886789-20249-5-git-send-email-a13xp0p0v88@gmail.com>

[ dropping devicetree, we're DMA specific here ]

On Tue, Dec 24, 2013 at 16:06 +0400, Alexander Popov wrote:
> 
> --- a/drivers/dma/mpc512x_dma.c
> +++ b/drivers/dma/mpc512x_dma.c
> [ ... ]
> @@ -950,6 +951,7 @@ static int mpc_dma_probe(struct platform_device *op)
>  	INIT_LIST_HEAD(&dma->channels);
>  	dma_cap_set(DMA_MEMCPY, dma->cap_mask);
>  	dma_cap_set(DMA_SLAVE, dma->cap_mask);
> +	dma_cap_set(DMA_PRIVATE, dma->cap_mask);
>  
>  	for (i = 0; i < dma->chancnt; i++) {
>  		mchan = &mdma->channels[i];

What are the implications of this?  Is a comment due?

I haven't found documentation about the DMA_PRIVATE flag, only
saw commit 59b5ec21446b9 "dmaengine: introduce
dma_request_channel and private channels".  Alex, unless I'm
missing something this one-line change is quite a change in
semantics, and has dramatic influence on the code's behaviour
(ignores the DMA controller when looking for channels that can do
mem-to-mem transfers).

Please reason about this change some more, and explain what it
does and why it's needed.  Consider the fact that this driver
handles both MPC5121 as well as MPC8308 hardware.


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office@denx.de

^ permalink raw reply

* Re: MPC8641 based custom board kernel Bug
From: Sri Ram Vemulpali @ 2013-12-26 22:51 UTC (permalink / raw)
  To: Ashish Khetan; +Cc: scottwood, linuxppc-dev, wyang, kernelnewbies
In-Reply-To: <CAERE9Prr_C31D96zuYbV0KQ7b_j8Te0A2DO8C+6YtetF0e6M_w@mail.gmail.com>

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

Why do not you use deconfig from linux kernel tree. Modify only base
address of CCSR (soc node) for child nodes of root in device tree.
arch/powerpc/boot/dts/mpc8641_hpcn.dts.

Sri


On Thu, Dec 26, 2013 at 3:48 AM, Ashish Khetan <curieux.khetan@gmail.com>wrote:

> i tried to dig more inside mpic_alloc fails. the function
> of_find_matching_node calls inside from mpic_alloc() should return the node
> at which pic is connected but it returns NULL. but why? In device tree i am
> using the following.. may be it will helpful.
> /dts-v1/;
>
> / {
>     model = "MPC8641HPCN";
>     compatible = "fsl,mpc8641hpcn";
>     #address-cells = <0x1>;
>     #size-cells = <0x1>;
>
>     aliases {
>         ethernet0 = "/soc8641@f8000000/ethernet@24000";
>         ethernet1 = "/soc8641@f8000000/ethernet@25000";
>         ethernet2 = "/soc8641@f8000000/ethernet@26000";
>         ethernet3 = "/soc8641@f8000000/ethernet@27000";
>         serial0 = "/soc8641@f8000000/serial@4500";
>     };
>
>     cpus {
>         #address-cells = <0x1>;
>         #size-cells = <0x0>;
>
>         PowerPC,8641@0 {
>             device_type = "cpu";
>             reg = <0x0>;
>             d-cache-line-size = <0x20>;
>             i-cache-line-size = <0x20>;
>             d-cache-size = <0x8000>;
>             i-cache-size = <0x8000>;
>             timebase-frequency = <0x0>;
>             bus-frequency = <0x0>;
>             clock-frequency = <0x0>;
>         };
>     };
>
>     memory {
>         device_type = "memory";
>         reg = <0x0 0x20000000>;
>     };
>
>     localbus@f8005000 {
>         #address-cells = <0x2>;
>         #size-cells = <0x1>;
>         compatible = "fsl,mpc8641-localbus", "simple-bus";
>         reg = <0xf8005000 0x1000>;
>         interrupts = <0x13 0x2>;
>         interrupt-parent = <0x1>;
>         ranges = <0x0 0x0 0xff000000 0x1000000>;
>
>         flash@0,0 {
>             compatible = "cfi-flash";
>             reg = <0x0 0x0 0x800000>;
>             bank-width = <0x2>;
>             device-width = <0x2>;
>             #address-cells = <0x1>;
>             #size-cells = <0x1>;
>         };
>     };
>
>     soc8641@f8000000 {
>         #address-cells = <0x1>;
>         #size-cells = <0x1>;
>         device_type = "soc";
>         compatible = "simple-bus";
>         ranges = <0x0 0xf8000000 0x100000>;
>         bus-frequency = <0x0>;
>
>         mcm-law@0 {
>             compatible = "fsl,mcm-law";
>             reg = <0x0 0x1000>;
>             fsl,num-laws = <0xa>;
>         };
>
>         mcm@1000 {
>             compatible = "fsl,mpc8641-mcm", "fsl,mcm";
>             reg = <0x1000 0x1000>;
>             interrupts = <0x11 0x2>;
>             interrupt-parent = <0x1>;
>         };
>
>         dma@21300 {
>             #address-cells = <0x1>;
>             #size-cells = <0x1>;
>             compatible = "fsl,mpc8641-dma", "fsl,eloplus-dma";
>             reg = <0x21300 0x4>;
>             ranges = <0x0 0x21100 0x200>;
>             cell-index = <0x0>;
>
>             dma-channel@0 {
>                 compatible = "fsl,mpc8641-dma-channel",
> "fsl,eloplus-dma-channel";
>                 reg = <0x0 0x80>;
>                 cell-index = <0x0>;
>                 interrupt-parent = <0x1>;
>                 interrupts = <0x14 0x2>;
>             };
>
>             dma-channel@80 {
>                 compatible = "fsl,mpc8641-dma-channel",
> "fsl,eloplus-dma-channel";
>                 reg = <0x80 0x80>;
>                 cell-index = <0x1>;
>                 interrupt-parent = <0x1>;
>                 interrupts = <0x15 0x2>;
>             };
>
>             dma-channel@100 {
>                 compatible = "fsl,mpc8641-dma-channel",
> "fsl,eloplus-dma-channel";
>                 reg = <0x100 0x80>;
>                 cell-index = <0x2>;
>                 interrupt-parent = <0x1>;
>                 interrupts = <0x16 0x2>;
>             };
>
>             dma-channel@180 {
>                 compatible = "fsl,mpc8641-dma-channel",
> "fsl,eloplus-dma-channel";
>                 reg = <0x180 0x80>;
>                 cell-index = <0x3>;
>                 interrupt-parent = <0x1>;
>                 interrupts = <0x17 0x2>;
>             };
>         };
>
>         ethernet@24000 {
>             #address-cells = <0x1>;
>             #size-cells = <0x1>;
>             cell-index = <0x0>;
>             device_type = "network";
>             model = "TSEC";
>             compatible = "gianfar";
>             reg = <0x24000 0x1000>;
>             ranges = <0x0 0x24000 0x1000>;
>             local-mac-address = [00 00 00 00 00 00];
>             interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
>             interrupt-parent = <0x1>;
>             tbi-handle = <0x2>;
>             phy-handle = <0x3>;
>             phy-connection-type = "rgmii-id";
>
>             mdio@520 {
>                 #address-cells = <0x1>;
>                 #size-cells = <0x0>;
>                 compatible = "fsl,gianfar-mdio";
>                 reg = <0x520 0x20>;
>
>                 ethernet-phy@0 {
>                     interrupt-parent = <0x1>;
>                     interrupts = <0xa 0x1>;
>                     reg = <0x0>;
>                     device_type = "ethernet-phy";
>                     linux,phandle = <0x3>;
>                 };
>
>                 ethernet-phy@1 {
>                     interrupt-parent = <0x1>;
>                     interrupts = <0xa 0x1>;
>                     reg = <0x1>;
>                     device_type = "ethernet-phy";
>                     linux,phandle = <0x5>;
>                 };
>
>                 ethernet-phy@2 {
>                     interrupt-parent = <0x1>;
>                     interrupts = <0xa 0x1>;
>                     reg = <0x2>;
>                     device_type = "ethernet-phy";
>                     linux,phandle = <0x7>;
>                 };
>
>                 ethernet-phy@3 {
>                     interrupt-parent = <0x1>;
>                     interrupts = <0xa 0x1>;
>                     reg = <0x3>;
>                     device_type = "ethernet-phy";
>                     linux,phandle = <0x9>;
>                 };
>
>                 tbi-phy@11 {
>                     reg = <0x11>;
>                     device_type = "tbi-phy";
>                     linux,phandle = <0x2>;
>                 };
>             };
>         };
>
>         ethernet@25000 {
>             #address-cells = <0x1>;
>             #size-cells = <0x1>;
>             cell-index = <0x1>;
>             device_type = "network";
>             model = "TSEC";
>             compatible = "gianfar";
>             reg = <0x25000 0x1000>;
>             ranges = <0x0 0x25000 0x1000>;
>             local-mac-address = [00 00 00 00 00 00];
>             interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
>             interrupt-parent = <0x1>;
>             tbi-handle = <0x4>;
>             phy-handle = <0x5>;
>             phy-connection-type = "rgmii-id";
>
>             mdio@520 {
>                 #address-cells = <0x1>;
>                 #size-cells = <0x0>;
>                 compatible = "fsl,gianfar-tbi";
>                 reg = <0x520 0x20>;
>
>                 tbi-phy@11 {
>                     reg = <0x11>;
>                     device_type = "tbi-phy";
>                     linux,phandle = <0x4>;
>                 };
>             };
>         };
>
>         ethernet@26000 {
>             #address-cells = <0x1>;
>             #size-cells = <0x1>;
>             cell-index = <0x2>;
>             device_type = "network";
>             model = "TSEC";
>             compatible = "gianfar";
>             reg = <0x26000 0x1000>;
>             ranges = <0x0 0x26000 0x1000>;
>             local-mac-address = [00 00 00 00 00 00];
>             interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
>             interrupt-parent = <0x1>;
>             tbi-handle = <0x6>;
>             phy-handle = <0x7>;
>             phy-connection-type = "rgmii-id";
>
>             mdio@520 {
>                 #address-cells = <0x1>;
>                 #size-cells = <0x0>;
>                 compatible = "fsl,gianfar-tbi";
>                 reg = <0x520 0x20>;
>
>                 tbi-phy@11 {
>                     reg = <0x11>;
>                     device_type = "tbi-phy";
>                     linux,phandle = <0x6>;
>                 };
>             };
>         };
>
>         ethernet@27000 {
>             #address-cells = <0x1>;
>             #size-cells = <0x1>;
>             cell-index = <0x3>;
>             device_type = "network";
>             model = "TSEC";
>             compatible = "gianfar";
>             reg = <0x27000 0x1000>;
>             ranges = <0x0 0x27000 0x1000>;
>             local-mac-address = [00 00 00 00 00 00];
>             interrupts = <0x25 0x2 0x26 0x2 0x27 0x2>;
>             interrupt-parent = <0x1>;
>             tbi-handle = <0x8>;
>             phy-handle = <0x9>;
>             phy-connection-type = "rgmii-id";
>
>             mdio@520 {
>                 #address-cells = <0x1>;
>                 #size-cells = <0x0>;
>                 compatible = "fsl,gianfar-tbi";
>                 reg = <0x520 0x20>;
>
>                 tbi-phy@11 {
>                     reg = <0x11>;
>                     device_type = "tbi-phy";
>                     linux,phandle = <0x8>;
>                 };
>             };
>         };
>
>         serial@4500 {
>             cell-index = <0x0>;
>             device_type = "serial";
>             compatible = "ns16550";
>             reg = <0x4500 0x100>;
>             clock-frequency = <0x0>;
>             interrupts = <0x2a 0x2>;
>             interrupt-parent = <0x1>;
>         };
>
>         pic@40000 {
>             interrupt-controller;
>             #address-cells = <0x0>;
>             #interrupt-cells = <0x2>;
>             reg = <0x40000 0x40000>;
>             compatible = "chrp,open-pic";
>             device_type = "open-pic";
>             linux,phandle = <0x1>;
>             phandle = <0x1>;
>         };
>
>         global-utilities@e0000 {
>             compatible = "fsl,mpc8641-guts";
>             reg = <0xe0000 0x1000>;
>             fsl,has-rstcr;
>         };
>     };
>
>     chosen {
>         linux,stdout-path = "/soc8641/serial0: serial@4500";
>     };
> };
>
>
>
>
> On Thu, Dec 26, 2013 at 2:37 PM, wyang <w90p710@gmail.com> wrote:
>
>>  On 12/26/2013 01:09 PM, Ashish Khetan wrote:
>>
>>   Hi,
>>  I was trying to port Linux-3.12 for MPC8641 based custom designed board
>> for evaluation purpose. I have been facing a kernel bug at mpic
>> initialization. Is somebody have faced this kind of bugs or can give me any
>> pointer for further steps how to solve kernel bugs will be really helpful.
>> here is the snapshot for the bug that may be helpful to address the bug.
>> Using MPC86xx HPCN machine description
>> Total memory = 512MB; using 1024kB for hash table (at cff00000)
>> Linux version 3.12.0 (ashish@ashish-VirtualBox) (gcc version 4.7.2 (GCC)
>> ) #2 We
>> d Dec 25 16:04:36 IST 2013
>> Found initrd at 0xde975000:0xdfec428a
>> bootconsole [udbg0] enabled
>> setup_arch: bootmem
>> mpc86xx_hpcn_setup_arch()
>> MPC86xx HPCN board from Freescale Semiconductor
>> arch: exit
>> Zone ranges:
>>   DMA      [mem 0x00000000-0x1fffffff]
>>   Normal   empty
>>   HighMem  empty
>> Movable zone start for each node
>> Early memory node ranges
>>   node   0: [mem 0x00000000-0x1fffffff]
>> Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
>> 130048
>> Kernel command line: root=/dev/ram0 rw rootfs console=ttyS0,115200
>> PID hash table entries: 2048 (order: 1, 8192 bytes)
>> Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
>> Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
>> Sorting __ex_table...
>> Memory: 424980K/524288K available (4172K kernel code, 208K rwdata, 1304K
>> rodata,
>>  196K init, 149K bss, 99308K reserved, 0K highmem)
>> Kernel virtual memory layout:
>>   * 0xfffcf000..0xfffff000  : fixmap
>>   * 0xff800000..0xffc00000  : highmem PTEs
>>   * 0xff7fe000..0xff800000  : early ioremap
>>   * 0xe1000000..0xff7fe000  : vmalloc & ioremap
>> SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
>> NR_IRQS:512 nr_irqs:512 16
>> ------------[ cut here ]------------
>> kernel BUG at arch/powerpc/platforms/86xx/pic.c:42!
>>
>>
>> It hints that mpic_alloc() fails. Maybe, you should spend some time
>> investigating why it fails. :-)
>>
>> Thanks
>> Wei
>>
>>  Oops: Exception in kernel mode, sig: 5 [#1]
>> MPC86xx HPCN
>> Modules linked in:
>> CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0 #2
>> task: c05903e0 ti: c05b4000 task.ti: c05b4000
>> NIP: c0567438 LR: c0567430 CTR: c0567400
>> REGS: c05b5ee0 TRAP: 0700   Not tainted  (3.12.0)
>> MSR: 00021032 <ME,IR,DR,RI>  CR: 24000042  XER: 20000000
>>
>> GPR00: c0567430 c05b5f90 c05903e0 00000000 c04e4ff8 c051e588 0000008f
>> 00000002
>> GPR08: c042789c 00000001 0000006f 00000000 22000048 bebffffd 11a7b4e5
>> 200c8000
>> GPR16: ffbeffff ffffffff 00000000 00000024 00000000 1fec56f8 1fec59a7
>> 00000000
>> GPR24: 00000000 1fff97e8 40000000 1ffcc6a0 c0bff080 c05c2490 c05c2628
>> c0585b60
>> NIP [c0567438] mpc86xx_init_irq+0x38/0x108
>> LR [c0567430] mpc86xx_init_irq+0x30/0x108
>> Call Trace:
>> [c05b5f90] [c0567430] mpc86xx_init_irq+0x30/0x108 (unreliable)
>> [c05b5fb0] [c0562784] init_IRQ+0x24/0x38
>> [c05b5fc0] [c055fde4] start_kernel+0x1bc/0x2ec
>> [c05b5ff0] [00003444] 0x3444
>> Instruction dump:
>> 3d00c04f 38800000 38a01002 38c00000 38e00100 39088f8c 38600000 90010024
>> bfa10014 4bffec35 7c690034 5529d97e <0f090000> 3fa0c04f 4bfff391 38600000
>> ---[ end trace 31fd0ba7d8756001 ]---
>>
>> Kernel panic - not syncing: Attempted to kill the idle task!
>> Rebooting in 180 seconds..
>>
>>
>>  Thanks & Regards
>>  Ashish Khetan
>>
>>
>> _______________________________________________
>> Linuxppc-dev mailing listLinuxppc-dev@lists.ozlabs.orghttps://lists.ozlabs.org/listinfo/linuxppc-dev
>>
>>
>>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


-- 
Regards,
Sri.

[-- Attachment #2: Type: text/html, Size: 18990 bytes --]

^ permalink raw reply

* Re: MPC8641 based custom board kernel Bug
From: Ashish Khetan @ 2013-12-27  5:20 UTC (permalink / raw)
  To: Sri Ram Vemulpali; +Cc: scottwood, linuxppc-dev, wyang, kernelnewbies
In-Reply-To: <CALyraeMiKQsoHV8AQ5SOz926z_YBD3LbFFNefMpRibYOt=Vo=Q@mail.gmail.com>

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

I am using the defconfig from linux kernel tree and for CCSR in u-boot its
F8000000 so the same i am using in device tree... so my question is - is it
unable to parse device tree ? or in device tree some thing need to modify
in device tree or in kernel source...
 please give some light on this...


Thanks & Regards
Ashish Khetan


On Fri, Dec 27, 2013 at 4:21 AM, Sri Ram Vemulpali
<sri.ram.gmu06@gmail.com>wrote:

> Why do not you use deconfig from linux kernel tree. Modify only base
> address of CCSR (soc node) for child nodes of root in device tree.
> arch/powerpc/boot/dts/mpc8641_hpcn.dts.
>
> Sri
>
>
> On Thu, Dec 26, 2013 at 3:48 AM, Ashish Khetan <curieux.khetan@gmail.com>wrote:
>
>> i tried to dig more inside mpic_alloc fails. the function
>> of_find_matching_node calls inside from mpic_alloc() should return the node
>> at which pic is connected but it returns NULL. but why? In device tree i am
>> using the following.. may be it will helpful.
>> /dts-v1/;
>>
>> / {
>>     model = "MPC8641HPCN";
>>     compatible = "fsl,mpc8641hpcn";
>>     #address-cells = <0x1>;
>>     #size-cells = <0x1>;
>>
>>     aliases {
>>         ethernet0 = "/soc8641@f8000000/ethernet@24000";
>>         ethernet1 = "/soc8641@f8000000/ethernet@25000";
>>         ethernet2 = "/soc8641@f8000000/ethernet@26000";
>>         ethernet3 = "/soc8641@f8000000/ethernet@27000";
>>         serial0 = "/soc8641@f8000000/serial@4500";
>>     };
>>
>>     cpus {
>>         #address-cells = <0x1>;
>>         #size-cells = <0x0>;
>>
>>         PowerPC,8641@0 {
>>             device_type = "cpu";
>>             reg = <0x0>;
>>             d-cache-line-size = <0x20>;
>>             i-cache-line-size = <0x20>;
>>             d-cache-size = <0x8000>;
>>             i-cache-size = <0x8000>;
>>             timebase-frequency = <0x0>;
>>             bus-frequency = <0x0>;
>>             clock-frequency = <0x0>;
>>         };
>>     };
>>
>>     memory {
>>         device_type = "memory";
>>         reg = <0x0 0x20000000>;
>>     };
>>
>>     localbus@f8005000 {
>>         #address-cells = <0x2>;
>>         #size-cells = <0x1>;
>>         compatible = "fsl,mpc8641-localbus", "simple-bus";
>>         reg = <0xf8005000 0x1000>;
>>         interrupts = <0x13 0x2>;
>>         interrupt-parent = <0x1>;
>>         ranges = <0x0 0x0 0xff000000 0x1000000>;
>>
>>         flash@0,0 {
>>             compatible = "cfi-flash";
>>             reg = <0x0 0x0 0x800000>;
>>             bank-width = <0x2>;
>>             device-width = <0x2>;
>>             #address-cells = <0x1>;
>>             #size-cells = <0x1>;
>>         };
>>     };
>>
>>     soc8641@f8000000 {
>>         #address-cells = <0x1>;
>>         #size-cells = <0x1>;
>>         device_type = "soc";
>>         compatible = "simple-bus";
>>         ranges = <0x0 0xf8000000 0x100000>;
>>         bus-frequency = <0x0>;
>>
>>         mcm-law@0 {
>>             compatible = "fsl,mcm-law";
>>             reg = <0x0 0x1000>;
>>             fsl,num-laws = <0xa>;
>>         };
>>
>>         mcm@1000 {
>>             compatible = "fsl,mpc8641-mcm", "fsl,mcm";
>>             reg = <0x1000 0x1000>;
>>             interrupts = <0x11 0x2>;
>>             interrupt-parent = <0x1>;
>>         };
>>
>>         dma@21300 {
>>             #address-cells = <0x1>;
>>             #size-cells = <0x1>;
>>             compatible = "fsl,mpc8641-dma", "fsl,eloplus-dma";
>>             reg = <0x21300 0x4>;
>>             ranges = <0x0 0x21100 0x200>;
>>             cell-index = <0x0>;
>>
>>             dma-channel@0 {
>>                 compatible = "fsl,mpc8641-dma-channel",
>> "fsl,eloplus-dma-channel";
>>                 reg = <0x0 0x80>;
>>                 cell-index = <0x0>;
>>                 interrupt-parent = <0x1>;
>>                 interrupts = <0x14 0x2>;
>>             };
>>
>>             dma-channel@80 {
>>                 compatible = "fsl,mpc8641-dma-channel",
>> "fsl,eloplus-dma-channel";
>>                 reg = <0x80 0x80>;
>>                 cell-index = <0x1>;
>>                 interrupt-parent = <0x1>;
>>                 interrupts = <0x15 0x2>;
>>             };
>>
>>             dma-channel@100 {
>>                 compatible = "fsl,mpc8641-dma-channel",
>> "fsl,eloplus-dma-channel";
>>                 reg = <0x100 0x80>;
>>                 cell-index = <0x2>;
>>                 interrupt-parent = <0x1>;
>>                 interrupts = <0x16 0x2>;
>>             };
>>
>>             dma-channel@180 {
>>                 compatible = "fsl,mpc8641-dma-channel",
>> "fsl,eloplus-dma-channel";
>>                 reg = <0x180 0x80>;
>>                 cell-index = <0x3>;
>>                 interrupt-parent = <0x1>;
>>                 interrupts = <0x17 0x2>;
>>             };
>>         };
>>
>>         ethernet@24000 {
>>             #address-cells = <0x1>;
>>             #size-cells = <0x1>;
>>             cell-index = <0x0>;
>>             device_type = "network";
>>             model = "TSEC";
>>             compatible = "gianfar";
>>             reg = <0x24000 0x1000>;
>>             ranges = <0x0 0x24000 0x1000>;
>>             local-mac-address = [00 00 00 00 00 00];
>>             interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
>>             interrupt-parent = <0x1>;
>>             tbi-handle = <0x2>;
>>             phy-handle = <0x3>;
>>             phy-connection-type = "rgmii-id";
>>
>>             mdio@520 {
>>                 #address-cells = <0x1>;
>>                 #size-cells = <0x0>;
>>                 compatible = "fsl,gianfar-mdio";
>>                 reg = <0x520 0x20>;
>>
>>                 ethernet-phy@0 {
>>                     interrupt-parent = <0x1>;
>>                     interrupts = <0xa 0x1>;
>>                     reg = <0x0>;
>>                     device_type = "ethernet-phy";
>>                     linux,phandle = <0x3>;
>>                 };
>>
>>                 ethernet-phy@1 {
>>                     interrupt-parent = <0x1>;
>>                     interrupts = <0xa 0x1>;
>>                     reg = <0x1>;
>>                     device_type = "ethernet-phy";
>>                     linux,phandle = <0x5>;
>>                 };
>>
>>                 ethernet-phy@2 {
>>                     interrupt-parent = <0x1>;
>>                     interrupts = <0xa 0x1>;
>>                     reg = <0x2>;
>>                     device_type = "ethernet-phy";
>>                     linux,phandle = <0x7>;
>>                 };
>>
>>                 ethernet-phy@3 {
>>                     interrupt-parent = <0x1>;
>>                     interrupts = <0xa 0x1>;
>>                     reg = <0x3>;
>>                     device_type = "ethernet-phy";
>>                     linux,phandle = <0x9>;
>>                 };
>>
>>                 tbi-phy@11 {
>>                     reg = <0x11>;
>>                     device_type = "tbi-phy";
>>                     linux,phandle = <0x2>;
>>                 };
>>             };
>>         };
>>
>>         ethernet@25000 {
>>             #address-cells = <0x1>;
>>             #size-cells = <0x1>;
>>             cell-index = <0x1>;
>>             device_type = "network";
>>             model = "TSEC";
>>             compatible = "gianfar";
>>             reg = <0x25000 0x1000>;
>>             ranges = <0x0 0x25000 0x1000>;
>>             local-mac-address = [00 00 00 00 00 00];
>>             interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
>>             interrupt-parent = <0x1>;
>>             tbi-handle = <0x4>;
>>             phy-handle = <0x5>;
>>             phy-connection-type = "rgmii-id";
>>
>>             mdio@520 {
>>                 #address-cells = <0x1>;
>>                 #size-cells = <0x0>;
>>                 compatible = "fsl,gianfar-tbi";
>>                 reg = <0x520 0x20>;
>>
>>                 tbi-phy@11 {
>>                     reg = <0x11>;
>>                     device_type = "tbi-phy";
>>                     linux,phandle = <0x4>;
>>                 };
>>             };
>>         };
>>
>>         ethernet@26000 {
>>             #address-cells = <0x1>;
>>             #size-cells = <0x1>;
>>             cell-index = <0x2>;
>>             device_type = "network";
>>             model = "TSEC";
>>             compatible = "gianfar";
>>             reg = <0x26000 0x1000>;
>>             ranges = <0x0 0x26000 0x1000>;
>>             local-mac-address = [00 00 00 00 00 00];
>>             interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
>>             interrupt-parent = <0x1>;
>>             tbi-handle = <0x6>;
>>             phy-handle = <0x7>;
>>             phy-connection-type = "rgmii-id";
>>
>>             mdio@520 {
>>                 #address-cells = <0x1>;
>>                 #size-cells = <0x0>;
>>                 compatible = "fsl,gianfar-tbi";
>>                 reg = <0x520 0x20>;
>>
>>                 tbi-phy@11 {
>>                     reg = <0x11>;
>>                     device_type = "tbi-phy";
>>                     linux,phandle = <0x6>;
>>                 };
>>             };
>>         };
>>
>>         ethernet@27000 {
>>             #address-cells = <0x1>;
>>             #size-cells = <0x1>;
>>             cell-index = <0x3>;
>>             device_type = "network";
>>             model = "TSEC";
>>             compatible = "gianfar";
>>             reg = <0x27000 0x1000>;
>>             ranges = <0x0 0x27000 0x1000>;
>>             local-mac-address = [00 00 00 00 00 00];
>>             interrupts = <0x25 0x2 0x26 0x2 0x27 0x2>;
>>             interrupt-parent = <0x1>;
>>             tbi-handle = <0x8>;
>>             phy-handle = <0x9>;
>>             phy-connection-type = "rgmii-id";
>>
>>             mdio@520 {
>>                 #address-cells = <0x1>;
>>                 #size-cells = <0x0>;
>>                 compatible = "fsl,gianfar-tbi";
>>                 reg = <0x520 0x20>;
>>
>>                 tbi-phy@11 {
>>                     reg = <0x11>;
>>                     device_type = "tbi-phy";
>>                     linux,phandle = <0x8>;
>>                 };
>>             };
>>         };
>>
>>         serial@4500 {
>>             cell-index = <0x0>;
>>             device_type = "serial";
>>             compatible = "ns16550";
>>             reg = <0x4500 0x100>;
>>             clock-frequency = <0x0>;
>>             interrupts = <0x2a 0x2>;
>>             interrupt-parent = <0x1>;
>>         };
>>
>>         pic@40000 {
>>             interrupt-controller;
>>             #address-cells = <0x0>;
>>             #interrupt-cells = <0x2>;
>>             reg = <0x40000 0x40000>;
>>             compatible = "chrp,open-pic";
>>             device_type = "open-pic";
>>             linux,phandle = <0x1>;
>>             phandle = <0x1>;
>>         };
>>
>>         global-utilities@e0000 {
>>             compatible = "fsl,mpc8641-guts";
>>             reg = <0xe0000 0x1000>;
>>             fsl,has-rstcr;
>>         };
>>     };
>>
>>     chosen {
>>         linux,stdout-path = "/soc8641/serial0: serial@4500";
>>     };
>> };
>>
>>
>>
>>
>> On Thu, Dec 26, 2013 at 2:37 PM, wyang <w90p710@gmail.com> wrote:
>>
>>>  On 12/26/2013 01:09 PM, Ashish Khetan wrote:
>>>
>>>   Hi,
>>>  I was trying to port Linux-3.12 for MPC8641 based custom designed board
>>> for evaluation purpose. I have been facing a kernel bug at mpic
>>> initialization. Is somebody have faced this kind of bugs or can give me any
>>> pointer for further steps how to solve kernel bugs will be really helpful.
>>> here is the snapshot for the bug that may be helpful to address the bug.
>>> Using MPC86xx HPCN machine description
>>> Total memory = 512MB; using 1024kB for hash table (at cff00000)
>>> Linux version 3.12.0 (ashish@ashish-VirtualBox) (gcc version 4.7.2
>>> (GCC) ) #2 We
>>> d Dec 25 16:04:36 IST 2013
>>> Found initrd at 0xde975000:0xdfec428a
>>> bootconsole [udbg0] enabled
>>> setup_arch: bootmem
>>> mpc86xx_hpcn_setup_arch()
>>> MPC86xx HPCN board from Freescale Semiconductor
>>> arch: exit
>>> Zone ranges:
>>>   DMA      [mem 0x00000000-0x1fffffff]
>>>   Normal   empty
>>>   HighMem  empty
>>> Movable zone start for each node
>>> Early memory node ranges
>>>   node   0: [mem 0x00000000-0x1fffffff]
>>> Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
>>> 130048
>>> Kernel command line: root=/dev/ram0 rw rootfs console=ttyS0,115200
>>> PID hash table entries: 2048 (order: 1, 8192 bytes)
>>> Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
>>> Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
>>> Sorting __ex_table...
>>> Memory: 424980K/524288K available (4172K kernel code, 208K rwdata, 1304K
>>> rodata,
>>>  196K init, 149K bss, 99308K reserved, 0K highmem)
>>> Kernel virtual memory layout:
>>>   * 0xfffcf000..0xfffff000  : fixmap
>>>   * 0xff800000..0xffc00000  : highmem PTEs
>>>   * 0xff7fe000..0xff800000  : early ioremap
>>>   * 0xe1000000..0xff7fe000  : vmalloc & ioremap
>>> SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
>>> NR_IRQS:512 nr_irqs:512 16
>>> ------------[ cut here ]------------
>>> kernel BUG at arch/powerpc/platforms/86xx/pic.c:42!
>>>
>>>
>>> It hints that mpic_alloc() fails. Maybe, you should spend some time
>>> investigating why it fails. :-)
>>>
>>> Thanks
>>> Wei
>>>
>>>  Oops: Exception in kernel mode, sig: 5 [#1]
>>> MPC86xx HPCN
>>> Modules linked in:
>>> CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0 #2
>>> task: c05903e0 ti: c05b4000 task.ti: c05b4000
>>> NIP: c0567438 LR: c0567430 CTR: c0567400
>>> REGS: c05b5ee0 TRAP: 0700   Not tainted  (3.12.0)
>>> MSR: 00021032 <ME,IR,DR,RI>  CR: 24000042  XER: 20000000
>>>
>>> GPR00: c0567430 c05b5f90 c05903e0 00000000 c04e4ff8 c051e588 0000008f
>>> 00000002
>>> GPR08: c042789c 00000001 0000006f 00000000 22000048 bebffffd 11a7b4e5
>>> 200c8000
>>> GPR16: ffbeffff ffffffff 00000000 00000024 00000000 1fec56f8 1fec59a7
>>> 00000000
>>> GPR24: 00000000 1fff97e8 40000000 1ffcc6a0 c0bff080 c05c2490 c05c2628
>>> c0585b60
>>> NIP [c0567438] mpc86xx_init_irq+0x38/0x108
>>> LR [c0567430] mpc86xx_init_irq+0x30/0x108
>>> Call Trace:
>>> [c05b5f90] [c0567430] mpc86xx_init_irq+0x30/0x108 (unreliable)
>>> [c05b5fb0] [c0562784] init_IRQ+0x24/0x38
>>> [c05b5fc0] [c055fde4] start_kernel+0x1bc/0x2ec
>>> [c05b5ff0] [00003444] 0x3444
>>> Instruction dump:
>>> 3d00c04f 38800000 38a01002 38c00000 38e00100 39088f8c 38600000 90010024
>>> bfa10014 4bffec35 7c690034 5529d97e <0f090000> 3fa0c04f 4bfff391 38600000
>>> ---[ end trace 31fd0ba7d8756001 ]---
>>>
>>> Kernel panic - not syncing: Attempted to kill the idle task!
>>> Rebooting in 180 seconds..
>>>
>>>
>>>  Thanks & Regards
>>>  Ashish Khetan
>>>
>>>
>>> _______________________________________________
>>> Linuxppc-dev mailing listLinuxppc-dev@lists.ozlabs.orghttps://lists.ozlabs.org/listinfo/linuxppc-dev
>>>
>>>
>>>
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
>
> --
> Regards,
> Sri.
>

[-- Attachment #2: Type: text/html, Size: 19988 bytes --]

^ permalink raw reply

* [PATCH] mtd: nand: remove pasemi_nand driver
From: Olof Johansson @ 2013-12-27  5:52 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris
  Cc: Olof Johansson, linuxppc-dev, linux-mtd, linux-kernel

The PA Semi platform is sparsely used these days (with just a handful
of known users out there). I'm 100% sure none of them use the MTD NAND
driver -- most standard use cases include PCI-e SATA controllers for
storage instead, and boot is done from LPC NOR flash.

So, there's little reason to keep carrying a driver that's not used by
anybody and that just gets hit by some tree-wide or tools-based changes
every now and then.

Signed-off-by: Olof Johansson <olof@lixom.net>
---
 drivers/mtd/nand/pasemi_nand.c |  238 ----------------------------------------
 1 file changed, 238 deletions(-)
 delete mode 100644 drivers/mtd/nand/pasemi_nand.c

diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
deleted file mode 100644
index 90f871a..0000000
--- a/drivers/mtd/nand/pasemi_nand.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (C) 2006-2007 PA Semi, Inc
- *
- * Author: Egor Martovetsky <egor@pasemi.com>
- * Maintained by: Olof Johansson <olof@lixom.net>
- *
- * Driver for the PWRficient onchip NAND flash interface
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
- */
-
-#undef DEBUG
-
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/nand_ecc.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/of_platform.h>
-#include <linux/platform_device.h>
-#include <linux/pci.h>
-
-#include <asm/io.h>
-
-#define LBICTRL_LPCCTL_NR		0x00004000
-#define CLE_PIN_CTL			15
-#define ALE_PIN_CTL			14
-
-static unsigned int lpcctl;
-static struct mtd_info *pasemi_nand_mtd;
-static const char driver_name[] = "pasemi-nand";
-
-static void pasemi_read_buf(struct mtd_info *mtd, u_char *buf, int len)
-{
-	struct nand_chip *chip = mtd->priv;
-
-	while (len > 0x800) {
-		memcpy_fromio(buf, chip->IO_ADDR_R, 0x800);
-		buf += 0x800;
-		len -= 0x800;
-	}
-	memcpy_fromio(buf, chip->IO_ADDR_R, len);
-}
-
-static void pasemi_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
-{
-	struct nand_chip *chip = mtd->priv;
-
-	while (len > 0x800) {
-		memcpy_toio(chip->IO_ADDR_R, buf, 0x800);
-		buf += 0x800;
-		len -= 0x800;
-	}
-	memcpy_toio(chip->IO_ADDR_R, buf, len);
-}
-
-static void pasemi_hwcontrol(struct mtd_info *mtd, int cmd,
-			     unsigned int ctrl)
-{
-	struct nand_chip *chip = mtd->priv;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	if (ctrl & NAND_CLE)
-		out_8(chip->IO_ADDR_W + (1 << CLE_PIN_CTL), cmd);
-	else
-		out_8(chip->IO_ADDR_W + (1 << ALE_PIN_CTL), cmd);
-
-	/* Push out posted writes */
-	eieio();
-	inl(lpcctl);
-}
-
-int pasemi_device_ready(struct mtd_info *mtd)
-{
-	return !!(inl(lpcctl) & LBICTRL_LPCCTL_NR);
-}
-
-static int pasemi_nand_probe(struct platform_device *ofdev)
-{
-	struct pci_dev *pdev;
-	struct device_node *np = ofdev->dev.of_node;
-	struct resource res;
-	struct nand_chip *chip;
-	int err = 0;
-
-	err = of_address_to_resource(np, 0, &res);
-
-	if (err)
-		return -EINVAL;
-
-	/* We only support one device at the moment */
-	if (pasemi_nand_mtd)
-		return -ENODEV;
-
-	pr_debug("pasemi_nand at %pR\n", &res);
-
-	/* Allocate memory for MTD device structure and private data */
-	pasemi_nand_mtd = kzalloc(sizeof(struct mtd_info) +
-				  sizeof(struct nand_chip), GFP_KERNEL);
-	if (!pasemi_nand_mtd) {
-		printk(KERN_WARNING
-		       "Unable to allocate PASEMI NAND MTD device structure\n");
-		err = -ENOMEM;
-		goto out;
-	}
-
-	/* Get pointer to private data */
-	chip = (struct nand_chip *)&pasemi_nand_mtd[1];
-
-	/* Link the private data with the MTD structure */
-	pasemi_nand_mtd->priv = chip;
-	pasemi_nand_mtd->owner = THIS_MODULE;
-
-	chip->IO_ADDR_R = of_iomap(np, 0);
-	chip->IO_ADDR_W = chip->IO_ADDR_R;
-
-	if (!chip->IO_ADDR_R) {
-		err = -EIO;
-		goto out_mtd;
-	}
-
-	pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa008, NULL);
-	if (!pdev) {
-		err = -ENODEV;
-		goto out_ior;
-	}
-
-	lpcctl = pci_resource_start(pdev, 0);
-	pci_dev_put(pdev);
-
-	if (!request_region(lpcctl, 4, driver_name)) {
-		err = -EBUSY;
-		goto out_ior;
-	}
-
-	chip->cmd_ctrl = pasemi_hwcontrol;
-	chip->dev_ready = pasemi_device_ready;
-	chip->read_buf = pasemi_read_buf;
-	chip->write_buf = pasemi_write_buf;
-	chip->chip_delay = 0;
-	chip->ecc.mode = NAND_ECC_SOFT;
-
-	/* Enable the following for a flash based bad block table */
-	chip->bbt_options = NAND_BBT_USE_FLASH;
-
-	/* Scan to find existence of the device */
-	if (nand_scan(pasemi_nand_mtd, 1)) {
-		err = -ENXIO;
-		goto out_lpc;
-	}
-
-	if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
-		printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
-		err = -ENODEV;
-		goto out_lpc;
-	}
-
-	printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n",
-	       res.start, lpcctl);
-
-	return 0;
-
- out_lpc:
-	release_region(lpcctl, 4);
- out_ior:
-	iounmap(chip->IO_ADDR_R);
- out_mtd:
-	kfree(pasemi_nand_mtd);
- out:
-	return err;
-}
-
-static int pasemi_nand_remove(struct platform_device *ofdev)
-{
-	struct nand_chip *chip;
-
-	if (!pasemi_nand_mtd)
-		return 0;
-
-	chip = pasemi_nand_mtd->priv;
-
-	/* Release resources, unregister device */
-	nand_release(pasemi_nand_mtd);
-
-	release_region(lpcctl, 4);
-
-	iounmap(chip->IO_ADDR_R);
-
-	/* Free the MTD device structure */
-	kfree(pasemi_nand_mtd);
-
-	pasemi_nand_mtd = NULL;
-
-	return 0;
-}
-
-static const struct of_device_id pasemi_nand_match[] =
-{
-	{
-		.compatible   = "pasemi,localbus-nand",
-	},
-	{},
-};
-
-MODULE_DEVICE_TABLE(of, pasemi_nand_match);
-
-static struct platform_driver pasemi_nand_driver =
-{
-	.driver = {
-		.name = driver_name,
-		.owner = THIS_MODULE,
-		.of_match_table = pasemi_nand_match,
-	},
-	.probe		= pasemi_nand_probe,
-	.remove		= pasemi_nand_remove,
-};
-
-module_platform_driver(pasemi_nand_driver);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
-MODULE_DESCRIPTION("NAND flash interface driver for PA Semi PWRficient");
-- 
1.7.10.4

^ permalink raw reply related

* Re: MPC8641 based custom board kernel Bug
From: Sri Ram Vemulpali @ 2013-12-27  6:40 UTC (permalink / raw)
  To: Ashish Khetan; +Cc: scottwood, linuxppc-dev, wyang, kernelnewbies
In-Reply-To: <CAERE9PrX61oNtQoT1tpL_+rXfirFeMa4woD2P2TSUJ_Xj-h4rg@mail.gmail.com>

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

You need to modify the base address of the each node to map in to processor
address space. All device nodes in device tree are provisioned with
physical addresses in processor domain. You need to understand the device
tree structure. Check your specs regarding the I/O mapping of the processor
memory. Following link is good example

http://xillybus.com/tutorials/device-tree-zynq-1

Regards,
Sri.


On Thu, Dec 26, 2013 at 9:20 PM, Ashish Khetan <curieux.khetan@gmail.com>wrote:

> I am using the defconfig from linux kernel tree and for CCSR in u-boot its
> F8000000 so the same i am using in device tree... so my question is - is it
> unable to parse device tree ? or in device tree some thing need to modify
> in device tree or in kernel source...
>  please give some light on this...
>
>
> Thanks & Regards
> Ashish Khetan
>
>
> On Fri, Dec 27, 2013 at 4:21 AM, Sri Ram Vemulpali <
> sri.ram.gmu06@gmail.com> wrote:
>
>> Why do not you use deconfig from linux kernel tree. Modify only base
>> address of CCSR (soc node) for child nodes of root in device tree.
>> arch/powerpc/boot/dts/mpc8641_hpcn.dts.
>>
>> Sri
>>
>>
>> On Thu, Dec 26, 2013 at 3:48 AM, Ashish Khetan <curieux.khetan@gmail.com>wrote:
>>
>>> i tried to dig more inside mpic_alloc fails. the function
>>> of_find_matching_node calls inside from mpic_alloc() should return the node
>>> at which pic is connected but it returns NULL. but why? In device tree i am
>>> using the following.. may be it will helpful.
>>> /dts-v1/;
>>>
>>> / {
>>>     model = "MPC8641HPCN";
>>>     compatible = "fsl,mpc8641hpcn";
>>>     #address-cells = <0x1>;
>>>     #size-cells = <0x1>;
>>>
>>>     aliases {
>>>         ethernet0 = "/soc8641@f8000000/ethernet@24000";
>>>         ethernet1 = "/soc8641@f8000000/ethernet@25000";
>>>         ethernet2 = "/soc8641@f8000000/ethernet@26000";
>>>         ethernet3 = "/soc8641@f8000000/ethernet@27000";
>>>         serial0 = "/soc8641@f8000000/serial@4500";
>>>     };
>>>
>>>     cpus {
>>>         #address-cells = <0x1>;
>>>         #size-cells = <0x0>;
>>>
>>>         PowerPC,8641@0 {
>>>             device_type = "cpu";
>>>             reg = <0x0>;
>>>             d-cache-line-size = <0x20>;
>>>             i-cache-line-size = <0x20>;
>>>             d-cache-size = <0x8000>;
>>>             i-cache-size = <0x8000>;
>>>             timebase-frequency = <0x0>;
>>>             bus-frequency = <0x0>;
>>>             clock-frequency = <0x0>;
>>>         };
>>>     };
>>>
>>>     memory {
>>>         device_type = "memory";
>>>         reg = <0x0 0x20000000>;
>>>     };
>>>
>>>     localbus@f8005000 {
>>>         #address-cells = <0x2>;
>>>         #size-cells = <0x1>;
>>>         compatible = "fsl,mpc8641-localbus", "simple-bus";
>>>         reg = <0xf8005000 0x1000>;
>>>         interrupts = <0x13 0x2>;
>>>         interrupt-parent = <0x1>;
>>>         ranges = <0x0 0x0 0xff000000 0x1000000>;
>>>
>>>         flash@0,0 {
>>>             compatible = "cfi-flash";
>>>             reg = <0x0 0x0 0x800000>;
>>>             bank-width = <0x2>;
>>>             device-width = <0x2>;
>>>             #address-cells = <0x1>;
>>>             #size-cells = <0x1>;
>>>         };
>>>     };
>>>
>>>     soc8641@f8000000 {
>>>         #address-cells = <0x1>;
>>>         #size-cells = <0x1>;
>>>         device_type = "soc";
>>>         compatible = "simple-bus";
>>>         ranges = <0x0 0xf8000000 0x100000>;
>>>         bus-frequency = <0x0>;
>>>
>>>         mcm-law@0 {
>>>             compatible = "fsl,mcm-law";
>>>             reg = <0x0 0x1000>;
>>>             fsl,num-laws = <0xa>;
>>>         };
>>>
>>>         mcm@1000 {
>>>             compatible = "fsl,mpc8641-mcm", "fsl,mcm";
>>>             reg = <0x1000 0x1000>;
>>>             interrupts = <0x11 0x2>;
>>>             interrupt-parent = <0x1>;
>>>         };
>>>
>>>         dma@21300 {
>>>             #address-cells = <0x1>;
>>>             #size-cells = <0x1>;
>>>             compatible = "fsl,mpc8641-dma", "fsl,eloplus-dma";
>>>             reg = <0x21300 0x4>;
>>>             ranges = <0x0 0x21100 0x200>;
>>>             cell-index = <0x0>;
>>>
>>>             dma-channel@0 {
>>>                 compatible = "fsl,mpc8641-dma-channel",
>>> "fsl,eloplus-dma-channel";
>>>                 reg = <0x0 0x80>;
>>>                 cell-index = <0x0>;
>>>                 interrupt-parent = <0x1>;
>>>                 interrupts = <0x14 0x2>;
>>>             };
>>>
>>>             dma-channel@80 {
>>>                 compatible = "fsl,mpc8641-dma-channel",
>>> "fsl,eloplus-dma-channel";
>>>                 reg = <0x80 0x80>;
>>>                 cell-index = <0x1>;
>>>                 interrupt-parent = <0x1>;
>>>                 interrupts = <0x15 0x2>;
>>>             };
>>>
>>>             dma-channel@100 {
>>>                 compatible = "fsl,mpc8641-dma-channel",
>>> "fsl,eloplus-dma-channel";
>>>                 reg = <0x100 0x80>;
>>>                 cell-index = <0x2>;
>>>                 interrupt-parent = <0x1>;
>>>                 interrupts = <0x16 0x2>;
>>>             };
>>>
>>>             dma-channel@180 {
>>>                 compatible = "fsl,mpc8641-dma-channel",
>>> "fsl,eloplus-dma-channel";
>>>                 reg = <0x180 0x80>;
>>>                 cell-index = <0x3>;
>>>                 interrupt-parent = <0x1>;
>>>                 interrupts = <0x17 0x2>;
>>>             };
>>>         };
>>>
>>>         ethernet@24000 {
>>>             #address-cells = <0x1>;
>>>             #size-cells = <0x1>;
>>>             cell-index = <0x0>;
>>>             device_type = "network";
>>>             model = "TSEC";
>>>             compatible = "gianfar";
>>>             reg = <0x24000 0x1000>;
>>>             ranges = <0x0 0x24000 0x1000>;
>>>             local-mac-address = [00 00 00 00 00 00];
>>>             interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
>>>             interrupt-parent = <0x1>;
>>>             tbi-handle = <0x2>;
>>>             phy-handle = <0x3>;
>>>             phy-connection-type = "rgmii-id";
>>>
>>>             mdio@520 {
>>>                 #address-cells = <0x1>;
>>>                 #size-cells = <0x0>;
>>>                 compatible = "fsl,gianfar-mdio";
>>>                 reg = <0x520 0x20>;
>>>
>>>                 ethernet-phy@0 {
>>>                     interrupt-parent = <0x1>;
>>>                     interrupts = <0xa 0x1>;
>>>                     reg = <0x0>;
>>>                     device_type = "ethernet-phy";
>>>                     linux,phandle = <0x3>;
>>>                 };
>>>
>>>                 ethernet-phy@1 {
>>>                     interrupt-parent = <0x1>;
>>>                     interrupts = <0xa 0x1>;
>>>                     reg = <0x1>;
>>>                     device_type = "ethernet-phy";
>>>                     linux,phandle = <0x5>;
>>>                 };
>>>
>>>                 ethernet-phy@2 {
>>>                     interrupt-parent = <0x1>;
>>>                     interrupts = <0xa 0x1>;
>>>                     reg = <0x2>;
>>>                     device_type = "ethernet-phy";
>>>                     linux,phandle = <0x7>;
>>>                 };
>>>
>>>                 ethernet-phy@3 {
>>>                     interrupt-parent = <0x1>;
>>>                     interrupts = <0xa 0x1>;
>>>                     reg = <0x3>;
>>>                     device_type = "ethernet-phy";
>>>                     linux,phandle = <0x9>;
>>>                 };
>>>
>>>                 tbi-phy@11 {
>>>                     reg = <0x11>;
>>>                     device_type = "tbi-phy";
>>>                     linux,phandle = <0x2>;
>>>                 };
>>>             };
>>>         };
>>>
>>>         ethernet@25000 {
>>>             #address-cells = <0x1>;
>>>             #size-cells = <0x1>;
>>>             cell-index = <0x1>;
>>>             device_type = "network";
>>>             model = "TSEC";
>>>             compatible = "gianfar";
>>>             reg = <0x25000 0x1000>;
>>>             ranges = <0x0 0x25000 0x1000>;
>>>             local-mac-address = [00 00 00 00 00 00];
>>>             interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
>>>             interrupt-parent = <0x1>;
>>>             tbi-handle = <0x4>;
>>>             phy-handle = <0x5>;
>>>             phy-connection-type = "rgmii-id";
>>>
>>>             mdio@520 {
>>>                 #address-cells = <0x1>;
>>>                 #size-cells = <0x0>;
>>>                 compatible = "fsl,gianfar-tbi";
>>>                 reg = <0x520 0x20>;
>>>
>>>                 tbi-phy@11 {
>>>                     reg = <0x11>;
>>>                     device_type = "tbi-phy";
>>>                     linux,phandle = <0x4>;
>>>                 };
>>>             };
>>>         };
>>>
>>>         ethernet@26000 {
>>>             #address-cells = <0x1>;
>>>             #size-cells = <0x1>;
>>>             cell-index = <0x2>;
>>>             device_type = "network";
>>>             model = "TSEC";
>>>             compatible = "gianfar";
>>>             reg = <0x26000 0x1000>;
>>>             ranges = <0x0 0x26000 0x1000>;
>>>             local-mac-address = [00 00 00 00 00 00];
>>>             interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
>>>             interrupt-parent = <0x1>;
>>>             tbi-handle = <0x6>;
>>>             phy-handle = <0x7>;
>>>             phy-connection-type = "rgmii-id";
>>>
>>>             mdio@520 {
>>>                 #address-cells = <0x1>;
>>>                 #size-cells = <0x0>;
>>>                 compatible = "fsl,gianfar-tbi";
>>>                 reg = <0x520 0x20>;
>>>
>>>                 tbi-phy@11 {
>>>                     reg = <0x11>;
>>>                     device_type = "tbi-phy";
>>>                     linux,phandle = <0x6>;
>>>                 };
>>>             };
>>>         };
>>>
>>>         ethernet@27000 {
>>>             #address-cells = <0x1>;
>>>             #size-cells = <0x1>;
>>>             cell-index = <0x3>;
>>>             device_type = "network";
>>>             model = "TSEC";
>>>             compatible = "gianfar";
>>>             reg = <0x27000 0x1000>;
>>>             ranges = <0x0 0x27000 0x1000>;
>>>             local-mac-address = [00 00 00 00 00 00];
>>>             interrupts = <0x25 0x2 0x26 0x2 0x27 0x2>;
>>>             interrupt-parent = <0x1>;
>>>             tbi-handle = <0x8>;
>>>             phy-handle = <0x9>;
>>>             phy-connection-type = "rgmii-id";
>>>
>>>             mdio@520 {
>>>                 #address-cells = <0x1>;
>>>                 #size-cells = <0x0>;
>>>                 compatible = "fsl,gianfar-tbi";
>>>                 reg = <0x520 0x20>;
>>>
>>>                 tbi-phy@11 {
>>>                     reg = <0x11>;
>>>                     device_type = "tbi-phy";
>>>                     linux,phandle = <0x8>;
>>>                 };
>>>             };
>>>         };
>>>
>>>         serial@4500 {
>>>             cell-index = <0x0>;
>>>             device_type = "serial";
>>>             compatible = "ns16550";
>>>             reg = <0x4500 0x100>;
>>>             clock-frequency = <0x0>;
>>>             interrupts = <0x2a 0x2>;
>>>             interrupt-parent = <0x1>;
>>>         };
>>>
>>>         pic@40000 {
>>>             interrupt-controller;
>>>             #address-cells = <0x0>;
>>>             #interrupt-cells = <0x2>;
>>>             reg = <0x40000 0x40000>;
>>>             compatible = "chrp,open-pic";
>>>             device_type = "open-pic";
>>>             linux,phandle = <0x1>;
>>>             phandle = <0x1>;
>>>         };
>>>
>>>         global-utilities@e0000 {
>>>             compatible = "fsl,mpc8641-guts";
>>>             reg = <0xe0000 0x1000>;
>>>             fsl,has-rstcr;
>>>         };
>>>     };
>>>
>>>     chosen {
>>>         linux,stdout-path = "/soc8641/serial0: serial@4500";
>>>     };
>>> };
>>>
>>>
>>>
>>>
>>> On Thu, Dec 26, 2013 at 2:37 PM, wyang <w90p710@gmail.com> wrote:
>>>
>>>>  On 12/26/2013 01:09 PM, Ashish Khetan wrote:
>>>>
>>>>   Hi,
>>>>  I was trying to port Linux-3.12 for MPC8641 based custom designed
>>>> board for evaluation purpose. I have been facing a kernel bug at mpic
>>>> initialization. Is somebody have faced this kind of bugs or can give me any
>>>> pointer for further steps how to solve kernel bugs will be really helpful.
>>>> here is the snapshot for the bug that may be helpful to address the bug.
>>>> Using MPC86xx HPCN machine description
>>>> Total memory = 512MB; using 1024kB for hash table (at cff00000)
>>>> Linux version 3.12.0 (ashish@ashish-VirtualBox) (gcc version 4.7.2
>>>> (GCC) ) #2 We
>>>> d Dec 25 16:04:36 IST 2013
>>>> Found initrd at 0xde975000:0xdfec428a
>>>> bootconsole [udbg0] enabled
>>>> setup_arch: bootmem
>>>> mpc86xx_hpcn_setup_arch()
>>>> MPC86xx HPCN board from Freescale Semiconductor
>>>> arch: exit
>>>> Zone ranges:
>>>>   DMA      [mem 0x00000000-0x1fffffff]
>>>>   Normal   empty
>>>>   HighMem  empty
>>>> Movable zone start for each node
>>>> Early memory node ranges
>>>>   node   0: [mem 0x00000000-0x1fffffff]
>>>> Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
>>>> 130048
>>>> Kernel command line: root=/dev/ram0 rw rootfs console=ttyS0,115200
>>>> PID hash table entries: 2048 (order: 1, 8192 bytes)
>>>> Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
>>>> Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
>>>> Sorting __ex_table...
>>>> Memory: 424980K/524288K available (4172K kernel code, 208K rwdata,
>>>> 1304K rodata,
>>>>  196K init, 149K bss, 99308K reserved, 0K highmem)
>>>> Kernel virtual memory layout:
>>>>   * 0xfffcf000..0xfffff000  : fixmap
>>>>   * 0xff800000..0xffc00000  : highmem PTEs
>>>>   * 0xff7fe000..0xff800000  : early ioremap
>>>>   * 0xe1000000..0xff7fe000  : vmalloc & ioremap
>>>> SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
>>>> NR_IRQS:512 nr_irqs:512 16
>>>> ------------[ cut here ]------------
>>>> kernel BUG at arch/powerpc/platforms/86xx/pic.c:42!
>>>>
>>>>
>>>> It hints that mpic_alloc() fails. Maybe, you should spend some time
>>>> investigating why it fails. :-)
>>>>
>>>> Thanks
>>>> Wei
>>>>
>>>>  Oops: Exception in kernel mode, sig: 5 [#1]
>>>> MPC86xx HPCN
>>>> Modules linked in:
>>>> CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0 #2
>>>> task: c05903e0 ti: c05b4000 task.ti: c05b4000
>>>> NIP: c0567438 LR: c0567430 CTR: c0567400
>>>> REGS: c05b5ee0 TRAP: 0700   Not tainted  (3.12.0)
>>>> MSR: 00021032 <ME,IR,DR,RI>  CR: 24000042  XER: 20000000
>>>>
>>>> GPR00: c0567430 c05b5f90 c05903e0 00000000 c04e4ff8 c051e588 0000008f
>>>> 00000002
>>>> GPR08: c042789c 00000001 0000006f 00000000 22000048 bebffffd 11a7b4e5
>>>> 200c8000
>>>> GPR16: ffbeffff ffffffff 00000000 00000024 00000000 1fec56f8 1fec59a7
>>>> 00000000
>>>> GPR24: 00000000 1fff97e8 40000000 1ffcc6a0 c0bff080 c05c2490 c05c2628
>>>> c0585b60
>>>> NIP [c0567438] mpc86xx_init_irq+0x38/0x108
>>>> LR [c0567430] mpc86xx_init_irq+0x30/0x108
>>>> Call Trace:
>>>> [c05b5f90] [c0567430] mpc86xx_init_irq+0x30/0x108 (unreliable)
>>>> [c05b5fb0] [c0562784] init_IRQ+0x24/0x38
>>>> [c05b5fc0] [c055fde4] start_kernel+0x1bc/0x2ec
>>>> [c05b5ff0] [00003444] 0x3444
>>>> Instruction dump:
>>>> 3d00c04f 38800000 38a01002 38c00000 38e00100 39088f8c 38600000 90010024
>>>> bfa10014 4bffec35 7c690034 5529d97e <0f090000> 3fa0c04f 4bfff391
>>>> 38600000
>>>> ---[ end trace 31fd0ba7d8756001 ]---
>>>>
>>>> Kernel panic - not syncing: Attempted to kill the idle task!
>>>> Rebooting in 180 seconds..
>>>>
>>>>
>>>>  Thanks & Regards
>>>>  Ashish Khetan
>>>>
>>>>
>>>> _______________________________________________
>>>> Linuxppc-dev mailing listLinuxppc-dev@lists.ozlabs.orghttps://lists.ozlabs.org/listinfo/linuxppc-dev
>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Kernelnewbies mailing list
>>> Kernelnewbies@kernelnewbies.org
>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>
>>>
>>
>>
>> --
>> Regards,
>> Sri.
>>
>
>


-- 
Regards,
Sri.

[-- Attachment #2: Type: text/html, Size: 21200 bytes --]

^ permalink raw reply

* Re: [PATCH] mtd: nand: remove pasemi_nand driver
From: Paul Bolle @ 2013-12-27  9:10 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linux-mtd, linuxppc-dev, David Woodhouse, linux-kernel
In-Reply-To: <1388123524-9000-1-git-send-email-olof@lixom.net>

On Thu, 2013-12-26 at 21:52 -0800, Olof Johansson wrote:
> The PA Semi platform is sparsely used these days (with just a handful
> of known users out there). I'm 100% sure none of them use the MTD NAND
> driver -- most standard use cases include PCI-e SATA controllers for
> storage instead, and boot is done from LPC NOR flash.
> 
> So, there's little reason to keep carrying a driver that's not used by
> anybody and that just gets hit by some tree-wide or tools-based changes
> every now and then.
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
>  drivers/mtd/nand/pasemi_nand.c |  238 ----------------------------------------
>  1 file changed, 238 deletions(-)
>  delete mode 100644 drivers/mtd/nand/pasemi_nand.c

If this gets accepted we should remove the related entry in
drivers/mtd/nand/Kconfig and the related line in
drivers/mtd/nand/Makefile too, shouldn't we?


Paul Bolle

^ permalink raw reply

* Re: [PATCH] mtd: nand: remove pasemi_nand driver
From: Olof Johansson @ 2013-12-27 21:34 UTC (permalink / raw)
  To: Paul Bolle
  Cc: linux-mtd@lists.infradead.org, linuxppc-dev, David Woodhouse,
	linux-kernel@vger.kernel.org
In-Reply-To: <1388135456.5072.3.camel@x220>

On Fri, Dec 27, 2013 at 1:10 AM, Paul Bolle <pebolle@tiscali.nl> wrote:
> On Thu, 2013-12-26 at 21:52 -0800, Olof Johansson wrote:
>> The PA Semi platform is sparsely used these days (with just a handful
>> of known users out there). I'm 100% sure none of them use the MTD NAND
>> driver -- most standard use cases include PCI-e SATA controllers for
>> storage instead, and boot is done from LPC NOR flash.
>>
>> So, there's little reason to keep carrying a driver that's not used by
>> anybody and that just gets hit by some tree-wide or tools-based changes
>> every now and then.
>>
>> Signed-off-by: Olof Johansson <olof@lixom.net>
>> ---
>>  drivers/mtd/nand/pasemi_nand.c |  238 ----------------------------------------
>>  1 file changed, 238 deletions(-)
>>  delete mode 100644 drivers/mtd/nand/pasemi_nand.c
>
> If this gets accepted we should remove the related entry in
> drivers/mtd/nand/Kconfig and the related line in
> drivers/mtd/nand/Makefile too, shouldn't we?

D'oh. Yes, of course. v2 coming.


-Olof

^ permalink raw reply

* Re: [PATCH 1/4] powerpc/eeh: Add restore_bars operation
From: Benjamin Herrenschmidt @ 2013-12-27 22:20 UTC (permalink / raw)
  To: Gavin Shan; +Cc: linuxppc-dev
In-Reply-To: <1387961936-20451-1-git-send-email-shangw@linux.vnet.ibm.com>

On Wed, 2013-12-25 at 16:58 +0800, Gavin Shan wrote:
> After reset on the specific PE or PHB, we never configure AER
> correctly on PowerNV platform. We needn't care it on pSeries
> platform. The patch introduces additional EEH operation eeh_ops::
> restore_bars() so that we have chance to configure AER correctly
> for PowerNV platform.

Why call it "restore_bars" if it restores something else (in this case
AER) ?

I would call it "restore_config" instead... Also rather than adding
the knowledge of what AER bit works or not for the device, would it
make sense to instead have a FW call to re-init the device ?

Otherwise, you introduce duplication between Linux and Firmware with
the risk of getting out of sync...

Cheers,
Ben.

> Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/eeh.h               |    1 +
>  arch/powerpc/kernel/eeh_pe.c                 |    3 +++
>  arch/powerpc/platforms/pseries/eeh_pseries.c |    4 +++-
>  3 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
> index d3e5e9b..4b709bf 100644
> --- a/arch/powerpc/include/asm/eeh.h
> +++ b/arch/powerpc/include/asm/eeh.h
> @@ -157,6 +157,7 @@ struct eeh_ops {
>  	int (*read_config)(struct device_node *dn, int where, int size, u32 *val);
>  	int (*write_config)(struct device_node *dn, int where, int size, u32 val);
>  	int (*next_error)(struct eeh_pe **pe);
> +	void (*restore_bars)(struct device_node *dn);
>  };
>  
>  extern struct eeh_ops *eeh_ops;
> diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
> index f945053..19eb95a 100644
> --- a/arch/powerpc/kernel/eeh_pe.c
> +++ b/arch/powerpc/kernel/eeh_pe.c
> @@ -737,6 +737,9 @@ static void *eeh_restore_one_device_bars(void *data, void *flag)
>  	else
>  		eeh_restore_device_bars(edev, dn);
>  
> +	if (eeh_ops->restore_bars)
> +		eeh_ops->restore_bars(dn);
> +
>  	return NULL;
>  }
>  
> diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
> index ccb633e..623adaf 100644
> --- a/arch/powerpc/platforms/pseries/eeh_pseries.c
> +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
> @@ -689,7 +689,9 @@ static struct eeh_ops pseries_eeh_ops = {
>  	.get_log		= pseries_eeh_get_log,
>  	.configure_bridge       = pseries_eeh_configure_bridge,
>  	.read_config		= pseries_eeh_read_config,
> -	.write_config		= pseries_eeh_write_config
> +	.write_config		= pseries_eeh_write_config,
> +	.next_error		= NULL,
> +	.restore_bars		= NULL
>  };
>  
>  /**

^ permalink raw reply

* Re: [PATCH 4/5] powerpc/fsl-booke: Add initial T208x QDS board support
From: Scott Wood @ 2013-12-27 22:53 UTC (permalink / raw)
  To: Liu Shengzhou-B36685; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1baad106bec84b5a9f8f3298e1476330@DM2PR03MB398.namprd03.prod.outlook.com>

On Fri, 2013-12-20 at 00:42 -0600, Liu Shengzhou-B36685 wrote:
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Wednesday, December 18, 2013 3:57 AM
> > To: Liu Shengzhou-B36685
> > Cc: linuxppc-dev@lists.ozlabs.org
> > Subject: Re: [PATCH 4/5] powerpc/fsl-booke: Add initial T208x QDS board
> > support
> > 
> > On Wed, 2013-12-11 at 19:19 +0800, Shengzhou Liu wrote:
> > > +		boardctrl: board-control@3,0 {
> > > +			#address-cells = <1>;
> > > +			#size-cells = <1>;
> > > +			compatible = "fsl,fpga-qixis";
> > > +			reg = <3 0 0x300>;
> > > +			ranges = <0 3 0 0x300>;
> > > +		};
> > 
> > Why do you have ranges and #address-cells/#size-cells here?  When would
> > there ever be a child node?
> 
> [Shengzhou] There are multiple child nodes for this(in a separate DPAA-related patch, but whole DPAA module has not been upstreamed yet so far)

Those properties can be added if and when the dpaa nodes go upstream.
They don't make sense as is.

-Scott

^ permalink raw reply

* Re: [PATCH] powerpc/mpic_timer: fix the time calculation is not accurate
From: Scott Wood @ 2013-12-27 23:59 UTC (permalink / raw)
  To: Dongsheng Wang; +Cc: linuxppc-dev
In-Reply-To: <1387766025-46101-1-git-send-email-dongsheng.wang@freescale.com>

On Mon, 2013-12-23 at 10:33 +0800, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang@freescale.com>
> 
> When the timer GTCCR toggle bit is inverted, we calculated the rest
> of the time is not accurate. So we need to ignore this bit.
> 
> Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> 
> diff --git a/arch/powerpc/sysdev/mpic_timer.c b/arch/powerpc/sysdev/mpic_timer.c
> index 22d7d57..0fb70c9 100644
> --- a/arch/powerpc/sysdev/mpic_timer.c
> +++ b/arch/powerpc/sysdev/mpic_timer.c
> @@ -41,6 +41,7 @@
>  #define MPIC_TIMER_TCR_ROVR_OFFSET	24
>  
>  #define TIMER_STOP			0x80000000
> +#define GTCCR_TOG			0x80000000
>  #define TIMERS_PER_GROUP		4
>  #define MAX_TICKS			(~0U >> 1)
>  #define MAX_TICKS_CASCADE		(~0U)
> @@ -96,8 +97,15 @@ static void convert_ticks_to_time(struct timer_group_priv *priv,
>  	time->tv_sec = (__kernel_time_t)div_u64(ticks, priv->timerfreq);
>  	tmp_sec = (u64)time->tv_sec * (u64)priv->timerfreq;
>  
> -	time->tv_usec = (__kernel_suseconds_t)
> -		div_u64((ticks - tmp_sec) * 1000000, priv->timerfreq);
> +	time->tv_usec = 0;
> +
> +	/*
> +	 * In some cases tmp_sec may be greater than ticks, because in the
> +	 * process of calculation ticks and tmp_sec will be rounded.
> +	 */
> +	if (tmp_sec <= ticks)
> +		time->tv_usec = (__kernel_suseconds_t)
> +			div_u64((ticks - tmp_sec) * 1000000, priv->timerfreq);

I don't see how this part of the patch relates to the patch description.

-Scott

^ permalink raw reply

* 3.13-rc3: BUG: soft lockup - CPU#0 stuck for 23s!
From: Christian Kujau @ 2013-12-28  4:00 UTC (permalink / raw)
  To: LKML; +Cc: linuxppc-dev, xfs

I noticed that my machine locks up quite often with 3.13.-rc3.

PowerPC G4 again, but this machine was pretty much rock solid until now:
when there's lots of disk I/O going on, the system locks up, but not 
entirely: the calltrace is still written to netconsole (but not to its 
local disk) and answers ping requests - but SSH login is impossible and a 
reset is needed. The workload of the machine has not changed, when there's 
disk I/O it means that either rsync is running or some crazy remote Java 
application is scanning over this machine's NFS shares.

There's sometimes "xfs" mentioned in the call trace and the disk I/O is 
all happening on the xfs mounts, that's why I Cc'ed the xfs mailing list.

More details on: http://nerdbynature.de/bits/3.13-rc3/

Any ideas?

The most recent lockup is from today below, this time it wasn't rsync or 
NFS but I was experimenting with xfs on a loop device, backed by a 1GB 
file, like this:

  $ dd if=/dev/zero of=/usr/local/test.img bs=1M count=1k
  $ losetup -f /usr/local/test.img && mkfs.xfs /dev/loop0
  $ mount -t xfs /dev/loop0 /mnt/disk
  $ cd /mnt/disk
  $ cp -ax / /mnt/disk       - which filled the disk
  $ rm -rf lib/              - make some room
  $ i=1; while true; do printf "$i "; dd if=/dev/zero of=f$i \
        count=100 bs=100k; i=$(($i+1)); done      - filling the disk again

  => and then the machine locked up.

 [308783.613600] BUG: soft lockup - CPU#0 stuck for 23s! [kworker/u2:1:14542]
 [308783.613703] Modules linked in: md5 ecb nfs i2c_powermac therm_adt746x ecryptfs arc4 b43 firewire_sbp2 usb_storage mac80211 cfg80211
 [308783.613944] irq event stamp: 37770086
 [308783.613980] hardirqs last  enabled at (37770085): [<c0546ff0>] _raw_spin_unlock_irq+0x30/0x60
 [308783.614075] hardirqs last disabled at (37770086): [<c0010700>] reenable_mmu+0x30/0x88
 [308783.614156] softirqs last  enabled at (37764418): [<c00354d4>] __do_softirq+0x168/0x1e8
 [308783.614236] softirqs last disabled at (37764411): [<c0035990>] irq_exit+0xa4/0xc8
 [308783.614312] CPU: 0 PID: 14542 Comm: kworker/u2:1 Not tainted 3.13.0-rc3-00365-gc48b660 #1
 [308783.614384] Workqueue: writeback bdi_writeback_workfn  (flush-7:0)
  
 [308783.614454] task: e8d20bb0 ti: e0c5a000 task.ti: e0c5a000
 [308783.614499] NIP: c0546ffc LR: c0546ff0 CTR: 00000000
 [308783.614543] REGS: e0c5ba80 TRAP: 0901   Not tainted  (3.13.0-rc3-00365-gc48b660)
 [308783.614596] MSR: 00009032 ,ME ,IR ,DR ,RI > CR: 444c2224  XER: 20000000
 [308783.614739] #012GPR00: #012GPR08: 
  
 [308783.614998] NIP [c0546ffc] _raw_spin_unlock_irq+0x3c/0x60
 [308783.615047] LR [c0546ff0] _raw_spin_unlock_irq+0x30/0x60
 [308783.615089] Call Trace:
 [308783.615121] [e0c5bb30] [c0546ff0] _raw_spin_unlock_irq+0x30/0x60  (unreliable)
 [308783.615202] [e0c5bb40] [c009f0e4] __set_page_dirty_nobuffers+0xc8/0x144
 [308783.615264] [e0c5bb60] [c01bec28] xfs_vm_writepage+0x90/0x57c
 [308783.615322] [e0c5bbf0] [c009e618] __writepage+0x24/0x7c
 [308783.615376] [e0c5bc00] [c009ec38] write_cache_pages+0x1d0/0x380
 [308783.615433] [e0c5bca0] [c009ee34] generic_writepages+0x4c/0x70
 [308783.615493] [e0c5bce0] [c00f9af8] __writeback_single_inode+0x34/0x12c
 [308783.615968] [e0c5bd00] [c00f9e74] writeback_sb_inodes+0x1f4/0x344
 [308783.616418] [e0c5bd70] [c00fa050] __writeback_inodes_wb+0x8c/0xd0
 [308783.616864] [e0c5bda0] [c00fa258] wb_writeback+0x1c4/0x1cc
 [308783.617306] [e0c5bdd0] [c00fae14] bdi_writeback_workfn+0x158/0x33c
 [308783.617751] [e0c5be50] [c004906c] process_one_work+0x19c/0x3f0
 [308783.618193] [e0c5be80] [c0049a0c] worker_thread+0x128/0x3c0
 [308783.618630] [e0c5beb0] [c004fa8c] kthread+0xbc/0xd0
 [308783.619071] [e0c5bf40] [c001099c] ret_from_kernel_thread+0x5c/0x64
 [308783.619501] Instruction dump:
 [308783.619915] 7ca802a6 
 [308783.620437] 4bb1c681 

-- 
BOFH excuse #446:

Mailer-daemon is busy burning your message in hell.

^ permalink raw reply

* [question] Can the execution of the atomtic operation instruction pair lwarx/stwcx be interrrupted by local HW interruptions?
From: Gavin Hu @ 2013-12-28  5:41 UTC (permalink / raw)
  To: Linuxppc-dev

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

Hi

I notice that there is a pair ppc instructions lwarx and stwcx used to
atomtic operation for instance, atomic_inc/atomic_dec.

In some ppc manuals, they more emphasize its mechanism is that lwarx can
reseve the target memory address preventing other CORE from modifying it.

I assume that there is atomtic operation executing on the CORE0 in a
multicore system. In this situation, does the CORE0 disable the local HW
interrupt?
Can the executing process from the beginning of lwarx and end of stwcx be
interrupted by HW interruptions/exceptions?  Anyway, they are two assembly
instructions.

 Thanks a lot!

"1:    lwarx    %0,0,%2        # atomic_inc\n\
    addic    %0,%0,1\n"
"    stwcx.    %0,0,%2 \n\


BR
Gavin. Hu

[-- Attachment #2: Type: text/html, Size: 899 bytes --]

^ permalink raw reply

* Re: [PATCH 11/39] powerpc: endian safe trampoline
From: Olof Johansson @ 2013-12-28  7:24 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: Paul Mackerras, linuxppc-dev, chzigotzky
In-Reply-To: <1379901913-5945-12-git-send-email-anton@samba.org>

Nothing like some holiday powerpc early boot debugging. :-)

On Sun, Sep 22, 2013 at 7:04 PM, Anton Blanchard <anton@samba.org> wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> Create a trampoline that works in either endian and flips to
> the expected endian. Use it for primary and secondary thread
> entry as well as RTAS and OF call return.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Anton Blanchard <anton@samba.org>

Some users reported failure with their kernel config to build and run
3.13-rc5. pasemi_defconfig boots just fine, but it seems that
ppc64_defconfig does not.

I've bisected it down to this particular patch. More below.


> diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
> index 0c51fb4..ce05bba 100644
> --- a/arch/powerpc/include/asm/ppc_asm.h
> +++ b/arch/powerpc/include/asm/ppc_asm.h
> @@ -845,6 +845,35 @@ END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,946)
>  #define N_SLINE        68
>  #define N_SO   100
>
> -#endif /*  __ASSEMBLY__ */
> +/*
> + * Create an endian fixup trampoline
> + *
> + * This starts with a "tdi 0,0,0x48" instruction which is
> + * essentially a "trap never", and thus akin to a nop.
> + *
> + * The opcode for this instruction read with the wrong endian
> + * however results in a b . + 8
> + *
> + * So essentially we use that trick to execute the following
> + * trampoline in "reverse endian" if we are running with the
> + * MSR_LE bit set the "wrong" way for whatever endianness the
> + * kernel is built for.
> + */
>
> +#ifdef CONFIG_PPC_BOOK3E
> +#define FIXUP_ENDIAN
> +#else
> +#define FIXUP_ENDIAN                                              \
> +       tdi   0,0,0x48;   /* Reverse endian of b . + 8          */ \
> +       b     $+36;       /* Skip trampoline if endian is good  */ \
> +       .long 0x05009f42; /* bcl 20,31,$+4                      */ \
> +       .long 0xa602487d; /* mflr r10                           */ \
> +       .long 0x1c004a39; /* addi r10,r10,28                    */ \
> +       .long 0xa600607d; /* mfmsr r11                          */ \
> +       .long 0x01006b69; /* xori r11,r11,1                     */ \
> +       .long 0xa6035a7d; /* mtsrr0 r10                         */ \
> +       .long 0xa6037b7d; /* mtsrr1 r11                         */ \
> +       .long 0x2400004c  /* rfid                               */

So, the combination of this sequence and its execution at __start
seems to be what's causing problems for me. I've both commented out
and nopped out the second instruction and the handcoded LE opcodes,
and it makes no difference -- it seems to be the execution of the tdi
that traps or causes some other problem. And yeah -- it definitely
shouldn't since TO is 0. Likewise if I replace the tdi with nop and
keep the rest it runs fine.

I'm a bit baffled that there's a difference based on what config is
booted. I'm booting a raw vmlinux from a BE firmware. Initial code
sequence is largely the same for both configs.

Unfortunately I no longer have a JTAG environment such that I can
check the value of r0 at the time of tdi execution. Still, based on
docs it shouldn't matter since there are no TO bits set. I don't see a
rational reason to why the above should fail. And indeed, if I load a
known-different value and set TO=4, I still see failures. Etc.

I also tried moving the FIXUP_ENDIAN call until after the branch to
__start_initialization_multiplatform but before 64-bit enable and
there it runs just fine.

So, I'm really quite baffled right now. Any ideas would be welcome,
I'm sort of stumped. In particular since pasemi_defconfig boots fine.


-Olof

^ 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