使用pruss2扩展网口 - AM57x - 嵌入式开发者社区 - 51ele.net
设为首页收藏本站

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 5927|回复: 6

[未解决] 使用pruss2扩展网口

[复制链接]

20

主题

47

帖子

1240

积分

金牌会员

Rank: 6Rank: 6

积分
1240
发表于 2019-9-24 16:02:03 | 显示全部楼层 |阅读模式
我们想仿照5728-idk的电路,想通过pru拓展一个网口,设备树仿照tl5728-idk.dtb中关于pru2的配置,外围电路也同样仿照idk的电路设计,如下图pru2重复配置MAC地址,想询问一下,这是什么原因,移植pru,在电路相同的情况下,只需要设备树配置好就可以了吗,还有什么其他的地方需要注意的吗以下是设备树中关于pru2的配置,使用的是pru2_1
  1. compatible = "ti,am5728-idk", "ti,am5728", "ti,dra742", "ti,dra74",
  2.                      "ti,dra7";
  3.         #if(1)
  4.         aliases {
  5.                 ethernet2 = &pruss2_emac0;
  6.         };
  7.        

  8.         pruss2_eth: pruss2_eth {
  9.                 compatible = "ti,am57-prueth";
  10.                 pruss = <&pruss2>;
  11.                 sram = <&ocmcram1>;
  12.                 interrupt-parent = <&pruss2_intc>;
  13.                 /*rx-queue-size = /bits/ 16 <254 134 134 254 48>;*/ /* RED */
  14.                 /*rx-queue-size = /bits/ 16 <194 194 194 194 48>;*/ /* EMAC */
  15.                 /* map is lowpcp-to->hipcp where val 3=q4, 2=q3, 1=q2, 0=q1 */
  16.                 /*pcp-rxq-map = /bits/ 8 <3 3 2 2 1 1 0 0>;*/
  17.                

  18.                 pruss2_emac0: ethernet-mii0 {
  19.                         phy-handle = <&pruss2_eth1_phy>;
  20.                         phy-mode = "mii";
  21.                         interrupts = <21>, <23>, <24>;
  22.                         interrupt-names = "rx", "tx", "ptp_tx";
  23.                         /* Filled in by bootloader */
  24.                         local-mac-address = [00 00 00 00 00 00];
  25.                         /*tx-queue-size = /bits/ 16 <97 97 97 97 48>;*/
  26.                 };
  27.         };

  28. pru2_mii_pins_default: pru2_mii_pins_default {
  29.                 pinctrl-single,pins = <
  30.                         DRA7XX_CORE_IOPAD(0x3644, (PIN_INPUT_PULLUP | MUX_MODE14))   /* RMII_MHZ_50_CLK.gpio5_17 */
  31.                         DRA7XX_CORE_IOPAD(0x3774, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* gpio6_10.pr2_mii_mt1_clk (AC5) */
  32.                         DRA7XX_CORE_IOPAD(0x3778, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* gpio6_11.pr2_mii1_txen (AB4) */
  33.                         DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* mmc3_clk.pr2_mii1_txd3 (AD4) */
  34.                         DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* mmc3_cmd.pr2_mii1_txd2 (AC4) */
  35.                         DRA7XX_CORE_IOPAD(0x36a4, (PIN_INPUT_PULLUP | MUX_MODE11))   /* mcasp1_aclkx.pr2_mdio_mdclk (C14) */
  36.                         DRA7XX_CORE_IOPAD(0x36a8, (PIN_INPUT_PULLUP | MUX_MODE11))   /* mcasp1_fsx.pr2_mdio_data (D14) */
  37.                         DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* mmc3_dat0.pr2_mii1_txd1 (AC7) */
  38.                         DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* immc3_dat1.pr2_mii1_txd0 (AC6) */
  39.                         DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* mmc3_dat2.pr2_mii_mr1_clk (AC9) */
  40.                         DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* mmc3_dat3.pr2_mii1_rxdv (AC3) */
  41.                         DRA7XX_CORE_IOPAD(0x3794, (PIN_INPUT_PULLUP | MUX_MODE11))   /* mmc3_dat4.pr2_mii1_rxd3 (AC8) */
  42.                         DRA7XX_CORE_IOPAD(0x3798, (PIN_INPUT_PULLUP | MUX_MODE11))   /* mmc3_dat5.pr2_mii1_rxd2 (AD6) */
  43.                         DRA7XX_CORE_IOPAD(0x379c, (PIN_INPUT_PULLUP | MUX_MODE11))   /* mmc3_dat6.pr2_mii1_rxd1 (AB8) */
  44.                         DRA7XX_CORE_IOPAD(0x37a0, (PIN_INPUT_PULLUP | MUX_MODE11))   /* mmc3_dat7.pr2_mii1_rxd0 (AB5) */
  45.                         DRA7XX_CORE_IOPAD(0x372c, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* mcasp3_axr0.pr2_mii1_rxer (B19) */
  46.                         DRA7XX_CORE_IOPAD(0x3730, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* mcasp3_axr1.pr2_mii1_rxlink (C17) */
  47.                         DRA7XX_CORE_IOPAD(0x3694, (PIN_INPUT_PULLUP | MUX_MODE11))   /* xref_clk0.pr2_mii1_col (D18) */
  48.                         DRA7XX_CORE_IOPAD(0x3698, (PIN_INPUT_PULLDOWN | MUX_MODE11)) /* mcasp2_axr9.pr2_mii1_crs (E17) */
  49.                 >;
  50.         };


  51. &pruss_soc_bus2 {
  52.         status = "okay";

  53.         pruss2: pruss@4b280000 {
  54.                 status = "okay";

  55.                 pru2_1: pru@4b2b8000 {
  56.                         interrupt-parent = <&pruss2_intc>;
  57.                         interrupts = <18>, <19>;
  58.                         interrupt-names = "vring", "kick";
  59.                         status = "okay";
  60.                 };
  61.         };
  62. };

  63. &pruss2_mdio {
  64.         status = "okay";
  65.         pinctrl-names = "default";
  66.         pinctrl-0 = <&pru2_mii_pins_default>;

  67.         //reset-gpios = <&gpio3 27 GPIO_ACTIVE_LOW>,
  68.         //                          <&gpio6 13 GPIO_ACTIVE_LOW>;
  69.         //reset-delay-us = <2>;   /* PHY datasheet states 1uS min */

  70.         pruss2_eth1_phy: ethernet-phy@0 {
  71.                 reg = <0>;
  72.                 interrupt-parent = <&gpio5>;
  73.                 interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
  74.         };
  75. };

复制代码
  1. [   13.387459] remoteproc remoteproc4: 4b234000.pru0 is available
  2. [   13.400750] pru-rproc 4b234000.pru0: PRU rproc node /ocp/pruss_soc_bus@4b226000/pruss@4b200000/pru@4b234000 probed successfully
  3. [   13.437689] remoteproc remoteproc5: 4b238000.pru1 is available
  4. [   13.453405] pru-rproc 4b238000.pru1: PRU rproc node /ocp/pruss_soc_bus@4b226000/pruss@4b200000/pru@4b238000 probed successfully
  5. [   13.489244] remoteproc remoteproc6: 4b2b4000.pru0 is available
  6. [   13.495155] pru-rproc 4b2b4000.pru0: PRU rproc node /ocp/pruss_soc_bus@4b2a6000/pruss@4b280000/pru@4b2b4000 probed successfully
  7.          Starting Network Service...[   13.573671] remoteproc remoteproc7: 4b2b8000.pru1 is available

  8. [   13.617568] pru-rproc 4b2b8000.pru1: PRU rproc node /ocp/pruss_soc_bus@4b2a6000/pruss@4b280000/pru@4b2b8000 probed successfully
  9.          Starting Login Service...
  10.          Starting rc.pvr.service...
  11. <font color="#ff0000">[   13.686165] prueth pruss2_eth: pruss MC Mask 0:0:0:0:0:0
  12. [   13.693197] prueth pruss2_eth: port 1: using random MAC addr: 26:76:f6:e4:0c:04</font>
  13. [  OK  ] Started Daily Cleanup of Temporary Directories.
  14. [  OK  ] Reached target Timers.
  15. [  OK  ] Reached target System Time Synchronized.
  16. [  OK  ] Started Network Service.
  17. [   14.036248] net eth1: initializing cpsw version 1.15 (0)
  18. [   14.052151] cpsw 48484000.ethernet: initialized cpsw ale version 1.4
  19. [   14.074790] cpsw 48484000.ethernet: ALE Table size 1024
  20. [  OK  ] Reached target Network.
  21.          Starting Permit User Sessions...
  22.          Starting Lightning Fast Webserver With Light System Requirements...
  23. [   14.194449] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
  24.          Starting Network Time Service...
  25. [   14.240733] Micrel KSZ9031 Gigabit PHY 48485000.mdio:01: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=48485000.mdio:01, irq=-1)
  26. [   14.266589] cpts ptp bc clkid 0
  27.          Starting Network Name Resolution...
  28. [   14.276887] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
  29. [  OK  ] Created slice system-systemd\x2dbacklight.slice.
  30. [   14.328703] net eth0: initializing cpsw version 1.15 (0)
  31.          Starting Load/Save Screen Backlight...htness of backlight:backlight...
  32. [  OK  ] Started Permit User Sessions.
  33. [  OK  ] Started Login Service.
  34. [  OK  ] Started rc.pvr.service.
  35. [   14.476225] Micrel KSZ9031 Gigabit PHY 48485000.mdio:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=48485000.mdio:00, irq=-1)
  36. [   14.503423] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
  37. [   14.558822] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
  38. [   14.568715] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
  39. [  OK  ] Started Lightning Fast Webserver With Light System Requirements.
  40. [  OK  ] Started Network Name Resolution.
  41. [  OK  ] Started Load/Save Screen Backlight Brightness of backlight:backlight.
  42. [  OK  ] Started Network Time Service.
  43. [   15.105874] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
  44. [   15.117318] EXT4-fs (mmcblk0p3): mounting ext3 file system using the ext4 subsystem
  45. [   15.216772] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
  46. [   15.952617] NET: Registered protocol family 43
  47. <font color="#ff0000">[   15.957708] prueth pruss2_eth: pruss MC Mask 0:0:0:0:0:0
  48. [   15.968333] prueth pruss2_eth: port 1: using random MAC addr: 3a:9a:38:7f:90:27
  49. [   15.986862] prueth pruss2_eth: pruss MC Mask 0:0:0:0:0:0
  50. [   16.000385] prueth pruss2_eth: port 1: using random MAC addr: 72:84:4a:28:c9:09</font>
  51. [  OK  ] Reached target Sound Card.
  52. [  OK  ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
复制代码




回复

使用道具 举报

36

主题

526

帖子

7569

积分

创龙

Rank: 8Rank: 8

积分
7569
发表于 2019-9-24 16:24:27 | 显示全部楼层
您好,
  可以参考TL5728-IDK去设计PRU网口,驱动上mii0 mii1都需要用,可以只用pru2。
回复 支持 反对

使用道具 举报

20

主题

47

帖子

1240

积分

金牌会员

Rank: 6Rank: 6

积分
1240
 楼主| 发表于 2019-9-24 16:55:15 | 显示全部楼层
梁淑怡-Tronlong 发表于 2019-9-24 16:24
您好,
  可以参考TL5728-IDK去设计PRU网口,驱动上mii0 mii1都需要用,可以只用pru2。
...

您好:

就是参考idk去设计的pru,设备树按照您说的mii0和mii1都使用了,但是因为只是拓展一个网口,只有mii1实际有用,设备树配置和tl5728-idk.dts相同,打印的pru相关信息如下
  1. root@AM57xx-Tronlong:~# dmesg |grep pru   
  2. [   10.223640] ti-pruss 4b200000.pruss: creating PRU cores and other child platform devices
  3. [   10.238741] ti-pruss 4b280000.pruss: creating PRU cores and other child platform devices
  4. [   10.475566] remoteproc remoteproc4: 4b234000.pru0 is available
  5. [   10.481473] pru-rproc 4b234000.pru0: PRU rproc node /ocp/pruss_soc_bus@4b226000/pruss@4b200000/pru@4b234000 probed successfully
  6. [   10.493801] remoteproc remoteproc5: 4b238000.pru1 is available
  7. [   10.500338] pru-rproc 4b238000.pru1: PRU rproc node /ocp/pruss_soc_bus@4b226000/pruss@4b200000/pru@4b238000 probed successfully
  8. [   10.512242] remoteproc remoteproc6: 4b2b4000.pru0 is available
  9. [   10.529796] pru-rproc 4b2b4000.pru0: PRU rproc node /ocp/pruss_soc_bus@4b2a6000/pruss@4b280000/pru@4b2b4000 probed successfully
  10. [   10.548197] remoteproc remoteproc7: 4b2b8000.pru1 is available
  11. [   10.558263] pru-rproc 4b2b8000.pru1: PRU rproc node /ocp/pruss_soc_bus@4b2a6000/pruss@4b280000/pru@4b2b8000 probed successfully
  12. [   11.327270] prueth pruss2_eth: pruss MC Mask 0:0:0:0:0:0
  13. [   11.332844] prueth pruss2_eth: port 1: using random MAC addr: 6a:dd:12:c9:ff:79
  14. [   13.023038] prueth pruss2_eth: pruss MC Mask 0:0:0:0:0:0
  15. [   13.023184] prueth pruss2_eth: port 1: using random MAC addr: 3a:cc:3d:55:3b:0c
  16. [   13.283417] prueth pruss2_eth: pruss MC Mask 0:0:0:0:0:0
  17. [   13.283568] prueth pruss2_eth: port 1: using random MAC addr: 8a:4d:11:65:b3:f9
  18. [   13.301750] prueth pruss2_eth: pruss MC Mask 0:0:0:0:0:0
  19. [   13.301917] prueth pruss2_eth: port 1: using random MAC addr: 62:19:7d:75:de:87
复制代码
回复 支持 反对

使用道具 举报

20

主题

47

帖子

1240

积分

金牌会员

Rank: 6Rank: 6

积分
1240
 楼主| 发表于 2019-9-24 17:03:50 | 显示全部楼层
phy的打印信息如下:
  1. dmesg |grep phy                           
  2. [    0.000000] Booting Linux on physical CPU 0x0
  3. [    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 6.14MHz (phys).
  4. [    0.737533] dra7-pcie 51000000.pcie: Linked as a consumer to phy-4a094000.pciephy.3
  5. [    1.739350] dra7-pcie 51000000.pcie: phy link never came up
  6. [    2.946457] libphy: Fixed MDIO Bus: probed
  7. [    3.017271] libphy: 48485000.mdio: probed
  8. [    3.035739] davinci_mdio 48485000.mdio: phy[0]: device 48485000.mdio:00, driver Micrel KSZ9031 Gigabit PHY
  9. [    3.045442] davinci_mdio 48485000.mdio: phy[1]: device 48485000.mdio:01, driver Micrel KSZ9031 Gigabit PHY
  10. [   10.311174] libphy: 4b2b2400.mdio: probed
  11. [   13.585035] Micrel KSZ9031 Gigabit PHY 48485000.mdio:01: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=48485000.mdio:01, irq=-1)
  12. [   13.793559] Micrel KSZ9031 Gigabit PHY 48485000.mdio:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=48485000.mdio:00, irq=-1)
复制代码
回复 支持 反对

使用道具 举报

36

主题

526

帖子

7569

积分

创龙

Rank: 8Rank: 8

积分
7569
发表于 2019-9-24 17:21:03 | 显示全部楼层
您好,
  复位引脚要定义
  

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

20

主题

47

帖子

1240

积分

金牌会员

Rank: 6Rank: 6

积分
1240
 楼主| 发表于 2019-9-25 08:07:33 | 显示全部楼层
您好:
非常感谢您的回复
我们这里没有连接复位引脚,硬件电路上直接连接的是板子上的复位输出RSTOUTN,没有单独的io做复位引脚,这里是必须定义复位引脚吗?

点评

要接复位引脚  详情 回复 发表于 2019-9-25 14:39
回复 支持 反对

使用道具 举报

36

主题

526

帖子

7569

积分

创龙

Rank: 8Rank: 8

积分
7569
发表于 2019-9-25 14:39:23 | 显示全部楼层
大鹅 发表于 2019-9-25 08:07
您好:
非常感谢您的回复
我们这里没有连接复位引脚,硬件电路上直接连接的是板子上的复位输出RSTOUTN,没 ...

要接复位引脚
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|嵌入式开发者社区 ( 粤ICP备15055271号

GMT+8, 2024-3-29 14:44 , Processed in 0.042696 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

快速回复 返回顶部 返回列表