From patchwork Sat Sep 25 20:32:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12517787 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB5B2C433EF for ; Sat, 25 Sep 2021 20:32:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5C9A60F4B for ; Sat, 25 Sep 2021 20:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229926AbhIYUeE (ORCPT ); Sat, 25 Sep 2021 16:34:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbhIYUeD (ORCPT ); Sat, 25 Sep 2021 16:34:03 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A19E7C061575; Sat, 25 Sep 2021 13:32:28 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id i23so38360199wrb.2; Sat, 25 Sep 2021 13:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/Wb71HqjEOUF7N4+48DrIALQ2aRBPLW7pWxHbo6fkmE=; b=HbiIavrACDoPKKGhz91lnyYOWGe+guXmTlZquxkI+ZWBKrxLN2/KuJ6/036mrWsj+b TJul81dnFl8GpexEDl4/rSHBDjMyDYC46nEcQ0xZhv9W8IhKKUvXXqaxVwHyx9r2s5U7 sGZdEmY1D0uzn5Lcf+F4qcZqIvdN6ZG/sVcpiiQVQ+aER12Z9MM/Je/7Ty/ybpbwp9ty ntYHBjzaFVHLGHnZgrAIkCMl+Nx8CmaKp99Q5NqqO7tcpehbZ2vadJJPq0w7Y2QUCw+q vetDxGuzNgJoKejT/vGWa2dRDBEF5FcY568KoHosPRa1M9vAowSufNEd0w4TqW85hKf3 9kkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Wb71HqjEOUF7N4+48DrIALQ2aRBPLW7pWxHbo6fkmE=; b=CKWLfitnOm23uWO89djO0IwYunX5RyyBsShJnfw9KfZo8gsHSQHydi0BlUUMajYEl7 VHui7jhgUZIa3PNYfHnTCL+SfPwn+ALtKvFQtb2HInNgn8MUWknSDTLo+5e1UMHhBNz3 vC99VNtBrhRQ+Yzeg32xMsCeo7oWpd7LFdlQa5Y4d6xlgTCQqLK0bz+lkcNao9e0K9JH C9+anpwxk1dbIGSGDy3Xb3zIVYNX73qfyx/HkRCM1X4xzlm0fUIHf7Asbe4T8d/cmOU7 6/U8rjsHMCzQ91QDqRt6s0lDFm/SBhaU4dts6NhRp1N+kKizZazR3gzjApz3uLAJPQWx A8aw== X-Gm-Message-State: AOAM533ZOWZ+LyDcbKbOTNo4H21z57qYZqK3lPGHfUSwlrtnrfjPf1sD O87Gd7Sq5O8XvZCKJDEq/kg= X-Google-Smtp-Source: ABdhPJzicsFl8kGv0kXGzP2vQVihQ9IDXNPh1hRIUUYF38RKGOcv/+47W7tmg6FpSgAZOb2nJPTX/w== X-Received: by 2002:a5d:56c4:: with SMTP id m4mr18860182wrw.225.1632601947300; Sat, 25 Sep 2021 13:32:27 -0700 (PDT) Received: from localhost.localdomain (252.red-83-54-181.dynamicip.rima-tde.net. [83.54.181.252]) by smtp.gmail.com with ESMTPSA id a202sm16703279wmd.15.2021.09.25.13.32.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 13:32:26 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: robh@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, Liviu.Dudau@arm.com, bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/6] Revert "MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT" Date: Sat, 25 Sep 2021 22:32:19 +0200 Message-Id: <20210925203224.10419-2-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925203224.10419-1-sergio.paracuellos@gmail.com> References: <20210925203224.10419-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This reverts commit 159697474db41732ef3b6c2e8d9395f09d1f659e. There is no real need to increase IO_SPACE_LIMIT if PCI_IOBASE is properly set to 'mips_io_port_base'. Hence revert this commit first before doing anything else. Signed-off-by: Sergio Paracuellos Acked-by: Thomas Bogendoerfer --- arch/mips/include/asm/mach-ralink/spaces.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/mach-ralink/spaces.h b/arch/mips/include/asm/mach-ralink/spaces.h index 31a3525213cf..87d085c9ad61 100644 --- a/arch/mips/include/asm/mach-ralink/spaces.h +++ b/arch/mips/include/asm/mach-ralink/spaces.h @@ -2,7 +2,9 @@ #ifndef __ASM_MACH_RALINK_SPACES_H_ #define __ASM_MACH_RALINK_SPACES_H_ -#define IO_SPACE_LIMIT 0x1fffffff +#define PCI_IOBASE _AC(0xa0000000, UL) +#define PCI_IOSIZE SZ_16M +#define IO_SPACE_LIMIT (PCI_IOSIZE - 1) #include #endif From patchwork Sat Sep 25 20:32:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12517789 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86B56C433F5 for ; Sat, 25 Sep 2021 20:32:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B766610F7 for ; Sat, 25 Sep 2021 20:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229934AbhIYUeF (ORCPT ); Sat, 25 Sep 2021 16:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbhIYUeE (ORCPT ); Sat, 25 Sep 2021 16:34:04 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8E2C061570; Sat, 25 Sep 2021 13:32:29 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id r23so12932369wra.6; Sat, 25 Sep 2021 13:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oY+ehST4wA6FiZDaz59HXjjwDmgVx1fzGmc8GDxtC+8=; b=n4M61+uEZFS1EockQ3PZFF5TgXu3qhFC/4VdpqCXW1ywiyuUuMZgPqxTgm7qPJLfGC uAy1c0jSgM33eFOZUGAJ+5+xVYqc544jDnlbGzW9a30fBK1NBGA4L+b2v90yA7FhYZM6 6xZtyVxbfNTY/0B461sTYKXObRg5MFflLuytA+cUi0ppY6n2x3SgVVKaQ8bP4sH2l7x/ apCcVo/je2+jwWqyd5lmLNpj+RYf64j2jAvOcApJZ8/sQgHemC0vgJbz07nPP1Irpn+u PFplbG50nEdZEdQM/A9f6Jap9dXTCoFDizgP3RB56mvdZptLbku14vd7qScoSF5Z6FhI DolA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oY+ehST4wA6FiZDaz59HXjjwDmgVx1fzGmc8GDxtC+8=; b=YqOuxrUI0cQIbbExaR4NtQ17VEgVFWn8F3/T5rzZOC8+2Zy1oEJtsEW0KhF+3VFPcd 1wQTfZxcfC45AV3l0msPxjB7A/97jCUSx7oWFFMOdFAaLiZQGdoQtUKdUqhCI8BC371o kUpKz5D1Es2n4/cFj5AnGmahhKFuUyZ15B8E2pdcovLWuqbG++Ii6LEeJJCXQcBe/Lyr sbJZmXDpOOabtdmYKQpFy/7ZChlmMLoPnTEojsTU+wB+I8pg04E5wx5l7QwlkFEkio+l 9dVQZZcRcyi1FHF5mNm58xY5hDHJKXNWivJGu2vozq/BxUKXYwzURB2kDcXzpgPVCY6I xAOg== X-Gm-Message-State: AOAM530N1XMUbP3VolzzPNPIucZ+tBqdDV+44OV16fh0O8WuD+x7hOIe OEd1zL9HWl35K0eYOxubQnY= X-Google-Smtp-Source: ABdhPJzFetuuD8I1kF2Kxi1e7fnCMBC2vyQnEn9VwPsSUkTNiO5tfoUQ9VfUAozd2orCAEjRt70gFA== X-Received: by 2002:a7b:c932:: with SMTP id h18mr8228480wml.112.1632601948320; Sat, 25 Sep 2021 13:32:28 -0700 (PDT) Received: from localhost.localdomain (252.red-83-54-181.dynamicip.rima-tde.net. [83.54.181.252]) by smtp.gmail.com with ESMTPSA id a202sm16703279wmd.15.2021.09.25.13.32.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 13:32:28 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: robh@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, Liviu.Dudau@arm.com, bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/6] Revert "staging: mt7621-pci: set end limit for 'ioport_resource'" Date: Sat, 25 Sep 2021 22:32:20 +0200 Message-Id: <20210925203224.10419-3-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925203224.10419-1-sergio.paracuellos@gmail.com> References: <20210925203224.10419-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This reverts commit 50fb34eca2944fd67493717c9fbda125336f1655. Since IO_SPACE_LIMIT is not really being changed there is no real need to adjust the ioport_resource end limit. Acked-by: Arnd Bergmann Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 86d9c3d122e2..6acfc94a16e7 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -526,8 +526,6 @@ static int mt7621_pci_probe(struct platform_device *pdev) if (!dev->of_node) return -ENODEV; - ioport_resource.end = IO_SPACE_LIMIT; - bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); if (!bridge) return -ENOMEM; From patchwork Sat Sep 25 20:32:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12517791 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F022C433EF for ; Sat, 25 Sep 2021 20:32:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2897160F4C for ; Sat, 25 Sep 2021 20:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229957AbhIYUeG (ORCPT ); Sat, 25 Sep 2021 16:34:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbhIYUeG (ORCPT ); Sat, 25 Sep 2021 16:34:06 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC403C061570; Sat, 25 Sep 2021 13:32:30 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id t8so38336755wrq.4; Sat, 25 Sep 2021 13:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uSEYmLllNjJftf9n5AprTfaaSYD64ry9qHpFZHlSP5E=; b=mK9eDOopE4EeNRjuJv79Vfu0yg1xqvz1s1EEyvjCOHsg5UuI90jlrsxHA0ICR0xRZi Advw48cgO/XZjkSf/CP1jzDIAi5R+VgbDKMoQjGnAZOq+UDSP1itc/QHbNeC/npV/fyX y4QSZJuf7xRmpFiLoO1Il5dAyyrjE3I0eN5JEYbSA8eVMvRVzzbYsVJzcclDtNhO+uGi EvqhX5msauPSAJ/yTRpXc2yx2Ecosw1GMTsGpJeC3vx3Tw5mkC0zO1sTlpkcGdRd2mXX pA3CRybJs0ZbWCDrNPBtj3sTSYW1eTUqPSbkQ+ZstrYYIPmlrsDp5LaBrtJa22CfnjG6 Ab+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uSEYmLllNjJftf9n5AprTfaaSYD64ry9qHpFZHlSP5E=; b=eU6qN0Oz9bOwX1tuYscQieTpGduLpmbYuvNv5Lp/70Gnyf4BtvOC3vVL+JVvSYgoal 27T3HaZS1dIULA3hLMT4tIhXEf+1tDFME7z5bqADT6jiNbZdpQlnyg2ffxdJFbkhRSv2 4kchozXADAUbcRvTmLMQPRZ6PzibjIh98XdbAX0KAB1GSX/FfjWVHNV/gSDSFRPPYeZK xiBpV2ZnhC5r8XNI1/hbUMvOMCxFSfyr85GtPA1TJGOWDPgGM2V0oQtHlnoyXfqho7Vi Ep7ZIQhUbIeoxRor0FOZu/jnP9Yt7uuaSBqkEdxRb+wplkk6kdEpoHUCreylv+hdd7vM 0pJg== X-Gm-Message-State: AOAM532wZCltz5eYGgeQMr27RtUqeXM4LFit1CDR5O2evx80cx3I/lab 47PMaXoMSVBLXcLJ/AUaAAE= X-Google-Smtp-Source: ABdhPJw1wJuIcSQdsCcNqDifiu5l3xy9TQ+mGAYLfv7U7/t0+L1QAKHkglr6WgQuix7pkZUZy2pmnA== X-Received: by 2002:a5d:4388:: with SMTP id i8mr18259416wrq.340.1632601949390; Sat, 25 Sep 2021 13:32:29 -0700 (PDT) Received: from localhost.localdomain (252.red-83-54-181.dynamicip.rima-tde.net. [83.54.181.252]) by smtp.gmail.com with ESMTPSA id a202sm16703279wmd.15.2021.09.25.13.32.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 13:32:29 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: robh@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, Liviu.Dudau@arm.com, bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/6] MIPS: ralink: set PCI_IOBASE to 'mips_io_port_base' Date: Sat, 25 Sep 2021 22:32:21 +0200 Message-Id: <20210925203224.10419-4-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925203224.10419-1-sergio.paracuellos@gmail.com> References: <20210925203224.10419-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org By default MIPS architecture use function 'set_io_port_base()' to set the virtual address of the first IO port. This function at the end sets variable 'mips_io_port_base' with the desired address. To align things and allow to change first IO port location address for PCI, set PCI_IOBASE definition as 'mips_io_port_base'. Fixes: 222b27713d7f ("MIPS: ralink: Define PCI_IOBASE") Acked-by: Arnd Bergmann Signed-off-by: Sergio Paracuellos Acked-by: Thomas Bogendoerfer --- arch/mips/include/asm/mach-ralink/spaces.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/mach-ralink/spaces.h b/arch/mips/include/asm/mach-ralink/spaces.h index 87d085c9ad61..05d14c21c417 100644 --- a/arch/mips/include/asm/mach-ralink/spaces.h +++ b/arch/mips/include/asm/mach-ralink/spaces.h @@ -2,8 +2,8 @@ #ifndef __ASM_MACH_RALINK_SPACES_H_ #define __ASM_MACH_RALINK_SPACES_H_ -#define PCI_IOBASE _AC(0xa0000000, UL) -#define PCI_IOSIZE SZ_16M +#define PCI_IOBASE mips_io_port_base +#define PCI_IOSIZE SZ_64K #define IO_SPACE_LIMIT (PCI_IOSIZE - 1) #include From patchwork Sat Sep 25 20:32:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12517793 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C2C5C4332F for ; Sat, 25 Sep 2021 20:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B780610EA for ; Sat, 25 Sep 2021 20:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbhIYUeQ (ORCPT ); Sat, 25 Sep 2021 16:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbhIYUeH (ORCPT ); Sat, 25 Sep 2021 16:34:07 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 142B3C061575; Sat, 25 Sep 2021 13:32:32 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id i23so38360502wrb.2; Sat, 25 Sep 2021 13:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tk71Ha065utVNVLOH6SmaYvA7yXp/Uoif9kGNCMKFO4=; b=oQ9MnWyOtTbvghYiZ0b8FFRNGb8c2o10uU5v985hfBjn8BOI0+5qphvBnU1rFmI53D zRTi/xqH+ckeulaQwJVICjodLX+bMH7wGH9IFzNRSPCv1I9UYlWYu5iMhOLXD+M7vDc6 IqF1BgFZWXuAN45uyfhc5xLy03VPWJiCGokiNwnWQLrWrKkvPYl7hLqC2En3sYtDFlx4 JMhlzEh31NPOX751fPKHkJBjexUt1Xfk53Nj6l3S1BeEonPeQ0n8uF6KZNjaVxwWbtPU F4YSupZhOBDgm6LgiySw7pLRZlysdW7sEj7froIkry1zPJSaiuqiarSMamKA7zpmCa7b 44TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tk71Ha065utVNVLOH6SmaYvA7yXp/Uoif9kGNCMKFO4=; b=w6lYm4PS+9DVE564Za1ZYGRa8BiOAeRjri12p3ViNItJXbuod9hweVl3J5eV/a7u1e Hvflx8OtTmwCRYNHjusdOULX1EoSRdmwRXgiyWIMiv8eGxs+9MxlgEMClpGaaojEMYnK bEHXppgCJaA18rOuQkqvtacckhVIing7kWOUkPCIVBjHFTZ2I6D1HC054Dz5Wemviere i+rQqJncVTa/LIe5820dGDI4zPxHBbISL14O2BueD7WWFAwkdhopeBVak+lpEBWsYres M6qyWmpVJ1VjL2lXXSqhzP2BXYOMSh3HDaVwU0J0WxJzxyvGnngU8uIMIfDplxf2ZNIB 8+eQ== X-Gm-Message-State: AOAM531wp0L//rE7TG1esjKDnQp2PnSlVeSNiyeZJTTvGteLcS3kg5Dr zKr80gKA3nfPtmBWMbgS62e4gMdJPS0= X-Google-Smtp-Source: ABdhPJzI3fdOjvJi6rSKVa4OVIP23IVjo8NUZi2jfEe976T7EWHYlU2C+s4vJR2g6bsltRRGIm3Bbg== X-Received: by 2002:a5d:47a4:: with SMTP id 4mr18493619wrb.274.1632601950717; Sat, 25 Sep 2021 13:32:30 -0700 (PDT) Received: from localhost.localdomain (252.red-83-54-181.dynamicip.rima-tde.net. [83.54.181.252]) by smtp.gmail.com with ESMTPSA id a202sm16703279wmd.15.2021.09.25.13.32.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 13:32:30 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: robh@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, Liviu.Dudau@arm.com, bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/6] PCI: Allow architecture-specific pci_remap_iospace() Date: Sat, 25 Sep 2021 22:32:22 +0200 Message-Id: <20210925203224.10419-5-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925203224.10419-1-sergio.paracuellos@gmail.com> References: <20210925203224.10419-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org pci_remap_iospace() was originally meant as an architecture specific helper but it moved into generic code after all architectures had the same requirements. MIPS has different requirements so it should not be shared. The way for doing this will be using a macro 'pci_remap_iospace' defined for those architectures that need a special treatment. Hence, put core API function inside preprocesor conditional code for 'pci_remap_iospace' definition. Acked-by: Bjorn Helgaas Acked-by: Arnd Bergmann Signed-off-by: Sergio Paracuellos --- drivers/pci/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index ce2ab62b64cf..0ec57bb01a88 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4123,6 +4123,7 @@ unsigned long __weak pci_address_to_pio(phys_addr_t address) * architectures that have memory mapped IO functions defined (and the * PCI_IOBASE value defined) should call this function. */ +#ifndef pci_remap_iospace int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) { #if defined(PCI_IOBASE) && defined(CONFIG_MMU) @@ -4146,6 +4147,7 @@ int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) #endif } EXPORT_SYMBOL(pci_remap_iospace); +#endif /** * pci_unmap_iospace - Unmap the memory mapped I/O space From patchwork Sat Sep 25 20:32:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12517797 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54F1FC433F5 for ; Sat, 25 Sep 2021 20:32:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4313060F4B for ; Sat, 25 Sep 2021 20:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbhIYUeT (ORCPT ); Sat, 25 Sep 2021 16:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbhIYUeN (ORCPT ); Sat, 25 Sep 2021 16:34:13 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AFD2C061765; Sat, 25 Sep 2021 13:32:33 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id t8so38336962wrq.4; Sat, 25 Sep 2021 13:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yKlbIEgqwR0qKF8U+1Jmv4I3Uips5CrTskAfz926Lgw=; b=X4MuI7BDwuEfS0kx+aSaMc/Oso11hkeMpr296AAfzuYHNay+DEGMlnw58azTBbTdOx D0eIX133N+i//NgM4wovM29cPWfQWSiYXzPfFjo6XLs2GGeESmQRKBl/LQT0AdG6yCvx VuL/ij3eJUsQIRoJqKi9OZaF9RkPfjeWniW38Uypp2ZoVnhYpyEyZTnHZp1MMV28N2jM zqH2Q8Ejfp85vpppMvnQHcv/xuQwuNIAEoI5p8q7YAKCqwAVzgI3Hq4TIzAy/7QdKpkh CoLyJieFkhioAT4oPsFejj5+O2IYoCIKf8IoclO1nL7rFQyUHj/cWQqdSJvvBX//ITnt 4hWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yKlbIEgqwR0qKF8U+1Jmv4I3Uips5CrTskAfz926Lgw=; b=JFCVfCcmv2aa8ZtVyM2T5b6UPwWTUVc/CJl5dsGNhma94XK+8xN2nP3X0Gkk+lcYvM xwk1VZ3qvpSbFwc08stBafbX9ewEHToPjrRiRvP/JVMAXYkSOoxyoA3ftWj1CxNt3gvR tYHlqQ6weDbFOXesf9x0rKbfLRkJ1fO74Ltm4VSTS7gPKdxoueO5HFonOdvqwgl3/zjr Mmmzr5WumdCoC7NBBVJs81mPgNLt72Mxo9iA07CEw10L1ACcOTZZw64ut150Aweo6DeO THjsA/RYK1CadnAVKFpYZRex8wzEyVvUVq3Yh8vxCObUPxCQ15u0DvEawvJKrwipy6fY kNGA== X-Gm-Message-State: AOAM5312n/80TFaButF/cLN00MgLrmSl/C2Cx56R0/pqzGx6XMBMjMxc UwCc4uSfQBXDix+zpUCOmUY= X-Google-Smtp-Source: ABdhPJyB5EAGRY414d65WgCtR2DA5/RQmVAZJ8drxqTB2g4Nnh94SBqW29tqzshSJ+0sTHFz9SbFdw== X-Received: by 2002:adf:9bdb:: with SMTP id e27mr18382224wrc.162.1632601951732; Sat, 25 Sep 2021 13:32:31 -0700 (PDT) Received: from localhost.localdomain (252.red-83-54-181.dynamicip.rima-tde.net. [83.54.181.252]) by smtp.gmail.com with ESMTPSA id a202sm16703279wmd.15.2021.09.25.13.32.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 13:32:31 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: robh@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, Liviu.Dudau@arm.com, bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/6] MIPS: implement architecture-specific 'pci_remap_iospace()' Date: Sat, 25 Sep 2021 22:32:23 +0200 Message-Id: <20210925203224.10419-6-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925203224.10419-1-sergio.paracuellos@gmail.com> References: <20210925203224.10419-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org To make PCI IO work we need to properly virtually map IO cpu physical address and set this virtual address as the address of the first PCI IO port which is set using function 'set_io_port_base()'. Acked-by: Arnd Bergmann Signed-off-by: Sergio Paracuellos Acked-by: Thomas Bogendoerfer --- arch/mips/include/asm/pci.h | 2 ++ arch/mips/pci/pci-generic.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index 9ffc8192adae..35270984a5f0 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h @@ -20,6 +20,8 @@ #include #include +#define pci_remap_iospace pci_remap_iospace + #ifdef CONFIG_PCI_DRIVERS_LEGACY /* diff --git a/arch/mips/pci/pci-generic.c b/arch/mips/pci/pci-generic.c index 95b00017886c..18eb8a453a86 100644 --- a/arch/mips/pci/pci-generic.c +++ b/arch/mips/pci/pci-generic.c @@ -46,3 +46,17 @@ void pcibios_fixup_bus(struct pci_bus *bus) { pci_read_bridge_bases(bus); } + +int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) +{ + unsigned long vaddr; + + if (res->start != 0) { + WARN_ONCE(1, "resource start address is not zero\n"); + return -ENODEV; + } + + vaddr = (unsigned long)ioremap(phys_addr, resource_size(res)); + set_io_port_base(vaddr); + return 0; +} From patchwork Sat Sep 25 20:32:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12517795 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86AE3C43217 for ; Sat, 25 Sep 2021 20:32:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7176960F4B for ; Sat, 25 Sep 2021 20:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230049AbhIYUeS (ORCPT ); Sat, 25 Sep 2021 16:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbhIYUeN (ORCPT ); Sat, 25 Sep 2021 16:34:13 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2139DC061769; Sat, 25 Sep 2021 13:32:34 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id g16so38315200wrb.3; Sat, 25 Sep 2021 13:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YGJlwr2TgrXRfWneKRDsk4/Af6P1h7wSgc5Vc8J2024=; b=PFdJIClUviW3KXuNKJE+H6ls1LLMZD8ZnRUiIzhy/EGpa5nuJfcuygtInTm9TxRddx L/MN531XpjR64tFqU//TTmtzWx/AyzNYOQ8b/gA8//7KK+NiJqxz0HLCe2jerIkKhQ3l BKHTYwb7LxJCaxyYtO5gRD2+22dP4UJ41Oc4xBNxtf+zpu0FaPAcMqqyuISDIUzlKLWO C12rvZtUdByHjKXSqv5Rb6rULeUdOxTK555+QZeBjUC5T76LexM6mg1T5p6wMatzpH6l mtcQFqO+ghZ2q2QvdgQkY7CWblLcnoZXENDN7LUZMqb18ZsPKYHKEVLjqzU7NaHG0P8K UBSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YGJlwr2TgrXRfWneKRDsk4/Af6P1h7wSgc5Vc8J2024=; b=evuofuscLYezkE0A/fyZPCQ/7YNKPOM8i1hlBL3x1u2i/JbD2ezBCYPEXZI6nI4rh9 ZPQKTwuL6RwcFUwuqGL0E9bKxGimScw+JbCQLoDEwTaMVgCdW0+AXbDnvWQ81yNtYWZ8 FLPWrvV4g2HevhCDrzYl9URGhzVbhS0yotbw0H5wBtuqZth7xm3Xrj4oehufq/l9CcOq xmbjV5r/O782WssS+GTnL3apc6vE3YOpuqcpo1DFOyecWvp0GFRPoPGvP0PPHCnwh3im Y2dPt9Xk06clWeV1AEPYbxB98klpTtjCqcv2lRYpC4eo0hhxmsQeEeUvL3+44bA13gAp Z02g== X-Gm-Message-State: AOAM530DUGYCNEs7E7RWsTnaISibiCYyqpfx661Jkg856wXcIb0D6Kmi 638CnLvP+KRqqlNRkIvr25Y= X-Google-Smtp-Source: ABdhPJwIeSjsdRl4hxHnhQhhjCG31SKIMxpVNFgDBVktB0VGtnJwUeufSCGaKYc4FjlkTA8pYynJ/w== X-Received: by 2002:a5d:6450:: with SMTP id d16mr18209600wrw.40.1632601952804; Sat, 25 Sep 2021 13:32:32 -0700 (PDT) Received: from localhost.localdomain (252.red-83-54-181.dynamicip.rima-tde.net. [83.54.181.252]) by smtp.gmail.com with ESMTPSA id a202sm16703279wmd.15.2021.09.25.13.32.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 13:32:32 -0700 (PDT) From: Sergio Paracuellos To: tsbogend@alpha.franken.de Cc: robh@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, Liviu.Dudau@arm.com, bhelgaas@google.com, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, neil@brown.name, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/6] staging: mt7621-pci: properly adjust base address for the IO window Date: Sat, 25 Sep 2021 22:32:24 +0200 Message-Id: <20210925203224.10419-7-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925203224.10419-1-sergio.paracuellos@gmail.com> References: <20210925203224.10419-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The value to adjust in the bridge register RALINK_PCI_IOBASE must take into account the raw value from DT, not only the translated linux port number. As long as io_offset is zero, the two are the same, but if you were to use multiple host bridge in the system, or pick a different bus address in DT, you can have a nonzero io_offset. At this means to take into account the bus address which is used to calculate this offset, substracting it from the IO resource start address. Acked-by: Arnd Bergmann Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 6acfc94a16e7..503cb1fca2e0 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -482,7 +482,7 @@ static int mt7621_pcie_enable_ports(struct pci_host_bridge *host) /* Setup MEMWIN and IOWIN */ pcie_write(pcie, 0xffffffff, RALINK_PCI_MEMBASE); - pcie_write(pcie, entry->res->start, RALINK_PCI_IOBASE); + pcie_write(pcie, entry->res->start - entry->offset, RALINK_PCI_IOBASE); list_for_each_entry(port, &pcie->ports, list) { if (port->enabled) {