您尚未登录。

#1 Re: 全志 SOC » 全志T113的主线内核的EMAC问题 » 2025-10-17 20:19:18

这是原理图部分,板子是淘宝上的 bingpi_m2
Snipaste_2025-10-17_20-17-36.png

#2 Re: 全志 SOC » 全志T113的主线内核的EMAC问题 » 2025-10-17 20:10:24

	rmii_pg_pins: rmii-pg-pins {
		pins = "PG0", "PG1", "PG2", "PG3", "PG4", "PG5",
			   "PG11", "PG12", "PG13", "PG14", "PG15";
		function = "emac";
		drive-strength = <10>;
	};

PG11 和 drive-strength 是改驱动之前调试时写的
其中 PG11 是 25M 时钟引脚
还没测去掉这两项后能否跑通

#3 Re: 全志 SOC » 全志T113的主线内核的EMAC问题 » 2025-10-01 00:44:03

参考实现,内核版本 6.12.0

diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index a00a667454a9..411ca8fbb30e 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -21,6 +21,7 @@
 #include <linux/ethtool.h>
 #include <linux/phy.h>
 #include <linux/property.h>
+#include <linux/clk.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -89,6 +90,7 @@ static struct ip101g_hw_stat ip101g_hw_stats[] = {
 struct ip101a_g_phy_priv {
 	enum ip101gr_sel_intr32 sel_intr32;
 	u64 stats[ARRAY_SIZE(ip101g_hw_stats)];
+	struct clk *clk;
 };
 
 static int ip175c_config_init(struct phy_device *phydev)
@@ -210,6 +212,11 @@ static int ip101a_g_probe(struct phy_device *phydev)
 	if (!priv)
 		return -ENOMEM;
 
+	priv->clk = devm_clk_get_optional_enabled(dev, NULL);
+	if (IS_ERR(priv->clk))
+		return dev_err_probe(dev, PTR_ERR(priv->clk),
+				     "failed to get phy clock\n");
+
 	/* Both functions (RX error and interrupt status) are sharing the same
 	 * pin on the 32-pin IP101GR, so this is an exclusive choice.
 	 */
@@ -571,6 +578,33 @@ static void ip101g_get_stats(struct phy_device *phydev,
 		data[i] = ip101g_get_stat(phydev, i);
 }

+static int ip101a_g_suspend(struct phy_device *phydev)
+{
+	struct ip101a_g_phy_priv *priv = phydev->priv;
+	int ret = 0;
+
+	if (!phydev->wol_enabled) {
+		ret = genphy_suspend(phydev);
+
+		if (ret)
+			return ret;
+
+		clk_disable_unprepare(priv->clk);
+	}
+
+	return ret;
+}
+
+static int ip101a_g_resume(struct phy_device *phydev)
+{
+	struct ip101a_g_phy_priv *priv = phydev->priv;
+
+	if (!phydev->wol_enabled)
++		clk_prepare_enable(priv->clk);
+
+	return genphy_resume(phydev);
+}
+
 static struct phy_driver icplus_driver[] = {
 {
 	PHY_ID_MATCH_MODEL(IP175C_PHY_ID),
@@ -601,8 +635,9 @@ static struct phy_driver icplus_driver[] = {
 	.config_aneg	= ip101a_g_config_aneg,
 	.read_status	= ip101a_g_read_status,
 	.soft_reset	= genphy_soft_reset,
-	.suspend	= genphy_suspend,
-	.resume		= genphy_resume,
+	.suspend	= ip101a_g_suspend,
+	.resume		= ip101a_g_resume,
+	.flags		= PHY_ALWAYS_CALL_SUSPEND,
 }, {
 	.name		= "ICPlus IP101G",
 	.match_phy_device = ip101g_match_phy_device,
@@ -618,8 +653,9 @@ static struct phy_driver icplus_driver[] = {
 	.get_sset_count = ip101g_get_sset_count,
 	.get_strings	= ip101g_get_strings,
 	.get_stats	= ip101g_get_stats,
-	.suspend	= genphy_suspend,
-	.resume		= genphy_resume,
+	.suspend	= ip101a_g_suspend,
+	.resume		= ip101a_g_resume,
+	.flags		= PHY_ALWAYS_CALL_SUSPEND,
 } };
 
 module_phy_driver(icplus_driver);
&emac {
	pinctrl-names = "default";
	pinctrl-0 = <&rmii_pg_pins>;
	phy-mode = "rmii";
	phy-handle = <&phy1>;
	phy-supply = <&reg_vcc3v3>;
	status = "okay";
};

&mdio {
	status = "okay";

	phy1: ethernet-phy@1 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <1>;
		reset-gpios = <&pio 6 6 GPIO_ACTIVE_LOW>; /* PG6 */
		reset-assert-us = <5000>;
		reset-deassert-us = <5000>;
		clocks = <&ccu CLK_EMAC_25M>;
	};
};

#4 Re: 全志 SOC » 全志T113的主线内核的EMAC问题 » 2025-10-01 00:31:17

困扰了我好久,在网上翻出这个
按照 https://lore.kernel.org/netdev/20230605154010.49611-2-detlev.casanova@collabora.com/T/#u
格式修改对应的phy驱动
然后在phy节点添加 clocks = <&ccu CLK_EMAC_25M>;

#6 Re: 全志 SOC » T113-S3 RGB液晶颜色不对 » 2025-02-14 21:44:12

我的t113s3也有类似的问题,用的主线6.12内核,上电后屏幕底色大概率为绿色,偶尔会有浅蓝色
折腾了好久最后在网上找到一个临时的解决方案:
https://lists.freedesktop.org/archives/dri-devel/2024-November/477063.html,
sun8i_tcon_top.c文件182行writel(0, regs + TCON_TOP_PORT_SEL_REG);
第一个参数改为0x20后显示就正常了
IMG_0826.jpg

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn


太原小智科技有限责任公司 - 东莞哇酷科技有限公司联合开发