Re: [PATCH v3] powerpc: Use PFN_PHYS() to avoid truncating the physical address

2015-03-26 Thread Emil Medve
Hello Kumar,


On 03/26/2015 10:18 AM, Kumar Gala wrote:
 Why no commit message with what issue this change was trying to fix?

A while back, when I attempted to remove bootmem (in favor of just plain
memblock as in powerpc land bootmem was just a wrapper to memblock
anyway) I run at some point into a problem with an intermediate address
value because of this ' PAGE_SHIFT' on the wrong width variable. Using
PFN_PHYS() took care of it (it has a cast) so I decided to get this
defensive patch applied. Since, I dropped my bootmem/memblock patches in
favor to Anton's (Blanchard) work so my concrete issue example is
somewhat gone


Cheers,


 - k
 
 On Mar 25, 2015, at 8:49 AM, Emil Medve emilian.me...@freescale.com wrote:
 
 Signed-off-by: Emil Medve emilian.me...@freescale.com
 ---

 v3: Rebased and updated due to upstream changes since v2

 v2: Rebased and updated due to upstream changes since v1

 arch/powerpc/include/asm/io.h  | 2 +-
 arch/powerpc/include/asm/page.h| 2 +-
 arch/powerpc/include/asm/pgalloc-32.h  | 2 +-
 arch/powerpc/include/asm/rtas.h| 3 ++-
 arch/powerpc/kernel/crash_dump.c   | 2 +-
 arch/powerpc/kernel/eeh.c  | 4 +---
 arch/powerpc/kernel/io-workarounds.c   | 2 +-
 arch/powerpc/kernel/pci-common.c   | 2 +-
 arch/powerpc/kernel/vdso.c | 6 +++---
 arch/powerpc/kvm/book3s_64_mmu_host.c  | 2 +-
 arch/powerpc/kvm/book3s_64_mmu_hv.c| 2 +-
 arch/powerpc/kvm/book3s_hv_rm_mmu.c| 4 ++--
 arch/powerpc/kvm/e500_mmu_host.c   | 5 ++---
 arch/powerpc/mm/hugepage-hash64.c  | 2 +-
 arch/powerpc/mm/hugetlbpage-book3e.c   | 2 +-
 arch/powerpc/mm/hugetlbpage-hash64.c   | 2 +-
 arch/powerpc/mm/mem.c  | 9 -
 arch/powerpc/mm/numa.c | 5 ++---
 arch/powerpc/platforms/powernv/opal.c  | 2 +-
 arch/powerpc/platforms/pseries/iommu.c | 8 
 20 files changed, 32 insertions(+), 36 deletions(-)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2] powerpc/mpc85xx: Add MDIO bus muxing support to the board device tree(s)

2015-03-25 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Describe the PHY topology for all configurations supported by each board

Based on prior work by Andy Fleming aflem...@gmail.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v2: Remove 'Change-Id'

 arch/powerpc/boot/dts/b4860qds.dts|  60 -
 arch/powerpc/boot/dts/b4qds.dtsi  |  51 -
 arch/powerpc/boot/dts/p1023rdb.dts|  24 +-
 arch/powerpc/boot/dts/p2041rdb.dts|  92 +++-
 arch/powerpc/boot/dts/p3041ds.dts | 112 +-
 arch/powerpc/boot/dts/p4080ds.dts | 184 +++-
 arch/powerpc/boot/dts/p5020ds.dts | 112 +-
 arch/powerpc/boot/dts/p5040ds.dts | 234 +++-
 arch/powerpc/boot/dts/t1040rdb.dts|  32 ++-
 arch/powerpc/boot/dts/t1042rdb.dts|  30 ++-
 arch/powerpc/boot/dts/t1042rdb_pi.dts |  18 +-
 arch/powerpc/boot/dts/t104xqds.dtsi   | 178 ++-
 arch/powerpc/boot/dts/t104xrdb.dtsi   |  33 ++-
 arch/powerpc/boot/dts/t2080qds.dts| 158 +-
 arch/powerpc/boot/dts/t2080rdb.dts|  67 +-
 arch/powerpc/boot/dts/t2081qds.dts| 221 ++-
 arch/powerpc/boot/dts/t4240qds.dts| 400 +-
 arch/powerpc/boot/dts/t4240rdb.dts| 149 -
 18 files changed, 2135 insertions(+), 20 deletions(-)

diff --git a/arch/powerpc/boot/dts/b4860qds.dts 
b/arch/powerpc/boot/dts/b4860qds.dts
index 6bb3707..98b1ef4 100644
--- a/arch/powerpc/boot/dts/b4860qds.dts
+++ b/arch/powerpc/boot/dts/b4860qds.dts
@@ -1,7 +1,7 @@
 /*
  * B4860DS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -39,12 +39,69 @@
model = fsl,B4860QDS;
compatible = fsl,B4860QDS;
 
+   aliases {
+   phy_sgmii_1e = phy_sgmii_1e;
+   phy_sgmii_1f = phy_sgmii_1f;
+   phy_xaui_slot1 = phy_xaui_slot1;
+   phy_xaui_slot2 = phy_xaui_slot2;
+   };
+
ifc: localbus@ffe124000 {
board-control@3,0 {
compatible = fsl,b4860qds-fpga, fsl,fpga-qixis;
};
};
 
+   soc@ffe00 {
+   fman@40 {
+   ethernet@e8000 {
+   phy-handle = phy_sgmii_1e;
+   phy-connection-type = sgmii;
+   };
+
+   ethernet@ea000 {
+   phy-handle = phy_sgmii_1f;
+   phy-connection-type = sgmii;
+   };
+
+   ethernet@f {
+   phy-handle = phy_xaui_slot1;
+   phy-connection-type = xgmii;
+   };
+
+   ethernet@f2000 {
+   phy-handle = phy_xaui_slot2;
+   phy-connection-type = xgmii;
+   };
+
+   mdio@fc000 {
+   phy_sgmii_1e: ethernet-phy@1e {
+   reg = 0x1e;
+   status = disabled;
+   };
+
+   phy_sgmii_1f: ethernet-phy@1f {
+   reg = 0x1f;
+   status = disabled;
+   };
+   };
+
+   mdio@fd000 {
+   phy_xaui_slot1: xaui-phy@slot1 {
+   compatible = 
ethernet-phy-ieee802.3-c45;
+   reg = 0x7;
+   status = disabled;
+   };
+
+   phy_xaui_slot2: xaui-phy@slot2 {
+   compatible = 
ethernet-phy-ieee802.3-c45;
+   reg = 0x6;
+   status = disabled;
+   };
+   };
+   };
+   };
+
rio: rapidio@ffe0c {
reg = 0xf 0xfe0c 0 0x11000;
 
@@ -55,7 +112,6 @@
ranges = 0 0 0xc 0x3000 0 0x1000;
};
};
-
 };
 
 /include/ fsl/b4860si-post.dtsi
diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index 559d006..af49456 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420DS Device Tree Source
  *
- * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2015

[PATCH v3] powerpc: Use PFN_PHYS() to avoid truncating the physical address

2015-03-25 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v3: Rebased and updated due to upstream changes since v2

v2: Rebased and updated due to upstream changes since v1

 arch/powerpc/include/asm/io.h  | 2 +-
 arch/powerpc/include/asm/page.h| 2 +-
 arch/powerpc/include/asm/pgalloc-32.h  | 2 +-
 arch/powerpc/include/asm/rtas.h| 3 ++-
 arch/powerpc/kernel/crash_dump.c   | 2 +-
 arch/powerpc/kernel/eeh.c  | 4 +---
 arch/powerpc/kernel/io-workarounds.c   | 2 +-
 arch/powerpc/kernel/pci-common.c   | 2 +-
 arch/powerpc/kernel/vdso.c | 6 +++---
 arch/powerpc/kvm/book3s_64_mmu_host.c  | 2 +-
 arch/powerpc/kvm/book3s_64_mmu_hv.c| 2 +-
 arch/powerpc/kvm/book3s_hv_rm_mmu.c| 4 ++--
 arch/powerpc/kvm/e500_mmu_host.c   | 5 ++---
 arch/powerpc/mm/hugepage-hash64.c  | 2 +-
 arch/powerpc/mm/hugetlbpage-book3e.c   | 2 +-
 arch/powerpc/mm/hugetlbpage-hash64.c   | 2 +-
 arch/powerpc/mm/mem.c  | 9 -
 arch/powerpc/mm/numa.c | 5 ++---
 arch/powerpc/platforms/powernv/opal.c  | 2 +-
 arch/powerpc/platforms/pseries/iommu.c | 8 
 20 files changed, 32 insertions(+), 36 deletions(-)

diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 9eaf301..d6454f5 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -794,7 +794,7 @@ static inline void * phys_to_virt(unsigned long address)
 /*
  * Change struct page to physical address.
  */
-#define page_to_phys(page) ((phys_addr_t)page_to_pfn(page)  PAGE_SHIFT)
+#define page_to_phys(page) PFN_PHYS(page_to_pfn(page))
 
 /*
  * 32 bits still uses virt_to_bus() for it's implementation of DMA
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 69c0598..30f33ed 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -128,7 +128,7 @@ extern long long virt_phys_offset;
 #endif
 
 #define virt_to_page(kaddr)pfn_to_page(__pa(kaddr)  PAGE_SHIFT)
-#define pfn_to_kaddr(pfn)  __va((pfn)  PAGE_SHIFT)
+#define pfn_to_kaddr(pfn)  __va(PFN_PHYS(pfn))
 #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr)  PAGE_SHIFT)
 
 /*
diff --git a/arch/powerpc/include/asm/pgalloc-32.h 
b/arch/powerpc/include/asm/pgalloc-32.h
index 842846c..3d19a8e 100644
--- a/arch/powerpc/include/asm/pgalloc-32.h
+++ b/arch/powerpc/include/asm/pgalloc-32.h
@@ -24,7 +24,7 @@ extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
 #define pmd_populate_kernel(mm, pmd, pte)  \
(pmd_val(*(pmd)) = __pa(pte) | _PMD_PRESENT)
 #define pmd_populate(mm, pmd, pte) \
-   (pmd_val(*(pmd)) = (page_to_pfn(pte)  PAGE_SHIFT) | 
_PMD_PRESENT)
+   (pmd_val(*(pmd)) = PFN_PHYS(page_to_pfn(pte)) | _PMD_PRESENT)
 #define pmd_pgtable(pmd) pmd_page(pmd)
 #else
 #define pmd_populate_kernel(mm, pmd, pte)  \
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 2e23e92..2e430b6d 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -3,6 +3,7 @@
 #ifdef __KERNEL__
 
 #include linux/spinlock.h
+#include linux/pfn.h
 #include asm/page.h
 
 /*
@@ -418,7 +419,7 @@ extern void rtas_take_timebase(void);
 #ifdef CONFIG_PPC_RTAS
 static inline int page_is_rtas_user_buf(unsigned long pfn)
 {
-   unsigned long paddr = (pfn  PAGE_SHIFT);
+   unsigned long paddr = PFN_PHYS(pfn);
if (paddr = rtas_rmo_buf  paddr  (rtas_rmo_buf + RTAS_RMOBUF_MAX))
return 1;
return 0;
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index cfa0f81..b6578ee 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -104,7 +104,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
return 0;
 
csize = min_t(size_t, csize, PAGE_SIZE);
-   paddr = pfn  PAGE_SHIFT;
+   paddr = PFN_PHYS(pfn);
 
if (memblock_is_region_memory(paddr, csize)) {
vaddr = __va(paddr);
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 3b2252e..119af20 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -326,7 +326,6 @@ void eeh_slot_error_detail(struct eeh_pe *pe, int severity)
 static inline unsigned long eeh_token_to_phys(unsigned long token)
 {
pte_t *ptep;
-   unsigned long pa;
int hugepage_shift;
 
/*
@@ -336,9 +335,8 @@ static inline unsigned long eeh_token_to_phys(unsigned long 
token)
if (!ptep)
return token;
WARN_ON(hugepage_shift);
-   pa = pte_pfn(*ptep)  PAGE_SHIFT;
 
-   return pa | (token  (PAGE_SIZE-1));
+   return PFN_PHYS(pte_pfn(*ptep)) | (token  (PAGE_SIZE - 1));
 }
 
 /*
diff --git a/arch/powerpc/kernel/io-workarounds.c 
b/arch/powerpc/kernel/io-workarounds.c
index 24b968f..dd9a4a2 100644
--- a/arch/powerpc/kernel/io-workarounds.c
+++ b/arch/powerpc/kernel/io

[PATCH v8 2/2] powerpc/mpc85xx: Add FSL QorIQ DPAA QMan support to device tree(s)

2015-03-24 Thread Emil Medve
From: Kumar Gala ga...@kernel.crashing.org

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
Signed-off-by: Chunhe Lan chunhe@freescale.com
Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v8: Fix indentation/whitespaces

v7: Remove 'Change-Id'

v6: Rebase

 arch/powerpc/boot/dts/b4qds.dtsi|  12 ++
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  69 ++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi| 106 ++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  43 
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  78 +++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 126 +++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 318 
 arch/powerpc/boot/dts/kmcoge4.dts   |  12 ++
 arch/powerpc/boot/dts/oca4080.dts   |  12 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p2041rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p3041ds.dts   |  12 ++
 arch/powerpc/boot/dts/p4080ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5020ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5040ds.dts   |  12 ++
 arch/powerpc/boot/dts/t104xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t104xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  12 ++
 arch/powerpc/boot/dts/t4240rdb.dts  |  12 ++
 26 files changed, 985 insertions(+)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index 24ed80d..559d006 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -106,6 +106,14 @@
size = 0 0x100;
alignment = 0 0x100;
};
+   qman_fqd: qman-fqd {
+   size = 0 0x40;
+   alignment = 0 0x40;
+   };
+   qman_pfdr: qman-pfdr {
+   size = 0 0x200;
+   alignment = 0 0x200;
+   };
};
 
dcsr: dcsr@f {
@@ -116,6 +124,10 @@
ranges = 0x0 0xf 0xf400 0x200;
};
 
+   qportals: qman-portals@ff600 {
+   ranges = 0x0 0xf 0xf600 0x200;
+   };
+
soc: soc@ffe00 {
ranges = 0x 0xf 0xfe00 0x100;
reg = 0xf 0xfe00 0 0x1000;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index f35e9e0..f26e736 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -167,6 +167,75 @@
};
 };
 
+qportals {
+   qportal14: qman-portal@38000 {
+   compatible = fsl,qman-portal;
+   reg = 0x38000 0x4000, 0x100e000 0x1000;
+   interrupts = 132 0x2 0 0;
+   fsl,qman-channel-id = 0xe;
+   };
+   qportal15: qman-portal@3c000 {
+   compatible = fsl,qman-portal;
+   reg = 0x3c000 0x4000, 0x100f000 0x1000;
+   interrupts = 134 0x2 0 0;
+   fsl,qman-channel-id = 0xf;
+   };
+   qportal16: qman-portal@4 {
+   compatible = fsl,qman-portal;
+   reg = 0x4 0x4000, 0x101 0x1000;
+   interrupts = 136 0x2 0 0;
+   fsl,qman-channel-id = 0x10;
+   };
+   qportal17: qman-portal@44000 {
+   compatible = fsl,qman-portal;
+   reg = 0x44000 0x4000, 0x1011000 0x1000;
+   interrupts = 138 0x2 0 0;
+   fsl,qman-channel-id = 0x11;
+   };
+   qportal18: qman-portal@48000 {
+   compatible = fsl,qman-portal;
+   reg = 0x48000 0x4000, 0x1012000 0x1000;
+   interrupts = 140 0x2 0 0;
+   fsl,qman-channel-id = 0x12;
+   };
+   qportal19: qman-portal@4c000 {
+   compatible = fsl,qman-portal;
+   reg = 0x4c000 0x4000, 0x1013000 0x1000;
+   interrupts = 142 0x2 0 0;
+   fsl,qman-channel-id = 0x13;
+   };
+   qportal20: qman-portal@5 {
+   compatible = fsl,qman-portal;
+   reg = 0x5 0x4000, 0x1014000 0x1000;
+   interrupts = 144 0x2 0 0;
+   fsl,qman-channel-id = 0x14;
+   };
+   qportal21: qman-portal@54000

Re: [PATCH 1/3] powerpc/mpc85xx: Add FMan clock nodes

2015-03-24 Thread Emil Medve
Hello Scott,


On 03/23/2015 06:30 PM, Scott Wood wrote:
 On Thu, 2015-02-26 at 09:26 -0600, Emil Medve wrote:
 From: Igal Liberman igal.liber...@freescale.com

 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 ---
  arch/powerpc/boot/dts/fsl/b4si-post.dtsi| 11 +++
  arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  8 
  arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  8 
  arch/powerpc/boot/dts/fsl/p4080si-post.dtsi | 16 
  arch/powerpc/boot/dts/fsl/p5020si-post.dtsi | 13 +
  arch/powerpc/boot/dts/fsl/p5040si-post.dtsi | 26 ++
  arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  8 
  arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 11 +++
  arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 20 
  9 files changed, 121 insertions(+)

 diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi 
 b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
 index f8c325e..38621ef 100644
 --- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
 +++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
 @@ -395,6 +395,17 @@
  reg = 0xe 0xe00;
  fsl,has-rstcr;
  fsl,liodn-bits = 12;
 +
 +fm0clk: fm0-clk-mux {
 +#clock-cells = 0;
 +compatible = fsl,fman-clk-mux;
 +clocks = pll0 0, pll0 1, pll0 2, pll0 3,
 + platform_pll 0, pll1 1, pll1 2;
 +clock-names = pll0, pll0-div2, pll0-div3,
 +  pll0-div4, platform-pll, pll1-div2,
 +  pll1-div3;
 +clock-output-names = fm0-clk;
 +};
 
 Where's the binding for fsl,fman-clk-mux?
 

Igal will follow-up with the binding document


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v3 00/10] Freescale DPAA B/QMan drivers

2015-03-09 Thread Emil Medve
v3: Addressed feedback from Kumar and Scott (partially, more in the next 
round)
Moved public headers into include/soc/fsl and code into drivers/soc/fsl
Various clean-up

v2: Moved out of staging into soc/freescale

To do:  Add a maintainer(s) entry
Add module(s) support
Some important clean-ups

Geoff Thorpe (8):
  fsl_bman: Add drivers for the Freescale DPAA BMan
  fsl_qman: Add drivers for the Freescale DPAA QMan
  powerpc/mpc85xx: Add platform support for the Freescale DPAA BMan
  powerpc/mpc85xx: Add platform support for the Freescale DPAA QMan
  fsl_bman: Add self-tester
  fsl_qman: Add self-tester
  fsl_bman: Add debugfs support
  fsl_qman: Add debugfs support

Hai-Ying Wang (2):
  fsl_bman: Add HOTPLUG_CPU support
  fsl_qman: Add HOTPLUG_CPU support

 arch/powerpc/Kconfig  |   33 +-
 arch/powerpc/configs/mpc85xx_defconfig|1 +
 arch/powerpc/configs/mpc85xx_smp_defconfig|1 +
 arch/powerpc/platforms/85xx/Kconfig   |   11 +-
 arch/powerpc/platforms/85xx/corenet_generic.c |   28 +-
 arch/powerpc/platforms/85xx/p1023_rdb.c   |   28 +-
 drivers/soc/fsl/Kconfig   |  188 ++
 drivers/soc/fsl/Makefile  |   22 +-
 drivers/soc/fsl/bman.c|  610 ++
 drivers/soc/fsl/bman.h|  523 +
 drivers/soc/fsl/bman_api.c| 1054 ++
 drivers/soc/fsl/bman_debugfs.c|  118 ++
 drivers/soc/fsl/bman_portal.c |  372 
 drivers/soc/fsl/bman_priv.h   |  148 ++
 drivers/soc/fsl/bman_test.c   |   55 +
 drivers/soc/fsl/bman_test.h   |   43 +
 drivers/soc/fsl/bman_test_api.c   |  180 ++
 drivers/soc/fsl/bman_test_thresh.c|  195 ++
 drivers/soc/fsl/dpaa_alloc.c  |  572 ++
 drivers/soc/fsl/dpaa_sys.h|  293 +++
 drivers/soc/fsl/qbman_driver.c|   84 +
 drivers/soc/fsl/qman.c|  990 ++
 drivers/soc/fsl/qman.h| 1301 
 drivers/soc/fsl/qman_api.c| 2623 +
 drivers/soc/fsl/qman_debugfs.c| 1325 +
 drivers/soc/fsl/qman_portal.c |  547 ++
 drivers/soc/fsl/qman_priv.h   |  282 +++
 drivers/soc/fsl/qman_test.c   |   56 +
 drivers/soc/fsl/qman_test.h   |   42 +
 drivers/soc/fsl/qman_test_api.c   |  212 ++
 drivers/soc/fsl/qman_test_stash.c |  496 +
 drivers/soc/fsl/qman_utils.c  |  128 ++
 include/soc/fsl/bman.h|  516 +
 include/soc/fsl/qman.h| 1954 ++
 34 files changed, 15004 insertions(+), 27 deletions(-)
 create mode 100644 drivers/soc/fsl/bman.c
 create mode 100644 drivers/soc/fsl/bman.h
 create mode 100644 drivers/soc/fsl/bman_api.c
 create mode 100644 drivers/soc/fsl/bman_debugfs.c
 create mode 100644 drivers/soc/fsl/bman_portal.c
 create mode 100644 drivers/soc/fsl/bman_priv.h
 create mode 100644 drivers/soc/fsl/bman_test.c
 create mode 100644 drivers/soc/fsl/bman_test.h
 create mode 100644 drivers/soc/fsl/bman_test_api.c
 create mode 100644 drivers/soc/fsl/bman_test_thresh.c
 create mode 100644 drivers/soc/fsl/dpaa_alloc.c
 create mode 100644 drivers/soc/fsl/dpaa_sys.h
 create mode 100644 drivers/soc/fsl/qbman_driver.c
 create mode 100644 drivers/soc/fsl/qman.c
 create mode 100644 drivers/soc/fsl/qman.h
 create mode 100644 drivers/soc/fsl/qman_api.c
 create mode 100644 drivers/soc/fsl/qman_debugfs.c
 create mode 100644 drivers/soc/fsl/qman_portal.c
 create mode 100644 drivers/soc/fsl/qman_priv.h
 create mode 100644 drivers/soc/fsl/qman_test.c
 create mode 100644 drivers/soc/fsl/qman_test.h
 create mode 100644 drivers/soc/fsl/qman_test_api.c
 create mode 100644 drivers/soc/fsl/qman_test_stash.c
 create mode 100644 drivers/soc/fsl/qman_utils.c
 create mode 100644 include/soc/fsl/bman.h
 create mode 100644 include/soc/fsl/qman.h

-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v3 09/10] fsl_bman: Add HOTPLUG_CPU support

2015-03-09 Thread Emil Medve
From: Hai-Ying Wang haiying.w...@freescale.com

Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
---
 drivers/soc/fsl/bman_portal.c | 45 ++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/fsl/bman_portal.c b/drivers/soc/fsl/bman_portal.c
index b06339a..60c966e 100644
--- a/drivers/soc/fsl/bman_portal.c
+++ b/drivers/soc/fsl/bman_portal.c
@@ -29,6 +29,9 @@
  */
 
 #include bman_priv.h
+#ifdef CONFIG_HOTPLUG_CPU
+#include linux/cpu.h
+#endif
 
 /*
  * Global variables of the max portal/pool number this bman version supported
@@ -179,7 +182,7 @@ static int __init parse_bportals(char *str)
 }
 __setup(bportals=, parse_bportals);
 
-static void bman_offline_cpu(unsigned int cpu)
+static void __cold bman_offline_cpu(unsigned int cpu)
 {
struct bman_portal *p = (struct bman_portal *)affine_bportals[cpu];
const struct bm_portal_config *pcfg;
@@ -191,6 +194,42 @@ static void bman_offline_cpu(unsigned int cpu)
}
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void __cold bman_online_cpu(unsigned int cpu)
+{
+   struct bman_portal *p = (struct bman_portal *)affine_bportals[cpu];
+   const struct bm_portal_config *pcfg;
+
+   if (p) {
+   pcfg = bman_get_bm_portal_config(p);
+   if (pcfg)
+   irq_set_affinity(pcfg-public_cfg.irq, cpumask_of(cpu));
+   }
+}
+
+static int __cold bman_hotplug_cpu_callback(struct notifier_block *nfb,
+   unsigned long action, void *hcpu)
+{
+   unsigned int cpu = (unsigned long)hcpu;
+
+   switch (action) {
+   case CPU_ONLINE:
+   case CPU_ONLINE_FROZEN:
+   bman_online_cpu(cpu);
+   break;
+   case CPU_DOWN_PREPARE:
+   case CPU_DOWN_PREPARE_FROZEN:
+   bman_offline_cpu(cpu);
+   }
+
+   return NOTIFY_OK;
+}
+
+static struct notifier_block bman_hotplug_cpu_notifier = {
+   .notifier_call = bman_hotplug_cpu_callback,
+};
+#endif /* CONFIG_HOTPLUG_CPU */
+
 /* Initialise the BMan driver. The meat of this function deals with portals. 
The
  * following describes the flow of portal-handling, the code steps refer to
  * this description;
@@ -325,5 +364,9 @@ int __init bman_init(void)
for_each_cpu(cpu, offline_cpus)
bman_offline_cpu(cpu);
 
+#ifdef CONFIG_HOTPLUG_CPU
+   register_hotcpu_notifier(bman_hotplug_cpu_notifier);
+#endif
+
return 0;
 }
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v3 10/10] fsl_qman: Add HOTPLUG_CPU support

2015-03-09 Thread Emil Medve
From: Hai-Ying Wang haiying.w...@freescale.com

Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
---
 drivers/soc/fsl/qman_portal.c | 45 +++
 1 file changed, 45 insertions(+)

diff --git a/drivers/soc/fsl/qman_portal.c b/drivers/soc/fsl/qman_portal.c
index c4b96cc..27372d4 100644
--- a/drivers/soc/fsl/qman_portal.c
+++ b/drivers/soc/fsl/qman_portal.c
@@ -29,6 +29,9 @@
  */
 
 #include qman_priv.h
+#ifdef CONFIG_HOTPLUG_CPU
+#include linux/cpu.h
+#endif
 
 /* Global variable containing revision id (even on non-control plane systems
  * where CCSR isn't available) */
@@ -380,6 +383,45 @@ static void qman_offline_cpu(unsigned int cpu)
}
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void qman_online_cpu(unsigned int cpu)
+{
+   struct qman_portal *p;
+   const struct qm_portal_config *pcfg;
+   p = (struct qman_portal *)affine_portals[cpu];
+   if (p) {
+   pcfg = qman_get_qm_portal_config(p);
+   if (pcfg) {
+   irq_set_affinity(pcfg-public_cfg.irq, cpumask_of(cpu));
+   qman_portal_update_sdest(pcfg, cpu);
+   }
+   }
+}
+
+static int __cpuinit qman_hotplug_cpu_callback(struct notifier_block *nfb,
+   unsigned long action, void *hcpu)
+{
+   unsigned int cpu = (unsigned long)hcpu;
+
+   switch (action) {
+   case CPU_ONLINE:
+   case CPU_ONLINE_FROZEN:
+   qman_online_cpu(cpu);
+   break;
+   case CPU_DOWN_PREPARE:
+   case CPU_DOWN_PREPARE_FROZEN:
+   qman_offline_cpu(cpu);
+   default:
+   break;
+   }
+   return NOTIFY_OK;
+}
+
+static struct notifier_block qman_hotplug_cpu_notifier = {
+   .notifier_call = qman_hotplug_cpu_callback,
+};
+#endif /* CONFIG_HOTPLUG_CPU */
+
 __init int qman_init(void)
 {
struct cpumask slave_cpus;
@@ -498,5 +540,8 @@ __init int qman_init(void)
cpumask_andnot(offline_cpus, cpu_possible_mask, cpu_online_mask);
for_each_cpu(cpu, offline_cpus)
qman_offline_cpu(cpu);
+#ifdef CONFIG_HOTPLUG_CPU
+   register_hotcpu_notifier(qman_hotplug_cpu_notifier);
+#endif
return 0;
 }
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v3 06/10] fsl_qman: Add self-tester

2015-03-09 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/soc/fsl/Kconfig  |  26 +-
 drivers/soc/fsl/Makefile |   4 +
 drivers/soc/fsl/bman_test.c  |   2 +-
 drivers/soc/fsl/{bman_test.c = qman_test.c} |  15 +-
 drivers/soc/fsl/{bman_test.c = qman_test.h} |  33 +-
 drivers/soc/fsl/qman_test_api.c  | 212 
 drivers/soc/fsl/qman_test_stash.c| 496 +++
 7 files changed, 756 insertions(+), 32 deletions(-)
 copy drivers/soc/fsl/{bman_test.c = qman_test.c} (91%)
 copy drivers/soc/fsl/{bman_test.c = qman_test.h} (81%)
 create mode 100644 drivers/soc/fsl/qman_test_api.c
 create mode 100644 drivers/soc/fsl/qman_test_stash.c

diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
index 4abf25b..e00f2bf 100644
--- a/drivers/soc/fsl/Kconfig
+++ b/drivers/soc/fsl/Kconfig
@@ -53,7 +53,7 @@ config FSL_BMAN_TEST
---help---
  This option compiles self-test code for BMan.
 
-config FSL_BMAN_TEST_HIGH
+config FSL_BMAN_TEST_API
bool BMan high-level self-test
depends on FSL_BMAN_TEST
default y
@@ -93,6 +93,30 @@ config FSL_QMAN_CONFIG
  linux image is running as a guest OS under the hypervisor, only one
  guest OS (the control plane) needs this option.
 
+config FSL_QMAN_TEST
+   tristate QMan self-tests
+   default n
+   ---help---
+ This option compiles self-test code for QMan.
+
+config FSL_QMAN_TEST_API
+   bool QMan high-level self-test
+   depends on FSL_QMAN_TEST
+   default y
+   ---help---
+ This requires the presence of cpu-affine portals, and performs
+ high-level API testing with them (whichever portal(s) are affine to
+ the cpu(s) the test executes on).
+
+config FSL_QMAN_TEST_STASH
+   bool QMan 'hot potato' data-stashing self-test
+   depends on FSL_QMAN_TEST
+   default y
+   ---help---
+ This performs a hot potato style test enqueuing/dequeuing a frame
+ across a series of FQs scheduled to different portals (and cpus), with
+ DQRR, data and context stashing always on.
+
 # H/w settings that can be hard-coded for now.
 config FSL_QMAN_FQD_SZ
int size of Frame Queue Descriptor region
diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
index 55e62f1..bd0fd91 100644
--- a/drivers/soc/fsl/Makefile
+++ b/drivers/soc/fsl/Makefile
@@ -11,5 +11,9 @@ bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH)+= 
bman_test_thresh.o
 
 obj-$(CONFIG_FSL_QMAN) += qman_api.o qman_utils.o
 obj-$(CONFIG_FSL_QMAN_CONFIG)  += qman.o qman_portal.o
+obj-$(CONFIG_FSL_QMAN_TEST)+= qman_tester.o
+qman_tester-y   = qman_test.o
+qman_tester-$(CONFIG_FSL_QMAN_TEST_API)+= qman_test_api.o
+qman_tester-$(CONFIG_FSL_QMAN_TEST_STASH)  += qman_test_stash.o
 
 obj-$(CONFIG_FSL_FMAN) += fman/
diff --git a/drivers/soc/fsl/bman_test.c b/drivers/soc/fsl/bman_test.c
index d09f4e1..8edcada 100644
--- a/drivers/soc/fsl/bman_test.c
+++ b/drivers/soc/fsl/bman_test.c
@@ -36,7 +36,7 @@ MODULE_DESCRIPTION(BMan testing);
 
 static int test_init(void)
 {
-#ifdef CONFIG_FSL_BMAN_TEST_HIGH
+#ifdef CONFIG_FSL_BMAN_TEST_API
int loop = 1;
while (loop--)
bman_test_api();
diff --git a/drivers/soc/fsl/bman_test.c b/drivers/soc/fsl/qman_test.c
similarity index 91%
copy from drivers/soc/fsl/bman_test.c
copy to drivers/soc/fsl/qman_test.c
index d09f4e1..d2e1fbb 100644
--- a/drivers/soc/fsl/bman_test.c
+++ b/drivers/soc/fsl/qman_test.c
@@ -28,22 +28,23 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include bman_test.h
+#include qman_test.h
 
 MODULE_AUTHOR(Geoff Thorpe);
 MODULE_LICENSE(Dual BSD/GPL);
-MODULE_DESCRIPTION(BMan testing);
+MODULE_DESCRIPTION(QMan testing);
 
 static int test_init(void)
 {
-#ifdef CONFIG_FSL_BMAN_TEST_HIGH
int loop = 1;
-   while (loop--)
-   bman_test_api();
+   while (loop--) {
+#ifdef CONFIG_FSL_QMAN_TEST_STASH
+   qman_test_stash();
 #endif
-#ifdef CONFIG_FSL_BMAN_TEST_THRESH
-   bman_test_thresh();
+#ifdef CONFIG_FSL_QMAN_TEST_API
+   qman_test_api();
 #endif
+   }
return 0;
 }
 
diff --git a/drivers/soc/fsl/bman_test.c b/drivers/soc/fsl/qman_test.h
similarity index 81%
copy from drivers/soc/fsl/bman_test.c
copy to drivers/soc/fsl/qman_test.h
index d09f4e1..caa58c0 100644
--- a/drivers/soc/fsl/bman_test.c
+++ b/drivers/soc/fsl/qman_test.h
@@ -28,28 +28,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include bman_test.h
+#include linux/kernel.h
+#include linux/errno.h
+#include linux/io.h
+#include linux/slab.h
+#include linux/module.h
+#include linux/interrupt.h
+#include linux/delay.h
 

[RFC v3 04/10] powerpc/mpc85xx: Add platform support for the Freescale DPAA QMan

2015-03-09 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 arch/powerpc/platforms/85xx/corenet_generic.c | 8 +++-
 arch/powerpc/platforms/85xx/p1023_rdb.c   | 8 +++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index c5a82c9..255f542 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -201,15 +201,21 @@ static int __init corenet_generic_probe(void)
 }
 
 /* Early setup is required for large chunks of contiguous (and 
coarsely-aligned)
- * memory. The following shoe-horns BMan init_early calls into the
+ * memory. The following shoe-horns Q/BMan init_early calls into the
  * platform setup to let them parse their CCSR nodes early on.
  */
+#ifdef CONFIG_FSL_QMAN_CONFIG
+void __init qman_init_early(void);
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
 void __init bman_init_early(void);
 #endif
 
 __init void corenet_ds_init_early(void)
 {
+#ifdef CONFIG_FSL_QMAN_CONFIG
+   qman_init_early();
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
bman_init_early();
 #endif
diff --git a/arch/powerpc/platforms/85xx/p1023_rdb.c 
b/arch/powerpc/platforms/85xx/p1023_rdb.c
index e629394..ab06296 100644
--- a/arch/powerpc/platforms/85xx/p1023_rdb.c
+++ b/arch/powerpc/platforms/85xx/p1023_rdb.c
@@ -106,14 +106,20 @@ static int __init p1023_rdb_probe(void)
 }
 
 /* Early setup is required for large chunks of contiguous (and 
coarsely-aligned)
- * memory. The following shoe-horns BMan init_early calls into the
+ * memory. The following shoe-horns Q/BMan init_early calls into the
  * platform setup to let them parse their CCSR nodes early on. */
+#ifdef CONFIG_FSL_QMAN_CONFIG
+void __init qman_init_early(void);
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
 void __init bman_init_early(void);
 #endif
 
 static __init void p1023_rdb_init_early(void)
 {
+#ifdef CONFIG_FSL_QMAN_CONFIG
+   qman_init_early();
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
bman_init_early();
 #endif
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v3 07/10] fsl_bman: Add debugfs support

2015-03-09 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/soc/fsl/Kconfig|   7 +++
 drivers/soc/fsl/Makefile   |   1 +
 drivers/soc/fsl/bman_api.c |  19 +++
 drivers/soc/fsl/bman_debugfs.c | 118 +
 drivers/soc/fsl/dpaa_sys.h |   1 +
 include/soc/fsl/bman.h |   6 +++
 6 files changed, 152 insertions(+)
 create mode 100644 drivers/soc/fsl/bman_debugfs.c

diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
index e00f2bf..eaede8b 100644
--- a/drivers/soc/fsl/Kconfig
+++ b/drivers/soc/fsl/Kconfig
@@ -73,6 +73,13 @@ config FSL_BMAN_TEST_THRESH
  drainer thread, and the other threads that they observe exactly
  the depletion state changes that are expected.
 
+config FSL_BMAN_DEBUGFS
+   tristate BMan debugfs interface
+   depends on DEBUG_FS
+   default y
+   ---help---
+ This option compiles debugfs code for BMan.
+
 endif # FSL_BMAN
 
 config FSL_QMAN
diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
index bd0fd91..a991e18 100644
--- a/drivers/soc/fsl/Makefile
+++ b/drivers/soc/fsl/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_FSL_BMAN_TEST) += bman_tester.o
 bman_tester-y   = bman_test.o
 bman_tester-$(CONFIG_FSL_BMAN_TEST_API)+= bman_test_api.o
 bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH) += bman_test_thresh.o
+obj-$(CONFIG_FSL_BMAN_DEBUGFS) += bman_debugfs.o
 
 obj-$(CONFIG_FSL_QMAN) += qman_api.o qman_utils.o
 obj-$(CONFIG_FSL_QMAN_CONFIG)  += qman.o qman_portal.o
diff --git a/drivers/soc/fsl/bman_api.c b/drivers/soc/fsl/bman_api.c
index 8de4973..1a6a440 100644
--- a/drivers/soc/fsl/bman_api.c
+++ b/drivers/soc/fsl/bman_api.c
@@ -996,6 +996,25 @@ int bman_flush_stockpile(struct bman_pool *pool, u32 flags)
 }
 EXPORT_SYMBOL(bman_flush_stockpile);
 
