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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 434C7C433EF for ; Wed, 24 Nov 2021 16:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348617AbhKXQ1S (ORCPT ); Wed, 24 Nov 2021 11:27:18 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:46781 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348524AbhKXQ1R (ORCPT ); Wed, 24 Nov 2021 11:27:17 -0500 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 6438924000B; Wed, 24 Nov 2021 16:24:02 +0000 (UTC) Date: Wed, 24 Nov 2021 17:24:02 +0100 From: Alexandre Belloni To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Russell King , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Thomas Petazzoni , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Dominik Brodowski , Nicolas Ferre , Ludovic Desroches , Marek =?iso-8859-1?Q?Beh=FAn?= , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] arm: ioremap: Replace pci_ioremap_io() usage by pci_remap_iospace() Message-ID: References: <20211124154116.916-1-pali@kernel.org> <20211124154116.916-5-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211124154116.916-5-pali@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/11/2021 16:41:15+0100, Pali Rohár wrote: > Replace all usage of ARM specific pci_ioremap_io() function by standard PCI > core API function pci_remap_iospace() in all drivers and arm march code. > > Signed-off-by: Pali Rohár Reviewed-by: Alexandre Belloni > --- > arch/arm/mach-dove/pcie.c | 9 +++++---- > arch/arm/mach-iop32x/pci.c | 5 ++++- > arch/arm/mach-mv78xx0/pcie.c | 5 ++++- > arch/arm/mach-orion5x/pci.c | 10 ++++++++-- > drivers/pcmcia/at91_cf.c | 6 +++++- > 5 files changed, 26 insertions(+), 9 deletions(-) > > diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c > index ee91ac6b5ebf..2a493bdfffc6 100644 > --- a/arch/arm/mach-dove/pcie.c > +++ b/arch/arm/mach-dove/pcie.c > @@ -38,6 +38,7 @@ static int num_pcie_ports; > static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) > { > struct pcie_port *pp; > + struct resource realio; > > if (nr >= num_pcie_ports) > return 0; > @@ -53,10 +54,10 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) > > orion_pcie_setup(pp->base); > > - if (pp->index == 0) > - pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE0_IO_PHYS_BASE); > - else > - pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE1_IO_PHYS_BASE); > + realio.start = sys->busnr * SZ_64K; > + realio.end = realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, pp->index == 0 ? DOVE_PCIE0_IO_PHYS_BASE : > + DOVE_PCIE1_IO_PHYS_BASE); > > /* > * IORESOURCE_MEM > diff --git a/arch/arm/mach-iop32x/pci.c b/arch/arm/mach-iop32x/pci.c > index ab0010dc3145..7a215d2ee7e2 100644 > --- a/arch/arm/mach-iop32x/pci.c > +++ b/arch/arm/mach-iop32x/pci.c > @@ -185,6 +185,7 @@ iop3xx_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) > int iop3xx_pci_setup(int nr, struct pci_sys_data *sys) > { > struct resource *res; > + struct resource realio; > > if (nr != 0) > return 0; > @@ -206,7 +207,9 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys) > > pci_add_resource_offset(&sys->resources, res, sys->mem_offset); > > - pci_ioremap_io(0, IOP3XX_PCI_LOWER_IO_PA); > + realio.start = 0; > + realio.end = realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, IOP3XX_PCI_LOWER_IO_PA); > > return 1; > } > diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c > index 636d84b40466..e15646af7f26 100644 > --- a/arch/arm/mach-mv78xx0/pcie.c > +++ b/arch/arm/mach-mv78xx0/pcie.c > @@ -101,6 +101,7 @@ static void __init mv78xx0_pcie_preinit(void) > static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys) > { > struct pcie_port *pp; > + struct resource realio; > > if (nr >= num_pcie_ports) > return 0; > @@ -115,7 +116,9 @@ static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys) > orion_pcie_set_local_bus_nr(pp->base, sys->busnr); > orion_pcie_setup(pp->base); > > - pci_ioremap_io(nr * SZ_64K, MV78XX0_PCIE_IO_PHYS_BASE(nr)); > + realio.start = nr * SZ_64K; > + realio.end = realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, MV78XX0_PCIE_IO_PHYS_BASE(nr)); > > pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset); > > diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c > index 76951bfbacf5..92e938bba20d 100644 > --- a/arch/arm/mach-orion5x/pci.c > +++ b/arch/arm/mach-orion5x/pci.c > @@ -142,6 +142,7 @@ static struct pci_ops pcie_ops = { > static int __init pcie_setup(struct pci_sys_data *sys) > { > struct resource *res; > + struct resource realio; > int dev; > > /* > @@ -164,7 +165,9 @@ static int __init pcie_setup(struct pci_sys_data *sys) > pcie_ops.read = pcie_rd_conf_wa; > } > > - pci_ioremap_io(sys->busnr * SZ_64K, ORION5X_PCIE_IO_PHYS_BASE); > + realio.start = sys->busnr * SZ_64K; > + realio.end = realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, ORION5X_PCIE_IO_PHYS_BASE); > > /* > * Request resources. > @@ -466,6 +469,7 @@ static void __init orion5x_setup_pci_wins(void) > static int __init pci_setup(struct pci_sys_data *sys) > { > struct resource *res; > + struct resource realio; > > /* > * Point PCI unit MBUS decode windows to DRAM space. > @@ -482,7 +486,9 @@ static int __init pci_setup(struct pci_sys_data *sys) > */ > orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER); > > - pci_ioremap_io(sys->busnr * SZ_64K, ORION5X_PCI_IO_PHYS_BASE); > + realio.start = sys->busnr * SZ_64K; > + realio.end = realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, ORION5X_PCI_IO_PHYS_BASE); > > /* > * Request resources > diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c > index 6b1edfc890a3..92df2c2c5d07 100644 > --- a/drivers/pcmcia/at91_cf.c > +++ b/drivers/pcmcia/at91_cf.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include > > #include > @@ -230,6 +231,7 @@ static int at91_cf_probe(struct platform_device *pdev) > struct at91_cf_socket *cf; > struct at91_cf_data *board; > struct resource *io; > + struct resource realio; > int status; > > board = devm_kzalloc(&pdev->dev, sizeof(*board), GFP_KERNEL); > @@ -307,7 +309,9 @@ static int at91_cf_probe(struct platform_device *pdev) > * io_offset is set to 0x10000 to avoid the check in static_find_io(). > * */ > cf->socket.io_offset = 0x10000; > - status = pci_ioremap_io(0x10000, cf->phys_baseaddr + CF_IO_PHYS); > + realio.start = cf->socket.io_offset; > + realio.end = realio.start + SZ_64K - 1; > + status = pci_remap_iospace(&realio, cf->phys_baseaddr + CF_IO_PHYS); > if (status) > goto fail0a; > > -- > 2.20.1 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com 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 0C848C433F5 for ; Wed, 24 Nov 2021 16:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=24bnuEDM2ovAMP0H1SJHXh33i8y7TETmWbspMnJCEXg=; b=xqWqCBY0cbF4CG vPxCXEcg38pf25Jg2IIX+34IJEJ6TI5Wly7dRNKw/vAJvAzbcMlbZ+JyPBoMK8+h0Bj9aVRtefpws jHwdSfHGdkUFf+MjQ4ln2AI7+FRuf6PySBNt0oauf002EX4Hrr4Y/k7yUfRlbuNprRDpU5mrKvo6Q x2T6Zv7vPenCEMhJcL/YchPV4cRARzc9cMvP+wihtNGQqQ/d/jCAUT9tn3fxRc1rB48SQ76meLslu JBOpTrYTVdFn6Gj9GZn3jXw7gNP+GMqdZgoOQXqo9GaazjqMw4wxSU2QfOgYzckGY+bVhE406bTmm rd64R2WMF+PuLCIlhiKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpv49-005FWQ-02; Wed, 24 Nov 2021 16:24:13 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpv44-005FUq-Qi for linux-arm-kernel@lists.infradead.org; Wed, 24 Nov 2021 16:24:11 +0000 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 6438924000B; Wed, 24 Nov 2021 16:24:02 +0000 (UTC) Date: Wed, 24 Nov 2021 17:24:02 +0100 From: Alexandre Belloni To: Pali =?iso-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH 4/5] arm: ioremap: Replace pci_ioremap_io() usage by pci_remap_iospace() Message-ID: References: <20211124154116.916-1-pali@kernel.org> <20211124154116.916-5-pali@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211124154116.916-5-pali@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211124_082409_185147_B02F5EA7 X-CRM114-Status: GOOD ( 22.29 ) 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: , Cc: Marek =?iso-8859-1?Q?Beh=FAn?= , Andrew Lunn , Lorenzo Pieralisi , linux-kernel@vger.kernel.org, Rob Herring , linux-pci@vger.kernel.org, Gregory Clement , Russell King , Dominik Brodowski , Bjorn Helgaas , Ludovic Desroches , Thomas Petazzoni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24/11/2021 16:41:15+0100, Pali Roh=E1r wrote: > Replace all usage of ARM specific pci_ioremap_io() function by standard P= CI > core API function pci_remap_iospace() in all drivers and arm march code. > = > Signed-off-by: Pali Roh=E1r Reviewed-by: Alexandre Belloni > --- > arch/arm/mach-dove/pcie.c | 9 +++++---- > arch/arm/mach-iop32x/pci.c | 5 ++++- > arch/arm/mach-mv78xx0/pcie.c | 5 ++++- > arch/arm/mach-orion5x/pci.c | 10 ++++++++-- > drivers/pcmcia/at91_cf.c | 6 +++++- > 5 files changed, 26 insertions(+), 9 deletions(-) > = > diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c > index ee91ac6b5ebf..2a493bdfffc6 100644 > --- a/arch/arm/mach-dove/pcie.c > +++ b/arch/arm/mach-dove/pcie.c > @@ -38,6 +38,7 @@ static int num_pcie_ports; > static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) > { > struct pcie_port *pp; > + struct resource realio; > = > if (nr >=3D num_pcie_ports) > return 0; > @@ -53,10 +54,10 @@ static int __init dove_pcie_setup(int nr, struct pci_= sys_data *sys) > = > orion_pcie_setup(pp->base); > = > - if (pp->index =3D=3D 0) > - pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE0_IO_PHYS_BASE); > - else > - pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE1_IO_PHYS_BASE); > + realio.start =3D sys->busnr * SZ_64K; > + realio.end =3D realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, pp->index =3D=3D 0 ? DOVE_PCIE0_IO_PHYS_BASE= : > + DOVE_PCIE1_IO_PHYS_BASE); > = > /* > * IORESOURCE_MEM > diff --git a/arch/arm/mach-iop32x/pci.c b/arch/arm/mach-iop32x/pci.c > index ab0010dc3145..7a215d2ee7e2 100644 > --- a/arch/arm/mach-iop32x/pci.c > +++ b/arch/arm/mach-iop32x/pci.c > @@ -185,6 +185,7 @@ iop3xx_pci_abort(unsigned long addr, unsigned int fsr= , struct pt_regs *regs) > int iop3xx_pci_setup(int nr, struct pci_sys_data *sys) > { > struct resource *res; > + struct resource realio; > = > if (nr !=3D 0) > return 0; > @@ -206,7 +207,9 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys) > = > pci_add_resource_offset(&sys->resources, res, sys->mem_offset); > = > - pci_ioremap_io(0, IOP3XX_PCI_LOWER_IO_PA); > + realio.start =3D 0; > + realio.end =3D realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, IOP3XX_PCI_LOWER_IO_PA); > = > return 1; > } > diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c > index 636d84b40466..e15646af7f26 100644 > --- a/arch/arm/mach-mv78xx0/pcie.c > +++ b/arch/arm/mach-mv78xx0/pcie.c > @@ -101,6 +101,7 @@ static void __init mv78xx0_pcie_preinit(void) > static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys) > { > struct pcie_port *pp; > + struct resource realio; > = > if (nr >=3D num_pcie_ports) > return 0; > @@ -115,7 +116,9 @@ static int __init mv78xx0_pcie_setup(int nr, struct p= ci_sys_data *sys) > orion_pcie_set_local_bus_nr(pp->base, sys->busnr); > orion_pcie_setup(pp->base); > = > - pci_ioremap_io(nr * SZ_64K, MV78XX0_PCIE_IO_PHYS_BASE(nr)); > + realio.start =3D nr * SZ_64K; > + realio.end =3D realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, MV78XX0_PCIE_IO_PHYS_BASE(nr)); > = > pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset); > = > diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c > index 76951bfbacf5..92e938bba20d 100644 > --- a/arch/arm/mach-orion5x/pci.c > +++ b/arch/arm/mach-orion5x/pci.c > @@ -142,6 +142,7 @@ static struct pci_ops pcie_ops =3D { > static int __init pcie_setup(struct pci_sys_data *sys) > { > struct resource *res; > + struct resource realio; > int dev; > = > /* > @@ -164,7 +165,9 @@ static int __init pcie_setup(struct pci_sys_data *sys) > pcie_ops.read =3D pcie_rd_conf_wa; > } > = > - pci_ioremap_io(sys->busnr * SZ_64K, ORION5X_PCIE_IO_PHYS_BASE); > + realio.start =3D sys->busnr * SZ_64K; > + realio.end =3D realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, ORION5X_PCIE_IO_PHYS_BASE); > = > /* > * Request resources. > @@ -466,6 +469,7 @@ static void __init orion5x_setup_pci_wins(void) > static int __init pci_setup(struct pci_sys_data *sys) > { > struct resource *res; > + struct resource realio; > = > /* > * Point PCI unit MBUS decode windows to DRAM space. > @@ -482,7 +486,9 @@ static int __init pci_setup(struct pci_sys_data *sys) > */ > orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER); > = > - pci_ioremap_io(sys->busnr * SZ_64K, ORION5X_PCI_IO_PHYS_BASE); > + realio.start =3D sys->busnr * SZ_64K; > + realio.end =3D realio.start + SZ_64K - 1; > + pci_remap_iospace(&realio, ORION5X_PCI_IO_PHYS_BASE); > = > /* > * Request resources > diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c > index 6b1edfc890a3..92df2c2c5d07 100644 > --- a/drivers/pcmcia/at91_cf.c > +++ b/drivers/pcmcia/at91_cf.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include > = > #include > @@ -230,6 +231,7 @@ static int at91_cf_probe(struct platform_device *pdev) > struct at91_cf_socket *cf; > struct at91_cf_data *board; > struct resource *io; > + struct resource realio; > int status; > = > board =3D devm_kzalloc(&pdev->dev, sizeof(*board), GFP_KERNEL); > @@ -307,7 +309,9 @@ static int at91_cf_probe(struct platform_device *pdev) > * io_offset is set to 0x10000 to avoid the check in static_find_io(). > * */ > cf->socket.io_offset =3D 0x10000; > - status =3D pci_ioremap_io(0x10000, cf->phys_baseaddr + CF_IO_PHYS); > + realio.start =3D cf->socket.io_offset; > + realio.end =3D realio.start + SZ_64K - 1; > + status =3D pci_remap_iospace(&realio, cf->phys_baseaddr + CF_IO_PHYS); > if (status) > goto fail0a; > = > -- = > 2.20.1 > = -- = Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel