Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: John Crispin <blogic@openwrt.org>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Ralph Hempel <ralph.hempel@lantiq.com>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH V2 3/3] MIPS: lantiq: add dma/etop board support
Date: Fri, 06 May 2011 14:26:17 +0400	[thread overview]
Message-ID: <4DC3CCC9.4040002@mvista.com> (raw)
In-Reply-To: <1304633402-24161-4-git-send-email-blogic@openwrt.org>

Hello.

On 06-05-2011 2:10, John Crispin wrote:

> This patch adds functions to register the etop and dma platform devices and
> calls them from the board specific setup code.

> Signed-off-by: John Crispin<blogic@openwrt.org>
> Signed-off-by: Ralph Hempel<ralph.hempel@lantiq.com>
> Cc: linux-mips@linux-mips.org
[...]

> diff --git a/arch/mips/lantiq/devices.c b/arch/mips/lantiq/devices.c
> index e758863..a10244e 100644
> --- a/arch/mips/lantiq/devices.c
> +++ b/arch/mips/lantiq/devices.c
> @@ -31,6 +31,19 @@
>   #define IRQ_RES(resname, irq) \
>   	{.name = #resname, .start = (irq), .flags = IORESOURCE_IRQ}
>
> +/* dma engine */
> +static struct resource ltq_dma_resource = {
> +	.name	= "dma",
> +	.start	= LTQ_DMA_BASE_ADDR,
> +	.end	= LTQ_DMA_BASE_ADDR + LTQ_DMA_SIZE - 1,
> +	.flags  = IORESOURCE_MEM,

    Spaces before = instead of tab here.

> diff --git a/arch/mips/lantiq/xway/devices.c b/arch/mips/lantiq/xway/devices.c
> index 7d58ae5..99ff2ef 100644
> --- a/arch/mips/lantiq/xway/devices.c
> +++ b/arch/mips/lantiq/xway/devices.c
> @@ -75,3 +75,30 @@ void __init ltq_register_gpio_stp(void)
>   {
>   	platform_device_register_simple("ltq_stp", 0,&ltq_stp_resource, 1);
>   }
> +
> +/* ethernet */
> +static struct resource ltq_ethernet_resources = {
> +	.name   = "etop",
> +	.start  = LTQ_ETOP_BASE_ADDR,
> +	.end    = LTQ_ETOP_BASE_ADDR + LTQ_ETOP_SIZE - 1,
> +	.flags  = IORESOURCE_MEM,

    It's better to use tabs, not spaces between the filed names and =, like 
above...

> +};
> +
> +static struct platform_device ltq_ethernet = {
> +	.name = "ltq_etop",
> +	.resource =&ltq_ethernet_resources,
> +	.num_resources  = 1,

    Too many spaces?

> +};
> +
> +void __init
> +ltq_register_ethernet(struct ltq_eth_data *eth)
> +{
> +	if (!eth)
> +		return;
> +	if (!is_valid_ether_addr(eth->mac.sa_data)) {
> +		pr_warn("etop: invalid MAC, using random\n");
> +		random_ether_addr(eth->mac.sa_data);
> +	}

    Why not do it in the driver?

> +	ltq_ethernet.dev.platform_data = eth;
> +	platform_device_register(&ltq_ethernet);
> +}
[...]
> diff --git a/arch/mips/lantiq/xway/mach-easy50712.c b/arch/mips/lantiq/xway/mach-easy50712.c
> index 5242a27..a001761 100644
> --- a/arch/mips/lantiq/xway/mach-easy50712.c
> +++ b/arch/mips/lantiq/xway/mach-easy50712.c
> @@ -59,13 +59,19 @@ static struct ltq_pci_data ltq_pci_data = {
>   	},
>   };
>
> +static struct ltq_eth_data ltq_eth_data = {
> +	.mii_mode = PHY_INTERFACE_MODE_MII,
> +};
> +
>   static void __init easy50712_init(void)
>   {
> +	ltq_register_dma();
>   	ltq_register_gpio();
>   	ltq_register_gpio_stp();
>   	ltq_register_nor(&easy50712_flash_data);
>   	ltq_register_wdt();
>   	ltq_register_pci(&ltq_pci_data);
> +	ltq_register_ethernet(&ltq_eth_data);
>   }
>
>   MIPS_MACHINE(LTQ_MACH_EASY50712,

    I'd put the board code in a sperate patch...

WBR, Sergei

      reply	other threads:[~2011-05-06 10:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1304633402-24161-1-git-send-email-blogic@openwrt.org>
2011-05-05 22:10 ` [PATCH V2 1/3] MIPS: lantiq: add DMA support John Crispin
2011-05-05 22:10 ` [PATCH V2 2/3] MIPS: lantiq: add ethernet driver John Crispin
2011-05-05 22:10   ` David Miller
2011-05-05 22:16     ` John Crispin
2011-05-05 22:10 ` [PATCH V2 3/3] MIPS: lantiq: add dma/etop board support John Crispin
2011-05-06 10:26   ` Sergei Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DC3CCC9.4040002@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=blogic@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=ralph.hempel@lantiq.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox