From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.207]) (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 5286528C867; Fri, 30 May 2025 23:41:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.207 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748648469; cv=none; b=d3xQ7ZMjOXyH6ZcV6cshwbujq7TdfccCj5tzfuXEXnFGDTlVCJWWZ91hKkhS5UPiv/L51b7ErEuKWWd4oeSKt9XIw1D0tfBV2GoLY5S041nIx0J2iMIU90A1pAq/pVQ3X8wBk8dENb/Mi6ont+7txTUaabgcYUN4v99wDM/X+HE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748648469; c=relaxed/simple; bh=4B9tzFxEtbtW0QuF/1fX2tnzYHvPuPpKA+2T69jnTy4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rxUJ1inNZXMhwDuTqMqL0ABb1JxhWg5TlaJNnRrKp7mOXE5Pf5h9QYhDQ/qHJ+HxsKrvBXtWTapmMwHWvCxQbxF7kxPJ9dCWWSBbjfM5EObCfhzohyApqmhyC/qZHw7EP64NDMHgGgVmqqcMtNzrDVlYVMakj4POCr6Zb3Wvzso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=VH0hhQNr; arc=none smtp.client-ip=192.19.144.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="VH0hhQNr" Received: from mail-lvn-it-01.broadcom.com (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 4618FC000C7D; Fri, 30 May 2025 16:41:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 4618FC000C7D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1748648467; bh=4B9tzFxEtbtW0QuF/1fX2tnzYHvPuPpKA+2T69jnTy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VH0hhQNrGsFcjOBZ9UM7Kv4dHYZheib5522XceonxslInZtyRRPHIWyEMCX9iyzMB HsDiYyup1Udh9HNVVYe8OZqbMJSLErYb2w9JGz6bUqKNJGMNXFLcvwThM1DOiciykB OMrtKH60klwtkl1paixIauLo2ibeFRKnSLQr23s8= Received: from fainelli-desktop.igp.broadcom.net (fainelli-desktop.dhcp.broadcom.net [10.67.48.245]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail-lvn-it-01.broadcom.com (Postfix) with ESMTPSA id A6FCD180008FB; Fri, 30 May 2025 16:41:06 -0700 (PDT) From: Florian Fainelli To: bcm-kernel-feedback-list@broadcom.com, Andrea della Porta , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Lorenzo Pieralisi , Krzysztof Wilczynski , Manivannan Sadhasivam , Bjorn Helgaas , Linus Walleij , Catalin Marinas , Will Deacon , Bartosz Golaszewski , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Saravana Kannan , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-gpio@vger.kernel.org, Masahiro Yamada , Stefan Wahren , Herve Codina , Luca Ceresoli , Thomas Petazzoni , Andrew Lunn , Phil Elwell , Dave Stevenson , kernel-list@raspberrypi.com, Matthias Brugger Cc: Florian Fainelli Subject: Re: [PATCH v12 07/13] misc: rp1: RaspberryPi RP1 misc driver Date: Fri, 30 May 2025 16:41:06 -0700 Message-ID: <20250530234106.465777-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250529135052.28398-7-andrea.porta@suse.com> References: <20250529135052.28398-7-andrea.porta@suse.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Florian Fainelli On Thu, 29 May 2025 15:50:44 +0200, Andrea della Porta wrote: > The RaspberryPi RP1 is a PCI multi function device containing > peripherals ranging from Ethernet to USB controller, I2C, SPI > and others. > > Implement a bare minimum driver to operate the RP1, leveraging > actual OF based driver implementations for the on-board peripherals > by loading a devicetree overlay during driver probe if the RP1 > node is not already present in the DT. > > The peripherals are accessed by mapping MMIO registers starting > from PCI BAR1 region. > > With the overlay approach we can achieve more generic and agnostic > approach to managing this chipset, being that it is a PCI endpoint > and could possibly be reused in other hw implementations. The > presented approach is also used by Bootlin's Microchip LAN966x > patchset (see link) as well, for a similar chipset. > In this case, the inclusion tree for the DT overlay is as follow > (the arrow points to the includer): > > rp1-pci.dtso <---- rp1-common.dtsi > > On the other hand, to ensure compatibility with downstream, this > driver can also work with a DT already comprising the RP1 node, so > the dynamically loaded overlay will not be used if the DT is already > fully defined. > > The reason why this driver is contained in drivers/misc has > been paved by Bootlin's LAN966X driver, which first used the > overlay approach to implement non discoverable peripherals behind a > PCI bus. For RP1, the same arguments apply: it's not used as an SoC > since the driver code is not running on-chip and is not like an MFD > since it does not really need all the MFD infrastructure (shared regs, > etc.). So, for this particular use, misc has been proposed and deemed > as a good choice. For further details about that please check the links. > > This driver is heavily based on downstream code from RaspberryPi > Foundation, and the original author is Phil Elwell. > > Link: https://datasheets.raspberrypi.com/rp1/rp1-peripherals.pdf > Link: https://lore.kernel.org/all/20240612140208.GC1504919@google.com/ > Link: https://lore.kernel.org/all/83f7fa09-d0e6-4f36-a27d-cee08979be2a@app.fastmail.com/ > Link: https://lore.kernel.org/all/2024081356-mutable-everyday-6f9d@gregkh/ > Link: https://lore.kernel.org/all/20240808154658.247873-1-herve.codina@bootlin.com/ > > Signed-off-by: Andrea della Porta > Acked-by: Bjorn Helgaas # quirks.c, pci_ids.h > Acked-by: Greg Kroah-Hartman > --- Applied to https://github.com/Broadcom/stblinux/commits/drivers/next, thanks! -- Florian