[ELDK] Problem of PPC 405EX ethernet in MII mode instead of RGMII

噜斯卡 孙 sxb203 at yahoo.com.cn
Thu Sep 9 14:26:03 CEST 2010


Dear madam/sir:
      Are you Felix? I readed a mail on 'http://lists.denx.de/pipermail/eldk/2009-May/000744.html' which answered a question of 'PPC 405EX ethernet in MII mode instead of RGMII' by Felix(The mail time is Tue May 5 21:30:51 CEST 2009 ). Now I encounter the same problem. My board is similar to a Kilauea too but  with a Micrel KSZ8041 ethernet phy which support RMII mode and MII mode. We've wired the PHY up for MII mode. But it doesn,t work both in U-Boot and linux.
     In U-Boot, I modify the part of ethernet of the 'kilauea.h' file like:
/*-----------------------------------------------------------------------
 * Ethernet
 *----------------------------------------------------------------------*/
#define CONFIG_SYS_DISCOVER_PHY 1
#define CONFIG_IBM_EMAC4_V4 1
#define CONFIG_EMAC_PHY_MODE EMAC_PHY_MODE_NONE_MII /*set phy to MII mode*/
#define CONFIG_PHY_ADDR  1 /* PHY address, See schematics */
#define CONFIG_PHY_RESET 1 /* reset phy upon startup */
#define CONFIG_PHY_GIGE  1 /* Include GbE speed/duplex detection */
#define CONFIG_HAS_ETH0  1
#define CONFIG_HAS_ETH1 1 /* add support for "eth1addr"   */
#define CONFIG_PHY1_ADDR 2
      And ethernet environment of U-Boot of my target board have be set too(192.168.0.136 is IP of host):
          ipadder=192.168.0.60
          serverip=192.168.0.136
          ethaddr=00:03:0d:00:00:08
    but the wor didn't work right, I used 'mii device' command, the console print like:
MII devices: 'ppc_4xx_eth0' 'ppc_4xx_eth1'
Current device: 'ppc_4xx_eth0'  
    And if I didn't connect the target to host in net, use 'mii info', the console print:
PHY 0x00: OUI = 0x0885, Model = 0x11, Rev = 0x03,  10baseT, HDX
PHY 0x01: OUI = 0x0885, Model = 0x11, Rev = 0x03,  10baseT, HDX
    And if I connect the target to host in net, use 'mii info', the console print:
PHY 0x00: OUI = 0x0885, Model = 0x11, Rev = 0x03, 100baseT, FDX
PHY 0x01: OUI = 0x0885, Model = 0x11, Rev = 0x03, 100baseT, FDX
    And if I ping the host(ping 192.168.0.136) in U-boot, the console print:
=> ping 192.168.0.136
 Waiting for PHY auto negotiation to complete.. done
 ENET Speed is 100 Mbps - FULL duplex connection (EMAC0)
 Using ppc_4xx_eth0 device
 ping failed; host 192.168.0.136 is not alive
 =>
     In linux(my linux kernel version is linux-2.6.32-denx),I modify EMAC0 in 'kilauea.dts' file like(I delete EMAC1 and RGMII0 of 'kilauea.dts'):
EMAC0:
 ethernet at ef600900 {
     linux,network-index = <0x0>;
    device_type = "network";
     compatible = "ibm,emac-405ex", "ibm,emac4sync";
     interrupt-parent = <&EMAC0>;
     interrupts = <0x0 0x1>;
     #interrupt-cells = <1>;
     #address-cells = <0>;
     #size-cells = <0>;
     interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4
       /*Wake*/  0x1 &UIC1 0x1d 0x4>;
     reg = <0xef600900 0x000000c4>;
     local-mac-address = [000000000000]; /* Filled in by U-Boot */
     mal-device = <&MAL0>;
     mal-tx-channel = <0>;
     mal-rx-channel = <0>;
     cell-index = <0>;
     max-frame-size = <9000>;
     rx-fifo-size = <4096>;
     tx-fifo-size = <2048>;
     phy-mode = "mii";
     phy-address = <1>;
     has-inverted-stacr-oc;
     has-new-stacr-staopc;
};
     And have used 'make kilauea.dtb' compile the kilauea.dtb. Now, in linux, when I connect the target board to host in net, the console print 'eth0: link is up, 100 FDX, pause enabled', and when I disconnect the net connection, the console print 'eth0: link is down', It likes that net connection state checking is OK, But net doesn't work right(I can't ping the host in linux too). 
    the boot information of my target like:
