All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support
@ 2010-11-29  2:21 Kuninori Morimoto
  2010-11-29  4:38 ` Magnus Damm
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2010-11-29  2:21 UTC (permalink / raw)
  To: linux-sh

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-mackerel.c |   34 +++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index b8df709..e2def7e 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -32,6 +32,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
+#include <linux/smsc911x.h>
 
 #include <mach/common.h>
 #include <mach/sh7372.h>
@@ -109,8 +110,37 @@ static struct platform_device nor_flash_device = {
 	.resource	= nor_flash_resources,
 };
 
+/* SMSC */
+static struct resource smc911x_resources[] = {
+	{
+		.start	= 0x14000000,
+		.end	= 0x16000000 - 1,
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= evt2irq(0x02c0) /* IRQ6A */,
+		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
+	},
+};
+
+static struct smsc911x_platform_config smsc911x_info = {
+	.flags		= SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS,
+	.irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+	.irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
+};
+
+static struct platform_device smc911x_device = {
+	.name           = "smsc911x",
+	.id             = -1,
+	.num_resources  = ARRAY_SIZE(smc911x_resources),
+	.resource       = smc911x_resources,
+	.dev            = {
+		.platform_data = &smsc911x_info,
+	},
+};
+
 static struct platform_device *mackerel_devices[] __initdata = {
 	&nor_flash_device,
+	&smc911x_device,
 };
 
 static struct map_desc mackerel_io_desc[] __initdata = {
@@ -142,6 +172,10 @@ static void __init mackerel_init(void)
 	gpio_request(GPIO_FN_SCIFA0_TXD, NULL);
 	gpio_request(GPIO_FN_SCIFA0_RXD, NULL);
 
+	/* enable SMSC911X */
+	gpio_request(GPIO_FN_CS5A,	NULL);
+	gpio_request(GPIO_FN_IRQ6_39,	NULL);
+
 	sh7372_add_standard_devices();
 
 	platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support
  2010-11-29  2:21 [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support Kuninori Morimoto
@ 2010-11-29  4:38 ` Magnus Damm
  2010-11-29  6:16 ` Kuninori Morimoto
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Magnus Damm @ 2010-11-29  4:38 UTC (permalink / raw)
  To: linux-sh

Hi Morimoto-san,

Thanks for your patch.

On Mon, Nov 29, 2010 at 11:21 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> +static struct smsc911x_platform_config smsc911x_info = {
> +       .flags          = SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS,

There is no EEPROM on this board? I guess so since you use
SMSC911X_SAVE_MAC_ADDRESS.

I suspect that this code is not going to work with romImage since it
depends on the boot loader for mac address.

> @@ -142,6 +172,10 @@ static void __init mackerel_init(void)
>        gpio_request(GPIO_FN_SCIFA0_TXD, NULL);
>        gpio_request(GPIO_FN_SCIFA0_RXD, NULL);
>
> +       /* enable SMSC911X */
> +       gpio_request(GPIO_FN_CS5A,      NULL);
> +       gpio_request(GPIO_FN_IRQ6_39,   NULL);
> +

If you have time, please add code to setup optimized memory
read/writing timings for the CS memory window here.

Thanks,

/ magnus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support
  2010-11-29  2:21 [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support Kuninori Morimoto
  2010-11-29  4:38 ` Magnus Damm
@ 2010-11-29  6:16 ` Kuninori Morimoto
  2010-11-29  7:42 ` Magnus Damm
  2010-11-29 10:56 ` Kuninori Morimoto
  3 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2010-11-29  6:16 UTC (permalink / raw)
  To: linux-sh


Hi Magnus

Thank you for your check

> There is no EEPROM on this board? I guess so since you use
> SMSC911X_SAVE_MAC_ADDRESS.
> 
> I suspect that this code is not going to work with romImage since it
> depends on the boot loader for mac address.

Yes. mackerel doesn't have EEPROM for SMSC

> > +       gpio_request(GPIO_FN_CS5A,      NULL);
> > +       gpio_request(GPIO_FN_IRQ6_39,   NULL);
> > +
> 
> If you have time, please add code to setup optimized memory
> read/writing timings for the CS memory window here.

sorry.
What does this "optimized timings" mean ?


Best regards
--
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support
  2010-11-29  2:21 [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support Kuninori Morimoto
  2010-11-29  4:38 ` Magnus Damm
  2010-11-29  6:16 ` Kuninori Morimoto
@ 2010-11-29  7:42 ` Magnus Damm
  2010-11-29 10:56 ` Kuninori Morimoto
  3 siblings, 0 replies; 5+ messages in thread
From: Magnus Damm @ 2010-11-29  7:42 UTC (permalink / raw)
  To: linux-sh

Hi Morimoto-san,

On Mon, Nov 29, 2010 at 3:16 PM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> Thank you for your check
>
>> There is no EEPROM on this board? I guess so since you use
>> SMSC911X_SAVE_MAC_ADDRESS.
>>
>> I suspect that this code is not going to work with romImage since it
>> depends on the boot loader for mac address.
>
> Yes. mackerel doesn't have EEPROM for SMSC

Is it possible that we can extend the kernel to located the MAC address somehow?

>> > +       gpio_request(GPIO_FN_CS5A,      NULL);
>> > +       gpio_request(GPIO_FN_IRQ6_39,   NULL);
>> > +
>>
>> If you have time, please add code to setup optimized memory
>> read/writing timings for the CS memory window here.
>
> sorry.
> What does this "optimized timings" mean ?

The memory window signal timing values associated with the CS signal
can be programmed using the BSC. The timings should be optimized so we
get decent performance. On some boards we got transmission/reception
errors with the slowest settings, and usually the U-boot settings are
far from optimal.

Also, if we use romImage we need to setup the BSC settings for the CS
signal anyway.

Look at these two linux-2.6 git commits as examples:

a30c89ad41099f58922e0941e346e7c4371655b9
724cfb944007b7f8d346523a7810b53a35921bc5

Please check to see if you can optimize the throughput.

Thanks,

/ magnus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support
  2010-11-29  2:21 [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2010-11-29  7:42 ` Magnus Damm
@ 2010-11-29 10:56 ` Kuninori Morimoto
  3 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2010-11-29 10:56 UTC (permalink / raw)
  To: linux-sh


Hi Magnus

Thank you for your advice

> > Yes. mackerel doesn't have EEPROM for SMSC
> 
> Is it possible that we can extend the kernel to located the MAC address somehow?

Hmm...
I think it is sore spot of this board.
Can we use flash area ?

> The memory window signal timing values associated with the CS signal
> can be programmed using the BSC. The timings should be optimized so we
> get decent performance. On some boards we got transmission/reception
> errors with the slowest settings, and usually the U-boot settings are
> far from optimal.
> 
> Also, if we use romImage we need to setup the BSC settings for the CS
> signal anyway.
> 
> Look at these two linux-2.6 git commits as examples:
> 
> a30c89ad41099f58922e0941e346e7c4371655b9
> 724cfb944007b7f8d346523a7810b53a35921bc5
> 
> Please check to see if you can optimize the throughput.

Thank you I understand.
I don't know current BSC is optimized or not.
But for now, it seems not so bad.
Of course I will care it continuously.
Thanks

Best regards
--
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-29 10:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-29  2:21 [PATCH 2/5] ARM: mach-shmobile: mackerel: Add SMSC support Kuninori Morimoto
2010-11-29  4:38 ` Magnus Damm
2010-11-29  6:16 ` Kuninori Morimoto
2010-11-29  7:42 ` Magnus Damm
2010-11-29 10:56 ` Kuninori Morimoto

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.