TI论坛
直播中

马聪

7年用户 204经验值
私信 关注

请问am3352的设备树中如何配置双百兆的网口?

本帖最后由 一只耳朵怪 于 2018-6-21 08:46 编辑

各位好。
有没有相关的资料介绍如何在4.x的内核设备树中配置双百兆(rmii模式)网口的?

回帖(8)

余少虹

2018-6-21 00:33:21
请参考下面的CPSW user guide.
processors.wiki.ti.com/.../Linux_Core_CPSW_User's_Guide
举报

马聪

2018-6-21 00:48:33
引用: vuywsdfwf 发表于 2018-6-21 00:33
请参考下面的CPSW user guide.
processors.wiki.ti.com/.../Linux_Core_CPSW_User's_Guide

你好 Shine Zhang。
配置单网口为RMII模式,遇到下面的问题,请帮忙看看是哪里配置的有问题,谢谢。
cpu是am3352,phy芯片是dp83620,需要配置成百兆的RMII模式,片外晶振提供时钟,硬件配置phy地址位5,我配置的设备树如下:
cpsw_default: cpsw_default [
pinctrl-single,pins = <
/* Slave 1 */
AM33XX_IOPAD(0x90C, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_crs.rmii1_crs_dv */
AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxerr.rmii1_rxerr */
AM33XX_IOPAD(0x914, PIN_OUTPUT | MUX_MODE1) /* mii1_txen.rmii1_txen */
AM33XX_IOPAD(0x924, PIN_OUTPUT | MUX_MODE1) /* mii1_txd1.rmii1_txd1 */
AM33XX_IOPAD(0x928, PIN_OUTPUT | MUX_MODE1) /* mii1_txd0.rmii1_txd0 */
AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_refclk.rmii1_refclk */
AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 */
AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 */
>;
];
cpsw_sleep: cpsw_sleep [
pinctrl-single,pins = <
/* Slave 1 reset value */
AM33XX_IOPAD(0x90C, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
];
davinci_mdio_default: davinci_mdio_default [
pinctrl-single,pins = <
/* MDIO */
AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */
AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */
>;
];
davinci_mdio_sleep: davinci_mdio_sleep [
pinctrl-single,pins = <
/* MDIO reset value */
AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
];
&mac [
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
status = "okay";
];
&davinci_mdio [
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
status = "okay";
];
&cpsw_emac0 [
phy_id = <&davinci_mdio>, <5>;
phy-mode = "rmii";
];

&phy_sel [
rmii-clock-ext;
];
目前我的单板启动过程中会提示没有找到phy:
[ 1.401063] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
[ 1.408472] [drm] Initialized
[ 1.446133] brd: module loaded
[ 1.466036] loop: module loaded
[ 1.475613] libphy: Fixed MDIO Bus: probed
[ 1.556382] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[ 1.562893] davinci_mdio 4a101000.mdio: no live phy, scanning all
[ 1.569968] davinci_mdio: probe of 4a101000.mdio failed with error -5
[ 1.578211] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property
[ 1.587126] cpsw 4a100000.ethernet: Detected MACID = 98:5d:ad:b6:29:04
[ 1.594314] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
[ 1.606503] mousedev: PS/2 mouse device common for all mice
[ 1.613590] i2c /dev entries driver
……
[ 8.642974] net eth0: initializing cpsw version 1.12 (0)
[ 8.648628] net eth0: initialized cpsw ale version 1.4
[ 8.654023] net eth0: ALE Table size 1024
[ 8.661486] libphy: PHY 4a101000.mdio:05 not found
[ 8.666535] net eth0: phy "4a101000.mdio:05" not found on slave 0, err -19
[ 8.673760] libphy: PHY not found
[ 8.677344] net eth0: phy "" not found on slave 1, err -19
[ 8.694482] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
烦请帮忙看看是否哪里配置有问题,谢谢。
举报

吴思莹

2018-6-21 00:58:23
引用: yx19911127 发表于 2018-6-21 00:48
你好 Shine Zhang。
配置单网口为RMII模式,遇到下面的问题,请帮忙看看是哪里配置的有问题,谢谢。
cpu是am3352,phy芯片是dp83620,需要配置成百兆的RMII模式,片外晶振提供时钟,硬件配置phy地址位5,我配置的设备树如下:

参考这个:
e2echina.ti.com/.../45981
确认一下GMII_SEL, 相关的PINMUX,PHY_ID都该正确是你要的配置了吗?特别是GMII_SEL和PINMUX,用寄存器回读的方法看一下生效值是不是正确的。
举报

马聪

2018-6-21 01:16:54
引用: hwjj940056201 发表于 2018-6-21 00:58
参考这个:
e2echina.ti.com/.../45981
确认一下GMII_SEL, 相关的PINMUX,PHY_ID都该正确是你要的配置了吗?特别是GMII_SEL和PINMUX,用寄存器回读的方法看一下生效值是不是正确的。

你好,经过添加打印信息发现driver/net/ethernet/ti/cpsw-phy-sel.c文件中的cpsw_gmii_sel_am3352函数没有执行到:
static const struct of_device_id cpsw_phy_sel_id_table[] = [
        [
                .compatible        = "ti,am3352-cpsw-phy-sel",
                .data                = &cpsw_gmii_sel_am3352,
        ],
        [
                .compatible        = "ti,dra7xx-cpsw-phy-sel",
                .data                = &cpsw_gmii_sel_dra7xx,
        ],
        [
                .compatible        = "ti,am43xx-cpsw-phy-sel",
                .data                = &cpsw_gmii_sel_am3352,
        ],
        []
];
请问 struct of_device_id结构的data成员在内核代码的什么地方会被调用?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分