+int bman_query_pools(struct bm_pool_state *state)
+{
+   struct bman_portal *p = get_affine_portal();
+   struct bm_mc_result *mcr;
+   __maybe_unused unsigned long irqflags;
+
+   PORTAL_IRQ_LOCK(p, irqflags);
+   bm_mc_start(p-p);
+   bm_mc_commit(p-p, BM_MCC_VERB_CMD_QUERY);
+   while (!(mcr = bm_mc_result(p-p)))
+   cpu_relax();
+   DPA_ASSERT((mcr-verb  BM_MCR_VERB_CMD_MASK) == BM_MCR_VERB_CMD_QUERY);
+   *state = mcr-query;
+   PORTAL_IRQ_UNLOCK(p, irqflags);
+   put_affine_portal();
+   return 0;
+}
+EXPORT_SYMBOL(bman_query_pools);
+
 #ifdef CONFIG_FSL_BMAN_CONFIG
 u32 bman_query_free_buffers(struct bman_pool *pool)
 {
diff --git a/drivers/soc/fsl/bman_debugfs.c b/drivers/soc/fsl/bman_debugfs.c
new file mode 100644
index 000..df451de
--- /dev/null
+++ b/drivers/soc/fsl/bman_debugfs.c
@@ -0,0 +1,118 @@
+/* Copyright 2010 - 2015 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 linux/module.h
+#include soc/fsl/bman.h
+#include linux/debugfs.h
+#include linux/seq_file.h
+#include linux/uaccess.h
+
+static struct dentry *dfs_root; /* debugfs root directory */
+
+/***
+ *  Query Buffer 

[RFC v3 05/10] fsl_bman: Add self-tester

2015-03-09 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/soc/fsl/Kconfig|  26 +
 drivers/soc/fsl/Makefile   |   4 +
 drivers/soc/fsl/bman_test.c|  55 +++
 drivers/soc/fsl/bman_test.h|  43 
 drivers/soc/fsl/bman_test_api.c| 180 ++
 drivers/soc/fsl/bman_test_thresh.c | 195 +
 6 files changed, 503 insertions(+)
 create mode 100644 drivers/soc/fsl/bman_test.c
 create mode 100644 drivers/soc/fsl/bman_test.h
 create mode 100644 drivers/soc/fsl/bman_test_api.c
 create mode 100644 drivers/soc/fsl/bman_test_thresh.c

diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
index 73fdfb8..4abf25b 100644
--- a/drivers/soc/fsl/Kconfig
+++ b/drivers/soc/fsl/Kconfig
@@ -47,6 +47,32 @@ config FSL_BMAN_CONFIG
  linux image is running as a guest OS under the hypervisor, only one
  guest OS (the control plane) needs this option.
 
+config FSL_BMAN_TEST
+   tristate BMan self-tests
+   default n
+   ---help---
+ This option compiles self-test code for BMan.
+
+config FSL_BMAN_TEST_HIGH
+   bool BMan high-level self-test
+   depends on FSL_BMAN_TEST
+   default y
+   ---help---
+ This requires the presence of cpu-affine portals, and performs
+ high-level API testing with them (whichever portal(s) are affine to
+ the cpu(s) the test executes on).
+
+config FSL_BMAN_TEST_THRESH
+   bool BMan threshold test
+   depends on FSL_BMAN_TEST
+   default y
+   ---help---
+ Multi-threaded (SMP) test of BMan pool depletion. A pool is seeded
+ before multiple threads (one per cpu) create pool objects to track
+ depletion state changes. The pool is then drained to empty by a
+ drainer thread, and the other threads that they observe exactly
+ the depletion state changes that are expected.
+
 endif # FSL_BMAN
 
 config FSL_QMAN
diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
index d53627d..55e62f1 100644
--- a/drivers/soc/fsl/Makefile
+++ b/drivers/soc/fsl/Makefile
@@ -4,6 +4,10 @@ obj-$(CONFIG_HAS_FSL_QBMAN)+= 
qbman_driver.o
 
 obj-$(CONFIG_FSL_BMAN) += bman_api.o
 obj-$(CONFIG_FSL_BMAN_CONFIG)  += bman.o bman_portal.o
+obj-$(CONFIG_FSL_BMAN_TEST)+= bman_tester.o
+bman_tester-y   = bman_test.o
+bman_tester-$(CONFIG_FSL_BMAN_TEST_API)+= bman_test_api.o
+bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH) += bman_test_thresh.o
 
 obj-$(CONFIG_FSL_QMAN) += qman_api.o qman_utils.o
 obj-$(CONFIG_FSL_QMAN_CONFIG)  += qman.o qman_portal.o
diff --git a/drivers/soc/fsl/bman_test.c b/drivers/soc/fsl/bman_test.c
new file mode 100644
index 000..d09f4e1
--- /dev/null
+++ b/drivers/soc/fsl/bman_test.c
@@ -0,0 +1,55 @@
+/* Copyright 2008 - 2015 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 bman_test.h
+
+MODULE_AUTHOR(Geoff Thorpe);
+MODULE_LICENSE(Dual BSD/GPL);
+MODULE_DESCRIPTION(BMan testing);
+
+static int 

[RFC v3 03/10] powerpc/mpc85xx: Add platform support for the Freescale DPAA BMan

2015-03-09 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 arch/powerpc/Kconfig  | 33 +++
 arch/powerpc/configs/mpc85xx_defconfig|  1 +
 arch/powerpc/configs/mpc85xx_smp_defconfig|  1 +
 arch/powerpc/platforms/85xx/Kconfig   | 11 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 22 +++---
 arch/powerpc/platforms/85xx/p1023_rdb.c   | 22 ++
 6 files changed, 64 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 7258b468..6ab5ad5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -362,7 +362,7 @@ config PPC_TRANSACTIONAL_MEM
select VSX
default n
---help---
- Support user-mode Transactional Memory on POWERPC.
+Support user-mode Transactional Memory on POWERPC.
 
 config IOMMU_HELPER
def_bool PPC64
@@ -375,7 +375,7 @@ config SWIOTLB
  Support for IO bounce buffering for systems without an IOMMU.
  This allows us to DMA to the full physical address space on
  platforms where the size of a physical address is larger
- than the bus address.  Not all platforms support this.
+ than the bus address.  Not all platforms support this.
 
 config HOTPLUG_CPU
bool Support for enabling/disabling CPUs
@@ -411,8 +411,8 @@ config KEXEC
depends on (PPC_BOOK3S || FSL_BOOKE || (44x  !SMP))
help
  kexec is a system call that implements the ability to shutdown your
- current kernel, and to start another kernel.  It is like a reboot
- but it is independent of the system firmware.   And like a reboot
+ current kernel, and to start another kernel.  It is like a reboot
+ but it is independent of the system firmware.   And like a reboot
  you can start any kernel with it, not just Linux.
 
  The name comes from the similarity to the exec system call.
@@ -451,7 +451,7 @@ config IRQ_ALL_CPUS
help
  This option gives the kernel permission to distribute IRQs across
  multiple CPUs.  Saying N here will route all IRQs to the first
- CPU.  Generally saying Y is safe, although some problems have been
+ CPU.  Generally saying Y is safe, although some problems have been
  reported with SMP Power Macintoshes with this option enabled.
 
 config NUMA
@@ -500,9 +500,9 @@ config ARCH_MEMORY_PROBE
depends on MEMORY_HOTPLUG
 
 # Some NUMA nodes have memory ranges that span
-# other nodes.  Even though a pfn is valid and
+# other nodes. Even though a pfn is valid and
 # between a node's start and end pfns, it may not
-# reside on that node.  See memmap_init_zone()
+# reside on that node. See memmap_init_zone()
 # for details.
 config NODES_SPAN_OTHER_NODES
def_bool y
@@ -601,8 +601,8 @@ config FORCE_MAX_ZONEORDER
  This config option is actually maximum order plus one. For example,
  a value of 11 means that the largest free memory block is 2^10 pages.
 
- The page size is not necessarily 4KB.  For example, on 64-bit
- systems, 64KB pages can be enabled via CONFIG_PPC_64K_PAGES.  Keep
+ The page size is not necessarily 4KB.  For example, on 64-bit
+ systems, 64KB pages can be enabled via CONFIG_PPC_64K_PAGES.  Keep
  this in mind when choosing a value for this option.
 
 config PPC_SUBPAGE_PROT
@@ -631,7 +631,7 @@ config PPC_DENORMALISATION
default y if PPC_POWERNV
---help---
  Add support for handling denormalisation of single precision
- values.  Useful for bare metal only.  If unsure say Y here.
+ values.  Useful for bare metal only.  If unsure say Y here.
 
 config CMDLINE_BOOL
bool Default bootloader kernel arguments
@@ -741,7 +741,7 @@ config FSL_SOC
bool
 
 config FSL_PCI
-   bool
+   bool
select PPC_INDIRECT_PCI
select PCI_QUIRKS
 
@@ -779,12 +779,17 @@ config FSL_GTM
help
  Freescale General-purpose Timers support
 
+config HAS_FSL_QBMAN
+   bool Datapath Acceleration Queue and Buffer management
+   help
+ Datapath Acceleration Queue and Buffer management
+
 # Yes MCA RS/6000s exist but Linux-PPC does not currently support any
 config MCA
bool
 
 # Platforms that what PCI turned unconditionally just do select PCI
-# in their config node.  Platforms that want to choose at config
+# in their config node. Platforms that want to choose at config
 # time should select PPC_PCI_CHOICE
 config PPC_PCI_CHOICE
bool
@@ -911,14 +916,14 @@ config DYNAMIC_MEMSTART
select NONSTATIC_KERNEL
help
  This option enables the kernel to be loaded at any page aligned
- physical address. The kernel creates a mapping from KERNELBASE to 
+ physical address. The kernel creates a mapping from KERNELBASE to
  

[RFC v3 08/10] fsl_qman: Add debugfs support

2015-03-09 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/soc/fsl/Kconfig|7 +
 drivers/soc/fsl/Makefile   |1 +
 drivers/soc/fsl/qman_api.c |   58 ++
 drivers/soc/fsl/qman_debugfs.c | 1325 
 drivers/soc/fsl/qman_priv.h|8 +
 include/soc/fsl/qman.h |6 +
 6 files changed, 1405 insertions(+)
 create mode 100644 drivers/soc/fsl/qman_debugfs.c

diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
index eaede8b..84425c1 100644
--- a/drivers/soc/fsl/Kconfig
+++ b/drivers/soc/fsl/Kconfig
@@ -124,6 +124,13 @@ config FSL_QMAN_TEST_STASH
  across a series of FQs scheduled to different portals (and cpus), with
  DQRR, data and context stashing always on.
 
+config FSL_QMAN_DEBUGFS
+   tristate QMan debugfs interface
+   depends on DEBUG_FS
+   default y
+   ---help---
+ This option compiles debugfs code for QMan.
+
 # H/w settings that can be hard-coded for now.
 config FSL_QMAN_FQD_SZ
int size of Frame Queue Descriptor region
diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
index a991e18..3516a8d 100644
--- a/drivers/soc/fsl/Makefile
+++ b/drivers/soc/fsl/Makefile
@@ -16,5 +16,6 @@ obj-$(CONFIG_FSL_QMAN_TEST)   += qman_tester.o
 qman_tester-y   = qman_test.o
 qman_tester-$(CONFIG_FSL_QMAN_TEST_API)+= qman_test_api.o
 qman_tester-$(CONFIG_FSL_QMAN_TEST_STASH)  += qman_test_stash.o
+obj-$(CONFIG_FSL_QMAN_DEBUGFS) += qman_debugfs.o
 
 obj-$(CONFIG_FSL_FMAN) += fman/
diff --git a/drivers/soc/fsl/qman_api.c b/drivers/soc/fsl/qman_api.c
index ad1d85b..ee97972 100644
--- a/drivers/soc/fsl/qman_api.c
+++ b/drivers/soc/fsl/qman_api.c
@@ -1764,6 +1764,37 @@ int qman_query_wq(u8 query_dedicated, struct 
qm_mcr_querywq *wq)
 }
 EXPORT_SYMBOL(qman_query_wq);
 
+int qman_testwrite_cgr(struct qman_cgr *cgr, u64 i_bcnt,
+   struct qm_mcr_cgrtestwrite *result)
+{
+   struct qm_mc_command *mcc;
+   struct qm_mc_result *mcr;
+   struct qman_portal *p = get_affine_portal();
+   unsigned long irqflags __maybe_unused;
+   u8 res;
+
+   PORTAL_IRQ_LOCK(p, irqflags);
+   mcc = qm_mc_start(p-p);
+   mcc-cgrtestwrite.cgid = cgr-cgrid;
+   mcc-cgrtestwrite.i_bcnt_hi = (u8)(i_bcnt  32);
+   mcc-cgrtestwrite.i_bcnt_lo = (u32)i_bcnt;
+   qm_mc_commit(p-p, QM_MCC_VERB_CGRTESTWRITE);
+   while (!(mcr = qm_mc_result(p-p)))
+   cpu_relax();
+   DPA_ASSERT((mcr-verb  QM_MCR_VERB_MASK) == QM_MCC_VERB_CGRTESTWRITE);
+   res = mcr-result;
+   if (res == QM_MCR_RESULT_OK)
+   *result = mcr-cgrtestwrite;
+   PORTAL_IRQ_UNLOCK(p, irqflags);
+   put_affine_portal();
+   if (res != QM_MCR_RESULT_OK) {
+   pr_err(CGR TEST WRITE failed: %s\n, mcr_result_str(res));
+   return -EIO;
+   }
+   return 0;
+}
+EXPORT_SYMBOL(qman_testwrite_cgr);
+
 int qman_query_cgr(struct qman_cgr *cgr, struct qm_mcr_querycgr *cgrd)
 {
struct qm_mc_command *mcc;
@@ -1792,6 +1823,33 @@ int qman_query_cgr(struct qman_cgr *cgr, struct 
qm_mcr_querycgr *cgrd)
 }
 EXPORT_SYMBOL(qman_query_cgr);
 
+int qman_query_congestion(struct qm_mcr_querycongestion *congestion)
+{
+   struct qm_mc_result *mcr;
+   struct qman_portal *p = get_affine_portal();
+   unsigned long irqflags __maybe_unused;
+   u8 res;
+
+   PORTAL_IRQ_LOCK(p, irqflags);
+   qm_mc_start(p-p);
+   qm_mc_commit(p-p, QM_MCC_VERB_QUERYCONGESTION);
+   while (!(mcr = qm_mc_result(p-p)))
+   cpu_relax();
+   DPA_ASSERT((mcr-verb  QM_MCR_VERB_MASK) ==
+   QM_MCC_VERB_QUERYCONGESTION);
+   res = mcr-result;
+   if (res == QM_MCR_RESULT_OK)
+   *congestion = mcr-querycongestion;
+   PORTAL_IRQ_UNLOCK(p, irqflags);
+   put_affine_portal();
+   if (res != QM_MCR_RESULT_OK) {
+   pr_err(QUERY_CONGESTION failed: %s\n, mcr_result_str(res));
+   return -EIO;
+   }
+   return 0;
+}
+EXPORT_SYMBOL(qman_query_congestion);
+
 /* internal function used as a wait_event() expression */
 static int set_p_vdqcr(struct qman_portal *p, struct qman_fq *fq, u32 vdqcr)
 {
diff --git a/drivers/soc/fsl/qman_debugfs.c b/drivers/soc/fsl/qman_debugfs.c
new file mode 100644
index 000..0e97768
--- /dev/null
+++ b/drivers/soc/fsl/qman_debugfs.c
@@ -0,0 +1,1325 @@
+/* Copyright 2010 - 2015 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 

Re: [PATCH 0/7] Freescale DPAA FMan FLIB(s)

2015-03-05 Thread Emil Medve
Hello Jamal,


On 03/05/2015 06:32 AM, Jamal Hadi Salim wrote:
 On 03/05/15 00:45, Emil Medve wrote:
 From: Igal Liberman igal.liber...@freescale.com

 The Freescale Data Path Acceleration Architecture (DPAA) is a set of
 hardware components on specific QorIQ P and T series multicore
 processors.
 This architecture provides the infrastructure to support simplified
 sharing of networking interfaces and accelerators by multiple CPU cores,
 and the accelerators themselves.

 One of the DPAA accelerators is the Frame Manager (FMan), which
 combines the Ethernet network interfaces with packet distribution
 logic to provide intelligent distribution and queuing decisions for
 incoming traffic at line rate.

 This patch presents the FMan Foundation Libraries (FLIB) headers.
 The FMan FLIB suite adds basic support for the DPAA FMan hardware
 register access.
 The FMan FLIB suite is used in Freescale's SDK Releases.

 
 Is this intended to merely enable your sdk?

The intent is to upstream the entire suite of the DPAA drivers. All the
drivers are still WIP, but B/QMan have been already presented to the
upstream community and this is the first attempt to publish (some low
level code of) the FMan driver. As we go through our internal checklist
and in the same time address community feedback we'll soon get the
drivers to be acceptable for the upstream trees

The first version of the actual Ethernet driver will follow imminently

SDK enablement is a side-effect

 How are you planning to
 add support for your classifiers, queue schedulers etc?

Yes

 Is that a patch
 on top of this or it is something that sits on user space?

Both. Full DPAA/Ethernet enablement will be present in the kernel. We
also have support for user-space based approach. I'm unsure where/when
we might publish that. Of course the SDK is always a place you can turn
to for all the code we have (in whatever state it might be)


Cheers.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/7] Freescale DPAA FMan FLIB(s)

2015-03-05 Thread Emil Medve
Hello Jamal,


On 03/05/2015 08:35 AM, Jamal Hadi Salim wrote:
 Hi Emil,
 
 On 03/05/15 08:48, Emil Medve wrote:
 
 The intent is to upstream the entire suite of the DPAA drivers. All the
 drivers are still WIP, but B/QMan have been already presented to the
 upstream community and this is the first attempt to publish (some low
 level code of) the FMan driver. As we go through our internal checklist
 and in the same time address community feedback we'll soon get the
 drivers to be acceptable for the upstream trees

 The first version of the actual Ethernet driver will follow imminently

 SDK enablement is a side-effect
 
 Meaning? Let me ask the question differently:
 Do i need your sdk to use the features exposed

No. All the kernel drivers/code we want to upstream is meant to stand on
its own and be used the normal Linux/Unix way

 or can i use something
 like tc to set up the deficit rr or wred or the exposed classifiers
 and associated actions?

The SDK doesn't currently support the enablement of any HW QoS features
via standard Linux user-space tools. The SDK contains some FSL tools for
that. As a time moving target we intend to support lots of the DPAA
features via standard kernel/user-space means: ethtool, iptables,
iproute2, etc.

 Would your sdk (via user space direct programming) benefit because you
 have pushed these pieces into the kernel?

Not specifically because of the kernel drivers. In support for the
user-space DPAA the kernel will have some UIO/VFIO drivers to allow the
user-space to mmap these devices (portals, ports, MAC(s), etc.). The
intent is to use the same driver sources for the kernel- and user-space
drivers

 How are you planning to
 add support for your classifiers, queue schedulers etc?

 Yes
 
 Yes as in these will be available via linux kernel or via your sdk?

As in these will be available via familiar kernel-/user-space tools

 Is that a patch
 on top of this or it is something that sits on user space?

 Both. Full DPAA/Ethernet enablement will be present in the kernel. We
 also have support for user-space based approach. I'm unsure where/when
 we might publish that. Of course the SDK is always a place you can turn
 to for all the code we have (in whatever state it might be)
 
 the sdk is open source?

I'm uncertain about *all* the licenses included, but you can look into
it and download the SDK via git.freescale.com and/or
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=SDKLINUX


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 7/7] soc/fman: Add the FMan SP FLIB

2015-03-04 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 drivers/soc/fsl/fman/Makefile |   1 +
 drivers/soc/fsl/fman/sp/Makefile  |  13 +++
 drivers/soc/fsl/fman/sp/fman_sp.c | 204 ++
 3 files changed, 218 insertions(+)
 create mode 100644 drivers/soc/fsl/fman/sp/Makefile
 create mode 100644 drivers/soc/fsl/fman/sp/fman_sp.c

diff --git a/drivers/soc/fsl/fman/Makefile b/drivers/soc/fsl/fman/Makefile
index f415188..4a854b3 100644
--- a/drivers/soc/fsl/fman/Makefile
+++ b/drivers/soc/fsl/fman/Makefile
@@ -14,5 +14,6 @@ obj-$(CONFIG_FSL_FMAN_PORT)   += port/
 obj-$(CONFIG_FSL_FMAN_MAC) += mac/
 obj-$(CONFIG_FSL_FMAN_PCD) += pcd/
 obj-$(CONFIG_FSL_FMAN_RTC) += rtc/
+obj-$(CONFIG_FSL_FMAN) += sp/
 
 endif
diff --git a/drivers/soc/fsl/fman/sp/Makefile b/drivers/soc/fsl/fman/sp/Makefile
new file mode 100644
index 000..4655c11
--- /dev/null
+++ b/drivers/soc/fsl/fman/sp/Makefile
@@ -0,0 +1,13 @@
+ccflags-y += -DVERSION=\\
+
+ifeq ($(CONFIG_FSL_FMAN),y)
+
+FMAN = $(srctree)/drivers/soc/fsl/fman
+
+ccflags-y += -I$(FMAN)/flib
+
+obj-$(CONFIG_FSL_FMAN) += fsl_fman_sp.o
+
+fsl_fman_sp-objs   := fman_sp.o
+
+endif
diff --git a/drivers/soc/fsl/fman/sp/fman_sp.c 
b/drivers/soc/fsl/fman/sp/fman_sp.c
new file mode 100644
index 000..e11413d
--- /dev/null
+++ b/drivers/soc/fsl/fman/sp/fman_sp.c
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2008-2015 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_fman_sp.h
+
+uint32_t fman_vsp_get_statistics(struct fm_pcd_storage_profile_regs *regs,
+uint16_t index)
+{
+   struct fm_pcd_storage_profile_regs *sp_regs;
+
+   sp_regs = regs[index];
+   return ioread32be(sp_regs-fm_sp_acnt);
+}
+
+void fman_vsp_set_statistics(struct fm_pcd_storage_profile_regs *regs,
+uint16_t index, uint32_t value)
+{
+   struct fm_pcd_storage_profile_regs *sp_regs;
+
+   sp_regs = regs[index];
+   iowrite32be(value, sp_regs-fm_sp_acnt);
+}
+
+void fman_vsp_defconfig(struct fm_storage_profile_params *cfg)
+{
+   cfg-dma_swap_data = DEFAULT_FMAN_SP_DMA_SWAP_DATA;
+   cfg-int_context_cache_attr =
+   DEFAULT_FMAN_SP_DMA_INT_CONTEXT_CACHE_ATTR;
+   cfg-header_cache_attr = DEFAULT_FMAN_SP_DMA_HEADER_CACHE_ATTR;
+   cfg-scatter_gather_cache_attr =
+   DEFAULT_FMAN_SP_DMA_SCATTER_GATHER_CACHE_ATTR;
+   cfg-dma_write_optimize = DEFAULT_FMAN_SP_DMA_WRITE_OPTIMIZE;
+   cfg-no_scather_gather = DEFAULT_FMAN_SP_NO_SCATTER_GATHER;
+}
+
+static inline uint32_t calc_vec_dep(int max_pools, bool *pools,
+   struct fman_ext_pools *ext_buf_pools,
+   uint32_t mask)
+{
+   int i, j;
+   uint32_t vector = 0;
+
+   for (i = 0; i  max_pools; i++)
+   if (pools[i])
+   for (j = 0; j  ext_buf_pools-num_pools_used; j++)
+   if (i == ext_buf_pools-ext_buf_pool[j].id) {
+   vector |= mask  j;
+   break;
+   }
+   return 

[PATCH 2/7] soc/fman: Add the FMan FLIB

2015-03-04 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 drivers/soc/Kconfig   |1 +
 drivers/soc/Makefile  |1 +
 drivers/soc/fsl/Kconfig   |1 +
 drivers/soc/fsl/Makefile  |1 +
 drivers/soc/fsl/fman/Kconfig  |7 +
 drivers/soc/fsl/fman/Makefile |   13 +
 drivers/soc/fsl/fman/fman.c   | 1396 +
 7 files changed, 1420 insertions(+)
 create mode 100644 drivers/soc/fsl/Kconfig
 create mode 100644 drivers/soc/fsl/Makefile
 create mode 100644 drivers/soc/fsl/fman/Kconfig
 create mode 100644 drivers/soc/fsl/fman/Makefile
 create mode 100644 drivers/soc/fsl/fman/fman.c

diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
index 76d6bd4..674a6e6 100644
--- a/drivers/soc/Kconfig
+++ b/drivers/soc/Kconfig
@@ -1,5 +1,6 @@
 menu SOC (System On Chip) specific Drivers
 
+source drivers/soc/fsl/Kconfig
 source drivers/soc/qcom/Kconfig
 source drivers/soc/ti/Kconfig
 source drivers/soc/versatile/Kconfig
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index 063113d..42836ee 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -2,6 +2,7 @@
 # Makefile for the Linux Kernel SOC specific device drivers.
 #
 
+obj-$(CONFIG_FSL_SOC)  += fsl/
 obj-$(CONFIG_ARCH_QCOM)+= qcom/
 obj-$(CONFIG_ARCH_TEGRA)   += tegra/
 obj-$(CONFIG_SOC_TI)   += ti/
diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
new file mode 100644
index 000..38c08ae
--- /dev/null
+++ b/drivers/soc/fsl/Kconfig
@@ -0,0 +1 @@
+source drivers/soc/fsl/fman/Kconfig
diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
new file mode 100644
index 000..97d715c
--- /dev/null
+++ b/drivers/soc/fsl/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_FSL_FMAN)   += fman/
diff --git a/drivers/soc/fsl/fman/Kconfig b/drivers/soc/fsl/fman/Kconfig
new file mode 100644
index 000..e5009a9
--- /dev/null
+++ b/drivers/soc/fsl/fman/Kconfig
@@ -0,0 +1,7 @@
+menuconfig FSL_FMAN
+   tristate Freescale DPAA Frame Manager
+   depends on FSL_SOC || COMPILE_TEST
+   default n
+   help
+   Freescale Data-Path Acceleration Architecture Frame Manager
+   (FMan) support
diff --git a/drivers/soc/fsl/fman/Makefile b/drivers/soc/fsl/fman/Makefile
new file mode 100644
index 000..d7fbecb
--- /dev/null
+++ b/drivers/soc/fsl/fman/Makefile
@@ -0,0 +1,13 @@
+ccflags-y += -DVERSION=\\
+
+ifeq ($(CONFIG_FSL_FMAN),y)
+
+FMAN = $(srctree)/drivers/soc/fsl/fman
+
+ccflags-y += -I$(FMAN)/flib
+
+obj-$(CONFIG_FSL_FMAN) += fsl_fman.o
+
+fsl_fman-objs  := fman.o
+
+endif
diff --git a/drivers/soc/fsl/fman/fman.c b/drivers/soc/fsl/fman/fman.c
new file mode 100644
index 000..dbf2cd3
--- /dev/null
+++ b/drivers/soc/fsl/fman/fman.c
@@ -0,0 +1,1396 @@
+/*
+ * Copyright 2008-2015 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_fman.h
+
+uint32_t fman_get_bmi_err_event(struct fman_bmi_regs __iomem *bmi_rg)
+{
+   uint32_t event, mask, force;
+
+   event = ioread32be(bmi_rg-fmbm_ievr);
+   mask = ioread32be(bmi_rg-fmbm_ier);
+   event = mask;
+   /* clear the forced events */
+   force = 

[PATCH 3/7] soc/fman: Add the FMan port FLIB

2015-03-04 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 drivers/soc/fsl/fman/Kconfig  |   10 +
 drivers/soc/fsl/fman/Makefile |2 +
 drivers/soc/fsl/fman/port/Makefile|   13 +
 drivers/soc/fsl/fman/port/fman_port.c | 1536 +
 4 files changed, 1561 insertions(+)
 create mode 100644 drivers/soc/fsl/fman/port/Makefile
 create mode 100644 drivers/soc/fsl/fman/port/fman_port.c

diff --git a/drivers/soc/fsl/fman/Kconfig b/drivers/soc/fsl/fman/Kconfig
index e5009a9..a5f981f 100644
--- a/drivers/soc/fsl/fman/Kconfig
+++ b/drivers/soc/fsl/fman/Kconfig
@@ -5,3 +5,13 @@ menuconfig FSL_FMAN
help
Freescale Data-Path Acceleration Architecture Frame Manager
(FMan) support
+
+if FSL_FMAN
+
+config FSL_FMAN_PORT
+   bool FMan port
+   default n
+   help
+   Freescale DPAA FMan port support
+
+endif  # FSL_FMAN
diff --git a/drivers/soc/fsl/fman/Makefile b/drivers/soc/fsl/fman/Makefile
index d7fbecb..a0132cc 100644
--- a/drivers/soc/fsl/fman/Makefile
+++ b/drivers/soc/fsl/fman/Makefile
@@ -10,4 +10,6 @@ obj-$(CONFIG_FSL_FMAN)+= fsl_fman.o
 
 fsl_fman-objs  := fman.o
 
+obj-$(CONFIG_FSL_FMAN_PORT) += port/
+
 endif
diff --git a/drivers/soc/fsl/fman/port/Makefile 
b/drivers/soc/fsl/fman/port/Makefile
new file mode 100644
index 000..3e79c3f
--- /dev/null
+++ b/drivers/soc/fsl/fman/port/Makefile
@@ -0,0 +1,13 @@
+ccflags-y += -DVERSION=\\
+
+ifeq ($(CONFIG_FSL_FMAN_PORT),y)
+
+FMAN = $(srctree)/drivers/soc/fsl/fman
+
+ccflags-y += -I$(FMAN)/flib
+
+obj-$(CONFIG_FSL_FMAN_PORT)+= fsl_fman_port.o
+
+fsl_fman_port-objs := fman_port.o
+
+endif
diff --git a/drivers/soc/fsl/fman/port/fman_port.c 
b/drivers/soc/fsl/fman/port/fman_port.c
new file mode 100644
index 000..cc9ebb0
--- /dev/null
+++ b/drivers/soc/fsl/fman/port/fman_port.c
@@ -0,0 +1,1536 @@
+/*
+ * Copyright 2008-2015 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 common/general.h
+
+#include fman_common.h
+#include fsl_fman_port.h
+
+/* problem Eyal: the following should not be here*/
+#define NIA_FM_CTL_AC_NO_IPACC_PRE_BMI_ENQ_FRAME0x0028
+
+static uint32_t get_no_pcd_nia_bmi_ac_enc_frame(struct fman_port_cfg *cfg)
+{
+   if (cfg-errata_A006675)
+   return NIA_ENG_FM_CTL |
+   NIA_FM_CTL_AC_NO_IPACC_PRE_BMI_ENQ_FRAME;
+   else
+   return NIA_ENG_BMI | NIA_BMI_AC_ENQ_FRAME;
+}
+
+static int init_bmi_rx(struct fman_port *port,
+  struct fman_port_cfg *cfg,
+  struct fman_port_params *params)
+{
+   struct fman_port_rx_bmi_regs __iomem *regs = port-bmi_regs-rx;
+   uint32_t tmp;
+
+   /* Rx Configuration register */
+   tmp = 0;
+   if (cfg-discard_override)
+   tmp |= BMI_PORT_CFG_FDOVR;
+   iowrite32be(tmp, regs-fmbm_rcfg);
+
+   /* DMA attributes */
+   tmp = (uint32_t)cfg-dma_swap_data  BMI_DMA_ATTR_SWP_SHIFT;
+   if (cfg-dma_ic_stash_on)
+   tmp |= BMI_DMA_ATTR_IC_STASH_ON;
+   if (cfg-dma_header_stash_on)
+   tmp |= BMI_DMA_ATTR_HDR_STASH_ON;
+  

[PATCH 5/7] soc/fman: Add the FMan parser and KeyGen FLIB(s)

2015-03-04 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 drivers/soc/fsl/fman/Kconfig|   6 +
 drivers/soc/fsl/fman/Makefile   |   1 +
 drivers/soc/fsl/fman/pcd/Makefile   |  13 +
 drivers/soc/fsl/fman/pcd/fman_kg.c  | 850 
 drivers/soc/fsl/fman/pcd/fman_prs.c | 127 ++
 5 files changed, 997 insertions(+)
 create mode 100644 drivers/soc/fsl/fman/pcd/Makefile
 create mode 100644 drivers/soc/fsl/fman/pcd/fman_kg.c
 create mode 100644 drivers/soc/fsl/fman/pcd/fman_prs.c

diff --git a/drivers/soc/fsl/fman/Kconfig b/drivers/soc/fsl/fman/Kconfig
index c1c258c..2559ee9 100644
--- a/drivers/soc/fsl/fman/Kconfig
+++ b/drivers/soc/fsl/fman/Kconfig
@@ -20,4 +20,10 @@ config FSL_FMAN_MAC
help
Freescale DPAA FMan MAC support
 
+config FSL_FMAN_PCD
+   bool FMan PCD
+   default n
+   help
+   Freescale DPAA FMan Parse, Classify and Distribute support
+
 endif  # FSL_FMAN
diff --git a/drivers/soc/fsl/fman/Makefile b/drivers/soc/fsl/fman/Makefile
index ffaabd9..dc37f35 100644
--- a/drivers/soc/fsl/fman/Makefile
+++ b/drivers/soc/fsl/fman/Makefile
@@ -12,5 +12,6 @@ fsl_fman-objs := fman.o
 
 obj-$(CONFIG_FSL_FMAN_PORT)+= port/
 obj-$(CONFIG_FSL_FMAN_MAC) += mac/
+obj-$(CONFIG_FSL_FMAN_PCD) += pcd/
 
 endif
diff --git a/drivers/soc/fsl/fman/pcd/Makefile 
b/drivers/soc/fsl/fman/pcd/Makefile
new file mode 100644
index 000..fa40367
--- /dev/null
+++ b/drivers/soc/fsl/fman/pcd/Makefile
@@ -0,0 +1,13 @@
+ccflags-y += -DVERSION=\\
+
+ifeq ($(CONFIG_FSL_FMAN_PCD),y)
+
+FMAN = $(srctree)/drivers/soc/fsl/fman
+
+ccflags-y += -I$(FMAN)/flib
+
+obj-$(CONFIG_FSL_FMAN_PCD) += fsl_fman_pcd.o
+
+fsl_fman_pcd-objs  := fman_kg.o fman_prs.o
+
+endif
diff --git a/drivers/soc/fsl/fman/pcd/fman_kg.c 
b/drivers/soc/fsl/fman/pcd/fman_kg.c
new file mode 100644
index 000..f420db6
--- /dev/null
+++ b/drivers/soc/fsl/fman/pcd/fman_kg.c
@@ -0,0 +1,850 @@
+/*
+ * Copyright 2008-2015 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_fman_kg.h
+
+/* static functions */
+
+static uint32_t build_ar_bind_scheme(uint8_t hwport_id, bool write)
+{
+   uint32_t rw;
+
+   rw = write ? (uint32_t)FM_KG_KGAR_WRITE : (uint32_t)FM_KG_KGAR_READ;
+
+   return (uint32_t)(FM_KG_KGAR_GO | rw | FM_PCD_KG_KGAR_SEL_PORT_ENTRY |
+ hwport_id | FM_PCD_KG_KGAR_SEL_PORT_WSEL_SP);
+}
+
+static void clear_pe_all_scheme(struct fman_kg_regs __iomem *regs,
+   uint8_t hwport_id)
+{
+   uint32_t ar;
+
+   fman_kg_write_sp(regs, 0x, 0);
+
+   ar = build_ar_bind_scheme(hwport_id, true);
+   fman_kg_write_ar_wait(regs, ar);
+}
+
+static uint32_t build_ar_bind_cls_plan(uint8_t hwport_id, bool write)
+{
+   uint32_t rw;
+
+   rw = write ? (uint32_t)FM_KG_KGAR_WRITE : (uint32_t)FM_KG_KGAR_READ;
+
+   return (uint32_t)(FM_KG_KGAR_GO | rw | FM_PCD_KG_KGAR_SEL_PORT_ENTRY |
+ hwport_id | FM_PCD_KG_KGAR_SEL_PORT_WSEL_CPP);
+}
+
+static void clear_pe_all_cls_plan(struct fman_kg_regs __iomem *regs,
+ 

[PATCH 6/7] soc/fman: Add the FMan RTC FLIB

2015-03-04 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 drivers/soc/fsl/fman/Kconfig|   6 +
 drivers/soc/fsl/fman/Makefile   |   1 +
 drivers/soc/fsl/fman/rtc/Makefile   |  13 ++
 drivers/soc/fsl/fman/rtc/fman_rtc.c | 354 
 4 files changed, 374 insertions(+)
 create mode 100644 drivers/soc/fsl/fman/rtc/Makefile
 create mode 100644 drivers/soc/fsl/fman/rtc/fman_rtc.c

diff --git a/drivers/soc/fsl/fman/Kconfig b/drivers/soc/fsl/fman/Kconfig
index 2559ee9..a144eb5 100644
--- a/drivers/soc/fsl/fman/Kconfig
+++ b/drivers/soc/fsl/fman/Kconfig
@@ -26,4 +26,10 @@ config FSL_FMAN_PCD
help
Freescale DPAA FMan Parse, Classify and Distribute support
 
+config FSL_FMAN_RTC
+   bool FMan RTC
+   default n
+   help
+   Freescale DPAA FMan Real Time Clock (PTP) support
+
 endif  # FSL_FMAN
diff --git a/drivers/soc/fsl/fman/Makefile b/drivers/soc/fsl/fman/Makefile
index dc37f35..f415188 100644
--- a/drivers/soc/fsl/fman/Makefile
+++ b/drivers/soc/fsl/fman/Makefile
@@ -13,5 +13,6 @@ fsl_fman-objs := fman.o
 obj-$(CONFIG_FSL_FMAN_PORT)+= port/
 obj-$(CONFIG_FSL_FMAN_MAC) += mac/
 obj-$(CONFIG_FSL_FMAN_PCD) += pcd/
+obj-$(CONFIG_FSL_FMAN_RTC) += rtc/
 
 endif
diff --git a/drivers/soc/fsl/fman/rtc/Makefile 
b/drivers/soc/fsl/fman/rtc/Makefile
new file mode 100644
index 000..69a92fb
--- /dev/null
+++ b/drivers/soc/fsl/fman/rtc/Makefile
@@ -0,0 +1,13 @@
+ccflags-y += -DVERSION=\\
+
+ifeq ($(CONFIG_FSL_FMAN_RTC),y)
+
+FMAN = $(srctree)/drivers/soc/fsl/fman
+
+ccflags-y += -I$(FMAN)/flib
+
+obj-$(CONFIG_FSL_FMAN_RTC) += fsl_fman_rtc.o
+
+fsl_fman_rtc-objs  := fman_rtc.o
+
+endif
diff --git a/drivers/soc/fsl/fman/rtc/fman_rtc.c 
b/drivers/soc/fsl/fman/rtc/fman_rtc.c
new file mode 100644
index 000..e6d6dae
--- /dev/null
+++ b/drivers/soc/fsl/fman/rtc/fman_rtc.c
@@ -0,0 +1,354 @@
+/*
+ * Copyright 2008-2015 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_fman_rtc.h
+
+void fman_rtc_defconfig(struct rtc_cfg *cfg)
+{
+   int i;
+
+   cfg-src_clk = DEFAULT_SRC_CLOCK;
+   cfg-invert_input_clk_phase = DEFAULT_INVERT_INPUT_CLK_PHASE;
+   cfg-invert_output_clk_phase = DEFAULT_INVERT_OUTPUT_CLK_PHASE;
+   cfg-pulse_realign = DEFAULT_PULSE_REALIGN;
+   for (i = 0; i  FMAN_RTC_MAX_NUM_OF_ALARMS; i++)
+   cfg-alarm_polarity[i] = DEFAULT_ALARM_POLARITY;
+   for (i = 0; i  FMAN_RTC_MAX_NUM_OF_EXT_TRIGGERS; i++)
+   cfg-trigger_polarity[i] = DEFAULT_TRIGGER_POLARITY;
+}
+
+uint32_t fman_rtc_get_events(struct rtc_regs __iomem *regs)
+{
+   return ioread32be(regs-tmr_tevent);
+}
+
+uint32_t fman_rtc_get_event(struct rtc_regs __iomem *regs, uint32_t ev_mask)
+{
+   return ioread32be(regs-tmr_tevent)  ev_mask;
+}
+
+uint32_t fman_rtc_get_interrupt_mask(struct rtc_regs __iomem *regs)
+{
+   return ioread32be(regs-tmr_temask);
+}
+
+void fman_rtc_set_interrupt_mask(struct rtc_regs __iomem *regs, uint32_t mask)
+{
+   iowrite32be(mask, regs-tmr_temask);
+}
+
+void fman_rtc_ack_event(struct rtc_regs __iomem *regs, uint32_t events)
+{
+   

[PATCH 4/7] soc/fman: Add the FMan MAC FLIB

2015-03-04 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 drivers/soc/fsl/fman/Kconfig  |   6 +
 drivers/soc/fsl/fman/Makefile |   7 +-
 drivers/soc/fsl/fman/mac/Makefile |  15 +
 drivers/soc/fsl/fman/mac/fman_crc32.c | 117 
 drivers/soc/fsl/fman/mac/fman_crc32.h |  40 ++
 drivers/soc/fsl/fman/mac/fman_dtsec.c | 844 ++
 drivers/soc/fsl/fman/mac/fman_dtsec_mii_acc.c | 169 ++
 drivers/soc/fsl/fman/mac/fman_memac.c | 504 +++
 drivers/soc/fsl/fman/mac/fman_memac_mii_acc.c | 218 +++
 drivers/soc/fsl/fman/mac/fman_tgec.c  | 372 
 10 files changed, 2289 insertions(+), 3 deletions(-)
 create mode 100644 drivers/soc/fsl/fman/mac/Makefile
 create mode 100644 drivers/soc/fsl/fman/mac/fman_crc32.c
 create mode 100644 drivers/soc/fsl/fman/mac/fman_crc32.h
 create mode 100644 drivers/soc/fsl/fman/mac/fman_dtsec.c
 create mode 100644 drivers/soc/fsl/fman/mac/fman_dtsec_mii_acc.c
 create mode 100644 drivers/soc/fsl/fman/mac/fman_memac.c
 create mode 100644 drivers/soc/fsl/fman/mac/fman_memac_mii_acc.c
 create mode 100644 drivers/soc/fsl/fman/mac/fman_tgec.c

diff --git a/drivers/soc/fsl/fman/Kconfig b/drivers/soc/fsl/fman/Kconfig
index a5f981f..c1c258c 100644
--- a/drivers/soc/fsl/fman/Kconfig
+++ b/drivers/soc/fsl/fman/Kconfig
@@ -14,4 +14,10 @@ config FSL_FMAN_PORT
help
Freescale DPAA FMan port support
 
+config FSL_FMAN_MAC
+   bool FMan MAC
+   default n
+   help
+   Freescale DPAA FMan MAC support
+
 endif  # FSL_FMAN
diff --git a/drivers/soc/fsl/fman/Makefile b/drivers/soc/fsl/fman/Makefile
index a0132cc..ffaabd9 100644
--- a/drivers/soc/fsl/fman/Makefile
+++ b/drivers/soc/fsl/fman/Makefile
@@ -6,10 +6,11 @@ FMAN = $(srctree)/drivers/soc/fsl/fman
 
 ccflags-y += -I$(FMAN)/flib
 
-obj-$(CONFIG_FSL_FMAN) += fsl_fman.o
+obj-$(CONFIG_FSL_FMAN) += fsl_fman.o
 
-fsl_fman-objs  := fman.o
+fsl_fman-objs  := fman.o
 
-obj-$(CONFIG_FSL_FMAN_PORT) += port/
+obj-$(CONFIG_FSL_FMAN_PORT)+= port/
+obj-$(CONFIG_FSL_FMAN_MAC) += mac/
 
 endif
diff --git a/drivers/soc/fsl/fman/mac/Makefile 
b/drivers/soc/fsl/fman/mac/Makefile
new file mode 100644
index 000..3188c46
--- /dev/null
+++ b/drivers/soc/fsl/fman/mac/Makefile
@@ -0,0 +1,15 @@
+ccflags-y += -DVERSION=\\
+
+ifeq ($(CONFIG_FSL_FMAN_MAC),y)
+
+FMAN = $(srctree)/drivers/soc/fsl/fman
+
+ccflags-y += -I$(FMAN)/flib
+
+obj-$(CONFIG_FSL_FMAN_MAC) += fsl_fman_mac.o
+
+fsl_fman_mac-objs  := fman_dtsec.o fman_dtsec_mii_acc.o\
+  fman_memac.o fman_tgec.o \
+  fman_crc32.o fman_memac_mii_acc.o
+
+endif
diff --git a/drivers/soc/fsl/fman/mac/fman_crc32.c 
b/drivers/soc/fsl/fman/mac/fman_crc32.c
new file mode 100644
index 000..2c85178
--- /dev/null
+++ b/drivers/soc/fsl/fman/mac/fman_crc32.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2008-2015 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 fman_crc32.h
+#include common/general.h
+
+/* precomputed CRC values for address hashing 

[PATCH 0/7] Freescale DPAA FMan FLIB(s)

2015-03-04 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

The Freescale Data Path Acceleration Architecture (DPAA) is a set of
hardware components on specific QorIQ P and T series multicore processors.
This architecture provides the infrastructure to support simplified
sharing of networking interfaces and accelerators by multiple CPU cores,
and the accelerators themselves.

One of the DPAA accelerators is the Frame Manager (FMan), which
combines the Ethernet network interfaces with packet distribution
logic to provide intelligent distribution and queuing decisions for
incoming traffic at line rate.

This patch presents the FMan Foundation Libraries (FLIB) headers.
The FMan FLIB suite adds basic support for the DPAA FMan hardware register 
access.
The FMan FLIB suite is used in Freescale's SDK Releases.

Igal Liberman (7):
  soc/fman: Add the FMan FLIB headers
  soc/fman: Add the FMan FLIB
  soc/fman: Add the FMan port FLIB
  soc/fman: Add the FMan MAC FLIB
  soc/fman: Add the FMan parser and KeyGen FLIB(s)
  soc/fman: Add the FMan RTC FLIB
  soc/fman: Add the FMan SP FLIB

 drivers/soc/Kconfig|1 +
 drivers/soc/Makefile   |1 +
 drivers/soc/fsl/Kconfig|1 +
 drivers/soc/fsl/Makefile   |1 +
 drivers/soc/fsl/fman/Kconfig   |   35 +
 drivers/soc/fsl/fman/Makefile  |   19 +
 drivers/soc/fsl/fman/flib/common/general.h |   45 +
 drivers/soc/fsl/fman/flib/fman_common.h|   74 +
 drivers/soc/fsl/fman/flib/fsl_enet.h   |  276 
 drivers/soc/fsl/fman/flib/fsl_fman.h   |  801 ++
 drivers/soc/fsl/fman/flib/fsl_fman_dtsec.h | 1017 +
 drivers/soc/fsl/fman/flib/fsl_fman_dtsec_mii_acc.h |  104 ++
 drivers/soc/fsl/fman/flib/fsl_fman_kg.h|  506 +++
 drivers/soc/fsl/fman/flib/fsl_fman_memac.h |  492 +++
 drivers/soc/fsl/fman/flib/fsl_fman_memac_mii_acc.h |   77 +
 drivers/soc/fsl/fman/flib/fsl_fman_port.h  |  602 
 drivers/soc/fsl/fman/flib/fsl_fman_prs.h   |  106 ++
 drivers/soc/fsl/fman/flib/fsl_fman_rtc.h   |  415 ++
 drivers/soc/fsl/fman/flib/fsl_fman_sp.h|  133 ++
 drivers/soc/fsl/fman/flib/fsl_fman_tgec.h  |  484 ++
 drivers/soc/fsl/fman/fman.c| 1396 ++
 drivers/soc/fsl/fman/mac/Makefile  |   15 +
 drivers/soc/fsl/fman/mac/fman_crc32.c  |  117 ++
 drivers/soc/fsl/fman/mac/fman_crc32.h  |   40 +
 drivers/soc/fsl/fman/mac/fman_dtsec.c  |  844 +++
 drivers/soc/fsl/fman/mac/fman_dtsec_mii_acc.c  |  169 +++
 drivers/soc/fsl/fman/mac/fman_memac.c  |  504 +++
 drivers/soc/fsl/fman/mac/fman_memac_mii_acc.c  |  218 +++
 drivers/soc/fsl/fman/mac/fman_tgec.c   |  372 +
 drivers/soc/fsl/fman/pcd/Makefile  |   13 +
 drivers/soc/fsl/fman/pcd/fman_kg.c |  850 +++
 drivers/soc/fsl/fman/pcd/fman_prs.c|  127 ++
 drivers/soc/fsl/fman/port/Makefile |   13 +
 drivers/soc/fsl/fman/port/fman_port.c  | 1536 
 drivers/soc/fsl/fman/rtc/Makefile  |   13 +
 drivers/soc/fsl/fman/rtc/fman_rtc.c|  354 +
 drivers/soc/fsl/fman/sp/Makefile   |   13 +
 drivers/soc/fsl/fman/sp/fman_sp.c  |  204 +++
 38 files changed, 11988 insertions(+)
 create mode 100644 drivers/soc/fsl/Kconfig
 create mode 100644 drivers/soc/fsl/Makefile
 create mode 100644 drivers/soc/fsl/fman/Kconfig
 create mode 100644 drivers/soc/fsl/fman/Makefile
 create mode 100644 drivers/soc/fsl/fman/flib/common/general.h
 create mode 100644 drivers/soc/fsl/fman/flib/fman_common.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_enet.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_dtsec.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_dtsec_mii_acc.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_kg.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_memac.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_memac_mii_acc.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_port.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_prs.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_rtc.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_sp.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_tgec.h
 create mode 100644 drivers/soc/fsl/fman/fman.c
 create mode 100644 drivers/soc/fsl/fman/mac/Makefile
 create mode 100644 drivers/soc/fsl/fman/mac/fman_crc32.c
 create mode 100644 drivers/soc/fsl/fman/mac/fman_crc32.h
 create mode 100644 drivers/soc/fsl/fman/mac/fman_dtsec.c
 create mode 100644 drivers/soc/fsl/fman/mac/fman_dtsec_mii_acc.c
 create mode 100644 

Re: [PATCH] powerpc/mpc85xx: Add MDIO bus muxing support to the board device tree(s)

2015-03-02 Thread Emil Medve
Hello Scott,


On 03/02/2015 09:32 AM, Emil Medve wrote:
 From: Igal Liberman igal.liber...@freescale.com
 
 Describe the PHY topology for all configurations supported by each board
 
 Based on prior work by Andy Fleming aflem...@gmail.com
 
 Change-Id: I4fbcc5df9ee7c4f784afae9dab5d1e78cdc24f0f

Bah, I'll remove this...

 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
 Signed-off-by: Emil Medve emilian.me...@freescale.com
 ---
  arch/powerpc/boot/dts/b4860qds.dts|  60 -
  arch/powerpc/boot/dts/b4qds.dtsi  |  51 -
  arch/powerpc/boot/dts/p1023rdb.dts|  24 +-
  arch/powerpc/boot/dts/p2041rdb.dts|  92 +++-
  arch/powerpc/boot/dts/p3041ds.dts | 112 +-
  arch/powerpc/boot/dts/p4080ds.dts | 184 +++-
  arch/powerpc/boot/dts/p5020ds.dts | 112 +-
  arch/powerpc/boot/dts/p5040ds.dts | 234 +++-
  arch/powerpc/boot/dts/t1040rdb.dts|  32 ++-
  arch/powerpc/boot/dts/t1042rdb.dts|  30 ++-
  arch/powerpc/boot/dts/t1042rdb_pi.dts |  18 +-
  arch/powerpc/boot/dts/t104xqds.dtsi   | 178 ++-
  arch/powerpc/boot/dts/t104xrdb.dtsi   |  33 ++-
  arch/powerpc/boot/dts/t2080qds.dts| 158 +-
  arch/powerpc/boot/dts/t2080rdb.dts|  67 +-
  arch/powerpc/boot/dts/t2081qds.dts| 221 ++-
  arch/powerpc/boot/dts/t4240qds.dts| 400 
 +-
  arch/powerpc/boot/dts/t4240rdb.dts| 149 -
  18 files changed, 2135 insertions(+), 20 deletions(-)


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/mpc85xx: Add MDIO bus muxing support to the board device tree(s)

2015-03-02 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Describe the PHY topology for all configurations supported by each board

Based on prior work by Andy Fleming aflem...@gmail.com

Change-Id: I4fbcc5df9ee7c4f784afae9dab5d1e78cdc24f0f
Signed-off-by: Igal Liberman igal.liber...@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/boot/dts/b4860qds.dts|  60 -
 arch/powerpc/boot/dts/b4qds.dtsi  |  51 -
 arch/powerpc/boot/dts/p1023rdb.dts|  24 +-
 arch/powerpc/boot/dts/p2041rdb.dts|  92 +++-
 arch/powerpc/boot/dts/p3041ds.dts | 112 +-
 arch/powerpc/boot/dts/p4080ds.dts | 184 +++-
 arch/powerpc/boot/dts/p5020ds.dts | 112 +-
 arch/powerpc/boot/dts/p5040ds.dts | 234 +++-
 arch/powerpc/boot/dts/t1040rdb.dts|  32 ++-
 arch/powerpc/boot/dts/t1042rdb.dts|  30 ++-
 arch/powerpc/boot/dts/t1042rdb_pi.dts |  18 +-
 arch/powerpc/boot/dts/t104xqds.dtsi   | 178 ++-
 arch/powerpc/boot/dts/t104xrdb.dtsi   |  33 ++-
 arch/powerpc/boot/dts/t2080qds.dts| 158 +-
 arch/powerpc/boot/dts/t2080rdb.dts|  67 +-
 arch/powerpc/boot/dts/t2081qds.dts| 221 ++-
 arch/powerpc/boot/dts/t4240qds.dts| 400 +-
 arch/powerpc/boot/dts/t4240rdb.dts| 149 -
 18 files changed, 2135 insertions(+), 20 deletions(-)

diff --git a/arch/powerpc/boot/dts/b4860qds.dts 
b/arch/powerpc/boot/dts/b4860qds.dts
index 6bb3707..98b1ef4 100644
--- a/arch/powerpc/boot/dts/b4860qds.dts
+++ b/arch/powerpc/boot/dts/b4860qds.dts
@@ -1,7 +1,7 @@
 /*
  * B4860DS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -39,12 +39,69 @@
model = fsl,B4860QDS;
compatible = fsl,B4860QDS;
 
+   aliases {
+   phy_sgmii_1e = phy_sgmii_1e;
+   phy_sgmii_1f = phy_sgmii_1f;
+   phy_xaui_slot1 = phy_xaui_slot1;
+   phy_xaui_slot2 = phy_xaui_slot2;
+   };
+
ifc: localbus@ffe124000 {
board-control@3,0 {
compatible = fsl,b4860qds-fpga, fsl,fpga-qixis;
};
};
 
+   soc@ffe00 {
+   fman@40 {
+   ethernet@e8000 {
+   phy-handle = phy_sgmii_1e;
+   phy-connection-type = sgmii;
+   };
+
+   ethernet@ea000 {
+   phy-handle = phy_sgmii_1f;
+   phy-connection-type = sgmii;
+   };
+
+   ethernet@f {
+   phy-handle = phy_xaui_slot1;
+   phy-connection-type = xgmii;
+   };
+
+   ethernet@f2000 {
+   phy-handle = phy_xaui_slot2;
+   phy-connection-type = xgmii;
+   };
+
+   mdio@fc000 {
+   phy_sgmii_1e: ethernet-phy@1e {
+   reg = 0x1e;
+   status = disabled;
+   };
+
+   phy_sgmii_1f: ethernet-phy@1f {
+   reg = 0x1f;
+   status = disabled;
+   };
+   };
+
+   mdio@fd000 {
+   phy_xaui_slot1: xaui-phy@slot1 {
+   compatible = 
ethernet-phy-ieee802.3-c45;
+   reg = 0x7;
+   status = disabled;
+   };
+
+   phy_xaui_slot2: xaui-phy@slot2 {
+   compatible = 
ethernet-phy-ieee802.3-c45;
+   reg = 0x6;
+   status = disabled;
+   };
+   };
+   };
+   };
+
rio: rapidio@ffe0c {
reg = 0xf 0xfe0c 0 0x11000;
 
@@ -55,7 +112,6 @@
ranges = 0 0 0xc 0x3000 0 0x1000;
};
};
-
 };
 
 /include/ fsl/b4860si-post.dtsi
diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index 559d006..6ef6933 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420DS Device Tree Source
  *
- * Copyright 2012 - 2014 Freescale Semiconductor, Inc

[v5 2/2] powerpc/corenet: Enable muxing MDIO buses via FPGA

2015-02-27 Thread Emil Medve
From: Shruti Kanetkar kanetkar.shr...@gmail.com

Signed-off-by: Andy Fleming aflem...@gmail.com
Signed-off-by: Shaohui Xie shaohui@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v5: Remove 'Change-Id'

v4: Add 'Signed-off-by'

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370873
Also supersedes http://patchwork.ozlabs.org/patch/423348
Update via 'savedefconfig'
Auto-probe devices on 'fsl,fpga-qixis'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 1 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 6 ++
 3 files changed, 8 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 44e53a4..5242355 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -100,6 +100,7 @@ CONFIG_AT803X_PHY=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 724e579..c1cb6e9 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -86,6 +86,7 @@ CONFIG_E1000E=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 0804b10..63bef30 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -91,6 +91,12 @@ static const struct of_device_id of_device_ids[] = {
.compatible = mdio-mux-gpio
},
{
+   .compatible = fsl,fpga-ngpixis
+   },
+   {
+   .compatible = fsl,fpga-qixis
+   },
+   {
.compatible = fsl,srio,
},
{
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[v7 1/2] powerpc/mpc85xx: Add FSL QorIQ DPAA BMan support to device tree(s)

2015-02-27 Thread Emil Medve
From: Kumar Gala ga...@kernel.crashing.org

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
Signed-off-by: Chunhe Lan chunhe@freescale.com
Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v7: Remove 'Change-Id'

v6: Rebase

 arch/powerpc/boot/dts/b4qds.dtsi|  17 +-
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  60 ++-
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi|  89 +-
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  37 +++-
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  65 ++-
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 105 ++-
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 265 +++-
 arch/powerpc/boot/dts/kmcoge4.dts   |  15 ++
 arch/powerpc/boot/dts/oca4080.dts   |  15 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  18 +-
 arch/powerpc/boot/dts/p2041rdb.dts  |  17 +-
 arch/powerpc/boot/dts/p3041ds.dts   |  17 +-
 arch/powerpc/boot/dts/p4080ds.dts   |  17 +-
 arch/powerpc/boot/dts/p5020ds.dts   |  17 +-
 arch/powerpc/boot/dts/p5040ds.dts   |  17 +-
 arch/powerpc/boot/dts/t104xqds.dtsi |  17 +-
 arch/powerpc/boot/dts/t104xrdb.dtsi |  14 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  17 +-
 arch/powerpc/boot/dts/t208xrdb.dtsi |  15 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  17 +-
 arch/powerpc/boot/dts/t4240rdb.dts  |  15 ++
 26 files changed, 899 insertions(+), 22 deletions(-)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index e5bde0b..24ed80d 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420DS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -97,10 +97,25 @@
device_type = memory;
};
 
+   reserved-memory {
+   #address-cells = 2;
+   #size-cells = 2;
+   ranges;
+
+   bman_fbpr: bman-fbpr {
+   size = 0 0x100;
+   alignment = 0 0x100;
+   };
+   };
+
dcsr: dcsr@f {
ranges = 0x 0xf 0x 0x01052000;
};
 
+   bportals: bman-portals@ff400 {
+   ranges = 0x0 0xf 0xf400 0x200;
+   };
+
soc: soc@ffe00 {
ranges = 0x 0xf 0xfe00 0x100;
reg = 0xf 0xfe00 0 0x1000;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index d0a5cde..68b9a05 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4860 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -109,6 +109,64 @@
};
 };
 
+bportals {
+   bman-portal@38000 {
+   compatible = fsl,bman-portal;
+   reg = 0x38000 0x4000, 0x100e000 0x1000;
+   interrupts = 133 2 0 0;
+   };
+   bman-portal@3c000 {
+   compatible = fsl,bman-portal;
+   reg = 0x3c000 0x4000, 0x100f000 0x1000;
+   interrupts = 135 2 0 0;
+   };
+   bman-portal@4 {
+   compatible = fsl,bman-portal;
+   reg = 0x4 0x4000, 0x101 0x1000;
+   interrupts = 137 2 0 0;
+   };
+   bman-portal@44000 {
+   compatible = fsl,bman-portal;
+   reg = 0x44000 0x4000, 0x1011000 0x1000;
+   interrupts = 139 2 0 0;
+   };
+   bman-portal@48000 {
+   compatible = fsl,bman-portal;
+   reg = 0x48000 0x4000, 0x1012000 0x1000;
+   interrupts = 141 2 0 0;
+   };
+   bman-portal@4c000 {
+   compatible = fsl,bman-portal;
+   reg = 0x4c000 0x4000, 0x1013000 0x1000;
+   interrupts = 143 2 0 0;
+   };
+   bman-portal@5 {
+   compatible = fsl,bman-portal

[v5 1/2] powerpc/corenet: Enable muxing MDIO buses via GPIO

2015-02-27 Thread Emil Medve
From: Andy Fleming aflem...@gmail.com

Signed-off-by: Andy Fleming aflem...@gmail.com
Signed-off-by: Shaohui Xie shaohui@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v5: Remove 'Change-Id'

v4: Add 'Signed-off-by'

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370871
Also supersedes http://patchwork.ozlabs.org/patch/423350
Update via 'savedefconfig'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 1 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index ca7957b..44e53a4 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -99,6 +99,7 @@ CONFIG_E1000E=y
 CONFIG_AT803X_PHY=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 04737aa..724e579 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -85,6 +85,7 @@ CONFIG_FSL_XGMAC_MDIO=y
 CONFIG_E1000E=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 1f309cc..0804b10 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -88,6 +88,9 @@ static const struct of_device_id of_device_ids[] = {
.compatible = simple-bus
},
{
+   .compatible = mdio-mux-gpio
+   },
+   {
.compatible = fsl,srio,
},
{
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[v7 2/2] powerpc/mpc85xx: Add FSL QorIQ DPAA QMan support to device tree(s)

2015-02-27 Thread Emil Medve
From: Kumar Gala ga...@kernel.crashing.org

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
Signed-off-by: Chunhe Lan chunhe@freescale.com
Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v7: Remove 'Change-Id'

v6: Rebase

 arch/powerpc/boot/dts/b4qds.dtsi|  12 ++
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  69 ++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi| 106 ++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  43 
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  78 +++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 126 +++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 318 
 arch/powerpc/boot/dts/kmcoge4.dts   |  12 ++
 arch/powerpc/boot/dts/oca4080.dts   |  12 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p2041rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p3041ds.dts   |  12 ++
 arch/powerpc/boot/dts/p4080ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5020ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5040ds.dts   |  12 ++
 arch/powerpc/boot/dts/t104xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t104xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  12 ++
 arch/powerpc/boot/dts/t4240rdb.dts  |  12 ++
 26 files changed, 985 insertions(+)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index 24ed80d..559d006 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -106,6 +106,14 @@
size = 0 0x100;
alignment = 0 0x100;
};
+   qman_fqd: qman-fqd {
+   size = 0 0x40;
+   alignment = 0 0x40;
+   };
+   qman_pfdr: qman-pfdr {
+   size = 0 0x200;
+   alignment = 0 0x200;
+   };
};
 
dcsr: dcsr@f {
@@ -116,6 +124,10 @@
ranges = 0x0 0xf 0xf400 0x200;
};
 
+   qportals: qman-portals@ff600 {
+   ranges = 0x0 0xf 0xf600 0x200;
+   };
+
soc: soc@ffe00 {
ranges = 0x 0xf 0xfe00 0x100;
reg = 0xf 0xfe00 0 0x1000;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index 68b9a05..02ccde6 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -167,6 +167,75 @@
};
 };
 
+qportals {
+   qportal14: qman-portal@38000 {
+   compatible = fsl,qman-portal;
+   reg = 0x38000 0x4000, 0x100e000 0x1000;
+   interrupts = 132 0x2 0 0;
+   fsl,qman-channel-id = 0xe;
+   };
+   qportal15: qman-portal@3c000 {
+   compatible = fsl,qman-portal;
+   reg = 0x3c000 0x4000, 0x100f000 0x1000;
+   interrupts = 134 0x2 0 0;
+   fsl,qman-channel-id = 0xf;
+   };
+   qportal16: qman-portal@4 {
+   compatible = fsl,qman-portal;
+   reg = 0x4 0x4000, 0x101 0x1000;
+   interrupts = 136 0x2 0 0;
+   fsl,qman-channel-id = 0x10;
+   };
+   qportal17: qman-portal@44000 {
+   compatible = fsl,qman-portal;
+   reg = 0x44000 0x4000, 0x1011000 0x1000;
+   interrupts = 138 0x2 0 0;
+   fsl,qman-channel-id = 0x11;
+   };
+   qportal18: qman-portal@48000 {
+   compatible = fsl,qman-portal;
+   reg = 0x48000 0x4000, 0x1012000 0x1000;
+   interrupts = 140 0x2 0 0;
+   fsl,qman-channel-id = 0x12;
+   };
+   qportal19: qman-portal@4c000 {
+   compatible = fsl,qman-portal;
+   reg = 0x4c000 0x4000, 0x1013000 0x1000;
+   interrupts = 142 0x2 0 0;
+   fsl,qman-channel-id = 0x13;
+   };
+   qportal20: qman-portal@5 {
+   compatible = fsl,qman-portal;
+   reg = 0x5 0x4000, 0x1014000 0x1000;
+   interrupts = 144 0x2 0 0;
+   fsl,qman-channel-id = 0x14;
+   };
+   qportal21: qman-portal@54000 {
+   compatible = fsl,qman-portal

[PATCH 2/3] powerpc/mpc85xx: Create dts components for the FSL QorIQ DPAA FMan

2015-02-26 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Based on prior work by Andy Fleming aflem...@gmail.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-0.dtsi   |  69 ++
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-1.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-2.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-3.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-4.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-0.dtsi| 101 
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-10g-0.dtsi  |  61 
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-0.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-1.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-2.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-3.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-4.dtsi   |  68 +
 arch/powerpc/boot/dts/fsl/qoriq-fman-1.dtsi| 101 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi |  61 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi |  61 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-0.dtsi   | 106 +
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi |  61 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi |  61 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi  |  62 
 arch/powerpc/boot/dts/fsl/qoriq-fman3-1.dtsi   | 106 +
 32 files changed, 2206 insertions(+)
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-2.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-3.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0-1g-4.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-10g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-2.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-3.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1-1g-4.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-fman3-1.dtsi

diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi 
b/arch/powerpc/boot/dts/fsl/qoriq-fman-0-10g-0.dtsi
new file mode 100644
index 000

[PATCH 3/3] powerpc/mpc85xx: Add FSL QorIQ DPAA FMan support to the SoC device tree(s)

2015-02-26 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Based on prior work by Andy Fleming aflem...@gmail.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi  |   9 ++-
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  20 -
 arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi  |  12 ++-
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi|  31 +++-
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi | 115 +++-
 arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi  |   5 +-
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  29 ++-
 arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi  |  10 ++-
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  29 ++-
 arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi  |  10 ++-
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  48 +++-
 arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi  |  15 +++-
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  29 ++-
 arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi  |  10 ++-
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  56 +-
 arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi  |  17 +++-
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  31 
 arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi  |   9 ++-
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi |  43 +++
 arch/powerpc/boot/dts/fsl/t208xsi-pre.dtsi  |  11 +++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi |  88 -
 arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi  |  22 +-
 22 files changed, 629 insertions(+), 20 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi 
b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
index 338af7e..70e2096 100644
--- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420 Silicon/SoC Device Tree Source (pre include)
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2015 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -54,8 +54,13 @@
dma0 = dma0;
dma1 = dma1;
sdhc = sdhc;
-   };
 
+   fman0 = fman0;
+   ethernet0 = enet0;
+   ethernet1 = enet1;
+   ethernet2 = enet2;
+   ethernet3 = enet3;
+   };
 
cpus {
#address-cells = 1;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index 02ccde6..006e95c 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4860 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 - 2014 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -260,6 +260,24 @@
compatible = fsl,b4860-rcpm, fsl,qoriq-rcpm-2.0;
};
 
+/include/ qoriq-fman3-0-1g-4.dtsi
+/include/ qoriq-fman3-0-1g-5.dtsi
+/include/ qoriq-fman3-0-10g-0.dtsi
+/include/ qoriq-fman3-0-10g-1.dtsi
+   fman@40 {
+   enet4: ethernet@e8000 {
+   };
+
+   enet5: ethernet@ea000 {
+   };
+
+   enet6: ethernet@f {
+   };
+
+   enet7: ethernet@f2000 {
+   };
+   };
+
L2: l2-cache-controller@c2 {
compatible = fsl,b4860-l2-cache-controller;
};
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
index 1948f73..0fbda72 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4860 Silicon/SoC Device Tree Source (pre include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -54,6 +54,16 @@
dma0 = dma0;
dma1 = dma1;
sdhc = sdhc;
+
+   fman0 = fman0;
+   ethernet0 = enet0;
+   ethernet1 = enet1;
+   ethernet2 = enet2;
+   ethernet3 = enet3;
+   ethernet4 = enet4;
+   ethernet5 = enet5;
+   ethernet6 = enet6;
+   ethernet7 = enet7;
};
 
 
diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
index 38621ef..b2ff0cb 100644
--- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi

[PATCH 1/3] powerpc/mpc85xx: Add FMan clock nodes

2015-02-26 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi| 11 +++
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  8 
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  8 
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi | 16 
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi | 13 +
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi | 26 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  8 
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 11 +++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 20 
 9 files changed, 121 insertions(+)

diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
index f8c325e..38621ef 100644
--- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
@@ -395,6 +395,17 @@
reg = 0xe 0xe00;
fsl,has-rstcr;
fsl,liodn-bits = 12;
+
+   fm0clk: fm0-clk-mux {
+   #clock-cells = 0;
+   compatible = fsl,fman-clk-mux;
+   clocks = pll0 0, pll0 1, pll0 2, pll0 3,
+platform_pll 0, pll1 1, pll1 2;
+   clock-names = pll0, pll0-div2, pll0-div3,
+ pll0-div4, platform-pll, pll1-div2,
+ pll1-div3;
+   clock-output-names = fm0-clk;
+   };
};
 
 /include/ qoriq-clockgen2.dtsi
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
index 1f18b8b..60f63dc 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
@@ -316,6 +316,14 @@
fsl,has-rstcr;
#sleep-cells = 1;
fsl,liodn-bits = 12;
+
+   fm0clk: fm0-clk-mux {
+   #clock-cells = 0;
+   compatible = fsl,fman-clk-mux;
+   clocks = platform_pll 1, pll1 1;
+   clock-names = platform-pll-div2, pll1-div2;
+   clock-output-names = fm0-clk;
+   };
};
 
pins: global-utilities@e0e00 {
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
index a555d24..d4e6677 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
@@ -343,6 +343,14 @@
fsl,has-rstcr;
#sleep-cells = 1;
fsl,liodn-bits = 12;
+
+   fm0clk: fm0-clk-mux {
+   #clock-cells = 0;
+   compatible = fsl,fman-clk-mux;
+   clocks = platform_pll 1, pll1 1;
+   clock-names = platform-pll-div2, pll1-div2;
+   clock-output-names = fm0-clk;
+   };
};
 
pins: global-utilities@e0e00 {
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
index 0fe7281..d1cb691 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -363,6 +363,22 @@
fsl,has-rstcr;
#sleep-cells = 1;
fsl,liodn-bits = 12;
+
+   fm0clk: fm0-clk-mux {
+   #clock-cells = 0;
+   compatible = fsl,fman-clk-mux;
+   clocks = platform_pll 1, pll2 1;
+   clock-names = platform-pll-div2, pll2-div2;
+   clock-output-names = fm0-clk;
+   };
+
+   fm1clk: fm1-clk-mux {
+   #clock-cells = 0;
+   compatible = fsl,fman-clk-mux;
+   clocks = platform_pll 1, pll2 1;
+   clock-names = platform-pll-div2, pll2-div2;
+   clock-output-names = fm1-clk;
+   };
};
 
pins: global-utilities@e0e00 {
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
index a34ca20..9f3049d 100644
--- a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
@@ -348,6 +348,15 @@
fsl,has-rstcr;
#sleep-cells = 1;
fsl,liodn-bits = 12;
+
+   fm0clk: fm0-clk-mux {
+   #clock-cells = 0;
+   compatible = fsl,fman-clk-mux;
+   clocks = platform_pll 1, pll1 1, pll1 2;
+   clock-names = platform-pll-div2, pll1-div2,
+ pll1-div4;
+   clock-output-names = fm0-clk;
+   };
};
 
pins: 

Re: [PATCH][v3] powerpc/mpc85xx: Add FMan platform support

2015-02-23 Thread Emil Medve
Hello Scott,


On 02/23/2015 04:01 PM, Scott Wood wrote:
 On Wed, 2015-02-18 at 16:04 +0200, Igal.Liberman wrote:
 From: Igal Liberman igal.liber...@freescale.com

 Get the FMan devices/sub-nodes (MAC, MDIO, etc.) auto-probed

 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 ---
  arch/powerpc/platforms/85xx/common.c  |1 +
  arch/powerpc/platforms/85xx/corenet_generic.c |3 +++
  2 files changed, 4 insertions(+)
 
 What changed from v2?

v1,2 were based on an internal tree/branch and had some reference to
'fsl,dpaa':

   { .compatible = fsl,dpaa, },


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC v2 01/10] fsl_bman: Add drivers for the Freescale DPAA BMan

2015-02-18 Thread Emil Medve
Hello Kumar,


Thanks for taking the time to review this

On 02/18/2015 11:43 AM, Kumar Gala wrote:
 On Feb 16, 2015, at 9:46 AM, Emil Medve emilian.me...@freescale.com wrote:
 
 From: Geoff Thorpe geoff.tho...@freescale.com

 Change-Id: I075944acf740dbaae861104c17a9ff7247dec1be
 Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
 ---
 drivers/soc/Kconfig  |1 +
 drivers/soc/Makefile |1 +
 drivers/soc/freescale/Kconfig|   51 ++
 drivers/soc/freescale/Makefile   |7 +
 drivers/soc/freescale/bman.c |  611 
 drivers/soc/freescale/bman.h |  524 +
 drivers/soc/freescale/bman_api.c | 1033 
 ++
 drivers/soc/freescale/bman_portal.c  |  330 +++
 drivers/soc/freescale/bman_priv.h|  149 +
 drivers/soc/freescale/dpaa_alloc.c   |  404 +
 drivers/soc/freescale/dpaa_sys.h |  235 
 drivers/soc/freescale/qbman_driver.c |   41 ++
 include/linux/fsl_bman.h |  511 +
 
 If you are using drivers/soc than the include should probably be 
 include/soc/freescale/

Will move/rename

 Also, any reason you guys aren’t using drivers/soc/fsl ?

Will rename


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v2 03/10] powerpc/mpc85xx: Add platform support for the Freescale DPAA BMan

2015-02-16 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I59de17c040cdd304f86306336fcf89f130f7db2d
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 arch/powerpc/Kconfig  |  5 +
 arch/powerpc/configs/mpc85xx_defconfig|  1 +
 arch/powerpc/configs/mpc85xx_smp_defconfig|  1 +
 arch/powerpc/platforms/85xx/Kconfig   |  1 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 16 
 arch/powerpc/platforms/85xx/p1023_rdb.c   | 14 ++
 6 files changed, 38 insertions(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 7258b468..6ab5ad5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -779,6 +779,11 @@ config FSL_GTM
help
  Freescale General-purpose Timers support
 
+config HAS_FSL_QBMAN
+   bool Datapath Acceleration Queue and Buffer management
+   help
+ Datapath Acceleration Queue and Buffer management
+
 # Yes MCA RS/6000s exist but Linux-PPC does not currently support any
 config MCA
bool
diff --git a/arch/powerpc/configs/mpc85xx_defconfig 
b/arch/powerpc/configs/mpc85xx_defconfig
index 8496389..aa7e41f 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -49,6 +49,7 @@ CONFIG_HIGHMEM=y
 CONFIG_BINFMT_MISC=m
 CONFIG_MATH_EMULATION=y
 CONFIG_FORCE_MAX_ZONEORDER=12
+CONFIG_HAS_FSL_QBMAN=y
 CONFIG_PCI=y
 CONFIG_PCIEPORTBUS=y
 # CONFIG_PCIEASPM is not set
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig 
b/arch/powerpc/configs/mpc85xx_smp_defconfig
index bf88caf..82feda1 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -50,6 +50,7 @@ CONFIG_HIGHMEM=y
 CONFIG_BINFMT_MISC=m
 CONFIG_MATH_EMULATION=y
 CONFIG_FORCE_MAX_ZONEORDER=12
+CONFIG_HAS_FSL_QBMAN=y
 CONFIG_PCI=y
 CONFIG_PCI_MSI=y
 CONFIG_RAPIDIO=y
diff --git a/arch/powerpc/platforms/85xx/Kconfig 
b/arch/powerpc/platforms/85xx/Kconfig
index dbdd5fa..51e9a7b 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -276,6 +276,7 @@ config CORENET_GENERIC
select GPIO_MPC8XXX
select HAS_RAPIDIO
select PPC_EPAPR_HV_PIC
+   select HAS_FSL_QBMAN
help
  This option enables support for the FSL CoreNet based boards.
  For 32bit kernel, the following boards are supported:
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 63bef30..74faab7 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -197,6 +197,21 @@ static int __init corenet_generic_probe(void)
return 0;
 }
 
+/* Early setup is required for large chunks of contiguous (and 
coarsely-aligned)
+ * memory. The following shoe-horns Bman init_early calls into the
+ * platform setup to let them parse their CCSR nodes early on.
+ */
+#ifdef CONFIG_FSL_BMAN_CONFIG
+void __init bman_init_early(void);
+#endif
+
+__init void corenet_ds_init_early(void)
+{
+#ifdef CONFIG_FSL_BMAN_CONFIG
+   bman_init_early();
+#endif
+}
+
 define_machine(corenet_generic) {
.name   = CoreNet Generic,
.probe  = corenet_generic_probe,
@@ -215,6 +230,7 @@ define_machine(corenet_generic) {
 #else
.power_save = e500_idle,
 #endif
+   .init_early = corenet_ds_init_early,
 };
 
 machine_arch_initcall(corenet_generic, corenet_gen_publish_devices);
diff --git a/arch/powerpc/platforms/85xx/p1023_rdb.c 
b/arch/powerpc/platforms/85xx/p1023_rdb.c
index d5b7509..624d3d6 100644
--- a/arch/powerpc/platforms/85xx/p1023_rdb.c
+++ b/arch/powerpc/platforms/85xx/p1023_rdb.c
@@ -103,7 +103,20 @@ static int __init p1023_rdb_probe(void)
unsigned long root = of_get_flat_dt_root();
 
return of_flat_dt_is_compatible(root, fsl,P1023RDB);
+}
+
+/* Early setup is required for large chunks of contiguous (and 
coarsely-aligned)
+ * memory. The following shoe-horns Bman init_early calls into the
+ * platform setup to let them parse their CCSR nodes early on. */
+#ifdef CONFIG_FSL_BMAN_CONFIG
+void __init bman_init_early(void);
+#endif
 
+static __init void p1023_rdb_init_early(void)
+{
+#ifdef CONFIG_FSL_BMAN_CONFIG
+   bman_init_early();
+#endif
 }
 
 define_machine(p1023_rdb) {
@@ -119,4 +132,5 @@ define_machine(p1023_rdb) {
.pcibios_fixup_bus  = fsl_pcibios_fixup_bus,
.pcibios_fixup_phb  = fsl_pcibios_fixup_phb,
 #endif
+   .init_early = p1023_rdb_init_early,
 };
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v2 04/10] powerpc/mpc85xx: Add platform support for the Freescale DPAA QMan

2015-02-16 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I59de17c040cdd304f86306336fcf89f130f7db2d
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 arch/powerpc/platforms/85xx/corenet_generic.c | 8 +++-
 arch/powerpc/platforms/85xx/p1023_rdb.c   | 8 +++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 74faab7..20b8f9a 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -198,15 +198,21 @@ static int __init corenet_generic_probe(void)
 }
 
 /* Early setup is required for large chunks of contiguous (and 
coarsely-aligned)
- * memory. The following shoe-horns Bman init_early calls into the
+ * memory. The following shoe-horns Q/Bman init_early calls into the
  * platform setup to let them parse their CCSR nodes early on.
  */
+#ifdef CONFIG_FSL_QMAN_CONFIG
+void __init qman_init_early(void);
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
 void __init bman_init_early(void);
 #endif
 
 __init void corenet_ds_init_early(void)
 {
+#ifdef CONFIG_FSL_QMAN_CONFIG
+   qman_init_early();
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
bman_init_early();
 #endif
diff --git a/arch/powerpc/platforms/85xx/p1023_rdb.c 
b/arch/powerpc/platforms/85xx/p1023_rdb.c
index 624d3d6..dc69801 100644
--- a/arch/powerpc/platforms/85xx/p1023_rdb.c
+++ b/arch/powerpc/platforms/85xx/p1023_rdb.c
@@ -106,14 +106,20 @@ static int __init p1023_rdb_probe(void)
 }
 
 /* Early setup is required for large chunks of contiguous (and 
coarsely-aligned)
- * memory. The following shoe-horns Bman init_early calls into the
+ * memory. The following shoe-horns Q/Bman init_early calls into the
  * platform setup to let them parse their CCSR nodes early on. */
+#ifdef CONFIG_FSL_QMAN_CONFIG
+void __init qman_init_early(void);
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
 void __init bman_init_early(void);
 #endif
 
 static __init void p1023_rdb_init_early(void)
 {
+#ifdef CONFIG_FSL_QMAN_CONFIG
+   qman_init_early();
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
bman_init_early();
 #endif
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v2 06/10] fsl_qman: Add self-tester

2015-02-16 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I314d36d94717cfc34053b6212899f71cb729d16c
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/soc/freescale/Kconfig  |  26 +-
 drivers/soc/freescale/Makefile |   4 +
 drivers/soc/freescale/bman_test.c  |   2 +-
 drivers/soc/freescale/{bman_test.c = qman_test.c} |  15 +-
 drivers/soc/freescale/{bman_test.c = qman_test.h} |  33 +-
 drivers/soc/freescale/qman_test_api.c  | 213 +
 drivers/soc/freescale/qman_test_stash.c| 497 +
 7 files changed, 758 insertions(+), 32 deletions(-)
 copy drivers/soc/freescale/{bman_test.c = qman_test.c} (91%)
 copy drivers/soc/freescale/{bman_test.c = qman_test.h} (81%)
 create mode 100644 drivers/soc/freescale/qman_test_api.c
 create mode 100644 drivers/soc/freescale/qman_test_stash.c

diff --git a/drivers/soc/freescale/Kconfig b/drivers/soc/freescale/Kconfig
index 6786b94..001999e 100644
--- a/drivers/soc/freescale/Kconfig
+++ b/drivers/soc/freescale/Kconfig
@@ -53,7 +53,7 @@ config FSL_BMAN_TEST
---help---
  This option compiles self-test code for BMan.
 
-config FSL_BMAN_TEST_HIGH
+config FSL_BMAN_TEST_API
bool BMan high-level self-test
depends on FSL_BMAN_TEST
default y
@@ -93,6 +93,30 @@ config FSL_QMAN_CONFIG
  linux image is running as a guest OS under the hypervisor, only one
  guest OS (the control plane) needs this option.
 
+config FSL_QMAN_TEST
+   tristate QMan self-tests
+   default n
+   ---help---
+ This option compiles self-test code for QMan.
+
+config FSL_QMAN_TEST_API
+   bool QMan high-level self-test
+   depends on FSL_QMAN_TEST
+   default y
+   ---help---
+ This requires the presence of cpu-affine portals, and performs
+ high-level API testing with them (whichever portal(s) are affine to
+ the cpu(s) the test executes on).
+
+config FSL_QMAN_TEST_STASH
+   bool QMan 'hot potato' data-stashing self-test
+   depends on FSL_QMAN_TEST
+   default y
+   ---help---
+ This performs a hot potato style test enqueuing/dequeuing a frame
+ across a series of FQs scheduled to different portals (and cpus), with
+ DQRR, data and context stashing always on.
+
 # H/w settings that can be hard-coded for now.
 config FSL_QMAN_FQD_SZ
int size of Frame Queue Descriptor region
diff --git a/drivers/soc/freescale/Makefile b/drivers/soc/freescale/Makefile
index 09f31b0..1f59a6b 100644
--- a/drivers/soc/freescale/Makefile
+++ b/drivers/soc/freescale/Makefile
@@ -13,3 +13,7 @@ bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH)+= 
bman_test_thresh.o
 # QMan
 obj-$(CONFIG_FSL_QMAN) += qman_api.o qman_utils.o
 obj-$(CONFIG_FSL_QMAN_CONFIG)  += qman.o qman_portal.o
+obj-$(CONFIG_FSL_QMAN_TEST)+= qman_tester.o
+qman_tester-y   = qman_test.o
+qman_tester-$(CONFIG_FSL_QMAN_TEST_API)+= qman_test_api.o
+qman_tester-$(CONFIG_FSL_QMAN_TEST_STASH)  += qman_test_stash.o
diff --git a/drivers/soc/freescale/bman_test.c 
b/drivers/soc/freescale/bman_test.c
index 350f2f8..5d23752 100644
--- a/drivers/soc/freescale/bman_test.c
+++ b/drivers/soc/freescale/bman_test.c
@@ -37,7 +37,7 @@ MODULE_DESCRIPTION(BMan testing);
 
 static int test_init(void)
 {
-#ifdef CONFIG_FSL_BMAN_TEST_HIGH
+#ifdef CONFIG_FSL_BMAN_TEST_API
int loop = 1;
while (loop--)
bman_test_api();
diff --git a/drivers/soc/freescale/bman_test.c 
b/drivers/soc/freescale/qman_test.c
similarity index 91%
copy from drivers/soc/freescale/bman_test.c
copy to drivers/soc/freescale/qman_test.c
index 350f2f8..094d46d 100644
--- a/drivers/soc/freescale/bman_test.c
+++ b/drivers/soc/freescale/qman_test.c
@@ -29,22 +29,23 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include bman_test.h
+#include qman_test.h
 
 MODULE_AUTHOR(Geoff Thorpe);
 MODULE_LICENSE(Dual BSD/GPL);
-MODULE_DESCRIPTION(BMan testing);
+MODULE_DESCRIPTION(QMan testing);
 
 static int test_init(void)
 {
-#ifdef CONFIG_FSL_BMAN_TEST_HIGH
int loop = 1;
-   while (loop--)
-   bman_test_api();
+   while (loop--) {
+#ifdef CONFIG_FSL_QMAN_TEST_STASH
+   qman_test_stash();
 #endif
-#ifdef CONFIG_FSL_BMAN_TEST_THRESH
-   bman_test_thresh();
+#ifdef CONFIG_FSL_QMAN_TEST_API
+   qman_test_api();
 #endif
+   }
return 0;
 }
 
diff --git a/drivers/soc/freescale/bman_test.c 
b/drivers/soc/freescale/qman_test.h
similarity index 81%
copy from drivers/soc/freescale/bman_test.c
copy to drivers/soc/freescale/qman_test.h
index 350f2f8..4690376 100644
--- a/drivers/soc/freescale/bman_test.c
+++ b/drivers/soc/freescale/qman_test.h
@@ -29,28 +29,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 

[RFC v2 00/10] Freescale DPAA B/QMan drivers

2015-02-16 Thread Emil Medve
v2: Moved out of staging into soc/freescale

Hello,


This is the se attempt to publish the . They are
not to be applied yet.  

These are the Freescale DPAA B/QMan drivers. At this stage, this is more or less
the drivers from the Freescale PowerPC SDK roughly squashed and split in a
sequence of component patches. They still needs some work and cleanup before we
expect to have them applied, but we appreciate early feedback

To do:  Add a maintainer(s) entry
Add module(s) support
Some important clean-ups

Cheers,


Geoff Thorpe (8):
  fsl_bman: Add drivers for the Freescale DPAA BMan
  fsl_qman: Add drivers for the Freescale DPAA QMan
  powerpc/mpc85xx: Add platform support for the Freescale DPAA BMan
  powerpc/mpc85xx: Add platform support for the Freescale DPAA QMan
  fsl_bman: Add self-tester
  fsl_qman: Add self-tester
  fsl_bman: Add debugfs support
  fsl_qman: Add debugfs support

Hai-Ying Wang (2):
  fsl_bman: Add HOTPLUG_CPU support
  fsl_qman: Add HOTPLUG_CPU support

 arch/powerpc/Kconfig  |5 +
 arch/powerpc/configs/mpc85xx_defconfig|1 +
 arch/powerpc/configs/mpc85xx_smp_defconfig|1 +
 arch/powerpc/platforms/85xx/Kconfig   |1 +
 arch/powerpc/platforms/85xx/corenet_generic.c |   22 +
 arch/powerpc/platforms/85xx/p1023_rdb.c   |   20 +
 drivers/soc/Kconfig   |1 +
 drivers/soc/Makefile  |1 +
 drivers/soc/freescale/Kconfig |  187 ++
 drivers/soc/freescale/Makefile|   21 +
 drivers/soc/freescale/bman.c  |  611 ++
 drivers/soc/freescale/bman.h  |  524 +
 drivers/soc/freescale/bman_api.c  | 1055 ++
 drivers/soc/freescale/bman_debugfs.c  |  119 ++
 drivers/soc/freescale/bman_portal.c   |  373 
 drivers/soc/freescale/bman_priv.h |  149 ++
 drivers/soc/freescale/bman_test.c |   56 +
 drivers/soc/freescale/bman_test.h |   44 +
 drivers/soc/freescale/bman_test_api.c |  181 ++
 drivers/soc/freescale/bman_test_thresh.c  |  196 ++
 drivers/soc/freescale/dpaa_alloc.c|  573 ++
 drivers/soc/freescale/dpaa_sys.h  |  294 +++
 drivers/soc/freescale/qbman_driver.c  |   85 +
 drivers/soc/freescale/qman.c  |  991 ++
 drivers/soc/freescale/qman.h  | 1302 
 drivers/soc/freescale/qman_api.c  | 2624 +
 drivers/soc/freescale/qman_debugfs.c  | 1326 +
 drivers/soc/freescale/qman_portal.c   |  548 ++
 drivers/soc/freescale/qman_priv.h |  283 +++
 drivers/soc/freescale/qman_test.c |   57 +
 drivers/soc/freescale/qman_test.h |   43 +
 drivers/soc/freescale/qman_test_api.c |  213 ++
 drivers/soc/freescale/qman_test_stash.c   |  497 +
 drivers/soc/freescale/qman_utils.c|  129 ++
 include/linux/fsl_bman.h  |  517 +
 include/linux/fsl_qman.h  | 1955 ++
 36 files changed, 15005 insertions(+)
 create mode 100644 drivers/soc/freescale/Kconfig
 create mode 100644 drivers/soc/freescale/Makefile
 create mode 100644 drivers/soc/freescale/bman.c
 create mode 100644 drivers/soc/freescale/bman.h
 create mode 100644 drivers/soc/freescale/bman_api.c
 create mode 100644 drivers/soc/freescale/bman_debugfs.c
 create mode 100644 drivers/soc/freescale/bman_portal.c
 create mode 100644 drivers/soc/freescale/bman_priv.h
 create mode 100644 drivers/soc/freescale/bman_test.c
 create mode 100644 drivers/soc/freescale/bman_test.h
 create mode 100644 drivers/soc/freescale/bman_test_api.c
 create mode 100644 drivers/soc/freescale/bman_test_thresh.c
 create mode 100644 drivers/soc/freescale/dpaa_alloc.c
 create mode 100644 drivers/soc/freescale/dpaa_sys.h
 create mode 100644 drivers/soc/freescale/qbman_driver.c
 create mode 100644 drivers/soc/freescale/qman.c
 create mode 100644 drivers/soc/freescale/qman.h
 create mode 100644 drivers/soc/freescale/qman_api.c
 create mode 100644 drivers/soc/freescale/qman_debugfs.c
 create mode 100644 drivers/soc/freescale/qman_portal.c
 create mode 100644 drivers/soc/freescale/qman_priv.h
 create mode 100644 drivers/soc/freescale/qman_test.c
 create mode 100644 drivers/soc/freescale/qman_test.h
 create mode 100644 drivers/soc/freescale/qman_test_api.c
 create mode 100644 drivers/soc/freescale/qman_test_stash.c
 create mode 100644 drivers/soc/freescale/qman_utils.c
 create mode 100644 include/linux/fsl_bman.h
 create mode 100644 include/linux/fsl_qman.h

-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v2 10/10] fsl_qman: Add HOTPLUG_CPU support

2015-02-16 Thread Emil Medve
From: Hai-Ying Wang haiying.w...@freescale.com

Change-Id: Ica4d1b2b0fd3c3ae5e043663febd9f4cb7c762cf
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
---
 drivers/soc/freescale/qman_portal.c | 45 +
 1 file changed, 45 insertions(+)

diff --git a/drivers/soc/freescale/qman_portal.c 
b/drivers/soc/freescale/qman_portal.c
index 7216de1..b008b41 100644
--- a/drivers/soc/freescale/qman_portal.c
+++ b/drivers/soc/freescale/qman_portal.c
@@ -30,6 +30,9 @@
  */
 
 #include qman_priv.h
+#ifdef CONFIG_HOTPLUG_CPU
+#include linux/cpu.h
+#endif
 
 /* Global variable containing revision id (even on non-control plane systems
  * where CCSR isn't available) */
@@ -381,6 +384,45 @@ static void qman_offline_cpu(unsigned int cpu)
}
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void qman_online_cpu(unsigned int cpu)
+{
+   struct qman_portal *p;
+   const struct qm_portal_config *pcfg;
+   p = (struct qman_portal *)affine_portals[cpu];
+   if (p) {
+   pcfg = qman_get_qm_portal_config(p);
+   if (pcfg) {
+   irq_set_affinity(pcfg-public_cfg.irq, cpumask_of(cpu));
+   qman_portal_update_sdest(pcfg, cpu);
+   }
+   }
+}
+
+static int __cpuinit qman_hotplug_cpu_callback(struct notifier_block *nfb,
+   unsigned long action, void *hcpu)
+{
+   unsigned int cpu = (unsigned long)hcpu;
+
+   switch (action) {
+   case CPU_ONLINE:
+   case CPU_ONLINE_FROZEN:
+   qman_online_cpu(cpu);
+   break;
+   case CPU_DOWN_PREPARE:
+   case CPU_DOWN_PREPARE_FROZEN:
+   qman_offline_cpu(cpu);
+   default:
+   break;
+   }
+   return NOTIFY_OK;
+}
+
+static struct notifier_block qman_hotplug_cpu_notifier = {
+   .notifier_call = qman_hotplug_cpu_callback,
+};
+#endif /* CONFIG_HOTPLUG_CPU */
+
 __init int qman_init(void)
 {
struct cpumask slave_cpus;
@@ -499,5 +541,8 @@ __init int qman_init(void)
cpumask_andnot(offline_cpus, cpu_possible_mask, cpu_online_mask);
for_each_cpu(cpu, offline_cpus)
qman_offline_cpu(cpu);
+#ifdef CONFIG_HOTPLUG_CPU
+   register_hotcpu_notifier(qman_hotplug_cpu_notifier);
+#endif
return 0;
 }
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v2 05/10] fsl_bman: Add self-tester

