Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp886080rdb; Sat, 6 Jan 2024 14:03:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGv/KaHkB00WXmaBBYbVCUPqR7mbsniwcLpOL3m6Rs89sGc4iqeZg6B+ELeIX8jaViUD01q X-Received: by 2002:a05:6214:2268:b0:680:c82e:97c1 with SMTP id gs8-20020a056214226800b00680c82e97c1mr2464464qvb.46.1704578635046; Sat, 06 Jan 2024 14:03:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704578635; cv=none; d=google.com; s=arc-20160816; b=UHtRRU5AV8dmVjY7mKz7SLMBoPwbK766W/Skarc/4D80uf8NsfuSK2AsITwuK7TsBl NlETw89Ub1mN3HldTMrw9u51di9wDswZlwnLmkIkdfuLNa4mXqgID77um1KD/6j71nth g2aNMpguOE4Ber9quY6JL9b1I1p9QujKxpIKkFTCHhifQVhlHAZjoyLwY5JfqZn4hJ4S h6kFvMIZVcu1AfZWFAu2YbtfQ41a3svX4NwvpspoVkpO/D6wvqBPypjz3OR9h5Xruocg wrXsW32+3w8rYXjJJAMN/Ieril0aE2FeNDrpQL3ooZqAzKLuIpEPjczm/fK9AkE070f0 n7uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Lsex701tK5pEY9KKRutw30UPF14FTBUAFWLK2f3CQHw=; fh=68RgKoabxfhyv3A0MGu1eBhlKoIZRg8ZgftQiXISmWg=; b=g+innwomoD8IqKcGHOb7luGlblfcQN3IXteiR7GJ5hLQPWPbDA5Wf+6PcxVJbkedVU rnTh0wah5zHcVfCLy8Sqpvxm6iZQz9c4Pu1W5LtVdKK4+bl6THbTd7ytNtkXIuFFYzud c52iT4ler5vb1iMhsGj3wURjRUuBunEvD7EGwK/WmpxtfgnAHfiLySxVFnQ8DmoXTH32 yT2rFuGNi4EXxkcpw4utPYSc5F0uSqWNljk6xN6RSHAHhrxDKA14bAFnOCZ7eV5SI7Rj lGAAUp1uS7+dZuf8KMKv2My6dVskNsWQV8Xnu3bp8c50knWylJOAgy2vrpDIMHEgTWA6 sP3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nJQ1aIUW; spf=pass (google.com: domain of linux-kernel+bounces-18723-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18723-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e19-20020a0cf353000000b0067f9b96b46csi4634075qvm.259.2024.01.06.14.03.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 14:03:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18723-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nJQ1aIUW; spf=pass (google.com: domain of linux-kernel+bounces-18723-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18723-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BE6B51C210A9 for ; Sat, 6 Jan 2024 22:03:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D686B101D4; Sat, 6 Jan 2024 22:03:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nJQ1aIUW" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 807CAF9EC; Sat, 6 Jan 2024 22:03:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3368b1e056eso665367f8f.3; Sat, 06 Jan 2024 14:03:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704578618; x=1705183418; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Lsex701tK5pEY9KKRutw30UPF14FTBUAFWLK2f3CQHw=; b=nJQ1aIUWgaj80sClMj6gXPIMV3QI8mB4mI7KHOFwb8DEJ7gxixsHnZqVcwEgvzD+PF SvRtaLohc3Myh4aMYP19gZcp0uDT+KknFeT1FbR0yCX4RNdKyoTpjH+NWoPGo9QowcJ9 yvVy2QIlAZ+GP+hEm+4ipaPXo9PxSq4naZbrQIOEbNVMhoMcF2KP/iBizO3CkjneveYY Yq6+cWGzeAe2n5P4CAV3dIW/Cspx4KjPUyspdUWmxD5WCJH1NnjmVlKLohF+Kd2xJMnx iUsnP59SHrAnxbxcKl6POQUBdSKJdZi8jZ0TCi+szQ19wUwnVD2EvG/FiYMoollJgUa+ mQUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704578618; x=1705183418; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lsex701tK5pEY9KKRutw30UPF14FTBUAFWLK2f3CQHw=; b=laH2UaLNEHvgPYv+RfxQkqwZxtUjCdwP0GB/RVzLkjmqplGbkGMS0GlZhV3Lkc7zhZ GU9evoq0p6dKdpYl+usUuH6h+q3bAZfXPtX1IiW5l/Y895eAnkC56gYRWi80Sganz+5z VFZvLWRaoxrtWKJ+OevWFofENJyt5eNyrz/XgsmgkXhrGbZAl1lnMbBKFbo/1FkieEaJ da8JTJK78QhGgTnYvYTkg333XaN7SEkLrPDXH+/EDl1qiTXhGR1CrV/QbcFSw6fbLwaG 35W83ep2w+GRmpQZoqp8iBUlRqhZ1w35Y3yRGpQsGQEQwT95Uchzwrz7AFzCKqbp/E1l QXjg== X-Gm-Message-State: AOJu0YzVDZ4TwRd1o3GzC4uDYQzUQWVCsX8zC21cLKQZwtJrnuDzk38v hFvsvFtJs7QqvCWZ1H5jgQw= X-Received: by 2002:a5d:408a:0:b0:337:555b:d320 with SMTP id o10-20020a5d408a000000b00337555bd320mr747108wrp.39.1704578617487; Sat, 06 Jan 2024 14:03:37 -0800 (PST) Received: from [192.168.0.3] ([69.6.8.124]) by smtp.gmail.com with ESMTPSA id r16-20020a056000015000b003373ef060d5sm4069972wrx.113.2024.01.06.14.03.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Jan 2024 14:03:36 -0800 (PST) Message-ID: <1df87389-d78c-48e0-b743-0fd11bd82b85@gmail.com> Date: Sun, 7 Jan 2024 00:03:34 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/5] support ipq5332 platform Content-Language: en-US To: Andrew Lunn Cc: Jie Luo , agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk, robert.marko@sartura.hr, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_srichara@quicinc.com References: <20231225084424.30986-1-quic_luoj@quicinc.com> <895eadd7-1631-4b6b-8db4-d371f2e52611@lunn.ch> From: Sergey Ryazanov In-Reply-To: <895eadd7-1631-4b6b-8db4-d371f2e52611@lunn.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 06.01.2024 17:45, Andrew Lunn wrote: >> I just realized that the UNIPHY block is a MII (probably SGMII) controller. >> Isn't it? And I expect that it responsible more then just for clock >> enabling. It should also activate and perform a basic configuration of MII >> for actual data transmission. If so, then it should placed somewhere under >> drivers/net/phy or drivers/net/pcs. > > Before we decide that, we need a description of what the UNIPHY > actually does, what registers it has, etc. Sometimes blocks like this > get split into a generic PHY, aka drivers/phy/ and a PCS driver. This > would be true if the UNIPHY is also used for USB SERDES, SATA SERDES > etc. The SERDES parts go into a generic PHY driver, and the SGMII on > to of the SERDES is placed is a PCS driver. As far as I understand, UNIPHY only contains SGMII/PSGMII/whatever and a simple clock controller. PCIe & USB phys are implemented in other hardware blocks. See the lately merged USB support code for similar IPQ5018 SoC. But I can only speak to what I found searching online and checking the vendor's qca-ssdk "driver". https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk/-/tree/NHSS.QSDK.12.4.5.r3 I hope Luo can clarify with more confidence. > The problem i have so far is that there is no usable description of > any of this hardware, and the developers trying to produce drivers for > this hardware don't actually seem to understand the Linux architecture > for things like this. > >> As far as I understand, we basically agree that clocks configuration can be >> implemented based on the clock API using a more specialized driver(s) than >> MDIO. The only obstacle is the PHY chip initialization issue explained >> below. >> Thank you for this compact yet detailed summary. Now it much more clear, >> what this phy chip requires to be initialized. >> >> Looks like you need to implement at least two drivers: >> 1. chip (package) level driver that is responsible for basic "package" >> initialization; >> 2. phy driver to handle actual phy capabilities. > > Nope. As i keep saying, please look at the work Christian is > doing. phylib already has the concept of a PHY package, e.g. look at > the MSCC driver, and how it uses devm_phy_package_join(). What is > missing is a DT binding which allows package properties to be > expressed in DT. And this is what Christian is adding. Andrew, thank you so much for pointing me to that API and Christian's work. I have checked the DT change proposal and it fits this QCA8084 case perfectly. Am I right that all one has to do to solve this QCA8084 initialization case is wrap phys in a ethernet-phy-package node and use devm_phy_package_join() / phy_package_init_once() to do the basic initialization? So simple? I came to put my 2c in and learnt a couple of new tricks. What a nice day :) -- Sergey