U-Boot 2010.06 (Sep 07 2010 - 14:48:48)
CPU:   AMCC PowerPC 405EX Rev. C at 400 MHz (PLB=200 OPB=100 EBC=100)
       No Security support
       Bootstrap Option C - Boot ROM Location EBC (16 bits)
       16 kB I-Cache 16 kB D-Cache
Board: Kilauea - AMCC PPC405EX Evaluation Board (CPLD rev. 0)
I2C:   ready
DRAM:  256 MiB (ECC not enabled, 400 MHz, CL4)
FLASH: 64 MiB
NAND:  No NAND device found!!!
0 MiB
PCI:   Bus Dev VenId DevId Class Int
PCIE1: successfully set as root-complex
        01  00  1095  3132  0180  00
I2C write: failed 4
DTT1:  FAILED
Net:   ppc_4xx_eth0
Type run flash_nfs_fdt to mount root filesystem over NFS
Hit any key to stop autoboot:  0
Using ip address 192.168.0.60
## Booting kernel from Legacy Image at fc000000 ...
   Image Name:   Linux-2.6.32-rc7-01409-g358cd6f-
   Created:      2010-09-03   7:16:36 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1787374 Bytes = 1.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at fc200000 ...
   Image Name:   kilauea Ramdisk Rev 006
   Created:      2008-09-24  20:57:56 UTC
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    20947753 Bytes = 20 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at fc1e0000
   Booting using the fdt blob at 0xfc1e0000
   Uncompressing Kernel Image ... OK
   Loading Ramdisk to 0ea8f000, end 0fe89329 ... OK
   Loading Device Tree to 00ffb000, end 00fffb27 ... OK
Using PowerPC 40x Platform machine description
Linux version 2.6.32-rc7-01409-g358cd6f-dirty (sunxubin at sunxubin-desktop) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)) #13 Fri Sep 3 15:16:32 CST 2010
Found initrd at 0xcea8f000:0xcfe89329
Zone PFN ranges:
  DMA      0x00000000 -> 0x00010000
  Normal   0x00010000 -> 0x00010000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00010000
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
Kernel command line: ramdisk_size=65536 root=/dev/ram rw mtdparts=fc000000.nor_flash:1920k(linux),128k(dtb),28M(ramdisk),4M(jffs2),29952k(user),256k(env),384k(uboot) ip=192.168.0.60:192.168.0.136::255.255.255.0:kilauea:eth0:off panic=1 console=ttyS0,115200
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 235316k/262144k available (3508k kernel code, 26528k reserved, 168k data, 119k bss, 152k init)
Kernel virtual memory layout:
  * 0xffffe000..0xfffff000  : fixmap
  * 0xfde00000..0xfe000000  : consistent mem
  * 0xfde00000..0xfde00000  : early ioremap
  * 0xd1000000..0xfde00000  : vmalloc & ioremap
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:512
UIC0 (32 IRQ sources) at DCR 0xc0
UIC1 (32 IRQ sources) at DCR 0xd0
UIC2 (32 IRQ sources) at DCR 0xe0
clocksource: timebase mult[a00000] shift[22] registered
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCIE1: Checking link...
PCIE1: Device detected, waiting for link...
PCIE1: link is up !
PCI host bridge /plb/pciex at 0c0000000 (primary) ranges:
 MEM 0x0000000098000000..0x000000009fffffff -> 0x0000000080000000
  IO 0x00000000e0010000..0x00000000e001ffff -> 0x0000000000000000
