Re: CPM2 USB host driver

2007-12-01 Thread Mike Rapoport
> 
>> I tried to forward-port FHCI from Freescale 2.6.11 kernels. Twice.
>> But these efforts always stumbled over more important tasks.
> 
> Do you think I start from the FHCI driver provided by Freescale for 2.6.11, 
> from the cpm2usb driver or from scratch ?

The cmp2usb is old and crappy, and I had no time at all to update it. So if the
choice was to start from cpm2usb or from scratch, I'd choose to start from 
scratch.

> Both the cpm2usb and FHCI drivers seem to use the packet-level interface. Is 
> there any reason not to use the transaction-level interface ?


> Best regards,
> 

-- 
Sincerely yours,
Mike.

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


Re: [PATCH v2 2/2] [POWERPC] Use new machine_xxx_initcall hooks in platform code

2007-12-01 Thread Grant Likely
On 12/1/07, Grant Likely <[EMAIL PROTECTED]> wrote:
> From: Grant Likely <[EMAIL PROTECTED]>
>
> This patch makes the platform code use the new machine-specific initcall
> hooks.  This has the advantage of not needing to explicitly test
> machine_is() at the top of every initcall function.

Warning: I have *not* exhaustively tested this; just spot checked in a
few places.  I'll be more thorough once I know everyone is okay with
it in principle.

Cheers,
g.