2015-02-16 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: If1b44bb013addc1e855c73a4e6ff74bc8b6e4829
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/soc/freescale/Kconfig|  26 
 drivers/soc/freescale/Makefile   |   8 +-
 drivers/soc/freescale/bman.c |  16 +--
 drivers/soc/freescale/bman_api.c |  14 +--
 drivers/soc/freescale/bman_portal.c  |  18 +--
 drivers/soc/freescale/bman_priv.h|   2 +-
 drivers/soc/freescale/bman_test.c|  56 +
 drivers/soc/freescale/bman_test.h|  44 +++
 drivers/soc/freescale/bman_test_api.c| 181 
 drivers/soc/freescale/bman_test_thresh.c | 196 +++
 drivers/soc/freescale/dpaa_alloc.c   |   2 +-
 drivers/soc/freescale/dpaa_sys.h |   2 +-
 drivers/soc/freescale/qman.c |  26 ++--
 drivers/soc/freescale/qman_api.c |  18 +--
 drivers/soc/freescale/qman_portal.c  |  18 +--
 drivers/soc/freescale/qman_priv.h|   2 +-
 include/linux/fsl_bman.h |  10 +-
 include/linux/fsl_qman.h |  18 +--
 18 files changed, 582 insertions(+), 75 deletions(-)
 create mode 100644 drivers/soc/freescale/bman_test.c
 create mode 100644 drivers/soc/freescale/bman_test.h
 create mode 100644 drivers/soc/freescale/bman_test_api.c
 create mode 100644 drivers/soc/freescale/bman_test_thresh.c

diff --git a/drivers/soc/freescale/Kconfig b/drivers/soc/freescale/Kconfig
index 9329c5c..6786b94 100644
--- a/drivers/soc/freescale/Kconfig
+++ b/drivers/soc/freescale/Kconfig
@@ -47,6 +47,32 @@ config FSL_BMAN_CONFIG
  linux image is running as a guest OS under the hypervisor, only one
  guest OS (the control plane) needs this option.
 
+config FSL_BMAN_TEST
+   tristate BMan self-tests
+   default n
+   ---help---
+ This option compiles self-test code for BMan.
+
+config FSL_BMAN_TEST_HIGH
+   bool BMan high-level self-test
+   depends on FSL_BMAN_TEST
+   default y
+   ---help---
+ This requires the presence of cpu-affine portals, and performs
+ high-level API testing with them (whichever portal(s) are affine to
+ the cpu(s) the test executes on).
+
+config FSL_BMAN_TEST_THRESH
+   bool BMan threshold test
+   depends on FSL_BMAN_TEST
+   default y
+   ---help---
+ Multi-threaded (SMP) test of BMan pool depletion. A pool is seeded
+ before multiple threads (one per cpu) create pool objects to track
+ depletion state changes. The pool is then drained to empty by a
+ drainer thread, and the other threads that they observe exactly
+ the depletion state changes that are expected.
+
 endif # FSL_BMAN
 
 config FSL_QMAN
diff --git a/drivers/soc/freescale/Makefile b/drivers/soc/freescale/Makefile
index 69be592..09f31b0 100644
--- a/drivers/soc/freescale/Makefile
+++ b/drivers/soc/freescale/Makefile
@@ -2,10 +2,14 @@
 obj-$(CONFIG_FSL_DPA)  += dpaa_alloc.o
 obj-$(CONFIG_HAS_FSL_QBMAN)+= qbman_driver.o
 
-# Bman
+# BMan
 obj-$(CONFIG_FSL_BMAN) += bman_api.o
 obj-$(CONFIG_FSL_BMAN_CONFIG)  += bman.o bman_portal.o
+obj-$(CONFIG_FSL_BMAN_TEST)+= bman_tester.o
+bman_tester-y   = bman_test.o
+bman_tester-$(CONFIG_FSL_BMAN_TEST_API)+= bman_test_api.o
+bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH) += bman_test_thresh.o
 
-# Qman
+# QMan
 obj-$(CONFIG_FSL_QMAN) += qman_api.o qman_utils.o
 obj-$(CONFIG_FSL_QMAN_CONFIG)  += qman.o qman_portal.o
diff --git a/drivers/soc/freescale/bman.c b/drivers/soc/freescale/bman.c
index fba6ae0..66986f2 100644
--- a/drivers/soc/freescale/bman.c
+++ b/drivers/soc/freescale/bman.c
@@ -275,7 +275,7 @@ static int __init fsl_bman_init(struct device_node *node)
BUG_ON(!bm);
bm_node = node;
bm_get_version(bm, id, major, minor);
-   pr_info(Bman ver:%04x,%02x,%02x\n, id, major, minor);
+   pr_info(BMan ver:%04x,%02x,%02x\n, id, major, minor);
if ((major == 1)  (minor == 0)) {
bman_ip_rev = BMAN_REV10;
bman_pool_max = 64;
@@ -286,7 +286,7 @@ static int __init fsl_bman_init(struct device_node *node)
bman_ip_rev = BMAN_REV21;
bman_pool_max = 64;
} else {
-   pr_warn(unknown Bman version, default to rev1.0\n);
+   pr_warn(unknown BMan version, default to rev1.0\n);
}
 
