<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[【FAQ】全志R329以太网常用调试说明]]></title><description><![CDATA[<p dir="auto"><strong>需求背景</strong></p>
<p dir="auto">硬件：R329+ RTL8211F<br />
软件：Tina3.0及以上</p>
<p dir="auto"><strong>需求说明</strong></p>
<p dir="auto">对于单phy的平台以太网技术已经很成熟，这里提供一些以太网常用的调试方法。帮助客户快速定位常见问题。</p>
<p dir="auto"><strong>常用命令</strong></p>
<pre><code>ifconfig eth0 up        打开eth0 网卡
ifconfig eth0 down      关闭eth0 网卡
ifconfig eth0 promisc   设置网卡eth0为混杂模式
ifconfig eth0 -promisc  取消网卡eth0的混杂模式
ifconfig eth0 192.168.1.100   设置ip地址
ifconfig eth0 hw ether 4A:13:E4:F9:79:74   设置mac地址
ifconfig eth0 192.168.1.100  设置静态ip地址
udhcpc -i eth0         动态获取ip地址
</code></pre>
<p dir="auto"><strong>代码路径</strong></p>
<p dir="auto">内核代码</p>
<pre><code>gmac代码：
drivers/net/ethernet/allwinner/
sunxi-gmac.c  sunxi_gmac_ops.c
phy代码：(一般用内核generic的代码)
linux-4.9/drivers/net/phy
phy.c phy_device.c mdio_bus.c ...
</code></pre>
<p dir="auto">配置代码</p>
<pre><code>linux-4.9的适配
board.dts
 730                 gmac0: eth@05020000 {
 731                         phy-rst = &lt;&amp;r_pio PH 19 1 1 1 0&gt;;
 732                         use_ephy25m = &lt;1&gt;;
 733                         phy-mode = "rgmii";
 734                         tx-delay = &lt;7&gt;;
 735                         rx-delay = &lt;0&gt;;
 736                         status   = "okay";
 737                 };
</code></pre>
<p dir="auto"><strong>调试工具</strong></p>
<p dir="auto">1.ethtool</p>
<pre><code>ethtool -s eth0 speed 1000 duplex full autoneg on  //设置1000M全双工自适应
</code></pre>
<p dir="auto">2.brctl</p>
<pre><code>root@TinaLinux:/# brctl --help
BusyBox v1.27.2 () multi-call binary.

Usage: brctl COMMAND [BRIDGE [INTERFACE&rsqb;&rsqb;

Manage ethernet bridges

Commands:
        show                    Show a list of bridges
        addbr BRIDGE            Create BRIDGE
        delbr BRIDGE            Delete BRIDGE
        addif BRIDGE IFACE      Add IFACE to BRIDGE
        delif BRIDGE IFACE      Delete IFACE from BRIDGE
        setageing BRIDGE TIME           Set ageing time
        setfd BRIDGE TIME               Set bridge forward delay
        sethello BRIDGE TIME            Set hello time
        setmaxage BRIDGE TIME           Set max message age
        setpathcost BRIDGE COST         Set path cost
        setportprio BRIDGE PRIO         Set port priority
        setbridgeprio BRIDGE PRIO       Set bridge priority
        stp BRIDGE [1/yes/on|0/no/off]  STP on/off
root@TinaLinux:/# brctl addif br-lan eth0
[ 4312.718522] br-lan: port 1(eth0) entered blocking state
[ 4312.724433] br-lan: port 1(eth0) entered disabled state
[ 4312.730790] device eth0 entered promiscuous mode

root@TinaLinux:/# brctl delif br-lan eth0
[ 4270.518067] device eth0 left promiscuous mode
[ 4270.523335] br-lan: port 1(eth0) entered disabled state
</code></pre>
<p dir="auto">eth0加入和移除网桥时都会有混杂模式的打印<br />
br-lan网桥的配置</p>
<pre><code>&gt; Networking support &gt; Networking options
		&lt;*&gt; 802.1d Ethernet Bridging    //CONFIG_BRIDGE=y
</code></pre>
]]></description><link>https://bbs.aw-ol.com/topic/647/faq-全志r329以太网常用调试说明</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 20:35:39 GMT</lastBuildDate><atom:link href="https://bbs.aw-ol.com/topic/647.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Nov 2021 02:16:59 GMT</pubDate><ttl>60</ttl></channel></rss>