s5pv210-dm9000--git log -p

@@ -17,8 +17,22 @@
 
 /* VIC0: System, DMA, Timer */
 
-#define IRQ_EINT6               S5P_IRQ_VIC0(6)
-#define IRQ_EINT13              S5P_IRQ_VIC0(13)
+#define IRQ_EINT0              S5P_IRQ_VIC0(0)
+#define IRQ_EINT1              S5P_IRQ_VIC0(1)
+#define IRQ_EINT2              S5P_IRQ_VIC0(2)
+#define IRQ_EINT3              S5P_IRQ_VIC0(3)
+#define IRQ_EINT4              S5P_IRQ_VIC0(4)
+#define IRQ_EINT5              S5P_IRQ_VIC0(5)
+#define IRQ_EINT6              S5P_IRQ_VIC0(6)
+#define IRQ_EINT7              S5P_IRQ_VIC0(7)
+#define IRQ_EINT8              S5P_IRQ_VIC0(8)
+#define IRQ_EINT9              S5P_IRQ_VIC0(9)
+#define IRQ_EINT10             S5P_IRQ_VIC0(10)
+#define IRQ_EINT11             S5P_IRQ_VIC0(11)
+#define IRQ_EINT12             S5P_IRQ_VIC0(12)
+#define IRQ_EINT13             S5P_IRQ_VIC0(13)
+#define IRQ_EINT14             S5P_IRQ_VIC0(14)
+#define IRQ_EINT15             S5P_IRQ_VIC0(15)
 #define IRQ_EINT16_31          S5P_IRQ_VIC0(16)
 #define IRQ_BATF               S5P_IRQ_VIC0(17)
 #define IRQ_MDMA               S5P_IRQ_VIC0(18)
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index ee81e4b..83e08d7 100755
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -15,7 +15,9 @@
 
 #include <plat/map-base.h>
 #include <plat/map-s5p.h>
-
+//#define S5PV210_PA_DM9000       (0xA8000000) jhk add dm9000
+#define S5PV210_PA_DM9000      (0x88000300)
+#define S5P_PA_DM9000           S5PV210_PA_DM9000
 #if defined(CONFIG_MACH_SMDKV210) || defined(CONFIG_MACH_MANGO210)

 #define S5PV210_PA_SDRAM               0x20000000
 #else
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 960c4ba..5c158be 100755
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -1121,7 +1121,30 @@ static void mango210_board_cfg_gpio(void)
         }
 
 }
+#ifdef CONFIG_DM9000
+static void __init smdkc110_dm9000_set(void)
+{
+       unsigned int tmp;
+
+       tmp = ((0<<28)|(3<<24)|(7<<16)|(1<<12)|(3<<8)|(6<<4)|(0<<0));
+       __raw_writel(tmp, (S5P_SROM_BW+0x08));//Bc1
+       
+       tmp = __raw_readl(S5P_SROM_BW);
+       tmp &= ~(0xf << 4);
+       
 
+       tmp |= (0x1 << 4);
+       tmp |= (0x2 << 4);
+
+       __raw_writel(tmp, S5P_SROM_BW);
+
+       tmp = __raw_readl(S5PV210_MP01CON);
+       tmp &= ~(0xf << 4);
+       tmp |= (2 << 4);
+
+       __raw_writel(tmp, S5PV210_MP01CON);
+}
+#endif
 

