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.

[参考译文] DP83826I:无法与 Sitara AM243x 进行以太网通信

Guru**** 2393115 points
Other Parts Discussed in Thread: DP83826I

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/interface-group/interface/f/interface-forum/1124225/dp83826i-no-ethernet-communication-possible-with-sitara-am243x

器件型号:DP83826I

您好、TI 专家、

我们目前正在努力让 DP83826I PHY 与 Sitara AM243x 一起运行。

为了分步分析问题、我们尝试从在我们自己的硬件目标上运行的 AM243x SDK (V08.03.00.18)获取"enet_layer2_icssg"示例、我们在其中使用 DP83826I PHY。

我们修改了 example.syscfg 以匹配我们的硬件设计:

/**
 * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
 * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
 * @cliArgs --device "AM243x_ALV_beta" --package "ALV" --part "ALV" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM243x@08.03.00"
 * @versions {"tool":"1.12.1+2446"}
 */

/**
 * Import the modules used in this configuration.
 */
const gpio       = scripting.addModule("/drivers/gpio/gpio", {}, false);
const gpio1      = gpio.addInstance();
const gpio2      = gpio.addInstance();
const i2c        = scripting.addModule("/drivers/i2c/i2c", {}, false);
const i2c1       = i2c.addInstance();
const i2c2       = i2c.addInstance();
const pruicss    = scripting.addModule("/drivers/pruicss/pruicss", {}, false);
const pruicss1   = pruicss.addInstance();
const pruicss2   = pruicss.addInstance();
const udma       = scripting.addModule("/drivers/udma/udma", {}, false);
const udma1      = udma.addInstance();
const debug_log  = scripting.addModule("/kernel/dpl/debug_log");
const mpu_armv7  = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
const mpu_armv71 = mpu_armv7.addInstance();
const mpu_armv72 = mpu_armv7.addInstance();
const mpu_armv73 = mpu_armv7.addInstance();
const mpu_armv74 = mpu_armv7.addInstance();
const mpu_armv75 = mpu_armv7.addInstance();
const mpu_armv76 = mpu_armv7.addInstance();
const mpu_armv77 = mpu_armv7.addInstance();
const enet_icss  = scripting.addModule("/networking/enet_icss/enet_icss", {}, false);
const enet_icss1 = enet_icss.addInstance();

/**
 * Write custom configuration values to the imported modules.
 */
gpio1.$name                = "CONFIG_GPIO_RESET1";
gpio1.pinDir               = "OUTPUT";
gpio1.GPIO.gpioPin.$assign = "ball.U13";

gpio2.$name                = "CONFIG_GPIO_RESET2";
gpio2.pinDir               = "OUTPUT";
gpio2.GPIO.gpioPin.$assign = "ball.V7";

i2c1.$name           = "CONFIG_I2C0";
i2c1.I2C.$assign     = "I2C0";
i2c1.I2C.SCL.$assign = "ball.A18";
i2c1.I2C.SDA.$assign = "ball.B18";

i2c2.$name           = "CONFIG_I2C1";
i2c2.I2C.$assign     = "I2C1";
i2c2.I2C.SCL.$assign = "ball.C18";
i2c2.I2C.SDA.$assign = "ball.B19";

pruicss2.$name   = "CONFIG_PRU_ICSS0";
pruicss2.coreClk = 333333333;
pruicss2.iepClk  = 500000000;

udma1.$name    = "CONFIG_UDMA_PKTDMA_0";
udma1.instance = "PKTDMA_0";

debug_log.enableUartLog = true;
debug_log.enableCssLog  = false;
debug_log.uartLog.$name = "CONFIG_UART0";

mpu_armv71.$name             = "CONFIG_MPU_REGION0";
mpu_armv71.size              = 31;
mpu_armv71.attributes        = "Device";
mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv71.allowExecute      = false;

mpu_armv72.$name             = "CONFIG_MPU_REGION1";
mpu_armv72.size              = 15;
mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";

mpu_armv73.$name             = "CONFIG_MPU_REGION2";
mpu_armv73.baseAddr          = 0x41010000;
mpu_armv73.size              = 15;
mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";

mpu_armv74.$name             = "CONFIG_MPU_REGION3";
mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv74.baseAddr          = 0x70000000;
mpu_armv74.size              = 23;

mpu_armv75.$name             = "CONFIG_MPU_REGION4";
mpu_armv75.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv75.baseAddr          = 0x80000000;
mpu_armv75.size              = 31;

mpu_armv76.$name             = "CONFIG_MPU_REGION5";
mpu_armv76.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv76.baseAddr          = 0xA5000000;
mpu_armv76.size              = 23;
mpu_armv76.attributes        = "NonCached";

mpu_armv77.$name    = "CONFIG_MPU_REGION6";
mpu_armv77.size     = 27;
mpu_armv77.baseAddr = 0x60000000;

enet_icss1.$name                = "CONFIG_ENET_ICSS0";
enet_icss1.GigabitSupportEnable = false;
enet_icss1.phyAddr2             = 7;
enet_icss1.phyAddr1             = 3;

enet_icss1.icss                 = pruicss1;
pruicss1.$name                  = "CONFIG_PRU_ICSS1";
pruicss1.intcMapping.create(1);
pruicss1.intcMapping[0].$name   = "CONFIG_ICSS1_INTC_MAPPING0";
pruicss1.intcMapping[0].event   = "41";
pruicss1.intcMapping[0].channel = "7";
pruicss1.intcMapping[0].host    = "8";

/**
 * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
 * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
 * re-solve from scratch.
 */
gpio1.GPIO.$suggestSolution                                 = "GPIO0";
gpio2.GPIO.$suggestSolution                                 = "GPIO0";
debug_log.uartLog.UART.$suggestSolution                     = "USART0";
debug_log.uartLog.UART.RXD.$suggestSolution                 = "ball.D15";
debug_log.uartLog.UART.TXD.$suggestSolution                 = "ball.C16";
enet_icss1.PRU_ICSSG1_MDIO.$suggestSolution                 = "PRU_ICSSG1_MDIO0";
enet_icss1.PRU_ICSSG1_MDIO.MDC.$suggestSolution             = "ball.Y6";
enet_icss1.PRU_ICSSG1_MDIO.MDIO.$suggestSolution            = "ball.AA6";
enet_icss1.PRU_ICSSG1_IEP.$suggestSolution                  = "PRU_ICSSG1_IEP1";
enet_icss1.PRU_ICSSG1_IEP.EDC_LATCH_IN0.$suggestSolution    = "ball.Y13";
enet_icss1.PRU_ICSSG1_IEP.EDC_SYNC_OUT0.$suggestSolution    = "ball.V12";
enet_icss1.PRU_ICSSG1_MII_G_RT.$suggestSolution             = "PRU_ICSSG1_MII_G_RT";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_COL.$suggestSolution    = "ball.U15";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_CRS.$suggestSolution    = "ball.U14";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_RXD0.$suggestSolution   = "ball.Y7";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_RXD1.$suggestSolution   = "ball.U8";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_RXD2.$suggestSolution   = "ball.W8";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_RXD3.$suggestSolution   = "ball.V8";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_RXDV.$suggestSolution   = "ball.Y8";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_RXER.$suggestSolution   = "ball.V13";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_RXLINK.$suggestSolution = "ball.W13";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_TXD0.$suggestSolution   = "ball.AA8";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_TXD1.$suggestSolution   = "ball.U9";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_TXD2.$suggestSolution   = "ball.W9";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_TXD3.$suggestSolution   = "ball.AA9";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII0_TXEN.$suggestSolution   = "ball.Y9";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_COL.$suggestSolution    = "ball.V14";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_CRS.$suggestSolution    = "ball.W14";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_RXD0.$suggestSolution   = "ball.W11";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_RXD1.$suggestSolution   = "ball.V11";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_RXD2.$suggestSolution   = "ball.AA12";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_RXD3.$suggestSolution   = "ball.Y12";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_RXDV.$suggestSolution   = "ball.W12";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_RXER.$suggestSolution   = "ball.AA13";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_RXLINK.$suggestSolution = "ball.U12";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_TXD0.$suggestSolution   = "ball.AA10";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_TXD1.$suggestSolution   = "ball.V10";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_TXD2.$suggestSolution   = "ball.U10";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_TXD3.$suggestSolution   = "ball.AA11";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII1_TXEN.$suggestSolution   = "ball.Y11";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII_MR0_CLK.$suggestSolution = "ball.AA7";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII_MR1_CLK.$suggestSolution = "ball.U11";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII_MT0_CLK.$suggestSolution = "ball.V9";
enet_icss1.PRU_ICSSG1_MII_G_RT.MII_MT1_CLK.$suggestSolution = "ball.Y10";

