This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM8148 uboot 网络正常,Linux 起来后网络不通

Other Parts Discussed in Thread: TVP5158

DM8148 uboot 网络正常,Linux 起来后网络不通
在 DM814X_TI_EVM 基础上做了些裁剪,在 RGMII0 上接 AR8031 PHY,PHYADDRESS=0,PHYMODE=0(BaseT RGMII).
U-boot 能正常工作,网络,内存等都没问题。
起动Linux系统 NFS 文件系统挂不上去,做了很多无用的工作,NFS 死活不工作。怀疑网络部分有毛病
采用nbi-NAND-FLASH 文件系统,在uboot下通过网络将文件系统和内核烧到NAND-FLASH 上去(该板没做SD内存卡接口)。Linux 内核能正常启动

内核是没做任何修改的 DVRRDK_04.00.00.03 版本下的  uImage_DM814X_TI_EVM


内核启动后的部分信息如下:

ONFI param page 0 valid
ONFI flash detected
NAND device: Maf ID: 0x2c, Chip ID: 0xca (Micron, NAND 256MiB 3,3V 16-bit)
 erasesize: 0x20000, writesize: 2048, oobsize: 64
omap2-nand: detected x16 NAND flash
Creating 7 MTD partitions on "omap2-nand.0":
0x000000000000-0x000000020000 : "U-Boot-min"
0x000000020000-0x000000260000 : "U-Boot"
0x000000260000-0x000000280000 : "U-Boot Env"
0x000000280000-0x000000580000 : "U-Boot Logo"
0x000000580000-0x0000009c0000 : "Kernel"
0x0000009c0000-0x00000d1e0000 : "File System"
0x00000d1e0000-0x000010000000 : "Reserved"
UBI: attaching mtd5 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
ata1: SATA link down (SStatus 0 SControl 300)
UBI: max. sequence number:       141
UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 11, need 16
UBI: attached mtd5 to ubi0
UBI: MTD device name:            "File System"
UBI: MTD device size:            200 MiB
UBI: number of good PEBs:        1601
UBI: number of bad PEBs:         0
UBI: number of corrupted PEBs:   0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 1601
UBI: number of PEBs reserved for bad PEB handling: 11
UBI: max/mean erase counter: 2/0
UBI: image sequence number:  585864963
UBI: background thread "ubi_bgt0d" started, PID 46
davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
davinci_mdio davinci_mdio.0: detected phy mask fffffffe
davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown
CAN device driver interface
CAN bus driver for Bosch D_CAN controller 1.0
d_can d_can: d_can device registered (irq=52, irq_obj=53)
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver dm9601
usbcore: registered new interface driver cdc_acm
cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
qt602240_ts 1-004a: __qt602240_read_reg: i2c transfer failed
qt602240_ts: probe of 1-004a failed with error -5
omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
i2c /dev entries driver
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v1.0.0)
OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
notify_init : notify drivercreated  for  remote proc id 2 at physical Address 0xbfd00000
usbcore: registered new interface driver snd-usb-audio
Registered tvp5158 audio codec
*** Forcing SW CTS!
asoc: tvp5158-hifi <-> davinci-mcasp.0 mapping ok
asoc: tlv320aic3x-hifi <-> davinci-mcasp.2 mapping ok
asoc: HDMI-DAI-CODEC <-> hdmi-dai mapping ok
ALSA device list:
  #0: TI81XX SOUND0
  #1: TI81XX SOUND1
TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
can: broadcast manager protocol (rev 20090105 t)
Registering the dns_resolver key type
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
omap_voltage_late_init: Voltage driver support not added
Power Management for TI81XX.
Detected MACID=20:c3:8f:31:aa:22
omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   199225344 bytes (194556 KiB, 189 MiB, 1569 LEBs)
UBIFS: journal size:       9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:14.
devtmpfs: mounted
Freeing init memory: 232K
Failed to execute /init.  Attempting defaults...
INIT: version 2.88 booting
 Mounting /dev/shm              :  Mounting /dev/pts          :  Mounting other filesystems :  Mounting /dev/sda1              : mount: mounting /dev/sda1 on /media/sda1 failed: No such file or directory
Sync command ...Error opening /dev/fb0: No such file or directory
Starting udev
udev[79]: starting version 164
Starting Bootlog daemon:
CPSW phy found : id is : 0x4dd074
PHY 0:01 not found
PHY: 0:00 - Link is Up - 100/Full
bootlogd.
Applying sync command

 _____                    _____           _         _   
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
              |___|                    |___|            

Arago Project http://arago-project.org dm814x ttyO0

Arago 2012.10 dm814x ttyO0

dm814x login:   



AR8031 的ID =0x4dd074
Llinux 启动后,手工用 ifconfig 配置ip

root@dm814x:~# ifconfig eth0 down
root@dm814x:~# ifconfig eth0 192.168.1.199 netmask 255.255.255.0
root@dm814x:~# ifconfig eth0  hw ether 001122334455
root@dm814x:~# ifconfig eth0 up
root@dm814x:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:22:33:44:55  
          inet addr:192.168.1.199  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:4598 errors:0 dropped:1729 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:452074 (441.4 KiB)  TX bytes:644 (644.0 B)
          Interrupt:40

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:260 (260.0 B)  TX bytes:260 (260.0 B)

经过测试,把网线拔出来提示如下
root@dm814x:~# PHY: 0:00 - Link is Down
经过测试,把网线插上提示如下
root@dm814x:~# PHY: 0:00 - Link is Up - 100/Full

通过仔细测试,用tcpdump 测试,可以得出能正常接收TCP/IP 的数据包,在接收数据时可以在
root@dm814x:~# cat /proc/interrupts 可以观察到中断的产生,也能抓到正常的数据包,能观察到发送数据包时的中断产生,以及在ifconfig 中看
到TX packets:23,  TX bytes:89440  数据的变化,在tcpdump 也能看到包发出去了,但可以肯定数据包并没有发出去.

结论: U-boot 网络能正常工作,启动到Linux 下,网络能接收数据,不能发送数据。
uboot Linux 的代码未做任何修改

没有买8148的开发板。各位大侠前辈们,有遇到类似问题的给点提示,问题出现有几天了,头发又掉了不少。

  • 用示波器发现在100M 链路下 RGMII0_TXC 的时钟不对。
    在uboot 下,RGMII0_TXC 是稳定的25MHz方波
    在linux 下,RGMII0_TXC 是不太稳定的5MHz方波(也不太像是10M的波形)
    仔细检查 RGMII0_TXC 脚的复用设置,没什么有用的发现。
    正在仔细的查找与 RGMII 相关的寄存器,也没有什么有用的发现。

    仔细查看我做的8148板子一官方的ti8148evn的设计,有什么不同?(我没有购买dm8148的开发板)

    开始怀疑自己的硬件设计,怀疑时钟部分,由于我的设计没有用PCIE和SATA接口,我就把SATA的一个查分时钟给去掉了,我还专门在CPU的手册上求证,该时钟可以不需要。结果证实我的的猜测。在U-BOOT 里的代码初始化时钟的时候并没有用这个时钟,在Linux内核的代码用了这个时钟,(网络的时钟也正好是该时钟通过PLL变出来的)。

    直接修改 arm/mach-omap2/devices.c 更改 TI814X_CONTROL_SATA_PLLCFG0 的初始化代码,用20MHz

    在掉了若干头发后终于搞定(目前板子稳定运行),也终于理解那些专家教授的头发为什么这么少了。。