Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1366920rdb; Mon, 19 Feb 2024 13:06:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWPOpXORA+5OctZHIDUehV2mX4yFvja/ZvM7MACpk2YPGzR1D5CbT+ms6ItOhydKO+VnyhbItdDdleWZRtWTd21X2PJvLi/ZVm8EL96Sg== X-Google-Smtp-Source: AGHT+IEwq2sZqdwLwnPeEmN1UAFJ0hEGkH2/IvHpG8z6ZQxKO2p0ARMkE/oMBZCHmNsPEjndewJg X-Received: by 2002:a05:6214:4884:b0:68d:131f:c61f with SMTP id pc4-20020a056214488400b0068d131fc61fmr20426864qvb.30.1708376775626; Mon, 19 Feb 2024 13:06:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708376775; cv=pass; d=google.com; s=arc-20160816; b=c+ABqVeuC7n3/0K1UUcyw4elxuDiOSD8J9IAL3xKbdsG9Ob+Iv/3f0f/9Juw14X42J QZvEjRB3LRIAXYJq0pR4QAnDaoq+4wnrQC1VfctmLEEwB3D9Nfm4PvFepJNcAzplHcVo BMYhPraaxP+HhU+BZEs2vgm0HNgl9sG4JkRH1uY3ou/szPIPbOIXV7FdP0Vo4v37RT3e p1Nu5bLSqQuME5zEqwXMAYv/2Tvvcrwh9o28AkSe83b2a+rVpqMZeoDqCao8pwDFsUfA HCH/nvofP6QOQGfHGpod4q5UhHBrFI/Xe+FzbqzysOpnNc9QK+qWrqnbl5yO+fq9b3JE t4iA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZOgxDgXjl4qwjPPUdr5tiry2hRdBim87LYWDSoqsvk4=; fh=Vu5oR2yWRWjzZc8mheCeXqC4k8l+KJqriw7nJR+XBLc=; b=ySPKjAEc7yVW4F6V0O11q2/AhZqo5BcoHkLh7XVfm+msIFfCPRPGIfu4sliaIPtscv pW0pWy/PDlq/nPXM+3bCuqUEomy0elKfmDCZG5VjbBuhVCo0Iq3Hw8Qv81v128rUWOpA 0kphEwLuKqTIr8LeFP+3XUVteB1c3xalNvcH3iyu3G2fZmOkJwlmNJhNm3V9AJcx5gv7 fM7Wci2nsyEOUY0ddVoyCNQgrEvPtxf/Iqbd6UA7k++EESJ908oh0iahLriYlvmaElzI lVMCPWHAF5CiZfZpLjuf41O1VXdf8Y62cZLcpvD1Gx+ZW2GHtJ4PJKk6ZZmopKjjtGWB Bi/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=cIM5NyNN; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-71988-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71988-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ib12-20020a0562141c8c00b0068f3fccc515si7106945qvb.394.2024.02.19.13.06.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 13:06:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71988-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=@lunn.ch header.s=20171124 header.b=cIM5NyNN; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-71988-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71988-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 15EE61C22237 for ; Mon, 19 Feb 2024 21:06:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B208D53E0C; Mon, 19 Feb 2024 21:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="cIM5NyNN" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 6B3381F18D; Mon, 19 Feb 2024 21:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708376764; cv=none; b=jzcqHFc+rGXAzdWLeoevqZgT3lkA8FVEeEEMoxqLlUZJBVio4nD+I9PEctmCpgT/P0OvEFJXkPNcLKBOgv84zbEVoN8WUykstJ+4POv2/e/UdmTrk7k1kyu/TfZvvu5mJDbqpLVmnc/stv2lXn3y5YvUL5TcZVUfV1aRLOC/rqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708376764; c=relaxed/simple; bh=KU4nGP7iEFzvC/1hs1YWVpyHfJhGdPFeSmJ8xNlLcWc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uaam/PdTHgGELq65WQ9y3k/DATIcyDd2nj5KWSfV1o6PW8sUBNnI00b1+xEq0avxo6hwcwPNoDL2J5EgDt3/iH2exSLyO9MIFJECIHKuhYwU3fFd7xxbHrwO5PP9deK8mQ1d7y9ejuLcAu7Rdb7Ge6ECc0y6k2O2k6gnevhhl5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=cIM5NyNN; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=ZOgxDgXjl4qwjPPUdr5tiry2hRdBim87LYWDSoqsvk4=; b=cIM5NyNNeWDim+UZ1Gwx6XfcEH f0PKlkovpQVxnvG2cREypNR88n5pUmtf9z7rqlwmUm6Mlq2lLbQ9zCs6uJBmddp0ZLAtOKLHBpDys Vh42aXe2ZCWSM/85RhEWepKUYNcpWuWbkn3S0mf1V8/O8/nCFQDdXzMRVaC8HXRF18zg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rcApd-008EUS-9d; Mon, 19 Feb 2024 22:05:45 +0100 Date: Mon, 19 Feb 2024 22:05:45 +0100 From: Andrew Lunn To: Yang Xiwen Cc: Yisen Zhuang , Salil Mehta , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiner Kallweit , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH net-next v3 3/6] net: hisilicon: add support for hisi_femac core on Hi3798MV200 Message-ID: <5572f4dd-dcf2-42ec-99c8-51bf4d1f28ba@lunn.ch> References: <20240220-net-v3-0-b68e5b75e765@outlook.com> <20240220-net-v3-3-b68e5b75e765@outlook.com> <29fc21f0-0e46-4d0f-8d4b-c4dbd1689c55@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Feb 20, 2024 at 04:14:36AM +0800, Yang Xiwen wrote: > On 2/20/2024 4:03 AM, Andrew Lunn wrote: > > > Note it's unable to put the MDIO bus node outside of MAC controller > > > (i.e. at the same level in the parent bus node). Because we need to > > > control all clocks and resets in FEMAC driver due to the phy reset > > > procedure. So the clocks can't be assigned to MDIO bus device, which is > > > an essential resource for the MDIO bus to work. > > What PHY driver is being used? If there a specific PHY driver for this > > hardware? Does it implement soft reset? > > I'm using generic PHY driver. > > It implements IEEE C22 standard. So there is a soft reset in BMCR register. > > > > > I'm wondering if you can skip hardware reset of the PHY and only do a > > software reset. > > There must be someone to deassert the hardware reset control signal for the > PHY. We can't rely on the boot loader to do that. And here even we choose to > skip the hardware reset procedure, the sequence of deasserting the reset > signals is also very important. (i.e. first PHY, then MAC and MACIF). > Opposite to the normal sequence. (we normally first register MAC driver, and > then PHY). There are a few MACs which require the PHY to provide a clock to the MAC before they can use their DMA engine. The PHY provides typically a 25MHz clock, which is used to driver the DMA. So long as you don't touch the DMA, you can access other parts of the MAC before the PHY is generating the clock. So it might be possible to take the MAC and MACIF out of reset, then create the MDIO bus, probe the PHY, take it out of reset so its generating the clock, and then complete the rest of the MAC setup. Andrew