am335x Lan8710a 双网口配置
-
一、 经过调试, LAN8710A在 am335x 上面需要使用 GMII的模式,设备树 pin mux配置如下:
// 下面是工作模式的配置,在睡眠模式下是配成GPIO模式
162 cpsw_default: cpsw_default {
163 pinctrl-single,pins = <
164 /* Slave 1 */
165 0x110 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (J15) gmii1_rxer */
166 0x114 ( PIN_OUTPUT | MUX_MODE0 ) /* (J16) gmii1_txen */
167 0x118 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (J17) gmii1_rxdv */
168 0x11c ( PIN_OUTPUT | MUX_MODE0 ) /* (J18) gmii1_txd3 */
169 0x120 ( PIN_OUTPUT | MUX_MODE0 ) /* (K15) gmii1_txd2 */
170 0x124 ( PIN_OUTPUT | MUX_MODE0 ) /* (K16) gmii1_txd1 */
171 0x128 ( PIN_OUTPUT | MUX_MODE0 ) /* (K17) gmii1_txd0 */
172 0x12c ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (K18) gmii1_txclk */
173 0x130 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (L18) gmii1_rxclk */
174 0x134 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (L17) gmii1_rxd3 */
175 0x138 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (L16) gmii1_rxd2 */
176 0x13c ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (L15) gmii1_rxd1 */
177 0x140 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (M16) gmii1_rxd0 */
178 0x74 ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (U17) gpmc_wpn.gmii2_rxerr */
179 0x40 ( PIN_OUTPUT | MUX_MODE1 ) /* (R13) gpmc_a0.gmii2_txen */
180 0x44 ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (V14) gpmc_a1.gmii2_rxdv */
181 0x58 ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (U15) gpmc_a6.gmii2_txclk */
182 0x5c ( PIN_INPUT_PULLDOWN | MUX_MODE1 ) /* (T15) gpmc_a7.gmii2_rxclk */
183 0x54 ( PIN_OUTPUT | MUX_MODE1 ) /* (V15) gpmc_a5.gmii2_txd0 */
184 0x50 ( PIN_OUTPUT | MUX_MODE1 ) /* (R14) gpmc_a4.gmii2_txd1 */
185 0x4c ( PIN_OUTPUT | MUX_MODE1 ) /* (T14) gpmc_a3.gmii2_txd2 */
186 0x48 ( PIN_OUTPUT | MUX_MODE1 ) /* (U14) gpmc_a2.gmii2_txd3 */
187 0x6c ( PIN_INPUT | MUX_MODE1 ) /* (V17) gpmc_a11.gmii2_rxd0 */
188 0x68 ( PIN_INPUT | MUX_MODE1 ) /* (T16) gpmc_a10.gmii2_rxd1 */
189 0x64 ( PIN_INPUT | MUX_MODE1 ) /* (U16) gpmc_a9.gmii2_rxd2 */
190 0x60 ( PIN_INPUT | MUX_MODE1 ) /* (V16) gpmc_a8.gmii2_rxd3 */
191 >;
192 };
-
二、 有关节点的配置如下:
595 &mac {
596 pinctrl-names = "default", "sleep";
597 pinctrl-0 = <&cpsw_default>;
598 pinctrl-1 = <&cpsw_sleep>;
599 dual_emac = <1>;
600 status = "okay";
601 };
602
603 &davinci_mdio {
604 pinctrl-names = "default", "sleep";
605 pinctrl-0 = <&davinci_mdio_default>;
606 pinctrl-1 = <&davinci_mdio_sleep>;
607 status = "okay";
608 };
609
610 &cpsw_emac0 {
611 phy_id = <&davinci_mdio>, <0>;
612 phy-mode = "mii";
613 dual_emac_res_vlan = <1>;
614 };
615
616 &cpsw_emac1 {
617 phy_id = <&davinci_mdio>, <1>;
618 phy-mode = "mii";
619 dual_emac_res_vlan = <2>;
620 };
-
三、有关 make menuconfig 的配置参考:
http://www.cnblogs.com/chenfulin5/p/8144686.html -
四、phy 的要选择
Read The Fucking Source Code