From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8CF3AC3DA4A for ; Fri, 2 Aug 2024 22:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eIf2Z8xfUOppJ4QPCEEzWDe13OvSm96VdoVeFbEEidI=; b=m4eE9C9jlGim4Zpn2YlYw4bAJU pQmbgsPjScpgbuu0kqH520jLUHxvxQm0iCmhkV/nyZcqkcgksTGazC3MpkhjkVpG7rRuLL3iUrdaV LHMpzBkQCqU2bbABVshqR+//WiV8/dzSaN4nLCvyT6kbSUhtyv8yVWnO+360gxPqTUmzOWyS4VP6r tP1qxdP5Eb6UaTV/ddfWT0lGr2hWr4A8feYnbRr9wYvAA97M/lz83KWey/vxoMsvHwuZ0Vek9wI1t q69GgpZCLLthMwvKIhEPDf5fuqZWQWmLxYtkVxEOVu5m78ZY7B3zZ2PV5WIZLrfURQfDueTOtGdhI YasEQa5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sa0QD-0000000ADuR-1xv4; Fri, 02 Aug 2024 22:06:49 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sa0Ph-0000000ADow-1e3s for linux-arm-kernel@lists.infradead.org; Fri, 02 Aug 2024 22:06:19 +0000 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7a1843b4cdbso5185173a12.2 for ; Fri, 02 Aug 2024 15:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1722636377; x=1723241177; darn=lists.infradead.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eIf2Z8xfUOppJ4QPCEEzWDe13OvSm96VdoVeFbEEidI=; b=VOwr9aN8hLAdIr9CyhvyxtbPvwWpI3bMl67z/YpjjPEXYxUT9yyHbpKebDyZ0bujYp PSaGsVXO8869LobkiorxdVRpLzpsGRauVZWULo8HSNpuanUUmT14BPfKxjhW/OZ3UNht 4CbMwS3GQNEVulnqwzhfaZazWSs90dJ0qj6wY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722636377; x=1723241177; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eIf2Z8xfUOppJ4QPCEEzWDe13OvSm96VdoVeFbEEidI=; b=jJPrPmSXAeztevJj/9QIDe4/UUSwgd+kinn9zeG+nC2CDCdC64mQ152+iNlZTJLBMq I+H8ZNc6bVgAyeORKEFZ2N0vqWkfxH9bApZskVvclbbaQ4nZmcA2cc1P5vVn9RUKuCOV fHBr+DU31JPjQO2QTsz19FEVs6+dnrWxfDAxLGnno3f8jhg8oy/Fcr6LtaZa12UECiBu sZ38u+sppEeQl9vscJL0+MG3EgFHJQI4nQHZF5k+VezjLNBMwMROLMKVWC14hIC1rqPs BoG00VjMDcjddBFD8/Y90jb/lk01E60r7rVggcwdLtNGKVQ2FWDzxQrNfWEYTSfEKYFt JjvQ== X-Forwarded-Encrypted: i=1; AJvYcCV+Ofj1WcxrbZYxygktWyqOreSqVqZxMdl/ud5O9osSIzkLgqmW+U/KttAHxJBvnFzjDC7JSjgog1qkZYxbG2sg5u+9qbgmI6lPA8Jp/5z4NaV7mpg= X-Gm-Message-State: AOJu0YxjJX6Q6OfQEkIxxNmOhlHIBcU04Fbw6q2z0CcD89/+P2A9Sv+8 5FWpuVOcbUMX3IxtDlReXE6sGEkdyBhjpSNKjA5ehBWhEcgZm05tlRSsWstCUakAwrgNF/lBiXl rCR9pIid9aMFhBA35SqxIWWXcumnMzrxIegNQ X-Google-Smtp-Source: AGHT+IGxtg3mlYSN2rnmmdH11LPx0I3q2XmRLrpKXRUZmiSUOVEth982q9X6S4T/IQAjtrfS3F02EOw6tsjhv/XAj2A= X-Received: by 2002:a05:6a20:3d81:b0:1c4:7d53:bf76 with SMTP id adf61e73a8af0-1c699624320mr7126559637.38.1722636376546; Fri, 02 Aug 2024 15:06:16 -0700 (PDT) MIME-Version: 1.0 References: <20240802031822.1862030-1-jitendra.vegiraju@broadcom.com> In-Reply-To: From: Jitendra Vegiraju Date: Fri, 2 Aug 2024 15:06:05 -0700 Message-ID: Subject: Re: [PATCH net-next v3 0/3] net: stmmac: Add PCI driver support for BCM8958x To: Serge Semin Cc: netdev@vger.kernel.org, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, bcm-kernel-feedback-list@broadcom.com, richardcochran@gmail.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org, andrew@lunn.ch, linux@armlinux.org.uk, horms@kernel.org, florian.fainelli@broadcom.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240802_150617_561259_D5116339 X-CRM114-Status: GOOD ( 37.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 2, 2024 at 3:02=E2=80=AFAM Serge Semin wrote: > > Hi Jitendra > > On Thu, Aug 01, 2024 at 08:18:19PM -0700, jitendra.vegiraju@broadcom.com = wrote: > > From: Jitendra Vegiraju > > > > This patchset adds basic PCI ethernet device driver support for Broadco= m > > BCM8958x Automotive Ethernet switch SoC devices. > > > > This SoC device has PCIe ethernet MAC attached to an integrated etherne= t > > switch using XGMII interface. The PCIe ethernet controller is presented= to > > the Linux host as PCI network device. > > > > The following block diagram gives an overview of the application. > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > > | Host CPU/Linux | > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > > || PCIe > > || > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > > | +--------------+ | > > | | PCIE Endpoint| | > > | | Ethernet | | > > | | Controller | | > > | | DMA | | > > | +--------------+ | > > | | MAC | BCM8958X | > > | +--------------+ SoC | > > | || XGMII | > > | || | > > | +--------------+ | > > | | Ethernet | | > > | | switch | | > > | +--------------+ | > > | || || || || | > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > > || || || || More external interfaces > > > > The MAC block on BCM8958x is based on Synopsis XGMAC 4.00a core. This > > driver uses common dwxgmac2 code where applicable. > > Thanks for submitting the series. > > I am curious how come Broadcom got to use an IP-core which hasn't > been even announced by Synopsys. AFAICS the most modern DW XGMAC > IP-core is of v3.xxa version: > > https://www.synopsys.com/dw/ipdir.php?ds=3Ddwc_ether_xgmac > I am not sure why the 4.00a IP-code is not announced for general availability yet. The Synopsis documentation for this IP mentions 3.xx IP as reference for this design and lists new features for 4.00a. > Are you sure that your device isn't equipped with some another DW MAC > IP-core, like DW 25G Ethernet MAC? (which BTW is equipped with a new > Hyper DMA engine with a capability to have up to 128/256 channels with > likely indirect addressing.) Do I miss something? > Yes, I briefly mentioned the new DMA architecture in the commit log for patch 1/3. You are correct, the name for the new DMA engine is Hyper DMA. It probably started with some 3.xx IP-Core. This DW-MAC is capable of 25G, but this SOC is not using 25G support. > * I'll join the patch set review after the weekend, sometime on the > next week. > > -Serge(y) > > > Driver functionality specific to this MAC is implemented in dwxgmac4.c. > > Management of integrated ethernet switch on this SoC is not handled by > > the PCIe interface. > > This SoC device has PCIe ethernet MAC directly attached to an integrate= d > > ethernet switch using XGMII interface. > > > > v2->v3: > > Addressed v2 comments from Andrew, Jakub, Russel and Simon. > > Based on suggestion by Russel and Andrew, added software node to cre= ate > > phylink in fixed-link mode. > > Moved dwxgmac4 specific functions to new files dwxgmac4.c and dwxgma= c4.h > > in stmmac core module. > > Reorganized the code to use the existing glue logic support for xgma= c in > > hwif.c and override ops functions for dwxgmac4 specific functions. > > The patch is split into three parts. > > Patch#1 Adds dma_ops for dwxgmac4 in stmmac core > > Patch#2 Hooks in the hardware interface handling for dwxgmac4 > > Patch#3 Adds PCI driver for BCM8958x device > > > > v1->v2: > > Minor fixes to address coding style issues. > > Sent v2 too soon by mistake, without waiting for review comments. > > Received feedback on this version. > > https://lore.kernel.org/netdev/20240511015924.41457-1-jitendra.vegir= aju@broadcom.com/ > > > > v1: > > https://lore.kernel.org/netdev/20240510000331.154486-1-jitendra.vegi= raju@broadcom.com/ > > > > Jitendra Vegiraju (3): > > Add basic dwxgmac4 support to stmmac core > > Integrate dwxgmac4 into stmmac hwif handling > > Add PCI driver support for BCM8958x > > > > MAINTAINERS | 8 + > > drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 + > > drivers/net/ethernet/stmicro/stmmac/Makefile | 3 +- > > drivers/net/ethernet/stmicro/stmmac/common.h | 4 + > > .../net/ethernet/stmicro/stmmac/dwmac-brcm.c | 517 ++++++++++++++++++ > > .../ethernet/stmicro/stmmac/dwxgmac2_dma.c | 31 ++ > > .../net/ethernet/stmicro/stmmac/dwxgmac4.c | 142 +++++ > > .../net/ethernet/stmicro/stmmac/dwxgmac4.h | 84 +++ > > drivers/net/ethernet/stmicro/stmmac/hwif.c | 26 +- > > drivers/net/ethernet/stmicro/stmmac/hwif.h | 1 + > > 10 files changed, 825 insertions(+), 2 deletions(-) > > create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-brcm.c > > create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwxgmac4.c > > create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwxgmac4.h > > > > -- > > 2.34.1 > > > >