return 0;
@@ -330,7 +330,7 @@ static void log_edata_bits(u32 bit_count)
 {
u32 i, j, mask = 0x;
 
-   pr_warn(Bman ErrInt, EDATA:\n);
+   pr_warn(BMan ErrInt, EDATA:\n);
i = bit_count/32;
if (bit_count%32) {
i++;
@@ -351,13 +351,13 @@ static void log_additional_error_info(u32 isr_val, u32 
ecsr_val)
  

[RFC v2 08/10] fsl_qman: Add debugfs support

2015-02-16 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I59a75a91b289193b5ab1d30a08f60119dc4d7568
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/soc/freescale/Kconfig|7 +
 drivers/soc/freescale/Makefile   |1 +
 drivers/soc/freescale/qman_api.c |   58 ++
 drivers/soc/freescale/qman_debugfs.c | 1326 ++
 drivers/soc/freescale/qman_priv.h|8 +
 include/linux/fsl_qman.h |6 +
 6 files changed, 1406 insertions(+)
 create mode 100644 drivers/soc/freescale/qman_debugfs.c

diff --git a/drivers/soc/freescale/Kconfig b/drivers/soc/freescale/Kconfig
index f819671..5f683c8 100644
--- a/drivers/soc/freescale/Kconfig
+++ b/drivers/soc/freescale/Kconfig
@@ -124,6 +124,13 @@ config FSL_QMAN_TEST_STASH
  across a series of FQs scheduled to different portals (and cpus), with
  DQRR, data and context stashing always on.
 
+config FSL_QMAN_DEBUGFS
+   tristate QMan debugfs interface
+   depends on DEBUG_FS
+   default y
+   ---help---
+ This option compiles debugfs code for QMan.
+
 # H/w settings that can be hard-coded for now.
 config FSL_QMAN_FQD_SZ
int size of Frame Queue Descriptor region
diff --git a/drivers/soc/freescale/Makefile b/drivers/soc/freescale/Makefile
index c980dac..aac7cb2 100644
--- a/drivers/soc/freescale/Makefile
+++ b/drivers/soc/freescale/Makefile
@@ -18,3 +18,4 @@ obj-$(CONFIG_FSL_QMAN_TEST)   += qman_tester.o
 qman_tester-y   = qman_test.o
 qman_tester-$(CONFIG_FSL_QMAN_TEST_API)+= qman_test_api.o
 qman_tester-$(CONFIG_FSL_QMAN_TEST_STASH)  += qman_test_stash.o
+obj-$(CONFIG_FSL_QMAN_DEBUGFS) += qman_debugfs.o
diff --git a/drivers/soc/freescale/qman_api.c b/drivers/soc/freescale/qman_api.c
index 08dbb36..7556118 100644
--- a/drivers/soc/freescale/qman_api.c
+++ b/drivers/soc/freescale/qman_api.c
@@ -1765,6 +1765,37 @@ int qman_query_wq(u8 query_dedicated, struct 
qm_mcr_querywq *wq)
 }
 EXPORT_SYMBOL(qman_query_wq);
 
+int qman_testwrite_cgr(struct qman_cgr *cgr, u64 i_bcnt,
+   struct qm_mcr_cgrtestwrite *result)
+{
+   struct qm_mc_command *mcc;
+   struct qm_mc_result *mcr;
+   struct qman_portal *p = get_affine_portal();
+   unsigned long irqflags __maybe_unused;
+   u8 res;
+
+   PORTAL_IRQ_LOCK(p, irqflags);
+   mcc = qm_mc_start(p-p);
+   mcc-cgrtestwrite.cgid = cgr-cgrid;
+   mcc-cgrtestwrite.i_bcnt_hi = (u8)(i_bcnt  32);
+   mcc-cgrtestwrite.i_bcnt_lo = (u32)i_bcnt;
+   qm_mc_commit(p-p, QM_MCC_VERB_CGRTESTWRITE);
+   while (!(mcr = qm_mc_result(p-p)))
+   cpu_relax();
+   DPA_ASSERT((mcr-verb  QM_MCR_VERB_MASK) == QM_MCC_VERB_CGRTESTWRITE);
+   res = mcr-result;
+   if (res == QM_MCR_RESULT_OK)
+   *result = mcr-cgrtestwrite;
+   PORTAL_IRQ_UNLOCK(p, irqflags);
+   put_affine_portal();
+   if (res != QM_MCR_RESULT_OK) {
+   pr_err(CGR TEST WRITE failed: %s\n, mcr_result_str(res));
+   return -EIO;
+   }
+   return 0;
+}
+EXPORT_SYMBOL(qman_testwrite_cgr);
+
 int qman_query_cgr(struct qman_cgr *cgr, struct qm_mcr_querycgr *cgrd)
 {
struct qm_mc_command *mcc;
@@ -1793,6 +1824,33 @@ int qman_query_cgr(struct qman_cgr *cgr, struct 
qm_mcr_querycgr *cgrd)
 }
 EXPORT_SYMBOL(qman_query_cgr);
 
+int qman_query_congestion(struct qm_mcr_querycongestion *congestion)
+{
+   struct qm_mc_result *mcr;
+   struct qman_portal *p = get_affine_portal();
+   unsigned long irqflags __maybe_unused;
+   u8 res;
+
+   PORTAL_IRQ_LOCK(p, irqflags);
+   qm_mc_start(p-p);
+   qm_mc_commit(p-p, QM_MCC_VERB_QUERYCONGESTION);
+   while (!(mcr = qm_mc_result(p-p)))
+   cpu_relax();
+   DPA_ASSERT((mcr-verb  QM_MCR_VERB_MASK) ==
+   QM_MCC_VERB_QUERYCONGESTION);
+   res = mcr-result;
+   if (res == QM_MCR_RESULT_OK)
+   *congestion = mcr-querycongestion;
+   PORTAL_IRQ_UNLOCK(p, irqflags);
+   put_affine_portal();
+   if (res != QM_MCR_RESULT_OK) {
+   pr_err(QUERY_CONGESTION failed: %s\n, mcr_result_str(res));
+   return -EIO;
+   }
+   return 0;
+}
+EXPORT_SYMBOL(qman_query_congestion);
+
 /* internal function used as a wait_event() expression */
 static int set_p_vdqcr(struct qman_portal *p, struct qman_fq *fq, u32 vdqcr)
 {
diff --git a/drivers/soc/freescale/qman_debugfs.c 
b/drivers/soc/freescale/qman_debugfs.c
new file mode 100644
index 000..c09f88f
--- /dev/null
+++ b/drivers/soc/freescale/qman_debugfs.c
@@ -0,0 +1,1326 @@
+/* Copyright 2010-2011 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

[RFC v2 09/10] fsl_bman: Add HOTPLUG_CPU support

2015-02-16 Thread Emil Medve
From: Hai-Ying Wang haiying.w...@freescale.com

Change-Id: I863d5c15c7f35f9de4ea3d985e4ff467167924b7
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
---
 drivers/soc/freescale/bman_portal.c | 45 -
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/freescale/bman_portal.c 
b/drivers/soc/freescale/bman_portal.c
index a91081c..f484a91 100644
--- a/drivers/soc/freescale/bman_portal.c
+++ b/drivers/soc/freescale/bman_portal.c
@@ -30,6 +30,9 @@
  */
 
 #include bman_priv.h
+#ifdef CONFIG_HOTPLUG_CPU
+#include linux/cpu.h
+#endif
 
 /*
  * Global variables of the max portal/pool number this bman version supported
@@ -180,7 +183,7 @@ static int __init parse_bportals(char *str)
 }
 __setup(bportals=, parse_bportals);
 
-static void bman_offline_cpu(unsigned int cpu)
+static void __cold bman_offline_cpu(unsigned int cpu)
 {
struct bman_portal *p = (struct bman_portal *)affine_bportals[cpu];
const struct bm_portal_config *pcfg;
@@ -192,6 +195,42 @@ static void bman_offline_cpu(unsigned int cpu)
}
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void __cold bman_online_cpu(unsigned int cpu)
+{
+   struct bman_portal *p = (struct bman_portal *)affine_bportals[cpu];
+   const struct bm_portal_config *pcfg;
+
+   if (p) {
+   pcfg = bman_get_bm_portal_config(p);
+   if (pcfg)
+   irq_set_affinity(pcfg-public_cfg.irq, cpumask_of(cpu));
+   }
+}
+
+static int __cold bman_hotplug_cpu_callback(struct notifier_block *nfb,
+   unsigned long action, void *hcpu)
+{
+   unsigned int cpu = (unsigned long)hcpu;
+
+   switch (action) {
+   case CPU_ONLINE:
+   case CPU_ONLINE_FROZEN:
+   bman_online_cpu(cpu);
+   break;
+   case CPU_DOWN_PREPARE:
+   case CPU_DOWN_PREPARE_FROZEN:
+   bman_offline_cpu(cpu);
+   }
+
+   return NOTIFY_OK;
+}
+
+static struct notifier_block bman_hotplug_cpu_notifier = {
+   .notifier_call = bman_hotplug_cpu_callback,
+};
+#endif /* CONFIG_HOTPLUG_CPU */
+
 /* Initialise the BMan driver. The meat of this function deals with portals. 
The
  * following describes the flow of portal-handling, the code steps refer to
  * this description;
@@ -326,5 +365,9 @@ int __init bman_init(void)
for_each_cpu(cpu, offline_cpus)
bman_offline_cpu(cpu);
 
+#ifdef CONFIG_HOTPLUG_CPU
+   register_hotcpu_notifier(bman_hotplug_cpu_notifier);
+#endif
+
return 0;
 }
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC v2 07/10] fsl_bman: Add debugfs support

2015-02-16 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I7eea7aea8a58ad0c28451b70801c0d101e88d263
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/soc/freescale/Kconfig|   7 +++
 drivers/soc/freescale/Makefile   |   1 +
 drivers/soc/freescale/bman_api.c |  19 ++
 drivers/soc/freescale/bman_debugfs.c | 119 +++
 drivers/soc/freescale/dpaa_sys.h |   1 +
 include/linux/fsl_bman.h |   6 ++
 6 files changed, 153 insertions(+)
 create mode 100644 drivers/soc/freescale/bman_debugfs.c

diff --git a/drivers/soc/freescale/Kconfig b/drivers/soc/freescale/Kconfig
index 001999e..f819671 100644
--- a/drivers/soc/freescale/Kconfig
+++ b/drivers/soc/freescale/Kconfig
@@ -73,6 +73,13 @@ config FSL_BMAN_TEST_THRESH
  drainer thread, and the other threads that they observe exactly
  the depletion state changes that are expected.
 
+config FSL_BMAN_DEBUGFS
+   tristate BMan debugfs interface
+   depends on DEBUG_FS
+   default y
+   ---help---
+ This option compiles debugfs code for BMan.
+
 endif # FSL_BMAN
 
 config FSL_QMAN
diff --git a/drivers/soc/freescale/Makefile b/drivers/soc/freescale/Makefile
index 1f59a6b..c980dac 100644
--- a/drivers/soc/freescale/Makefile
+++ b/drivers/soc/freescale/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_FSL_BMAN_TEST) += bman_tester.o
 bman_tester-y   = bman_test.o
 bman_tester-$(CONFIG_FSL_BMAN_TEST_API)+= bman_test_api.o
 bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH) += bman_test_thresh.o
+obj-$(CONFIG_FSL_BMAN_DEBUGFS) += bman_debugfs.o
 
 # QMan
 obj-$(CONFIG_FSL_QMAN) += qman_api.o qman_utils.o
diff --git a/drivers/soc/freescale/bman_api.c b/drivers/soc/freescale/bman_api.c
index 7bb4840..20f510a 100644
--- a/drivers/soc/freescale/bman_api.c
+++ b/drivers/soc/freescale/bman_api.c
@@ -997,6 +997,25 @@ int bman_flush_stockpile(struct bman_pool *pool, u32 flags)
 }
 EXPORT_SYMBOL(bman_flush_stockpile);
 
+int bman_query_pools(struct bm_pool_state *state)
+{
+   struct bman_portal *p = get_affine_portal();
+   struct bm_mc_result *mcr;
+   __maybe_unused unsigned long irqflags;
+
+   PORTAL_IRQ_LOCK(p, irqflags);
+   bm_mc_start(p-p);
+   bm_mc_commit(p-p, BM_MCC_VERB_CMD_QUERY);
+   while (!(mcr = bm_mc_result(p-p)))
+   cpu_relax();
+   DPA_ASSERT((mcr-verb  BM_MCR_VERB_CMD_MASK) == BM_MCR_VERB_CMD_QUERY);
+   *state = mcr-query;
+   PORTAL_IRQ_UNLOCK(p, irqflags);
+   put_affine_portal();
+   return 0;
+}
+EXPORT_SYMBOL(bman_query_pools);
+
 #ifdef CONFIG_FSL_BMAN_CONFIG
 u32 bman_query_free_buffers(struct bman_pool *pool)
 {
diff --git a/drivers/soc/freescale/bman_debugfs.c 
b/drivers/soc/freescale/bman_debugfs.c
new file mode 100644
index 000..b93e705
--- /dev/null
+++ b/drivers/soc/freescale/bman_debugfs.c
@@ -0,0 +1,119 @@
+/* Copyright 2010-2011 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 linux/module.h
+#include linux/fsl_bman.h
+#include linux/debugfs.h
+#include linux/seq_file.h
+#include linux/uaccess.h
+
+static struct dentry *dfs_root; /* debugfs 

Re: [PATCH] powerpc/dts: Update platform PLL node

2015-02-08 Thread Emil Medve
Hello Scott,


On 01/29/2015 10:12 PM, Scott Wood wrote:
 From: Igal Liberman igal.liber...@freescale.com

 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 Change-Id: I92d020651237041d3767aa35e9345439714f9831
 ---
  arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi |6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

 Please explain this more.  Was it just wrong before?  Is this for a new 
 chip?  If
 the latter, what effect does this have on existing chips?

 It wasn't wrong, however it was missing some clocking options which
 might be used by some hardware accelerators available in T/B devices.
 I need this options for FMan, however it might be used for other
 accelerators too.
 
 If the PLL had a div3 option and it wasn't described by the PLL node,
 the node was wrong.

Somewhere between early versions of the RM and the cores not using this
PLL output, yes the node is incomplete/wrong

 Do all chips that use this file have a div3?

Yup. T1/2/4, B4, etc. It's used as an input clock to the various IP
blocks on said SoC(es), FMan, eSDHC, PME, etc.

 diff --git a/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
 b/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
 index 48e0b6e..7e1f074 100644
 --- a/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
 +++ b/arch/powerpc/boot/dts/fsl/qoriq-clockgen2.dtsi
 @@ -49,14 +49,16 @@ global-utilities@e1000 {
reg = 0x800 0x4;
compatible = fsl,qoriq-core-pll-2.0;
clocks = sysclk;
 -  clock-output-names = pll0, pll0-div2, pll0-div4;
 +  clock-output-names = pll0, pll0-div2, pll0-div3,
 +pll0-div4;

 You're changing the meaning of existing clock index 2.

 Yes, however this platform PLL is a new work which is not yet
 used, so we aren't breaking any functionality.
 
 No, it's the core PLL node which is already in use.  However, it looks
 like the driver already interprets clock index 2 differently based on
 whether clock index 3 exists.  None of this is mentioned in the binding
 document...

Yes, it's a bit fishy and that clock registration (code) ends up
working. However, I think we ought to key that code on the chassis
version and not on the number of clock outputs in some (in/complete)
node instance

That being said, there are two outstanding issues:

1. The core mux nodes need to be updated to get pllX-div4 from index 3
not 2. Currently things work because our RCW(s) don't use pllX-div4 so
the inconsistency goes unnoticed

2. Chassis v2 supports frequency scaling for the HW accelerators (FMan
in this particular case) much like it's supported for the cores (both
chassis v1/2). This patch doesn't cover that


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC 00/10] Freescale DPAA B/QMan drivers

2015-02-05 Thread Emil Medve
Hello Dan,


Thanks for the reply

On 02/05/2015 02:41 AM, Dan Carpenter wrote:
 Normally, for staging drivers we just require the TODO and a maintainer
 and we merge things as-is.  There isn't really much review of the code.

I think I'll go for drivers/soc as we have quite a handful of other
drivers using this code that already decided not to be located into staging


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC 00/10] Freescale DPAA B/QMan drivers

2015-02-05 Thread Emil Medve
Hello Bob,


On 02/05/2015 09:48 AM, Bob Cochran wrote:
 On 02/04/2015 09:48 AM, Emil Medve wrote:

 Hello,


 This is the first attempt to publish the Freescale DPAA B/QMan
 drivers. They are
 not to be applied yet.  At this stage, this is more or less the
 drivers from the
 Freescale PowerPC SDK roughly squashed and split in a sequence of
 component
 patches. They still needs some work and cleanup before we expect to
 have them
 applied, but we appreciate early feedback
 
 
 Hi Emil,
 
 I had thought to try to apply these patches and build it, but I won't
 get very far using it without FMAN (on my t1040).   I searched through
 the mail archives and didn't find FMAN patches other than for the device
 tree.   I also don't see it in the mainline tree.
 
 If FMAN patches have already been submitted, please point me to it.
 
 If not, then please let me know when we will see code to support FMAN.

Let me inquire with the FMan guy here. I'll get back to you on this,
however, don't hold your breath. There might be some weeks before the
FMan driver will hit the e-mail lists

 Also, is it your intention for the same QMAN/BMAN drivers to be used
 with both FMAN and the LS AIOP?

These drivers (with some upcoming updates) are expected to be use on all
QorIQ and LS1 devices. The programming model for LS2 (which includes the
AIOP and friends) seems to have a different programming model and these
drivers will not be usable there


Cheers,


 Thank you,
 
 Bob
 
 
 
 
 


 Cheers,


 Geoff Thorpe (8):
fsl_bman: Add drivers for the Freescale DPAA BMan
fsl_qman: Add drivers for the Freescale DPAA QMan
powerpc/mpc85xx: Add platform support for the Freescale DPAA BMan
powerpc/mpc85xx: Add platform support for the Freescale DPAA QMan
fsl_bman: Add self-tester
fsl_qman: Add self-tester
fsl_bman: Add debugfs support
fsl_qman: Add debugfs support

 Hai-Ying Wang (2):
fsl_bman: Add HOTPLUG_CPU support
fsl_qman: Add HOTPLUG_CPU support

   arch/powerpc/Kconfig|   33 +-
   arch/powerpc/platforms/85xx/Kconfig |   11 +-
   arch/powerpc/platforms/85xx/corenet_generic.c   |   26 +-
   arch/powerpc/platforms/85xx/p1023_rdb.c |   26 +-
   drivers/staging/Kconfig |4 +-
   drivers/staging/Makefile|1 +
   drivers/staging/fsl_qbman/Kconfig   |  188 ++
   drivers/staging/fsl_qbman/Makefile  |   23 +
   drivers/staging/fsl_qbman/bman_config.c |  611 ++
   drivers/staging/fsl_qbman/bman_debugfs.c|  119 +
   drivers/staging/fsl_qbman/bman_driver.c |  373 
   drivers/staging/fsl_qbman/bman_high.c   | 1055 +
   drivers/staging/fsl_qbman/bman_low.h|  524 +
   drivers/staging/fsl_qbman/bman_private.h|  149 ++
   drivers/staging/fsl_qbman/bman_test.c   |   56 +
   drivers/staging/fsl_qbman/bman_test.h   |   44 +
   drivers/staging/fsl_qbman/bman_test_high.c  |  181 ++
   drivers/staging/fsl_qbman/bman_test_thresh.c|  196 ++
   drivers/staging/fsl_qbman/dpa_alloc.c   |  573 +
   drivers/staging/fsl_qbman/dpa_sys.h |  294 +++
   drivers/staging/fsl_qbman/qbman_driver.c|   85 +
   drivers/staging/fsl_qbman/qman_config.c |  991 +
   drivers/staging/fsl_qbman/qman_debugfs.c| 1326 
   drivers/staging/fsl_qbman/qman_driver.c |  548 +
   drivers/staging/fsl_qbman/qman_high.c   | 2624
 +++
   drivers/staging/fsl_qbman/qman_low.h| 1302 +++
   drivers/staging/fsl_qbman/qman_private.h|  283 +++
   drivers/staging/fsl_qbman/qman_test.c   |   57 +
   drivers/staging/fsl_qbman/qman_test.h   |   43 +
   drivers/staging/fsl_qbman/qman_test_high.c  |  213 ++
   drivers/staging/fsl_qbman/qman_test_hotpotato.c |  497 +
   drivers/staging/fsl_qbman/qman_utility.c|  129 ++
   include/linux/fsl_bman.h|  517 +
   include/linux/fsl_qman.h| 1955
 +
   34 files changed, 15032 insertions(+), 25 deletions(-)
   create mode 100644 drivers/staging/fsl_qbman/Kconfig
   create mode 100644 drivers/staging/fsl_qbman/Makefile
   create mode 100644 drivers/staging/fsl_qbman/bman_config.c
   create mode 100644 drivers/staging/fsl_qbman/bman_debugfs.c
   create mode 100644 drivers/staging/fsl_qbman/bman_driver.c
   create mode 100644 drivers/staging/fsl_qbman/bman_high.c
   create mode 100644 drivers/staging/fsl_qbman/bman_low.h
   create mode 100644 drivers/staging/fsl_qbman/bman_private.h
   create mode 100644 drivers/staging/fsl_qbman/bman_test.c
   create mode 100644 drivers/staging/fsl_qbman/bman_test.h
   create mode 100644 drivers/staging/fsl_qbman/bman_test_high.c
   create mode 100644 drivers/staging/fsl_qbman/bman_test_thresh.c
   create mode 100644 drivers/staging/fsl_qbman/dpa_alloc.c

Re: [RFC 00/10] Freescale DPAA B/QMan drivers

2015-02-04 Thread Emil Medve
Hello Greg,


Thanks for looking at this

On 02/04/2015 12:40 PM, Greg KH wrote:
 On Wed, Feb 04, 2015 at 08:48:32AM -0600, Emil Medve wrote:

 Hello,


 This is the first attempt to publish the Freescale DPAA B/QMan drivers. They 
 are
 not to be applied yet.  At this stage, this is more or less the drivers from 
 the
 Freescale PowerPC SDK roughly squashed and split in a sequence of component
 patches. They still needs some work and cleanup before we expect to have them
 applied, but we appreciate early feedback
 
 First off, why put these in staging?  What's keeping them from being
 merged properly?

I was thinking they'll go into drivers/soc. Past some cleanup and some
integration issues, nothing holds them back

 Secondly, if they are going to go into staging, then I need a TODO file
 in the directory of the driver listing what needs to be done to move the
 code out of staging, and who is responsible for the code.  Ideally a
 MAINTAINERS entry as well.

Will get both lists, say, for the next post

 And finally, staging drivers should be self-contained, your .h files:
 
  include/linux/fsl_bman.h|  517 +
  include/linux/fsl_qman.h| 1955 +
 
 Need to be in drivers/staging/DRIVER_DIR/ not in include/linux/
 espeically as nothing outside of your driver needs these .h files.

These files contain the public interface(s) used by other devices
connected to the B/QMan: FMan, PME, RMan, DCE, etc. Every driver/piece
of code in need of a HW queue (QMan) or HW buffer allocator (BMan) will
use these files


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC 10/10] fsl_qman: Add HOTPLUG_CPU support

2015-02-04 Thread Emil Medve
From: Hai-Ying Wang haiying.w...@freescale.com

Change-Id: Ica4d1b2b0fd3c3ae5e043663febd9f4cb7c762cf
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
---
 drivers/staging/fsl_qbman/qman_driver.c | 45 +
 1 file changed, 45 insertions(+)

diff --git a/drivers/staging/fsl_qbman/qman_driver.c 
b/drivers/staging/fsl_qbman/qman_driver.c
index 5ca6221..7cd23bc 100644
--- a/drivers/staging/fsl_qbman/qman_driver.c
+++ b/drivers/staging/fsl_qbman/qman_driver.c
@@ -30,6 +30,9 @@
  */
 
 #include qman_private.h
+#ifdef CONFIG_HOTPLUG_CPU
+#include linux/cpu.h
+#endif
 
 /* Global variable containing revision id (even on non-control plane systems
  * where CCSR isn't available) */
@@ -381,6 +384,45 @@ static void qman_offline_cpu(unsigned int cpu)
}
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void qman_online_cpu(unsigned int cpu)
+{
+   struct qman_portal *p;
+   const struct qm_portal_config *pcfg;
+   p = (struct qman_portal *)affine_portals[cpu];
+   if (p) {
+   pcfg = qman_get_qm_portal_config(p);
+   if (pcfg) {
+   irq_set_affinity(pcfg-public_cfg.irq, cpumask_of(cpu));
+   qman_portal_update_sdest(pcfg, cpu);
+   }
+   }
+}
+
+static int __cpuinit qman_hotplug_cpu_callback(struct notifier_block *nfb,
+   unsigned long action, void *hcpu)
+{
+   unsigned int cpu = (unsigned long)hcpu;
+
+   switch (action) {
+   case CPU_ONLINE:
+   case CPU_ONLINE_FROZEN:
+   qman_online_cpu(cpu);
+   break;
+   case CPU_DOWN_PREPARE:
+   case CPU_DOWN_PREPARE_FROZEN:
+   qman_offline_cpu(cpu);
+   default:
+   break;
+   }
+   return NOTIFY_OK;
+}
+
+static struct notifier_block qman_hotplug_cpu_notifier = {
+   .notifier_call = qman_hotplug_cpu_callback,
+};
+#endif /* CONFIG_HOTPLUG_CPU */
+
 __init int qman_init(void)
 {
struct cpumask slave_cpus;
@@ -499,5 +541,8 @@ __init int qman_init(void)
cpumask_andnot(offline_cpus, cpu_possible_mask, cpu_online_mask);
for_each_cpu(cpu, offline_cpus)
qman_offline_cpu(cpu);
+#ifdef CONFIG_HOTPLUG_CPU
+   register_hotcpu_notifier(qman_hotplug_cpu_notifier);
+#endif
return 0;
 }
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC 07/10] fsl_bman: Add debugfs support

2015-02-04 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I7eea7aea8a58ad0c28451b70801c0d101e88d263
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/staging/fsl_qbman/Kconfig|   7 ++
 drivers/staging/fsl_qbman/Makefile   |   2 +
 drivers/staging/fsl_qbman/bman_debugfs.c | 119 +++
 drivers/staging/fsl_qbman/bman_high.c|  19 +
 drivers/staging/fsl_qbman/dpa_sys.h  |   1 +
 include/linux/fsl_bman.h |   6 ++
 6 files changed, 154 insertions(+)
 create mode 100644 drivers/staging/fsl_qbman/bman_debugfs.c

diff --git a/drivers/staging/fsl_qbman/Kconfig 
b/drivers/staging/fsl_qbman/Kconfig
index fdf2f3b..66a8361 100644
--- a/drivers/staging/fsl_qbman/Kconfig
+++ b/drivers/staging/fsl_qbman/Kconfig
@@ -74,6 +74,13 @@ config FSL_BMAN_TEST_THRESH
  drainer thread, and the other threads that they observe exactly
  the depletion state changes that are expected.
 
+config FSL_BMAN_DEBUGFS
+   tristate BMan debugfs interface
+   depends on DEBUG_FS
+   default y
+   ---help---
+ This option compiles debugfs code for BMan.
+
 endif # FSL_BMAN
 
 config FSL_QMAN
diff --git a/drivers/staging/fsl_qbman/Makefile 
b/drivers/staging/fsl_qbman/Makefile
index 04d61f7..0287eab 100644
--- a/drivers/staging/fsl_qbman/Makefile
+++ b/drivers/staging/fsl_qbman/Makefile
@@ -9,6 +9,8 @@ obj-$(CONFIG_FSL_BMAN_TEST)  += 
bman_tester.o
 bman_tester-y= bman_test.o
 bman_tester-$(CONFIG_FSL_BMAN_TEST_HIGH)+= bman_test_high.o
 bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH)  += bman_test_thresh.o
+obj-$(CONFIG_FSL_BMAN_DEBUGFS)  += bman_debugfs_interface.o
+bman_debugfs_interface-y = bman_debugfs.o
 
 # Qman
 obj-$(CONFIG_FSL_QMAN)  += qman_high.o qman_utility.o
diff --git a/drivers/staging/fsl_qbman/bman_debugfs.c 
b/drivers/staging/fsl_qbman/bman_debugfs.c
new file mode 100644
index 000..b93e705
--- /dev/null
+++ b/drivers/staging/fsl_qbman/bman_debugfs.c
@@ -0,0 +1,119 @@
+/* Copyright 2010-2011 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 linux/module.h
+#include linux/fsl_bman.h
+#include linux/debugfs.h
+#include linux/seq_file.h
+#include linux/uaccess.h
+
+static struct dentry *dfs_root; /* debugfs root directory */
+
+/***
+ *  Query Buffer Pool State
+ 
**/
+static int query_bp_state_show(struct seq_file *file, void *offset)
+{
+   int ret;
+   struct bm_pool_state state;
+   int i, j;
+   u32 mask;
+
+   memset(state, 0, sizeof(struct bm_pool_state));
+   ret = bman_query_pools(state);
+   if (ret) {
+   seq_printf(file, Error %d\n, ret);
+   return 0;
+   }
+   seq_puts(file, bp_id  free_buffers_avail  bp_depleted\n);
+   for (i = 0; i  2; i++) {
+   mask = 0x8000;
+   for (j = 0; j  32; j++) {
+   seq_printf(file,
+  %-2u   %-3s %-3s\n,
+ 

[RFC 00/10] Freescale DPAA B/QMan drivers

2015-02-04 Thread Emil Medve

Hello,


This is the first attempt to publish the Freescale DPAA B/QMan drivers. They are
not to be applied yet.  At this stage, this is more or less the drivers from the
Freescale PowerPC SDK roughly squashed and split in a sequence of component
patches. They still needs some work and cleanup before we expect to have them
applied, but we appreciate early feedback


Cheers,


Geoff Thorpe (8):
  fsl_bman: Add drivers for the Freescale DPAA BMan
  fsl_qman: Add drivers for the Freescale DPAA QMan
  powerpc/mpc85xx: Add platform support for the Freescale DPAA BMan
  powerpc/mpc85xx: Add platform support for the Freescale DPAA QMan
  fsl_bman: Add self-tester
  fsl_qman: Add self-tester
  fsl_bman: Add debugfs support
  fsl_qman: Add debugfs support

Hai-Ying Wang (2):
  fsl_bman: Add HOTPLUG_CPU support
  fsl_qman: Add HOTPLUG_CPU support

 arch/powerpc/Kconfig|   33 +-
 arch/powerpc/platforms/85xx/Kconfig |   11 +-
 arch/powerpc/platforms/85xx/corenet_generic.c   |   26 +-
 arch/powerpc/platforms/85xx/p1023_rdb.c |   26 +-
 drivers/staging/Kconfig |4 +-
 drivers/staging/Makefile|1 +
 drivers/staging/fsl_qbman/Kconfig   |  188 ++
 drivers/staging/fsl_qbman/Makefile  |   23 +
 drivers/staging/fsl_qbman/bman_config.c |  611 ++
 drivers/staging/fsl_qbman/bman_debugfs.c|  119 +
 drivers/staging/fsl_qbman/bman_driver.c |  373 
 drivers/staging/fsl_qbman/bman_high.c   | 1055 +
 drivers/staging/fsl_qbman/bman_low.h|  524 +
 drivers/staging/fsl_qbman/bman_private.h|  149 ++
 drivers/staging/fsl_qbman/bman_test.c   |   56 +
 drivers/staging/fsl_qbman/bman_test.h   |   44 +
 drivers/staging/fsl_qbman/bman_test_high.c  |  181 ++
 drivers/staging/fsl_qbman/bman_test_thresh.c|  196 ++
 drivers/staging/fsl_qbman/dpa_alloc.c   |  573 +
 drivers/staging/fsl_qbman/dpa_sys.h |  294 +++
 drivers/staging/fsl_qbman/qbman_driver.c|   85 +
 drivers/staging/fsl_qbman/qman_config.c |  991 +
 drivers/staging/fsl_qbman/qman_debugfs.c| 1326 
 drivers/staging/fsl_qbman/qman_driver.c |  548 +
 drivers/staging/fsl_qbman/qman_high.c   | 2624 +++
 drivers/staging/fsl_qbman/qman_low.h| 1302 +++
 drivers/staging/fsl_qbman/qman_private.h|  283 +++
 drivers/staging/fsl_qbman/qman_test.c   |   57 +
 drivers/staging/fsl_qbman/qman_test.h   |   43 +
 drivers/staging/fsl_qbman/qman_test_high.c  |  213 ++
 drivers/staging/fsl_qbman/qman_test_hotpotato.c |  497 +
 drivers/staging/fsl_qbman/qman_utility.c|  129 ++
 include/linux/fsl_bman.h|  517 +
 include/linux/fsl_qman.h| 1955 +
 34 files changed, 15032 insertions(+), 25 deletions(-)
 create mode 100644 drivers/staging/fsl_qbman/Kconfig
 create mode 100644 drivers/staging/fsl_qbman/Makefile
 create mode 100644 drivers/staging/fsl_qbman/bman_config.c
 create mode 100644 drivers/staging/fsl_qbman/bman_debugfs.c
 create mode 100644 drivers/staging/fsl_qbman/bman_driver.c
 create mode 100644 drivers/staging/fsl_qbman/bman_high.c
 create mode 100644 drivers/staging/fsl_qbman/bman_low.h
 create mode 100644 drivers/staging/fsl_qbman/bman_private.h
 create mode 100644 drivers/staging/fsl_qbman/bman_test.c
 create mode 100644 drivers/staging/fsl_qbman/bman_test.h
 create mode 100644 drivers/staging/fsl_qbman/bman_test_high.c
 create mode 100644 drivers/staging/fsl_qbman/bman_test_thresh.c
 create mode 100644 drivers/staging/fsl_qbman/dpa_alloc.c
 create mode 100644 drivers/staging/fsl_qbman/dpa_sys.h
 create mode 100644 drivers/staging/fsl_qbman/qbman_driver.c
 create mode 100644 drivers/staging/fsl_qbman/qman_config.c
 create mode 100644 drivers/staging/fsl_qbman/qman_debugfs.c
 create mode 100644 drivers/staging/fsl_qbman/qman_driver.c
 create mode 100644 drivers/staging/fsl_qbman/qman_high.c
 create mode 100644 drivers/staging/fsl_qbman/qman_low.h
 create mode 100644 drivers/staging/fsl_qbman/qman_private.h
 create mode 100644 drivers/staging/fsl_qbman/qman_test.c
 create mode 100644 drivers/staging/fsl_qbman/qman_test.h
 create mode 100644 drivers/staging/fsl_qbman/qman_test_high.c
 create mode 100644 drivers/staging/fsl_qbman/qman_test_hotpotato.c
 create mode 100644 drivers/staging/fsl_qbman/qman_utility.c
 create mode 100644 include/linux/fsl_bman.h
 create mode 100644 include/linux/fsl_qman.h

-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC 03/10] powerpc/mpc85xx: Add platform support for the Freescale DPAA BMan

2015-02-04 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I59de17c040cdd304f86306336fcf89f130f7db2d
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 arch/powerpc/Kconfig  | 33 +++
 arch/powerpc/platforms/85xx/Kconfig   | 11 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 20 ++--
 arch/powerpc/platforms/85xx/p1023_rdb.c   | 20 +---
 4 files changed, 60 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 89996f3..7b2e673 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -361,7 +361,7 @@ config PPC_TRANSACTIONAL_MEM
select VSX
default n
---help---
- Support user-mode Transactional Memory on POWERPC.
+Support user-mode Transactional Memory on POWERPC.
 
 config IOMMU_HELPER
def_bool PPC64
@@ -374,7 +374,7 @@ config SWIOTLB
  Support for IO bounce buffering for systems without an IOMMU.
  This allows us to DMA to the full physical address space on
  platforms where the size of a physical address is larger
- than the bus address.  Not all platforms support this.
+ than the bus address.  Not all platforms support this.
 
 config HOTPLUG_CPU
bool Support for enabling/disabling CPUs
@@ -410,8 +410,8 @@ config KEXEC
depends on (PPC_BOOK3S || FSL_BOOKE || (44x  !SMP))
help
  kexec is a system call that implements the ability to shutdown your
- current kernel, and to start another kernel.  It is like a reboot
- but it is independent of the system firmware.   And like a reboot
+ current kernel, and to start another kernel.  It is like a reboot
+ but it is independent of the system firmware.   And like a reboot
  you can start any kernel with it, not just Linux.
 
  The name comes from the similarity to the exec system call.
@@ -450,7 +450,7 @@ config IRQ_ALL_CPUS
help
  This option gives the kernel permission to distribute IRQs across
  multiple CPUs.  Saying N here will route all IRQs to the first
- CPU.  Generally saying Y is safe, although some problems have been
+ CPU.  Generally saying Y is safe, although some problems have been
  reported with SMP Power Macintoshes with this option enabled.
 
 config NUMA
@@ -499,9 +499,9 @@ config ARCH_MEMORY_PROBE
depends on MEMORY_HOTPLUG
 
 # Some NUMA nodes have memory ranges that span
-# other nodes.  Even though a pfn is valid and
+# other nodes. Even though a pfn is valid and
 # between a node's start and end pfns, it may not
-# reside on that node.  See memmap_init_zone()
+# reside on that node. See memmap_init_zone()
 # for details.
 config NODES_SPAN_OTHER_NODES
def_bool y
@@ -600,8 +600,8 @@ config FORCE_MAX_ZONEORDER
  This config option is actually maximum order plus one. For example,
  a value of 11 means that the largest free memory block is 2^10 pages.
 
- The page size is not necessarily 4KB.  For example, on 64-bit
- systems, 64KB pages can be enabled via CONFIG_PPC_64K_PAGES.  Keep
+ The page size is not necessarily 4KB.  For example, on 64-bit
+ systems, 64KB pages can be enabled via CONFIG_PPC_64K_PAGES.  Keep
  this in mind when choosing a value for this option.
 
 config PPC_SUBPAGE_PROT
@@ -630,7 +630,7 @@ config PPC_DENORMALISATION
default y if PPC_POWERNV
---help---
  Add support for handling denormalisation of single precision
- values.  Useful for bare metal only.  If unsure say Y here.
+ values.  Useful for bare metal only.  If unsure say Y here.
 
 config CMDLINE_BOOL
bool Default bootloader kernel arguments
@@ -740,7 +740,7 @@ config FSL_SOC
bool
 
 config FSL_PCI
-   bool
+   bool
select PPC_INDIRECT_PCI
select PCI_QUIRKS
 
@@ -778,12 +778,17 @@ config FSL_GTM
help
  Freescale General-purpose Timers support
 
+config HAS_FSL_QBMAN
+   bool Datapath Acceleration Queue and Buffer management
+   help
+ Datapath Acceleration Queue and Buffer management
+
 # Yes MCA RS/6000s exist but Linux-PPC does not currently support any
 config MCA
bool
 
 # Platforms that what PCI turned unconditionally just do select PCI
-# in their config node.  Platforms that want to choose at config
+# in their config node. Platforms that want to choose at config
 # time should select PPC_PCI_CHOICE
 config PPC_PCI_CHOICE
bool
@@ -910,14 +915,14 @@ config DYNAMIC_MEMSTART
select NONSTATIC_KERNEL
help
  This option enables the kernel to be loaded at any page aligned
- physical address. The kernel creates a mapping from KERNELBASE to 
+ physical address. The kernel creates a mapping from KERNELBASE to
  the address where the kernel is loaded. The page 

[RFC 09/10] fsl_bman: Add HOTPLUG_CPU support

2015-02-04 Thread Emil Medve
From: Hai-Ying Wang haiying.w...@freescale.com

Change-Id: I863d5c15c7f35f9de4ea3d985e4ff467167924b7
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
---
 drivers/staging/fsl_qbman/bman_driver.c | 45 -
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fsl_qbman/bman_driver.c 
b/drivers/staging/fsl_qbman/bman_driver.c
index bab2283..18a6cdd 100644
--- a/drivers/staging/fsl_qbman/bman_driver.c
+++ b/drivers/staging/fsl_qbman/bman_driver.c
@@ -30,6 +30,9 @@
  */
 
 #include bman_private.h
+#ifdef CONFIG_HOTPLUG_CPU
+#include linux/cpu.h
+#endif
 
 /*
  * Global variables of the max portal/pool number this bman version supported
@@ -180,7 +183,7 @@ static int __init parse_bportals(char *str)
 }
 __setup(bportals=, parse_bportals);
 
-static void bman_offline_cpu(unsigned int cpu)
+static void __cold bman_offline_cpu(unsigned int cpu)
 {
struct bman_portal *p = (struct bman_portal *)affine_bportals[cpu];
const struct bm_portal_config *pcfg;
@@ -192,6 +195,42 @@ static void bman_offline_cpu(unsigned int cpu)
}
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void __cold bman_online_cpu(unsigned int cpu)
+{
+   struct bman_portal *p = (struct bman_portal *)affine_bportals[cpu];
+   const struct bm_portal_config *pcfg;
+
+   if (p) {
+   pcfg = bman_get_bm_portal_config(p);
+   if (pcfg)
+   irq_set_affinity(pcfg-public_cfg.irq, cpumask_of(cpu));
+   }
+}
+
+static int __cold bman_hotplug_cpu_callback(struct notifier_block *nfb,
+   unsigned long action, void *hcpu)
+{
+   unsigned int cpu = (unsigned long)hcpu;
+
+   switch (action) {
+   case CPU_ONLINE:
+   case CPU_ONLINE_FROZEN:
+   bman_online_cpu(cpu);
+   break;
+   case CPU_DOWN_PREPARE:
+   case CPU_DOWN_PREPARE_FROZEN:
+   bman_offline_cpu(cpu);
+   }
+
+   return NOTIFY_OK;
+}
+
+static struct notifier_block bman_hotplug_cpu_notifier = {
+   .notifier_call = bman_hotplug_cpu_callback,
+};
+#endif /* CONFIG_HOTPLUG_CPU */
+
 /* Initialise the Bman driver. The meat of this function deals with portals. 
The
  * following describes the flow of portal-handling, the code steps refer to
  * this description;
@@ -326,5 +365,9 @@ int __init bman_init(void)
for_each_cpu(cpu, offline_cpus)
bman_offline_cpu(cpu);
 
+#ifdef CONFIG_HOTPLUG_CPU
+   register_hotcpu_notifier(bman_hotplug_cpu_notifier);
+#endif
+
return 0;
 }
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC 04/10] powerpc/mpc85xx: Add platform support for the Freescale DPAA QMan

2015-02-04 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I59de17c040cdd304f86306336fcf89f130f7db2d
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 arch/powerpc/platforms/85xx/corenet_generic.c | 8 +++-
 arch/powerpc/platforms/85xx/p1023_rdb.c   | 8 +++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 74faab7..20b8f9a 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -198,15 +198,21 @@ static int __init corenet_generic_probe(void)
 }
 
 /* Early setup is required for large chunks of contiguous (and 
coarsely-aligned)
- * memory. The following shoe-horns Bman init_early calls into the
+ * memory. The following shoe-horns Q/Bman init_early calls into the
  * platform setup to let them parse their CCSR nodes early on.
  */
+#ifdef CONFIG_FSL_QMAN_CONFIG
+void __init qman_init_early(void);
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
 void __init bman_init_early(void);
 #endif
 
 __init void corenet_ds_init_early(void)
 {
+#ifdef CONFIG_FSL_QMAN_CONFIG
+   qman_init_early();
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
bman_init_early();
 #endif
diff --git a/arch/powerpc/platforms/85xx/p1023_rdb.c 
b/arch/powerpc/platforms/85xx/p1023_rdb.c
index 624d3d6..dc69801 100644
--- a/arch/powerpc/platforms/85xx/p1023_rdb.c
+++ b/arch/powerpc/platforms/85xx/p1023_rdb.c
@@ -106,14 +106,20 @@ static int __init p1023_rdb_probe(void)
 }
 
 /* Early setup is required for large chunks of contiguous (and 
coarsely-aligned)
- * memory. The following shoe-horns Bman init_early calls into the
+ * memory. The following shoe-horns Q/Bman init_early calls into the
  * platform setup to let them parse their CCSR nodes early on. */
+#ifdef CONFIG_FSL_QMAN_CONFIG
+void __init qman_init_early(void);
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
 void __init bman_init_early(void);
 #endif
 
 static __init void p1023_rdb_init_early(void)
 {
+#ifdef CONFIG_FSL_QMAN_CONFIG
+   qman_init_early();
+#endif
 #ifdef CONFIG_FSL_BMAN_CONFIG
bman_init_early();
 #endif
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC 06/10] fsl_qman: Add self-tester

2015-02-04 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I314d36d94717cfc34053b6212899f71cb729d16c
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/staging/fsl_qbman/Kconfig   |  24 ++
 drivers/staging/fsl_qbman/Makefile  |  24 +-
 drivers/staging/fsl_qbman/qman_test.c   |  57 +++
 drivers/staging/fsl_qbman/qman_test.h   |  43 ++
 drivers/staging/fsl_qbman/qman_test_high.c  | 213 ++
 drivers/staging/fsl_qbman/qman_test_hotpotato.c | 497 
 6 files changed, 848 insertions(+), 10 deletions(-)
 create mode 100644 drivers/staging/fsl_qbman/qman_test.c
 create mode 100644 drivers/staging/fsl_qbman/qman_test.h
 create mode 100644 drivers/staging/fsl_qbman/qman_test_high.c
 create mode 100644 drivers/staging/fsl_qbman/qman_test_hotpotato.c

diff --git a/drivers/staging/fsl_qbman/Kconfig 
b/drivers/staging/fsl_qbman/Kconfig
index 1875dbf..fdf2f3b 100644
--- a/drivers/staging/fsl_qbman/Kconfig
+++ b/drivers/staging/fsl_qbman/Kconfig
@@ -94,6 +94,30 @@ config FSL_QMAN_CONFIG
  linux image is running as a guest OS under the hypervisor, only one
  guest OS (the control plane) needs this option.
 
+config FSL_QMAN_TEST
+   tristate QMan self-tests
+   default n
+   ---help---
+ This option compiles self-test code for QMan.
+
+config FSL_QMAN_TEST_HIGH
+   bool QMan high-level self-test
+   depends on FSL_QMAN_TEST
+   default y
+   ---help---
+ This requires the presence of cpu-affine portals, and performs
+ high-level API testing with them (whichever portal(s) are affine to
+ the cpu(s) the test executes on).
+
+config FSL_QMAN_TEST_STASH_POTATO
+   bool QMan 'hot potato' data-stashing self-test
+   depends on FSL_QMAN_TEST
+   default y
+   ---help---
+ This performs a hot potato style test enqueuing/dequeuing a frame
+ across a series of FQs scheduled to different portals (and cpus), with
+ DQRR, data and context stashing always on.
+
 # H/w settings that can be hard-coded for now.
 config FSL_QMAN_FQD_SZ
int size of Frame Queue Descriptor region
diff --git a/drivers/staging/fsl_qbman/Makefile 
b/drivers/staging/fsl_qbman/Makefile
index 0fcdd84..04d61f7 100644
--- a/drivers/staging/fsl_qbman/Makefile
+++ b/drivers/staging/fsl_qbman/Makefile
@@ -1,15 +1,19 @@
 # Common
-obj-$(CONFIG_FSL_DPA)  += dpa_alloc.o
-obj-$(CONFIG_HAS_FSL_QBMAN)+= qbman_driver.o
+obj-$(CONFIG_FSL_DPA)   += dpa_alloc.o
+obj-$(CONFIG_HAS_FSL_QBMAN) += qbman_driver.o
 
 # Bman
-obj-$(CONFIG_FSL_BMAN) += bman_high.o
-obj-$(CONFIG_FSL_BMAN_CONFIG)  += bman_config.o bman_driver.o
-obj-$(CONFIG_FSL_BMAN_TEST)+= bman_tester.o
-bman_tester-y   = bman_test.o
-bman_tester-$(CONFIG_FSL_BMAN_TEST_HIGH)   += bman_test_high.o
-bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH) += bman_test_thresh.o
+obj-$(CONFIG_FSL_BMAN)  += bman_high.o
+obj-$(CONFIG_FSL_BMAN_CONFIG)   += bman_config.o bman_driver.o
+obj-$(CONFIG_FSL_BMAN_TEST) += bman_tester.o
+bman_tester-y= bman_test.o
+bman_tester-$(CONFIG_FSL_BMAN_TEST_HIGH)+= bman_test_high.o
+bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH)  += bman_test_thresh.o
 
 # Qman
-obj-$(CONFIG_FSL_QMAN) += qman_high.o qman_utility.o
-obj-$(CONFIG_FSL_QMAN_CONFIG)  += qman_config.o qman_driver.o
+obj-$(CONFIG_FSL_QMAN)  += qman_high.o qman_utility.o
+obj-$(CONFIG_FSL_QMAN_CONFIG)   += qman_config.o qman_driver.o
+obj-$(CONFIG_FSL_QMAN_TEST) += qman_tester.o
+qman_tester-y= qman_test.o
+qman_tester-$(CONFIG_FSL_QMAN_TEST_HIGH)+= qman_test_high.o
+qman_tester-$(CONFIG_FSL_QMAN_TEST_STASH_POTATO) += qman_test_hotpotato.o
diff --git a/drivers/staging/fsl_qbman/qman_test.c 
b/drivers/staging/fsl_qbman/qman_test.c
new file mode 100644
index 000..09d8ea6
--- /dev/null
+++ b/drivers/staging/fsl_qbman/qman_test.c
@@ -0,0 +1,57 @@
+/* Copyright 2008-2011 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 

[RFC 08/10] fsl_qman: Add debugfs support

2015-02-04 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: I59a75a91b289193b5ab1d30a08f60119dc4d7568
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/staging/fsl_qbman/Kconfig|7 +
 drivers/staging/fsl_qbman/Makefile   |2 +
 drivers/staging/fsl_qbman/qman_debugfs.c | 1326 ++
 drivers/staging/fsl_qbman/qman_high.c|   58 ++
 drivers/staging/fsl_qbman/qman_private.h |8 +
 include/linux/fsl_qman.h |6 +
 6 files changed, 1407 insertions(+)
 create mode 100644 drivers/staging/fsl_qbman/qman_debugfs.c

diff --git a/drivers/staging/fsl_qbman/Kconfig 
b/drivers/staging/fsl_qbman/Kconfig
index 66a8361..9e2a25f 100644
--- a/drivers/staging/fsl_qbman/Kconfig
+++ b/drivers/staging/fsl_qbman/Kconfig
@@ -125,6 +125,13 @@ config FSL_QMAN_TEST_STASH_POTATO
  across a series of FQs scheduled to different portals (and cpus), with
  DQRR, data and context stashing always on.
 
+config FSL_QMAN_DEBUGFS
+   tristate QMan debugfs interface
+   depends on DEBUG_FS
+   default y
+   ---help---
+ This option compiles debugfs code for QMan.
+
 # H/w settings that can be hard-coded for now.
 config FSL_QMAN_FQD_SZ
int size of Frame Queue Descriptor region
diff --git a/drivers/staging/fsl_qbman/Makefile 
b/drivers/staging/fsl_qbman/Makefile
index 0287eab..5e93fff 100644
--- a/drivers/staging/fsl_qbman/Makefile
+++ b/drivers/staging/fsl_qbman/Makefile
@@ -19,3 +19,5 @@ obj-$(CONFIG_FSL_QMAN_TEST)+= 
qman_tester.o
 qman_tester-y= qman_test.o
 qman_tester-$(CONFIG_FSL_QMAN_TEST_HIGH)+= qman_test_high.o
 qman_tester-$(CONFIG_FSL_QMAN_TEST_STASH_POTATO) += qman_test_hotpotato.o
+obj-$(CONFIG_FSL_QMAN_DEBUGFS)  += qman_debugfs_interface.o
+qman_debugfs_interface-y = qman_debugfs.o
diff --git a/drivers/staging/fsl_qbman/qman_debugfs.c 
b/drivers/staging/fsl_qbman/qman_debugfs.c
new file mode 100644
index 000..f5ab16d
--- /dev/null
+++ b/drivers/staging/fsl_qbman/qman_debugfs.c
@@ -0,0 +1,1326 @@
+/* Copyright 2010-2011 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 qman_private.h
+
+#define MAX_FQID (0x00ff)
+#define QM_FQD_BLOCK_SIZE 64
+#define QM_FQD_AR(0xC10)
+
+static u32 fqid_max;
+static u64 qman_ccsr_start;
+static u64 qman_ccsr_size;
+
+static const char * const state_txt[] = {
+   Out of Service,
+   Retired,
+   Tentatively Scheduled,
+   Truly Scheduled,
+   Parked,
+   Active, Active Held or Held Suspended,
+   Unknown State 6,
+   Unknown State 7,
+   NULL,
+};
+
+static const u8 fqd_states[] = {
+   QM_MCR_NP_STATE_OOS, QM_MCR_NP_STATE_RETIRED, QM_MCR_NP_STATE_TEN_SCHED,
+   QM_MCR_NP_STATE_TRU_SCHED, QM_MCR_NP_STATE_PARKED,
+   QM_MCR_NP_STATE_ACTIVE};
+
+struct mask_to_text {
+   u16 mask;
+   const char *txt;
+};
+
+struct mask_filter_s {
+   u16 mask;
+   u8 filter;
+};
+
+static const struct mask_filter_s mask_filter[] = {
+   {QM_FQCTRL_PREFERINCACHE, 0},
+   {QM_FQCTRL_PREFERINCACHE, 1},
+   {QM_FQCTRL_HOLDACTIVE, 0},
+   

[RFC 05/10] fsl_bman: Add self-tester

2015-02-04 Thread Emil Medve
From: Geoff Thorpe geoff.tho...@freescale.com

Change-Id: If1b44bb013addc1e855c73a4e6ff74bc8b6e4829
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
---
 drivers/staging/fsl_qbman/Kconfig|  26 
 drivers/staging/fsl_qbman/Makefile   |  16 ++-
 drivers/staging/fsl_qbman/bman_test.c|  56 
 drivers/staging/fsl_qbman/bman_test.h|  44 ++
 drivers/staging/fsl_qbman/bman_test_high.c   | 181 +
 drivers/staging/fsl_qbman/bman_test_thresh.c | 196 +++
 6 files changed, 513 insertions(+), 6 deletions(-)
 create mode 100644 drivers/staging/fsl_qbman/bman_test.c
 create mode 100644 drivers/staging/fsl_qbman/bman_test.h
 create mode 100644 drivers/staging/fsl_qbman/bman_test_high.c
 create mode 100644 drivers/staging/fsl_qbman/bman_test_thresh.c

diff --git a/drivers/staging/fsl_qbman/Kconfig 
b/drivers/staging/fsl_qbman/Kconfig
index db90fe5..1875dbf 100644
--- a/drivers/staging/fsl_qbman/Kconfig
+++ b/drivers/staging/fsl_qbman/Kconfig
@@ -48,6 +48,32 @@ config FSL_BMAN_CONFIG
  linux image is running as a guest OS under the hypervisor, only one
  guest OS (the control plane) needs this option.
 
+config FSL_BMAN_TEST
+   tristate BMan self-tests
+   default n
+   ---help---
+ This option compiles self-test code for BMan.
+
+config FSL_BMAN_TEST_HIGH
+   bool BMan high-level self-test
+   depends on FSL_BMAN_TEST
+   default y
+   ---help---
+ This requires the presence of cpu-affine portals, and performs
+ high-level API testing with them (whichever portal(s) are affine to
+ the cpu(s) the test executes on).
+
+config FSL_BMAN_TEST_THRESH
+   bool BMan threshold test
+   depends on FSL_BMAN_TEST
+   default y
+   ---help---
+ Multi-threaded (SMP) test of BMan pool depletion. A pool is seeded
+ before multiple threads (one per cpu) create pool objects to track
+ depletion state changes. The pool is then drained to empty by a
+ drainer thread, and the other threads that they observe exactly
+ the depletion state changes that are expected.
+
 endif # FSL_BMAN
 
 config FSL_QMAN
diff --git a/drivers/staging/fsl_qbman/Makefile 
b/drivers/staging/fsl_qbman/Makefile
index 399d87e..0fcdd84 100644
--- a/drivers/staging/fsl_qbman/Makefile
+++ b/drivers/staging/fsl_qbman/Makefile
@@ -1,11 +1,15 @@
 # Common
-obj-$(CONFIG_FSL_DPA)  += dpa_alloc.o
-obj-$(CONFIG_HAS_FSL_QBMAN)+= qbman_driver.o
+obj-$(CONFIG_FSL_DPA)  += dpa_alloc.o
+obj-$(CONFIG_HAS_FSL_QBMAN)+= qbman_driver.o
 
 # Bman
-obj-$(CONFIG_FSL_BMAN) += bman_high.o
-obj-$(CONFIG_FSL_BMAN_CONFIG)  += bman_config.o bman_driver.o
+obj-$(CONFIG_FSL_BMAN) += bman_high.o
+obj-$(CONFIG_FSL_BMAN_CONFIG)  += bman_config.o bman_driver.o
+obj-$(CONFIG_FSL_BMAN_TEST)+= bman_tester.o
+bman_tester-y   = bman_test.o
+bman_tester-$(CONFIG_FSL_BMAN_TEST_HIGH)   += bman_test_high.o
+bman_tester-$(CONFIG_FSL_BMAN_TEST_THRESH) += bman_test_thresh.o
 
 # Qman
-obj-$(CONFIG_FSL_QMAN) += qman_high.o qman_utility.o
-obj-$(CONFIG_FSL_QMAN_CONFIG)  += qman_config.o qman_driver.o
+obj-$(CONFIG_FSL_QMAN) += qman_high.o qman_utility.o
+obj-$(CONFIG_FSL_QMAN_CONFIG)  += qman_config.o qman_driver.o
diff --git a/drivers/staging/fsl_qbman/bman_test.c 
b/drivers/staging/fsl_qbman/bman_test.c
new file mode 100644
index 000..1a261ee
--- /dev/null
+++ b/drivers/staging/fsl_qbman/bman_test.c
@@ -0,0 +1,56 @@
+/* Copyright 2008-2011 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

[PATCH] powerpc/dts: Remove B4860 emulator support

2015-02-03 Thread Emil Medve
From: Emil Medve emilian.me...@freescale.com

Probably we should have not upstreamed this in the first place

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/boot/dts/b4860emu.dts | 223 -
 1 file changed, 223 deletions(-)
 delete mode 100644 arch/powerpc/boot/dts/b4860emu.dts

diff --git a/arch/powerpc/boot/dts/b4860emu.dts 
b/arch/powerpc/boot/dts/b4860emu.dts
deleted file mode 100644
index 2aa5cd3..000
--- a/arch/powerpc/boot/dts/b4860emu.dts
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * B4860 emulator 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.
- */
-
-/dts-v1/;
-
-/include/ fsl/e6500_power_isa.dtsi
-
-/ {
-   compatible = fsl,B4860;
-   #address-cells = 2;
-   #size-cells = 2;
-   interrupt-parent = mpic;
-
-   aliases {
-   ccsr = soc;
-
-   serial0 = serial0;
-   serial1 = serial1;
-   serial2 = serial2;
-   serial3 = serial3;
-   dma0 = dma0;
-   dma1 = dma1;
-   };
-
-   cpus {
-   #address-cells = 1;
-   #size-cells = 0;
-
-   cpu0: PowerPC,e6500@0 {
-   device_type = cpu;
-   reg = 0 1;
-   next-level-cache = L2;
-   fsl,portid-mapping = 0x8000;
-   };
-   cpu1: PowerPC,e6500@2 {
-   device_type = cpu;
-   reg = 2 3;
-   next-level-cache = L2;
-   fsl,portid-mapping = 0x8000;
-   };
-   cpu2: PowerPC,e6500@4 {
-   device_type = cpu;
-   reg = 4 5;
-   next-level-cache = L2;
-   fsl,portid-mapping = 0x8000;
-   };
-   cpu3: PowerPC,e6500@6 {
-   device_type = cpu;
-   reg = 6 7;
-   next-level-cache = L2;
-   fsl,portid-mapping = 0x8000;
-   };
-   };
-};
-
-/ {
-   model = fsl,B4860QDS;
-   compatible = fsl,B4860EMU, fsl,B4860QDS;
-   #address-cells = 2;
-   #size-cells = 2;
-   interrupt-parent = mpic;
-
-   ifc: localbus@ffe124000 {
-   reg = 0xf 0xfe124000 0 0x2000;
-   ranges = 0 0 0xf 0xe800 0x0800
- 2 0 0xf 0xff80 0x0001
- 3 0 0xf 0xffdf 0x8000;
-
-   nor@0,0 {
-   #address-cells = 1;
-   #size-cells = 1;
-   compatible = cfi-flash;
-   reg = 0x0 0x0 0x800;
-   bank-width = 2;
-   device-width = 1;
-   };
-   };
-
-   memory {
-   device_type = memory;
-   };
-
-   soc: soc@ffe00 {
-   ranges = 0x 0xf 0xfe00 0x100;
-   reg = 0xf 0xfe00 0 0x1000;
-   };
-};
-
-ifc {
-   #address-cells = 2;
-   #size-cells = 1;
-   compatible = fsl,ifc, simple-bus

[PATCH v3] net/fsl_pq_mdio: Document supported compatibles

2015-02-01 Thread Emil Medve
From: Shruti Kanetkar kanetkar.shr...@gmail.com

The device tree binding(s) document has fallen out of sync with the
driver code. Update the list of supported devices to reflect current
driver capabilities

Change-Id: I440d8de2ee2d9c3b7b23e69b3da851cab18a4c9a
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v3: Separated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370870

 Documentation/devicetree/bindings/net/fsl-tsec-phy.txt | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt 
b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
index be6ea896..1e97532 100644
--- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
+++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
@@ -8,7 +8,16 @@ of how to define a PHY.
 Required properties:
   - reg : Offset and length of the register set for the device
   - compatible : Should define the compatible device type for the
-mdio.  Currently, this is most likely to be fsl,gianfar-mdio
+mdio. Currently supported strings/devices are:
+   - fsl,gianfar-tbi
+   - fsl,gianfar-mdio
+   - fsl,etsec2-tbi
+   - fsl,etsec2-mdio
+   - fsl,ucc-mdio
+   - fsl,fman-mdio
+When device_type is mdio, the following strings are also considered:
+   - gianfar
+   - ucc_geth_phy
 
 Example:
 
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v4 1/2] powerpc/corenet: Enable muxing MDIO buses via GPIO

2015-02-01 Thread Emil Medve
From: Andy Fleming aflem...@gmail.com

Change-Id: I4489db79957ad533f4ba3f04fe7d5bcb3288e981
Signed-off-by: Andy Fleming aflem...@gmail.com
Signed-off-by: Shaohui Xie shaohui@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v4: Add 'Signed-off-by'

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370871
Also supersedes http://patchwork.ozlabs.org/patch/423350
Update via 'savedefconfig'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 2 ++
 arch/powerpc/platforms/85xx/corenet_generic.c | 3 +++
 3 files changed, 6 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 7cc3cf8..3cb094a 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -104,6 +104,7 @@ CONFIG_E1000E=y
 CONFIG_VITESSE_PHY=y
 CONFIG_AT803X_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 61838c1..3b9d097 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -82,8 +82,10 @@ CONFIG_DUMMY=y
 CONFIG_FSL_PQ_MDIO=y
 CONFIG_FSL_XGMAC_MDIO=y
 CONFIG_E1000E=y
+CONFIG_PHYLIB=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 1f309cc..0804b10 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -88,6 +88,9 @@ static const struct of_device_id of_device_ids[] = {
.compatible = simple-bus
},
{
+   .compatible = mdio-mux-gpio
+   },
+   {
.compatible = fsl,srio,
},
{
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v4 2/2] powerpc/corenet: Enable muxing MDIO buses via FPGA

2015-02-01 Thread Emil Medve
From: Shruti Kanetkar kanetkar.shr...@gmail.com

Change-Id: I00c521664573808af4f9a9c06a97665db470b49a
Signed-off-by: Andy Fleming aflem...@gmail.com
Signed-off-by: Shaohui Xie shaohui@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v4: Add 'Signed-off-by'

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370873
Also supersedes http://patchwork.ozlabs.org/patch/423348
Update via 'savedefconfig'
Auto-probe devices on 'fsl,fpga-qixis'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 1 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 6 ++
 3 files changed, 8 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 3cb094a..1dc74ee 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -105,6 +105,7 @@ CONFIG_VITESSE_PHY=y
 CONFIG_AT803X_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 3b9d097..c2ff961 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -86,6 +86,7 @@ CONFIG_PHYLIB=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 0804b10..63bef30 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -91,6 +91,12 @@ static const struct of_device_id of_device_ids[] = {
.compatible = mdio-mux-gpio
},
{
+   .compatible = fsl,fpga-ngpixis
+   },
+   {
+   .compatible = fsl,fpga-qixis
+   },
+   {
.compatible = fsl,srio,
},
{
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v6 1/2] powerpc/mpc85xx: Add FSL QorIQ DPAA BMan support to device tree(s)

2015-02-01 Thread Emil Medve
From: Kumar Gala ga...@kernel.crashing.org

Change-Id: If643fa5ba0a903aef8f5056a2c90ebecc995b760
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
Signed-off-by: Chunhe Lan chunhe@freescale.com
Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v6: Rebased

 arch/powerpc/boot/dts/b4qds.dtsi|  17 +-
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  60 ++-
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi|  89 +-
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  37 +++-
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  65 ++-
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 105 ++-
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 265 +++-
 arch/powerpc/boot/dts/kmcoge4.dts   |  15 ++
 arch/powerpc/boot/dts/oca4080.dts   |  15 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  18 +-
 arch/powerpc/boot/dts/p2041rdb.dts  |  17 +-
 arch/powerpc/boot/dts/p3041ds.dts   |  17 +-
 arch/powerpc/boot/dts/p4080ds.dts   |  17 +-
 arch/powerpc/boot/dts/p5020ds.dts   |  17 +-
 arch/powerpc/boot/dts/p5040ds.dts   |  17 +-
 arch/powerpc/boot/dts/t104xqds.dtsi |  17 +-
 arch/powerpc/boot/dts/t104xrdb.dtsi |  14 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  17 +-
 arch/powerpc/boot/dts/t208xrdb.dtsi |  15 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  17 +-
 arch/powerpc/boot/dts/t4240rdb.dts  |  15 ++
 26 files changed, 899 insertions(+), 22 deletions(-)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index e5bde0b..24ed80d 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420DS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -97,10 +97,25 @@
device_type = memory;
};
 
+   reserved-memory {
+   #address-cells = 2;
+   #size-cells = 2;
+   ranges;
+
+   bman_fbpr: bman-fbpr {
+   size = 0 0x100;
+   alignment = 0 0x100;
+   };
+   };
+
dcsr: dcsr@f {
ranges = 0x 0xf 0x 0x01052000;
};
 
+   bportals: bman-portals@ff400 {
+   ranges = 0x0 0xf 0xf400 0x200;
+   };
+
soc: soc@ffe00 {
ranges = 0x 0xf 0xfe00 0x100;
reg = 0xf 0xfe00 0 0x1000;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index d0a5cde..68b9a05 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4860 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -109,6 +109,64 @@
};
 };
 
+bportals {
+   bman-portal@38000 {
+   compatible = fsl,bman-portal;
+   reg = 0x38000 0x4000, 0x100e000 0x1000;
+   interrupts = 133 2 0 0;
+   };
+   bman-portal@3c000 {
+   compatible = fsl,bman-portal;
+   reg = 0x3c000 0x4000, 0x100f000 0x1000;
+   interrupts = 135 2 0 0;
+   };
+   bman-portal@4 {
+   compatible = fsl,bman-portal;
+   reg = 0x4 0x4000, 0x101 0x1000;
+   interrupts = 137 2 0 0;
+   };
+   bman-portal@44000 {
+   compatible = fsl,bman-portal;
+   reg = 0x44000 0x4000, 0x1011000 0x1000;
+   interrupts = 139 2 0 0;
+   };
+   bman-portal@48000 {
+   compatible = fsl,bman-portal;
+   reg = 0x48000 0x4000, 0x1012000 0x1000;
+   interrupts = 141 2 0 0;
+   };
+   bman-portal@4c000 {
+   compatible = fsl,bman-portal;
+   reg = 0x4c000 0x4000, 0x1013000 0x1000;
+   interrupts = 143 2 0 0;
+   };
+   bman-portal@5 {
+   compatible = fsl,bman

[PATCH v6 2/2] powerpc/mpc85xx: Add FSL QorIQ DPAA QMan support to device tree(s)

2015-02-01 Thread Emil Medve
From: Kumar Gala ga...@kernel.crashing.org

Change-Id: If643fa5ba0a903aef8f5056a2c90ebecc995b760
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
Signed-off-by: Chunhe Lan chunhe@freescale.com
Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v6: Rebased

 arch/powerpc/boot/dts/b4qds.dtsi|  12 ++
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  69 ++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi| 106 ++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  43 
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  78 +++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 126 +++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 318 
 arch/powerpc/boot/dts/kmcoge4.dts   |  12 ++
 arch/powerpc/boot/dts/oca4080.dts   |  12 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p2041rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p3041ds.dts   |  12 ++
 arch/powerpc/boot/dts/p4080ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5020ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5040ds.dts   |  12 ++
 arch/powerpc/boot/dts/t104xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t104xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  12 ++
 arch/powerpc/boot/dts/t4240rdb.dts  |  12 ++
 26 files changed, 985 insertions(+)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index 24ed80d..559d006 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -106,6 +106,14 @@
size = 0 0x100;
alignment = 0 0x100;
};
+   qman_fqd: qman-fqd {
+   size = 0 0x40;
+   alignment = 0 0x40;
+   };
+   qman_pfdr: qman-pfdr {
+   size = 0 0x200;
+   alignment = 0 0x200;
+   };
};
 
dcsr: dcsr@f {
@@ -116,6 +124,10 @@
ranges = 0x0 0xf 0xf400 0x200;
};
 
+   qportals: qman-portals@ff600 {
+   ranges = 0x0 0xf 0xf600 0x200;
+   };
+
soc: soc@ffe00 {
ranges = 0x 0xf 0xfe00 0x100;
reg = 0xf 0xfe00 0 0x1000;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index 68b9a05..02ccde6 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -167,6 +167,75 @@
};
 };
 
+qportals {
+   qportal14: qman-portal@38000 {
+   compatible = fsl,qman-portal;
+   reg = 0x38000 0x4000, 0x100e000 0x1000;
+   interrupts = 132 0x2 0 0;
+   fsl,qman-channel-id = 0xe;
+   };
+   qportal15: qman-portal@3c000 {
+   compatible = fsl,qman-portal;
+   reg = 0x3c000 0x4000, 0x100f000 0x1000;
+   interrupts = 134 0x2 0 0;
+   fsl,qman-channel-id = 0xf;
+   };
+   qportal16: qman-portal@4 {
+   compatible = fsl,qman-portal;
+   reg = 0x4 0x4000, 0x101 0x1000;
+   interrupts = 136 0x2 0 0;
+   fsl,qman-channel-id = 0x10;
+   };
+   qportal17: qman-portal@44000 {
+   compatible = fsl,qman-portal;
+   reg = 0x44000 0x4000, 0x1011000 0x1000;
+   interrupts = 138 0x2 0 0;
+   fsl,qman-channel-id = 0x11;
+   };
+   qportal18: qman-portal@48000 {
+   compatible = fsl,qman-portal;
+   reg = 0x48000 0x4000, 0x1012000 0x1000;
+   interrupts = 140 0x2 0 0;
+   fsl,qman-channel-id = 0x12;
+   };
+   qportal19: qman-portal@4c000 {
+   compatible = fsl,qman-portal;
+   reg = 0x4c000 0x4000, 0x1013000 0x1000;
+   interrupts = 142 0x2 0 0;
+   fsl,qman-channel-id = 0x13;
+   };
+   qportal20: qman-portal@5 {
+   compatible = fsl,qman-portal;
+   reg = 0x5 0x4000, 0x1014000 0x1000;
+   interrupts = 144 0x2 0 0;
+   fsl,qman-channel-id = 0x14;
+   };
+   qportal21: qman-portal@54000

Re: [v5, 5/6] powerpc/mpc85xx: Add FSL QorIQ DPAA BMan support to device tree(s)

2015-01-30 Thread Emil Medve
Hello Scott,


On 01/29/2015 11:03 PM, Scott Wood wrote:
 On Mon, Dec 08, 2014 at 04:29:20AM -0600, Emil Medve wrote:
 From: Kumar Gala ga...@kernel.crashing.org

 Change-Id: If643fa5ba0a903aef8f5056a2c90ebecc995b760
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
 Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
 Signed-off-by: Chunhe Lan chunhe@freescale.com
 Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
 [Emil Medve: Sync with the upstream binding]
 Signed-off-by: Emil Medve emilian.me...@freescale.com
 
 Doesn't apply cleanly
 
 @@ -408,6 +415,8 @@ crypto: crypto@30 {
  fsl,iommu-parent = pamu1;
  };
  
 +/include/ qoriq-bman1.dtsi
 +
  /include/ qoriq-fman-0.dtsi
  /include/ qoriq-fman-0-1g-0.dtsi
  /include/ qoriq-fman-0-1g-1.dtsi
 
 What tree did you base these patches on?  There's no fman in the upstream
 device trees yet (just a binding).

They were based on this patch series:
http://patchwork.ozlabs.org/patch/370866. Will re-send


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock

2015-01-28 Thread Emil Medve
Hello Mike,


On 01/28/2015 12:15 PM, Mike Turquette wrote:
 Quoting Emil Medve (2015-01-21 02:03:22)
 Based on clk-next from 
 git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git

 v2: Rebased as several prerequisite patches (including a file rename) got
 applied upstream

 Emil Medve (9):
   clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT
   clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
   clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT
   clk: qoriq: Fix checkpatch type OOM_MESSAGE
   clk: qoriq: Make local symbol 'static'
   clk: qoriq: Replace kzalloc() with kmalloc()
   clk: qoriq: Use pr_fmt()
 
 Patches 1-7 applied to clk-next towards 3.20

Thank you

 I'd prefer some
 reviewed-by's from your peers at freescale for the clock driver
 correctness.

That's fair

   powerpc/corenet: Enable CLK_QORIQ

I was thinking Scott can pick this up

   clk: qoriq: Add support for the platform PLL

I'll get Yuan-Tian to review this

 Igal Liberman (1):
   clk: qoriq: Add support for the FMan clock

Scott, I'd appreciate your help here


Cheers,


  arch/powerpc/configs/corenet32_smp_defconfig |   1 +
  arch/powerpc/configs/corenet64_smp_defconfig |   1 +
  drivers/clk/clk-qoriq.c  | 378 
 +--
  3 files changed, 357 insertions(+), 23 deletions(-)

 -- 
 2.2.1
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 2/2] powerpc/corenet: Enable muxing MDIO buses via FPGA

2015-01-22 Thread Emil Medve
From: Shruti Kanetkar shr...@freescale.com

Change-Id: I00c521664573808af4f9a9c06a97665db470b49a
Signed-off-by: Andy Fleming aflem...@gmail.com
Signed-off-by: Shaohui Xie shaohui@freescale.com
Signed-off-by: Shruti Kanetkar shr...@freescale.com
---

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370873
Also supersedes http://patchwork.ozlabs.org/patch/423348
Update via 'savedefconfig'
Auto-probe devices on 'fsl,fpga-qixis'

arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 1 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 6 ++
 3 files changed, 8 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 5ccedc1..869270c 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -104,6 +104,7 @@ CONFIG_VITESSE_PHY=y
 CONFIG_AT803X_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index ce16278..00c49b0 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -82,6 +82,7 @@ CONFIG_DUMMY=y
 CONFIG_E1000E=y
 CONFIG_PHYLIB=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 0804b10..63bef30 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -91,6 +91,12 @@ static const struct of_device_id of_device_ids[] = {
.compatible = mdio-mux-gpio
},
{
+   .compatible = fsl,fpga-ngpixis
+   },
+   {
+   .compatible = fsl,fpga-qixis
+   },
+   {
.compatible = fsl,srio,
},
{
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 1/2] powerpc/corenet: Enable muxing MDIO buses via GPIO

2015-01-22 Thread Emil Medve
From: Andy Fleming aflem...@gmail.com

Change-Id: I4489db79957ad533f4ba3f04fe7d5bcb3288e981
Signed-off-by: Andy Fleming aflem...@gmail.com
Signed-off-by: Shaohui Xie shaohui@freescale.com
Signed-off-by: Shruti Kanetkar shr...@freescale.com
---

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370871
Also supersedes http://patchwork.ozlabs.org/patch/423350
Update via 'savedefconfig'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 2 ++
 arch/powerpc/platforms/85xx/corenet_generic.c | 3 +++
 3 files changed, 6 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 611efe9..5ccedc1 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -103,6 +103,7 @@ CONFIG_E1000E=y
 CONFIG_VITESSE_PHY=y
 CONFIG_AT803X_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index be24a18..ce16278 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -80,6 +80,8 @@ CONFIG_SATA_SIL24=y
 CONFIG_NETDEVICES=y
 CONFIG_DUMMY=y
 CONFIG_E1000E=y
+CONFIG_PHYLIB=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 1f309cc..0804b10 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -88,6 +88,9 @@ static const struct of_device_id of_device_ids[] = {
.compatible = simple-bus
},
{
+   .compatible = mdio-mux-gpio
+   },
+   {
.compatible = fsl,srio,
},
{
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: Remove duplicate tlbcam_index declarations

2015-01-21 Thread Emil Medve
They seem to be leftovers from '14cf11a powerpc: Merge enough to start
building in arch/powerpc'

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/mm/fsl_booke_mmu.c | 2 --
 arch/powerpc/mm/pgtable_32.c| 1 -
 2 files changed, 3 deletions(-)

diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index 94cd728..b46912f 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -67,8 +67,6 @@ struct tlbcamrange {
phys_addr_t phys;
 } tlbcam_addrs[NUM_TLBCAMS];
 
-extern unsigned int tlbcam_index;
-
 unsigned long tlbcam_sz(int idx)
 {
return tlbcam_addrs[idx].limit - tlbcam_addrs[idx].start + 1;
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 50fad38..6eec886 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -63,7 +63,6 @@ void setbat(int index, unsigned long virt, phys_addr_t phys,
 #endif /* HAVE_BATS */
 
 #ifdef HAVE_TLBCAM
-extern unsigned int tlbcam_index;
 extern phys_addr_t v_mapped_by_tlbcam(unsigned long va);
 extern unsigned long p_mapped_by_tlbcam(phys_addr_t pa);
 #else /* !HAVE_TLBCAM */
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: Replace cpumask_weight(cpu_possible_mask) with num_possible_cpus()

2015-01-21 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/platforms/cell/smp.c| 2 +-
 arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 +-
 arch/powerpc/sysdev/mpic.c   | 2 +-
 arch/powerpc/sysdev/xics/xics-common.c   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/cell/smp.c 
b/arch/powerpc/platforms/cell/smp.c
index c8017a7..b64e7ea 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -106,7 +106,7 @@ static int __init smp_iic_probe(void)
 {
iic_request_IPIs();
 
-   return cpumask_weight(cpu_possible_mask);
+   return num_possible_cpus();
 }
 
 static void smp_cell_setup_cpu(int cpu)
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c 
b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index f30cf4d..6247544 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -272,7 +272,7 @@ static int pseries_add_processor(struct device_node *np)
 */
printk(KERN_ERR Cannot add cpu %s; this system configuration
supports %d logical cpus.\n, np-full_name,
-  cpumask_weight(cpu_possible_mask));
+  num_possible_cpus());
goto out_unlock;
}
 
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index c4648ad..bbfbbf2 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1929,7 +1929,7 @@ int __init smp_mpic_probe(void)
 
DBG(smp_mpic_probe()...\n);
 
-   nr_cpus = cpumask_weight(cpu_possible_mask);
+   nr_cpus = num_possible_cpus();
 
DBG(nr_cpus: %d\n, nr_cpus);
 
diff --git a/arch/powerpc/sysdev/xics/xics-common.c 
b/arch/powerpc/sysdev/xics/xics-common.c
index 365249c..125743b 100644
--- a/arch/powerpc/sysdev/xics/xics-common.c
+++ b/arch/powerpc/sysdev/xics/xics-common.c
@@ -148,7 +148,7 @@ int __init xics_smp_probe(void)
/* Register all the IPIs */
xics_request_ipi();
 
-   return cpumask_weight(cpu_possible_mask);
+   return num_possible_cpus();
 }
 
 #endif /* CONFIG_SMP */
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/dts: Remove T4240 emulator support

2015-01-21 Thread Emil Medve
Probably we should have not upstreamed this in the first place

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/boot/dts/t4240emu.dts | 281 -
 1 file changed, 281 deletions(-)
 delete mode 100644 arch/powerpc/boot/dts/t4240emu.dts

diff --git a/arch/powerpc/boot/dts/t4240emu.dts 
b/arch/powerpc/boot/dts/t4240emu.dts
deleted file mode 100644
index decaf35..000
--- a/arch/powerpc/boot/dts/t4240emu.dts
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * T4240 emulator 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.
- */
-
-/dts-v1/;
-
-/include/ fsl/e6500_power_isa.dtsi
-/ {
-   compatible = fsl,T4240;
-   #address-cells = 2;
-   #size-cells = 2;
-   interrupt-parent = mpic;
-
-   aliases {
-   ccsr = soc;
-
-   serial0 = serial0;
-   serial1 = serial1;
-   serial2 = serial2;
-   serial3 = serial3;
-   dma0 = dma0;
-   dma1 = dma1;
-   };
-
-   cpus {
-   #address-cells = 1;
-   #size-cells = 0;
-
-   cpu0: PowerPC,e6500@0 {
-   device_type = cpu;
-   reg = 0 1;
-   next-level-cache = L2_1;
-   fsl,portid-mapping = 0x8000;
-   };
-   cpu1: PowerPC,e6500@2 {
-   device_type = cpu;
-   reg = 2 3;
-   next-level-cache = L2_1;
-   fsl,portid-mapping = 0x8000;
-   };
-   cpu2: PowerPC,e6500@4 {
-   device_type = cpu;
-   reg = 4 5;
-   next-level-cache = L2_1;
-   fsl,portid-mapping = 0x8000;
-   };
-   cpu3: PowerPC,e6500@6 {
-   device_type = cpu;
-   reg = 6 7;
-   next-level-cache = L2_1;
-   fsl,portid-mapping = 0x8000;
-   };
-
-   cpu4: PowerPC,e6500@8 {
-   device_type = cpu;
-   reg = 8 9;
-   next-level-cache = L2_2;
-   fsl,portid-mapping = 0x4000;
-   };
-   cpu5: PowerPC,e6500@10 {
-   device_type = cpu;
-   reg = 10 11;
-   next-level-cache = L2_2;
-   fsl,portid-mapping = 0x4000;
-   };
-   cpu6: PowerPC,e6500@12 {
-   device_type = cpu;
-   reg = 12 13;
-   next-level-cache = L2_2;
-   fsl,portid-mapping = 0x4000;
-   };
-   cpu7: PowerPC,e6500@14 {
-   device_type = cpu;
-   reg = 14 15;
-   next-level-cache = L2_2;
-   fsl,portid-mapping = 0x4000;
-   };
-
-   cpu8: PowerPC,e6500@16 {
-   device_type = cpu;
-   reg = 16 17;
-   next

Re: [PATCH] powerpc: Replace cpumask_weight(cpu_possible_mask) with num_possible_cpus()

2015-01-21 Thread Emil Medve
Hello Michael,


On 01/21/2015 07:12 PM, Michael Ellerman wrote:
 On Wed, 2015-01-21 at 16:21 -0600, Emil Medve wrote:
 Signed-off-by: Emil Medve emilian.me...@freescale.com
 
 Why?
 
 Because:
 
#define num_possible_cpus()cpumask_weight(cpu_possible_mask)
 
 
 But please say so in future. I'll fix it up this time.

Thank you


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 06/10] clk: qoriq: Replace kzalloc() with kmalloc()

2015-01-21 Thread Emil Medve
Where the memset() is not necessary

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-qoriq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 07936a3..4b44825 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -193,7 +193,7 @@ static void __init core_pll_init(struct device_node *np)
if (!subclks)
goto err_map;
 
-   onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
+   onecell_data = kmalloc(sizeof(*onecell_data), GFP_KERNEL);
if (!onecell_data)
goto err_clks;
 
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 09/10] clk: qoriq: Add support for the platform PLL

2015-01-21 Thread Emil Medve
Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-qoriq.c | 83 +
 1 file changed, 83 insertions(+)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 07bdfc5..cda90a9 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -271,9 +271,92 @@ static void __init sysclk_init(struct device_node *node)
if (!IS_ERR(clk))
of_clk_add_provider(np, of_clk_src_simple_get, clk);
 }
+
+static void __init pltfrm_pll_init(struct device_node *np)
+{
+   void __iomem *base;
+   uint32_t mult;
+   const char *parent_name, *clk_name;
+   int i, _errno;
+   struct clk_onecell_data *cod;
+
+   base = of_iomap(np, 0);
+   if (!base) {
+   pr_err(%s(): %s: of_iomap() failed\n, __func__, np-name);
+   return;
+   }
+
+   /* Get the multiple of PLL */
+   mult = ioread32be(base);
+
+   iounmap(base);
+
+   /* Check if this PLL is disabled */
+   if (mult  PLL_KILL) {
+   pr_debug(%s(): %s: Disabled\n, __func__, np-name);
+   return;
+   }
+   mult = (mult  GENMASK(6, 1))  1;
+
+   parent_name = of_clk_get_parent_name(np, 0);
+   if (!parent_name) {
+   pr_err(%s(): %s: of_clk_get_parent_name() failed\n,
+  __func__, np-name);
+   return;
+   }
+
+   i = of_property_count_strings(np, clock-output-names);
+   if (i  0) {
+   pr_err(%s(): %s: of_property_count_strings(clock-output-names) 
= %d\n,
+  __func__, np-name, i);
+   return;
+   }
+
+   cod = kmalloc(sizeof(*cod) + i * sizeof(struct clk *), GFP_KERNEL);
+   if (!cod)
+   return;
+   cod-clks = (struct clk **)(cod + 1);
+   cod-clk_num = i;
+
+   for (i = 0; i  cod-clk_num; i++) {
+   _errno = of_property_read_string_index(np, clock-output-names,
+  i, clk_name);
+   if (_errno  0) {
+   pr_err(%s(): %s: 
of_property_read_string_index(clock-output-names) = %d\n,
+  __func__, np-name, _errno);
+   goto return_clk_unregister;
+   }
+
+   cod-clks[i] = clk_register_fixed_factor(NULL, clk_name,
+  parent_name, 0, mult, 1 + i);
+   if (IS_ERR(cod-clks[i])) {
+   pr_err(%s(): %s: clk_register_fixed_factor(%s) = 
%ld\n,
+  __func__, np-name,
+  clk_name, PTR_ERR(cod-clks[i]));
+   goto return_clk_unregister;
+   }
+   }
+
+   _errno = of_clk_add_provider(np, of_clk_src_onecell_get, cod);
+   if (_errno  0) {
+   pr_err(%s(): %s: of_clk_add_provider() = %d\n,
+  __func__, np-name, _errno);
+   goto return_clk_unregister;
+   }
+
+   return;
+
+return_clk_unregister:
+   while (--i = 0)
+   clk_unregister(cod-clks[i]);
+   kfree(cod);
+}
+
 CLK_OF_DECLARE(qoriq_sysclk_1, fsl,qoriq-sysclk-1.0, sysclk_init);
 CLK_OF_DECLARE(qoriq_sysclk_2, fsl,qoriq-sysclk-2.0, sysclk_init);
 CLK_OF_DECLARE(qoriq_core_pll_1, fsl,qoriq-core-pll-1.0, core_pll_init);
 CLK_OF_DECLARE(qoriq_core_pll_2, fsl,qoriq-core-pll-2.0, core_pll_init);
 CLK_OF_DECLARE(qoriq_core_mux_1, fsl,qoriq-core-mux-1.0, core_mux_init);
 CLK_OF_DECLARE(qoriq_core_mux_2, fsl,qoriq-core-mux-2.0, core_mux_init);
+CLK_OF_DECLARE(qoriq_pltfrm_pll_1, fsl,qoriq-platform-pll-1.0, 
pltfrm_pll_init);
+CLK_OF_DECLARE(qoriq_pltfrm_pll_2, fsl,qoriq-platform-pll-2.0, 
pltfrm_pll_init);
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 01/10] clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT

2015-01-21 Thread Emil Medve
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+   rc = of_property_read_string_index(np, clock-output-names,
+   0, clk_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+   pr_err(Could not register clock provider for node:%s\n,
+np-name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+   rc = of_property_read_string_index(np, clock-output-names,
+   i, clk_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+   pr_err(Could not register clk provider for node:%s\n,
+np-name);

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-qoriq.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index f9b7eb4..90ff685 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -121,7 +121,7 @@ static void __init core_mux_init(struct device_node *np)
cmux_clk-flags = CLKSEL_ADJUST;
 
rc = of_property_read_string_index(np, clock-output-names,
-   0, clk_name);
+  0, clk_name);
if (rc) {
pr_err(%s: read clock names error\n, np-name);
goto err_clk;
@@ -143,7 +143,7 @@ static void __init core_mux_init(struct device_node *np)
rc = of_clk_add_provider(np, of_clk_src_simple_get, clk);
if (rc) {
pr_err(Could not register clock provider for node:%s\n,
-np-name);
+  np-name);
goto err_clk;
}
goto err_name;
@@ -206,7 +206,7 @@ static void __init core_pll_init(struct device_node *np)
 
for (i = 0; i  count; i++) {
rc = of_property_read_string_index(np, clock-output-names,
-   i, clk_name);
+  i, clk_name);
if (rc) {
pr_err(%s: could not get clock names\n, np-name);
goto err_cell;
@@ -238,7 +238,7 @@ static void __init core_pll_init(struct device_node *np)
rc = of_clk_add_provider(np, of_clk_src_onecell_get, onecell_data);
if (rc) {
pr_err(Could not register clk provider for node:%s\n,
-np-name);
+  np-name);
goto err_cell;
}
 
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 00/10] clk: qoriq: Add support for the FMan clock

2015-01-21 Thread Emil Medve
Based on clk-next from 
git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git

v2: Rebased as several prerequisite patches (including a file rename) got
applied upstream

Emil Medve (9):
  clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT
  clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
  clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT
  clk: qoriq: Fix checkpatch type OOM_MESSAGE
  clk: qoriq: Make local symbol 'static'
  clk: qoriq: Replace kzalloc() with kmalloc()
  clk: qoriq: Use pr_fmt()
  powerpc/corenet: Enable CLK_QORIQ
  clk: qoriq: Add support for the platform PLL

Igal Liberman (1):
  clk: qoriq: Add support for the FMan clock

 arch/powerpc/configs/corenet32_smp_defconfig |   1 +
 arch/powerpc/configs/corenet64_smp_defconfig |   1 +
 drivers/clk/clk-qoriq.c  | 378 +--
 3 files changed, 357 insertions(+), 23 deletions(-)

-- 
2.2.1
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 05/10] clk: qoriq: Make local symbol 'static'

2015-01-21 Thread Emil Medve
drivers/clk/clk-qoriq.c:59:22: warning: symbol 'cmux_ops' was not declared. 
Should it be static?

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-qoriq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index e25dea9..07936a3 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -56,7 +56,7 @@ static u8 cmux_get_parent(struct clk_hw *hw)
return clksel;
 }
 
-const struct clk_ops cmux_ops = {
+static const struct clk_ops cmux_ops = {
.get_parent = cmux_get_parent,
.set_parent = cmux_set_parent,
 };
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 10/10] clk: qoriq: Add support for the FMan clock

2015-01-21 Thread Emil Medve
From: Igal Liberman igal.liber...@freescale.com

Change-Id: Ide452600ece9fdd7028a27556d2f1ab3bddd3aa5
Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 drivers/clk/clk-qoriq.c | 253 
 1 file changed, 253 insertions(+)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index cda90a9..afa81cd 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -19,6 +19,8 @@
 #include linux/of.h
 #include linux/slab.h
 
+#include asm/fsl_guts.h
+
 struct cmux_clk {
struct clk_hw hw;
void __iomem *reg;
@@ -155,6 +157,256 @@ err_name:
kfree(parent_names);
 }
 
