public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Nishant Kamat <nskamat@ti.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [RESENDING PATCH 4/4] ARM: OMAP: Add ethernet support for OMAP LDP
Date: Fri, 16 May 2008 10:55:49 -0700	[thread overview]
Message-ID: <20080516175549.GW23002@atomide.com> (raw)
In-Reply-To: <1210862562-5903-4-git-send-email-nskamat@ti.com>

* Nishant Kamat <nskamat@ti.com> [080515 07:45]:
> This patch adds ethernet support (smc911x) for OMAP LDP platform.
> 
> Signed-off-by: Nishant Kamat <nskamat@ti.com>
> ---
>  arch/arm/configs/omap_ldp_defconfig   |  164 ++++++++++++++++++++++++++++++++-
>  arch/arm/mach-omap2/board-ldp.c       |   51 ++++++++++
>  include/asm-arm/arch-omap/board-ldp.h |    6 +
>  3 files changed, 218 insertions(+), 3 deletions(-)
> 

<snip>

> diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
> index 2ac4c9b..47e86bf 100644
> --- a/arch/arm/mach-omap2/board-ldp.c
> +++ b/arch/arm/mach-omap2/board-ldp.c
> @@ -46,6 +46,26 @@
>  
>  #define TWL4030_MSECURE_GPIO	22
>  
> +static struct resource ldp_smc911x_resources[] = {
> +	[0] = {
> +		.start	= OMAP34XX_ETHR_START,
> +		.end	= OMAP34XX_ETHR_START + SZ_4K,
> +		.flags	= IORESOURCE_MEM,
> +	},
> +	[1] = {
> +		.start	= 0,
> +		.end	= 0,
> +		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
> +	},
> +};
> +
> +static struct platform_device ldp_smc911x_device = {
> +	.name		= "smc911x",
> +	.id		= -1,
> +	.num_resources	= ARRAY_SIZE(ldp_smc911x_resources),
> +	.resource	= ldp_smc911x_resources,
> +};
> +
>  static int ts_gpio;
>  
>  #ifdef CONFIG_RTC_DRV_TWL4030
> @@ -184,16 +204,47 @@ static struct spi_board_info ldp_spi_board_info[] __initdata = {
>  };
>  
>  static struct platform_device *ldp_devices[] __initdata = {
> +	&ldp_smc911x_device,
>  #ifdef CONFIG_RTC_DRV_TWL4030
>  	&ldp_twl4030rtc_device,
>  #endif
>  };
>  
> +static inline void __init ldp_init_smc911x(void)
> +{
> +	int eth_cs;
> +	unsigned long cs_mem_base;
> +	int eth_gpio = 0;
> +
> +	eth_cs = LDP_SMC911X_CS;
> +
> +	if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
> +		printk(KERN_ERR "Failed to request GPMC mem for smc911x\n");
> +		return;
> +	}
> +
> +	ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
> +	ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
> +	udelay(100);
> +
> +	eth_gpio = LDP_SMC911X_GPIO;
> +
> +	ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
> +
> +	if (omap_request_gpio(eth_gpio) < 0) {
> +		printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
> +			eth_gpio);
> +		return;
> +	}
> +	omap_set_gpio_direction(eth_gpio, 1);
> +}
> +
>  static void __init omap_ldp_init_irq(void)
>  {
>  	omap2_init_common_hw();
>  	omap_init_irq();
>  	omap_gpio_init();
> +	ldp_init_smc911x();
>  }
>  
>  static struct omap_uart_config ldp_uart_config __initdata = {
> diff --git a/include/asm-arm/arch-omap/board-ldp.h b/include/asm-arm/arch-omap/board-ldp.h
> index b227561..97c15d9 100644
> --- a/include/asm-arm/arch-omap/board-ldp.h
> +++ b/include/asm-arm/arch-omap/board-ldp.h
> @@ -29,6 +29,12 @@
>  #ifndef __ASM_ARCH_OMAP_LDP_H
>  #define __ASM_ARCH_OMAP_LDP_H
>  
> +#define DEBUG_BASE		0x08000000
> +
> +#define OMAP34XX_ETHR_START	DEBUG_BASE
> +#define LDP_SMC911X_CS		1
> +#define LDP_SMC911X_GPIO	152
> +
>  #define TWL4030_IRQNUM		INT_34XX_SYS_NIRQ
>  
>  #endif /* __ASM_ARCH_OMAP_LDP_H */

These redefines will conflict when compiling in support for multiple
boards. They should be passed in the platform_data.

Tony

  reply	other threads:[~2008-05-16 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15 14:42 [RESENDING PATCH 1/4] ARM: OMAP: Add register defines for TWL4030 vaux1 Nishant Kamat
2008-05-15 14:42 ` [RESENDING PATCH 2/4] ARM: OMAP: Add basic board support for OMAP LDP Nishant Kamat
2008-05-15 14:42   ` [RESENDING PATCH 3/4] ARM: OMAP: Add default kernel config " Nishant Kamat
2008-05-15 14:42     ` [RESENDING PATCH 4/4] ARM: OMAP: Add ethernet support " Nishant Kamat
2008-05-16 17:55       ` Tony Lindgren [this message]
2008-05-19  9:50         ` [RESENDING PATCH 4/4] ARM: OMAP: Add ethernet support for OMAPLDP Kamat, Nishant
2008-05-21 15:51           ` Tony Lindgren
2008-05-16 17:54     ` [RESENDING PATCH 3/4] ARM: OMAP: Add default kernel config for OMAP LDP Tony Lindgren
2008-05-16 17:53   ` [RESENDING PATCH 2/4] ARM: OMAP: Add basic board support " Tony Lindgren
2008-05-16 17:52 ` [RESENDING PATCH 1/4] ARM: OMAP: Add register defines for TWL4030 vaux1 Tony Lindgren

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=20080516175549.GW23002@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nskamat@ti.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