>
> Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
> ---
>
>  arch/powerpc/platforms/40x/kilauea.c |5 +
>  arch/powerpc/platforms/40x/virtex.c  |5 +
>  arch/powerpc/platforms/40x/walnut.c  |5 +
>  arch/powerpc/platforms/44x/bamboo.c  |5 +
>  arch/powerpc/platforms/44x/ebony.c   |5 +
>  arch/powerpc/platforms/44x/sequoia.c |5 +
>  arch/powerpc/platforms/82xx/mpc8272_ads.c|5 +
>  arch/powerpc/platforms/82xx/pq2fads.c|5 +
>  arch/powerpc/platforms/83xx/mpc832x_mds.c|5 +
>  arch/powerpc/platforms/83xx/mpc832x_rdb.c|   11 ++-
>  arch/powerpc/platforms/83xx/mpc836x_mds.c|5 +
>  arch/powerpc/platforms/85xx/mpc85xx_ads.c|5 +
>  arch/powerpc/platforms/85xx/mpc85xx_cds.c|6 +-
>  arch/powerpc/platforms/85xx/mpc85xx_mds.c|5 +
>  arch/powerpc/platforms/8xx/ep88xc.c  |5 ++---
>  arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 ++---
>  arch/powerpc/platforms/cell/io-workarounds.c |5 +
>  arch/powerpc/platforms/cell/iommu.c  |5 +
>  arch/powerpc/platforms/cell/pmu.c|5 +
>  arch/powerpc/platforms/cell/setup.c  |5 +
>  arch/powerpc/platforms/celleb/iommu.c|6 +-
>  arch/powerpc/platforms/celleb/setup.c|5 +
>  arch/powerpc/platforms/embedded6xx/ls_uart.c |5 +
>  arch/powerpc/platforms/pasemi/idle.c |5 +
>  arch/powerpc/platforms/pasemi/setup.c|   10 ++
>  arch/powerpc/platforms/powermac/low_i2c.c|7 ++-
>  arch/powerpc/platforms/powermac/pfunc_base.c |3 +--
>  arch/powerpc/platforms/powermac/pic.c|3 +--
>  arch/powerpc/platforms/powermac/setup.c  |   12 ++--
>  29 files changed, 35 insertions(+), 128 deletions(-)
>
> diff --git a/arch/powerpc/platforms/40x/kilauea.c 
> b/arch/powerpc/platforms/40x/kilauea.c
> index 1bffdbd..0853db7 100644
> --- a/arch/powerpc/platforms/40x/kilauea.c
> +++ b/arch/powerpc/platforms/40x/kilauea.c
> @@ -29,14 +29,11 @@ static struct of_device_id kilauea_of_bus[] = {
>
>  static int __init kilauea_device_probe(void)
>  {
> -   if (!machine_is(kilauea))
> -   return 0;
> -
> of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
>
> return 0;
>  }
> -device_initcall(kilauea_device_probe);
> +machine_device_initcall(kilauea, kilauea_device_probe);
>
>  static int __init kilauea_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/40x/virtex.c 
> b/arch/powerpc/platforms/40x/virtex.c
> index 14bbc32..43fcc8e 100644
> --- a/arch/powerpc/platforms/40x/virtex.c
> +++ b/arch/powerpc/platforms/40x/virtex.c
> @@ -17,14 +17,11 @@
>
>  static int __init virtex_device_probe(void)
>  {
> -   if (!machine_is(virtex))
> -   return 0;
> -
> of_platform_bus_probe(NULL, NULL, NULL);
>
> return 0;
>  }
> -device_initcall(virtex_device_probe);
> +machine_device_initcall(virtex, virtex_device_probe);
>
>  static int __init virtex_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/40x/walnut.c 
> b/arch/powerpc/platforms/40x/walnut.c
> index ff6db24..91a5247 100644
> --- a/arch/powerpc/platforms/40x/walnut.c
> +++ b/arch/powerpc/platforms/40x/walnut.c
> @@ -34,15 +34,12 @@ static struct of_device_id walnut_of_bus[] = {
>
>  static int __init walnut_device_probe(void)
>  {
> -   if (!machine_is(walnut))
> -   return 0;
> -
> /* FIXME: do bus probe here */
> of_platform_bus_probe(NULL, walnut_of_bus, NULL);
>
> return 0;
>  }
> -device_initcall(walnut_device_probe);
> +machine_device_initcall(walnut, walnut_device_probe);
>
>  static int __init walnut_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/44x/bamboo.c 
> b/arch/powerpc/platforms/44x/bamboo.c
> index be23f11..5253996 100644
> --- a/arch/powerpc/platforms/44x/bamboo.c
> +++ b/arch/powerpc/platforms/44x/bamboo.c
> @@ -32,14 +32,11 @@ static struct of_device_id bamboo_of_bus[] = {
>
>  static int __init bamboo_device_probe(void)
>  {
> -   if (!machine_is(bamboo))
> -   return 0;
> -
> of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
>
> return 0;
>  }
> -device_initcall(bamboo_device_probe);
> +machine_device_initcall(bamboo, bamboo_device_probe);
>
>  static int __init bamboo_probe(void)
>  {
> diff --git a/arch/powerpc/platforms/44x/ebony.c 
> b/arch/powerpc/platforms/44x/ebony.c
> index 6

[PATCH v2 2/2] [POWERPC] Use new machine_xxx_initcall hooks in platform code

2007-12-01 Thread Grant Likely
From: Grant Likely <[EMAIL PROTECTED]>

This patch makes the platform code use the new machine-specific initcall
hooks.  This has the advantage of not needing to explicitly test
machine_is() at the top of every initcall function.

Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---

 arch/powerpc/platforms/40x/kilauea.c |5 +
 arch/powerpc/platforms/40x/virtex.c  |5 +
 arch/powerpc/platforms/40x/walnut.c  |5 +
 arch/powerpc/platforms/44x/bamboo.c  |5 +
 arch/powerpc/platforms/44x/ebony.c   |5 +
 arch/powerpc/platforms/44x/sequoia.c |5 +
 arch/powerpc/platforms/82xx/mpc8272_ads.c|5 +
 arch/powerpc/platforms/82xx/pq2fads.c|5 +
 arch/powerpc/platforms/83xx/mpc832x_mds.c|5 +
 arch/powerpc/platforms/83xx/mpc832x_rdb.c|   11 ++-
 arch/powerpc/platforms/83xx/mpc836x_mds.c|5 +
 arch/powerpc/platforms/85xx/mpc85xx_ads.c|5 +
 arch/powerpc/platforms/85xx/mpc85xx_cds.c|6 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c|5 +
 arch/powerpc/platforms/8xx/ep88xc.c  |5 ++---
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 ++---
 arch/powerpc/platforms/cell/io-workarounds.c |5 +
 arch/powerpc/platforms/cell/iommu.c  |5 +
 arch/powerpc/platforms/cell/pmu.c|5 +
 arch/powerpc/platforms/cell/setup.c  |5 +
 arch/powerpc/platforms/celleb/iommu.c|6 +-
 arch/powerpc/platforms/celleb/setup.c|5 +
 arch/powerpc/platforms/embedded6xx/ls_uart.c |5 +
 arch/powerpc/platforms/pasemi/idle.c |5 +
 arch/powerpc/platforms/pasemi/setup.c|   10 ++
 arch/powerpc/platforms/powermac/low_i2c.c|7 ++-
 arch/powerpc/platforms/powermac/pfunc_base.c |3 +--
 arch/powerpc/platforms/powermac/pic.c|3 +--
 arch/powerpc/platforms/powermac/setup.c  |   12 ++--
 29 files changed, 35 insertions(+), 128 deletions(-)

diff --git a/arch/powerpc/platforms/40x/kilauea.c 
b/arch/powerpc/platforms/40x/kilauea.c
index 1bffdbd..0853db7 100644
--- a/arch/powerpc/platforms/40x/kilauea.c
+++ b/arch/powerpc/platforms/40x/kilauea.c
@@ -29,14 +29,11 @@ static struct of_device_id kilauea_of_bus[] = {
 
 static int __init kilauea_device_probe(void)
 {
-   if (!machine_is(kilauea))
-   return 0;
-
of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
 
return 0;
 }
-device_initcall(kilauea_device_probe);
+machine_device_initcall(kilauea, kilauea_device_probe);
 
 static int __init kilauea_probe(void)
 {
diff --git a/arch/powerpc/platforms/40x/virtex.c 
b/arch/powerpc/platforms/40x/virtex.c
index 14bbc32..43fcc8e 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -17,14 +17,11 @@
 
 static int __init virtex_device_probe(void)
 {
-   if (!machine_is(virtex))
-   return 0;
-
of_platform_bus_probe(NULL, NULL, NULL);
 
return 0;
 }
-device_initcall(virtex_device_probe);
+machine_device_initcall(virtex, virtex_device_probe);
 
 static int __init virtex_probe(void)
 {
diff --git a/arch/powerpc/platforms/40x/walnut.c 
b/arch/powerpc/platforms/40x/walnut.c
index ff6db24..91a5247 100644
--- a/arch/powerpc/platforms/40x/walnut.c
+++ b/arch/powerpc/platforms/40x/walnut.c
@@ -34,15 +34,12 @@ static struct of_device_id walnut_of_bus[] = {
 
 static int __init walnut_device_probe(void)
 {
-   if (!machine_is(walnut))
-   return 0;
-
/* FIXME: do bus probe here */
of_platform_bus_probe(NULL, walnut_of_bus, NULL);
 
return 0;
 }
-device_initcall(walnut_device_probe);
+machine_device_initcall(walnut, walnut_device_probe);
 
 static int __init walnut_probe(void)
 {
diff --git a/arch/powerpc/platforms/44x/bamboo.c 
b/arch/powerpc/platforms/44x/bamboo.c
index be23f11..5253996 100644
--- a/arch/powerpc/platforms/44x/bamboo.c
+++ b/arch/powerpc/platforms/44x/bamboo.c
@@ -32,14 +32,11 @@ static struct of_device_id bamboo_of_bus[] = {
 
 static int __init bamboo_device_probe(void)
 {
-   if (!machine_is(bamboo))
-   return 0;
-
of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
 
return 0;
 }
-device_initcall(bamboo_device_probe);
+machine_device_initcall(bamboo, bamboo_device_probe);
 
 static int __init bamboo_probe(void)
 {
diff --git a/arch/powerpc/platforms/44x/ebony.c 
b/arch/powerpc/platforms/44x/ebony.c
index 6cd3476..b783c6e 100644
--- a/arch/powerpc/platforms/44x/ebony.c
+++ b/arch/powerpc/platforms/44x/ebony.c
@@ -36,14 +36,11 @@ static struct of_device_id ebony_of_bus[] = {
 
 static int __init ebony_device_probe(void)
 {
-   if (!machine_is(ebony))
-   return 0;
-
of_platform_bus_probe(NULL, ebony_of_bus, NULL);
 
return 0;
 }
-device_initcall(ebony_device_probe);
+machine_device_initcall(ebony, ebony_device_probe);

[PATCH v2 1/2] [POWERPC] Add machine initcall macros

2007-12-01 Thread Grant Likely
From: Grant Likely <[EMAIL PROTECTED]>

The machine initcall macros allow initcalls to be registered which
test machine_is() before executing the initcall.

Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---

 include/asm-powerpc/machdep.h |   23 +++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 6968f43..d5cd982 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -326,5 +326,28 @@ static inline void log_error(char *buf, unsigned int 
err_type, int fatal)
ppc_md.log_error(buf, err_type, fatal);
 }
 
+#define __define_machine_initcall(mach,level,fn,id) \
+   static int __init __machine_initcall_##mach##_##fn(void) { \
+   if (machine_is(mach)) return fn(); \
+   return 0; \
+   } \
+   __define_initcall(level,__machine_initcall_##mach##_##fn,id);
+
+#define machine_core_initcall(mach,fn) 
__define_machine_initcall(mach,"1",fn,1)
+#define machine_core_initcall_sync(mach,fn)
__define_machine_initcall(mach,"1s",fn,1s)
+#define machine_postcore_initcall(mach,fn) 
__define_machine_initcall(mach,"2",fn,2)
+#define machine_postcore_initcall_sync(mach,fn)
__define_machine_initcall(mach,"2s",fn,2s)
+#define machine_arch_initcall(mach,fn) 
__define_machine_initcall(mach,"3",fn,3)
+#define machine_arch_initcall_sync(mach,fn)
__define_machine_initcall(mach,"3s",fn,3s)
+#define machine_subsys_initcall(mach,fn)   
__define_machine_initcall(mach,"4",fn,4)
+#define machine_subsys_initcall_sync(mach,fn)  
__define_machine_initcall(mach,"4s",fn,4s)
+#define machine_fs_initcall(mach,fn)   
__define_machine_initcall(mach,"5",fn,5)
+#define machine_fs_initcall_sync(mach,fn)  
__define_machine_initcall(mach,"5s",fn,5s)
+#define machine_rootfs_initcall(mach,fn)   
__define_machine_initcall(mach,"rootfs",fn,rootfs)
+#define machine_device_initcall(mach,fn)   
__define_machine_initcall(mach,"6",fn,6)
+#define machine_device_initcall_sync(mach,fn)  
__define_machine_initcall(mach,"6s",fn,6s)
+#define machine_late_initcall(mach,fn) 
__define_machine_initcall(mach,"7",fn,7)
+#define machine_late_initcall_sync(mach,fn)
__define_machine_initcall(mach,"7s",fn,7s)
+
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_MACHDEP_H */

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


[PATCH] Fix buglets in mpc5200 FEC code that are corrupting memory.

2007-12-01 Thread Grant Likely
From: Jon Smirl <[EMAIL PROTECTED]>

This is the reason I couldn't get user space started or connect to my
nfs server. Patch is against current linus git.

mpc5200 fec driver is corrupting memory. This patch fixes two bugs
where the wrong skb buffer was being referenced.

Signed-off-by: Jon Smirl <[EMAIL PROTECTED]>
Acked-by: Domen Puncer <[EMAIL PROTECTED]>
Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---

Jeff, this one hasn't been picked up for 2.6.24 yet and in needs to go in.

Thanks,
g.

 drivers/net/fec_mpc52xx.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index a8a0ee2..ddfcc0b 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -422,7 +422,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void 
*dev_id)
 
rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status,
(struct bcom_bd **)&bd);
-   dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, 
DMA_FROM_DEVICE);
+   dma_unmap_single(&dev->dev, bd->skb_pa, rskb->len, 
DMA_FROM_DEVICE);
 
/* Test for errors in received frame */
if (status & BCOM_FEC_RX_BD_ERRORS) {
@@ -467,7 +467,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void 
*dev_id)
bcom_prepare_next_buffer(priv->rx_dmatsk);
 
bd->status = FEC_RX_BUFFER_SIZE;
-   bd->skb_pa = dma_map_single(&dev->dev, rskb->data,
+   bd->skb_pa = dma_map_single(&dev->dev, skb->data,
FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
 
bcom_submit_next_buffer(priv->rx_dmatsk, skb);

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


[PATCH] gianfar driver: eliminate compiler warnings and unnecessary macros

2007-12-01 Thread Grant Likely
From: Grant Likely <[EMAIL PROTECTED]>

This patch eliminates the warning of unused return values when the driver
registers it sysfs files.  Now the driver will print an error if it is
unable to register the sysfs files.

It also eliminates the macros used to wrap the DEVICE_ATTR macro and the
device_create_file function call.  The macros don't reduce the number of
lines of source code in the file and the name munging makes is so that
cscope and friends don't see the references to the functions.  It's better
to just call the kernel API directly.

While we're at it, the DEVICE_ATTR instances have been moved down to
be grouped with the functions they depend on.

Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---

 drivers/net/gianfar_sysfs.c |   50 ++-
 1 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index aec9ab1..230878b 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -37,24 +37,6 @@
 
 #include "gianfar.h"
 
-#define GFAR_ATTR(_name) \
-static ssize_t gfar_show_##_name(struct device *dev, \
-struct device_attribute *attr, char *buf); \
-static ssize_t gfar_set_##_name(struct device *dev, \
-   struct device_attribute *attr, \
-   const char *buf, size_t count); \
-static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
-
-#define GFAR_CREATE_FILE(_dev, _name) \
-   device_create_file(&_dev->dev, &dev_attr_##_name)
-
-GFAR_ATTR(bd_stash);
-GFAR_ATTR(rx_stash_size);
-GFAR_ATTR(rx_stash_index);
-GFAR_ATTR(fifo_threshold);
-GFAR_ATTR(fifo_starve);
-GFAR_ATTR(fifo_starve_off);
-
 static ssize_t gfar_show_bd_stash(struct device *dev,
  struct device_attribute *attr, char *buf)
 {
@@ -100,6 +82,8 @@ static ssize_t gfar_set_bd_stash(struct device *dev,
return count;
 }
 
+DEVICE_ATTR(bd_stash, 0644, gfar_show_bd_stash, gfar_set_bd_stash);
+
 static ssize_t gfar_show_rx_stash_size(struct device *dev,
   struct device_attribute *attr, char *buf)
 {
@@ -146,6 +130,9 @@ static ssize_t gfar_set_rx_stash_size(struct device *dev,
return count;
 }
 
+DEVICE_ATTR(rx_stash_size, 0644, gfar_show_rx_stash_size,
+   gfar_set_rx_stash_size);
+
 /* Stashing will only be enabled when rx_stash_size != 0 */
 static ssize_t gfar_show_rx_stash_index(struct device *dev,
struct device_attribute *attr,
@@ -184,6 +171,9 @@ static ssize_t gfar_set_rx_stash_index(struct device *dev,
return count;
 }
 
+DEVICE_ATTR(rx_stash_index, 0644, gfar_show_rx_stash_index,
+   gfar_set_rx_stash_index);
+
 static ssize_t gfar_show_fifo_threshold(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -219,6 +209,9 @@ static ssize_t gfar_set_fifo_threshold(struct device *dev,
return count;
 }
 
+DEVICE_ATTR(fifo_threshold, 0644, gfar_show_fifo_threshold,
+   gfar_set_fifo_threshold);
+
 static ssize_t gfar_show_fifo_starve(struct device *dev,
 struct device_attribute *attr, char *buf)
 {
@@ -253,6 +246,8 @@ static ssize_t gfar_set_fifo_starve(struct device *dev,
return count;
 }
 
+DEVICE_ATTR(fifo_starve, 0644, gfar_show_fifo_starve, gfar_set_fifo_starve);
+
 static ssize_t gfar_show_fifo_starve_off(struct device *dev,
 struct device_attribute *attr,
 char *buf)
@@ -288,9 +283,13 @@ static ssize_t gfar_set_fifo_starve_off(struct device *dev,
return count;
 }
 
+DEVICE_ATTR(fifo_starve_off, 0644, gfar_show_fifo_starve_off,
+   gfar_set_fifo_starve_off);
+
 void gfar_init_sysfs(struct net_device *dev)
 {
struct gfar_private *priv = netdev_priv(dev);
+   int rc;
 
/* Initialize the default values */
priv->rx_stash_size = DEFAULT_STASH_LENGTH;
@@ -301,11 +300,12 @@ void gfar_init_sysfs(struct net_device *dev)
priv->bd_stash_en = DEFAULT_BD_STASH;
 
/* Create our sysfs files */
-   GFAR_CREATE_FILE(dev, bd_stash);
-   GFAR_CREATE_FILE(dev, rx_stash_size);
-   GFAR_CREATE_FILE(dev, rx_stash_index);
-   GFAR_CREATE_FILE(dev, fifo_threshold);
-   GFAR_CREATE_FILE(dev, fifo_starve);
-   GFAR_CREATE_FILE(dev, fifo_starve_off);
-
+   rc = device_create_file(&dev->dev, &dev_attr_bd_stash);
+   rc |= device_create_file(&dev->dev, &dev_attr_rx_stash_size);
+   rc |= device_create_file(&dev->dev, &dev_attr_rx_stash_index);
+   rc |= device_create_file(&dev->dev, &dev_attr_fifo_threshold);
+   rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve);
+   rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve_off);
+   if (rc)
+   dev_err(&dev->dev, "Error creating gianfar sysfs f

[PATCH] gianfar: fix compile warning

2007-12-01 Thread Grant Likely
From: Grant Likely <[EMAIL PROTECTED]>

Eliminate an uninitialized variable warning.  The code is correct, but
a pointer to the automatic variable 'addr' is passed to dma_alloc_coherent.
Since addr has never been initialized, and the compiler doesn't know
what dma_alloc_coherent will do with it, it complains.

Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---

Jeff, this one should go in for 2.6.24

Cheers,
g.

 drivers/net/gianfar.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 38268d7..0431e9e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -696,7 +696,7 @@ int startup_gfar(struct net_device *dev)
 {
struct txbd8 *txbdp;
struct rxbd8 *rxbdp;
-   dma_addr_t addr;
+   dma_addr_t addr = 0;
unsigned long vaddr;
int i;
struct gfar_private *priv = netdev_priv(dev);

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


Re: [PATCH 2/3] [libata] pata_of_platform: OF-Platform PATA device driver

2007-12-01 Thread Olof Johansson
On Tue, Nov 27, 2007 at 06:39:08PM +0300, Anton Vorontsov wrote:

> +static struct of_device_id pata_of_platform_match[] = {
> + { .compatible = "pata-platform", },
> +};

On top of previous comment about the compatible string being
inappropriate:

You should add a MODULE_DEVICE_TABLE() entry for this. Dave Woodhouse
pointed out it's needed for autoloading modules (i.e. by the fedora
installer, etc).


-Olof

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


Re: [PATCH 0/3] OF-platform PATA driver

2007-12-01 Thread Olof Johansson
On Sun, Dec 02, 2007 at 02:58:10AM +0300, Anton Vorontsov wrote:
> On Sat, Dec 01, 2007 at 05:54:49PM -0500, Jeff Garzik wrote:
> while (1) {
>   send_patches();
> 
>   if (ack_collected(PaulM) && ack_collected(PowerPC_people))
>   break;
> 
>   sleep(wait_for_comments_timeout); <-- currently here.

I still haven't seen you address the compatible comments (that
pata-platform is suboptimal). Or did I miss some respin of the patches?


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


Re: serial console autodetection not working on powermac

2007-12-01 Thread Benjamin Herrenschmidt

On Sat, 2007-12-01 at 15:40 +0100, Olaf Hering wrote:
> How is the serial console autodetection supposed to work with current
> kernels? arch/powerpc/kernel/legacy_serial.c is not compiled unless
> CONFIG_PPC_UDBG_16550 is selected.
> Even if I force this config option, legacy_serial_console remains -1 and
> the ch-a/ch-b check in check_legacy_serial_console() does not trigger.
> Can the ch-a/ch-b check in check_legacy_serial_console() trigger anyway?
> 
> The autodetection used to work in earlier kernels.
> 
> A compiletime check for CONFIG_SERIAL_PMACZILOG_TTYS is also required,
> to switch between ttyS and ttyPZ. Currently ttyS is hardcoded.

It might well have bitrotted. It should be taken out of that file
anyway. I'll have a look next week. Remind me if I forget :-)

Ben.

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


Re: [PATCH 0/3] OF-platform PATA driver

2007-12-01 Thread Anton Vorontsov
On Sat, Dec 01, 2007 at 05:54:49PM -0500, Jeff Garzik wrote:
> Anton Vorontsov wrote:
> > Hi all,
> > 
> > Here is the second spin of the OF-platform PATA driver and
> > related patches.
> > 
> > Changes since RFC:
> > - nuked drivers/ata/pata_platform.h;
> > - powerpc bits: proper localbus node added.
> > 
> > 
> > Thanks for the previous review! This time I'm collecting acks,
> > don't be shy to give 'em generously. ;-)
> if (ack_collected(PaulM))
>   push(ACK)
> else {
>   /* do nothing */
> }

Yep, this is obvious.

Here is the algo I'm following:

while (1) {
send_patches();

if (ack_collected(PaulM) && ack_collected(PowerPC_people))
break;

sleep(wait_for_comments_timeout); <-- currently here.
}

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality

2007-12-01 Thread Stephen Rothwell
Just a little reminder ...

On Sun, 2 Dec 2007 00:34:03 +0300 Anton Vorontsov <[EMAIL PROTECTED]> wrote:
>
> static int __init of_add_fixed_phys(void)
> {
>   struct device_node *np;
>   const u32 *prop;
>   struct fixed_phy_status status = {};
> 
>   while ((np = of_find_node_by_name(NULL, "ethernet"))) {

for_each_node_by_name(np, "ethernet") {
(this probably does what you want instead of finding just the first
ethernet over and over again. :-))

>   data  = of_get_property(np, "fixed-link", NULL);
>   if (!data)
>   continue;
> 
>   status.link = 1;
>   status.duplex = data[1];
>   status.speed  = data[2];
> 
>   ret = fixed_phy_add(PHY_POLL, data[0], &status);
>   if (ret)
>   return ret;
if (ret) {
of_put_node(np);
retun ret;
}
>   }

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpE1oEuKHybY.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH 0/3] OF-platform PATA driver

2007-12-01 Thread Jeff Garzik
Anton Vorontsov wrote:
> Hi all,
> 
> Here is the second spin of the OF-platform PATA driver and
> related patches.
> 
> Changes since RFC:
> - nuked drivers/ata/pata_platform.h;
> - powerpc bits: proper localbus node added.
> 
> 
> Thanks for the previous review! This time I'm collecting acks,
> don't be shy to give 'em generously. ;-)

if (ack_collected(PaulM))
push(ACK)
else {
/* do nothing */
}




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


Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality

2007-12-01 Thread Vitaly Bordug
On Sun, 2 Dec 2007 00:34:03 +0300
Anton Vorontsov wrote:

> > If i understand your code correctly, you seem to rely on the fact 
> > that fixed_phy_add() is called before the fixed MDIO bus is scanned
> > for devices.  
> 
> Yes, indeed. The other name of "fixed phys" are "platform phys"
> or "platform MDIO bus" on which virtual PHYs are placed.
> 
> That is, these phys supposed to be created by the platform setup
> code (arch/). The rationale here is: we do hardware emulation, thus
> to make drivers actually see that "hardware", we have to create it
> early.

well that was the intention but... The point is - as device is emulated, 
(nearly) everything is doable,
and the only tradeoff to consider, is how far will we go with that emulation. 
IOW, PHYlib could be tricked
to "do the right thing", and I thought about adding module flexibility...

But thinking more about it, it seems that BSP-code-phy-creation just sucks less 
and is clear enough yet flexible.
-- 
Sincerely, Vitaly
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality

2007-12-01 Thread Vitaly Bordug
On Sat, 01 Dec 2007 16:59:52 -0500
Jeff Garzik wrote:

> Vitaly Bordug wrote:
> > With that patch fixed.c now fully emulates MDIO bus, thus no need
> > to duplicate PHY layer functionality. That, in turn, drastically
> > simplifies the code, and drops down line count.
> > 
> > As an additional bonus, now there is no need to register MDIO bus
> > for each PHY, all emulated PHYs placed on the platform fixed MDIO
> > bus. There is also no more need to pre-allocate PHYs via .config
> > option, this is all now handled dynamically.
> > 
> > p.s. Don't even try to understand patch content! Better: apply patch
> > and look into resulting drivers/net/phy/fixed.c.
> > 
> > Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> > Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
> 
> what's the context of this patchset?  2.6.25?
> 
Fine with it.

> it's late for 2.6.24-rc, IMO.
> 
> Do I have the latest version (sent Nov 26 @ 9:29am)?
yes, that's it.

-- 
Sincerely, Vitaly
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality

2007-12-01 Thread Jeff Garzik
Vitaly Bordug wrote:
> With that patch fixed.c now fully emulates MDIO bus, thus no need
> to duplicate PHY layer functionality. That, in turn, drastically
> simplifies the code, and drops down line count.
> 
> As an additional bonus, now there is no need to register MDIO bus
> for each PHY, all emulated PHYs placed on the platform fixed MDIO bus.
> There is also no more need to pre-allocate PHYs via .config option,
> this is all now handled dynamically.
> 
> p.s. Don't even try to understand patch content! Better: apply patch
> and look into resulting drivers/net/phy/fixed.c.
> 
> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>

what's the context of this patchset?  2.6.25?

it's late for 2.6.24-rc, IMO.

Do I have the latest version (sent Nov 26 @ 9:29am)?

Jeff



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


Re: [PATCH] [1/12] pasemi_mac: RX/TX ring management cleanup

2007-12-01 Thread Jeff Garzik
Olof Johansson wrote:
> pasemi_mac: RX/TX ring management cleanup
> 
> Prepare a bit for supporting multiple TX queues by cleaning up some
> of the ring management and shuffle things around a bit.
> 
> Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>

applied 1-12


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


Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality

2007-12-01 Thread Anton Vorontsov
On Sat, Dec 01, 2007 at 02:48:54PM +0100, Jochen Friedrich wrote:
> Hi Vitaly,
> 
> > With that patch fixed.c now fully emulates MDIO bus, thus no need
> > to duplicate PHY layer functionality. That, in turn, drastically
> > simplifies the code, and drops down line count.
> >
> > As an additional bonus, now there is no need to register MDIO bus
> > for each PHY, all emulated PHYs placed on the platform fixed MDIO bus.
> > There is also no more need to pre-allocate PHYs via .config option,
> > this is all now handled dynamically.
> >
> > p.s. Don't even try to understand patch content! Better: apply patch
> > and look into resulting drivers/net/phy/fixed.c.
> >   
> If i understand your code correctly, you seem to rely on the fact 
> that fixed_phy_add() is called before the fixed MDIO bus is scanned for 
> devices.

Yes, indeed. The other name of "fixed phys" are "platform phys"
or "platform MDIO bus" on which virtual PHYs are placed.

That is, these phys supposed to be created by the platform setup
code (arch/). The rationale here is: we do hardware emulation, thus
to make drivers actually see that "hardware", we have to create it
early.

> I tried to add fixed-phy support to fs_enet, but the fixed phy is not 
> found this way.
> 
> --- a/drivers/net/fs_enet/fs_enet-main.c
> +++ b/drivers/net/fs_enet/fs_enet-main.c
> @@ -36,6 +36,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> @@ -1174,8 +1175,24 @@ static int __devinit find_phy(struct device_node *np,
> struct device_node *phynode, *mdionode;
> struct resource res;
> int ret = 0, len;
> +   const u32 *data;
> +   struct fixed_phy_status status = {};
> +
> +   data  = of_get_property(np, "fixed-link", NULL);
> +   if (data) {
> +   status.link = 1;
> +   status.duplex = data[1];
> +   status.speed  = data[2];
> +
> +   ret = fixed_phy_add(PHY_POLL, data[0], &status);
> +   if (ret)
> +   return ret;
> +
> +   snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
> +   return 0;
> +   }
>  
> -   const u32 *data = of_get_property(np, "phy-handle", &len);
> +   data = of_get_property(np, "phy-handle", &len);
> if (!data || len != 4)
> return -EINVAL;

^^ the correct solution is to implement arch_initcall function
which will create fixed PHYs, and then leave only
snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); part in the
fs_enet's find_phy().

Try add something like this to the fsl_soc.c (compile untested):

- - - -
static int __init of_add_fixed_phys(void)
{
struct device_node *np;
const u32 *prop;
struct fixed_phy_status status = {};

while ((np = of_find_node_by_name(NULL, "ethernet"))) {
data  = of_get_property(np, "fixed-link", NULL);
if (!data)
continue;

status.link = 1;
status.duplex = data[1];
status.speed  = data[2];

ret = fixed_phy_add(PHY_POLL, data[0], &status);
if (ret)
return ret;
}

return 0;
}
arch_initcall(of_add_fixed_phys);
- - - -

And remove fixed_phy_add() from the fs_enet. This should work
nicely and also should be ideologically correct. ;-)

> How is this supposed to work for modules or for the
> PPC_CPM_NEW_BINDING mode where the device tree is no longer scanned
> during fs_soc initialization but during device initialization?

We should mark fixed.c as bool. Fake/virtual/fixed/platform PHYs
creation is architecture code anyway, can't be =m.

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Stop phy code from returning success to unknown ioctls.

2007-12-01 Thread Jeff Garzik
David Woodhouse wrote:
> This kind of sucks, and prevents the Fedora installer from using the
> device for network installs...
> 
> [EMAIL PROTECTED] phy]# iwconfig eth0 
>
> Warning: Driver for device eth0 has been compiled with an ancient version 
>  
> of Wireless Extension, while this program support version 11 and later.   
>  
> Some things may be broken...  
>  
>   
>  
> eth0ESSID:off/any  Nickname:""
>  
>   NWID:0  Channel:0  Access Point: 00:00:BF:81:14:E0  
>  
>   Bit Rate:-1.08206e+06 kb/s   Sensitivity=0/0
>  
>   RTS thr:off   Fragment thr:off  
>  
>   Encryption key:
>  
>   Power Management:off
>  
>   
>  
> Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 9bc1177..7c9e6e3 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -406,6 +406,9 @@ int phy_mii_ioctl(struct phy_device *phydev,
>   && phydev->drv->config_init)
>   phydev->drv->config_init(phydev);
>   break;
> +
> + default:
> + return -ENOTTY;
>   }
>  

applied


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


Re: [PATCH] SET_NETDEV_DEV() in fec_mpc52xx.c

2007-12-01 Thread Jeff Garzik
David Woodhouse wrote:
> This helps to allow the Fedora installer to use the built-in Ethernet on
> the Efika for a network install.
> 
> Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
> 
> --- a/drivers/net/fec_mpc52xx.c
> +++ b/drivers/net/fec_mpc52xx.c
> @@ -971,6 +971,8 @@ mpc52xx_fec_probe(struct of_device *op, const struct 
> of_device_id *match)
>  
>   mpc52xx_fec_reset_stats(ndev);
>  
> + SET_NETDEV_DEV(ndev, &op->dev);
> +
>   /* Register the new network device */
>   rv = register_netdev(ndev);

applied


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


Re: [PATCH 1/3][RESEND] phylib: add PHY interface modes for internal delay for tx and rx only

2007-12-01 Thread Jeff Garzik
Kim Phillips wrote:
> Allow phylib specification of cases where hardware needs to configure
> PHYs for Internal Delay only on either RX or TX (not both).
> 
> Signed-off-by: Kim Phillips <[EMAIL PROTECTED]>
> Tested-by: Anton Vorontsov <[EMAIL PROTECTED]>
> Acked-by: Li Yang <[EMAIL PROTECTED]>
> ---
>  include/linux/phy.h |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index f0742b6..e10763d 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -58,6 +58,8 @@ typedef enum {
>   PHY_INTERFACE_MODE_RMII,
>   PHY_INTERFACE_MODE_RGMII,
>   PHY_INTERFACE_MODE_RGMII_ID,
> + PHY_INTERFACE_MODE_RGMII_RXID,
> + PHY_INTERFACE_MODE_RGMII_TXID,
>   PHY_INTERFACE_MODE_RTBI
>  } phy_interface_t;

applied 1-3


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


Re: [RFC] [PATCH] pasemi: NMI support with MPIC

2007-12-01 Thread Olof Johansson
On Sun, Dec 02, 2007 at 07:38:45AM +1100, Benjamin Herrenschmidt wrote:
> 
> On Sat, 2007-12-01 at 12:28 -0600, Olof Johansson wrote:
> > Some PWRficient-based boards have a NMI button that's wired up to a GPIO
> > as interrupt source. By configuring the openpic accordingly, these get
> > delivered as a machine check with high priority, instead of as an external
> > interrupt.
> > 
> > The device tree contains a property "nmi-source" in the openpic node
> > for these systems, and it's the (hwirq) source for the input.
> > 
> > Also, for these interrupts, the IACK is read from another register than
> > the regular (MCACK), but they are EOI'd as usual. So implement said
> > function for the mpic driver.
> > 
> > Finally, move a couple of external function defines to include/ instead
> > of local under sysdev. Being able to mask/unmask and eoi directly saves
> > us from setting up a dummy irq handler that will never be called.
> 
> It's interesting how creative implementors are with MPICs :-)

:-)

> Looks allright to me but I haven't tested for regressions.

I've build tested all platforms, and I don't expect any runtime changes
for others since they're not executing the new paths.


Thanks,

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


Re: [RFC] [PATCH] pasemi: NMI support with MPIC

2007-12-01 Thread Benjamin Herrenschmidt

On Sat, 2007-12-01 at 12:28 -0600, Olof Johansson wrote:
> Some PWRficient-based boards have a NMI button that's wired up to a GPIO
> as interrupt source. By configuring the openpic accordingly, these get
> delivered as a machine check with high priority, instead of as an external
> interrupt.
> 
> The device tree contains a property "nmi-source" in the openpic node
> for these systems, and it's the (hwirq) source for the input.
> 
> Also, for these interrupts, the IACK is read from another register than
> the regular (MCACK), but they are EOI'd as usual. So implement said
> function for the mpic driver.
> 
> Finally, move a couple of external function defines to include/ instead
> of local under sysdev. Being able to mask/unmask and eoi directly saves
> us from setting up a dummy irq handler that will never be called.

It's interesting how creative implementors are with MPICs :-)

Looks allright to me but I haven't tested for regressions.

Ben.


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


Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality

2007-12-01 Thread Vitaly Bordug
On Sat, 01 Dec 2007 14:48:54 +0100
Jochen Friedrich wrote:

> Hi Vitaly,
> 
> > With that patch fixed.c now fully emulates MDIO bus, thus no need
> > to duplicate PHY layer functionality. That, in turn, drastically
> > simplifies the code, and drops down line count.
> >
> > As an additional bonus, now there is no need to register MDIO bus
> > for each PHY, all emulated PHYs placed on the platform fixed MDIO
> > bus. There is also no more need to pre-allocate PHYs via .config
> > option, this is all now handled dynamically.
> >
> > p.s. Don't even try to understand patch content! Better: apply patch
> > and look into resulting drivers/net/phy/fixed.c.
> >   
> If i understand your code correctly, you seem to rely on the fact 
> that fixed_phy_add() is called before the fixed MDIO bus is scanned
> for devices. How is this supposed to work for modules or for the 
> PPC_CPM_NEW_BINDING mode where the device tree is no longer scanned 
> during fs_soc initialization but during device initialization?
>
Well, this is kind of known issue - to work it around for now, place PHY lib 
after fs_enet in
Makefile. This way it works for me for _NEW_BINDING and mpc866ads.

> I tried to add fixed-phy support to fs_enet, but the fixed phy is not 
> found this way.
> 
The point is I have the code and it works now(for fs_enet etc.), but I need to 
find the way for the fixed phy pinning to work in either order with phylib. If 
you have ideas, please go ahead :)


> --- a/drivers/net/fs_enet/fs_enet-main.c
> +++ b/drivers/net/fs_enet/fs_enet-main.c
> @@ -36,6 +36,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> @@ -1174,8 +1175,24 @@ static int __devinit find_phy(struct
> device_node *np, struct device_node *phynode, *mdionode;
> struct resource res;
> int ret = 0, len;
> +   const u32 *data;
> +   struct fixed_phy_status status = {};
> +
> +   data  = of_get_property(np, "fixed-link", NULL);
> +   if (data) {
> +   status.link = 1;
> +   status.duplex = data[1];
> +   status.speed  = data[2];
> +
> +   ret = fixed_phy_add(PHY_POLL, data[0], &status);
> +   if (ret)
> +   return ret;
> +
> +   snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
> +   return 0;
> +   }
>  
> -   const u32 *data = of_get_property(np, "phy-handle", &len);
> +   data = of_get_property(np, "phy-handle", &len);
> if (!data || len != 4)
> return -EINVAL;
> 
> Thanks,
> Jochen


-- 
Sincerely, Vitaly
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[RFC] [PATCH] pasemi: NMI support with MPIC

2007-12-01 Thread Olof Johansson
Some PWRficient-based boards have a NMI button that's wired up to a GPIO
as interrupt source. By configuring the openpic accordingly, these get
delivered as a machine check with high priority, instead of as an external
interrupt.

The device tree contains a property "nmi-source" in the openpic node
for these systems, and it's the (hwirq) source for the input.

Also, for these interrupts, the IACK is read from another register than
the regular (MCACK), but they are EOI'd as usual. So implement said
function for the mpic driver.

Finally, move a couple of external function defines to include/ instead
of local under sysdev. Being able to mask/unmask and eoi directly saves
us from setting up a dummy irq handler that will never be called.


---

 arch/powerpc/platforms/pasemi/setup.c |   29 ++---
 arch/powerpc/sysdev/mpic.c|   26 +++---
 arch/powerpc/sysdev/mpic.h|3 ---
 include/asm-powerpc/mpic.h|   17 -
 4 files changed, 65 insertions(+), 10 deletions(-)


diff --git a/arch/powerpc/platforms/pasemi/setup.c 
b/arch/powerpc/platforms/pasemi/setup.c
index 14dace7..2102acc 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -56,6 +56,7 @@ struct mce_regs {
 
 static struct mce_regs mce_regs[MAX_MCE_REGS];
 static int num_mce_regs;
+static int nmi_virq = NO_IRQ;
 
 
 static void pas_restart(char *cmd)
@@ -184,6 +185,8 @@ static __init void pas_init_IRQ(void)
unsigned long openpic_addr;
const unsigned int *opprop;
int naddr, opplen;
+   int mpic_flags;
+   const unsigned int *nmiprop;
struct mpic *mpic;
 
mpic_node = NULL;
@@ -216,13 +219,25 @@ static __init void pas_init_IRQ(void)
openpic_addr = of_read_number(opprop, naddr);
printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
 
+   mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS;
+
+   nmiprop = of_get_property(mpic_node, "nmi-source", NULL);
+   if (nmiprop)
+   mpic_flags |= MPIC_ENABLE_MCK;
+
mpic = mpic_alloc(mpic_node, openpic_addr,
- MPIC_PRIMARY|MPIC_LARGE_VECTORS,
- 0, 0, " PAS-OPIC  ");
+ mpic_flags, 0, 0, " PAS-OPIC  ");
BUG_ON(!mpic);
 
mpic_assign_isu(mpic, 0, openpic_addr + 0x1);
mpic_init(mpic);
+   /* The NMI/MCK source needs to be prio 15 */
+   if (nmiprop) {
+   nmi_virq = irq_create_mapping(NULL, *nmiprop);
+   mpic_irq_set_priority(nmi_virq, 15);
+   mpic_unmask_irq(nmi_virq);
+   }
+
of_node_put(mpic_node);
of_node_put(root);
 }
@@ -242,6 +257,14 @@ static int pas_machine_check_handler(struct pt_regs *regs)
 
srr0 = regs->nip;
srr1 = regs->msr;
+
+   if (mpic_get_mcirq() == nmi_virq) {
+   printk(KERN_ERR "NMI delivered\n");
+   debugger(regs);
+   mpic_end_irq(nmi_virq);
+   goto out;
+   }
+
dsisr = mfspr(SPRN_DSISR);
printk(KERN_ERR "Machine Check on CPU %d\n", cpu);
printk(KERN_ERR "SRR0  0x%016lx SRR1 0x%016lx\n", srr0, srr1);
@@ -305,7 +328,7 @@ static int pas_machine_check_handler(struct pt_regs *regs)
}
}
 
-
+out:
/* SRR1[62] is from MSR[62] if recoverable, so pass that back */
return !!(srr1 & 0x2);
 }
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index e479388..22a691b 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -83,6 +83,7 @@ static u32 mpic_infos[][MPIC_IDX_END] = {
MPIC_CPU_WHOAMI,
MPIC_CPU_INTACK,
MPIC_CPU_EOI,
+   MPIC_CPU_MCACK,
 
MPIC_IRQ_BASE,
MPIC_IRQ_STRIDE,
@@ -121,6 +122,7 @@ static u32 mpic_infos[][MPIC_IDX_END] = {
TSI108_CPU_WHOAMI,
TSI108_CPU_INTACK,
TSI108_CPU_EOI,
+   TSI108_CPU_MCACK,
 
TSI108_IRQ_BASE,
TSI108_IRQ_STRIDE,
@@ -1109,6 +,11 @@ struct mpic * __init mpic_alloc(struct device_node *node,
mb();
}
 
+   if (flags & MPIC_ENABLE_MCK)
+   mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
+  mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
+  | MPIC_GREG_GCONF_MCK);
+
/* Read feature register, calculate num CPUs and, for non-ISU
 * MPICs, num sources as well. On ISU MPICs, sources are counted
 * as ISUs are added
@@ -1419,13 +1426,13 @@ void mpic_send_ipi(unsigned int ipi_no, unsigned int 
cpu_mask)
   mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0]));
 }
 
-unsigned int mpic_get_one_irq(struct mpic *mpic)
+static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
 {

serial console autodetection not working on powermac

2007-12-01 Thread Olaf Hering

How is the serial console autodetection supposed to work with current
kernels? arch/powerpc/kernel/legacy_serial.c is not compiled unless
CONFIG_PPC_UDBG_16550 is selected.
Even if I force this config option, legacy_serial_console remains -1 and
the ch-a/ch-b check in check_legacy_serial_console() does not trigger.
Can the ch-a/ch-b check in check_legacy_serial_console() trigger anyway?

The autodetection used to work in earlier kernels.

A compiletime check for CONFIG_SERIAL_PMACZILOG_TTYS is also required,
to switch between ttyS and ttyPZ. Currently ttyS is hardcoded.

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


Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality

2007-12-01 Thread Jochen Friedrich
Hi Vitaly,

> With that patch fixed.c now fully emulates MDIO bus, thus no need
> to duplicate PHY layer functionality. That, in turn, drastically
> simplifies the code, and drops down line count.
>
> As an additional bonus, now there is no need to register MDIO bus
> for each PHY, all emulated PHYs placed on the platform fixed MDIO bus.
> There is also no more need to pre-allocate PHYs via .config option,
> this is all now handled dynamically.
>
> p.s. Don't even try to understand patch content! Better: apply patch
> and look into resulting drivers/net/phy/fixed.c.
>   
If i understand your code correctly, you seem to rely on the fact 
that fixed_phy_add() is called before the fixed MDIO bus is scanned for 
devices. How is this supposed to work for modules or for the 
PPC_CPM_NEW_BINDING mode where the device tree is no longer scanned 
during fs_soc initialization but during device initialization?

I tried to add fixed-phy support to fs_enet, but the fixed phy is not 
found this way.

--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1174,8 +1175,24 @@ static int __devinit find_phy(struct device_node *np,
struct device_node *phynode, *mdionode;
struct resource res;
int ret = 0, len;
+   const u32 *data;
+   struct fixed_phy_status status = {};
+
+   data  = of_get_property(np, "fixed-link", NULL);
+   if (data) {
+   status.link = 1;
+   status.duplex = data[1];
+   status.speed  = data[2];
+
+   ret = fixed_phy_add(PHY_POLL, data[0], &status);
+   if (ret)
+   return ret;
+
+   snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
+   return 0;
+   }
 
-   const u32 *data = of_get_property(np, "phy-handle", &len);
+   data = of_get_property(np, "phy-handle", &len);
if (!data || len != 4)
return -EINVAL;

Thanks,
Jochen
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/3] 4xx: Change Kilauea dts to support new EMAC device tree properties

2007-12-01 Thread Stefan Roese
The recent changes from Benjamin Herrenschmidt to the ibm_newemac now
make it possible to support other 4xx variants by just defining the
correct properties in the device tree. In this case of the 405EX we
need to define "has-mdio" in the RGMII node and "has-inverted-stacr-oc"
and "has-new-stacr-staopc" in the EMAC node same as on the 440EPx.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/kilauea.dts |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/kilauea.dts 
b/arch/powerpc/boot/dts/kilauea.dts
index c824e8f..b090940 100644
--- a/arch/powerpc/boot/dts/kilauea.dts
+++ b/arch/powerpc/boot/dts/kilauea.dts
@@ -194,6 +194,7 @@
device_type = "rgmii-interface";
compatible = "ibm,rgmii-405ex", "ibm,rgmii";
reg = ;
+   has-mdio;
};
 
EMAC0: [EMAIL PROTECTED] {
@@ -220,6 +221,8 @@
phy-map = <>;
rgmii-device = <&RGMII0>;
rgmii-channel = <0>;
+   has-inverted-stacr-oc;
+   has-new-stacr-staopc;
};
 
EMAC1: [EMAIL PROTECTED] {
@@ -246,6 +249,8 @@
phy-map = <>;
rgmii-device = <&RGMII0>;
rgmii-channel = <1>;
+   has-inverted-stacr-oc;
+   has-new-stacr-staopc;
};
};
};
-- 
1.5.3.6.985.g65c6a4

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


[PATCH 3/3] 4xx: Add EMAC support to Kilauea defconfig

2007-12-01 Thread Stefan Roese
Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/configs/kilauea_defconfig |  717 
 1 files changed, 533 insertions(+), 184 deletions(-)

diff --git a/arch/powerpc/configs/kilauea_defconfig 
b/arch/powerpc/configs/kilauea_defconfig
index fd1c530..1340871 100644
--- a/arch/powerpc/configs/kilauea_defconfig
+++ b/arch/powerpc/configs/kilauea_defconfig
@@ -1,53 +1,22 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc9
-# Thu Oct 11 19:05:15 2007
+# Linux kernel version: 2.6.23
+# Sat Dec  1 07:52:20 2007
 #
-# CONFIG_PPC64 is not set
-
-#
-# Processor support
-#
-# CONFIG_6xx is not set
-# CONFIG_PPC_85xx is not set
-# CONFIG_PPC_8xx is not set
-CONFIG_40x=y
-# CONFIG_44x is not set
-# CONFIG_E200 is not set
-CONFIG_4xx=y
-# CONFIG_PPC_MM_SLICES is not set
-CONFIG_NOT_COHERENT_CACHE=y
-CONFIG_PPC32=y
-CONFIG_WORD_SIZE=32
-CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_TIME=y
-CONFIG_GENERIC_TIME_VSYSCALL=y
-CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
-CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_ARCH_HAS_ILOG2_U32=y
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
 CONFIG_PPC=y
-CONFIG_EARLY_PRINTK=y
+CONFIG_PPC32=y
 CONFIG_GENERIC_NVRAM=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
-CONFIG_PPC_OF=y
-CONFIG_OF=y
-# CONFIG_PPC_UDBG_16550 is not set
-# CONFIG_GENERIC_TBSYNC is not set
-CONFIG_AUDIT_ARCH=y
 CONFIG_GENERIC_BUG=y
-# CONFIG_DEFAULT_UIMAGE is not set
-CONFIG_PPC_DCR_NATIVE=y
-# CONFIG_PPC_DCR_MMIO is not set
-CONFIG_PPC_DCR=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -76,24 +45,22 @@ CONFIG_INITRAMFS_SOURCE=""
 CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
 CONFIG_SYSCTL_SYSCALL=y
-CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_HOTPLUG=y
+# CONFIG_KALLSYMS is not set
+# CONFIG_HOTPLUG is not set
 CONFIG_PRINTK=y
+# CONFIG_LOGBUFFER is not set
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
-CONFIG_EPOLL=y
+# CONFIG_EPOLL is not set
 CONFIG_SIGNALFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_SLUB_DEBUG=y
-# CONFIG_SLAB is not set
-CONFIG_SLUB=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
@@ -105,7 +72,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
 CONFIG_BLOCK=y
-CONFIG_LBD=y
+# CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
@@ -124,36 +91,58 @@ CONFIG_DEFAULT_AS=y
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 
 #
-# Platform support
+# Processor
+#
+# CONFIG_6xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+# CONFIG_E500 is not set
+CONFIG_PPC_DCR_NATIVE=y
+CONFIG_PPC_DCR=y
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_4xx=y
+CONFIG_WANT_EARLY_SERIAL=y
+
+#
+# IBM 4xx options
 #
-# CONFIG_PPC_MPC52xx is not set
-# CONFIG_PPC_MPC5200 is not set
-# CONFIG_PPC_CELL is not set
-# CONFIG_PPC_CELL_NATIVE is not set
-# CONFIG_PQ2ADS is not set
+# CONFIG_ACADIA is not set
+# CONFIG_BUBINGA is not set
+# CONFIG_CPCI405 is not set
+# CONFIG_EP405 is not set
 CONFIG_KILAUEA=y
+# CONFIG_MAKALU is not set
+# CONFIG_PPChameleonEVB is not set
+# CONFIG_REDWOOD_5 is not set
+# CONFIG_REDWOOD_6 is not set
+# CONFIG_SC3 is not set
+# CONFIG_SYCAMORE is not set
+# CONFIG_TAIHU is not set
 # CONFIG_WALNUT is not set
-# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
-# CONFIG_MPIC is not set
-# CONFIG_MPIC_WEIRD is not set
-# CONFIG_PPC_I8259 is not set
-# CONFIG_PPC_RTAS is not set
-# CONFIG_MMIO_NVRAM is not set
-# CONFIG_PPC_MPC106 is not set
-# CONFIG_PPC_970_NAP is not set
-# CONFIG_PPC_INDIRECT_IO is not set
-# CONFIG_GENERIC_IOMAP is not set
-# CONFIG_CPU_FREQ is not set
-# CONFIG_CPM2 is not set
-# CONFIG_FSL_ULI1575 is not set
+# CONFIG_XILINX_ML300 is not set
+# CONFIG_XILINX_ML403 is not set
+CONFIG_IBM405_ERR77=y
+CONFIG_IBM405_ERR51=y
+CONFIG_IBM_OCP=y
+CONFIG_IBM_EMAC4=y
+CONFIG_IBM_EMAC4V4=y
+CONFIG_405EX=y
+# CONFIG_PPC4xx_DMA is not set
+CONFIG_PPC_GEN550=y
+CONFIG_UART0_TTYS0=y
+# CONFIG_UART0_TTYS1 is not set
+CONFIG_NOT_COHERENT_CACHE=y
 
 #
-# Kernel options
+# Platform options
 #
+# CONFIG_PC_KEYBOARD is not set
 # CONFIG_HIGHMEM is not set
-# CONFIG_TICK_ONESHOT is not set
-# CONFIG_NO_HZ is not set
-# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_ARCH_POPULATES_NODE_MAP=y
 # CONFIG_HZ_100 is not set
 CONFIG_HZ_250=y
 # CONFIG_HZ_300 is not set
@@ -162,12 +151,6 @@ CONFIG_HZ=250
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set

[PATCH 1/3] 4xx: Add 405EX CPU type needed for EMAC support on Kilauea

2007-12-01 Thread Stefan Roese
For EMAC support, 405EX needs to be defined to enable the corresponding
EMAC features (IBM_NEW_EMAC_EMAC4, etc.).

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/40x/Kconfig |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/40x/Kconfig 
b/arch/powerpc/platforms/40x/Kconfig
index 66aa351..5d2ca0d 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -26,6 +26,7 @@ config KILAUEA
bool "Kilauea"
depends on 40x
default n
+   select 405EX
help
  This option enables support for the AMCC PPC405EX evaluation board.
 
@@ -98,6 +99,11 @@ config 405GP
 config 405EP
bool
 
+config 405EX
+   bool
+   select IBM_NEW_EMAC_EMAC4
+   select IBM_NEW_EMAC_RGMII
+
 config 405GPR
bool
 
-- 
1.5.3.6.985.g65c6a4

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