static void __init mango210_sound_init(void)
 {
@@ -1167,6 +1190,9 @@ static struct platform_device *mango210_devices[] __initdata = {
        &s3c_device_i2c0,
        &s3c_device_i2c1,
        &s3c_device_i2c2,
+#ifdef CONFIG_DM9000
+       &s5p_device_dm9000,
+#endif
 //#ifdef CONFIG_SND_S3C_SOC_AC97
        &s5pv210_device_ac97,
 //#endif
@@ -1754,7 +1780,9 @@ static void __init mango210_machine_init(void)
 #ifdef CONFIG_ANDROID_PMEM
         android_pmem_set_platdata();
 #endif
-
+#ifdef CONFIG_DM9000
+       smdkc110_dm9000_set();
+#endif
        mango210_sound_init();
 
        s3c24xx_ts_set_platdata(&s3c_ts_platform);
diff --git a/arch/arm/plat-s5p/devs.c b/arch/arm/plat-s5p/devs.c
index 622a606..e06f5ac 100755
--- a/arch/arm/plat-s5p/devs.c
+++ b/arch/arm/plat-s5p/devs.c
@@ -11,6 +11,7 @@
 */
 
 #include <linux/gpio.h>
+#include <linux/dm9000.h>
 #include <linux/platform_device.h>
 
 #include <mach/irqs.h>
@@ -22,6 +23,68 @@
 #include <plat/media.h>
 #include <plat/jpeg.h>

@@ -22,6 +23,68 @@
 #include <plat/media.h>
 #include <plat/jpeg.h>
 #include <mach/media.h>
+/* DM9000 registrations */
+#ifdef CONFIG_DM9000
+static struct resource s5p_dm9000_resources[] = {
+       [0] = {
+               .start = S5P_PA_DM9000,
+               .end   = S5P_PA_DM9000,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+#if defined(CONFIG_DM9000_16BIT)
+               .start = S5P_PA_DM9000 + 4,
+               .end   = S5P_PA_DM9000 + 4,
+               .flags = IORESOURCE_MEM,
+#else
+               .start = S5P_PA_DM9000 + 1,
+               .end   = S5P_PA_DM9000 + 1,
+               .flags = IORESOURCE_MEM,
+#endif
+       },
+       [2] = {
+               .start = IRQ_EINT9,
+               .end   = IRQ_EINT9,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       }
+};
+
+static struct dm9000_plat_data s5p_dm9000_platdata = {
+#if defined(CONFIG_DM9000_16BIT)
+       .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM,
+#else
+       .flags = DM9000_PLATF_8BITONLY | DM9000_PLATF_NO_EEPROM,
+#endif
+       .dev_addr = {0x00,0x09,0xc0,0xff,0xec,0x48},
+};
+
+struct platform_device s5p_device_dm9000 = {
+       .name           = "dm9000",
+       .id             =  0,
+       .dev            = {
+               .platform_data = &s5p_dm9000_platdata,
+       }
+};
+
+/* need to get the ether addr from armboot */
+static int __init ethaddr_setup(char *line)
+{
+       char *ep;
+       int i;
+
+       /* there should really be routines to do this stuff */
+       for (i = 0; i < 6; i++) {
+               s5p_dm9000_platdata.dev_addr[i] = line ? simple_strtoul(line, &ep, 16) : 0;
+               if (line)
+                       line = (*ep) ? ep+1 : ep;
+       }
+       printk("User MAC address: %pM\n", s5p_dm9000_platdata.dev_addr);
+       return 0;
+}
+__setup("ethaddr=", ethaddr_setup);
+#endif
 #if defined(CONFIG_VIDEO_FIMC) || defined(CONFIG_CPU_FREQ) /* TODO: use existing dev */
 static struct resource s3c_fimc0_resource[] = {
        [0] = {
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 47fb437..332ef86 100755
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -77,6 +77,7 @@ extern struct platform_device s3c_device_cfcon;
 
 extern struct platform_device s3c_device_spi0;
 extern struct platform_device s3c_device_spi1;
+extern struct platform_device s5p_device_dm9000;
 
 extern struct platform_device s5pc100_device_spi0;
 extern struct platform_device s5pc100_device_spi1;
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 906ef8f..f179436 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -985,6 +985,13 @@ config DM9000
          To compile this driver as a module, choose M here.  The module
          will be called dm9000.
 
+config DM9000_16BIT
+       bool "DM9000 16-bit"
+       depends on DM9000
+       default n
+       help
+         Support DM9000 ethernet controller with 16bit data bus
+
 config DM9000_DEBUGLEVEL
        int "DM9000 maximum debug level"
        depends on DM9000


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值