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.

am3352 using KSZ9021 's Phy , Extened Register not change..

Other Parts Discussed in Thread: AM3352

Hi.

I have Two questions

I'm using am3352 at custom board consist of  Two piece of  KSZ9201RL Ethernet Phy

So, Connect RGMILL Interface 

Before I'M Read that KSZ9201RL' Phy Issue

Then , I Will Change KSZ9201RL's Extened Registers ( speical 103H ~ 105H)

I'm Using phy_write and phy_read Function  or miibus->read and miibus->write 

It's General register Control Good handling  ( 0H ~ 1F )

But it's over register 100H , Not yet!

For Reason , davinci_mido.c source is davinci_mdio_write and davinci_mdio_read function at return 

#define PHY_REG_MASK 0x1f

  if (phy_reg & ~PHY_REG_MASK || phy_id & ~PHY_ID_MASK) 
  return -EINVAL; --> at return extended register 


1. One Question 

    that 's source change 

       now is test , so disable  (temporary )

#if 0

       if (phy_reg & ~PHY_REG_MASK || phy_id & ~PHY_ID_MASK) 
          return -EINVAL; --> at return extended register 

#endif

     it's control , is good

    Is it  Correct ? 

2. Two Question 

     then   that's source change  (temporary ), I'm change register 

    that's source cpsw.c 

     tmp = miibus->read(miibus, phy_addr, 0x104);

     printk(KERN_INFO "1CLKSKEW == 0x%x\n", tmp); 
     miibus->write(miibus, phy_addr, 0x104, 0x9797);

     tmp = miibus->read(miibus, phy_addr, 0x104);
     printk(KERN_INFO "2CLKSKEW == 0x%x\n", tmp);

   

    and davici_mdio.c 's function davinci_mdio_write is printk log

            reg = (USERACCESS_GO | USERACCESS_WRITE | (phy_reg << 21) |

             (phy_id << 16) | (phy_data & USERACCESS_DATA));

           printk("%s , phy_data %x , reg %x \n" ,__FUNCTION__ , phy_data , reg );

   It's Result Log

           [ 15.293046] 1CLKSKEW a== 0x1e1

          [ 15.296225] davinci_mdio_write - 104
          [ 15.300049] davinci_mdio_write , phy_data 9797 , reg e0819797
          [ 15.306370] 2CLKSKEW == 0x8597

   value not change 

   if register ( 104H ) is value (0x8759) that write , it ' change good 

   Is it Wrong ?

Now kernel log

   ~~~

[ 9.383501] davinci_mdio.0: probed
[ 9.387054] davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver Micrel KSZ9021 Gigabit PHY
[ 9.396151] davinci_mdio davinci_mdio.0: phy[2]: device 0:02, driver Micrel KSZ9021 Gigabit PHY
[ 9.405794] mousedev: PS/2 mouse device common for all mice

 ~~~

INIT: version 2.88 booting
Starting udev
Error opening /dev/fb0: No such device or address
Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
bootlogd.
ALSA: Restoring mixer settings...
Configuring network interfaces... /usr/sbin/alsactl: load_state:1686: No soundcards found...
[ 15.253287] net eth0: CPSW phy found : id is : 0x221611
[ 15.258755] cpsw_set_phy_config diggo
[ 15.262822] davinci_mdio_write - 0
[ 15.266458] davinci_mdio_write , phy_data 3140 , reg c0013140
[ 15.272767] cpsw_set_phy_config: MII_BMCR : 3140
[ 15.277770] davinci_mdio_write - 4
[ 15.281414] davinci_mdio_write , phy_data 1e1 , reg c08101e1
[ 15.287650] cpsw_set_phy_config: MII_ADVERTISE : 1e1
[ 15.293046] 1CLKSKEW a== 0x1e1
[ 15.296225] davinci_mdio_write - 104
[ 15.300049] davinci_mdio_write , phy_data 9797 , reg e0819797
[ 15.306370] 2CLKSKEW == 0x8597
[ 15.316506] ADDRCONF(NETDEV_UP): eth0: link is not ready
done.
Fri Apr 5 12:16:00 UTC 2013
INIT: Entering runlevel: 5
Starting system message bus: dbus.
Starting telnet daemon.
Starting syslogd/klogd: done
Starting thttpd.
[ 16.249994] davinci_mdio_write - 4   -- debug log
[ 16.253653] davinci_mdio_write , phy_data 8df7 , reg c0818df7
[ 16.260116] davinci_mdio_write - 0
[ 16.263752] davinci_mdio_write , phy_data 3340 , reg c0013340
Stopping Bootlog daemon: bootlogd.

My Question is so long ... sorry..

Thank you

Kind Regards,