On Fri, May 03, 2013 at 01:48:36AM +0200, Sebastian Hesselbarth wrote:
> To allow to move to orion irqchip driver, existing legacy devices
> have to map their irqs. This patch adds init code to map the
> corresponding irqs. It will vanish as soon as there is true device tree
> support for mv643xx_eth.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselba...@gmail.com>
> ---
> Changelog:
> v1->v2:
> - split off DT changes (Suggested by Jason Cooper)
> 
> Cc: Grant Likely <grant.lik...@linaro.org>
> Cc: Rob Herring <rob.herr...@calxeda.com>
> Cc: Rob Landley <r...@landley.net>
> Cc: Thomas Gleixner <t...@linutronix.de>
> Cc: Russell King <li...@arm.linux.org.uk>
> Cc: Arnd Bergmann <a...@arndb.de>
> Cc: Jason Cooper <ja...@lakedaemon.net>
> Cc: Andrew Lunn <and...@lunn.ch>
> Cc: Jason Gunthorpe <jguntho...@obsidianresearch.com>
> Cc: Thomas Petazzoni <thomas.petazz...@free-electrons.com>
> Cc: Gregory Clement <gregory.clem...@free-electrons.com>
> Cc: Ezequiel Garcia <ezequiel.gar...@free-electrons.com>
> Cc: Jean-Francois Moine <moin...@free.fr>
> Cc: devicetree-discuss@lists.ozlabs.org
> Cc: linux-...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-ker...@vger.kernel.org
> ---
>  arch/arm/mach-dove/board-dt.c |   31 ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
> index fbde1dd..9df6dd7 100644
> --- a/arch/arm/mach-dove/board-dt.c
> +++ b/arch/arm/mach-dove/board-dt.c
> @@ -12,6 +12,7 @@
>  #include <linux/clk-provider.h>
>  #include <linux/clk/mvebu.h>
>  #include <linux/of.h>
> +#include <linux/of_irq.h>
>  #include <linux/of_platform.h>
>  #include <linux/platform_data/usb-ehci-orion.h>
>  #include <asm/hardware/cache-tauros2.h>
> @@ -57,6 +58,34 @@ static struct mv643xx_eth_platform_data dove_dt_ge00_data 
> = {
>       .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
>  };
>  
> +#define DOVE_GE00_PHYS_BASE  0xf1070000
> +
> +static void __init dove_legacy_ge00_init(void)
> +{
> +     struct device_node *np = of_find_compatible_node(NULL, NULL,
> +                                      "marvell,mv643xx-eth-block");
> +     int irq_sum, irq_err;
> +
> +     if (!np)
> +             return;
> +
> +     irq_sum = irq_of_parse_and_map(np, 0);
> +     if (!irq_sum) {
> +             pr_err("%s: missing sum irq\n", np->full_name);
> +             return;
> +     }
> +
> +     irq_err = irq_of_parse_and_map(np, 1);
> +     if (!irq_err) {
> +             pr_err("%s: missing err irq\n", np->full_name);
> +             return;
> +     }
> +
> +     /* legacy ge00_init wants phys base */
> +     orion_ge00_init(&dove_dt_ge00_data, DOVE_GE00_PHYS_BASE,
> +                     irq_sum, irq_err, 1600);
> +}

Hi Sebastian

I know the above code is throw away, but it might help with getting
Kirkwood, Orion5x, mv78xx00 supported if we refactor this code and
move most of it into plat-orion/common.c. I could imaging a function

orion_ge00_irq_init(struct mv643xx_eth_platform_data *eth_data,
                    unsigned long mapbase, unsigned int tx_csum_limit)

which does the irq lookup and then calls orion_ge00_init().


Jason: what is the status of the ethernet driver conversion to DT?
Will it get merged this week, or is it material for the next merge
window?

      Andrew
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

Reply via email to