接下来、我们在硬件目标上运行示例、应用程序中的日志看起来不错、但我们无法通过 PHY 看到任何通信:

==========================
      MULTIPORT TEST      
==========================

Init all peripheral clocks
----------------------------------------------
Enabling clocks!

Open all peripherals
----------------------------------------------

Init  configs EnetType:2, InstId :1
----------------------------------------------
icssg1: Open port 1
EnetPhy_bindDriver:1718 
icssg1: Open port 2
EnetPhy_bindDriver:1718 
PHY 3 is alive
PHY 7 is alive
icssg1: Register async IOCTL callback
icssg1: Register TX timestamp callback

Attach core id 1 on all peripherals
----------------------------------------------
icssg1: Attach core

Create RX tasks
----------------------------------------------
icssg1: Create RX task
icssg1: Waiting for link up...

Enet Multiport Menu:
 'T'  -  Enable timestamp prints
 't'  -  Disable timestamp prints
 's'  -  Print statistics
 'r'  -  Reset statistics
 'm'  -  Show allocated MAC addresses
 'd'  -  Enable dscp based priority mapping
 'x'  -  Stop the test

Icssg_handleLinkUp:3060 
icssg1: Port 1 link is up
icssg1: Set port state to 'Forward'
icssg1: Async IOCTL completed
icssg1: Async IOCTL completed
Icssg_handleLinkUp:3060 
icssg1: Port 2 link is up
icssg1: Set port state to 'Forward'
icssg1: Async IOCTL completed
icssg1: Async IOCTL completed
icssg1: Open DMA
initQs() txFreePktInfoQ initialized with 8 pkts
icssg1: Set MAC addr: 70:ff:76:1d:92:c1
icssg1: MAC port addr: 70:ff:76:1d:92:c1

我们看不到来自目标的任何通信(它应该回送所有接收到的帧)、但链路检测等似乎起作用。 我们在示例中稍微深入地看了一下,我们在 EnetUdma_rxCqIsr()函数中设置了一个断点,但从未调用过该断点。

我们在启动后立即进行了正确的 PHY 配置检查、以实现 PHY 寄存器转储:

PHY 3 Register Dump
Register 0000 is: 2100
Register 0001 is: 7849
Register 0002 is: 2000
Register 0003 is: A131
Register 0004 is: 0181
Register 0005 is: 0000
Register 0006 is: 0004
Register 0007 is: 2001
Register 0008 is: 0000
Register 0009 is: 0020
Register 000A is: 0100
Register 000B is: 040B
Register 000C is: 0000
Register 000D is: 0000
Register 000E is: 0000
Register 000F is: 0000
Register 0010 is: 0004
Register 0011 is: 0108
Register 0012 is: 0000
Register 0013 is: 0000
Register 0014 is: 0000
Register 0015 is: 0000
Register 0016 is: 0100
Register 0017 is: 0041
Register 0018 is: 0400
Register 0019 is: C003
Register 001A is: 0000
Register 001B is: 007D
Register 001C is: 05EE
Register 001D is: 0000
Register 001E is: 0102
Register 0467 is: 00CF
Register 0468 is: 2586

