From patchwork Tue May 12 09:59:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wu X-Patchwork-Id: 1288339 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49LtZ764kLz9sRR for ; Tue, 12 May 2020 19:59:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D932C81CED; Tue, 12 May 2020 11:59:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 1920A81D00; Tue, 12 May 2020 11:59:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_WEB,SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.130]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7EB4481CD4 for ; Tue, 12 May 2020 11:59:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=david.wu@rock-chips.com Received: from localhost (unknown [192.168.167.32]) by lucky1.263xmail.com (Postfix) with ESMTP id 5B97FB4C98; Tue, 12 May 2020 17:59:17 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P33519T140425669101312S1589277555513275_; Tue, 12 May 2020 17:59:16 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: david.wu@rock-chips.com X-SENDER: wdc@rock-chips.com X-LOGIN-NAME: david.wu@rock-chips.com X-FST-TO: u-boot@lists.denx.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: David Wu To: u-boot@lists.denx.de Cc: christophe.roullier@st.com, patrice.chotard@st.com, patrick.delaunay@st.com, swarren@nvidia.com, sjg@chromium.org, philipp.tomsich@theobroma-systems.com, kever.yang@rock-chips.com, joe.hershberger@ni.com, David Wu Subject: [RESEND PATCH v2 11/11] net: gmac_rockchip: Add RV1126 gmac support Date: Tue, 12 May 2020 17:59:14 +0800 Message-Id: <20200512095914.29600-1-david.wu@rock-chips.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200512095603.29126-1-david.wu@rock-chips.com> References: <20200512095603.29126-1-david.wu@rock-chips.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean This Soc is different from the previous Socs, need to define eqos_config, and follow the dwc_eth_qos driver process. Signed-off-by: David Wu --- Changes in v2: - None drivers/net/gmac_rockchip.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/net/gmac_rockchip.c b/drivers/net/gmac_rockchip.c index aa2bab4203..d48a0f516b 100644 --- a/drivers/net/gmac_rockchip.c +++ b/drivers/net/gmac_rockchip.c @@ -368,6 +368,13 @@ static int rv1108_set_rmii_speed(struct rockchip_eth_dev *dev) return 0; } +static int rv1126_set_rgmii_speed(struct rockchip_eth_dev *dev) +{ + /* TO DO... */ + + return 0; +} + static void px30_gmac_set_to_rmii(struct gmac_rockchip_platdata *pdata) { struct px30_grf *grf; @@ -577,6 +584,11 @@ static void rv1108_gmac_set_to_rmii(struct gmac_rockchip_platdata *pdata) RV1108_GMAC_PHY_INTF_SEL_RMII); } +static void rv1126_set_to_rgmii(struct gmac_rockchip_platdata *pdata) +{ + /* TO DO... */ +} + static int gmac_rockchip_probe(struct udevice *dev) { struct gmac_rockchip_platdata *pdata = dev_get_platdata(dev); @@ -837,6 +849,20 @@ const struct rk_gmac_ops rv1108_gmac_ops = { .set_to_rmii = rv1108_gmac_set_to_rmii, }; +const struct rk_gmac_ops rv1126_gmac_ops = { + .config = { + .reg_access_always_ok = false, + .mdio_wait = 10000, + .swr_wait = 200, + .config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_NOT_ENABLED, + .config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_100_150, + .ops = &eqos_rockchip_ops + }, + + .fix_mac_speed = rv1126_set_rgmii_speed, + .set_to_rgmii = rv1126_set_to_rgmii, +}; + static const struct udevice_id rockchip_gmac_ids[] = { { .compatible = "rockchip,px30-gmac", .data = (ulong)&px30_gmac_ops }, @@ -854,6 +880,8 @@ static const struct udevice_id rockchip_gmac_ids[] = { .data = (ulong)&rk3399_gmac_ops }, { .compatible = "rockchip,rv1108-gmac", .data = (ulong)&rv1108_gmac_ops }, + { .compatible = "rockchip,rv1126-gmac", + .data = (ulong)&rv1126_gmac_ops }, { } };