Re: [PATCH V3 2/2] cpc925_edac: support single-processor configurations

2011-07-22 Thread Dmitry Eremin-Solenikov
On 7/23/11, Benjamin Herrenschmidt  wrote:
> On Sat, 2011-07-23 at 01:56 +0400, Dmitry Eremin-Solenikov wrote:
>> On 6/29/11, Benjamin Herrenschmidt  wrote:
>> > On Fri, 2011-06-17 at 16:51 +0400, Dmitry Eremin-Solenikov wrote:
>> >> If second CPU is not enabled, CPC925 EDAC driver will spill out
>> >> warnings
>> >> about errors on second Processor Interface. Support masking that out,
>> >> by detecting at runtime which CPUs are present in device tree.
>> >
>> > Doug ? Are you going to carry this or should I via powerpc.git ? There's
>> > a dependency on another patch that's going into powerpc-next ...
>>
>> I'm sorry. It's been a month ago. Is there any consensus regarding these
>> two
>> patches? Are they going in in the 3.1 merge window?
>
> There have been no response from the Doug, but I just realized we
> haven't CCing their mailing list... oh well, I'll probably send them to
> Linux myself some time next week.

Thank you very much!

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


Re: [PATCH V3 2/2] cpc925_edac: support single-processor configurations

2011-07-22 Thread Benjamin Herrenschmidt
On Sat, 2011-07-23 at 01:56 +0400, Dmitry Eremin-Solenikov wrote:
> On 6/29/11, Benjamin Herrenschmidt  wrote:
> > On Fri, 2011-06-17 at 16:51 +0400, Dmitry Eremin-Solenikov wrote:
> >> If second CPU is not enabled, CPC925 EDAC driver will spill out warnings
> >> about errors on second Processor Interface. Support masking that out,
> >> by detecting at runtime which CPUs are present in device tree.
> >
> > Doug ? Are you going to carry this or should I via powerpc.git ? There's
> > a dependency on another patch that's going into powerpc-next ...
> 
> I'm sorry. It's been a month ago. Is there any consensus regarding these two
> patches? Are they going in in the 3.1 merge window?

There have been no response from the Doug, but I just realized we
haven't CCing their mailing list... oh well, I'll probably send them to
Linux myself some time next week.

Ben.

> > Cheers,
> > Ben.
> >
> >> Signed-off-by: Dmitry Eremin-Solenikov 
> >> Cc: Harry Ciao 
> >> Cc: Doug Thompson 
> >> Signed-off-by: Dmitry Eremin-Solenikov 
> >> ---
> >>  drivers/edac/cpc925_edac.c |   67
> >> ++--
> >>  1 files changed, 64 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
> >> index a687a0d..a774c0d 100644
> >> --- a/drivers/edac/cpc925_edac.c
> >> +++ b/drivers/edac/cpc925_edac.c
> >> @@ -90,6 +90,7 @@ enum apimask_bits {
> >>ECC_MASK_ENABLE = (APIMASK_ECC_UE_H | APIMASK_ECC_CE_H |
> >>   APIMASK_ECC_UE_L | APIMASK_ECC_CE_L),
> >>  };
> >> +#define APIMASK_ADI(n)CPC925_BIT(((n)+1))
> >>
> >>  /
> >>   *Processor Interface Exception Register (APIEXCP)
> >> @@ -581,16 +582,73 @@ static void cpc925_mc_check(struct mem_ctl_info
> >> *mci)
> >>  }
> >>
> >>  / CPU err device/
> >> +static u32 cpc925_cpu_mask_disabled(void)
> >> +{
> >> +  struct device_node *cpus;
> >> +  struct device_node *cpunode = NULL;
> >> +  static u32 mask = 0;
> >> +
> >> +  /* use cached value if available */
> >> +  if (mask != 0)
> >> +  return mask;
> >> +
> >> +  mask = APIMASK_ADI0 | APIMASK_ADI1;
> >> +
> >> +  cpus = of_find_node_by_path("/cpus");
> >> +  if (cpus == NULL) {
> >> +  cpc925_printk(KERN_DEBUG, "No /cpus node !\n");
> >> +  return 0;
> >> +  }
> >> +
> >> +  while ((cpunode = of_get_next_child(cpus, cpunode)) != NULL) {
> >> +  const u32 *reg = of_get_property(cpunode, "reg", NULL);
> >> +
> >> +  if (strcmp(cpunode->type, "cpu")) {
> >> +  cpc925_printk(KERN_ERR, "Not a cpu node in /cpus: %s\n",
> >> cpunode->name);
> >> +  continue;
> >> +  }
> >> +
> >> +  if (reg == NULL || *reg > 2) {
> >> +  cpc925_printk(KERN_ERR, "Bad reg value at %s\n", 
> >> cpunode->full_name);
> >> +  continue;
> >> +  }
> >> +
> >> +  mask &= ~APIMASK_ADI(*reg);
> >> +  }
> >> +
> >> +  if (mask != (APIMASK_ADI0 | APIMASK_ADI1)) {
> >> +  /* We assume that each CPU sits on it's own PI and that
> >> +   * for present CPUs the reg property equals to the PI
> >> +   * interface id */
> >> +  cpc925_printk(KERN_WARNING,
> >> +  "Assuming PI id is equal to CPU MPIC id!\n");
> >> +  }
> >> +
> >> +  of_node_put(cpunode);
> >> +  of_node_put(cpus);
> >> +
> >> +  return mask;
> >> +}
> >> +
> >>  /* Enable CPU Errors detection */
> >>  static void cpc925_cpu_init(struct cpc925_dev_info *dev_info)
> >>  {
> >>u32 apimask;
> >> +  u32 cpumask;
> >>
> >>apimask = __raw_readl(dev_info->vbase + REG_APIMASK_OFFSET);
> >> -  if ((apimask & CPU_MASK_ENABLE) == 0) {
> >> -  apimask |= CPU_MASK_ENABLE;
> >> -  __raw_writel(apimask, dev_info->vbase + REG_APIMASK_OFFSET);
> >> +
> >> +  cpumask = cpc925_cpu_mask_disabled();
> >> +  if (apimask & cpumask) {
> >> +  cpc925_printk(KERN_WARNING, "CPU(s) not present, "
> >> +  "but enabled in APIMASK, disabling\n");
> >> +  apimask &= ~cpumask;
> >>}
> >> +
> >> +  if ((apimask & CPU_MASK_ENABLE) == 0)
> >> +  apimask |= CPU_MASK_ENABLE;
> >> +
> >> +  __raw_writel(apimask, dev_info->vbase + REG_APIMASK_OFFSET);
> >>  }
> >>
> >>  /* Disable CPU Errors detection */
> >> @@ -622,6 +680,9 @@ static void cpc925_cpu_check(struct
> >> edac_device_ctl_info *edac_dev)
> >>if ((apiexcp & CPU_EXCP_DETECTED) == 0)
> >>return;
> >>
> >> +  if ((apiexcp & ~cpc925_cpu_mask_disabled()) == 0)
> >> +  return;
> >> +
> >>apimask = __raw_readl(dev_info->vbase + REG_APIMASK_OFFSET);
> >>cpc925_printk(KERN_INFO, "Processor Interface Fault\n"
> >> "Processor Interface register dump:\n");
> >
> >
> >
> 
> 


___
Linuxppc-dev mailing list
Lin

Re: [PATCH V3 2/2] cpc925_edac: support single-processor configurations

2011-07-22 Thread Dmitry Eremin-Solenikov
On 6/29/11, Benjamin Herrenschmidt  wrote:
> On Fri, 2011-06-17 at 16:51 +0400, Dmitry Eremin-Solenikov wrote:
>> If second CPU is not enabled, CPC925 EDAC driver will spill out warnings
>> about errors on second Processor Interface. Support masking that out,
>> by detecting at runtime which CPUs are present in device tree.
>
> Doug ? Are you going to carry this or should I via powerpc.git ? There's
> a dependency on another patch that's going into powerpc-next ...

I'm sorry. It's been a month ago. Is there any consensus regarding these two
patches? Are they going in in the 3.1 merge window?

>
> Cheers,
> Ben.
>
>> Signed-off-by: Dmitry Eremin-Solenikov 
>> Cc: Harry Ciao 
>> Cc: Doug Thompson 
>> Signed-off-by: Dmitry Eremin-Solenikov 
>> ---
>>  drivers/edac/cpc925_edac.c |   67
>> ++--
>>  1 files changed, 64 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
>> index a687a0d..a774c0d 100644
>> --- a/drivers/edac/cpc925_edac.c
>> +++ b/drivers/edac/cpc925_edac.c
>> @@ -90,6 +90,7 @@ enum apimask_bits {
>>  ECC_MASK_ENABLE = (APIMASK_ECC_UE_H | APIMASK_ECC_CE_H |
>> APIMASK_ECC_UE_L | APIMASK_ECC_CE_L),
>>  };
>> +#define APIMASK_ADI(n)  CPC925_BIT(((n)+1))
>>
>>  /
>>   *  Processor Interface Exception Register (APIEXCP)
>> @@ -581,16 +582,73 @@ static void cpc925_mc_check(struct mem_ctl_info
>> *mci)
>>  }
>>
>>  / CPU err device/
>> +static u32 cpc925_cpu_mask_disabled(void)
>> +{
>> +struct device_node *cpus;
>> +struct device_node *cpunode = NULL;
>> +static u32 mask = 0;
>> +
>> +/* use cached value if available */
>> +if (mask != 0)
>> +return mask;
>> +
>> +mask = APIMASK_ADI0 | APIMASK_ADI1;
>> +
>> +cpus = of_find_node_by_path("/cpus");
>> +if (cpus == NULL) {
>> +cpc925_printk(KERN_DEBUG, "No /cpus node !\n");
>> +return 0;
>> +}
>> +
>> +while ((cpunode = of_get_next_child(cpus, cpunode)) != NULL) {
>> +const u32 *reg = of_get_property(cpunode, "reg", NULL);
>> +
>> +if (strcmp(cpunode->type, "cpu")) {
>> +cpc925_printk(KERN_ERR, "Not a cpu node in /cpus: %s\n",
>> cpunode->name);
>> +continue;
>> +}
>> +
>> +if (reg == NULL || *reg > 2) {
>> +cpc925_printk(KERN_ERR, "Bad reg value at %s\n", 
>> cpunode->full_name);
>> +continue;
>> +}
>> +
>> +mask &= ~APIMASK_ADI(*reg);
>> +}
>> +
>> +if (mask != (APIMASK_ADI0 | APIMASK_ADI1)) {
>> +/* We assume that each CPU sits on it's own PI and that
>> + * for present CPUs the reg property equals to the PI
>> + * interface id */
>> +cpc925_printk(KERN_WARNING,
>> +"Assuming PI id is equal to CPU MPIC id!\n");
>> +}
>> +
>> +of_node_put(cpunode);
>> +of_node_put(cpus);
>> +
>> +return mask;
>> +}
>> +
>>  /* Enable CPU Errors detection */
>>  static void cpc925_cpu_init(struct cpc925_dev_info *dev_info)
>>  {
>>  u32 apimask;
>> +u32 cpumask;
>>
>>  apimask = __raw_readl(dev_info->vbase + REG_APIMASK_OFFSET);
>> -if ((apimask & CPU_MASK_ENABLE) == 0) {
>> -apimask |= CPU_MASK_ENABLE;
>> -__raw_writel(apimask, dev_info->vbase + REG_APIMASK_OFFSET);
>> +
>> +cpumask = cpc925_cpu_mask_disabled();
>> +if (apimask & cpumask) {
>> +cpc925_printk(KERN_WARNING, "CPU(s) not present, "
>> +"but enabled in APIMASK, disabling\n");
>> +apimask &= ~cpumask;
>>  }
>> +
>> +if ((apimask & CPU_MASK_ENABLE) == 0)
>> +apimask |= CPU_MASK_ENABLE;
>> +
>> +__raw_writel(apimask, dev_info->vbase + REG_APIMASK_OFFSET);
>>  }
>>
>>  /* Disable CPU Errors detection */
>> @@ -622,6 +680,9 @@ static void cpc925_cpu_check(struct
>> edac_device_ctl_info *edac_dev)
>>  if ((apiexcp & CPU_EXCP_DETECTED) == 0)
>>  return;
>>
>> +if ((apiexcp & ~cpc925_cpu_mask_disabled()) == 0)
>> +return;
>> +
>>  apimask = __raw_readl(dev_info->vbase + REG_APIMASK_OFFSET);
>>  cpc925_printk(KERN_INFO, "Processor Interface Fault\n"
>>   "Processor Interface register dump:\n");
>
>
>


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


Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls

2011-07-22 Thread Dmitry Eremin-Solenikov
On 7/23/11, Scott Wood  wrote:
> On Fri, 22 Jul 2011 23:44:01 +0400
> Dmitry Eremin-Solenikov  wrote:
>
>> On 7/19/11, Scott Wood  wrote:
>> > On Tue, 19 Jul 2011 12:53:50 +0400
>> > Dmitry Eremin-Solenikov  wrote:
>> >
>> >> +static struct of_device_id __initdata mpc85xx_common_ids[] = {
>> >> + { .type = "soc", },
>> >> + { .compatible = "soc", },
>> >> + { .compatible = "simple-bus", },
>> >> + { .compatible = "gianfar", },
>> >> + { .compatible = "fsl,qe", },
>> >> + { .compatible = "fsl,cpm2", },
>> >> + {},
>> >> +};
>> >
>> > Same comment as for 83xx regarding localbus and compatibility with old
>> > device trees.
>>
>> I checked for in-kernel device trees. Unless I miss something, there are
>> no
>> leftovers from this list. (83xx provided no simple-bus property for
>> localbus,
>> so your argument is valid there). If we should care about strange cases,
>> not even blessed by kernel trees, I can add some of the old probes back.
>
> I see simple-bus missing in sbc8560 and ksi8560 -- were these included in
> the consolidation?  Plus some of the others may have had simple-bus added
> after their initial version.

Patches for those are included in the patch serie. Kumar has applied them
to next-3.2.

> As for out-of-tree trees (which could include trees dynamically
> generated/augmented by firmware, as well as device trees for custom boards
> that forked off of an old reference board tree), it's still nice to not
> break them as long as they stick to the binding.

I see your point. I just wasn't thinking too much about ot-of-tree trees.
My thought was that if someone updates the kernel, he can also update the dtb.

> While the localbus binding is deficient regarding the compatible property,
> IIRC localbus preceded the introduction of simple-bus, which appears to be
> defined only in ePAPR (not in Linux or on devicetree.org).  The ePAPR
> language does not suggest that it's mandatory for all buses that don't need
> special handling -- in fact, the language could be read as suggesting that
> it's only applicable to the "internal I/O bus" on an SoC (whereas this
> is an external bus), though that wasn't the intent behind it.

Could you please update the lbc.txt suggesting the compatibility
with simple-bus for lbc? Or you thing that it would be wrong?

I think we should define compatibility list as "fsl,mpc-localbus",
"fsl,pqX-localbus", "simple-bus", noting that by default new
platforms/boards should only use "simple-bus" internally. Does this
look reasonable for you? I can then try to provide a patch.

> The notion of probing buses isn't really a part of the device tree specs;
> they're more concerned with binding the devices themselves.  In theory
> Linux should probably be probing everything that a driver will match,
> regardless of where in the tree it is, except where an ancestor node is
> diasbled, has matched a driver that wants to do things differently, or is
> on a blacklist.  Of course, that's somewhat of a philosophical question on
> whether it's better to risk probing someting that shouldn't be, or not
> probing something that should be.  The former is often nastier but more
> obvious, the latter is more likely until simple-bus is more widely used,
> and either one results in something not working.

> Leaving the localbus in may help someone, and it shouldn't hurt anything.

What do you suggest/prefer? To add .name="localbus" to generic code
or to have board-specific hooks (like one for mpc834xemitx)?

So,

>
> -Scott
>
>


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


Re: [PATCH 2/5] hugetlb: add phys addr to struct huge_bootmem_page

2011-07-22 Thread Becky Bruce

On Jul 21, 2011, at 5:44 PM, Andrew Morton wrote:

> On Tue, 28 Jun 2011 14:54:45 -0500
> Becky Bruce  wrote:
> 
>> From: Becky Bruce 
>> 
>> This is needed on HIGHMEM systems - we don't always have a virtual
>> address so store the physical address and map it in as needed.
>> 
>> Signed-off-by: Becky Bruce 
>> ---
>> include/linux/hugetlb.h |3 +++
>> mm/hugetlb.c|8 +++-
>> 2 files changed, 10 insertions(+), 1 deletions(-)
>> 
>> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
>> index 59225ef..19644e0 100644
>> --- a/include/linux/hugetlb.h
>> +++ b/include/linux/hugetlb.h
>> @@ -231,6 +231,9 @@ struct hstate {
>> struct huge_bootmem_page {
>>  struct list_head list;
>>  struct hstate *hstate;
>> +#ifdef CONFIG_HIGHMEM
>> +phys_addr_t phys;
>> +#endif
>> };
>> 
>> struct page *alloc_huge_page_node(struct hstate *h, int nid);
>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
>> index 6402458..2db81ea 100644
>> --- a/mm/hugetlb.c
>> +++ b/mm/hugetlb.c
>> @@ -1105,8 +1105,14 @@ static void __init gather_bootmem_prealloc(void)
>>  struct huge_bootmem_page *m;
>> 
>>  list_for_each_entry(m, &huge_boot_pages, list) {
>> -struct page *page = virt_to_page(m);
>>  struct hstate *h = m->hstate;
>> +#ifdef CONFIG_HIGHMEM
>> +struct page *page = pfn_to_page(m->phys >> PAGE_SHIFT);
>> +free_bootmem_late((unsigned long)m,
>> +  sizeof(struct huge_bootmem_page));
>> +#else
>> +struct page *page = virt_to_page(m);
>> +#endif
>>  __ClearPageReserved(page);
>>  WARN_ON(page_count(page) != 1);
>>  prep_compound_huge_page(page, h->order);
> 
> nit: wrapping both definitions and statements in an ifdef like this is
> a bit nasty from a readability and maintainability point of view - it's
> inviting people to later make changes which fail to compile when the
> config option is flipped.
> 
> This is better:
> 
> --- a/mm/hugetlb.c~hugetlb-add-phys-addr-to-struct-huge_bootmem_page-fix
> +++ a/mm/hugetlb.c
> @@ -1106,12 +1106,14 @@ static void __init gather_bootmem_preall
> 
>   list_for_each_entry(m, &huge_boot_pages, list) {
>   struct hstate *h = m->hstate;
> + struct page *page;
> +
> #ifdef CONFIG_HIGHMEM
> - struct page *page = pfn_to_page(m->phys >> PAGE_SHIFT);
> + page = pfn_to_page(m->phys >> PAGE_SHIFT);
>   free_bootmem_late((unsigned long)m,
> sizeof(struct huge_bootmem_page));
> #else
> - struct page *page = virt_to_page(m);
> + page = virt_to_page(m);
> #endif
>   __ClearPageReserved(page);
>   WARN_ON(page_count(page) != 1);

Andrew,

I totally agree, this is better, thanks.   I see you've put my original patch 
and your fix into -mm;  I'd like it to percolate there for a bit before it goes 
to Linus to be sure I haven't broken anything.  It should be safe, as I don't 
think this particular function was ever expected to work on highmem platforms, 
but it's possible I'm overlooking something.

Cheers,
-Becky

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


[PATCH v2] powerpc/85xx: enable caam crypto driver by default

2011-07-22 Thread Kim Phillips
corenet based SoCs have SEC4 h/w, so enable the SEC4 driver,
caam, and the algorithms it supports, and disable the
SEC2/3 driver, talitos.

Signed-off-by: Kim Phillips 
---
v2: rebase from old e55xx_smp_defconfig file to new corenet & p1023
defconfigs

 arch/powerpc/configs/85xx/p1023rds_defconfig |1 +
 arch/powerpc/configs/corenet32_smp_defconfig |1 +
 arch/powerpc/configs/corenet64_smp_defconfig |5 -
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/configs/85xx/p1023rds_defconfig 
b/arch/powerpc/configs/85xx/p1023rds_defconfig
index 980ff8f..3ff5a81 100644
--- a/arch/powerpc/configs/85xx/p1023rds_defconfig
+++ b/arch/powerpc/configs/85xx/p1023rds_defconfig
@@ -171,3 +171,4 @@ CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_DEV_FSL_CAAM=y
diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 10562a5..4311d02 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -185,3 +185,4 @@ CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_DEV_FSL_CAAM=y
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index d322835..c92c204 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -100,5 +100,8 @@ CONFIG_DEBUG_INFO=y
 CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_VIRQ_DEBUG=y
 CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA512=y
+CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRYPTO_DEV_TALITOS=y
+CONFIG_CRYPTO_DEV_FSL_CAAM=y
-- 
1.7.6


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


Re: [PATCH V2 2/3] powerpc/83xx: consolidate of_platform_bus_probe calls

2011-07-22 Thread Scott Wood
On Fri, 22 Jul 2011 23:55:43 +0400
Dmitry Eremin-Solenikov  wrote:

> 83xx board files have a lot of duplication in
> *_declare_of_platform_devices() functions. Merge that into a single
> function common to most of the boards.
> 
> The only leftover is mpc834x_itx.c board file which explicitly asks for
> fsl,pq2pro-localbus, as corresponding bindings don't provide
> "simple-bus" compatibility in localbus node.

What if simple-bus is added to that board's device tree in the future?
Won't we end up probing it twice?

-Scott

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


Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls

2011-07-22 Thread Scott Wood
On Fri, 22 Jul 2011 23:44:01 +0400
Dmitry Eremin-Solenikov  wrote:

> On 7/19/11, Scott Wood  wrote:
> > On Tue, 19 Jul 2011 12:53:50 +0400
> > Dmitry Eremin-Solenikov  wrote:
> >
> >> +static struct of_device_id __initdata mpc85xx_common_ids[] = {
> >> +  { .type = "soc", },
> >> +  { .compatible = "soc", },
> >> +  { .compatible = "simple-bus", },
> >> +  { .compatible = "gianfar", },
> >> +  { .compatible = "fsl,qe", },
> >> +  { .compatible = "fsl,cpm2", },
> >> +  {},
> >> +};
> >
> > Same comment as for 83xx regarding localbus and compatibility with old
> > device trees.
> 
> I checked for in-kernel device trees. Unless I miss something, there are no
> leftovers from this list. (83xx provided no simple-bus property for localbus,
> so your argument is valid there). If we should care about strange cases,
> not even blessed by kernel trees, I can add some of the old probes back.

I see simple-bus missing in sbc8560 and ksi8560 -- were these included in
the consolidation?  Plus some of the others may have had simple-bus added
after their initial version.

As for out-of-tree trees (which could include trees dynamically
generated/augmented by firmware, as well as device trees for custom boards
that forked off of an old reference board tree), it's still nice to not
break them as long as they stick to the binding.

While the localbus binding is deficient regarding the compatible property,
IIRC localbus preceded the introduction of simple-bus, which appears to be
defined only in ePAPR (not in Linux or on devicetree.org).  The ePAPR
language does not suggest that it's mandatory for all buses that don't need
special handling -- in fact, the language could be read as suggesting that
it's only applicable to the "internal I/O bus" on an SoC (whereas this
is an external bus), though that wasn't the intent behind it.

The notion of probing buses isn't really a part of the device tree specs;
they're more concerned with binding the devices themselves.  In theory
Linux should probably be probing everything that a driver will match,
regardless of where in the tree it is, except where an ancestor node is
diasbled, has matched a driver that wants to do things differently, or is
on a blacklist.  Of course, that's somewhat of a philosophical question on
whether it's better to risk probing someting that shouldn't be, or not
probing something that should be.  The former is often nastier but more
obvious, the latter is more likely until simple-bus is more widely used,
and either one results in something not working.

Leaving the localbus in may help someone, and it shouldn't hurt anything.

-Scott

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


Re: [openmcapi-dev] [PATCH] powerpc: Exporting boot_cpuid_phys

2011-07-22 Thread Kumar Gala

On Jul 22, 2011, at 2:11 PM, Hollis Blanchard wrote:

> On 07/16/2011 06:22 AM, Andrew Gabbasov wrote:
>> Kernel loadable module can use hard_smp_processor_id() if building with SMP
>> kernel. In order to make it work for UP kernels too, boot_cpuid_phys
>> symbol (which is what hard_smp_processor_id() macro resolves to
>> in non-SMP configuration) must be exported.
>> 
>> Signed-off-by: Andrew Gabbasov
>> ---
>>  arch/powerpc/kernel/setup_32.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>> 
>> diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
>> index 1d2fbc9..3dffce6 100644
>> --- a/arch/powerpc/kernel/setup_32.c
>> +++ b/arch/powerpc/kernel/setup_32.c
>> @@ -49,6 +49,7 @@ extern void bootx_init(unsigned long r4, unsigned long 
>> phys);
>>  int boot_cpuid = -1;
>>  EXPORT_SYMBOL_GPL(boot_cpuid);
>>  int boot_cpuid_phys;
>> +EXPORT_SYMBOL_GPL(boot_cpuid_phys);
>> 
>>  int smp_hw_index[NR_CPUS];
> 
> Ben, ping?

Its in Benh's next branch.

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


[PATCH V2 2/2] powerpc/85xx: separate cpm2 pic init

2011-07-22 Thread Dmitry Eremin-Solenikov
Separate handling of CPM2 PIC initialization to mpc85xx_cpm2_pic_init()
function.

Signed-off-by: Dmitry Eremin-Solenikov 
---
 arch/powerpc/platforms/85xx/ksi8560.c|   29 +--
 arch/powerpc/platforms/85xx/mpc85xx.h|7 
 arch/powerpc/platforms/85xx/mpc85xx_ads.c|   33 +-
 arch/powerpc/platforms/85xx/mpc85xx_common.c |   39 ++
 arch/powerpc/platforms/85xx/sbc8560.c|   33 +-
 arch/powerpc/platforms/85xx/stx_gp3.c|   35 +--
 arch/powerpc/platforms/85xx/tqm85xx.c|   35 +--
 7 files changed, 51 insertions(+), 160 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/ksi8560.c 
b/arch/powerpc/platforms/85xx/ksi8560.c
index 7657e1a..3c325b1 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -33,7 +33,6 @@
 #include 
 
 #include 
-#include 
 
 #include "mpc85xx.h"
 
@@ -55,25 +54,11 @@ static void machine_restart(char *cmd)
for (;;);
 }
 
-static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
-{
-   struct irq_chip *chip = irq_desc_get_chip(desc);
-   int cascade_irq;
-
-   while ((cascade_irq = cpm2_get_irq()) >= 0)
-   generic_handle_irq(cascade_irq);
-
-   chip->irq_eoi(&desc->irq_data);
-}
-
 static void __init ksi8560_pic_init(void)
 {
struct mpic *mpic;
struct resource r;
struct device_node *np;
-#ifdef CONFIG_CPM2
-   int irq;
-#endif
 
np = of_find_node_by_type(NULL, "open-pic");
 
@@ -96,19 +81,7 @@ static void __init ksi8560_pic_init(void)
 
mpic_init(mpic);
 
-#ifdef CONFIG_CPM2
-   /* Setup CPM2 PIC */
-   np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
-   if (np == NULL) {
-   printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
-   return;
-   }
-   irq = irq_of_parse_and_map(np, 0);
-
-   cpm2_pic_init(np);
-   of_node_put(np);
-   irq_set_chained_handler(irq, cpm2_cascade);
-#endif
+   mpc85xx_cpm2_pic_init();
 }
 
 #ifdef CONFIG_CPM2
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h 
b/arch/powerpc/platforms/85xx/mpc85xx.h
index 1a1b4eb..2aa7c5d 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx.h
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -1,4 +1,11 @@
 #ifndef MPC85xx_H
 #define MPC85xx_H
 extern int mpc85xx_common_publish_devices(void);
+
+#ifdef CONFIG_CPM2
+extern void mpc85xx_cpm2_pic_init(void);
+#else
+static inline void __init mpc85xx_cpm2_pic_init(void) {}
+#endif /* CONFIG_CPM2 */
+
 #endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c 
b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 153d2aa..8df4ff5 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -32,7 +32,6 @@
 
 #ifdef CONFIG_CPM2
 #include 
-#include 
 #endif
 
 #include "mpc85xx.h"
@@ -48,29 +47,11 @@ static int mpc85xx_exclude_device(struct pci_controller 
*hose,
 }
 #endif /* CONFIG_PCI */
 
-#ifdef CONFIG_CPM2
-
-static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
-{
-   struct irq_chip *chip = irq_desc_get_chip(desc);
-   int cascade_irq;
-
-   while ((cascade_irq = cpm2_get_irq()) >= 0)
-   generic_handle_irq(cascade_irq);
-
-   chip->irq_eoi(&desc->irq_data);
-}
-
-#endif /* CONFIG_CPM2 */
-
 static void __init mpc85xx_ads_pic_init(void)
 {
struct mpic *mpic;
struct resource r;
struct device_node *np = NULL;
-#ifdef CONFIG_CPM2
-   int irq;
-#endif
 
np = of_find_node_by_type(np, "open-pic");
if (!np) {
@@ -92,19 +73,7 @@ static void __init mpc85xx_ads_pic_init(void)
 
mpic_init(mpic);
 
-#ifdef CONFIG_CPM2
-   /* Setup CPM2 PIC */
-   np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
-   if (np == NULL) {
-   printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
-   return;
-   }
-   irq = irq_of_parse_and_map(np, 0);
-
-   cpm2_pic_init(np);
-   of_node_put(np);
-   irq_set_chained_handler(irq, cpm2_cascade);
-#endif
+   mpc85xx_cpm2_pic_init();
 }
 
 /*
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_common.c 
b/arch/powerpc/platforms/85xx/mpc85xx_common.c
index 999567a..4fdf382 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_common.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_common.c
@@ -8,6 +8,8 @@
 #include 
 #include 
 
+#include 
+
 #include "mpc85xx.h"
 
 static struct of_device_id __initdata mpc85xx_common_ids[] = {
@@ -24,3 +26,40 @@ int __init mpc85xx_common_publish_devices(void)
 {
return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL);
 }
+
+#ifdef CONFIG_CPM2
+static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
+{
+   struct irq_chip *chip = irq_desc_get_chip(desc);
+   int cascade_irq;
+
+   while ((cascade_irq = cpm2_get_irq()) >= 0)
+   

[PATCH V2 1/2] powerpc/85xx: consolidate of_platform_bus_probe calls

2011-07-22 Thread Dmitry Eremin-Solenikov
85xx board files have a lot of duplication in *_publish_devices()/
*_declare_of_platform_devices() functions. Merge that into a single
function common to most of the boards.

Signed-off-by: Dmitry Eremin-Solenikov 
---
 arch/powerpc/platforms/85xx/Makefile |2 +
 arch/powerpc/platforms/85xx/ksi8560.c|   18 +-
 arch/powerpc/platforms/85xx/mpc8536_ds.c |   16 ++---
 arch/powerpc/platforms/85xx/mpc85xx.h|4 ++
 arch/powerpc/platforms/85xx/mpc85xx_ads.c|   20 ++-
 arch/powerpc/platforms/85xx/mpc85xx_cds.c|   16 ++---
 arch/powerpc/platforms/85xx/mpc85xx_common.c |   26 ++
 arch/powerpc/platforms/85xx/mpc85xx_ds.c |   20 +++
 arch/powerpc/platforms/85xx/mpc85xx_mds.c|   46 ++---
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c|   18 ++
 arch/powerpc/platforms/85xx/p1010rdb.c   |   15 ++---
 arch/powerpc/platforms/85xx/p1022_ds.c   |7 ++--
 arch/powerpc/platforms/85xx/p1023_rds.c  |   19 ++-
 arch/powerpc/platforms/85xx/sbc8548.c|   18 ++
 arch/powerpc/platforms/85xx/sbc8560.c|   20 ++-
 arch/powerpc/platforms/85xx/socrates.c   |   13 +--
 arch/powerpc/platforms/85xx/stx_gp3.c|   16 ++---
 arch/powerpc/platforms/85xx/tqm85xx.c|   16 ++---
 arch/powerpc/platforms/85xx/xes_mpc85xx.c|   20 +++
 19 files changed, 84 insertions(+), 246 deletions(-)
 create mode 100644 arch/powerpc/platforms/85xx/mpc85xx.h
 create mode 100644 arch/powerpc/platforms/85xx/mpc85xx_common.c

diff --git a/arch/powerpc/platforms/85xx/Makefile 
b/arch/powerpc/platforms/85xx/Makefile
index a971b32..172a4c8 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -3,6 +3,8 @@
 #
 obj-$(CONFIG_SMP) += smp.o
 
+obj-y += mpc85xx_common.o
+
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c 
b/arch/powerpc/platforms/85xx/ksi8560.c
index c46f935..7657e1a 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 
+#include "mpc85xx.h"
 
 #define KSI8560_CPLD_HVR   0x04 /* Hardware Version Register */
 #define KSI8560_CPLD_PVR   0x08 /* PLD Version Register */
@@ -215,22 +216,7 @@ static void ksi8560_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
 }
 
-static struct of_device_id __initdata of_bus_ids[] = {
-   { .type = "soc", },
-   { .type = "simple-bus", },
-   { .name = "cpm", },
-   { .name = "localbus", },
-   { .compatible = "gianfar", },
-   {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
-   of_platform_bus_probe(NULL, of_bus_ids, NULL);
-
-   return 0;
-}
-machine_device_initcall(ksi8560, declare_of_platform_devices);
+machine_device_initcall(ksi8560, mpc85xx_common_publish_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c 
b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index f79f2f1..9ee6455 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -32,6 +32,8 @@
 #include 
 #include 
 
+#include "mpc85xx.h"
+
 void __init mpc8536_ds_pic_init(void)
 {
struct mpic *mpic;
@@ -104,19 +106,7 @@ static void __init mpc8536_ds_setup_arch(void)
printk("MPC8536 DS board from Freescale Semiconductor\n");
 }
 
-static struct of_device_id __initdata mpc8536_ds_ids[] = {
-   { .type = "soc", },
-   { .compatible = "soc", },
-   { .compatible = "simple-bus", },
-   { .compatible = "gianfar", },
-   {},
-};
-
-static int __init mpc8536_ds_publish_devices(void)
-{
-   return of_platform_bus_probe(NULL, mpc8536_ds_ids, NULL);
-}
-machine_device_initcall(mpc8536_ds, mpc8536_ds_publish_devices);
+machine_device_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
 
 machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
 
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h 
b/arch/powerpc/platforms/85xx/mpc85xx.h
new file mode 100644
index 000..1a1b4eb
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -0,0 +1,4 @@
+#ifndef MPC85xx_H
+#define MPC85xx_H
+extern int mpc85xx_common_publish_devices(void);
+#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c 
b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 3b2c9bb..153d2aa 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -35,6 +35,8 @@
 #include 
 #endif
 
+#include "mpc85xx.h"
+
 #ifdef CONFIG_PCI
 static int mpc85xx_exclude_device(struct pci_controller *hose,
   u_char bus, u_char devfn)
@@ -221,23 +223,7 @@ static void mpc85xx_ads_show_cpuinfo(

[PATCH V2 0/2] powerpc/85xx: cleanup efforts

2011-07-22 Thread Dmitry Eremin-Solenikov
This is a second revision of patches, cleaning up mpc85xx support
Changes since V1:
* Temporarily drop questionable patches 
* Use common cpm2 init routing in stx_gp3.c
* Add powerpc/ prefix


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


Re: [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries

2011-07-22 Thread Dmitry Eremin-Solenikov
On 7/19/11, Kumar Gala  wrote:
>
> On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
>
>> p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies
>> other than dt compatible strings. Merge them into single machine entry
>> named mpc85xx_rdb
>>
>> Signed-off-by: Dmitry Eremin-Solenikov 
>> ---
>> arch/powerpc/platforms/85xx/mpc85xx_rdb.c |   40
>> ++--
>> 1 files changed, 9 insertions(+), 31 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> index 088f30b..7a3a37b 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> @@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void)
>> {
>>  return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
>> }
>> -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
>> -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
>> +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
>>
>> /*
>>  * Called very early, device-tree isn't unflattened
>>  */
>> -static int __init p2020_rdb_probe(void)
>> +static int __init mpc85xx_rdb_probe(void)
>> {
>>  unsigned long root = of_get_flat_dt_root();
>>
>> -if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
>> +if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") ||
>> +of_flat_dt_is_compatible(root, "fsl,P2020RDB")) {
>>  return 1;
>> -return 0;
>> +} else
>> +return 0;
>> }
>>
>> -static int __init p1020_rdb_probe(void)
>> -{
>> -unsigned long root = of_get_flat_dt_root();
>> -
>> -if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
>> -return 1;
>> -return 0;
>> -}
>> -
>> -define_machine(p2020_rdb) {
>> -.name   = "P2020 RDB",
>> -.probe  = p2020_rdb_probe,
>> -.setup_arch = mpc85xx_rdb_setup_arch,
>> -.init_IRQ   = mpc85xx_rdb_pic_init,
>> -#ifdef CONFIG_PCI
>> -.pcibios_fixup_bus  = fsl_pcibios_fixup_bus,
>> -#endif
>> -.get_irq= mpic_get_irq,
>> -.restart= fsl_rstcr_restart,
>> -.calibrate_decr = generic_calibrate_decr,
>> -.progress   = udbg_progress,
>> -};
>> -
>> -define_machine(p1020_rdb) {
>> -.name   = "P1020 RDB",
>> -.probe  = p1020_rdb_probe,
>> +define_machine(mpc85xx_rdb) {
>> +.name   = "MPC85xx RDB",
>
> breaking 'name' this way isn't acceptable.

BTW: what is so special in p1010rdb, so it's not
merged into this file, but exists as a separate .c file?

>
>> +.probe  = mpc85xx_rdb_probe,
>>  .setup_arch = mpc85xx_rdb_setup_arch,
>>  .init_IRQ   = mpc85xx_rdb_pic_init,
>> #ifdef CONFIG_PCI
>> --
>> 1.7.2.5
>
>


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


Re: [PATCH 12/14] 85xx/mpc85xx_ds,ads,cds: move .pci_exclude_device setting to machine definitions

2011-07-22 Thread Dmitry Eremin-Solenikov
On 7/19/11, Kumar Gala  wrote:
>
> On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
>
>> Signed-off-by: Dmitry Eremin-Solenikov 
>> ---
>> arch/powerpc/platforms/85xx/mpc85xx_ads.c |5 +++--
>> arch/powerpc/platforms/85xx/mpc85xx_cds.c |5 ++---
>> arch/powerpc/platforms/85xx/mpc85xx_ds.c  |5 +++--
>> 3 files changed, 8 insertions(+), 7 deletions(-)
>
> I believe these are done this way for a reason (its been some time).  I
> can't remember if it maters or not, but having pci_exclude_device() means
> that any code in fsl_add_bridge() would not be impacted by the exclude
> function.

Hmm. I have to check this.

BTW: what is the point in disabling access to bus == 0 && PCI_SLOT == 0 on some
of those boards (esp. ads)? Other boards lack this check/exclude. Does it mean
something historical (and so can be dropped), is it some workaround/bugfix
(then it should be propagated to other boards??) or something else?

>
> Not sure what value making this change has at this point.

One of my big goals is to drop most of differencies from setup_arch functions
(one simple function can handle all things like PCI, SWIOTLB, etc).
Not yet ready
for submission though (not enough time to clean all the things). And moving
this assignment to static code would allow me to drop setup_arch()
function completely
(more or less) on these boards.

>
> - k
>
>>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> index 3b2c9bb..2483929 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> @@ -200,8 +200,6 @@ static void __init mpc85xx_ads_setup_arch(void)
>> #ifdef CONFIG_PCI
>>  for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
>>  fsl_add_bridge(np, 1);
>> -
>> -ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>> }
>>
>> @@ -254,6 +252,9 @@ define_machine(mpc85xx_ads) {
>>  .probe  = mpc85xx_ads_probe,
>>  .setup_arch = mpc85xx_ads_setup_arch,
>>  .init_IRQ   = mpc85xx_ads_pic_init,
>> +#ifdef CONFIG_PCI
>> +.pci_exclude_device = mpc85xx_exclude_device,
>> +#endif
>>  .show_cpuinfo   = mpc85xx_ads_show_cpuinfo,
>>  .get_irq= mpic_get_irq,
>>  .restart= fsl_rstcr_restart,
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> index 6299a2a..e209c23 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> @@ -297,9 +297,6 @@ static void __init mpc85xx_cds_setup_arch(void)
>>  fsl_add_bridge(np, 0);
>>  }
>>  }
>> -
>> -ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
>> -ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>> }
>>
>> @@ -355,6 +352,8 @@ define_machine(mpc85xx_cds) {
>> #ifdef CONFIG_PCI
>>  .restart= mpc85xx_cds_restart,
>>  .pcibios_fixup_bus  = fsl_pcibios_fixup_bus,
>> +.pci_irq_fixup  = mpc85xx_cds_pci_irq_fixup,
>> +.pci_exclude_device = mpc85xx_exclude_device,
>> #else
>>  .restart= fsl_rstcr_restart,
>> #endif
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> index c7b97f7..53bf07d 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> @@ -182,8 +182,6 @@ static void __init mpc85xx_ds_setup_arch(void)
>>  hose->dma_window_size);
>>  }
>>  }
>> -
>> -ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>>
>> #ifdef CONFIG_SMP
>> @@ -279,6 +277,7 @@ define_machine(mpc8544_ds) {
>>  .init_IRQ   = mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>>  .pcibios_fixup_bus  = fsl_pcibios_fixup_bus,
>> +.pci_exclude_device = mpc85xx_exclude_device,
>> #endif
>>  .get_irq= mpic_get_irq,
>>  .restart= fsl_rstcr_restart,
>> @@ -293,6 +292,7 @@ define_machine(mpc8572_ds) {
>>  .init_IRQ   = mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>>  .pcibios_fixup_bus  = fsl_pcibios_fixup_bus,
>> +.pci_exclude_device = mpc85xx_exclude_device,
>> #endif
>>  .get_irq= mpic_get_irq,
>>  .restart= fsl_rstcr_restart,
>> @@ -307,6 +307,7 @@ define_machine(p2020_ds) {
>>  .init_IRQ   = mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>>  .pcibios_fixup_bus  = fsl_pcibios_fixup_bus,
>> +.pci_exclude_device = mpc85xx_exclude_device,
>> #endif
>>  .get_irq= mpic_get_irq,
>>  .restart= fsl_rstcr_restart,
>> --
>> 1.7.2.5
>
>


-- 
With best wishes
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/li

[PATCH V2 3/3] powerpc/83xx: headers cleanup

2011-07-22 Thread Dmitry Eremin-Solenikov
Drop lots of unused headers after board files merge/splitup

Signed-off-by: Dmitry Eremin-Solenikov 
---
 arch/powerpc/platforms/83xx/asp834x.c  |2 -
 arch/powerpc/platforms/83xx/km83xx.c   |   24 +--
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |5 
 arch/powerpc/platforms/83xx/misc.c |1 -
 arch/powerpc/platforms/83xx/mpc830x_rdb.c  |5 +--
 arch/powerpc/platforms/83xx/mpc831x_rdb.c  |2 -
 arch/powerpc/platforms/83xx/mpc832x_mds.c  |   30 
 arch/powerpc/platforms/83xx/mpc832x_rdb.c  |   11 
 arch/powerpc/platforms/83xx/mpc834x_itx.c  |   20 
 arch/powerpc/platforms/83xx/mpc834x_mds.c  |   20 
 arch/powerpc/platforms/83xx/mpc836x_mds.c  |   29 ---
 arch/powerpc/platforms/83xx/mpc836x_rdk.c  |8 +-
 arch/powerpc/platforms/83xx/mpc837x_mds.c  |4 ---
 arch/powerpc/platforms/83xx/mpc837x_rdb.c  |2 -
 arch/powerpc/platforms/83xx/sbc834x.c  |   20 
 arch/powerpc/platforms/83xx/suspend.c  |8 --
 arch/powerpc/platforms/83xx/usb.c  |8 --
 17 files changed, 4 insertions(+), 195 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/asp834x.c 
b/arch/powerpc/platforms/83xx/asp834x.c
index 464ea8e..a7c0188 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -14,10 +14,8 @@
  * option) any later version.
  */
 
-#include 
 #include 
 
-#include 
 #include 
 #include 
 
diff --git a/arch/powerpc/platforms/83xx/km83xx.c 
b/arch/powerpc/platforms/83xx/km83xx.c
index f82001e..032cf37 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -11,35 +11,13 @@
  * option) any later version.
  */
 
-#include 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
+
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
 #include 
-#include 
+#include 
 
 #include "mpc83xx.h"
 
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c 
b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 70798ac..f47aac2 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -11,17 +11,12 @@
  * (at your option) any later version.
  */
 
-#include 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 /*
diff --git a/arch/powerpc/platforms/83xx/misc.c 
b/arch/powerpc/platforms/83xx/misc.c
index ee4de77..96418d3 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -9,7 +9,6 @@
  * option) any later version.
  */
 
