Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1048350lqb; Wed, 29 May 2024 20:49:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyyuilebgn8A5wKzLCC2qkyIh+g4eJRhzOOz5Mbqd5MznkgByBdyHObVnQtdAa3hnL2T9cSo41j3y8Irp+G33KWw+3mKv+b8YF3vjKPA== X-Google-Smtp-Source: AGHT+IFEL2Sy5aG9IN8T/agxjn71h+Nkhsima03uvVXmYwfcLbbgyFfYZ/R/hoHNyL9nhlC9KYXN X-Received: by 2002:a05:6358:591a:b0:197:3d6f:cce3 with SMTP id e5c5f4694b2df-199b0bf4b87mr107471955d.13.1717040969462; Wed, 29 May 2024 20:49:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717040969; cv=pass; d=google.com; s=arc-20160816; b=1Kmqkvj7Ojh6O2YDu6XRSJAklJBJlZ1/lGZuOgvj6uRexPbupd8g98vWIctsZduCiS qiQN5MinfI2msRx3tskq7tLbOMj4qrx9Gi+3TEqy0rxFA4hE2cPpvQYHV/LrcEZUvyfz tw5MbDlj1z9Yr00TOt1pASG6m3alo+dBN/D3YQsqiNV/JRjURKH2vRyOyk5ajUVKbWq+ h3NspxYgiTAyVUlIZC84gK9OpUVoaZk2MVqencvmSbeEGWkX6FuSPDqPodr9Ayr3ws+E XEDZefIe0+loEK7b3jtAsH6qG7w2dHc8P3BrB1ZoSfS5Is6aUDz7PqyjkpcBSSWTku3Q fYqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=cs05OID3e7uX2ZECYRsXuLx9IE5E1oSN2ODuOpcM6zg=; fh=64w9rzpF6DVhguYLsxgNyXq+elZJt94iD6uwxQl/s+k=; b=r+9EQcTQOZMN3vtTiE1/wifHGHsqhTEoHSbNUkXpqY2/edq6WKhA05lyZs/1ayfkif KvtIe4QK/LmOsbplPWJKjNJXTEHcWBjylRiVfqsqCJRrjg2TxHKUJCvsxqPAi5oEUhH/ x/bnPqIrRAH1NYeQbzsRQVJ/9l3ser/ourX1P9E66NnFdnnw5GfDAI5sT8kDzju2gQ99 yC/TjmK5AlHNR1Wof1mv7+6F8PJwpXrabXshria0UqyguBCsWYJ4ZTJkuEgSv8/uwjmA PW//tgUvrkpJS0Pv5BCVhW5hqyl1VCLe9c2zXFCOoB3ZAj9hGbnAblYeC4k5QLmVB2df OJHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Ig67y8G7; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-194921-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822198a925si11839802a12.169.2024.05.29.20.49.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 20:49:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194921-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Ig67y8G7; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-194921-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CB3F2B20E3E for ; Thu, 30 May 2024 03:49:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F226F142E6F; Thu, 30 May 2024 03:49:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Ig67y8G7" Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B65A91CF94; Thu, 30 May 2024 03:49:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717040943; cv=none; b=GrZbalQmr1TlPRXl7ABEqfF6kQUyhhmBIv2jXGym/viRpdDAPGHo1ZqsojuXvFx4O0tViBdLuXyQU9RtAc7dCEYo2Xi97/TEZZVjh7dQAuOPWFBk5zbw96ypORQu+y4nXQzl5H3aXqqKc7UkT7JOzh/QnFKKkXP6LjPxasMS9Uc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717040943; c=relaxed/simple; bh=1tGBxjzrZ1sMx5ybpfsD32P2D0/8/cSyzfUjsytRiB4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=QRJg5y9YqyPM4EE0h4G7LRfUYfeGspQjH0j93hmbpeVu9RIs9xLfcbySwxTZKBqtdnf2EA/6Gquo6upbsk5DndxITEin2/o+5XmvXIphU23eVUmyyepRjpBkyfD6EXcROsOhxDr449zmLuuF6egD2gMdxMMfQp6RORuzNqag9KY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=Ig67y8G7; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 89ca5a601e3711ef8c37dd7afa272265-20240530 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=cs05OID3e7uX2ZECYRsXuLx9IE5E1oSN2ODuOpcM6zg=; b=Ig67y8G76llzUydslvKh4BQnchTCbl0EB3beO6vgo2tf/pdDwAYTV6fUeKNTOc1Ffnazft0+Ah5fcaAgZmmFNMHzeDKqhebK3aA5OM+UeikBdM7pChlpYx4y8irhsXx71DGwtaxDS2x4NUAxdTrXjxEqiojSh6Fa1CBVnjVpuUE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.39,REQID:1d0ab4e8-8f8f-423d-9846-353da09fc2e1,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:393d96e,CLOUDID:67a3fd87-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 89ca5a601e3711ef8c37dd7afa272265-20240530 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 550476448; Thu, 30 May 2024 11:48:55 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 30 May 2024 11:48:54 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 30 May 2024 11:48:54 +0800 From: Sky Huang To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Daniel Golle , Qingfang Deng , SkyLake Huang , Matthias Brugger , AngeloGioacchino Del Regno , , , , CC: Steven Liu , SkyLake.Huang Subject: [PATCH net-next v5 0/5] net: phy: mediatek: Introduce mtk-phy-lib and add 2.5Gphy support Date: Thu, 30 May 2024 11:48:39 +0800 Message-ID: <20240530034844.11176-1-SkyLake.Huang@mediatek.com> X-Mailer: git-send-email 2.18.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N From: "SkyLake.Huang" v2: - Apply correct PATCH tag. - Break LED/Token ring/Extend-link-pulse-time features into 3 patches. - Fix contents according to v1 comments. v3: - Rebase code and now this patch series can apply to net-next tree. [PATCH 4/5] Refactor mtk_gphy_cl22_read_status() with genphy_read_status(). [PATCH 5/5] 1. Add range check for firmware. 2. Fix c45_ids.mmds_present in probe function. 3. Still use genphy_update_link() in read_status because genphy_c45_read_link() can't correct detect link on this phy. v4: [PATCH 4/5] 1. Change extend_an_new_lp_cnt_limit()'s return type and all return values 2. Refactor comments in extend_an_new_lp_cnt_limit() [PATCH 5/5] 1. Move firmware loading function to mt798x_2p5ge_phy_load_fw() 2. Add AN disable warning in mt798x_2p5ge_phy_config_aneg() 3. Clarify the HDX comments in mt798x_2p5ge_phy_get_features() v5: - Fix syntax errors of comments in drivers/net/phy/mediatek/* [PATCH 1/5] - Change MEDIATEK_GE_SOC_PHY from bool back to tristate. [PATCH 5/5] 1. Move md32_en_cfg_base & pmb_addr to local variables to achieve symmetric code. 2. Print out firmware date code & version. 3. Don't return error if LED pinctrl switching fails. Also, add comments to this unusual operations. 4. Return -EOPNOTSUPP for AN off case in config_aneg(). SkyLake.Huang (5): net: phy: mediatek: Re-organize MediaTek ethernet phy drivers net: phy: mediatek: Move LED and read/write page helper functions into mtk phy lib net: phy: mediatek: Add token ring access helper functions in mtk-phy-lib net: phy: mediatek: Extend 1G TX/RX link pulse time net: phy: add driver for built-in 2.5G ethernet PHY on MT7988 MAINTAINERS | 7 +- drivers/net/phy/Kconfig | 17 +- drivers/net/phy/Makefile | 3 +- drivers/net/phy/mediatek-ge.c | 111 ---- drivers/net/phy/mediatek/Kconfig | 38 ++ drivers/net/phy/mediatek/Makefile | 5 + drivers/net/phy/mediatek/mtk-2p5ge.c | 423 ++++++++++++++ .../mtk-ge-soc.c} | 528 ++++++------------ drivers/net/phy/mediatek/mtk-ge.c | 244 ++++++++ drivers/net/phy/mediatek/mtk-phy-lib.c | 385 +++++++++++++ drivers/net/phy/mediatek/mtk.h | 108 ++++ 11 files changed, 1391 insertions(+), 478 deletions(-) delete mode 100644 drivers/net/phy/mediatek-ge.c create mode 100644 drivers/net/phy/mediatek/Kconfig create mode 100644 drivers/net/phy/mediatek/Makefile create mode 100644 drivers/net/phy/mediatek/mtk-2p5ge.c rename drivers/net/phy/{mediatek-ge-soc.c => mediatek/mtk-ge-soc.c} (77%) create mode 100644 drivers/net/phy/mediatek/mtk-ge.c create mode 100644 drivers/net/phy/mediatek/mtk-phy-lib.c create mode 100644 drivers/net/phy/mediatek/mtk.h -- 2.18.0