All of lore.kernel.org
 help / color / mirror / Atom feed
From: ryan@bluewatersys.com (Ryan Mallon)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 02/23] at91: Make Ethernet device common
Date: Wed, 20 Apr 2011 14:33:25 +1200	[thread overview]
Message-ID: <4DAE45F5.70302@bluewatersys.com> (raw)
In-Reply-To: <0D753D10438DA54287A00B027084269764D2329FA6@AUSP01VMBX24.collaborationhost.net>

On 04/20/2011 02:10 PM, H Hartley Sweeten wrote:
> On Tuesday, April 19, 2011 6:10 PM, Ryan Mallon wrote:
>>
>> Replace the individual Ethernet device code for each at91 variant with
>> a single implementation in devices.
>>
>> Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
> 
> Nice.
> 
> A couple comments below.
> 
> [snip]
> 
>> diff --git a/arch/arm/mach-at91/at572d940hf_devices.c b/arch/arm/mach-at91/at572d940hf_devices.c
>> index 0fc20a2..12af1d5 100644
>> --- a/arch/arm/mach-at91/at572d940hf_devices.c
>> +++ b/arch/arm/mach-at91/at572d940hf_devices.c
>> @@ -35,6 +35,7 @@
>>  
>>  #include "generic.h"
>>  #include "sam9_smc.h"
>> +#include "devices.h"
>>  
>>  
>>  /* --------------------------------------------------------------------
>> @@ -138,68 +139,26 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
>>   *  Ethernet
>>   * -------------------------------------------------------------------- */
>>  
>> -#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
>> -static u64 eth_dmamask = DMA_BIT_MASK(32);
>> -static struct at91_eth_data eth_data;
>> -
>> -static struct resource eth_resources[] = {
>> -	[0] = {
>> -		.start	= AT572D940HF_BASE_EMAC,
>> -		.end	= AT572D940HF_BASE_EMAC + SZ_16K - 1,
>> -		.flags	= IORESOURCE_MEM,
>> -	},
>> -	[1] = {
>> -		.start	= AT572D940HF_ID_EMAC,
>> -		.end	= AT572D940HF_ID_EMAC,
>> -		.flags	= IORESOURCE_IRQ,
>> -	},
> 
> [snip]
> 
>> +static struct __initdata at91_dev_table_ethernet device_eth = {
>> +	.mmio_base	= AT91SAM9260_BASE_EMAC,
>> +	.irq		= AT91SAM9260_ID_EMAC,
> 
> AT572D940HF_BASE_EMAC and AT572D940HF_ID_EMAC?

Crap. It's somehow ended up in patch 4 instead. Will fix, thanks.

> 
>> +	.rmii_pins	= eth_rmii_pins,
>> +	.nr_rmii_pins	= ARRAY_SIZE(eth_rmii_pins),
>>  };
>>
>> -void __init at91_add_device_eth(struct at91_eth_data *data)
>> -{
>> -	if (!data)
>> -		return;
>> -
>> -	if (data->phy_irq_pin) {
>> -		at91_set_gpio_input(data->phy_irq_pin, 0);
>> -		at91_set_deglitch(data->phy_irq_pin, 1);
>> -	}
>> -
>> -	/* Only RMII is supported */
>> -	data->is_rmii = 1;
> 
> How is this set for this platfrom?

By having mii_pins set to NULL. The devices.c code now does:

	if (!data->is_rmii && info->mii_pins)
		...
> 
> [snip]
> 
> diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
> index 59fc483..3c0959f 100644
> --- a/arch/arm/mach-at91/at91sam9261_devices.c
> +++ b/arch/arm/mach-at91/at91sam9261_devices.c
> @@ -1044,7 +1044,6 @@ void __init at91_set_serial_console(unsigned portnr) {}
>  void __init at91_add_device_serial(void) {}
>  #endif
>  
> -
> 
> Nit. Unrelated whitespace change.

Thanks, will clean this up.

> 
> [snip]
> 
> diff --git a/arch/arm/mach-at91/devices.c b/arch/arm/mach-at91/devices.c
> index 653e0a9..07fefc8 100644
> --- a/arch/arm/mach-at91/devices.c
> +++ b/arch/arm/mach-at91/devices.c
> 
> [snip]
> 
>> +static struct platform_device at91_eth_device = {
>> +	.name		= "macb",
>> +	.id		= -1,
>> +	.dev		= {
>> +				.dma_mask		= &eth_dmamask,
>> +				.coherent_dma_mask	= DMA_BIT_MASK(32),
>> +				.platform_data		= &eth_data,
> 
> Nit.  Excessive whitespace.

This is cut and pasted from one of the *_devices.c files so the change
is minimal.

> 
> [snip]
> 
>> +#else
>> +void __init at91_add_device_eth(struct at91_eth_data *data) {}
> 
> inline maybe?

No. This is also cut and pasted from the *_devices.c files so the change
is minimal. The compiler should out-right remove this anyway so it
shouldn't need to be inline.

~Ryan

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934

  reply	other threads:[~2011-04-20  2:33 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20  1:10 [RFC PATCH 00/23] at91: Replace duplicate device initialisation code with common code Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 01/23] at91: Add common devices framework Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 02/23] at91: Make Ethernet device common Ryan Mallon
2011-04-20  2:10   ` H Hartley Sweeten
2011-04-20  2:33     ` Ryan Mallon [this message]
2011-04-20 18:23       ` H Hartley Sweeten
2011-04-20  8:36   ` Uwe Kleine-König
2011-04-20 10:34     ` Jean-Christophe PLAGNIOL-VILLARD
2011-04-20 11:07     ` Ryan Mallon
2011-04-20 20:41     ` Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 03/23] at91: Make USB OHCI/EHCI devices common Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 04/23] at91: Make UDC device common Ryan Mallon
2011-04-20  1:10 ` [PATCH 05/23] at91: Make MMC device (at91_mci) common Ryan Mallon
2011-04-20  1:12   ` Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 05/23] at91: Make MMC device common Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 06/23] at91: Make NAND " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 07/23] at91: Make TWI " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 08/23] at91: Make SPI " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 09/23] at91: Make TCB " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 10/23] at91: Make RTT " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 11/23] at91: Make watchdog " Ryan Mallon
2011-04-20 17:10   ` H Hartley Sweeten
2011-04-20  1:10 ` [RFC PATCH 13/23] at91: Make PWM " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 14/23] at91: Make SSC " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 15/23] at91: Make AC97 " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 16/23] at91: Make LCD controller " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 17/23] at91: Make touchscreen " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 18/23] at91: Make HDMAC " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 19/23] at91: Make RTC " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 20/23] at91: Make high speed USB gadget " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 21/23] at91: Make compact flash " Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 22/23] at91: Move at91sam9263 CAN device to common devices Ryan Mallon
2011-04-20  1:10 ` [RFC PATCH 23/23] at91: Remove mAgic and ISI device code Ryan Mallon
2011-04-20  1:11 ` [RFC PATCH 12/23] at91: Make UART devices common Ryan Mallon
2011-04-20  3:47 ` [RFC PATCH 00/23] at91: Replace duplicate device initialisation code with common code Jean-Christophe PLAGNIOL-VILLARD
2011-04-20  3:58   ` Ryan Mallon
2011-04-20  4:03     ` Jean-Christophe PLAGNIOL-VILLARD
2011-04-20 17:14 ` H Hartley Sweeten
2011-04-20 21:07   ` Ryan Mallon
2011-04-21  0:56     ` Detlef Vollmann
2011-04-21  1:04       ` Ryan Mallon

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=4DAE45F5.70302@bluewatersys.com \
    --to=ryan@bluewatersys.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.