From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 66E861FDA7B; Thu, 20 Feb 2025 18:20:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740075648; cv=none; b=V7WKzzJlYr2iQ6nwqnsEnmGlckMIjlraZ9itBeXCbWVYPbTUa3/s2adx8AOpWncsbJ+FewapTpjnKCvKf8bcE9f93lHpEHXfcICVaUoAGat1/6hvMiR9RHKxyuqdOKmAeqAFyNETCEFoKYcrHguldO8Z/b5CPbVOQ/6H4ckOadQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740075648; c=relaxed/simple; bh=goF2sXGlwePNxi5jXjCq7qXTeQ/IBQiDq6ijNZ4pmnQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=UthJJ5rtMKgPT542b4zFxpNOnoo+fBuLcCtKylEt/VnELppPIGrXAhlelkxW+amZfWpDYtP+FMUiOIfjX7bjf26RdkBpmiBfG4AdnUJJkQujsYXyCTJPxMjMx7QI6AZDBri2lilKzU/C/A/3x/NwbbApra5thddoWQia6pHWfu4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PAB7y20X; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PAB7y20X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BFBDC4CED1; Thu, 20 Feb 2025 18:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740075648; bh=goF2sXGlwePNxi5jXjCq7qXTeQ/IBQiDq6ijNZ4pmnQ=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=PAB7y20XkqjVJWJyMszBT2gK8dHTBRm1WnFEnoSGcwRQboueF7LTqLi97yrR7aW8a ec9hWNjpBclx1fMFB+5NQ+a0eELhDRFNsVoOF0zaK1R3OyQsEgxNZGg/5SbSs8rTd0 RmYWSE7Ba49iPbYfnws3o7DoaqyDNnlq1Br4qjR3PN2UbS/NXgLbSgV3sPrx+nXZnY cm415/43Uw8gX5j6UqRyDvfgpTsprHWy/NZh6Wy7WR92oT+cqNi5vmfvZlDEyBDwZj YCamWFjRj0Cg8MaechwLKmK9Vn9zTe6T7zvW6qEpZo80fwEFD1CWh3xEdZXQWkFwgU 4SXT3GNl6aqJg== Date: Thu, 20 Feb 2025 12:20:46 -0600 From: Bjorn Helgaas To: Lorenzo Bianconi Cc: Ryder Lee , Jianjun Wang , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 2/2] PCI: mediatek-gen3: Configure PBUS_CSR registers for EN7581 SoC Message-ID: <20250220182046.GA304343@bhelgaas> Precedence: bulk X-Mailing-List: devicetree@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: <20250202-en7581-pcie-pbus-csr-v2-2-65dcb201c9a9@kernel.org> On Sun, Feb 02, 2025 at 08:34:24PM +0100, Lorenzo Bianconi wrote: > Configure PBus base address and address mask to allow the hw > to detect if a given address is on PCIE0, PCIE1 or PCIE2. > > Signed-off-by: Lorenzo Bianconi > --- > drivers/pci/controller/pcie-mediatek-gen3.c | 30 ++++++++++++++++++++++++++++- > 1 file changed, 29 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c > index aa24ac9aaecc749b53cfc4faf6399913d20cdbf2..9c2a592cae959de8fbe9ca5c5c2253f8eadf2c76 100644 > --- a/drivers/pci/controller/pcie-mediatek-gen3.c > +++ b/drivers/pci/controller/pcie-mediatek-gen3.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -24,6 +25,7 @@ > #include > #include > #include > +#include > #include > > #include "../pci.h" > @@ -127,6 +129,13 @@ > > #define PCIE_MTK_RESET_TIME_US 10 > > +#define PCIE_EN7581_PBUS_ADDR(_n) (0x00 + ((_n) << 3)) > +#define PCIE_EN7581_PBUS_ADDR_MASK(_n) (0x04 + ((_n) << 3)) > +#define PCIE_EN7581_PBUS_BASE_ADDR(_n) \ > + ((_n) == 2 ? 0x28000000 : \ > + (_n) == 1 ? 0x24000000 : 0x20000000) Are these addresses something that should be expressed in devicetree? It seems unusual to encode addresses directly in a driver. Bjorn