4xx PCI DMA offset set to 0x00000000
PCIE1: successfully set as root-complex
PCI: Probing PCI hardware
PCI: Hiding 4xx host bridge resources 0000:40:00.0
pci 0000:40:00.0: PCI bridge, secondary bus 0000:41
pci 0000:40:00.0:   IO window: 0x1000-0x1fff
pci 0000:40:00.0:   MEM window: 0x80000000-0x800fffff
pci 0000:40:00.0:   PREFETCH window: 0x80100000-0x801fffff
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource timebase
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 20456k freed
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
msgmni has been set to 500
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0xef600200 (irq = 26) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0xef600300 (irq = 17) is a 16550A
ef600200.serial: ttyS0 at MMIO 0xef600200 (irq = 26) is a 16550
ef600300.serial: ttyS1 at MMIO 0xef600300 (irq = 17) is a 16550
brd: module loaded
fc000000.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
fc000000.nor_flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
7 cmdlinepart partitions found on MTD device fc000000.nor_flash
Creating 7 MTD partitions on "fc000000.nor_flash":
0x000000000000-0x0000001e0000 : "linux"
0x0000001e0000-0x000000200000 : "dtb"
0x000000200000-0x000001e00000 : "ramdisk"
0x000001e00000-0x000002200000 : "jffs2"
0x000002200000-0x000003f40000 : "user"
0x000003f40000-0x000003f80000 : "env"
0x000003f80000-0x000003fe0000 : "uboot"
No NAND device found!!!
PPC 4xx OCP EMAC driver, version 3.54
MAL v2 /plb/mcmal, 2 TX channels, 2 RX channels
RGMII /plb/opb/emac-rgmii at ef600b00 initialized with MDIO support
/plb/opb/emac-rgmii at ef600b00: input 0 in MII mode
eth0: EMAC-0 /plb/opb/ethernet at ef600900, MAC 00:03:0d:00:00:08
eth0: found Generic MII PHY (0x01)
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
dwc_otg: version 2.60a 22-NOV-2006
dwc_otg: dwc_otg_core_reset() HANG! Soft Reset GRSTCTL=80000001
dwc_otg: Shared Tx FIFO mode
dwc_otg: Using DMA mode
dwc_otg dwc_otg.0: DWC OTG Controller
dwc_otg dwc_otg.0: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg.0: irq 18, io mem 0x00000000
dwc_otg: dwc_otg_core_host_init: Unable to clear halt on channel 1
dwc_otg: dwc_otg_core_host_init: Unable to clear halt on channel 2
dwc_otg: dwc_otg_core_host_init: Unable to clear halt on channel 3
dwc_otg: Init: Port Power? op_state=4
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: DWC OTG Controller
usb usb1: Manufacturer: Linux 2.6.32-rc7-01409-g358cd6f-dirty dwc_otg_hcd
usb usb1: SerialNumber: dwc_otg.0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
i2c /dev entries driver
ibm-iic ef600400.i2c: using standard (100 kHz) mode
rtc-ds1307: probe of 0-0068 failed with error -5
ibm-iic ef600500.i2c: using standard (100 kHz) mode
lm75: probe of 0-0048 failed with error -121
TCP cubic registered
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: link is down
eth0: link is up, 100 FDX, pause enabled
IP-Config: Complete:
     device=eth0, addr=192.168.0.60, mask=255.255.255.0, gw=255.255.255.255,
     host=kilauea, domain=, nis-domain=(none),
     bootserver=192.168.0.136, rootserver=192.168.0.136, rootpath=
RAMDISK: gzip image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing unused kernel memory: 152k init
mount: Mounting /dev/root on / failed: Invalid argument
JFFS2 mount failed. Some EvalKit software could not be loaded.
Running standard /etc/rc.d/rcS startup...

BusyBox v1.2.1 (2008.09.24-20:48+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ #
  
    can you point me in the right direction?
    Thanks!
    Sun Xubin


      


More information about the eldk mailing list