Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp213915pxy; Sat, 14 Aug 2021 05:08:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZfbxZO7zFBb1LOZvKAbr9cGMj8MgK+q7N4m1ZjKo5VC55F86GJFiRoGdf8ji2jQgvUC99 X-Received: by 2002:aa7:c7d0:: with SMTP id o16mr8691191eds.75.1628942899059; Sat, 14 Aug 2021 05:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628942899; cv=none; d=google.com; s=arc-20160816; b=YHWTdNhb8rPkKohClQb554BhCAAYtElxqLbHxRox+py7VwOrpcEAI93AFxjvqu9GTS fDc2aG2H5INtojcHlf6C2Mg+0yCBPPRahEpLoZYgKFVsadE7y3wApJC8Yi6Pi4mssKT3 nOQmp94EGVSURawMV9r1DBlVh3cjh0lb/pvdi3saCqmDpLMxht3KawwkGUwLBdJFU1HC fADWslUG49yeLyD/GjeVJE7qq087gc/ikW8CPP3msCkaARpDoRahAfOtKREAU3cUWqKW 4Rqw8UnYIPLpCb5FbSlOeGKoVqoIPX5fdiPaaLRg4Q2KNg8PW0GfmFFLq+8hWmG6BwyX cxUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qpQN2aTKtGCMgoh9M7a5uv16Wg9lA0To7j/jpu/dotM=; b=umcXQRqIoC+1Kxa0FwFij8dWgDzctb1xIUrVrXw9oxtX0u2efavY0qW7bq1GvNn1MV 3hIVwcNsQktx6BSmtecw3A8GMsQFZZbquxFJYzYP8RIG4kTakU1mSIUMQE2s8u4nCt1i h8LbpfUt2yvgNkcRJR1l3gbLIq9BAuD2DVVkJ0k+GOZkn/RcL90QHMShgaQ8QUCYk8pm uRjU0wN2Y7Uhh3QJ2XtGTRRx31oSa6tW1WjCHHH1ozp1Vuh6auahfrpXimOWC4Y6j3Fz frrp0sBeHqGgZLBE5RtuxH+SHeLgxtehJXP7nOMbcnoBYG1aJlRmAvShnV965A4MZDEY WZ0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bKS4yGk6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si6005862ejy.271.2021.08.14.05.07.50; Sat, 14 Aug 2021 05:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bKS4yGk6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238358AbhHNMCq (ORCPT + 99 others); Sat, 14 Aug 2021 08:02:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238064AbhHNMCn (ORCPT ); Sat, 14 Aug 2021 08:02:43 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54305C061764; Sat, 14 Aug 2021 05:02:15 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id lo4so23096575ejb.7; Sat, 14 Aug 2021 05:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qpQN2aTKtGCMgoh9M7a5uv16Wg9lA0To7j/jpu/dotM=; b=bKS4yGk6Fti2p1kFwiaS16i4xy5dlAA1rLYFW1Zxr+tWuJQwVgl+4zSh02FZ238J1j WcaESiPePl+mM9B6+Z4raxEVXELqC4/r1uiGmtpx12MsAP+4dOmAJDQsMVy4IqRDyGyJ JHPxEa9VwvG4Q/MglkZ6WFXG2QXlIOutehxfvMuowqLY/H0JGQHAqtw0uUsljI7UrJDS pkw449U2HCXW87ukHgh1KeIJR8P5D6d1Gr5ZB8kAZtL6q6N4ytwqlyaLFMTPjqfWQKaS 7S21qTLEvcMx4ucd0jlqUuqf6ZtdcaGvqoXAohcsfJaocLZEC+I6RTpXBJiqYyQwYdn/ dvpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qpQN2aTKtGCMgoh9M7a5uv16Wg9lA0To7j/jpu/dotM=; b=ii2TRoWRjcplHpxia5s4YyBKRsvQtETDgXPK/ci3bsMxorsq4fsop2SvPJU2TxNzsU LrNAj1gxycHkqREv0ots9b6/CGiLG8RJ0bTRtUoT77okpXhMaOxn3pM89pknkr8DCQTu ZgDnqFjHVo8B/fHGEPkz5AhbDy8vDXfN27SaXuYnviklXV9dRNmOQ5ADNSPClRbV9HK1 NR+J14h3xXq1++BdBT9CXUHRgXg32Jb2DfPzlrxMZo9XS8fan3jSpfYi+j/Yy3OTc5UU SdnB14IB8WN+V6td4L+xkSV8yNouO09OpVo9SjU6a8sMHUbvbZDP5+JPan1RlSMdzHA5 oFlg== X-Gm-Message-State: AOAM532nczJrNnm9AEs1DvAH0ZX//GU0UZveOhFAW+PV3AukwjNHFoJX 2acTEX03Yp4E4Aegm3NDats= X-Received: by 2002:a17:906:13d2:: with SMTP id g18mr7170183ejc.280.1628942533886; Sat, 14 Aug 2021 05:02:13 -0700 (PDT) Received: from skbuf ([188.25.144.60]) by smtp.gmail.com with ESMTPSA id u2sm2172760edd.82.2021.08.14.05.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Aug 2021 05:02:13 -0700 (PDT) Date: Sat, 14 Aug 2021 15:02:11 +0300 From: Vladimir Oltean To: Colin Foster Cc: andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, claudiu.manoil@nxp.com, alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com, hkallweit1@gmail.com, linux@armlinux.org.uk, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v3 net-next 09/10] net: dsa: ocelot: felix: add support for VSC75XX control over SPI Message-ID: <20210814120211.v2qjqgi6l3slnkq2@skbuf> References: <20210814025003.2449143-1-colin.foster@in-advantage.com> <20210814025003.2449143-10-colin.foster@in-advantage.com> <20210814114329.mycpcfwoqpqxzsyl@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210814114329.mycpcfwoqpqxzsyl@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 14, 2021 at 02:43:29PM +0300, Vladimir Oltean wrote: > The issue is that the registers for the PCS1G block look nothing like > the MDIO clause 22 layout, so anything that tries to map the struct > ocelot_pcs over a struct mdio_device is going to look like a horrible > shoehorn. > > For that we might need Russell's assistance. > > The documentation is at: > http://ww1.microchip.com/downloads/en/DeviceDoc/VMDS-10489.pdf > search for "Information about the registers for this product is available in the attached file." > and then open the PDF embedded within the PDF. In fact I do notice now that as long as you don't use any of the optional phylink_mii_c22_pcs_* helpers in your PCS driver, then struct phylink_pcs has pretty much zero dependency on struct mdio_device, which means that I'm wrong and it should be completely within reach to write a dedicated PCS driver for this hardware. As to how to make the common felix.c work with different implementations of struct phylink_pcs, one thing that certainly has to change is that struct felix should hold a struct phylink_pcs **pcs and not a struct lynx_pcs **pcs. Does this mean that we should refactor lynx_pcs_create() to return a struct phylink_pcs * instead of struct lynx_pcs *, and lynx_pcs_destroy() to receive the struct phylink_pcs *, use container_of() and free the larger struct lynx_pcs *? Yes, probably. If you feel uncomfortable with this, I can try to refactor lynx_pcs to make it easier to accomodate a different PCS driver in felix.