Add dm9000 network support for OK6410 board.
Subsystems (3)
PATCH 1/1 Add dm9000 network support for OK6410 board.
--- arch/arm/mach-s3c64xx/mach-smdk6410.c | 1 + arch/arm/plat-samsung/devs.c | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-)
arch/arm/mach-s3c64xx/mach-smdk6410.c +1 -0
@@ -276,6 +276,7 @@ static struct platform_device *smdk6410_devices[] __initdata = { &s3c_device_fb, &s3c_device_ohci, &s3c_device_usb_hsotg, + &s3c_device_dm9000, &samsung_asoc_dma, &s3c64xx_device_iisv4, &samsung_device_keypad,
arch/arm/plat-samsung/devs.c +40 -0
@@ -29,6 +29,7 @@#include <linux/mtd/partitions.h> #include <linux/mmc/host.h> #include <linux/ioport.h> +#include <linux/dm9000.h> #include <asm/irq.h> #include <asm/pmu.h>
@@ -1401,6 +1402,45 @@ void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd) }#endif /* CONFIG_S5P_DEV_USB_EHCI */ +/* Ethernet */ +#ifdef CONFIG_DM9000 +#define S3C64XX_PA_DM9000 (0x18000000) +#define S3C64XX_SZ_DM9000 SZ_1M +#define S3C64XX_VA_DM9000 S3C_ADDR(0x03b00300) + +static struct resource dm9000_resources[] = { + [0 ] = { + .start =S3C64XX_PA_DM9000 , + .end =S3C64XX_PA_DM9000 +3 , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =S3C64XX_PA_DM9000 +4 , + .end =S3C64XX_PA_DM9000 +S3C64XX_SZ_DM9000 -1 , + .flags =IORESOURCE_MEM , + }, + [2 ] = { + .start =IRQ_EINT (7 ), + .end =IRQ_EINT (7 ), + .flags =IORESOURCE_IRQ |IRQF_TRIGGER_HIGH , + }, +}; + +static struct dm9000_plat_data dm9000_setup = { + .flags =DM9000_PLATF_16BITONLY , + .dev_addr = {0x08 ,0x90 ,0x00 ,0xa0 ,0x90 ,0x90 }, +}; + +static struct platform_device s3c_device_dm9000 = { + .name ="dm9000" , + .id =0 , + .num_resources =ARRAY_SIZE (dm9000_resources), + .resource = dm9000_resources, + .dev = { + .platform_data = &dm9000_setup, + } +}; +#endif /*#ifdef CONFIG_DM9000*/ /* USB HSOTG */ #ifdef CONFIG_S3C_DEV_USB_HSOTG
Signature · 1 line
1.7.7.rc0.235.g8d714
Quoted 5 lines · peiyong feng
Signed-off-by peiyong feng <[email protected]>---
?arch/arm/mach-s3c64xx/mach-smdk6410.c | ? ?1 + ?arch/arm/plat-samsung/devs.c ? ? ? ? ?| ? 40 +++++++++++++++++++++++++++++++++ ?2 files changed, 41 insertions(+), 0 deletions(-)
If the change is intended for OK6410 board, any reason for modifying mach-smdk6410.c board file?
Quoted 29 lines
arch/arm/mach-s3c64xx/mach-smdk6410.c +1
-0@@ -276,6 +276,7 @@ static struct platform_device *smdk6410_devices[] __initdata = { ? ? ? ?&s3c_device_fb, ? ? ? ?&s3c_device_ohci, ? ? ? ?&s3c_device_usb_hsotg, + ? ? ? &s3c_device_dm9000, ? ? ? ?&samsung_asoc_dma, ? ? ? ?&s3c64xx_device_iisv4, ? ? ? ?&samsung_device_keypad,arch/arm/plat-samsung/devs.c +0
-0@@ -29,6 +29,7 @@?#include <
linux/mtd/partitions.h>
?#include <linux/mmc/host.h>
?#include <linux/ioport.h>
+#include <linux/dm9000.h>?#include <
asm/irq.h>
?#include <asm/pmu.h>arch/arm/plat-samsung/devs.c +0
-0@@ -1401,6 +1402,45 @@ void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd) ?}?#endif /*
CONFIG_S5P_DEV_USB_EHCI*/
arch/arm/plat-samsung/devs.c
Quoted 5 lines
arch/arm/plat-samsung/devs.c +5
-0+/* Ethernet */ +#ifdef CONFIG_DM9000 +#define S3C64XX_PA_DM9000 ? ? ?(0x18000000) +#define S3C64XX_SZ_DM9000 ? ? ?SZ_1M +#define S3C64XX_VA_DM9000 ? ? ?S3C_ADDR(0x03b00300)
There could be other boards based on other samsung soc's which would be using dm9000. So arch/arm/plat-samsung/devs.c might not be correct place for these additions. And, there is S3C64XX_PA_XM0CSN0 in mach-s3c64xx/include/mach/map.h which should be reused instead of these new macros.
Please refer to other board files in arch/arm/mach-s3c64xx for reference on adding dm9000 support for OK6410 board.
Regards,
Thomas.
Quoted 46 lines
arch/arm/plat-samsung/devs.c +34
-0+ +static struct resource dm9000_resources[] = { + ? ? ? [0] = { + ? ? ? ? ? ? ? .start ? ? ? ? ?= S3C64XX_PA_DM9000, + ? ? ? ? ? ? ? .end ? ? ? ? ? ?= S3C64XX_PA_DM9000 + 3, + ? ? ? ? ? ? ? .flags ? ? ? ? ?= IORESOURCE_MEM, + ? ? ? }, + ? ? ? [1] = { + ? ? ? ? ? ? ? .start ? ? ? ? ?= S3C64XX_PA_DM9000 + 4, + ? ? ? ? ? ? ? .end ? ? ? ? ? ?= S3C64XX_PA_DM9000 + S3C64XX_SZ_DM9000 - 1, + ? ? ? ? ? ? ? .flags ? ? ? ? ?= IORESOURCE_MEM, + ? ? ? }, + ? ? ? [2] = { + ? ? ? ? ? ? ? .start ? ? ? ? ?= IRQ_EINT(7), + ? ? ? ? ? ? ? .end ? ? ? ? ? ?= IRQ_EINT(7), + ? ? ? ? ? ? ? .flags ? ? ? ? ?= IORESOURCE_IRQ | IRQF_TRIGGER_HIGH, + ? ? ? }, +}; + +static struct dm9000_plat_data dm9000_setup = { + ? ? ? .flags ? ? ? ? ? ? ? ? ?= DM9000_PLATF_16BITONLY, + ? ? ? .dev_addr ? ? ? ? ? ? ? = { 0x08, 0x90, 0x00, 0xa0, 0x90, 0x90 }, +}; + +static struct platform_device s3c_device_dm9000 = { + ? ? ? .name ? ? ? ? ? ? ? ? ? = "dm9000", + ? ? ? .id ? ? ? ? ? ? ? ? ? ? ? ? ? ? = 0, + ? ? ? .num_resources ?= ARRAY_SIZE(dm9000_resources), + ? ? ? .resource ? ? ? ? ? ? ? = dm9000_resources, + ? ? ? .dev ? ? ? ? ? ? ? ? ? ?= { + ? ? ? ? ? ? ? .platform_data = &dm9000_setup, + ? ? ? } +}; +#endif /*#ifdef CONFIG_DM9000*/ ?/* USB HSOTG */
?#ifdef
CONFIG_S3C_DEV_USB_HSOTG
--
1.7.7.rc0.235.g8d714--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html Please read the FAQ at ?http://www.tux.org/lkml/
Quoted 1 line · Peiyong Feng
Hi Peiyong,
Thanks for your submitting and replying.
But you need to make sure your e-mail uses text-typed instead of html before replying.
And there are comments below.
Quoted 2 lines
Well, The OK6410 board is based on smdk6410 board.
And there many other boards that also are based on smdk6410 like mini6410
board.
Quoted 3 lines
The reasons why I modified smdk6410 board file are as follows:? A. Almost all the devices on OK6410 is supported in smdk6410, and the
device drivers of smdk6410 can work well in OK6410.
Quoted 1 line
Okay, you mean, just your OK6410 can work with smdk6410.
Quoted 1 line
B. If we just make other board file like mini6410 which is also based on
smdk6410, there maybe too many files that are as the same of smdk6410.
Quoted 1 line
Okay, you mean, we don't need duplicated codes.
Right, but how do you think that if the dm9000 or something cannot be used on smdk6410?
Nevertheless, we _really_ need to add it for other board not smdk6410?
Actually, there are codes for SMSC Lan9115 at mach-smdk6410.c......
If you want to use mach-smdk6410.c on your ok6410, well, let us think the way.
Quoted 2 lines
2011/11/11 Thomas Abraham <[email protected]>
On 11 November 2011 15:44, peiyong feng <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
Signed-off-by peiyong feng <[email protected]>---
?arch/arm/mach-s3c64xx/mach-smdk6410.c | ? ?1 +
?arch/arm/plat-samsung/devs.c ? ? ? ? ?| ? 40
+++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 1 line
?2 files changed, 41 insertions(+), 0 deletions(-)
If the change is intended for OK6410 board, any reason for modifying
mach-smdk6410.cboard file?Review
Quoted 2 lines
(quoted diff) +0
-0
b/arch/arm/mach-s3c64xx/mach-smdk6410.c
Quoted 4 lines
arch/arm/mach-s3c64xx/mach-smdk6410.c static struct platform_device *smdk6410_devices[]
Quoted 4 lines
index 8bc8edd..71e817a 100644
arch/arm/mach-s3c64xx/mach-smdk6410.c +0
-0@@ -276,6 +276,7 @@ static struct platform_device *smdk6410_devices[]
__initdata = {
Quoted 17 lines
Quoted 17 lines
arch/arm/mach-s3c64xx/mach-smdk6410.c +1
-0? ? ? ?&s3c_device_fb, ? ? ? ?&s3c_device_ohci, ? ? ? ?&s3c_device_usb_hsotg, + ? ? ? &s3c_device_dm9000, ? ? ? ?&samsung_asoc_dma, ? ? ? ?&s3c64xx_device_iisv4, ? ? ? ?&samsung_device_keypad,arch/arm/plat-samsung/devs.c +0
-0@@ -29,6 +29,7 @@?#include <
linux/mtd/partitions.h>
?#include <linux/mmc/host.h>
?#include <linux/ioport.h>
+#include <linux/dm9000.h>
Quoted 3 lines
arch/arm/plat-samsung/devs.c void __init s5p_ehci_set_platdata(struct
Quoted 3 lines
?#include <
asm/irq.h>
?#include <asm/pmu.h>arch/arm/plat-samsung/devs.c +0
-0@@ -1401,6 +1402,45 @@ void __init s5p_ehci_set_platdata(struct
s5p_ehci_platdata *pd)
Quoted 14 lines
arch/arm/plat-samsung/devs.c
Quoted 8 lines
arch/arm/plat-samsung/devs.c +0
-0?}?#endif /*
CONFIG_S5P_DEV_USB_EHCI*/arch/arm/plat-samsung/devs.c +5
-0+/* Ethernet */ +#ifdef CONFIG_DM9000 +#define S3C64XX_PA_DM9000 ? ? ?(0x18000000) +#define S3C64XX_SZ_DM9000 ? ? ?SZ_1M +#define S3C64XX_VA_DM9000 ? ? ?S3C_ADDR(0x03b00300)There could be other boards based on other samsung soc's which would be using dm9000. So
arch/arm/plat-samsung/devs.cmight not be correct place for these additions. And, there isS3C64XX_PA_XM0CSN0inmach-s3c64xx/include/mach/map.hwhich should be reused instead of these new macros.
Yes right.
Peiyong, you need to think that your codes affect others or not before submitting.
Quoted 11 lines
Please refer to other board files in
arch/arm/mach-s3c64xxfor reference on adding dm9000 support for OK6410 board.Regards,
Thomas.arch/arm/plat-samsung/devs.c
Quoted 5 lines
arch/arm/plat-samsung/devs.c +5
-0+ +static struct resource dm9000_resources[] = { + ? ? ? [0] = { + ? ? ? ? ? ? ? .start ? ? ? ? ?= S3C64XX_PA_DM9000, + ? ? ? ? ? ? ? .end ? ? ? ? ? ?= S3C64XX_PA_DM9000 + 3,
What is '3'?
Quoted 1 line
Quoted 1 line
+ ? ? ? ? ? ? ? .flags ? ? ? ? ?=
IORESOURCE_MEM,
And you can use DEFINE_RES_MEM macro here.
(snip)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
HI Kukjin,
Thanks a lot for your comments and reply.
2011/11/15 Kukjin Kim <[email protected]>:
Quoted 12 lines
Quoted 1 line · Peiyong Feng
Hi Peiyong,
Thanks for your submitting and replying.
But you need to make sure your e-mail uses text-typed instead of html before replying.And there are comments below.
Quoted 2 lines
Well, The OK6410 board is based on smdk6410 board.
And there many other boards that also are based on smdk6410 like mini6410
Quoted 8 lines
board.
Quoted 3 lines
The reasons why I modified smdk6410 board file are as follows:
A. Almost all the devices on OK6410 is supported in smdk6410, and thedevice drivers of smdk6410 can work well in OK6410.
Quoted 1 line
Okay, you mean, just your OK6410 can work with smdk6410.
As far as I know, there are some boards based on smdk6410 with the suffix 6410 like OK6410, mini6410, tiny6410, etc.
The difference between them is very small.
I give two examples:
1. The DM9000 network cards irq on OK6410 is IRQ_EINT(7) while the SMSC911x network cards irq on smdk6410 is IRQ_EINT(10), and their CS is the same 0x18000000.
2. Another example is the LCD. As we all know, the kernel has implemented a very good framework for framebuffer devices. different LCD device can work with just the right arguments like left_margin, right_margin, hsync_len, vsync_len, xres, yres, etc. And their LCD controller is the same.
Quoted 5 lines
Quoted 1 line
B. If we just make other board file like mini6410 which is also based on
smdk6410, there maybe too many files that are as the same of smdk6410.
Quoted 1 line
Okay, you mean, we don't need duplicated codes.
Quoted 8 lines
Right, but how do you think that if the dm9000 or something cannot be used on smdk6410?
Nevertheless, we _really_ need to add it for other board not smdk6410?Actually, there are codes for SMSC Lan9115 at
mach-smdk6410.c......If you want to use
mach-smdk6410.con your ok6410, well, let us think the way.
Well, this is the point. How can we deal with the various boards with the little difference and make them work with the kernel.
Quoted 90 lines
Quoted 3 lines
2011/11/11 Thomas Abraham <[email protected]>
On 11 November 2011 15:44, peiyong feng <[email protected]>Quoted 4 lines · wrote:
Quoted 4 lines
Signed-off-by peiyong feng <[email protected]>---
?arch/arm/mach-s3c64xx/mach-smdk6410.c | ? ?1 +
?arch/arm/plat-samsung/devs.c ? ? ? ? ?| ? 40+++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 1 line
?2 files changed, 41 insertions(+), 0 deletions(-)
If the change is intended for OK6410 board, any reason for modifying
mach-smdk6410.cboard file?Review
Quoted 2 lines
(quoted diff) +0
-0
b/arch/arm/mach-s3c64xx/mach-smdk6410.cQuoted 4 lines
arch/arm/mach-s3c64xx/mach-smdk6410.c static struct platform_device *smdk6410_devices[]
Quoted 4 lines
index 8bc8edd..71e817a 100644
arch/arm/mach-s3c64xx/mach-smdk6410.c +0
-0@@ -276,6 +276,7 @@ static struct platform_device *smdk6410_devices[]
__initdata= {Quoted 17 lines
Quoted 17 lines
arch/arm/mach-s3c64xx/mach-smdk6410.c +1
-0? ? ? ?&s3c_device_fb, ? ? ? ?&s3c_device_ohci, ? ? ? ?&s3c_device_usb_hsotg, + ? ? ? &s3c_device_dm9000, ? ? ? ?&samsung_asoc_dma, ? ? ? ?&s3c64xx_device_iisv4, ? ? ? ?&samsung_device_keypad,arch/arm/plat-samsung/devs.c +0
-0@@ -29,6 +29,7 @@?#include <
linux/mtd/partitions.h>
?#include <linux/mmc/host.h>
?#include <linux/ioport.h>
+#include <linux/dm9000.h>Quoted 3 lines
arch/arm/plat-samsung/devs.c void __init s5p_ehci_set_platdata(struct
Quoted 3 lines
?#include <
asm/irq.h>
?#include <asm/pmu.h>arch/arm/plat-samsung/devs.c +0
-0@@ -1401,6 +1402,45 @@ void __init s5p_ehci_set_platdata(struct
s5p_ehci_platdata*pd)Quoted 14 lines
arch/arm/plat-samsung/devs.c
Quoted 8 lines
arch/arm/plat-samsung/devs.c +0
-0?}?#endif /*
CONFIG_S5P_DEV_USB_EHCI*/arch/arm/plat-samsung/devs.c +5
-0+/* Ethernet */ +#ifdef CONFIG_DM9000 +#define S3C64XX_PA_DM9000 ? ? ?(0x18000000) +#define S3C64XX_SZ_DM9000 ? ? ?SZ_1M +#define S3C64XX_VA_DM9000 ? ? ?S3C_ADDR(0x03b00300)There could be other boards based on other samsung soc's which would be using dm9000. So
arch/arm/plat-samsung/devs.cmight not be correct place for these additions. And, there isS3C64XX_PA_XM0CSN0inmach-s3c64xx/include/mach/map.hwhich should be reused instead of these new macros.Yes right.
Peiyong, you need to think that your codes affect others or not before submitting.
Quoted 11 lines
Please refer to other board files in
arch/arm/mach-s3c64xxfor reference on adding dm9000 support for OK6410 board.Regards,
Thomas.arch/arm/plat-samsung/devs.c
Quoted 5 lines
arch/arm/plat-samsung/devs.c +5
-0+ +static struct resource dm9000_resources[] = { + ? ? ? [0] = { + ? ? ? ? ? ? ? .start ? ? ? ? ?= S3C64XX_PA_DM9000, + ? ? ? ? ? ? ? .end ? ? ? ? ? ?= S3C64XX_PA_DM9000 + 3,What is '3'?
Quoted 1 line
Quoted 1 line
+ ? ? ? ? ? ? ? .flags ? ? ? ? ?=
IORESOURCE_MEM,And you can use
DEFINE_RES_MEMmacro here.(snip)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
Quoted 22 lines · Peiyong Feng
HI Kukjin,
Thanks a lot for your comments and reply.
2011/11/15 Kukjin Kim <[email protected]>:
Quoted 16 lines
Quoted 1 line · Peiyong Feng
Hi Peiyong,
Thanks for your submitting and replying.
But you need to make sure your e-mail uses text-typed instead of html before replying.And there are comments below.
Quoted 2 lines
Well, The OK6410 board is based on smdk6410 board.
And there many other boards that also are based on smdk6410 like mini6410board.
Quoted 3 lines
The reasons why I modified smdk6410 board file are as follows:
A. Almost all the devices on OK6410 is supported in smdk6410, and the
Quoted 7 lines
Quoted 4 lines
device drivers of smdk6410 can work well in OK6410.
Quoted 1 line
Okay, you mean, just your OK6410 can work with smdk6410.
As far as I know, there are some boards based on smdk6410 with the suffix 6410 like OK6410, mini6410, tiny6410, etc.
The ?difference between them is very small.
smdk6410 and ok6410 boards use (based on) Samsung's s3c6410 processor. Boards based on s3c6410 processor should reuse existing upstream support available for s3c6410. But, the boards themselves are different. Both smdk6410 and ok6410 have a common s3c6410, but the peripherals on the board are all different. So, the statement "there are some boards based on smdk6410" is not right. The correct one would be "there are some boards based on s3c6410".
Quoted 5 lines
I give two examples:
1. The DM9000 network cards irq ?on OK6410 ?is IRQ_EINT(7) ? ?while the SMSC911x network cards irq on smdk6410 is ?IRQ_EINT(10), and their CS is the same0x18000000.
True, but smdk6410 does not have a DM9000 and adding DM9000 device information in smdk6410 board file is not the right thing.
Quoted 15 lines
2. Another example is the LCD. As we all know, the kernel has implemented a very good framework for framebuffer devices. different LCD device can work with just the right arguments like
left_margin,right_margin,hsync_len,vsync_len, xres, yres, etc. And their LCD controller is the same.Quoted 9 lines
Quoted 1 line
B. If we just make other board file like mini6410 which is also based on
smdk6410, there maybe too many files that are as the same of smdk6410.
Quoted 1 line
Okay, you mean, we don't need duplicated codes.
Right, but how do you think that if the dm9000 or something cannot be used on smdk6410?
Nevertheless, we _really_ need to add it for other board not smdk6410?
Quoted 7 lines
Quoted 4 lines
Actually, there are codes for SMSC Lan9115 at
mach-smdk6410.c......If you want to use
mach-smdk6410.con your ok6410, well, let us think the way.Well, this is the point. How can we deal with the various boards with the little difference and make them work with the kernel.
What is needed is a separate board file ok6410 board. All the s3c6410 related drivers and machine code would be reused, but board specific data would be contained in the ok6410 board file. You could have a look at all the arch/arm/mach-s3c64xx/mach-xxx.c files to know how different boards reuse existing s3c6410 mainline support.
Thanks,
Thomas.
[...]