From patchwork Fri Sep 24 21:11:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 1532498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=BusIi8Wf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4HGPq75b7Cz9sRN for ; Sat, 25 Sep 2021 07:11:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346968AbhIXVNT (ORCPT ); Fri, 24 Sep 2021 17:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346959AbhIXVNS (ORCPT ); Fri, 24 Sep 2021 17:13:18 -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 A719FC061571; Fri, 24 Sep 2021 14:11:44 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id t8so31254639wrq.4; Fri, 24 Sep 2021 14:11:44 -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=BusIi8Wf3opfOwB9LOvTJkb0RBGN9c/AZMXhKEu4/Zd/WTaN08+/I75PzRUBOSkaoW e0EI+VltJpRJs0yUoDiq2JYVEUQGNuMf0SFb38p2kayOyEtoK/eCwcDrP5gRqU2UnCDl UUVFQLK9insrtEsq/sFDGKJjYrE2zMrGGiakhDn8H79RsS0YQOQgMA3Chl1Syecv+7cM B/2iF+pqUOMGWWOIZO1cQTKjC8VxOSJruJ+7+jwKVIafQcIOhL+P39juIlH1LgkcWJj9 m+15mdSxhi5pDVGUh8eaYX1H4CnUuCfIvbMnomiLuN/cNbltXvHIOxe/T4da0YYuEi0K d/og== 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=VM7ue101Txe19Zcfm+aI6OF4L0slqCd9WgJkZUDIVk1byawoIZxjSY3dpyoQTE3Xis Nl+CN0mGuGG1A3fdCPyAHuSbAHf3tU0WlfPKzkOiBCQLqQI5c+l/ZMiq1bTX7R4tiG84 pYCX3xcXkJv/WQ4k5tLBxLiI0XDzDLpC7vThuTRqG+eahiXM0U9y6CVK8SSr3GsJTWQH TmxO7a2hco+mbMi3Pt2xg6ncy/m7AQ9yOTXVcc8gi1WnC4bDsuSN9w+/Gvz6W/EmC/Gb 5KxIImyPadII/TMJ7GPYAO2Ymj9IjHTp2wj09OzYNuGUWGASsWUeqdwROGDHXkQbPeRB VlgA== X-Gm-Message-State: AOAM530heSBBMo41Q08+4LvlngLev4TRStdJeDBJJJRdYJIcnWcnZ144 g+F7d1DYE7tiHwITvJOFOCJnHijoj+M= X-Google-Smtp-Source: ABdhPJwPb2VG2AAM5DJqJrFmCevyaxdyzhF4Xp4YRXzrfAKWASEzuLIa1qyzO7+829+r7vINf5tQXQ== X-Received: by 2002:adf:ecc9:: with SMTP id s9mr14287341wro.2.1632517903364; Fri, 24 Sep 2021 14:11:43 -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 y64sm10344297wmc.38.2021.09.24.14.11.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Sep 2021 14:11:43 -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 1/6] Revert "MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT" Date: Fri, 24 Sep 2021 23:11:34 +0200 Message-Id: <20210924211139.3477-2-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210924211139.3477-1-sergio.paracuellos@gmail.com> References: <20210924211139.3477-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 --- 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 Fri Sep 24 21:11:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 1532500 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=U+vJPGAx; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4HGPq96h0sz9sRN for ; Sat, 25 Sep 2021 07:11:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347039AbhIXVNU (ORCPT ); Fri, 24 Sep 2021 17:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346993AbhIXVNT (ORCPT ); Fri, 24 Sep 2021 17:13:19 -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 BB01EC061571; Fri, 24 Sep 2021 14:11:45 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id t8so31254721wrq.4; Fri, 24 Sep 2021 14:11:45 -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=OyR/G6OXJUzzgXbsVp3sTRgTYQYfQEC/z3g1X2aYcVs=; b=U+vJPGAxYG540bH5jV7NX7OpXK5kcakRlMMMOAE88V+10eHOaRVf9WET7nVoo4BCYK U6x2xqgSI7d9lu5+DIm7LeT10jAf+s2DcYJtd9mzkTQS0pXH0xrMZJAI1OcdvMYAGK3v DHir/VhLYLnPTF8ElRQz8n33B+jzEHp6lnCw7O7F3k4ccHbBu+VXEW6j1iCpu0NdBVUc 2aDtdnXNYBJwqDfV5XX2gCayCJEAAydMoC5B86qyUp9LbZGXA7UzskL8F8785InymAtq eYMKYrhrFNra/0yzqhjWLkN4QnWuPxWrRhCtRa4k0N7DNjwKdBRnlIapwIQ8NJaF1AFI 8u7A== 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=OyR/G6OXJUzzgXbsVp3sTRgTYQYfQEC/z3g1X2aYcVs=; b=eE7VGeb5uLjXzoQe242aNYG42c4ZlTMgSpI9SGYoE1Q2yZVxLVf+CSMTWMd8IuI76/ HS9/A75kQFB37l3R1HGCkQ8UD1vPidY6Xn8hOq5s5WbfDtZREDN1lSpZu15aSoYhPAUd 92P0QBvd0qGTzim7HOYekkwrQiLemt3Z7t+nPIhYtZnOZPTQ6wDKT8JqImkKsuYdwPsY Q9ADDa0ILYlSDy+jcG7g4OuiTckdS4bHS4YDrsOU8vgRI8i69LG69rs0KhxFiKZvEY2v Ah4bTpT9aZEKX8+0ild3rzoEbXZZSDVRnfO4HeF4K7116guzZGXHZP1tf8VTVZO+egHt N4ZA== X-Gm-Message-State: AOAM531IXM3zP1JY4iyO8VdYmQNXnmcC6RnWtzf4f9Lwont5O5/cp3FM 0dUGBTd5ahAo3gHpzBrZddU= X-Google-Smtp-Source: ABdhPJxsqQ7CQbB882G/Opgnfqeh4McKw5bFQkjiLaO0XftIVxWdCOu2Mr1R7/kvq0H+w2yIRZ9W0A== X-Received: by 2002:a5d:64ca:: with SMTP id f10mr13408326wri.93.1632517904436; Fri, 24 Sep 2021 14:11:44 -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 y64sm10344297wmc.38.2021.09.24.14.11.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Sep 2021 14:11:44 -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 2/6] Revert "staging: mt7621-pci: set end limit for 'ioport_resource'" Date: Fri, 24 Sep 2021 23:11:35 +0200 Message-Id: <20210924211139.3477-3-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210924211139.3477-1-sergio.paracuellos@gmail.com> References: <20210924211139.3477-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. Signed-off-by: Sergio Paracuellos Acked-by: Arnd Bergmann --- 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 Fri Sep 24 21:11:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 1532501 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=h++tGSSg; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4HGPqC5jMsz9sRN for ; Sat, 25 Sep 2021 07:11:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348511AbhIXVNX (ORCPT ); Fri, 24 Sep 2021 17:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347064AbhIXVNU (ORCPT ); Fri, 24 Sep 2021 17:13:20 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3773C061613; Fri, 24 Sep 2021 14:11:46 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id i23so31281284wrb.2; Fri, 24 Sep 2021 14:11:46 -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=67Kcuzs0YKpXx88WCjEGQzyrzMHeJWwzbYlSdV9bf6Q=; b=h++tGSSgJhBX7tDiNX6Qqq1hm8PKJWrjVafbvKhu50yYJ6rEUbg3p4gAHWFhC/E8/c xaiBw9Ws3BhFR7l/v793m+fIDjkH1AyGmGAdcwGOmhvug1NP8P9qdI5NGAnR9wpq8X9u x0Efg42zNIXLzwCcdIWBEaEicvmQyFlCGAVdaHUuayJTuWVlotxhtFXxX8vtV42tDkZd 7hzSuC1DPrkFPBx3vadA+gepFVTx4X0mw4Rm4m294Fj560McDuqoWxH42qOxy7JcRYn6 MUK2XSSxWyFLuRbFBevkl87pROqVo14o+AHTi+OS3CT/x49wDn+uTF3aJuQmgovXaHuN 3M7g== 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=67Kcuzs0YKpXx88WCjEGQzyrzMHeJWwzbYlSdV9bf6Q=; b=FpEad4xYnQgD7ShpGvfwc49Ht3GIRHdz9pJ01CDwREz8qqeVZdxVTYldh4cs0fUJ+s 95k0KEnLUmQI/ZX3//5yxRAZZtsDCw8WDo0HeoYjJnOMOx1fFyoLN/xCmwNVFLYImFzg 3EvNVgc6TzHMb3Qw9PbwhZnmCmLQJAyPrrb+4p4NSmmv05Ymf2pDByAgbOxJc1KpINsq yMqf3QxPbGmwXSZ9zxXdWoYpEgI9PiQHlBueWo2V4QShVupizVT7JuQPYd7wieCNYfuY 8ZG63I6efT6VmcDpkstbqGSFUI8nOE3Dk/Pro6cuAKvOH+PPrBk7vebq+dkUO8e3x7BZ nCRw== X-Gm-Message-State: AOAM533zF673qtWMijskge2BFYOKA0S5rgV07KOyER9ExFLpqp5GozSn piYloA/4iP98Ylifnpn4JaY= X-Google-Smtp-Source: ABdhPJxlgPyjAigRr3IRkrz9jfhRDtCZdzSo9a1pZP1SARM3Z4krfhSVP9ycUKCoQos0C57NnvMcgg== X-Received: by 2002:adf:8919:: with SMTP id s25mr13931537wrs.185.1632517905484; Fri, 24 Sep 2021 14:11:45 -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 y64sm10344297wmc.38.2021.09.24.14.11.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Sep 2021 14:11:45 -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 3/6] MIPS: ralink: set PCI_IOBASE to 'mips_io_port_base' Date: Fri, 24 Sep 2021 23:11:36 +0200 Message-Id: <20210924211139.3477-4-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210924211139.3477-1-sergio.paracuellos@gmail.com> References: <20210924211139.3477-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'. Also, we only need a size of 64 KB. Signed-off-by: Sergio Paracuellos Acked-by: Arnd Bergmann --- 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 Fri Sep 24 21:11:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 1532503 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XfmVM23a; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4HGPqF1dSJz9t8j for ; Sat, 25 Sep 2021 07:11:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348536AbhIXVNZ (ORCPT ); Fri, 24 Sep 2021 17:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347078AbhIXVNV (ORCPT ); Fri, 24 Sep 2021 17:13:21 -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 D4B2DC0614ED; Fri, 24 Sep 2021 14:11:47 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id t8so31254912wrq.4; Fri, 24 Sep 2021 14:11:47 -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=I3qu/bakw/8LhQIXjaOEPV5SVnN+1i5mwJzI+2iO/oc=; b=XfmVM23a3TZXWTkk8M3V4KnzK7ODNPfeDEzYIrtlcC4fAb5l2Kd3kaOYpjqmcy6Y9A h5L295fq+DCQxENcW/PpuACnlSFNi7Y7EvKL35atOfZnC3hMZmWym7Xy5O656ZY2Yr6W n19/dOLk6H4BahbETJSPfTYf/mubMDW6nu/nOVqUMkeH+pP9/T2QWlE0CgTS8E1DG8vZ PydsndU15zlsBcDGmd9m2NeT2mq3VpF+BqoCsdWvPBFE4RsJ1NUr/ScbLUOvLuXcekBA vnF9R9hBxl8lSgXGOLKqSjBz6sKu5nKUlRXcmPAU1zS0juXIUCKiuT11Iyrgzj50JQ4J VTEg== 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=I3qu/bakw/8LhQIXjaOEPV5SVnN+1i5mwJzI+2iO/oc=; b=zy5qut06EH2xPUpiqyCJfC6TzdlcxNDvIWqA5zoKbcabiXC5HWU62dRYAempQtle5n GX+Nu5EMDJV57C5aY0DDu5WS4/pEAj/8hH+j3UisbYwRKssRW3mRWO42jVy7sh4lVWjP V9YmdrvA5hzfFY4Fkb5KGoMnj1yQNNQFloTHzEM0wSKujvteJBnBQ+BkMGQPbJ5gH8IH W2vwXIMANSVNholrQ4QGZzmKPgSoE7CMiqWIBg0Sd5raja/wGqhOjp6uu3GbTuXJYagU I/N90dWHcSckuEL4pLVgcfWJetA5JrpcB1ioTMTddlt0luxQ9Tm2H+BeoygY4Sy/Ka9n SNJA== X-Gm-Message-State: AOAM533Ng18St/1EZTHTyTQ6Rud+d6luZn4GxLYDcirn0v1gnmeGbKsf 7DkvoZ2xrfZ0CSmhM2u1Yy+HQ25l2Pw= X-Google-Smtp-Source: ABdhPJyyg9AbUZb+fEXLr9Lk4DY8+qYFpCQ1iqu6RBGl04PJnjfBWVpkdf90r95BHZlh8KVQMwlk7w== X-Received: by 2002:adf:ed92:: with SMTP id c18mr13918812wro.86.1632517906559; Fri, 24 Sep 2021 14:11:46 -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 y64sm10344297wmc.38.2021.09.24.14.11.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Sep 2021 14:11:46 -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 4/6] PCI: allow architecture specific implementation of pci_remap_iospace() Date: Fri, 24 Sep 2021 23:11:37 +0200 Message-Id: <20210924211139.3477-5-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210924211139.3477-1-sergio.paracuellos@gmail.com> References: <20210924211139.3477-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 treatement. Hence, put core api function inside preprocesor conditional code for 'pci_remap_iospace' definition. Signed-off-by: Sergio Paracuellos Acked-by: Bjorn Helgaas Acked-by: Arnd Bergmann --- 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 Fri Sep 24 21:11:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 1532502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=pMUpUCMm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4HGPqD6Jbhz9sRN for ; Sat, 25 Sep 2021 07:11:52 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348530AbhIXVNY (ORCPT ); Fri, 24 Sep 2021 17:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348458AbhIXVNW (ORCPT ); Fri, 24 Sep 2021 17:13:22 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEA51C061613; Fri, 24 Sep 2021 14:11:48 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id w29so31101914wra.8; Fri, 24 Sep 2021 14:11:48 -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=rUTZvUNb/aRTjaMs08BG0O3uRLaU29RyM+PhYifid0Y=; b=pMUpUCMmarp0nIvy/TkK/WPQKudmfB/DVvWODbDkTzappLn5QaaHIheHmc4jfp8SgH 7tj8S8kb/Q2x3uo1ey8ylSpwqj9VJOAQPAonbA2wA6adYLGY3B9iTnHHuxmxpZ0axNru Sb6mYWHYzPW6QQXTDfnwfnEkgmpyVjMUwnroPQ3ek8ofELcoje8ktQzgvL+pAyVKfAOG tCirQbmwG61xE8hFnZt88YE4AaGW6b+pL7BrpO6v+itKx9WmCTpxfOyKRLdSz9C1czwb oAqxMIexTN/QgGMRAdQGqqPPiNyPpSD7p7HCmHnhubxNL1c5vJx8E0xep9RMcMK7AyXq MdYA== 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=rUTZvUNb/aRTjaMs08BG0O3uRLaU29RyM+PhYifid0Y=; b=K/wOvj83ACAKZu05KchvjY7kWAnfSlpwg1PaWf4kvHNgQJyN6WOuxE6+GoXKjIB/KG kcXEt8XQbdTg4FDCcgBalv2fRrjssU1Q4EW8e5acs5RZP20Ce3U+dOqIlfwgjg+XePIh iXV2XQoe2tMo8Y8jmx/egg9vjQe+gdlStR2+0HZDZ09a4PjuM+jlZpvG0xFCiScy7QdZ Yrajr/oprabs7CurHAFwWzqXeMTyAxOVucqs9pUaFPGo23RVqrHfCj685bV12eQV6U3o njZ2nMpPSAkPVqWO43I0eO+e8Lwvmu1NwyxvDpi8vwCExqh0Y/yORpFltEKlsM/2h/zQ DEQQ== X-Gm-Message-State: AOAM532jA6xLYHmLMeOYggtPLVndYmCIYaQCvngRgPjQUL5lrIeA5bYa KjhDTqNuhPg36v5MxCEPVQY= X-Google-Smtp-Source: ABdhPJzobyLQ43Z6C9NxnIkf5NvAfYzc3Ak1ecVF83cMaXbnY8A9vPPzsvVBDCRpBlZUJjMdmLT6vw== X-Received: by 2002:a1c:3b43:: with SMTP id i64mr4023029wma.170.1632517907585; Fri, 24 Sep 2021 14:11:47 -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 y64sm10344297wmc.38.2021.09.24.14.11.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Sep 2021 14:11:47 -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 5/6] MIPS: implement architecture dependent 'pci_remap_iospace()' Date: Fri, 24 Sep 2021 23:11:38 +0200 Message-Id: <20210924211139.3477-6-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210924211139.3477-1-sergio.paracuellos@gmail.com> References: <20210924211139.3477-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()'. Signed-off-by: Sergio Paracuellos Acked-by: Arnd Bergmann --- arch/mips/include/asm/pci.h | 2 ++ arch/mips/pci/pci-generic.c | 9 +++++++++ 2 files changed, 11 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..877ec9d6a614 100644 --- a/arch/mips/pci/pci-generic.c +++ b/arch/mips/pci/pci-generic.c @@ -46,3 +46,12 @@ 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) +{ + size_t size = (res->end - res->start) + 1; + unsigned long vaddr = (unsigned long)ioremap(phys_addr, size); + + set_io_port_base(vaddr); + return 0; +} From patchwork Fri Sep 24 21:11:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 1532504 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ajfY7Ymm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4HGPqJ4GVPz9t8j for ; Sat, 25 Sep 2021 07:11:56 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348510AbhIXVN1 (ORCPT ); Fri, 24 Sep 2021 17:13:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348520AbhIXVNX (ORCPT ); Fri, 24 Sep 2021 17:13:23 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB992C061760; Fri, 24 Sep 2021 14:11:49 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id d21so31081110wra.12; Fri, 24 Sep 2021 14:11:49 -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=iEHoU21DH841tx0qtRTz5FbDxLZko2mQ4Z33po9e6hg=; b=ajfY7Ymmr+7cnGhJOtrjT2wVcAV/rxDc7B6NaEreAvLHCKzEacArwdGGhIes3F+dnH 754KCqC0DrJT4Guxwjfq02g08n5JTWpJhxggEebDGVe4iAJEWjBOKlTrwOnDoES05n1s gi1tikCyks6F3pFbBEIqjzccnHxiruwRzYma9kwvIup0ywxIdtp2quLZwk+LOC4umEOm SymSBx4WkYfbtbEfxyFHPvXb6wbWLlExxXEmIoZcwc8rZqUGz468JTdlL9hBX0JTlrQc 4ppqYtW2JKAPOpazd9Zhkcdy946u4ZpSArcYgW/WA42qqI1K3O/QFTayYuSRleMmNGOK reUA== 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=iEHoU21DH841tx0qtRTz5FbDxLZko2mQ4Z33po9e6hg=; b=wyQ2pw6A2ymruPQNM82snjBLoItxMBoAT2tuPIuo1WA6Hks6k8QzQqHUsVt+pp1os7 fKV7eLousH9wHqTzJi618VpcL6YVSLzgBpESNQm1Be6As9L3BcTptrrzVcSlv3P4Buyd T7J08Y+COswCRrzgJ7mp9fkt5SYp9oWGjrb6OVs61gl125ErfvGZlzAvLaskMpF9kGnx vrJlD6fNJ6Z8Wc5HKce8YcMiTz444xqeDq4TP8p5MwyVuiIsqteE5XHpCqt3hg02SQDa bBgpGa1XmE3BGDbFblXecmNTrkMyXAgewTLCxdVkpcw26xFJsHl1aCywAf/+lU6KUT4X PWgg== X-Gm-Message-State: AOAM530yMPocuLyX9/kyKA/dYsMuFbC/TcPQtWAAeeCsDMpQm5CUGmB/ b1PeLlf0BHKVU9tsa/luajI= X-Google-Smtp-Source: ABdhPJxlUEJPYCJsNzawytHIOiH/45imW9bnZmTk3fyUFhDaECmpAeFTIfch/BNrkh6Bn7sAykByHg== X-Received: by 2002:adf:a549:: with SMTP id j9mr2799424wrb.353.1632517908646; Fri, 24 Sep 2021 14:11:48 -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 y64sm10344297wmc.38.2021.09.24.14.11.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Sep 2021 14:11:48 -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 6/6] staging: mt7621-pci: properly adjust base address for the IO window Date: Fri, 24 Sep 2021 23:11:39 +0200 Message-Id: <20210924211139.3477-7-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210924211139.3477-1-sergio.paracuellos@gmail.com> References: <20210924211139.3477-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. Signed-off-by: Sergio Paracuellos Acked-by: Arnd Bergmann --- 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) {