-#include 
 #include 
 #include 
 
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c 
b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index ef595f1..6e4783d 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -14,12 +14,11 @@
  */
 
 #include 
-#include 
-#include 
+
 #include 
 #include 
 #include 
-#include 
+
 #include "mpc83xx.h"
 
 /*
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c 
b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index ce87406..ac38b14 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -14,9 +14,7 @@
  */
 
 #include 
-#include 
 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c 
b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 668b58e..50e6963 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -10,45 +10,15 @@
  * option) any later version.
  */
 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
+
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
-#include 
 
 #include "mpc83xx.h"
 
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 /* 
  *
  * Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c 
b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index e4c7c64..358a71c 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -15,30 +15,19 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
 #include "mpc83xx.h"
 
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 #i

[PATCH V2 2/3] powerpc/83xx: consolidate of_platform_bus_probe calls

2011-07-22 Thread Dmitry Eremin-Solenikov
83xx board files have a lot of duplication in
*_declare_of_platform_devices() functions. Merge that into a single
function common to most of the boards.

The only leftover is mpc834x_itx.c board file which explicitly asks for
fsl,pq2pro-localbus, as corresponding bindings don't provide
"simple-bus" compatibility in localbus node.

Signed-off-by: Dmitry Eremin-Solenikov 
---
 arch/powerpc/platforms/83xx/asp834x.c |   15 +--
 arch/powerpc/platforms/83xx/km83xx.c  |   18 +-
 arch/powerpc/platforms/83xx/misc.c|   17 +
 arch/powerpc/platforms/83xx/mpc830x_rdb.c |   13 +
 arch/powerpc/platforms/83xx/mpc831x_rdb.c |   14 +-
 arch/powerpc/platforms/83xx/mpc832x_mds.c |   18 +-
 arch/powerpc/platforms/83xx/mpc832x_rdb.c |   18 +-
 arch/powerpc/platforms/83xx/mpc834x_itx.c |3 +--
 arch/powerpc/platforms/83xx/mpc834x_mds.c |   15 +--
 arch/powerpc/platforms/83xx/mpc836x_mds.c |   18 +-
 arch/powerpc/platforms/83xx/mpc836x_rdk.c |   11 +--
 arch/powerpc/platforms/83xx/mpc837x_mds.c |   17 +
 arch/powerpc/platforms/83xx/mpc837x_rdb.c |   18 +-
 arch/powerpc/platforms/83xx/mpc83xx.h |1 +
 arch/powerpc/platforms/83xx/sbc834x.c |   15 +--
 15 files changed, 31 insertions(+), 180 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/asp834x.c 
b/arch/powerpc/platforms/83xx/asp834x.c
index 90b6c06..464ea8e 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -36,20 +36,7 @@ static void __init asp834x_setup_arch(void)
mpc834x_usb_cfg();
 }
 
-static struct __initdata of_device_id asp8347_ids[] = {
-   { .type = "soc", },
-   { .compatible = "soc", },
-   { .compatible = "simple-bus", },
-   { .compatible = "gianfar", },
-   {},
-};
-
-static int __init asp8347_declare_of_platform_devices(void)
-{
-   of_platform_bus_probe(NULL, asp8347_ids, NULL);
-   return 0;
-}
-machine_device_initcall(asp834x, asp8347_declare_of_platform_devices);
+machine_device_initcall(asp834x, mpc83xx_declare_of_platform_devices);
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/km83xx.c 
b/arch/powerpc/platforms/83xx/km83xx.c
index 28d272a..f82001e 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -122,23 +122,7 @@ static void __init mpc83xx_km_setup_arch(void)
 #endif /* CONFIG_QUICC_ENGINE */
 }
 
-static struct of_device_id kmpbec83xx_ids[] = {
-   { .type = "soc", },
-   { .compatible = "soc", },
-   { .compatible = "simple-bus", },
-   { .type = "qe", },
-   { .compatible = "fsl,qe", },
-   {},
-};
-
-static int __init kmeter_declare_of_platform_devices(void)
-{
-   /* Publish the QE devices */
-   of_platform_bus_probe(NULL, kmpbec83xx_ids, NULL);
-
-   return 0;
-}
-machine_device_initcall(mpc83xx_km, kmeter_declare_of_platform_devices);
+machine_device_initcall(mpc83xx_km, mpc83xx_declare_of_platform_devices);
 
 /* list of the supported boards */
 static char *board[] __initdata = {
diff --git a/arch/powerpc/platforms/83xx/misc.c 
b/arch/powerpc/platforms/83xx/misc.c
index 4ac60cc..ee4de77 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -111,3 +111,20 @@ void __init mpc83xx_ipic_and_qe_init_IRQ(void)
mpc83xx_qe_init_IRQ();
 }
 #endif /* CONFIG_QUICC_ENGINE */
+
+static struct of_device_id __initdata of_bus_ids[] = {
+   { .type = "soc", },
+   { .compatible = "soc", },
+   { .compatible = "simple-bus" },
+   { .compatible = "gianfar" },
+   { .compatible = "gpio-leds", },
+   { .type = "qe", },
+   { .compatible = "fsl,qe", },
+   {},
+};
+
+int __init mpc83xx_declare_of_platform_devices(void)
+{
+   of_platform_bus_probe(NULL, of_bus_ids, NULL);
+   return 0;
+}
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c 
b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index b453c15..ef595f1 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -56,18 +56,7 @@ static int __init mpc830x_rdb_probe(void)
return of_flat_dt_match(of_get_flat_dt_root(), board);
 }
 
-static struct of_device_id __initdata of_bus_ids[] = {
-   { .compatible = "simple-bus" },
-   { .compatible = "gianfar" },
-   {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
-   of_platform_bus_probe(NULL, of_bus_ids, NULL);
-   return 0;
-}
-machine_device_initcall(mpc830x_rdb, declare_of_platform_devices);
+machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices);
 
 define_machine(mpc830x_rdb) {
.name   = "MPC830x RDB",
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c 
b/arch/powerpc/platforms/83xx/m

[PATCH V2 1/3] powerpc/83xx: consolidate init_IRQ functions

2011-07-22 Thread Dmitry Eremin-Solenikov
On mpc83xx platform nearly all _init_IRQ functions look alike. They either
just setup ipic, or setup ipic and QE PIC. Separate this to special functions
to be either referenced from ppc_md, or called from board file.

Signed-off-by: Dmitry Eremin-Solenikov 
---
 arch/powerpc/platforms/83xx/asp834x.c |   20 +
 arch/powerpc/platforms/83xx/km83xx.c  |   33 +
 arch/powerpc/platforms/83xx/misc.c|   46 +
 arch/powerpc/platforms/83xx/mpc830x_rdb.c |   18 +--
 arch/powerpc/platforms/83xx/mpc831x_rdb.c |   18 +--
 arch/powerpc/platforms/83xx/mpc832x_mds.c |   30 +--
 arch/powerpc/platforms/83xx/mpc832x_rdb.c |   31 +---
 arch/powerpc/platforms/83xx/mpc834x_itx.c |   18 +--
 arch/powerpc/platforms/83xx/mpc834x_mds.c |   18 +--
 arch/powerpc/platforms/83xx/mpc836x_mds.c |   30 +--
 arch/powerpc/platforms/83xx/mpc836x_rdk.c |   28 +-
 arch/powerpc/platforms/83xx/mpc837x_mds.c |   18 +--
 arch/powerpc/platforms/83xx/mpc837x_rdb.c |   18 +--
 arch/powerpc/platforms/83xx/mpc83xx.h |9 +
 arch/powerpc/platforms/83xx/sbc834x.c |   20 +
 15 files changed, 68 insertions(+), 287 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/asp834x.c 
b/arch/powerpc/platforms/83xx/asp834x.c
index aa0d84d..90b6c06 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -36,24 +36,6 @@ static void __init asp834x_setup_arch(void)
mpc834x_usb_cfg();
 }
 
-static void __init asp834x_init_IRQ(void)
-{
-   struct device_node *np;
-
-   np = of_find_node_by_type(NULL, "ipic");
-   if (!np)
-   return;
-
-   ipic_init(np, 0);
-
-   of_node_put(np);
-
-   /* Initialize the default interrupt mapping priorities,
-* in case the boot rom changed something on us.
-*/
-   ipic_set_default_priority();
-}
-
 static struct __initdata of_device_id asp8347_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
@@ -82,7 +64,7 @@ define_machine(asp834x) {
.name   = "ASP8347E",
.probe  = asp834x_probe,
.setup_arch = asp834x_setup_arch,
-   .init_IRQ   = asp834x_init_IRQ,
+   .init_IRQ   = mpc83xx_ipic_init_IRQ,
.get_irq= ipic_get_irq,
.restart= mpc83xx_restart,
.time_init  = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/km83xx.c 
b/arch/powerpc/platforms/83xx/km83xx.c
index a2b9b9e..28d272a 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -140,37 +140,6 @@ static int __init kmeter_declare_of_platform_devices(void)
 }
 machine_device_initcall(mpc83xx_km, kmeter_declare_of_platform_devices);
 
-static void __init mpc83xx_km_init_IRQ(void)
-{
-   struct device_node *np;
-
-   np = of_find_compatible_node(NULL, NULL, "fsl,pq2pro-pic");
-   if (!np) {
-   np = of_find_node_by_type(NULL, "ipic");
-   if (!np)
-   return;
-   }
-
-   ipic_init(np, 0);
-
-   /* Initialize the default interrupt mapping priorities,
-* in case the boot rom changed something on us.
-*/
-   ipic_set_default_priority();
-   of_node_put(np);
-
-#ifdef CONFIG_QUICC_ENGINE
-   np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
-   if (!np) {
-   np = of_find_node_by_type(NULL, "qeic");
-   if (!np)
-   return;
-   }
-   qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
-   of_node_put(np);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
 /* list of the supported boards */
 static char *board[] __initdata = {
"Keymile,KMETER1",
@@ -198,7 +167,7 @@ define_machine(mpc83xx_km) {
.name   = "mpc83xx-km-platform",
.probe  = mpc83xx_km_probe,
.setup_arch = mpc83xx_km_setup_arch,
-   .init_IRQ   = mpc83xx_km_init_IRQ,
+   .init_IRQ   = mpc83xx_ipic_and_qe_init_IRQ,
.get_irq= ipic_get_irq,
.restart= mpc83xx_restart,
.time_init  = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/misc.c 
b/arch/powerpc/platforms/83xx/misc.c
index f01806c..4ac60cc 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -11,9 +11,12 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include "mpc83xx.h"
@@ -65,3 +68,46 @@ long __init mpc83xx_time_init(void)
 
return 0;
 }
+
+void __init mpc83xx_ipic_init_IRQ(void)
+{
+   struct device_node *np;
+
+   /* looking for fsl,pq2pro-pic which is asl compatible with fsl,ipic */
+   np = of_find_compatible_node(N

[PATCH V2 0/3] powerpc/83xx cleanup

2011-07-22 Thread Dmitry Eremin-Solenikov
This is a revised version of leftovers from my cleanup efforts for MPC83xx
platform.

Changes since V1:
* Rename mpc83xx_both_init_IRQ to mpc83xx_ipic_and_qe_init_IRQ
* Add powerpc/ prefix to commit messages

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


Re: [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries

2011-07-22 Thread Dmitry Eremin-Solenikov
On 7/19/11, Kumar Gala  wrote:
>
> On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
>
>> p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies
>> other than dt compatible strings. Merge them into single machine entry
>> named mpc85xx_rdb
>>
>> Signed-off-by: Dmitry Eremin-Solenikov 
>> ---
>> arch/powerpc/platforms/85xx/mpc85xx_rdb.c |   40
>> ++--
>> 1 files changed, 9 insertions(+), 31 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> index 088f30b..7a3a37b 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
>> @@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void)
>> {
>>  return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
>> }
>> -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
>> -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
>> +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
>>
>> /*
>>  * Called very early, device-tree isn't unflattened
>>  */
>> -static int __init p2020_rdb_probe(void)
>> +static int __init mpc85xx_rdb_probe(void)
>> {
>>  unsigned long root = of_get_flat_dt_root();
>>
>> -if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
>> +if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") ||
>> +of_flat_dt_is_compatible(root, "fsl,P2020RDB")) {
>>  return 1;
>> -return 0;
>> +} else
>> +return 0;
>> }
>>
>> -static int __init p1020_rdb_probe(void)
>> -{
>> -unsigned long root = of_get_flat_dt_root();
>> -
>> -if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
>> -return 1;
>> -return 0;
>> -}
>> -
>> -define_machine(p2020_rdb) {
>> -.name   = "P2020 RDB",
>> -.probe  = p2020_rdb_probe,
>> -.setup_arch = mpc85xx_rdb_setup_arch,
>> -.init_IRQ   = mpc85xx_rdb_pic_init,
>> -#ifdef CONFIG_PCI
>> -.pcibios_fixup_bus  = fsl_pcibios_fixup_bus,
>> -#endif
>> -.get_irq= mpic_get_irq,
>> -.restart= fsl_rstcr_restart,
>> -.calibrate_decr = generic_calibrate_decr,
>> -.progress   = udbg_progress,
>> -};
>> -
>> -define_machine(p1020_rdb) {
>> -.name   = "P1020 RDB",
>> -.probe  = p1020_rdb_probe,
>> +define_machine(mpc85xx_rdb) {
>> +.name   = "MPC85xx RDB",
>
> breaking 'name' this way isn't acceptable.

What would be suitable from your point of view? Does "Px020 RDB" look good?
Or something like it?

>
>> +.probe  = mpc85xx_rdb_probe,
>>  .setup_arch = mpc85xx_rdb_setup_arch,
>>  .init_IRQ   = mpc85xx_rdb_pic_init,
>> #ifdef CONFIG_PCI
>> --
>> 1.7.2.5
>
>


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


Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls

2011-07-22 Thread Dmitry Eremin-Solenikov
On 7/19/11, Scott Wood  wrote:
> On Tue, 19 Jul 2011 12:53:50 +0400
> Dmitry Eremin-Solenikov  wrote:
>
>> +static struct of_device_id __initdata mpc85xx_common_ids[] = {
>> +{ .type = "soc", },
>> +{ .compatible = "soc", },
>> +{ .compatible = "simple-bus", },
>> +{ .compatible = "gianfar", },
>> +{ .compatible = "fsl,qe", },
>> +{ .compatible = "fsl,cpm2", },
>> +{},
>> +};
>
> Same comment as for 83xx regarding localbus and compatibility with old
> device trees.

I checked for in-kernel device trees. Unless I miss something, there are no
leftovers from this list. (83xx provided no simple-bus property for localbus,
so your argument is valid there). If we should care about strange cases,
not even blessed by kernel trees, I can add some of the old probes back.

What do you thing?

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


Re: [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code

2011-07-22 Thread Dmitry Eremin-Solenikov
On 7/19/11, Scott Wood  wrote:
> On Tue, 19 Jul 2011 12:53:41 +0400
> Dmitry Eremin-Solenikov  wrote:
>
>> As localbus on mpc8349e-mitx now provides simple-bus compatibility, we
>> can drop code asking for pq2pro-localbus devices on mpc834x_itx boards.
>
> Do we have a good reason for breaking compatibility with older device trees?

Hmm. No real reason if you look from this POV. Just didn't thought in
this direction.

BTW: Documentation/devicetree/fsl/lbc.txt doesn't talk at all about "compatible"
property. Maybe one can add there something (like asking to add simple-bus
for new platforms). I feel myself too unexperienced to fix that.

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


Re: [openmcapi-dev] [PATCH] powerpc: Exporting boot_cpuid_phys

2011-07-22 Thread Hollis Blanchard

On 07/16/2011 06:22 AM, Andrew Gabbasov wrote:

Kernel loadable module can use hard_smp_processor_id() if building with SMP
kernel. In order to make it work for UP kernels too, boot_cpuid_phys
symbol (which is what hard_smp_processor_id() macro resolves to
in non-SMP configuration) must be exported.

Signed-off-by: Andrew Gabbasov
---
  arch/powerpc/kernel/setup_32.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 1d2fbc9..3dffce6 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -49,6 +49,7 @@ extern void bootx_init(unsigned long r4, unsigned long phys);
  int boot_cpuid = -1;
  EXPORT_SYMBOL_GPL(boot_cpuid);
  int boot_cpuid_phys;
+EXPORT_SYMBOL_GPL(boot_cpuid_phys);

  int smp_hw_index[NR_CPUS];


Ben, ping?

Hollis Blanchard
Mentor Graphics, Embedded Systems Division

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


Re: [PATCH] [v3] tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver

2011-07-22 Thread Tabi Timur-B04825
On Fri, Jul 8, 2011 at 7:06 PM, Timur Tabi  wrote:
> The ePAPR embedded hypervisor specification provides an API for "byte
> channels", which are serial-like virtual devices for sending and receiving
> streams of bytes.  This driver provides Linux kernel support for byte
> channels via three distinct interfaces:
>
> 1) An early-console (udbg) driver.  This provides early console output
> through a byte channel.  The byte channel handle must be specified in a
> Kconfig option.
>
> 2) A normal console driver.  Output is sent to the byte channel designated
> for stdout in the device tree.  The console driver is for handling kernel
> printk calls.
>
> 3) A tty driver, which is used to handle user-space input and output.  The
> byte channel used for the console is designated as the default tty.
>
> Signed-off-by: Timur Tabi 
> ---

Greg,

I just want to make sure you haven't forgotten this patch.  Will you
be picking it up for 3.1?

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: RFC fsl_elbc_nand.c does not update mtd->ecc_stats

2011-07-22 Thread Scott Wood
On Fri, 22 Jul 2011 08:06:53 -0500
Michael Hench  wrote:

> when using the fsl_elbc_nand driver, mtd->ecc_stats does not appear to
> get updated

It gets updated for uncorrectable errors (so no need to use lteccr for
that), but not correctable.

> diff -purN orig/drivers/mtd/nand/fsl_elbc_nand.c
> linux-3.0-rc7/drivers/mtd/nand/fsl_elbc_nand.c
> --- orig/drivers/mtd/nand/fsl_elbc_nand.c 2011-07-22 07:02:37.908778052 
> -0500
> +++ linux-3.0-rc7/drivers/mtd/nand/fsl_elbc_nand.c2011-07-22
> 06:56:09.655002047 -0500
> @@ -748,12 +748,43 @@ static int fsl_elbc_read_page(struct mtd
> uint8_t *buf,
> int page)
>  {
> + struct fsl_elbc_mtd *priv = chip->priv;
> + struct fsl_lbc_ctrl *ctrl = priv->ctrl;
> + struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
> + uint32_t lteccr;
> +
>   fsl_elbc_read_buf(mtd, buf, mtd->writesize);
>   fsl_elbc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
> 
>   if (fsl_elbc_wait(mtd, chip) & NAND_STATUS_FAIL)
>   mtd->ecc_stats.failed++;
> 
> + if(chip->ecc.mode != NAND_ECC_HW)
> + return(0);
> +
> + /* get the hardware ECC results */
> + lteccr = in_be32(&lbc->lteccr);

Older versions of eLBC have LTECCR, though on the ones that don't have it,
it appears to read as zero and not be modifyable, so it shouldn't make
anything worse.

> + if(lteccr & 0x000F000F) {
> + int i;
> +
> + out_be32(&lbc->lteccr, -1); /* clear lteccr */

We should read and clear lteccr in fsl_elbc_run_command, and test the
stored value here.  That way we don't have leftover bits set in lteccr from
a read that didn't use read_page (such as MTD_OOB_RAW).

> + printk(KERN_ERR "ECC RESULT %x n=%d",
> + lteccr, mtd->ecc_stats.corrected);

I assume this is temporary?

-Scott

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


RFC fsl_elbc_nand.c does not update mtd->ecc_stats

2011-07-22 Thread Michael Hench
when using the fsl_elbc_nand driver, mtd->ecc_stats does not appear to
get updated
UBI uses this to determine when to scrub blocks
the patch below appears to fix this (draft 0)
am I missing anything?
does this look reasonable?



diff -purN orig/drivers/mtd/nand/fsl_elbc_nand.c
linux-3.0-rc7/drivers/mtd/nand/fsl_elbc_nand.c
--- orig/drivers/mtd/nand/fsl_elbc_nand.c   2011-07-22 07:02:37.908778052 
-0500
+++ linux-3.0-rc7/drivers/mtd/nand/fsl_elbc_nand.c  2011-07-22
06:56:09.655002047 -0500
@@ -748,12 +748,43 @@ static int fsl_elbc_read_page(struct mtd
  uint8_t *buf,
  int page)
 {
+   struct fsl_elbc_mtd *priv = chip->priv;
+   struct fsl_lbc_ctrl *ctrl = priv->ctrl;
+   struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
+   uint32_t lteccr;
+
fsl_elbc_read_buf(mtd, buf, mtd->writesize);
fsl_elbc_read_buf(mtd, chip->oob_poi, mtd->oobsize);

if (fsl_elbc_wait(mtd, chip) & NAND_STATUS_FAIL)
mtd->ecc_stats.failed++;

+   if(chip->ecc.mode != NAND_ECC_HW)
+   return(0);
+
+   /* get the hardware ECC results */
+   lteccr = in_be32(&lbc->lteccr);
+   if(lteccr & 0x000F000F) {
+   int i;
+
+   out_be32(&lbc->lteccr, -1); /* clear lteccr */
+   printk(KERN_ERR "ECC RESULT %x n=%d",
+   lteccr, mtd->ecc_stats.corrected);
+   /*
+* 4 bits, one for each 512 byte subpage
+* 12-15 (ppc order) are for successfully corrected
+* 28-31 are for failed
+* small page nand has 3 bits set to zero in each field
+*/
+   for(i=0; i < 4; i++) {
+   if(lteccr & 0x1)
+   mtd->ecc_stats.corrected++;
+   if(lteccr & 0x1)
+   mtd->ecc_stats.failed++;
+   lteccr >>= 1;
+   }
+   }
+
return 0;
 }
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 4/4] edac/85xx: PCI/PCIE error interrupt edac support.

2011-07-22 Thread Stijn Devriendt
On Thu, Jul 21, 2011 at 12:33 PM, Shaohui Xie  wrote:
> From: Kai.Jiang 
>
> Add pcie error interrupt edac support for mpc85xx and p4080.
> mpc85xx uses the legacy interrupt report mechanism - the error
> interrupts are reported directly to mpic. While, p4080 attaches
> most of error interrupts to interrupt 0. And report error interrupt
> to mpic via interrupt 0. This patch can handle both of them.
>
> Due to the error management register offset and definition
>
> difference between pci and pcie, use ccsr_pci structure to merge
> pci and pcie edac code into one.
>

This code has been posted a couple of months ago, if I'm not mistaken.
I'm currently testing it on a P2020 based design.

One of the failures I'm trying to cope with is a PCIe device that does not
send back a completion with data. e.g. a userspace process reads memory
through a memory map, but the PCIe device is not responding.
In this case the P2020 will stall due to the core_fault_in being asserted.

If configured, this interrupt will be called, but it does nothing to cure the
root cause (e.g. kill the process). End result is that the processor still
hangs.
I've been hacking my way around the kernel for a while and ended up a lot
closer to a working solution to recover from such a failure.

The issue I'm facing now is that the PIC can be configured to send the
interrupt as a critical interrupt to one of both cores, but that may not
be the core that is running the process that initiated the read.
I've done 2 test-runs and both killed the right process, but I'd like to make
sure that it's not by accident.
Bottom-line: what mechanisms are in place (or are required) to ensure
that the the right process (on the same core or on another core) is killed
regardless of how the PIC is configured?

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


Re: [PATCH 0/1] Remove obsolete HCU4 board

2011-07-22 Thread Josh Boyer
On Fri, Jul 22, 2011 at 6:40 AM, Niklaus Giger
 wrote:
>
> I left Netstal Maschinen a couple of months ago. As I could never convince
> my boss to give embedded Linux a real try, I would like to remove support
> for this embedded board. I was the only user.
>
> Many thanks for the friendly help I received on this list when I submitted
> the patches for this board!

I'll add this to my tree shortly.

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


[PATCH 1/1] Remove obsolete HCU4 board

2011-07-22 Thread Niklaus Giger
Signed-off-by: Niklaus Giger 
---
 arch/powerpc/boot/dts/hcu4.dts  |  168 
---
 arch/powerpc/configs/40x/hcu4_defconfig |   80 ---
 arch/powerpc/platforms/40x/hcu4.c   |   61 ---
 3 files changed, 0 insertions(+), 309 deletions(-)
 delete mode 100644 arch/powerpc/boot/dts/hcu4.dts
 delete mode 100644 arch/powerpc/configs/40x/hcu4_defconfig
 delete mode 100644 arch/powerpc/platforms/40x/hcu4.c

diff --git a/arch/powerpc/boot/dts/hcu4.dts b/arch/powerpc/boot/dts/hcu4.dts
deleted file mode 100644
index 7988598..000
--- a/arch/powerpc/boot/dts/hcu4.dts
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
-* Device Tree Source for Netstal Maschinen HCU4
-* based on the IBM Walnut
-*
-* Copyright 2008
-* Niklaus Giger 
-*
-* Copyright 2007 IBM Corp.
-* Josh Boyer 
-*
-* This file is licensed under the terms of the GNU General Public
-* License version 2.  This program is licensed "as is" without
-* any warranty of any kind, whether express or implied.
-*/
-
-/dts-v1/;
-
-/ {
-   #address-cells = <0x1>;
-   #size-cells = <0x1>;
-   model = "netstal,hcu4";
-   compatible = "netstal,hcu4";
-   dcr-parent = <0x1>;
-
-   aliases {
-   ethernet0 = "/plb/opb/ethernet@ef600800";
-   serial0 = "/plb/opb/serial@ef600300";
-   };
-
-   cpus {
-   #address-cells = <0x1>;
-   #size-cells = <0x0>;
-
-   cpu@0 {
-   device_type = "cpu";
-   model = "PowerPC,405GPr";
-   reg = <0x0>;
-   clock-frequency = <0>;  /* Filled in by U-Boot 
*/
-   timebase-frequency = <0x0>; /* Filled in by U-Boot 
*/
-   i-cache-line-size = <0x20>;
-   d-cache-line-size = <0x20>;
-   i-cache-size = <0x4000>;
-   d-cache-size = <0x4000>;
-   dcr-controller;
-   dcr-access-method = "native";
-   linux,phandle = <0x1>;
-   };
-   };
-
-   memory {
-   device_type = "memory";
-   reg = <0x0 0x0>;/* Filled in by U-Boot */
-   };
-
-   UIC0: interrupt-controller {
-   compatible = "ibm,uic";
-   interrupt-controller;
-   cell-index = <0x0>;
-   dcr-reg = <0xc0 0x9>;
-   #address-cells = <0x0>;
-   #size-cells = <0x0>;
-   #interrupt-cells = <0x2>;
-   linux,phandle = <0x2>;
-   };
-
-   plb {
-   compatible = "ibm,plb3";
-   #address-cells = <0x1>;
-   #size-cells = <0x1>;
-   ranges;
-   clock-frequency = <0x0>;/* Filled in by U-Boot */
-
-   SDRAM0: memory-controller {
-   compatible = "ibm,sdram-405gp";
-   dcr-reg = <0x10 0x2>;
-   };
-
-   MAL: mcmal {
-   compatible = "ibm,mcmal-405gp", "ibm,mcmal";
-   dcr-reg = <0x180 0x62>;
-   num-tx-chans = <0x1>;
-   num-rx-chans = <0x1>;
-   interrupt-parent = <0x2>;
-   interrupts = <0xb 0x4 0xc 0x4 0xa 0x4 0xd 0x4 0xe 0x4>;
-   linux,phandle = <0x3>;
-   };
-
-   POB0: opb {
-   compatible = "ibm,opb-405gp", "ibm,opb";
-   #address-cells = <0x1>;
-   #size-cells = <0x1>;
-   ranges = <0xef60 0xef60 0xa0>;
-   dcr-reg = <0xa0 0x5>;
-   clock-frequency = <0x0>;/* Filled in by U-Boot 
*/
-
-   UART0: serial@ef600300 {
-   device_type = "serial";
-   compatible = "ns16550";
-   reg = <0xef600300 0x8>;
-   virtual-reg = <0xef600300>;
-   clock-frequency = <0x0>;/* Filled in by U-Boot 
*/
-   current-speed = <0>;/* Filled in by U-Boot 
*/
-   interrupt-parent = <0x2>;
-   interrupts = <0x0 0x4>;
-   };
-
-   IIC: i2c@ef600500 {
-   compatible = "ibm,iic-405gp", "ibm,iic";
-   reg = <0xef600500 0x11>;
-   interrupt-parent = <0x2>;
-   interrupts = <0x2 0x4>;
-   };
-
-   GPIO: gpio@ef600700 {
-   compatible = "ibm,gpio-405gp";
-   reg = <0xef600700 0x20>;
-   };
-
-   EMAC: ethernet@ef600800 {
-  

[PATCH 0/1] Remove obsolete HCU4 board

2011-07-22 Thread Niklaus Giger

I left Netstal Maschinen a couple of months ago. As I could never convince
my boss to give embedded Linux a real try, I would like to remove support
for this embedded board. I was the only user.

Many thanks for the friendly help I received on this list when I submitted
the patches for this board!

Patch is based on 
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git

Niklaus Giger (1):
  Remove obsolete HCU4 board

 arch/powerpc/boot/dts/hcu4.dts  |  168 
---
 arch/powerpc/configs/40x/hcu4_defconfig |   80 ---
 arch/powerpc/platforms/40x/hcu4.c   |   61 ---
 3 files changed, 0 insertions(+), 309 deletions(-)
 delete mode 100644 arch/powerpc/boot/dts/hcu4.dts
 delete mode 100644 arch/powerpc/configs/40x/hcu4_defconfig
 delete mode 100644 arch/powerpc/platforms/40x/hcu4.c

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


Re: [PATCH 2/2 v2] eSDHC: Fix errors when booting kernel with fsl esdhc

2011-07-22 Thread Anton Vorontsov
On Fri, Jul 22, 2011 at 06:15:17PM +0800, Roy Zang wrote:
[...]
>   if (host->version >= SDHCI_SPEC_200) {
> - ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> - ctrl &= ~SDHCI_CTRL_DMA_MASK;
> - if ((host->flags & SDHCI_REQ_USE_DMA) &&
> - (host->flags & SDHCI_USE_ADMA))
> - ctrl |= SDHCI_CTRL_ADMA32;
> - else
> - ctrl |= SDHCI_CTRL_SDMA;
> - sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
> + if (host->quirks & SDHCI_QUIRK_QORIQ_PROCTL_WEIRD) {
> +#define ESDHCI_PROCTL_DMAS_MASK  0x0300
> +#define ESDHCI_PROCTL_ADMA32 0x0200
> +#define ESDHCI_PROCTL_SDMA   0x
> + ctrl = sdhci_readl(host, SDHCI_HOST_CONTROL);
> + ctrl &= ~ESDHCI_PROCTL_DMAS_MASK;
> + if ((host->flags & SDHCI_REQ_USE_DMA) &&
> + (host->flags & SDHCI_USE_ADMA))
> + ctrl |= ESDHCI_PROCTL_ADMA32;
> + else
> + ctrl |= ESDHCI_PROCTL_SDMA;
> + sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL);
> + } else {
> + ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> + ctrl &= ~SDHCI_CTRL_DMA_MASK;
> + if ((host->flags & SDHCI_REQ_USE_DMA) &&
> + (host->flags & SDHCI_USE_ADMA))
> + ctrl |= SDHCI_CTRL_ADMA32;
> + else
> + ctrl |= SDHCI_CTRL_SDMA;
> + sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);

We try to not pollute generic sdhci.c driver with chip-specific
quirks.

Maybe you can do the fixups via IO accessors? Or by introducing
some additional sdhci op?

[...]
>   if (power != (unsigned short)-1) {
>   switch (1 << power) {
> +#define  ESDHCI_FSL_POWER_MASK   0x40
> +#define  ESDHCI_FSL_POWER_1800x00
> +#define  ESDHCI_FSL_POWER_3000x40

Same here. The driver will rot quickly if everyone would start
putting chip-specific quirks into sdhci.c. Please don't.

Thanks,

-- 
Anton Vorontsov
Email: cbouatmai...@gmail.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 2/4] powerpc/85xx: enable pcie initialization for P4080

2011-07-22 Thread Xie Shaohui-B21989


>-Original Message-
>From: Gala Kumar-B11780
>Sent: Friday, July 22, 2011 2:06 PM
>To: Xie Shaohui-B21989
>Cc: linuxppc-dev@lists.ozlabs.org
>Subject: Re: [PATCH 2/4] powerpc/85xx: enable pcie initialization for
>P4080
>
>
>On Jul 21, 2011, at 5:25 AM, Shaohui Xie wrote:
>
>> Signed-off-by: Shaohui Xie 
>> ---
>> arch/powerpc/platforms/85xx/corenet_ds.c |3 +++
>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c
>b/arch/powerpc/platforms/85xx/corenet_ds.c
>> index 2ab338c..15247b0 100644
>> --- a/arch/powerpc/platforms/85xx/corenet_ds.c
>> +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
>> @@ -114,6 +114,9 @@ static const struct of_device_id of_device_ids[]
>__devinitconst = {
>>  .compatible = "simple-bus"
>>  },
>>  {
>> +.compatible = "fsl,p4080-pcie"
>> +},
>> +{
>>  .compatible = "fsl,rapidio-delta",
>>  },
>>  {}
>> --
>> 1.6.4
>>
>
>What about p204x, p3041 & p5020 boards?
>

[Xie Shaohui] I've check the galak/powerpc.git 'next' branch, this patch is not 
needed, please ignore it.


Best Regards, 
Shaohui Xie

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


[PATCH 2/2 v2] eSDHC: Fix errors when booting kernel with fsl esdhc

2011-07-22 Thread Roy Zang
From: Xu lei 

When esdhc module was enabled in p5020, there were following errors:

mmc0: Timeout waiting for hardware interrupt.
mmc0: error -110 whilst initialising SD card
mmc0: Unexpected interrupt 0x0200.
mmc0: Timeout waiting for hardware interrupt.
mmc0: error -110 whilst initialising SD card
mmc0: Unexpected interrupt 0x0200.

It is because ESDHC controller has different bit setting for PROCTL
register, when kernel sets Power Control Register by method for standard
SD Host Specification, it would overwritten FSL ESDHC PROCTL[DMAS];
when it set Host Control Registers[DMAS], it sets PROCTL[EMODE] and
PROCTL[D3CD]. These operations will set bad bits for PROCTL Register
on FSL ESDHC Controller and cause errors, so this patch will make esdhc
driver access FSL PROCTL Register according to block guide instead of
standard SD Host Specification.

For some FSL chips, such as MPC8536/P2020, PROCTL[VOLT_SEL] and PROCTL[DMAS]
bits are reserved and even if they are set to wrong bits there is no error.
But considering that all FSL ESDHC Controller register map is not fully
compliant to standard SD Host Specification, we put the patch to all of
FSL ESDHC Controllers.

Signed-off-by: Lei Xu 
Signed-off-by: Roy Zang 
Signed-off-by: Kumar Gala 
---
v2:v1 some minor code style fix according to Venkatraman's comment.

 drivers/mmc/host/sdhci-of-core.c |3 ++
 drivers/mmc/host/sdhci.c |   64 ++---
 include/linux/mmc/sdhci.h|6 ++-
 3 files changed, 59 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c
index 60e4186..fede43d 100644
--- a/drivers/mmc/host/sdhci-of-core.c
+++ b/drivers/mmc/host/sdhci-of-core.c
@@ -179,6 +179,9 @@ static int __devinit sdhci_of_probe(struct platform_device 
*ofdev)
if (sdhci_of_wp_inverted(np))
host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
 
+   if (of_device_is_compatible(np, "fsl,esdhc"))
+   host->quirks |= SDHCI_QUIRK_QORIQ_PROCTL_WEIRD;
+
clk = of_get_property(np, "clock-frequency", &size);
if (clk && size == sizeof(*clk) && *clk)
of_host->clock = be32_to_cpup(clk);
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 58d5436..855fbe8 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -674,7 +674,7 @@ static void sdhci_set_transfer_irqs(struct sdhci_host *host)
 static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command 
*cmd)
 {
u8 count;
-   u8 ctrl;
+   u32 ctrl;
struct mmc_data *data = cmd->data;
int ret;
 
@@ -807,14 +807,28 @@ static void sdhci_prepare_data(struct sdhci_host *host, 
struct mmc_command *cmd)
 * is ADMA.
 */
if (host->version >= SDHCI_SPEC_200) {
-   ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
-   ctrl &= ~SDHCI_CTRL_DMA_MASK;
-   if ((host->flags & SDHCI_REQ_USE_DMA) &&
-   (host->flags & SDHCI_USE_ADMA))
-   ctrl |= SDHCI_CTRL_ADMA32;
-   else
-   ctrl |= SDHCI_CTRL_SDMA;
-   sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
+   if (host->quirks & SDHCI_QUIRK_QORIQ_PROCTL_WEIRD) {
+#define ESDHCI_PROCTL_DMAS_MASK0x0300
+#define ESDHCI_PROCTL_ADMA32   0x0200
+#define ESDHCI_PROCTL_SDMA 0x
+   ctrl = sdhci_readl(host, SDHCI_HOST_CONTROL);
+   ctrl &= ~ESDHCI_PROCTL_DMAS_MASK;
+   if ((host->flags & SDHCI_REQ_USE_DMA) &&
+   (host->flags & SDHCI_USE_ADMA))
+   ctrl |= ESDHCI_PROCTL_ADMA32;
+   else
+   ctrl |= ESDHCI_PROCTL_SDMA;
+   sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL);
+   } else {
+   ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
+   ctrl &= ~SDHCI_CTRL_DMA_MASK;
+   if ((host->flags & SDHCI_REQ_USE_DMA) &&
+   (host->flags & SDHCI_USE_ADMA))
+   ctrl |= SDHCI_CTRL_ADMA32;
+   else
+   ctrl |= SDHCI_CTRL_SDMA;
+   sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
+   }
}
 
if (!(host->flags & SDHCI_REQ_USE_DMA)) {
@@ -1138,19 +1152,32 @@ out:
 static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
 {
u8 pwr = 0;
+   u8 volt = 0;
 
if (power != (unsigned short)-1) {
switch (1 << power) {
+#defineESDHCI_FSL_POWER_MASK   0x40
+#defineESDHCI_FSL_POWER_1800x00
+#defineESDHCI_FSL_POWER_3000x40
case MMC_VDD_165_195:
-   pwr = SDHCI_POWER_180;
+   

[PATCH 1/2 v2] eSDHC: Access Freescale eSDHC registers by 32-bit

2011-07-22 Thread Roy Zang
From: Xu lei 

For Freescale eSDHC registers only support 32-bit accesses,
this patch ensure that all Freescale eSDHC register accesses
are 32-bit.

Signed-off-by: Xu lei 
Signed-off-by: Roy Zang 
Signed-off-by: Kumar Gala 
---
this patch set replaces previous patches:
https://patchwork.kernel.org/patch/943332/
https://patchwork.kernel.org/patch/943342/
https://patchwork.kernel.org/patch/943322/

The last one is discarded according to the comment from Anton.


just resend with the new patch set. no change for this patch comparing
to previous version.

 drivers/mmc/host/sdhci-of-esdhc.c |   18 ++
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c 
b/drivers/mmc/host/sdhci-of-esdhc.c
index ba40d6d..c9a8519 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -1,7 +1,7 @@
 /*
  * Freescale eSDHC controller driver.
  *
- * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ * Copyright (c) 2007, 2010 Freescale Semiconductor, Inc.
  * Copyright (c) 2009 MontaVista Software, Inc.
  *
  * Authors: Xiaobo Xie 
@@ -23,11 +23,21 @@
 static u16 esdhc_readw(struct sdhci_host *host, int reg)
 {
u16 ret;
+   int base = reg & ~0x3;
+   int shift = (reg & 0x2) * 8;
 
if (unlikely(reg == SDHCI_HOST_VERSION))
-   ret = in_be16(host->ioaddr + reg);
+   ret = in_be32(host->ioaddr + base) & 0x;
else
-   ret = sdhci_be32bs_readw(host, reg);
+   ret = (in_be32(host->ioaddr + base) >> shift) & 0x;
+   return ret;
+}
+
+static u8 esdhc_readb(struct sdhci_host *host, int reg)
+{
+   int base = reg & ~0x3;
+   int shift = (reg & 0x3) * 8;
+   u8 ret = (in_be32(host->ioaddr + base) >> shift) & 0xff;
return ret;
 }
 
@@ -79,7 +89,7 @@ struct sdhci_of_data sdhci_esdhc = {
.ops = {
.read_l = sdhci_be32bs_readl,
.read_w = esdhc_readw,
-   .read_b = sdhci_be32bs_readb,
+   .read_b = esdhc_readb,
.write_l = sdhci_be32bs_writel,
.write_w = esdhc_writew,
.write_b = esdhc_writeb,
-- 
1.6.0.6


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


Re: [PATCH v2] powerpc/85xx: fix mpic configuration in CAMP mode

2011-07-22 Thread Kumar Gala

On Jul 12, 2011, at 2:49 AM, Fabio Baltieri wrote:

> Change the string to check for CAMP mode boot on MPC85xx (eg. P2020) to match
> the one in the corresponding dts files (p2020rdb_camp_core{0,1}.dts).
> 
> Without this fix the mpic is configured as in the SMP boot mode, which causes
> the first core to report a protected source interrupt error for devices
> of the other core and lock up.
> 
> Also add MPIC_SINGLE_DEST_CPU on both P2020 based architectures in CAMP
> mode as suggested by Scott Wood. Thanks.
> 
> Cc: Scott Wood 
> Cc: Poonam Aggrwal 
> Cc: Benjamin Herrenschmidt 
> Signed-off-by: Fabio Baltieri 
> ---
> arch/powerpc/platforms/85xx/mpc85xx_ds.c  |3 ++-
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c |5 +++--
> 2 files changed, 5 insertions(+), 3 deletions(-)

applied to next

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