Interfacing to a new ethernet Phy

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

Having some issues getting u-boot to initialize the on-board phy on our custom board. We had to deviate from the reference design a little because the device wasn't readily available.

Anyway the new device is the AMD Am79C874VC, and the PHY ID= "00010"

I edited the following line in u-boot/board/atmel/atngw100/atngw100.c (I'll make a custom board dir soon!) thusly:

void board_init_info(void)
{
   gd->bd->bi_phy_id[0] = 0x02;
}

Yet am not having much luck.. However the LEDs off the phy aren't lighting up either which leads me to think there is something amiss with it..

Any other spots to tweak? I also removed the macb1 statement in eth.c..

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does the PHY need some external reset first perhaps?

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hey hce,

After a somewhat late evening the problem was traced down to a pullup on the centre tap of the RXD transformer on RJ45.. I've got tftp going through u-boot, booting the uImage kernel. Didn't have the rootfs setup over nfs last night (sd card interface is also hooped on the board) so I'll be attempting that this morning.

I had the scope looking at the MDIO/MDC lines and the atmel was definitely sending all the right data, and then kept polling when it received the "link down" bit from the phy.

Just wondering, if it is setup with the phy ID in the u-boot, do I need to edit anything in the kernel when it boots or does it get the settings from u-boot? Even if the u-boot doesn't actually access the network, that is.

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

i have a custom board based on the ngw100, but i had to derivate the PHY. the PHY i use is a LXT971A by cortina systems. i already noticed, that the kernel provides such a driver for the MDIO interface, but unfortunately, the MDIO isn't hooked to the avr32. so i set the PHY in the hardware autonegotiation mode, to select the speed etc. automatically by the PHY hardware. consequently i choosed the fixed generic phy driver (without mdio support).

so far so good. i managed to boot a kernel image via tftp and uboot. that means, the phy acutally does work so far:

U-Boot 1.3.4 (Oct  3 2008 - 12:33:28)

U-Boot code: 00000000 -> 000112f4  data: 00017bb0 -> 0004e530
malloc: Using memory from 0x11f71000 to 0x11fb1000
DMA: Using memory from 0x11f6d000 to 0x11f71000
Flash:  8 MB at address 0x00000000
DRAM Configuration:
Bank #0: 10000000 32 MB
In:    serial
Out:   serial
Err:   serial
Net:   macb0, macb1
Press SPACE to abort autoboot in 3 seconds
U-Boot> tftp 0x10400000 uImage
macb0: link up, 10Mbps full-duplex (lpa: 0xffff)
Using macb0 device
TFTP from server 192.168.123.14; our IP address is 192.168.123.30; sending through gateway 192.168.123.254
Filename 'uImage'.
Load address: 0x10400000
Loading:  ICMP Host Redirect to 192.168.123.14 #### ICMP Host Redirect to 192.168.123.14 ######### ICMP Host Redirect to 192
         ###############
done
Bytes transferred = 1159847 (11b2a7 hex)

with this environment

bootargs=console=ttyS0 root=/dev/mtdblock1 rootfstype=jffs2
baudrate=115200
hostname="myboard"
ethact=macb0
ethaddr=00:04:25:1C:59:A7
bootdelay=3
bootcmd=tftp 0x10400000 uImage; bootm
tftpip=192.168.123.14
stdin=serial
stdout=serial
stderr=serial
filesize=11B2A7
fileaddr=10400000
gatewayip=192.168.123.254
netmask=255.255.255.0
ipaddr=192.168.123.30
serverip=192.168.123.14

But when the kernel loading finished, the eth0 interface in the linux environment doesn't work. The ifconfig eth0 output says:

 ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:04:25:1C:59:A7
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:25 Base address:0x1800

i don't know what to do - please help me.

here is my dmesg:

Starting kernel at 90000000 (params at 11f71008)...

Linux version 2.6.25.10.atmel.2 (simple@debmobile) (gcc version 4.2.2-atmel.1.0.8) #9 Fri Oct 3 22:50:33 CEST 2008
CPU: AT32AP700x chip revision C
CPU: AP7 [01] core revision 0 (AVR32B arch revision 1)
CPU: MMU configuration: Shared TLB
CPU: features: dsp simd ocd perfctr java
CPU: Running at 140.000 MHz
Physical memory:
  10000000-11ffffff
Reserved memory:
  10000000-10169315: Kernel code
  10169316-101e8197: Kernel data
Exception vectors start at 90012000
CPU: Paging enabled
Node 0: start_pfn = 0x10000, low = 0x12000
Node 0: mem_map starts at 901eb000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: console=ttyS0 root=/dev/mtdblock1 rootfstype=jffs2
PID hash table entries: 128 (order: 7, 512 bytes)
avr32_comparator: irq 0, 140.000 MHz
console [ttyS0] enabled
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 30524k/30524k available (1372k kernel code, 2244k reserved, 102k data, 72k init)
SLUB: Genslabs=10, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Calibrating delay using timer specific routine.. 281.89 BogoMIPS (lpj=563790)
Mount-cache hash table entries: 512
net_namespace: 236 bytes
NET: Registered protocol family 16
smc smc.0: Atmel Static Memory Controller at 0xfff03400
pdc pdc.0: Atmel Peripheral DMA Controller enabled
at32_eic at32_eic.0: External Interrupt Controller at 0xfff00100, IRQ 19
at32_eic at32_eic.0: Handling 4 external IRQs, starting with IRQ 64
dmac0: DesignWare DMA controller at 0xff200000 irq 2
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler cfq registered (default)
atmel_usart.0: ttyS0 at MMIO 0xffe01000 (irq = 7) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xffe00c00 (irq = 6) is a ATMEL_SERIAL
Fixed MDIO Bus: probed
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfff01800 irq 25 (00:04:25:1c:59:a7)
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)
physmap platform flash device: 00800000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0041
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00020000 : "u-boot"
0x00020000-0x007f0000 : "root"
0x007f0000-0x00800000 : "env"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xffe00000 (irq 3)
atmel_usba_udc atmel_usba_udc.0: MMIO registers at 0xfff03000 mapped at fff03000
atmel_usba_udc atmel_usba_udc.0: FIFO at 0xff300000 mapped at ff300000
g_file_storage gadget: no file given for LUN0
i2c /dev entries driver
atmel_twi atmel_twi.0: Atmel TWI/I2C adapter (baudrate 100k) at 0xffe00800.
Driver for 1-wire Dallas network protocol.
mmc_host mmc0: Atmel MCI controller at 0xfff02400 irq 28
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
cpufreq: AT32AP CPU frequency driver
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 72K (90000000 - 90012000)
init started: BusyBox v1.12.0 (2008-10-03 12:31:27 CEST)
mmc0: new SD card at address e624
mmcblk0: mmc0:e624 SU512 495488KiB
 mmcblk0: p1
Mounting virtual filesystems:
  /proc mounted
  /sys mounted
  /dev mounted
  /dev/pts directory made
  /dev/pts mounted
  /dev/shm directory made
  /config mounted
  /tmp mounted
  /var/run mounted
  /var/log mounted
Setting up mdev: done
Setting hostname: 'myboard.example.net'
Starting syslogd: done
Log messages to syslog: done
Starting klogd: done
Starting sshd: OK