基于tiny4412的Linux内核移植 -- DM9621NP网卡驱动移植(四)

转自:http://www.07net01.com/2016/01/1177282.html


作者信息

作者: 彭东林

邮箱:[email protected]

QQ:405728433

平台简介

开发板:tiny4412ADK + S700 + 4GB flash

要移植的内核版本:linux-4.4.0 (支持device tree)

u-boot版本:友善之臂自带的 U-Boot 2010.12 (为支持uImage启动,做了少许改动)

busybox版本:busybox 1.25

网卡芯片:DM9621NP

交叉编译工具链: arm-none-linux-gnueabi-gcc

      (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29))

概述

    tiny4412的网卡部分跟我之前的tq2440差别很大,在tq2440中使用网卡芯片是DM9000,使用的是内存接口,移植起来很容易,但是到了tiny4412就不一样了,tiny4412使用的网卡芯片是DM9621,它是usb接口的,而且并没有直接连接到exynos4412上,中间通过一个hub芯片usb4640,然后usb4640通过HSIC接口(XhsicSTROBE0和XhsicDATA0)连接到exynos4412上,下面是一些参考资料:

  • HSI介绍

         http://www.cnblogs.com/pengdonglin137/p/5151331.html

         http://www.cnblogs.com/pengdonglin137/p/5151006.html

  • exynos4412手册的第31章USB 2.0 Host Controller

基于tiny4412的Linux内核移植 -- DM9621NP网卡驱动移植(四)_第1张图片

 

基于tiny4412的Linux内核移植 -- DM9621NP网卡驱动移植(四)_第2张图片

 

  • 原理图

基于tiny4412的Linux内核移植 -- DM9621NP网卡驱动移植(四)_第3张图片

上面这张图就是tiny4412板子上的USB连接图,我们重点关注DM9621和USB4640。

移植

    通过阅读usb4640的芯片手册,同时结合tiny4412的原理图发现,usb4640的部分功能在tiny4412上是没有用的,没有外接的SPI Flash和I2C设备,大部分引脚都悬空了,除了数据传输的端口外,我们可以控制的就只剩下USB4640的复位引脚了,并且板子起来后,我用万用表测量了usb4640的复位引脚的电压,发现是0.7v左右,说明usb4640一直处于复位状态,最终针对usb4640我们要做的就是只是板子起来后,将控制usb4640复位的引脚电平拉高即可,当然需要在设备树中添加usb4640用到的GPIO资源。

    通过对比tiny4412自带的linux-3.0.86版本的内核,对于DM9621的驱动在Linux 4.4中全部在driver/net/usb/dm9601.c中实现了,并且对于dm9601这样的usb设备不需要出现在设备树中。所以针对dm9601我们要做的就是:在内核配置时将DM9601的驱动选中即可,同时发现,为了支持识别bootargs中的mac地址的功能,需要稍微修改dm9601.c,添加解析mac地址的功能,并且还需要将解析到的有效的mac地址设置到dm9621中,否则网络没法用(发现这个问题也废了一些时间)。

    此外,最关键的是一定要在设备树中将用到的片内外设使能:如hsi、ehci、ohci、otg等等。

下面是patch:

   1: diff --git a/Makefile b/Makefile
   2: index 70dea02..5d96411 100644
   3: --- a/Makefile
   4: +++ b/Makefile
   5: @@ -248,8 +248,8 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
   6:  # "make" in the configured kernel build directory always uses that.
   7:  # Default value for CROSS_COMPILE is not to prefix executables
   8:  # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
   9: -ARCH        ?= $(SUBARCH)
  10: -CROSS_COMPILE    ?= $(CONFIG_CROSS_COMPILE:"%"=%)
  11: +ARCH        ?= arm
  12: +CROSS_COMPILE    ?= /root/tiny4412_android5/SysPort/cross_compile/arm-2014.05/bin/arm-none-linux-gnueabi-
  13:  
  14:  # Architecture as present in compile.h
  15:  UTS_MACHINE     := $(ARCH)
  16: diff --git a/arch/arm/boot/dts/exynos4412-tiny4412.dts b/arch/arm/boot/dts/exynos4412-tiny4412.dts
  17: index 4840bbd..69a0d5d 100644
  18: --- a/arch/arm/boot/dts/exynos4412-tiny4412.dts
  19: +++ b/arch/arm/boot/dts/exynos4412-tiny4412.dts
  20: @@ -14,6 +14,7 @@
  21:  /dts-v1/;
  22:  #include "exynos4412.dtsi"
  23:  #include <;dt-bindings/gpio/gpio.h>
  24: +#include <;dt-bindings/usb4640/usb4640.h>
  25:  
  26:  / {
  27:      model = "FriendlyARM TINY4412 board based on Exynos4412";
  28: @@ -21,6 +22,7 @@
  29:  
  30:      chosen {
  31:          stdout-path = &;serial_0;
  32: +        bootargs = "root=/dev/ram0 rw rootfstype=ext4 console=ttySAC0,115200 ethmac=1C:6F:65:34:51:7E init=/linuxrc";
  33:      };
  34:  
  35:      memory {
  36: @@ -68,6 +70,12 @@
  37:              clock-frequency = <;24000000>;
  38:          };
  39:      };
  40: +
  41: +    usb-hub {
  42: +        compatible = "smsc,usb4640";
  43: +        reset-gpios = <&gpm2 4 GPIO_ACTIVE_LOW>;
  44: +        initial-mode = <;USB4640_MODE_HUB>;
  45: +    };
  46:  };
  47:  
  48:  &;rtc {
  49: @@ -78,7 +86,7 @@
  50:      bus-width = <;4>;
  51:      pinctrl-0 = <;&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
  52:      pinctrl-names = "default";
  53: -    status = "okay";
  54: +    status = "disabled";
  55:  };
  56:  
  57:  &;serial_0 {
  58: @@ -96,3 +104,32 @@
  59:  &;serial_3 {
  60:      status = "okay";
  61:  };
  62: +
  63: +&;exynos_usbphy {
  64: +    status = "okay";
  65: +};
  66: +
  67: +&;ehci {
  68: +    status = "okay";
  69: +    port@0 {
  70: +        status = "okay";
  71: +    };
  72: +    port@1 {
  73: +        status = "okay";
  74: +    };
  75: +    port@2 {
  76: +        status = "okay";
  77: +    };
  78: +};
  79: +
  80: +&;ohci {
  81: +    status = "okay";
  82: +    port@0 {
  83: +        status = "okay";
  84: +    };
  85: +};
  86: +
  87: +&;hsotg {
  88: +    status = "okay";
  89: +};
  90: +
  91: diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
  92: index 0b4bdd3..4361385 100644
  93: --- a/drivers/net/usb/dm9601.c
  94: +++ b/drivers/net/usb/dm9601.c
  95: @@ -58,6 +58,39 @@
  96:  #define DM_RX_OVERHEAD    7    /* 3 byte header + 4 byte crc tail */
  97:  #define DM_TIMEOUT    1000
  98:  
  99: +/* Setup ethernet address */
 100: +static u8 param_addr[ETH_ALEN];
 101: +
 102: +static int __init dm9601_set_mac(char *str) {
 103: +    u8 addr[ETH_ALEN];
 104: +    uint val;
 105: +    int idx = 0;
 106: +    char *p = str, *end;
 107: +
 108: +    while (*p &;& idx < ETH_ALEN) {
 109: +        val = simple_strtoul(p, &;end, 16);
 110: +        if (end <;= p) {
 111: +            break;
 112: +        } else {
 113: +            addr[idx++] = val;
 114: +            p = end;
 115: +            if (*p == ':'|| *p == '-') {
 116: +                p++;
 117: +            } else {
 118: +                break;
 119: +            }
 120: +        }
 121: +    }
 122: +
 123: +    if (idx == ETH_ALEN) {
 124: +        printk("Setup ethernet address to %pM\n", addr);
 125: +        memcpy(param_addr, addr, ETH_ALEN);
 126: +    }
 127: +
 128: +    return 1;
 129: +}
 130: +__setup("ethmac=", dm9601_set_mac);
 131: +
 132:  static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data)
 133:  {
 134:      int err;
 135: @@ -190,8 +223,6 @@ static int dm_read_eeprom_word(struct usbnet *dev, u8 offset, void *value)
 136:      return dm_read_shared_word(dev, 0, offset, value);
 137:  }
 138:  
 139: -
 140: -
 141:  static int dm9601_get_eeprom_len(struct net_device *dev)
 142:  {
 143:      return DM_EEPROM_LEN;
 144: @@ -389,7 +420,11 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
 145:      /*
 146:       * Overwrite the auto-generated address only with good ones.
 147:       */
 148: -    if (is_valid_ether_addr(mac))
 149: +    if (is_valid_ether_addr(param_addr)) {
 150: +        /* write MAC to dm9621 */
 151: +        memcpy(dev->;net->dev_addr, param_addr, ETH_ALEN);
 152: +        __dm9601_set_mac_address(dev);
 153: +    } else if (is_valid_ether_addr(mac))
 154:          memcpy(dev->;net->dev_addr, mac, ETH_ALEN);
 155:      else {
 156:          printk(KERN_WARNING
 157: diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
 158: index f7a7fc2..c1fcc2f 100644
 159: --- a/drivers/usb/misc/Kconfig
 160: +++ b/drivers/usb/misc/Kconfig
 161: @@ -249,6 +249,11 @@ config USB_HSIC_USB3503
 162:         help
 163:           This option enables support for SMSC USB3503 HSIC to USB 2.0 Driver.
 164:  
 165: +config USB_HSIC_USB4640
 166: +       tristate "USB4640 HSIC to USB20 Driver"
 167: +       help
 168: +         This option enables support for SMSC USB4640 HSIC to USB 2.0 Driver.
 169: +
 170:  config USB_LINK_LAYER_TEST
 171:      tristate "USB Link Layer Test driver"
 172:      help
 173: diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
 174: index 45fd4ac..05b6344 100644
 175: --- a/drivers/usb/misc/Makefile
 176: +++ b/drivers/usb/misc/Makefile
 177: @@ -25,6 +25,7 @@ obj-$(CONFIG_USB_USS720)        += uss720.o
 178:  obj-$(CONFIG_USB_SEVSEG)        += usbsevseg.o
 179:  obj-$(CONFIG_USB_YUREX)            += yurex.o
 180:  obj-$(CONFIG_USB_HSIC_USB3503)        += usb3503.o
 181: +obj-$(CONFIG_USB_HSIC_USB4640)        += usb4640.o
 182:  obj-$(CONFIG_USB_CHAOSKEY)        += chaoskey.o
 183:  
 184:  obj-$(CONFIG_USB_SISUSBVGA)        += sisusbvga/
 185: diff --git a/drivers/usb/misc/usb4640.c b/drivers/usb/misc/usb4640.c
 186: new file mode 100644
 187: index 0000000..9c9c01b
 188: --- /dev/null
 189: +++ b/drivers/usb/misc/usb4640.c
 190: @@ -0,0 +1,154 @@
 191: +/*
 192: + * Driver for SMSC USB4640 USB 2.0 hub controller driver
 193: + *
 194: + */
 195: +
 196: +#include <;linux/gpio.h>
 197: +#include <;linux/delay.h>
 198: +#include <;linux/slab.h>
 199: +#include <;linux/module.h>
 200: +#include <;linux/of_gpio.h>
 201: +#include <;linux/platform_device.h>
 202: +#include <;linux/platform_data/usb4640.h>
 203: +
 204: +struct usb4640 {
 205: +    enum usb4640_mode    mode;
 206: +    struct device        *dev;
 207: +    int    gpio_reset;
 208: +};
 209: +
 210: +static int usb4640_reset(struct usb4640 *hub, int state)
 211: +{
 212: +    if (gpio_is_valid(hub->;gpio_reset))
 213: +        gpio_set_value_cansleep(hub->;gpio_reset, state);
 214: +
 215: +    /* Wait 1ms for hub logic to stabilize */
 216: +    if (state)
 217: +        usleep_range(1, 10);
 218: +
 219: +    return 0;
 220: +}
 221: +
 222: +static int usb4640_connect(struct usb4640 *hub)
 223: +{
 224: +    struct device *dev = hub->;dev;
 225: +
 226: +    usb4640_reset(hub, 1);
 227: +    hub->mode = USB4640_MODE_HUB;
 228: +    dev_info(dev, "switched to HUB mode\n");
 229: +
 230: +    return 0;
 231: +}
 232: +
 233: +static int usb4640_switch_mode(struct usb4640 *hub, enum usb4640_mode mode)
 234: +{
 235: +    struct device *dev = hub->;dev;
 236: +    int err = 0;
 237: +
 238: +    switch (mode) {
 239: +    case USB4640_MODE_HUB:
 240: +        err = usb4640_connect(hub);
 241: +        break;
 242: +
 243: +    case USB4640_MODE_STANDBY:
 244: +        usb4640_reset(hub, 0);
 245: +        dev_info(dev, "switched to STANDBY mode\n");
 246: +        break;
 247: +
 248: +    default:
 249: +        dev_err(dev, "unknown mode is requested\n");
 250: +        err = -EINVAL;
 251: +        break;
 252: +    }
 253: +
 254: +    return err;
 255: +}
 256: +
 257: +
 258: +static int usb4640_probe(struct usb4640 *hub)
 259: +{
 260: +    struct device *dev = hub->;dev;
 261: +    struct usb4640_platform_data *pdata = http://www.cnblogs.com/pengdonglin137/p/dev_get_platdata(dev);
 262: +    struct device_node *np = dev->of_node;
 263: +    int err;
 264: +    u32 mode = USB4640_MODE_HUB;
 265: +
 266: +    if (pdata) {
 267: +        hub->;gpio_reset        = pdata->gpio_reset;
 268: +        hub->;mode        = pdata->initial_mode;
 269: +    } else if (np) {
 270: +        hub->;gpio_reset = of_get_named_gpio(np, "reset-gpios", 0);
 271: +        if (hub->;gpio_reset == -EPROBE_DEFER)
 272: +            return -EPROBE_DEFER;
 273: +        of_property_read_u32(np, "initial-mode", &mode);
 274: +        hub->;mode = mode;
 275: +    }
 276: +
 277: +    if (gpio_is_valid(hub->;gpio_reset)) {
 278: +        err = devm_gpio_request_one(dev, hub->;gpio_reset,
 279: +                GPIOF_OUT_INIT_LOW, "usb4640 reset");
 280: +        if (err) {
 281: +            dev_err(dev,
 282: +                "unable to request GPIO %d as reset pin (%d)\n",
 283: +                hub->;gpio_reset, err);
 284: +            return err;
 285: +        }
 286: +    }
 287: +
 288: +    usb4640_switch_mode(hub, hub->;mode);
 289: +
 290: +    dev_info(dev, "%s: probed in %s mode\n", __func__,
 291: +            (hub->;mode == USB4640_MODE_HUB) ? "hub" : "standby");
 292: +
 293: +    return 0;
 294: +}
 295: +
 296: +static int usb4640_platform_probe(struct platform_device *pdev)
 297: +{
 298: +    struct usb4640 *hub;
 299: +
 300: +    hub = devm_kzalloc(&;pdev->dev, sizeof(struct usb4640), GFP_KERNEL);
 301: +    if (!hub)
 302: +        return -ENOMEM;
 303: +    hub->dev = &pdev->dev;
 304: +
 305: +    return usb4640_probe(hub);
 306: +}
 307: +
 308: +#ifdef CONFIG_OF
 309: +static const struct of_device_id usb4640_of_match[] = {
 310: +    { .compatible = "smsc,usb4640", },
 311: +    {},
 312: +};
 313: +MODULE_DEVICE_TABLE(of, usb4640_of_match);
 314: +#endif
 315: +
 316: +static struct platform_driver usb4640_platform_driver = {
 317: +    .driver = {
 318: +        .name = USB4640_NAME,
 319: +        .of_match_table = of_match_ptr(usb4640_of_match),
 320: +    },
 321: +    .probe        = usb4640_platform_probe,
 322: +};
 323: +
 324: +static int __init usb4640_init(void)
 325: +{
 326: +    int err;
 327: +
 328: +    err = platform_driver_register(&;usb4640_platform_driver);
 329: +    if (err != 0)
 330: +        pr_err("usb4640: Failed to register platform driver: %d\n",
 331: +               err);
 332: +
 333: +    return 0;
 334: +}
 335: +module_init(usb4640_init);
 336: +
 337: +static void __exit usb4640_exit(void)
 338: +{
 339: +    platform_driver_unregister(&;usb4640_platform_driver);
 340: +}
 341: +module_exit(usb4640_exit);
 342: +
 343: +MODULE_DESCRIPTION("USB4640 USB HUB driver");
 344: +MODULE_LICENSE("GPL");
 345: diff --git a/include/dt-bindings/usb4640/usb4640.h b/include/dt-bindings/usb4640/usb4640.h
 346: new file mode 100644
 347: index 0000000..ef3e1e1
 348: --- /dev/null
 349: +++ b/include/dt-bindings/usb4640/usb4640.h
 350: @@ -0,0 +1,7 @@
 351: +#ifndef _DT_BINDINGS_USB4640
 352: +#define _DT_BINDINGS_USB4640
 353: +
 354: +#define USB4640_MODE_UNKNOWN   1
 355: +#define USB4640_MODE_HUB       2
 356: +#define USB4640_MODE_STANDBY   3
 357: +#endif
 358: diff --git a/include/linux/platform_data/usb4640.h b/include/linux/platform_data/usb4640.h
 359: new file mode 100644
 360: index 0000000..5a416ab
 361: --- /dev/null
 362: +++ b/include/linux/platform_data/usb4640.h
 363: @@ -0,0 +1,17 @@
 364: +#ifndef __USB4640_H__
 365: +#define __USB4640_H__
 366: +
 367: +#define USB4640_NAME    "usb4640"
 368: +
 369: +enum usb4640_mode {
 370: +    USB4640_MODE_UNKNOWN = 1,
 371: +    USB4640_MODE_HUB,
 372: +    USB4640_MODE_STANDBY,
 373: +};
 374: +
 375: +struct usb4640_platform_data {
 376: +    enum usb4640_mode    initial_mode;
 377: +    int    gpio_reset;
 378: +};
 379: +
 380: +#endif

 

测试

用ramdisk启动内核,可以看到如下log

[    2.690100] usb 2-2.2: new full-speed USB device number 4 using exynos-ehci
[    2.795595] usb 2-2.2: not running at top speed; connect to a high speed hub
[    2.869980] usb 2-2.2: New USB device found, idVendor=0a46, idProduct=9621
[    2.870147] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.883960] dm9601 2-2.2:1.0 eth0: register 'dm9601' at usb-12580000.ehci-2.2, Davicom DM96xx USB 10/100 Ethernet, 1c:6f:65:34:51:7e

执行如下命令:

ifconfig eth0 192.168.1.8

我的开发机使用桥接的方式连接到物理网卡上,ip是192.168.1.10,在板子上执行如下命令:

ping 192.168.1.10

看到如下log:

   1: [root@tiny4412 ]# ping 192.168.1.10
   2: PING 192.168.1.10 (192.168.1.10): 56 data bytes
   3: 64 bytes from 192.168.1.10: seq=0 ttl=64 time=1.354 ms
   4: 64 bytes from 192.168.1.10: seq=1 ttl=64 time=1.210 ms
   5: 64 bytes from 192.168.1.10: seq=2 ttl=64 time=1.550 ms
   6: 64 bytes from 192.168.1.10: seq=3 ttl=64 time=2.336 ms
   7: 64 bytes from 192.168.1.10: seq=4 ttl=64 time=1.612 ms
   8: ^C
   9: --- 192.168.1.10 ping statistics ---
  10: 5 packets transmitted, 5 packets received, 0% packet loss
  11: round-trip min/avg/max = 1.210/1.612/2.336 ms

可以将配置IP的命令写到/etc/profile中,就不用每次都配置ip了。

    下面我们看看系统的GPIO使用情况,再次之前需要挂载debugfs文件系统到/sys/kernel/debug下,修改配置文件/etc/fstab (需要在开发机上修改,然后重新制作ramdisk镜像),添加一行:

debugfs        /sys/kernel/debug    debugfs        defaults    0    0

然后重新制作生成ramdisk.img,启动系统,执行如下命令:

   1:  [root@tiny4412 ]# mount
   2:  /dev/root on / type ext4 (rw,relatime,data=http://www.cnblogs.com/pengdonglin137/p/ordered)
   3:  devtmpfs on /dev type devtmpfs (rw,relatime,size=480388k,nr_inodes=120097,mode=755)
   4:  proc on /proc type proc (rw,relatime)
   5:  tmpfs on /tmp type tmpfs (rw,relatime)
   6:  sysfs on /sys type sysfs (rw,relatime)
   7:  debugfs on /sys/kernel/debug type debugfs (rw,relatime)
   8:  devpts on /dev/pts type devpts (rw,relatime,mode=600)
   9:   
  10:  [root@tiny4412 ]# cat /sys/kernel/debug/gpio 
  11:  ......
  12:   
  13:  GPIOs 128-135, platform/11000000.pinctrl, gpm0:
  14:   
  15:  GPIOs 136-142, platform/11000000.pinctrl, gpm1:
  16:   
  17:  GPIOs 143-147, platform/11000000.pinctrl, gpm2:
  18:   gpio-147 (                    |usb4640 reset       ) out hi    
  19:   
  20:  GPIOs 148-155, platform/11000000.pinctrl, gpm3:
  21:   
  22:  GPIOs 156-163, platform/11000000.pinctrl, gpm4:
  23:   gpio-156 (                    |?                   ) out hi    
  24:   gpio-157 (                    |?                   ) out hi    
  25:   gpio-158 (                    |?                   ) out hi    
  26:   gpio-159 (                    |?                   ) out hi    
  27:   
  28:  GPIOs 164-169, platform/11000000.pinctrl, gpy0:
  29:   
  30:  ......

可以看到控制usb4640的gpio资源状态以及控制led灯的gpio状态。

    下面我们执行命令,将开发机上的一个共享目录用nfs挂载到tiny4412上:

   1:  [root@tiny4412 ]# ls /mnt/
   2:  [root@tiny4412 ]# mount -t nfs -o nolock 192.168.1.10:/nfs_rootfs/rootfs /mnt
   3:  [root@tiny4412 ]# ls /mnt/
   4:  bin      etc      linuxrc  proc     sbin     tmp      var
   5:  dev      lib      mnt      root     sys      usr

    下面测试使用NFS挂载根文件系统

在这块折腾了一些时间,我用在tq2440上挂载参数放在tiny4412上始终挂不上,最后发现将bootargs设置为如下格式即可:

setenv bootargs 'root=/dev/nfs rw nfsroot=192.168.1.10:/nfs_rootfs/rootfs ethmac=1C:6F:65:34:51:7E ip=192.168.1.8:192.168.1.10:192.168.1.1:255.255.255.0::eth0:off console=ttySAC0,115200 init=/linuxrc'

其中关键是对ip参数的设置:

ip=<;client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:<dns0-ip>:<dns1-ip> 

对bootargs的设置可以放在设备树中或者u-boot中,并且u-boot的bootargs的优先级更高,会将设备树中的bootargs覆盖了。

具体请参考内核文档:

Documentation/kernel-parameters.txt

Documentation/filesystems/nfs/nfsroot.txt

同时还需要注意的是如果用NFS启动根文件系统的话,使用bootm启动内核的时候,就不需要传递ramdisk的地址了(如:bootm 0x40000000 – 0x4200000 ),否则根文件系统还是ramdisk。

为了不破坏exynos_defconfig的默认配置,我copy了一份,重命名为tiny4412_defconfig,那么以后编译的时候:

make mrproper
make tiny4412_defconfig
make uImage LOADADDR=0x40008000 -j2
make dtbs

相应的内核代码我已经上传到github上了:

git clone https://github.com/pengdonglin137/linux-4.4_tiny4412.git -b port_to_tiny4412

下面是完整的启动log:

U-Boot 2010.12-00000-gb391276-dirty (Jan 17 2016 - 06:03:22) for TINY4412
 
 
CPU:    S5PC220 [Samsung SOC on SMP Platform Base on ARM CortexA9]
        APLL = 1400MHz, MPLL = 800MHz
 
Board:  TINY4412
DRAM:   1023 MiB
 
vdd_arm: 1.2
vdd_int: 1.0
vdd_mif: 1.1
 
BL1 version:  N/A (TrustZone Enabled BSP)
 
 
Checking Boot Mode ... SDMMC
REVISION: 1.1
MMC Device 0: 3803 MB
MMC Device 1: 3728 MB
MMC Device 2: N/A
*** Warning - using default environment
 
Net:    No ethernet found.
Hit any key to stop autoboot:  0 
TINY4412 # setenv bootargs 'root=/dev/nfs rw nfsroot=192.168.1.10:/nfs_rootfs/rootfs ethmac=1C:6F:65:34:51:7E ip=192.168.1.8:192.168.1.10:192.168.1.1:255.255.255.0::eth0:off console=ttySAC0,115200 init=/linuxrc'
TINY4412 # dnw 0x40000000;dnw 0x42000000;bootm 0x40000000 - 0x42000000
OTG cable Connected!
Now, Waiting for DNW to transmit data
Download Done!! Download Address: 0x40000000, Download Filesize:0x442100
Checksum is being calculated.....
Checksum O.K.
OTG cable Connected!
Now, Waiting for DNW to transmit data
Download Done!! Download Address: 0x42000000, Download Filesize:0xa5bf
Checksum is being calculated.
Checksum O.K.
## Booting kernel from Legacy Image at 40000000 ...
   Image Name:   Linux-4.4.0-gbd49c0f-dirty
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4464832 Bytes = 4360 KiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 42000000
   Booting using the fdt blob at 0x42000000
   Loading Kernel Image ... OK
OK
   Loading Device Tree to 413f2000, end 413ff5be ... OK
 
Starting kernel ...
 
Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0xa00
[    0.000000] Linux version 4.4.0-gbd49c0f-dirty (root@ubuntu) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) ) #42 SMP PREEMPT Sat Jan 23 00:42:50 PST 2016
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: FriendlyARM TINY4412 board based on Exynos4412
[    0.000000] cma: Reserved 64 MiB at 0x7bc00000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Samsung CPU ID: 0xe4412011
[    0.000000] PERCPU: Embedded 12 pages/cpu @ef79b000 s18816 r8192 d22144 u49152
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260352
[    0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.10:/nfs_rootfs/rootfs ethmac=1C:6F:65:34:51:7E ip=192.168.1.8:192.168.1.10:192.168.1.1:255.255.255.0::eth0:off console=ttySAC0,115200 init=/linuxrc
[    0.000000] Setup ethernet address to 1c:6f:65:34:51:7e
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 963304K/1047552K available (5909K kernel code, 294K rwdata, 2296K rodata, 440K init, 315K bss, 18712K reserved, 65536K cma-reserved, 195584K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc080b6fc   (8206 kB)
[    0.000000]       .init : 0xc080c000 - 0xc087a000   ( 440 kB)
[    0.000000]       .data : 0xc087a000 - 0xc08c3898   ( 295 kB)
[    0.000000]        .bss : 0xc08c6000 - 0xc0914e30   ( 316 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=4
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] GIC physical location is 0x10490000
[    0.000000] L2C: platform modifies aux control register: 0x02070000 ->; 0x3e470001
[    0.000000] L2C: platform provided aux values permit register corruption.
[    0.000000] L2C: DT/platform modifies aux control register: 0x02070000 ->; 0x3e470001
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310: enabling full line of zeros but not enabled in Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 16 ways, 1024 kB
[    0.000000] L2C-310: CACHE_ID 0x4100c4c8, AUX_CTRL 0x4e470001
[    0.000000] Exynos4x12 clocks: sclk_apll = 466666667, sclk_mpll = 800000000
[    0.000000]  sclk_epll = 96000000, sclk_vpll = 108000000, arm_clk = 1400000000
[    0.000000] Switching to timer-based delay loop, resolution 41ns
[    0.000000] clocksource: mct-frc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000126] Console: colour dummy device 80x30
[    0.000139] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=120000)
[    0.000148] pid_max: default: 32768 minimum: 301
[    0.000215] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000222] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000596] CPU: Testing write buffer coherency: ok
[    0.000781] CPU0: thread -1, cpu 0, socket 10, mpidr 80000a00
[    0.001011] Setting up static identity map for 0x400082c0 - 0x40008318
[    0.045047] CPU1: thread -1, cpu 1, socket 10, mpidr 80000a01
[    0.060041] CPU2: thread -1, cpu 2, socket 10, mpidr 80000a02
[    0.075041] CPU3: thread -1, cpu 3, socket 10, mpidr 80000a03
[    0.075080] Brought up 4 CPUs
[    0.075093] SMP: Total of 4 processors activated (192.00 BogoMIPS).
[    0.075098] CPU: All CPU(s) started in SVC mode.
[    0.075600] devtmpfs: initialized
[    0.084495] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.084782] lcd0-power-domain@10023C80 has as child subdomain: tv-power-domain@10023C20.
[    0.085182] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302231375000 ns
[    0.087124] pinctrl core: initialized pinctrl subsystem
[    0.087883] NET: Registered protocol family 16
[    0.089286] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.105004] cpuidle: using governor ladder
[    0.120000] cpuidle: using governor menu
[    0.120730] exynos-audss-clk 3810000.clock-controller: setup completed
[    0.157118] SCSI subsystem initialized
[    0.157476] usbcore: registered new interface driver usbfs
[    0.157554] usbcore: registered new interface driver hub
[    0.157634] usbcore: registered new device driver usb
[    0.158797] Advanced Linux Sound Architecture Driver Initialized.
[    0.159855] clocksource: Switched to clocksource mct-frc
[    0.169126] missing cooling_device property
[    0.169135] failed to build thermal zone cpu-thermal: -2
[    0.169232] NET: Registered protocol family 2
[    0.169597] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.169657] TCP bind hash table entries: 8192 (order: 5, 163840 bytes)
[    0.169774] TCP: Hash tables configured (established 8192 bind 8192)
[    0.169844] UDP hash table entries: 512 (order: 2, 24576 bytes)
[    0.169921] UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
[    0.170063] NET: Registered protocol family 1
[    0.170260] RPC: Registered named UNIX socket transport module.
[    0.170266] RPC: Registered udp transport module.
[    0.170271] RPC: Registered tcp transport module.
[    0.170275] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.171678] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.181021] romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
[    0.181708] bounce: pool size: 64 pages
[    0.181720] io scheduler noop registered
[    0.181728] io scheduler deadline registered
[    0.181892] io scheduler cfq registered (default)
[    0.182994] 125b0000.exynos-usbphy supply vbus not found, using dummy regulator
[    0.187320] dma-pl330 12680000.pdma: Loaded driver for PL330 DMAC-141330
[    0.187330] dma-pl330 12680000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
[    0.190446] dma-pl330 12690000.pdma: Loaded driver for PL330 DMAC-141330
[    0.190456] dma-pl330 12690000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
[    0.191331] dma-pl330 12850000.mdma: Loaded driver for PL330 DMAC-141330
[    0.191340] dma-pl330 12850000.mdma:         DBUFF-64x8bytes Num_Chans-8 Num_Peri-1 Num_Events-32
[    0.248324] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.249583] 13800000.serial: ttySAC0 at MMIO 0x13800000 (irq = 46, base_baud = 0) is a S3C6400/10
[    0.884507] console [ttySAC0] enabled
[    0.888494] 13810000.serial: ttySAC1 at MMIO 0x13810000 (irq = 47, base_baud = 0) is a S3C6400/10
[    0.897295] 13820000.serial: ttySAC2 at MMIO 0x13820000 (irq = 48, base_baud = 0) is a S3C6400/10
[    0.906124] 13830000.serial: ttySAC3 at MMIO 0x13830000 (irq = 49, base_baud = 0) is a S3C6400/10
[    0.915747] [drm] Initialized drm 1.1.0 20060810
[    0.929515] brd: module loaded
[    0.934098] loop: module loaded
[    0.934745] usbcore: registered new interface driver r8152
[    0.934849] usbcore: registered new interface driver asix
[    0.936336] usbcore: registered new interface driver ax88179_178a
[    0.942422] usbcore: registered new interface driver cdc_ether
[    0.948240] usbcore: registered new interface driver dm9601
[    0.953814] usbcore: registered new interface driver smsc75xx
[    0.959537] usbcore: registered new interface driver smsc95xx
[    0.965253] usbcore: registered new interface driver net1080
[    0.970894] usbcore: registered new interface driver cdc_subset
[    0.976794] usbcore: registered new interface driver zaurus
[    0.982377] usbcore: registered new interface driver cdc_ncm
[    0.988344] 12480000.hsotg supply vusb_d not found, using dummy regulator
[    0.994763] 12480000.hsotg supply vusb_a not found, using dummy regulator
[    1.329897] dwc2 12480000.hsotg: EPs: 16, dedicated fifos, 7808 entries in SPRAM
[    1.890439] dwc2 12480000.hsotg: DWC OTG Controller
[    1.890505] dwc2 12480000.hsotg: new USB bus registered, assigned bus number 1
[    1.890590] dwc2 12480000.hsotg: irq 44, io mem 0x00000000
[    1.890748] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.892445] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.899672] usb usb1: Product: DWC OTG Controller
[    1.904347] usb usb1: Manufacturer: Linux 4.4.0-gbd49c0f-dirty dwc2_hsotg
[    1.911117] usb usb1: SerialNumber: 12480000.hsotg
[    1.916358] hub 1-0:1.0: USB hub found
[    1.919630] hub 1-0:1.0: 1 port detected
[    1.924021] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.930062] ehci-exynos: EHCI EXYNOS driver
[    1.934657] exynos-ehci 12580000.ehci: EHCI Host Controller
[    1.939778] exynos-ehci 12580000.ehci: new USB bus registered, assigned bus number 2
[    1.947638] exynos-ehci 12580000.ehci: irq 45, io mem 0x12580000
[    1.959881] exynos-ehci 12580000.ehci: USB 2.0 started, EHCI 1.00
[    1.960064] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    1.966323] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.973527] usb usb2: Product: EHCI Host Controller
[    1.978387] usb usb2: Manufacturer: Linux 4.4.0-gbd49c0f-dirty ehci_hcd
[    1.984985] usb usb2: SerialNumber: 12580000.ehci
[    1.990080] hub 2-0:1.0: USB hub found
[    1.993408] hub 2-0:1.0: 3 ports detected
[    1.997831] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    2.003571] ohci-exynos: OHCI EXYNOS driver
[    2.007848] exynos-ohci 12590000.ohci: USB Host Controller
[    2.013209] exynos-ohci 12590000.ohci: new USB bus registered, assigned bus number 3
[    2.021052] exynos-ohci 12590000.ohci: irq 45, io mem 0x12590000
[    2.083982] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    2.084049] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.084117] usb usb3: Product: USB Host Controller
[    2.084165] usb usb3: Manufacturer: Linux 4.4.0-gbd49c0f-dirty ohci_hcd
[    2.087046] usb usb3: SerialNumber: 12590000.ohci
[    2.092106] hub 3-0:1.0: USB hub found
[    2.096504] hub 3-0:1.0: 3 ports detected
[    2.100096] usbcore: registered new interface driver usb-storage
[    2.105609] usb4640 usb-hub: switched to HUB mode
[    2.110134] usb4640 usb-hub: usb4640_probe: probed in hub mode
[    2.116058] using random self ethernet address
[    2.120377] using random host ethernet address
[    2.125174] usb0: HOST MAC 2a:35:be:fb:3e:10
[    2.129077] usb0: MAC 96:26:cb:ed:e3:f1
[    2.132886] using random self ethernet address
[    2.137303] using random host ethernet address
[    2.141762] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[    2.148325] g_ether gadget: g_ether ready
[    2.152466] dwc2 12480000.hsotg: dwc2_hsotg_init_fifo: timeout flushing fifos (GRSTCTL=80000430)
[    2.163211] dwc2 12480000.hsotg: Failed to get CSftRst asserted
[    2.166988] dwc2 12480000.hsotg: bound driver g_ether
[    2.174159] dwc2 12480000.hsotg: Failed to get CSftRst asserted
[    2.178185] mousedev: PS/2 mouse device common for all mice
[    2.184044] s3c-rtc 10070000.rtc: failed to find rtc source clock
[    2.189572] s3c-rtc: probe of 10070000.rtc failed with error -2
[    2.195719] i2c /dev entries driver
[    2.200599] device-mapper: ioctl: 4.34.0-ioctl (2015-10-28) initialised: [email protected]
[    2.208036] sdhci: Secure Digital Host Controller Interface driver
[    2.213513] sdhci: Copyright(c) Pierre Ossman
[    2.217966] Synopsys Designware Multimedia Card Interface Driver
[    2.225269] usbcore: registered new interface driver usbhid
[    2.229382] usbhid: USB HID core driver
[    2.235646] NET: Registered protocol family 10
[    2.238191] sit: IPv6 over IPv4 tunneling driver
[    2.242686] NET: Registered protocol family 17
[    2.246687] NET: Registered protocol family 15
[    2.251116] Key type dns_resolver registered
[    2.255513] Registering SWP/SWPB emulation handler
[    2.261255] hctosys: unable to open rtc device (rtc0)
[    2.339893] usb 2-2: new high-speed USB device number 2 using exynos-ehci
[    2.470277] usb 2-2: New USB device found, idVendor=0424, idProduct=2640
[    2.470352] usb 2-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.471237] hub 2-2:1.0: USB hub found
[    2.471397] hub 2-2:1.0: 3 ports detected
[    2.755028] usb 2-2.1: new high-speed USB device number 3 using exynos-ehci
[    2.866878] usb 2-2.1: New USB device found, idVendor=0424, idProduct=4040
[    2.867022] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.867160] usb 2-2.1: Product: Ultra Fast Media Reader
[    2.867268] usb 2-2.1: Manufacturer: Generic
[    2.868264] usb 2-2.1: SerialNumber: 000000264001
[    2.875978] usb-storage 2-2.1:1.0: USB Mass Storage device detected
[    2.885483] scsi host0: usb-storage 2-2.1:1.0
[    2.970054] usb 2-2.2: new full-speed USB device number 4 using exynos-ehci
[    3.075444] usb 2-2.2: not running at top speed; connect to a high speed hub
[    3.149958] usb 2-2.2: New USB device found, idVendor=0a46, idProduct=9621
[    3.150072] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.162741] dm9601 2-2.2:1.0 eth0: register 'dm9601' at usb-12580000.ehci-2.2, Davicom DM96xx USB 10/100 Ethernet, 1c:6f:65:34:51:7e
[    3.245020] usb 2-2.3: new high-speed USB device number 5 using exynos-ehci
[    3.283453] dm9601 2-2.2:1.0 eth0: link down
[    3.288190] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    3.350831] usb 2-2.3: New USB device found, idVendor=1a40, idProduct=0101
[    3.350945] usb 2-2.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.351055] usb 2-2.3: Product: USB 2.0 Hub
[    3.352871] hub 2-2.3:1.0: USB hub found
[    3.353204] hub 2-2.3:1.0: 4 ports detected
[    3.892368] scsi 0:0:0:0: Direct-Access     Generic  Ultra HS-COMBO   2.01 PQ: 0 ANSI: 0
[    3.896558] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    3.899836] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    5.555186] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    5.557590] dm9601 2-2.2:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[    5.569092] dm9601 2-2.2:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[    5.570505] IP-Config: Complete:
[    5.570545]      device=eth0, hwaddr=1c:6f:65:34:51:7e, ipaddr=192.168.1.8, mask=255.255.255.0, gw=19?    R           $$ZkW"rjRR&;&bootserver=192.168.1.10, rootserver=192.168.1.10, rootpath=
[    5.572071] ALSA device list:
[    5.572081]   No soundcards found.
[    5.623727] VFS: Mounted root (nfs filesystem) on device 0:14.
[    5.628784] devtmpfs: mounted
[    5.630194] Freeing unused kernel memory: 440K (c080c000 - c087a000)
 
[   14.895049] nfs: server 192.168.1.10 not responding, still trying
[   18.885041] nfs: server 192.168.1.10 not responding, still trying
[   18.925218] nfs: server 192.168.1.10 OK
[   18.929545] nfs: server 192.168.1.10 OK
[   23.310038] nfs: server 192.168.1.10 not responding, still trying
[   23.343364] nfs: server 192.168.1.10 OK
 
 
Please press Enter to activate this console. [root@tiny4412 ]# 
[root@tiny4412 ]# 
[root@tiny4412 ]# mount
192.168.1.10:/nfs_rootfs/rootfs on / type nfs (rw,relatime,vers=2,rsize=4096,wsize=4096,namlen=255,hard,nolock,proto=udp,timeo=11,retrans=3,sec=sys,mountaddr=192.168.1.10,mountvers=1,mountproto=udp,local_lock=all,addr=192.168.1.10)
devtmpfs on /dev type devtmpfs (rw,relatime,size=481652k,nr_inodes=120413,mode=755)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
[root@tiny4412 ]# 

你可能感兴趣的:(基于tiny4412的Linux内核移植 -- DM9621NP网卡驱动移植(四))