我用DM6467T做开发,Linux内核是TI官方指定的2.6.32-rc2,在/arm/arch/mach-davinci/borad-dm646x-evm.c文件中的evm_init函数中,有两句关于PHY和MDIO设定的语句:
soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK;
soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY;
其中DM646X_EVM_PHY_MASK和DM646X_EVM_MDIO_FREQUENCY的定义如下:
#define DM646X_EVM_PHY_MASK (0x2)
#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
暂时没参透这两句都什么意思,希望TI的专家能予以指点。
还有,我参看DM6467的DataSheet,在《TMS320DM646x DMSoC Ethernet Media Access Controller (EMAC)/ Management Data Input/Output (MDIO) Module User's Guide》的2.1章节中有这样几句描述:
2.1 Clock Control
The frequencies for the transmit and receive clocks are fixed by the IEEE 802.3 specification as:
• 2.5 MHz at 10 Mbps
• 25 MHz at 100 Mbps
• 125 MHz at 1000 Mbps
All EMAC logic is clocked synchronously with the PLL peripheral clock. The MDIO clock can be controlled through the application software, by programming the divide-down factor in the MDIO control register (CONTROL).
TI只说EMAC部分的clock有2.5、25和125的设定,然后说MDIO需要根据实际情况,由软件设定。
我想请教一下TI的专家,在软件中根据什么条件去设定MDIO的clock的频率呢?上面代码中提到的DM646X_EVM_MDIO_FREQUENCY是phy bus的frequency还是mdio的frequency?麻烦TI的专家们一并解释一下。
kooking:
DM646X_EVM_MDIO_FREQUENCY应该指MDIO的频率,MDIO的频率是为了配置PHY芯片的寄存器
Shaquille Wu:
回复 kooking:
那软件根据什么设定这个frequency呢?总要有个根据吧
kooking:
回复 Shaquille Wu:
就我所了解的,这个参数意义不太大,frequency是用于设置PHY寄存器,具体的frequency可能和PHY寄存器要设置的状态有关