+/* Table for matching compatible strings, for device tree
+ * guts node, for QorIQ SOCs.
+ * fsl,qoriq-device-config-2.0 corresponds to T4  B4
+ * SOCs. For the older SOCs fsl,qoriq-device-config-1.0
+ * string would be used.
+ */
+
+static const struct of_device_id guts_device_ids[] = {
+   { .compatible = fsl,qoriq-device-config-1.0, },
+   { .compatible = fsl,qoriq-device-config-2.0, },
+   {}
+};
+
+/* P2, P3, P4, P5 */
+#define FM1_CLK_SEL_SHIFT  30
+#define FM1_CLK_SELBIT(FM1_CLK_SEL_SHIFT)
+#define FM2_CLK_SEL_SHIFT  29
+#define FM2_CLK_SELBIT(FM2_CLK_SEL_SHIFT)
+#define HWA_ASYNC_DIV_SHIFT26
+#define HWA_ASYNC_DIV  BIT(HWA_ASYNC_DIV_SHIFT)
+
+/* B4, T2 */
+#define HWA_CGA_M1_CLK_SEL_SHIFT   29
+#define HWA_CGA_M1_CLK_SEL (BIT(HWA_CGA_M1_CLK_SEL_SHIFT + 2) |\
+BIT(HWA_CGA_M1_CLK_SEL_SHIFT + 1) |\
+BIT(HWA_CGA_M1_CLK_SEL_SHIFT))
+
+/* T4240 */
+#define HWA_CGB_M1_CLK_SEL_SHIFT   26
+#define HWA_CGB_M1_CLK_SEL (BIT(HWA_CGB_M1_CLK_SEL_SHIFT + 2) |\
+BIT(HWA_CGB_M1_CLK_SEL_SHIFT + 1) |\
+BIT(HWA_CGB_M1_CLK_SEL_SHIFT))
+#define HWA_CGB_M2_CLK_SEL_SHIFT   3
+#define HWA_CGB_M2_CLK_SEL (BIT(HWA_CGB_M2_CLK_SEL_SHIFT + 2) |\
+BIT(HWA_CGB_M2_CLK_SEL_SHIFT + 1) |\
+BIT(HWA_CGB_M2_CLK_SEL_SHIFT))
+
+static u8 get_fm_clk_parent(struct clk_hw *hw)
+{
+   struct ccsr_guts __iomem *guts_regs = NULL;
+   struct device_node *guts;
+   uint32_t reg = 0;
+   int clk_src = 0;
+   int fm_clk_select = -EINVAL;
+   int fm_id = 0;
+
+   guts = of_find_matching_node(NULL, guts_device_ids);
+   if (!guts) {
+   pr_err(could not find GUTS node\n);
+   return -EINVAL;
+   }
+
+   guts_regs = of_iomap(guts, 0);
+   of_node_put(guts);
+   if (!guts_regs) {
+   pr_err(ioremap of GUTS node failed\n);
+   return -EINVAL;
+   }
+
+   if (!strcmp(__clk_get_name(hw-clk), fm1-clk))
+   fm_id = 1;
+
+   /* The FM clock provider is SoC dependent and it's determened by the
+* reset configuration word (RCW). We need to map the RCW options to
+* the order of the providers in the device tree.
+* This code makes assumptions about the clock provider order:
+* In the P family:
+*  0 - platform clock/2
+*  1 - PLLx /2
+*  2 - PLLx /4 (if possible).
+* In B/T family:
+*  The same order in which the clock providers are described in
+*  the Reference Manual, starting from 0.
+*
+* In a case of only one possible provider, the index is 0.
+*/
+
+   if (of_device_is_compatible(guts, fsl,p1023-guts) ||
+   of_device_is_compatible(guts, fsl,t1040-device-config)) {
+   /* P1023 and T1040 have only one optional clock source */
+   fm_clk_select = 0;
+   } else if (of_device_is_compatible(guts, fsl,p2041-device-config) ||
+  of_device_is_compatible(guts, fsl,p3041-device-config) ||
+  of_device_is_compatible(guts, fsl,p4080-device-config)) {
+   /* Read RCW*/
+   reg = ioread32be(guts_regs-rcwsr[7]);
+
+   /* Check bit 225 or bit 226 (FM2, P4080)
+* 0 - The clock source is Platform PLL /2
+* 1 - The clock source is PLL2 /2 (P2, P3) or PLL3 /2 (P4)
+*
+* Bit 225 represents FM1, Bit 226 represents FM2
+*/
+   if (fm_id == 0)
+   fm_clk_select = (reg  FM1_CLK_SEL) 
+   FM1_CLK_SEL_SHIFT;
+   else
+   fm_clk_select = (reg  FM2_CLK_SEL) 
+   FM2_CLK_SEL_SHIFT;
+   } else if (of_device_is_compatible(guts, fsl,p5020-device-config) ||
+  of_device_is_compatible(guts, fsl,p5040-device-config)) {
+   /* Read 

[PATCH v2 04/10] clk: qoriq: Fix checkpatch type OOM_MESSAGE

2015-01-21 Thread Emil Medve
WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+   if (!parent_names) {
+   pr_err(%s: could not allocate parent_names\n, __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+   if (!cmux_clk) {
+   pr_err(%s: could not allocate cmux_clk\n, __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+   if (!subclks) {
+   pr_err(%s: could not allocate subclks\n, __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+   if (!onecell_data) {
+   pr_err(%s: could not allocate onecell_data\n, __func__);

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-qoriq.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index a1cd137..e25dea9 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -86,19 +86,16 @@ static void __init core_mux_init(struct device_node *np)
return;
}
parent_names = kcalloc(count, sizeof(char *), GFP_KERNEL);
-   if (!parent_names) {
-   pr_err(%s: could not allocate parent_names\n, __func__);
+   if (!parent_names)
return;
-   }
 
for (i = 0; i  count; i++)
parent_names[i] = of_clk_get_parent_name(np, i);
 
cmux_clk = kzalloc(sizeof(*cmux_clk), GFP_KERNEL);
-   if (!cmux_clk) {
-   pr_err(%s: could not allocate cmux_clk\n, __func__);
+   if (!cmux_clk)
goto err_name;
-   }
+
cmux_clk-reg = of_iomap(np, 0);
if (!cmux_clk-reg) {
pr_err(%s: could not map register\n, __func__);
@@ -193,16 +190,12 @@ static void __init core_pll_init(struct device_node *np)
}
 
subclks = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
-   if (!subclks) {
-   pr_err(%s: could not allocate subclks\n, __func__);
+   if (!subclks)
goto err_map;
-   }
 
onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
-   if (!onecell_data) {
-   pr_err(%s: could not allocate onecell_data\n, __func__);
+   if (!onecell_data)
goto err_clks;
-   }
 
for (i = 0; i  count; i++) {
rc = of_property_read_string_index(np, clock-output-names,
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 07/10] clk: qoriq: Use pr_fmt()

2015-01-21 Thread Emil Medve
Currently a mix of clk-qoriq/qoriq-clk and no prefix is used

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-qoriq.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 4b44825..07bdfc5 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -7,6 +7,9 @@
  *
  * clock driver for Freescale QorIQ SoCs.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/clk-provider.h
 #include linux/io.h
 #include linux/kernel.h
@@ -163,7 +166,7 @@ static void __init core_pll_init(struct device_node *np)
 
base = of_iomap(np, 0);
if (!base) {
-   pr_err(clk-qoriq: iomap error\n);
+   pr_err(iomap error\n);
return;
}
 
@@ -253,7 +256,7 @@ static void __init sysclk_init(struct device_node *node)
u32 rate;
 
if (!np) {
-   pr_err(qoriq-clk: could not get parent node\n);
+   pr_err(could not get parent node\n);
return;
}
 
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 02/10] clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY

2015-01-21 Thread Emil Medve
WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply
+   subclks = kzalloc(sizeof(struct clk *) * count, GFP_KERNEL);

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-qoriq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 90ff685..475ce1c 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -85,7 +85,7 @@ static void __init core_mux_init(struct device_node *np)
pr_err(%s: get clock count error\n, np-name);
return;
}
-   parent_names = kzalloc((sizeof(char *) * count), GFP_KERNEL);
+   parent_names = kcalloc(count, sizeof(char *), GFP_KERNEL);
if (!parent_names) {
pr_err(%s: could not allocate parent_names\n, __func__);
return;
@@ -192,7 +192,7 @@ static void __init core_pll_init(struct device_node *np)
goto err_map;
}
 
-   subclks = kzalloc(sizeof(struct clk *) * count, GFP_KERNEL);
+   subclks = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
if (!subclks) {
pr_err(%s: could not allocate subclks\n, __func__);
goto err_map;
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 08/10] powerpc/corenet: Enable CLK_QORIQ

2015-01-21 Thread Emil Medve
Change-Id: I1a80ad7b9f6854791bd270b746f93a91439155a6
Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/configs/corenet32_smp_defconfig | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 611efe9..cce62e9 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -147,6 +147,7 @@ CONFIG_STAGING=y
 CONFIG_MEMORY=y
 CONFIG_VIRT_DRIVERS=y
 CONFIG_FSL_HV_MANAGER=y
+CONFIG_CLK_QORIQ=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index be24a18..c9e8057 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -117,6 +117,7 @@ CONFIG_DMADEVICES=y
 CONFIG_FSL_DMA=y
 CONFIG_VIRT_DRIVERS=y
 CONFIG_FSL_HV_MANAGER=y
+CONFIG_CLK_QORIQ=y
 CONFIG_FSL_CORENET_CF=y
 CONFIG_MEMORY=y
 CONFIG_EXT2_FS=y
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 03/10] clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT

2015-01-21 Thread Emil Medve
CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*cmux_clk)...) over 
kzalloc(sizeof(struct cmux_clk)...)
+   cmux_clk = kzalloc(sizeof(struct cmux_clk), GFP_KERNEL);

CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*onecell_data)...) over 
kzalloc(sizeof(struct clk_onecell_data)...)
+   onecell_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-qoriq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 475ce1c..a1cd137 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -94,7 +94,7 @@ static void __init core_mux_init(struct device_node *np)
for (i = 0; i  count; i++)
parent_names[i] = of_clk_get_parent_name(np, i);
 
-   cmux_clk = kzalloc(sizeof(struct cmux_clk), GFP_KERNEL);
+   cmux_clk = kzalloc(sizeof(*cmux_clk), GFP_KERNEL);
if (!cmux_clk) {
pr_err(%s: could not allocate cmux_clk\n, __func__);
goto err_name;
@@ -198,7 +198,7 @@ static void __init core_pll_init(struct device_node *np)
goto err_map;
}
 
-   onecell_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
+   onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
if (!onecell_data) {
pr_err(%s: could not allocate onecell_data\n, __func__);
goto err_clks;
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL

2015-01-21 Thread Emil Medve
Hello Yuan-Tian,


On 01/21/2015 03:37 AM, Tang Yuantian-B29983 wrote:
 Hello Emil,
 
From the RM and your code, I didn't see any difference between the two type 
of PLL.
 Could you provide some use cases or feature that prove this is necessary?

I said the DT makes the core_pll_init() code stand out. Yes, the
register layout is identical, but that's not the entire story about the
place of these PLL(s) in the SoC clocking hierarchy/tree

 If there did have some features that current function didn't
 contain, can we expend the current one to include it?

Once core_pll_init() gets fixed/cleaned up somebody should look into
unifying *_pll_init()

 BTW: if you did need this, please update the binding as well, if any:
 Documentation/devicetree/bindings/clock/qoriq-clock.txt

The platform PLL binding is already there


Cheers,


 Thanks,
 Yuantian
 
 -Original Message-
 From: Emil Medve [mailto:emilian.me...@freescale.com]
 Sent: Wednesday, January 21, 2015 5:03 PM
 To: Tang Yuantian-B29983; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
 mturque...@linaro.org; haoke...@gmail.com
 Subject: Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL

 Hello Yuan-Tian,


 On 01/21/2015 02:35 AM, Tang Yuantian-B29983 wrote:
 Hi Emil,

 I don't think it is the best to add a function that is very similar to 
 existing one.
 If you think the function name is not appropriate, rename it.

 It's not a naming matter. As I said, core_pll_init() assumptions and 
 decisions
 based on the number of clocks in the DT. My hunch is some of these 
 assumptions
 are not necessary and/or should be explicit based on the node/device 
 compatible.
 Having a standalone platform PLL initialization function wasn't a unilateral 
 lack of
 foresight


 Cheers,


 Thanks,
 Yuantian

 -Original Message-
 From: Emil Medve [mailto:emilian.me...@freescale.com]
 Sent: Wednesday, January 21, 2015 4:20 PM
 To: Tang Yuantian-B29983; linuxppc-dev@lists.ozlabs.org; Wood
 Scott-B07421; mturque...@linaro.org; haoke...@gmail.com
 Subject: Re: [PATCH 8/8] clk: ppc-corenet: Add support for the
 platform PLL

 Hello Yuan-Tian,


 On 01/20/2015 11:42 PM, Tang Yuantian-B29983 wrote:
 Which platform are you trying to use this on?

 CoreNet chassis v1 and v2 SoC(s)

 Can this be initialized by core pll function core_pll_init()?
 I just saw most of this function is silimar to the core_pll_init().

 Yes, the flow is similar, but core_pll_init() makes assumptions that
 it shouldn't or are not relevant to the platform PLL


 Cheers,


 Thanks,
 Yuantian

 -Original Message-
 From: Emil Medve [mailto:emilian.me...@freescale.com]
 Sent: Tuesday, January 20, 2015 6:10 PM
 To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
 mturque...@linaro.org; haoke...@gmail.com; Tang Yuantian-B29983
 Cc: Medve Emilian-EMMEDVE1
 Subject: [PATCH 8/8] clk: ppc-corenet: Add support for the platform
 PLL

 Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
 Signed-off-by: Emil Medve emilian.me...@freescale.com
 ---
  drivers/clk/clk-ppc-corenet.c | 85
 +++
  1 file changed, 85 insertions(+)

 diff --git a/drivers/clk/clk-ppc-corenet.c
 b/drivers/clk/clk-ppc-corenet.c index
 91816b1..ff425e1 100644
 --- a/drivers/clk/clk-ppc-corenet.c
 +++ b/drivers/clk/clk-ppc-corenet.c
 @@ -7,6 +7,9 @@
   *
   * clock driver for Freescale PowerPC corenet SoCs.
   */
 +
 +#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
 +
  #include linux/clk-provider.h
  #include linux/io.h
  #include linux/kernel.h
 @@ -261,9 +264,91 @@ static void __init sysclk_init(struct
 device_node
 *node)
  of_clk_add_provider(np, of_clk_src_simple_get, clk);  }

 +static void __init pltfrm_pll_init(struct device_node *np) {
 +void __iomem *base;
 +uint32_t mult;
 +const char *parent_name, *clk_name;
 +int i, _errno;
 +struct clk_onecell_data *cod;
 +
 +base = of_iomap(np, 0);
 +if (!base) {
 +pr_err(%s(): %s: of_iomap() failed\n, __func__, 
 np-name);
 +return;
 +}
 +
 +/* Get the multiple of PLL */
 +mult = ioread32be(base);
 +
 +iounmap(base);
 +
 +/* Check if this PLL is disabled */
 +if (mult  PLL_KILL) {
 +pr_debug(%s(): %s: Disabled\n, __func__, np-name);
 +return;
 +}
 +mult = (mult  GENMASK(6, 1))  1;
 +
 +parent_name = of_clk_get_parent_name(np, 0);
 +if (!parent_name) {
 +pr_err(%s(): %s: of_clk_get_parent_name() failed\n,
 +   __func__, np-name);
 +return;
 +}
 +
 +i = of_property_count_strings(np, clock-output-names);
 +if (i  0) {
 +pr_err(%s(): %s: 
 of_property_count_strings(clock-output-names)
 = %d\n,
 +   __func__, np-name, i);
 +return;
 +}
 +
 +cod = kmalloc(sizeof(*cod) + i

Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL

2015-01-21 Thread Emil Medve
Hello Yuan-Tian,


On 01/20/2015 11:42 PM, Tang Yuantian-B29983 wrote:
 Which platform are you trying to use this on?

CoreNet chassis v1 and v2 SoC(s)

 Can this be initialized by core pll function core_pll_init()?
 I just saw most of this function is silimar to the core_pll_init().

Yes, the flow is similar, but core_pll_init() makes assumptions that it
shouldn't or are not relevant to the platform PLL


Cheers,


 Thanks,
 Yuantian
 
 -Original Message-
 From: Emil Medve [mailto:emilian.me...@freescale.com]
 Sent: Tuesday, January 20, 2015 6:10 PM
 To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; mturque...@linaro.org;
 haoke...@gmail.com; Tang Yuantian-B29983
 Cc: Medve Emilian-EMMEDVE1
 Subject: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL

 Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
 Signed-off-by: Emil Medve emilian.me...@freescale.com
 ---
  drivers/clk/clk-ppc-corenet.c | 85
 +++
  1 file changed, 85 insertions(+)

 diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c 
 index
 91816b1..ff425e1 100644
 --- a/drivers/clk/clk-ppc-corenet.c
 +++ b/drivers/clk/clk-ppc-corenet.c
 @@ -7,6 +7,9 @@
   *
   * clock driver for Freescale PowerPC corenet SoCs.
   */
 +
 +#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
 +
  #include linux/clk-provider.h
  #include linux/io.h
  #include linux/kernel.h
 @@ -261,9 +264,91 @@ static void __init sysclk_init(struct device_node *node)
  of_clk_add_provider(np, of_clk_src_simple_get, clk);  }

 +static void __init pltfrm_pll_init(struct device_node *np) {
 +void __iomem *base;
 +uint32_t mult;
 +const char *parent_name, *clk_name;
 +int i, _errno;
 +struct clk_onecell_data *cod;
 +
 +base = of_iomap(np, 0);
 +if (!base) {
 +pr_err(%s(): %s: of_iomap() failed\n, __func__, np-name);
 +return;
 +}
 +
 +/* Get the multiple of PLL */
 +mult = ioread32be(base);
 +
 +iounmap(base);
 +
 +/* Check if this PLL is disabled */
 +if (mult  PLL_KILL) {
 +pr_debug(%s(): %s: Disabled\n, __func__, np-name);
 +return;
 +}
 +mult = (mult  GENMASK(6, 1))  1;
 +
 +parent_name = of_clk_get_parent_name(np, 0);
 +if (!parent_name) {
 +pr_err(%s(): %s: of_clk_get_parent_name() failed\n,
 +   __func__, np-name);
 +return;
 +}
 +
 +i = of_property_count_strings(np, clock-output-names);
 +if (i  0) {
 +pr_err(%s(): %s: of_property_count_strings(clock-output-names)
 = %d\n,
 +   __func__, np-name, i);
 +return;
 +}
 +
 +cod = kmalloc(sizeof(*cod) + i * sizeof(struct clk *), GFP_KERNEL);
 +if (!cod)
 +return;
 +cod-clks = (struct clk **)(cod + 1);
 +cod-clk_num = i;
 +
 +for (i = 0; i  cod-clk_num; i++) {
 +_errno = of_property_read_string_index(np, clock-output-names,
 +   i, clk_name);
 +if (_errno  0) {
 +pr_err(%s(): %s:
 of_property_read_string_index(clock-output-names) = %d\n,
 +   __func__, np-name, _errno);
 +goto return_clk_unregister;
 +}
 +
 +cod-clks[i] = clk_register_fixed_factor(NULL, clk_name,
 +   parent_name, 0, mult, 1 + i);
 +if (IS_ERR(cod-clks[i])) {
 +pr_err(%s(): %s: clk_register_fixed_factor(%s) = 
 %ld\n,
 +   __func__, np-name,
 +   clk_name, PTR_ERR(cod-clks[i]));
 +goto return_clk_unregister;
 +}
 +}
 +
 +_errno = of_clk_add_provider(np, of_clk_src_onecell_get, cod);
 +if (_errno  0) {
 +pr_err(%s(): %s: of_clk_add_provider() = %d\n,
 +   __func__, np-name, _errno);
 +goto return_clk_unregister;
 +}
 +
 +return;
 +
 +return_clk_unregister:
 +while (--i = 0)
 +clk_unregister(cod-clks[i]);
 +kfree(cod);
 +}
 +
  CLK_OF_DECLARE(qoriq_sysclk_1, fsl,qoriq-sysclk-1.0, sysclk_init);
 CLK_OF_DECLARE(qoriq_sysclk_2, fsl,qoriq-sysclk-2.0, sysclk_init);
 CLK_OF_DECLARE(qoriq_core_pll_1, fsl,qoriq-core-pll-1.0, core_pll_init);
 CLK_OF_DECLARE(qoriq_core_pll_2, fsl,qoriq-core-pll-2.0, core_pll_init);
 CLK_OF_DECLARE(qoriq_core_mux_1, fsl,qoriq-core-mux-1.0, core_mux_init);
 CLK_OF_DECLARE(qoriq_core_mux_2, fsl,qoriq-core-mux-2.0, core_mux_init);
 +CLK_OF_DECLARE(qoriq_pltfrm_pll_1, fsl,qoriq-platform-pll-1.0,
 +pltfrm_pll_init); CLK_OF_DECLARE(qoriq_pltfrm_pll_2,
 +fsl,qoriq-platform-pll-2.0, pltfrm_pll_init);
 --
 2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL

2015-01-21 Thread Emil Medve
Hello Yuan-Tian,


On 01/21/2015 02:35 AM, Tang Yuantian-B29983 wrote:
 Hi Emil,
 
 I don't think it is the best to add a function that is very similar to 
 existing one. 
 If you think the function name is not appropriate, rename it.

It's not a naming matter. As I said, core_pll_init() assumptions and
decisions based on the number of clocks in the DT. My hunch is some of
these assumptions are not necessary and/or should be explicit based on
the node/device compatible. Having a standalone platform PLL
initialization function wasn't a unilateral lack of foresight


Cheers,


 Thanks,
 Yuantian
 
 -Original Message-
 From: Emil Medve [mailto:emilian.me...@freescale.com]
 Sent: Wednesday, January 21, 2015 4:20 PM
 To: Tang Yuantian-B29983; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
 mturque...@linaro.org; haoke...@gmail.com
 Subject: Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL

 Hello Yuan-Tian,


 On 01/20/2015 11:42 PM, Tang Yuantian-B29983 wrote:
 Which platform are you trying to use this on?

 CoreNet chassis v1 and v2 SoC(s)

 Can this be initialized by core pll function core_pll_init()?
 I just saw most of this function is silimar to the core_pll_init().

 Yes, the flow is similar, but core_pll_init() makes assumptions that it 
 shouldn't or
 are not relevant to the platform PLL


 Cheers,


 Thanks,
 Yuantian

 -Original Message-
 From: Emil Medve [mailto:emilian.me...@freescale.com]
 Sent: Tuesday, January 20, 2015 6:10 PM
 To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
 mturque...@linaro.org; haoke...@gmail.com; Tang Yuantian-B29983
 Cc: Medve Emilian-EMMEDVE1
 Subject: [PATCH 8/8] clk: ppc-corenet: Add support for the platform
 PLL

 Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
 Signed-off-by: Emil Medve emilian.me...@freescale.com
 ---
  drivers/clk/clk-ppc-corenet.c | 85
 +++
  1 file changed, 85 insertions(+)

 diff --git a/drivers/clk/clk-ppc-corenet.c
 b/drivers/clk/clk-ppc-corenet.c index
 91816b1..ff425e1 100644
 --- a/drivers/clk/clk-ppc-corenet.c
 +++ b/drivers/clk/clk-ppc-corenet.c
 @@ -7,6 +7,9 @@
   *
   * clock driver for Freescale PowerPC corenet SoCs.
   */
 +
 +#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
 +
  #include linux/clk-provider.h
  #include linux/io.h
  #include linux/kernel.h
 @@ -261,9 +264,91 @@ static void __init sysclk_init(struct device_node
 *node)
of_clk_add_provider(np, of_clk_src_simple_get, clk);  }

 +static void __init pltfrm_pll_init(struct device_node *np) {
 +  void __iomem *base;
 +  uint32_t mult;
 +  const char *parent_name, *clk_name;
 +  int i, _errno;
 +  struct clk_onecell_data *cod;
 +
 +  base = of_iomap(np, 0);
 +  if (!base) {
 +  pr_err(%s(): %s: of_iomap() failed\n, __func__, np-name);
 +  return;
 +  }
 +
 +  /* Get the multiple of PLL */
 +  mult = ioread32be(base);
 +
 +  iounmap(base);
 +
 +  /* Check if this PLL is disabled */
 +  if (mult  PLL_KILL) {
 +  pr_debug(%s(): %s: Disabled\n, __func__, np-name);
 +  return;
 +  }
 +  mult = (mult  GENMASK(6, 1))  1;
 +
 +  parent_name = of_clk_get_parent_name(np, 0);
 +  if (!parent_name) {
 +  pr_err(%s(): %s: of_clk_get_parent_name() failed\n,
 + __func__, np-name);
 +  return;
 +  }
 +
 +  i = of_property_count_strings(np, clock-output-names);
 +  if (i  0) {
 +  pr_err(%s(): %s: of_property_count_strings(clock-output-names)
 = %d\n,
 + __func__, np-name, i);
 +  return;
 +  }
 +
 +  cod = kmalloc(sizeof(*cod) + i * sizeof(struct clk *), GFP_KERNEL);
 +  if (!cod)
 +  return;
 +  cod-clks = (struct clk **)(cod + 1);
 +  cod-clk_num = i;
 +
 +  for (i = 0; i  cod-clk_num; i++) {
 +  _errno = of_property_read_string_index(np, clock-output-names,
 + i, clk_name);
 +  if (_errno  0) {
 +  pr_err(%s(): %s:
 of_property_read_string_index(clock-output-names) = %d\n,
 + __func__, np-name, _errno);
 +  goto return_clk_unregister;
 +  }
 +
 +  cod-clks[i] = clk_register_fixed_factor(NULL, clk_name,
 + parent_name, 0, mult, 1 + i);
 +  if (IS_ERR(cod-clks[i])) {
 +  pr_err(%s(): %s: clk_register_fixed_factor(%s) = 
 %ld\n,
 + __func__, np-name,
 + clk_name, PTR_ERR(cod-clks[i]));
 +  goto return_clk_unregister;
 +  }
 +  }
 +
 +  _errno = of_clk_add_provider(np, of_clk_src_onecell_get, cod);
 +  if (_errno  0) {
 +  pr_err(%s(): %s: of_clk_add_provider() = %d\n,
 + __func__, np-name, _errno);
 +  goto return_clk_unregister;
 +  }
 +
 +  return;
 +
 +return_clk_unregister:
 +  while (--i = 0)
 +  clk_unregister(cod-clks[i]);
 +  kfree(cod);
 +}
 +
  CLK_OF_DECLARE(qoriq_sysclk_1, fsl

[PATCH 1/8] clk: ppc-corenet: Fix checkpatch type PARENTHESIS_ALIGNMENT

2015-01-20 Thread Emil Medve
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+   rc = of_property_read_string_index(np, clock-output-names,
+   0, clk_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+   pr_err(Could not register clock provider for node:%s\n,
+np-name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+   rc = of_property_read_string_index(np, clock-output-names,
+   i, clk_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+   pr_err(Could not register clk provider for node:%s\n,
+np-name);

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-ppc-corenet.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c
index bf0fe56..7cb8f23 100644
--- a/drivers/clk/clk-ppc-corenet.c
+++ b/drivers/clk/clk-ppc-corenet.c
@@ -110,7 +110,7 @@ static void __init core_mux_init(struct device_node *np)
cmux_clk-flags = CLKSEL_ADJUST;
 
rc = of_property_read_string_index(np, clock-output-names,
-   0, clk_name);
+  0, clk_name);
if (rc) {
pr_err(%s: read clock names error\n, np-name);
goto err_clk;
@@ -132,7 +132,7 @@ static void __init core_mux_init(struct device_node *np)
rc = of_clk_add_provider(np, of_clk_src_simple_get, clk);
if (rc) {
pr_err(Could not register clock provider for node:%s\n,
-np-name);
+  np-name);
goto err_clk;
}
goto err_name;
@@ -198,7 +198,7 @@ static void __init core_pll_init(struct device_node *np)
 
for (i = 0; i  count; i++) {
rc = of_property_read_string_index(np, clock-output-names,
-   i, clk_name);
+  i, clk_name);
if (rc) {
pr_err(%s: could not get clock names\n, np-name);
goto err_cell;
@@ -230,7 +230,7 @@ static void __init core_pll_init(struct device_node *np)
rc = of_clk_add_provider(np, of_clk_src_onecell_get, onecell_data);
if (rc) {
pr_err(Could not register clk provider for node:%s\n,
-np-name);
+  np-name);
goto err_cell;
}
 
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL

2015-01-20 Thread Emil Medve
Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-ppc-corenet.c | 85 +++
 1 file changed, 85 insertions(+)

diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c
index 91816b1..ff425e1 100644
--- a/drivers/clk/clk-ppc-corenet.c
+++ b/drivers/clk/clk-ppc-corenet.c
@@ -7,6 +7,9 @@
  *
  * clock driver for Freescale PowerPC corenet SoCs.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/clk-provider.h
 #include linux/io.h
 #include linux/kernel.h
@@ -261,9 +264,91 @@ static void __init sysclk_init(struct device_node *node)
of_clk_add_provider(np, of_clk_src_simple_get, clk);
 }
 
+static void __init pltfrm_pll_init(struct device_node *np)
+{
+   void __iomem *base;
+   uint32_t mult;
+   const char *parent_name, *clk_name;
+   int i, _errno;
+   struct clk_onecell_data *cod;
+
+   base = of_iomap(np, 0);
+   if (!base) {
+   pr_err(%s(): %s: of_iomap() failed\n, __func__, np-name);
+   return;
+   }
+
+   /* Get the multiple of PLL */
+   mult = ioread32be(base);
+
+   iounmap(base);
+
+   /* Check if this PLL is disabled */
+   if (mult  PLL_KILL) {
+   pr_debug(%s(): %s: Disabled\n, __func__, np-name);
+   return;
+   }
+   mult = (mult  GENMASK(6, 1))  1;
+
+   parent_name = of_clk_get_parent_name(np, 0);
+   if (!parent_name) {
+   pr_err(%s(): %s: of_clk_get_parent_name() failed\n,
+  __func__, np-name);
+   return;
+   }
+
+   i = of_property_count_strings(np, clock-output-names);
+   if (i  0) {
+   pr_err(%s(): %s: of_property_count_strings(clock-output-names) 
= %d\n,
+  __func__, np-name, i);
+   return;
+   }
+
+   cod = kmalloc(sizeof(*cod) + i * sizeof(struct clk *), GFP_KERNEL);
+   if (!cod)
+   return;
+   cod-clks = (struct clk **)(cod + 1);
+   cod-clk_num = i;
+
+   for (i = 0; i  cod-clk_num; i++) {
+   _errno = of_property_read_string_index(np, clock-output-names,
+  i, clk_name);
+   if (_errno  0) {
+   pr_err(%s(): %s: 
of_property_read_string_index(clock-output-names) = %d\n,
+  __func__, np-name, _errno);
+   goto return_clk_unregister;
+   }
+
+   cod-clks[i] = clk_register_fixed_factor(NULL, clk_name,
+  parent_name, 0, mult, 1 + i);
+   if (IS_ERR(cod-clks[i])) {
+   pr_err(%s(): %s: clk_register_fixed_factor(%s) = 
%ld\n,
+  __func__, np-name,
+  clk_name, PTR_ERR(cod-clks[i]));
+   goto return_clk_unregister;
+   }
+   }
+
+   _errno = of_clk_add_provider(np, of_clk_src_onecell_get, cod);
+   if (_errno  0) {
+   pr_err(%s(): %s: of_clk_add_provider() = %d\n,
+  __func__, np-name, _errno);
+   goto return_clk_unregister;
+   }
+
+   return;
+
+return_clk_unregister:
+   while (--i = 0)
+   clk_unregister(cod-clks[i]);
+   kfree(cod);
+}
+
 CLK_OF_DECLARE(qoriq_sysclk_1, fsl,qoriq-sysclk-1.0, sysclk_init);
 CLK_OF_DECLARE(qoriq_sysclk_2, fsl,qoriq-sysclk-2.0, sysclk_init);
 CLK_OF_DECLARE(qoriq_core_pll_1, fsl,qoriq-core-pll-1.0, core_pll_init);
 CLK_OF_DECLARE(qoriq_core_pll_2, fsl,qoriq-core-pll-2.0, core_pll_init);
 CLK_OF_DECLARE(qoriq_core_mux_1, fsl,qoriq-core-mux-1.0, core_mux_init);
 CLK_OF_DECLARE(qoriq_core_mux_2, fsl,qoriq-core-mux-2.0, core_mux_init);
+CLK_OF_DECLARE(qoriq_pltfrm_pll_1, fsl,qoriq-platform-pll-1.0, 
pltfrm_pll_init);
+CLK_OF_DECLARE(qoriq_pltfrm_pll_2, fsl,qoriq-platform-pll-2.0, 
pltfrm_pll_init);
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/8] clk: ppc-corenet: Fix checkpatch type ALLOC_WITH_MULTIPLY

2015-01-20 Thread Emil Medve
WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply
+   subclks = kzalloc(sizeof(struct clk *) * count, GFP_KERNEL);

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-ppc-corenet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c
index 7cb8f23..efa74aa 100644
--- a/drivers/clk/clk-ppc-corenet.c
+++ b/drivers/clk/clk-ppc-corenet.c
@@ -85,7 +85,7 @@ static void __init core_mux_init(struct device_node *np)
pr_err(%s: get clock count error\n, np-name);
return;
}
-   parent_names = kzalloc((sizeof(char *) * count), GFP_KERNEL);
+   parent_names = kcalloc(count, sizeof(char *), GFP_KERNEL);
if (!parent_names) {
pr_err(%s: could not allocate parent_names\n, __func__);
return;
@@ -184,7 +184,7 @@ static void __init core_pll_init(struct device_node *np)
/* output clock number per PLL */
clocks_per_pll = count;
 
-   subclks = kzalloc(sizeof(struct clk *) * count, GFP_KERNEL);
+   subclks = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
if (!subclks) {
pr_err(%s: could not allocate subclks\n, __func__);
goto err_map;
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 5/8] clk: ppc-corenet: Make local symbol 'static'

2015-01-20 Thread Emil Medve
drivers/clk/clk-ppc-corenet.c:63:22: warning: symbol 'cmux_ops' was not 
declared. Should it be static?

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-ppc-corenet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c
index 6a9dbaa..d84a7f0 100644
--- a/drivers/clk/clk-ppc-corenet.c
+++ b/drivers/clk/clk-ppc-corenet.c
@@ -57,7 +57,7 @@ static u8 cmux_get_parent(struct clk_hw *hw)
return clksel;
 }
 
-const struct clk_ops cmux_ops = {
+static const struct clk_ops cmux_ops = {
.get_parent = cmux_get_parent,
.set_parent = cmux_set_parent,
 };
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 4/8] clk: ppc-corenet: Fix checkpatch type OOM_MESSAGE

2015-01-20 Thread Emil Medve
WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+   if (!parent_names) {
+   pr_err(%s: could not allocate parent_names\n, __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+   if (!cmux_clk) {
+   pr_err(%s: could not allocate cmux_clk\n, __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+   if (!subclks) {
+   pr_err(%s: could not allocate subclks\n, __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+   if (!onecell_data) {
+   pr_err(%s: could not allocate onecell_data\n, __func__);

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-ppc-corenet.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c
index a439f52..6a9dbaa 100644
--- a/drivers/clk/clk-ppc-corenet.c
+++ b/drivers/clk/clk-ppc-corenet.c
@@ -86,19 +86,16 @@ static void __init core_mux_init(struct device_node *np)
return;
}
parent_names = kcalloc(count, sizeof(char *), GFP_KERNEL);
-   if (!parent_names) {
-   pr_err(%s: could not allocate parent_names\n, __func__);
+   if (!parent_names)
return;
-   }
 
for (i = 0; i  count; i++)
parent_names[i] = of_clk_get_parent_name(np, i);
 
cmux_clk = kzalloc(sizeof(*cmux_clk), GFP_KERNEL);
-   if (!cmux_clk) {
-   pr_err(%s: could not allocate cmux_clk\n, __func__);
+   if (!cmux_clk)
goto err_name;
-   }
+
cmux_clk-reg = of_iomap(np, 0);
if (!cmux_clk-reg) {
pr_err(%s: could not map register\n, __func__);
@@ -185,16 +182,12 @@ static void __init core_pll_init(struct device_node *np)
clocks_per_pll = count;
 
subclks = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
-   if (!subclks) {
-   pr_err(%s: could not allocate subclks\n, __func__);
+   if (!subclks)
goto err_map;
-   }
 
onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
-   if (!onecell_data) {
-   pr_err(%s: could not allocate onecell_data\n, __func__);
+   if (!onecell_data)
goto err_clks;
-   }
 
for (i = 0; i  count; i++) {
rc = of_property_read_string_index(np, clock-output-names,
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/8] clk: ppc-corenet: Fix checkpatch type ALLOC_SIZEOF_STRUCT

2015-01-20 Thread Emil Medve
CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*cmux_clk)...) over 
kzalloc(sizeof(struct cmux_clk)...)
+   cmux_clk = kzalloc(sizeof(struct cmux_clk), GFP_KERNEL);

CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*onecell_data)...) over 
kzalloc(sizeof(struct clk_onecell_data)...)
+   onecell_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-ppc-corenet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c
index efa74aa..a439f52 100644
--- a/drivers/clk/clk-ppc-corenet.c
+++ b/drivers/clk/clk-ppc-corenet.c
@@ -94,7 +94,7 @@ static void __init core_mux_init(struct device_node *np)
for (i = 0; i  count; i++)
parent_names[i] = of_clk_get_parent_name(np, i);
 
-   cmux_clk = kzalloc(sizeof(struct cmux_clk), GFP_KERNEL);
+   cmux_clk = kzalloc(sizeof(*cmux_clk), GFP_KERNEL);
if (!cmux_clk) {
pr_err(%s: could not allocate cmux_clk\n, __func__);
goto err_name;
@@ -190,7 +190,7 @@ static void __init core_pll_init(struct device_node *np)
goto err_map;
}
 
-   onecell_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
+   onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
if (!onecell_data) {
pr_err(%s: could not allocate onecell_data\n, __func__);
goto err_clks;
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 0/8] clk: ppc-corenet: Add support for the platform PLL

2015-01-20 Thread Emil Medve
These patches are based on:

http://patchwork.ozlabs.org/patch/417297
http://patchwork.ozlabs.org/patch/417295
http://patchwork.ozlabs.org/patch/417292

The first 5 patches below are checkpatch/static analysis fixes

Emil Medve (8):
  clk: ppc-corenet: Fix checkpatch type PARENTHESIS_ALIGNMENT
  clk: ppc-corenet: Fix checkpatch type ALLOC_WITH_MULTIPLY
  clk: ppc-corenet: Fix checkpatch type ALLOC_SIZEOF_STRUCT
  clk: ppc-corenet: Fix checkpatch type OOM_MESSAGE
  clk: ppc-corenet: Make local symbol 'static'
  clk: ppc-corenet: Replace kzalloc() with kmalloc()
  powerpc/corenet: Enable CLK_PPC_CORENET
  clk: ppc-corenet: Add support for the platform PLL

 arch/powerpc/configs/corenet32_smp_defconfig |   1 +
 arch/powerpc/configs/corenet64_smp_defconfig |   1 +
 drivers/clk/clk-ppc-corenet.c| 120 ++-
 3 files changed, 101 insertions(+), 21 deletions(-)

-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 7/8] powerpc/corenet: Enable CLK_PPC_CORENET

2015-01-20 Thread Emil Medve
Change-Id: I1a80ad7b9f6854791bd270b746f93a91439155a6
Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/configs/corenet32_smp_defconfig | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 611efe9..93c38d2 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -147,6 +147,7 @@ CONFIG_STAGING=y
 CONFIG_MEMORY=y
 CONFIG_VIRT_DRIVERS=y
 CONFIG_FSL_HV_MANAGER=y
+CONFIG_CLK_PPC_CORENET=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index be24a18..b9d75ae 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -119,6 +119,7 @@ CONFIG_VIRT_DRIVERS=y
 CONFIG_FSL_HV_MANAGER=y
 CONFIG_FSL_CORENET_CF=y
 CONFIG_MEMORY=y
+CONFIG_CLK_PPC_CORENET=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 CONFIG_ISO9660_FS=m
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 6/8] clk: ppc-corenet: Replace kzalloc() with kmalloc()

2015-01-20 Thread Emil Medve
Where the memset() is not necessary

Signed-off-by: Emil Medve emilian.me...@freescale.com
---
 drivers/clk/clk-ppc-corenet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c
index d84a7f0..91816b1 100644
--- a/drivers/clk/clk-ppc-corenet.c
+++ b/drivers/clk/clk-ppc-corenet.c
@@ -185,7 +185,7 @@ static void __init core_pll_init(struct device_node *np)
if (!subclks)
goto err_map;
 
-   onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
+   onecell_data = kmalloc(sizeof(*onecell_data), GFP_KERNEL);
if (!onecell_data)
goto err_clks;
 
-- 
2.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/8] clk: ppc-corenet: Add support for the platform PLL

2015-01-20 Thread Emil Medve
Hello Yuan-Tian,


On 01/20/2015 07:40 PM, Tang Yuantian-B29983 wrote:
 Hi Emil,
 
 Thanks for fixing those warnings. The patch set you based on is merged.
 I sent another two patches and one of them got merged. You probably need to 
 rebase your patches.
 My patch link:
 http://patchwork.ozlabs.org/patch/429257/

I'll rebase on top of this and resubmit


Cheers,


 http://patchwork.ozlabs.org/patch/429258/
 
 Thanks,
 Yuantian
 
 -Original Message-
 From: Emil Medve [mailto:emilian.me...@freescale.com]
 Sent: Tuesday, January 20, 2015 6:09 PM
 To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; mturque...@linaro.org;
 haoke...@gmail.com; Tang Yuantian-B29983
 Cc: Medve Emilian-EMMEDVE1
 Subject: [PATCH 0/8] clk: ppc-corenet: Add support for the platform PLL

 These patches are based on:

 http://patchwork.ozlabs.org/patch/417297
 http://patchwork.ozlabs.org/patch/417295
 http://patchwork.ozlabs.org/patch/417292

 The first 5 patches below are checkpatch/static analysis fixes

 Emil Medve (8):
   clk: ppc-corenet: Fix checkpatch type PARENTHESIS_ALIGNMENT
   clk: ppc-corenet: Fix checkpatch type ALLOC_WITH_MULTIPLY
   clk: ppc-corenet: Fix checkpatch type ALLOC_SIZEOF_STRUCT
   clk: ppc-corenet: Fix checkpatch type OOM_MESSAGE
   clk: ppc-corenet: Make local symbol 'static'
   clk: ppc-corenet: Replace kzalloc() with kmalloc()
   powerpc/corenet: Enable CLK_PPC_CORENET
   clk: ppc-corenet: Add support for the platform PLL

  arch/powerpc/configs/corenet32_smp_defconfig |   1 +
  arch/powerpc/configs/corenet64_smp_defconfig |   1 +
  drivers/clk/clk-ppc-corenet.c| 120
 ++-
  3 files changed, 101 insertions(+), 21 deletions(-)

 --
 2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] [v3] power/fsl: add MDIO dt binding for FMan

2015-01-08 Thread Emil Medve
Hello Scott,


On 01/07/2015 07:12 PM, Scott Wood wrote:
 On Wed, 2015-01-07 at 13:44 -0600, Emil Medve wrote:
 Hello Scott,


 On 01/07/2015 12:05 PM, Scott Wood wrote:
 On Tue, 2015-01-06 at 23:29 -0600, Xie Shaohui-B21989 wrote:
 +- interrupts
 +   Usage: optional
 +   Value type: prop-encoded-array
 +   Definition: Event interrupt of external MDIO controller.
 +   1 Gb/s MDIO and 10 Gb/s MDIO has one interrupt 
 respectively.

 I'm confused by respectively here.  Does fsl,fman-memac-mdio have two
 interrupts (one for 1 Gb/s and one for 10 Gb/s)?
 [S.H] We use two MDIO controllers for external PHY management. One for 1 
 Gb/s,
 One for 10 Gb/s, and two MDIO interrupts connected to MPIC.

 If there can be two interrupts you need to make that clear and specify
 the order.

 Is it possible for one MDIO controller to have an interrupt connected
 but not the other, on the same system?  How would you represent that in
 the device tree?  If there are two MDIO controllers why are they in the
 same node?

 Historically (FMan v2 and even before/legacy) we've had each MAC include
 an MDIO controller, but only one MDIO controller per MAC type/speed (1
 Gb/s vs 10 Gb/s) is pinned out and all the same speed PHY(s) are
 connected to the respective MDIO controllers. As such the first 1 Gb/s
 MAC/MDIO controller is used to manage all the 1 Gb/s PHY(s) and the
 first 10 Gb/s MAC/MDIO controller is used to manage all the 10 Gb/s
 PHY(s). Each MDIO controller has the ability to generate interrupts but
 only pinned out MDIO controllers are hooked up to the MPIC (as such the
 talk about two interrupts)

 (Each MAC has also integrated a SERDES/TBI/internal PHY that is
 connected to the local MDIO controller)

 As you can imagine this creates a number of problems in a partitioning
 scenario (and not just, imagine RCWs where the first MAC is not
 used/enabled). In order to help a bit (but not quite enough), in FMan
 v3, two additional MDIO controllers (one for 1 the Gb/s PHY(s) and one
 for 1 the 10 Gb/s PHY(s)) have been integrated that are not associated
 with any MAC and these are the pinned out MDIO controllers on such
 SoC(s) (chassis v2)
 
 I'm happy to hear that.  Is that what is meant by external here?

External doesn't mean external to the MAC nodes. External doesn't
even properly apply to the MDIO controller(s) at all but to the PHY(s).

 I thought it meant external to the SoC.  Is this the term used by
 hardware documentation?

The documentation (mostly chip errata documents) refers to
external/internal MDIO accesses and as on FMan v3 external PHY accesses
are always made via these extra MDIO controllers (pinned oud) and the
internal SERDES PHY accesses are always made via the in-MAC MDIO
controllers some level of confusion is easy to be achieved. All the MDIO
controllers are identical whether they are in-MAC or standalone

 I'd have called it independent or similar.

To make things even more confusing, some documents call these extra MDIO
controllers dedicated


Cheers,


   Does optional mean it's used if and
 only if external MDIO is used, or is it optional even with external MDIO? 
  I see
 it's not present in the example -- do we not have a real example that has 
 the
 interrupt?
 [S.H] optional means it's available on hardware, but MDIO driver does 
 not use interrupt. 
 So we don't have a real example.

 record type=brokenThe device tree describes the hardware, not the
 driver/record

 Anyway, only two MDIO nodes (out of 4 to 14) would have an interrupt
 property describing exactly one interrupt. What language should we use
 to convey this situation
 
 So the answer is that there will not be more than one MDIO controller
 per MDIO node, or more than one interrupt per MDIO node?  In that case
 just get rid of the confusing respectively sentence -- and always
 describe the interrupt if it exists in hardware.
 
 -Scott
 
 
 .
 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] [v3] power/fsl: add MDIO dt binding for FMan

2015-01-07 Thread Emil Medve
Hello Scott,


On 01/07/2015 12:05 PM, Scott Wood wrote:
 On Tue, 2015-01-06 at 23:29 -0600, Xie Shaohui-B21989 wrote:
 +- interrupts
 + Usage: optional
 + Value type: prop-encoded-array
 + Definition: Event interrupt of external MDIO controller.
 + 1 Gb/s MDIO and 10 Gb/s MDIO has one interrupt respectively.

 I'm confused by respectively here.  Does fsl,fman-memac-mdio have two
 interrupts (one for 1 Gb/s and one for 10 Gb/s)?
 [S.H] We use two MDIO controllers for external PHY management. One for 1 
 Gb/s,
 One for 10 Gb/s, and two MDIO interrupts connected to MPIC.
 
 If there can be two interrupts you need to make that clear and specify
 the order.
 
 Is it possible for one MDIO controller to have an interrupt connected
 but not the other, on the same system?  How would you represent that in
 the device tree?  If there are two MDIO controllers why are they in the
 same node?

Historically (FMan v2 and even before/legacy) we've had each MAC include
an MDIO controller, but only one MDIO controller per MAC type/speed (1
Gb/s vs 10 Gb/s) is pinned out and all the same speed PHY(s) are
connected to the respective MDIO controllers. As such the first 1 Gb/s
MAC/MDIO controller is used to manage all the 1 Gb/s PHY(s) and the
first 10 Gb/s MAC/MDIO controller is used to manage all the 10 Gb/s
PHY(s). Each MDIO controller has the ability to generate interrupts but
only pinned out MDIO controllers are hooked up to the MPIC (as such the
talk about two interrupts)

(Each MAC has also integrated a SERDES/TBI/internal PHY that is
connected to the local MDIO controller)

As you can imagine this creates a number of problems in a partitioning
scenario (and not just, imagine RCWs where the first MAC is not
used/enabled). In order to help a bit (but not quite enough), in FMan
v3, two additional MDIO controllers (one for 1 the Gb/s PHY(s) and one
for 1 the 10 Gb/s PHY(s)) have been integrated that are not associated
with any MAC and these are the pinned out MDIO controllers on such
SoC(s) (chassis v2)

   Does optional mean it's used if and
 only if external MDIO is used, or is it optional even with external MDIO?  
 I see
 it's not present in the example -- do we not have a real example that has 
 the
 interrupt?
 [S.H] optional means it's available on hardware, but MDIO driver does not 
 use interrupt. 
 So we don't have a real example.
 
 record type=brokenThe device tree describes the hardware, not the
 driver/record

Anyway, only two MDIO nodes (out of 4 to 14) would have an interrupt
property describing exactly one interrupt. What language should we use
to convey this situation


Cheers,


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/2] powerpc/config: enable mdio buses muxing via Memory-mapped device

2015-01-05 Thread Emil Medve
Hello Shao-Hui,


On 01/03/2015 10:58 PM, Xie Shaohui-B21989 wrote:
 Hello Emil,
 
 The patches sent by Shruti were marked as Changes Requested over 5 months.
 to me if the patches do need changes, the possible changes seems not in 
 'config' but in corenet_generic.c.

It was part of a series that needed changes in other patches

 I'm not sure if it's OK to add some compatibles in corenet_generic.c. if we 
 can use the existing compatible simple-bus,
 Then we will only need to enable MDIO mux option in config without adding 
 compatible in corenet_generic.c.

The container bus of the muxing nodes doesn't carry the simple-bus
compatible and (as per the ePAPR definition) I'm unsure it would be
applicable


Cheers,


 Best Regards, 
 Shaohui Xie
 
 -Original Message-
 From: Emil Medve [mailto:emilian.me...@freescale.com]
 Sent: Friday, January 02, 2015 4:43 PM
 To: shh@gmail.com; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421
 Cc: Andy Fleming; Xie Shaohui-B21989; Kanetkar Shruti-B44454
 Subject: Re: [PATCH 2/2] powerpc/config: enable mdio buses muxing via
 Memory-mapped device

 Hello Shao-Hui,


 On 12/22/2014 03:21 AM, shh@gmail.com wrote:
 From: Andy Fleming aflem...@gmail.com

 Signed-off-by: Andy Fleming aflem...@gmail.com
 Signed-off-by: Shaohui Xie shaohui@freescale.com
 ---
  arch/powerpc/configs/corenet32_smp_defconfig | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig | 1 +
  2 files changed, 2 insertions(+)

 Shruti submitted a more complete version of this patch here:

 http://patchwork.ozlabs.org/patch/370873

 We should stick with that version


 Cheers,

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/2] powerpc/config: enable mdio buses muxing via Memory-mapped device

2015-01-02 Thread Emil Medve
Hello Shao-Hui,


On 12/22/2014 03:21 AM, shh@gmail.com wrote:
 From: Andy Fleming aflem...@gmail.com
 
 Signed-off-by: Andy Fleming aflem...@gmail.com
 Signed-off-by: Shaohui Xie shaohui@freescale.com
 ---
  arch/powerpc/configs/corenet32_smp_defconfig | 1 +
  arch/powerpc/configs/corenet64_smp_defconfig | 1 +
  2 files changed, 2 insertions(+)

Shruti submitted a more complete version of this patch here:

http://patchwork.ozlabs.org/patch/370873

We should stick with that version


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/2] powerpc/config: enable mdio buses muxing via gpio

2015-01-02 Thread Emil Medve
Hello Shao-Hui,


On 12/22/2014 03:19 AM, shh@gmail.com wrote:
 From: Andy Fleming aflem...@gmail.com
 
 Signed-off-by: Andy Fleming aflem...@gmail.com
 Signed-off-by: Shaohui Xie shaohui@freescale.com
 ---
  arch/powerpc/configs/corenet32_smp_defconfig | 2 ++
  arch/powerpc/configs/corenet64_smp_defconfig | 2 ++
  2 files changed, 4 insertions(+)

Shruti submitted a more complete version of this patch here:

http://patchwork.ozlabs.org/patch/370871

We should stick with that version


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] [v2] power/fsl: add MDIO dt binding for FMan

2014-12-22 Thread Emil Medve
Hello Scott,


On 12/22/2014 02:32 AM, Scott Wood wrote:
 On Mon, 2014-12-22 at 02:20 -0600, Emil Medve wrote:
 Hello Shao-Hui,


 On 12/21/2014 08:31 PM, Xie Shaohui-B21989 wrote:
 On Fri, 2014-12-19 at 01:23 -0600, Xie Shaohui-B21989 wrote:
 -Original Message-
 From: Wood Scott-B07421
 Sent: Friday, December 19, 2014 6:01 AM
 To: Xie Shaohui-B21989
 Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; Medve
 Emilian- EMMEDVE1; Liberman Igal-B31950
 Subject: Re: [PATCH] [v2] power/fsl: add MDIO dt binding for FMan

 On Thu, 2014-12-18 at 06:53 -0600, Xie Shaohui-B21989 wrote:
 Ping.

 Best Regards,
 Shaohui Xie

 I can't put patches in my -next until the merge window closes.

 +EXAMPLE
 +
 +Example for FMan v2 external MDIO:
 +
 +mdio@f1000 {
 +compatible = fsl,fman-xmdio;
 +reg = 0xf1000 0x1000;
 +bus-frequency = 2;
 +};

 So the bus frequency is only 20 KHz?  Or is the unit supposed
 to be something other than Hz?
 [S.H] it's only an example, it could be different on real SoCs,
 but they always lower than the standard one, The standard one is
 2.5MHz, I have
 to use Hz for it.

 Is there any SoC for which 20 kHz is the right frequency?  I just
 want to make sure the example is realistic.
 [S.H] the clock divider has a limitation that the MAX value it can get
 on Fman v2 is 255 (0xff, 8 bits), On Fman v3 is 511(0x1ff, 9 bits).

 So the lowest frequency on Fman v2 is: Fman_clock / (2 * 255), On Fman
 v3 is: Fman_clock / ((2 * 511) + 1).

 Take default Fman frequency setting from SDK1.7 as example, the lowest
 clock used for Fman v2 is 581MHz, The lowest clock for Fman v3 is 600MHz.

 Then the lowest bus frequency can get is:
 Fman v2: ~1140KHz
 Fman v3: ~587KHz

 20KHz is not practice, we don't have a suggested value in errata document.
 For this example, should I post a new version with a value like 1200KHz?

 This is different from how you described the problem before.  If the 
 limitation
 is on the divider, rather than the absolute bus frequency, then specifiy 
 the max
 divider.  Or better, since according to the above this correlates with fman
 version, just have the driver know what the max divider is for each fman 
 version.
 [S.H] The problem is not the divider has limitation, the problem is a 
 different bus frequency 
 Is needed which is lower than the standard, but due to the divider 
 limitation, the lowest
 bus frequency also has limitation. i.e. we need to use the divider to get a 
 lower frequency,
 but how much lower the value could be is restricted by the divider 
 limitation.
 
 This is difficult to follow -- are you saying the erratum requires a
 speed that is not achievable?
 
 For the purpose of an example in the binding document, I suggest we just
 stick with the IEEE standard frequency.
 
 The whole reason for this property existing in the device tree is
 non-standard frequencies.

While the standard claims 2.5 MHz, most MDIO controllers and PHY devices
support frequencies well beyond the standard. Specifying a lower then
the standard frequency for the benefit of some errata is just one side
of this property

 We can continue this conversation about errata handling when we submit
 the code relevant to this binding (and the FMan v3 support)
 
 It affects the binding, so let's discuss it now please.

I think this specific (unpublished yet) errata has less bearing on the
binding then you might believe. This is mostly about providing a
common/default frequency supported by all the devices on some board

Anyway, the above thread about bits and lowest frequency limitation(s)
is not really a problem/limitation. The range of frequencies (dividers)
supported by both controller versions in all the supported SoC(s) allows
responding to this (FMan v3 only) errata just fine


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

  1   2   3   >