PHY 7 Register Dump
Register 0000 is: 2100
Register 0001 is: 7849
Register 0002 is: 2000
Register 0003 is: A131
Register 0004 is: 0181
Register 0005 is: 0000
Register 0006 is: 0004
Register 0007 is: 2001
Register 0008 is: 0000
Register 0009 is: 0020
Register 000A is: 0100
Register 000B is: 040B
Register 000C is: 0000
Register 000D is: 0000
Register 000E is: 0000
Register 000F is: 0000
Register 0010 is: 0004
Register 0011 is: 0108
Register 0012 is: 0000
Register 0013 is: 0000
Register 0014 is: 0000
Register 0015 is: 0000
Register 0016 is: 0100
Register 0017 is: 0041
Register 0018 is: 0400
Register 0019 is: C007
Register 001A is: 0000
Register 001B is: 007D
Register 001C is: 05EE
Register 001D is: 0000
Register 001E is: 0102
Register 0467 is: 00DF
Register 0468 is: 2186

我们感到奇怪的是、"自动协商"似乎被禁用-它应该通过自举引脚启用(请参阅寄存器0x0467中的自举锁存器)。

我们在 LinkUp 事件之后进行了额外的寄存器转储、现在他似乎正确启用了"自动协商"、但仍然无法进行通信。:

After LinkUp

PHY 3 Register Dump
Register 0000 is: 3100
Register 0001 is: 786D
Register 0002 is: 2000
Register 0003 is: A131
Register 0004 is: 01E1
Register 0005 is: CDE1
Register 0006 is: 000F
Register 0007 is: 2001
Register 0008 is: 0000
Register 0009 is: 0020
Register 000A is: 0100
Register 000B is: 040B
Register 000C is: 0000
Register 000D is: 0000
Register 000E is: 0000
Register 000F is: 0000
Register 0010 is: 0015
Register 0011 is: 0108
Register 0012 is: 6400
Register 0013 is: 2800
Register 0014 is: 0000
Register 0015 is: 0000
Register 0016 is: 0100
Register 0017 is: 0041
Register 0018 is: 0400
Register 0019 is: CC03
Register 001A is: 0000
Register 001B is: 007D
Register 001C is: 05EE
Register 001D is: 0000
Register 001E is: 0102
Register 0467 is: 00CF
Register 0468 is: 2586

PHY 7 Register Dump
Register 0000 is: 3100
Register 0001 is: 786D
Register 0002 is: 2000
Register 0003 is: A131
Register 0004 is: 01E1
Register 0005 is: 45E1
Register 0006 is: 0007
Register 0007 is: 2001
Register 0008 is: 0000
Register 0009 is: 0020
Register 000A is: 0100
Register 000B is: 040B
Register 000C is: 0000
Register 000D is: 0000
Register 000E is: 0000
Register 000F is: 0000
Register 0010 is: 0615
Register 0011 is: 0108
Register 0012 is: 6400
Register 0013 is: 2800
Register 0014 is: 0000
Register 0015 is: 0000
Register 0016 is: 0100
Register 0017 is: 0041
Register 0018 is: 0400
Register 0019 is: CC07
Register 001A is: 0000
Register 001B is: 007D
Register 001C is: 05EE
Register 001D is: 0000
Register 001E is: 0102
Register 0467 is: 00DF
Register 0468 is: 2186

下面是另一个使我们困惑的点:为什么在 LinkUp 之后寄存器0x19中保留的位10设置为1?

您是否有任何提示、为什么沟通无法正常进行、以及我们可以在哪里进一步调查?

此致

Alex

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Alex:

    寄存器0001读取0x786D、这是正常的。 这意味着与 Link-Partner 的连接成功

    寄存器0468读取0x2586、表示器件处于 MII 模式。

    这让我相信 MAC 通信存在问题、请咨询 MAC 产品进行故障排除。

    此致、

    Alvaro Reyes

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Alexander、

    您能否使用 以下回送模式进行测试-  MII 回送 和 模拟回送。

    如果 MII 环回本身失败、则需要 在 MAC 配置下进行调试。

    此致、
    Aakash

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Aakash、您好!

    感谢您提供有关回送模式的提示。

    我们运行了一个示例、我们发现需要为 MII 通信模式设置#define ENET_TEST_MII_MODE。 我们必须在示例文档:(

    但是、我们仍然很好奇、为什么寄存器0中的"Autocontion"位在链路之后会切换、即使它是通过引脚搭接设置的

    此致

    Alex