From patchwork Fri Feb 18 21:25:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12751922 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 C56BFC433EF for ; Fri, 18 Feb 2022 21:27:49 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3KirHevgYylLV9U2XjZEzA7AMaiiPcDuH3gU0Jo+9sQ=; b=llcHZwWdr8e81n EYVA+PW2fbPy0MgJQ6IA6mlZeIa+JvwzIr6eTxrOrSCPBM+uORmng07fzrdFiP0uUBPZV5M+DzZ5e qHpMBZN+Mp9KC9bjbVMhaxD13sbyYh/hXagqnFOD6lZP5tMmhFaBvagpQawYqiAtJVhoE7Vlx81Rr Qjt6PukQlSFvF9sUQPKe0k8H+Q3UFxx5cX4Zgm5U5UHClXUOvxAu/zP4BR/OgwP50u0brLUgu1umV vNGfIt1YxOUBi4EiwlQVn8K90rzVB2v4533URpgFd7wRuOole6VZ0kQroEaGAzWSWhRYG2K79J1cW AqScuRH4kj/kNSdY+YXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLAlb-00FlG7-Py; Fri, 18 Feb 2022 21:26:15 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLAlX-00FlEy-Gw for linux-arm-kernel@lists.infradead.org; Fri, 18 Feb 2022 21:26:13 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2BD8FB826FB; Fri, 18 Feb 2022 21:26:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CE9AC340EB; Fri, 18 Feb 2022 21:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645219567; bh=67CzBjJX5ADPiMrFIWys7nmcZswOOgMf2OfedGZwxso=; h=From:To:Cc:Subject:Date:From; b=KnpXmn4UT51pv3OWGWxN0LEuLx7nJmopvtcQpAL5hGJK3qQ4/stQHpVs9AUiPmeSm OMU0ic9ZpSj4FvN3+zGRy+vCoJAgTsecq1voWEgbcwO2qOCzywXe3l3L547tvQCawy MgNnbuqAeU2KI8HnejMxoccRTnjmBbPX1A65DsS9UIjXpJbbghEW1gbrm96oblRBRr nhP6p//q8hPYwj7rV+BHj0GLSRZdW9xz7HT0akxtZw8zde2G2lQdjaMNDG6gazRQOK gM1ON+gK2ZxY02Pq32ozlEfCO0MxVzlotwVmnaFaglDiuWD1uqf4aD8Wcsxs5HBdLa FXYs/J54Nohng== Received: by pali.im (Postfix) id 496B22BAE; Fri, 18 Feb 2022 22:26:04 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Andrew Lunn , Gregory Clement , =?utf-8?q?Marek_Beh=C3=BAn?= Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: marvell: armada-37xx: Remap IO space to bus address 0x0 Date: Fri, 18 Feb 2022 22:25:26 +0100 Message-Id: <20220218212526.16021-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220218_132611_732670_594F5D1E X-CRM114-Status: GOOD ( 17.16 ) 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 Remap PCI I/O space to the bus address 0x0 in the Armada 37xx device-tree in order to support legacy I/O port based cards which have hardcoded I/O ports in low address space. Some legacy PCI I/O based cards do not support 32-bit I/O addressing. Since commit 64f160e19e92 ("PCI: aardvark: Configure PCIe resources from 'ranges' DT property") this driver can work with I/O windows which have a different address for CPU than for PCI bus (unless there is some conflict with other A37xx mapping), without needing additional support for this in the firmware. Note that DDR on A37xx is mapped to bus address 0x0 and that mapping of I/O space can be set to address 0x0 too because MEM space and I/O space are separate and so they do not conflict. Signed-off-by: Pali Rohár Reported-by: Arnd Bergmann Reviewed-by: Marek Behún Reviewed-by: Arnd Bergmann --- arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 2 +- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts index 6581092c2c90..7d1b9153a901 100644 --- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts @@ -163,7 +163,7 @@ */ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0xe8000000 0 0xe8000000 0 0x01000000 /* Port 0 IO */ + ranges = <0x81000000 0 0x00000000 0 0xe8000000 0 0x01000000 /* Port 0 IO */ 0x82000000 0 0xe9000000 0 0xe9000000 0 0x07000000>; /* Port 0 MEM */ /* enabled by U-Boot if PCIe module is present */ diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi index 549c3f7c5b27..a099b7787429 100644 --- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi @@ -515,7 +515,7 @@ * (totaling 127 MiB) for MEM. */ ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x07f00000 /* Port 0 MEM */ - 0x81000000 0 0xeff00000 0 0xeff00000 0 0x00100000>; /* Port 0 IO*/ + 0x81000000 0 0x00000000 0 0xeff00000 0 0x00100000>; /* Port 0 IO */ interrupt-map-mask = <0 0 0 7>; interrupt-map = <0 0 0 1 &pcie_intc 0>, <0 0 0 2 &pcie_intc 1>,