From patchwork Sat Sep 25 08:46: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: 12517319 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 72D61C433F5 for ; Sat, 25 Sep 2021 08:46:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50E10610C9 for ; Sat, 25 Sep 2021 08:46:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235252AbhIYIsY (ORCPT ); Sat, 25 Sep 2021 04:48:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232623AbhIYIsX (ORCPT ); Sat, 25 Sep 2021 04:48:23 -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 766D4C061604; Sat, 25 Sep 2021 01:46:46 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id u18so34622741wrg.5; Sat, 25 Sep 2021 01:46: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=/Wb71HqjEOUF7N4+48DrIALQ2aRBPLW7pWxHbo6fkmE=; b=Qb6/ebapboRHy2oxDc5q5VKXIVMIzbT8rHvoiG93lXdmxmyV273iAip7+DFT0TVWM5 ThMCV4WQlTJfLBbPiCfXIXrJA+e96NvGpyT95pOLeR3cszXHWgK2d8/As056yObw/s6M hBjmb5+F0HSPxeHaF0FLKZPtLGQozqNac0tueZCGYo7UOMd3hYdqcE6RuDodhjH/GXPj yrP3re6Inavf+6pMuFQroemIGz8qiVLjKUDfqEPscF1uaWd2S0EoRyMplFmIPrxwEwj/ qnTWTlTcLcoAyrZFOJI1TGPOB1aOisEOkqccb1yPx/J3qng3JIS/vMOoJDNWnxHHfYVt 4/NQ== 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=at+kVPorqhycMtWAWCwzC+j8cFKuIY1cf2ov1Hpg0K4avfLAo+iEtCihGmPXeHzOPm kjOzMruVHmCMYM3snY8EYXjl1zQmpLYsPrsUzifTV/7g73E+zgWOHJKPQofGtH826+h2 j+XFCxQTsBPbwVdRuiVFuLCxVoT5MRsIT6ZNBqso7a0nFZDfUQcFBAHAkHsCEu5eiiB5 Myuhj61occ7zCSechmRyFNSWshPJvnH0uutK+6DkCHfh8XBNSECaHBkvqOFZ4La35pOk z6ZTvZiRfCDj3xDr/mws0q04TaifwsVpTQD5twLy2/woirq1RAAdYqWIu+T0sbhX32Kt 59qQ== X-Gm-Message-State: AOAM531xEYfLfEjC0/rx1N2jc8BKlFRjzV12dkNbVSvXL6rqcGWUmNzR FOWQcWrdyg+Oarlv2Yjkbds= X-Google-Smtp-Source: ABdhPJyHw1n6sTAwD4+nW7+bDwyTqs/z8xs5p4MbTYREbctn6X5pxMdGperx/5q5l/rxf4lfJ0zo1A== X-Received: by 2002:a05:600c:17d1:: with SMTP id y17mr6282479wmo.135.1632559605031; Sat, 25 Sep 2021 01:46: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 y9sm17222997wmj.36.2021.09.25.01.46.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 01:46: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 v2 1/6] Revert "MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT" Date: Sat, 25 Sep 2021 10:46:36 +0200 Message-Id: <20210925084642.5642-2-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925084642.5642-1-sergio.paracuellos@gmail.com> References: <20210925084642.5642-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 Sat Sep 25 08:46: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: 12517315 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 7EA65C433F5 for ; Sat, 25 Sep 2021 08:46:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E4E061039 for ; Sat, 25 Sep 2021 08:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233850AbhIYIsX (ORCPT ); Sat, 25 Sep 2021 04:48:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232535AbhIYIsX (ORCPT ); Sat, 25 Sep 2021 04:48:23 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7931BC061714; Sat, 25 Sep 2021 01:46:47 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id c21so4886127wrb.13; Sat, 25 Sep 2021 01:46: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=OyR/G6OXJUzzgXbsVp3sTRgTYQYfQEC/z3g1X2aYcVs=; b=Ve5h4llJBbg+a9UGjsfI2LkC6Tty/m1yswQbTIaTUjASf3eUBFomFWIv3s1iqUj1zD ks+oXPxs6vEk3iRog76+HBY29NElVilHQzVnA2+ecBRG/ODxFiDcT/LCUySr5YInBpfc 07MIIIXjHMPcuVM95jcPa9tVXJncbQe/mrU0uCLsyNMElvf0VIm37LmLNxAaFl3KqKs8 JYbl9IzgvhHzJho1rYgCh7CMm452s2dUwju59OMASmmCi/owxBnlUdmjnZff5kJcmCoL i09EvltS53cK58I8lXQDfcNiiJwP/QqiB8iHqgUZWUtGUWJVw33ikXCudmh6YEZNG5tx CsvQ== 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=MCnsXYmKoTGoomfTYOLGyuxmjGpvtACXVXPNsuKaUFFXq1uGDQkETFUTI95AjbQ0aY Mr0dGLhsAF6vuL5SfBeSKcfRIz6HYAaIXQGCv75+zXmy6H5VuuWIRzPGIOcLQZs/iG26 XaO6RX7ftOIqnQgNsgc+dO9ighggPHs0d0nuKLmflcA7Q7Zf8Vj9FavGYA2JxFCfqyqA ANlLfDC7p9JRBIW8JIlqsFjiNVw4Xyktv5nJMJYH/c9MY/vcJJ8DEy5aob2ra4pE3sq5 xEya/5KU5DTxRGHdKcZX4P8tEJKfJeIq/Ju+QAwJ7zjq+m8FwLkeoXr9RfgSbEcW3ZoJ GWxw== X-Gm-Message-State: AOAM530FnhTFMes4Q0D0qa9xaEv3xXMCIdKavfhNxxC5KZkyG6FDN18s 4O+HeH7XnF8jJ4JY5Clum7Y= X-Google-Smtp-Source: ABdhPJxrdMP9CEP1wL+ipHaMl9NqnnbgtNcHgIxgUCsjqPj7hjtBA5Xxk78r6uj30mhTf8XuyDbchg== X-Received: by 2002:a5d:64a7:: with SMTP id m7mr16103528wrp.171.1632559606127; Sat, 25 Sep 2021 01:46: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 y9sm17222997wmj.36.2021.09.25.01.46.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 01:46: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 v2 2/6] Revert "staging: mt7621-pci: set end limit for 'ioport_resource'" Date: Sat, 25 Sep 2021 10:46:37 +0200 Message-Id: <20210925084642.5642-3-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925084642.5642-1-sergio.paracuellos@gmail.com> References: <20210925084642.5642-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 --- 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 08:46: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: 12517321 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 51994C4332F for ; Sat, 25 Sep 2021 08:47:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37B6961039 for ; Sat, 25 Sep 2021 08:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232535AbhIYIsZ (ORCPT ); Sat, 25 Sep 2021 04:48:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232860AbhIYIsX (ORCPT ); Sat, 25 Sep 2021 04:48:23 -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 7F76BC061740; Sat, 25 Sep 2021 01:46:48 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id i24so18623397wrc.9; Sat, 25 Sep 2021 01:46: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=17lAPdZ/wrC5MQWHWYujyp8BZtV5RPbk2EUbs/RKr5Y=; b=oFNoN7WuFkLkL4Gbhxk9ErtpomJ5l4gZxKbX39MGxDRQspEYedNasXU80Ma+WnQnK9 pJC36nZcvyPPvvKo4zR5iXzjuwXsYJUUl1oPCcnhhTzHfUrpcYmx0aBH+9AaKEjeeCg6 BLehZGKfRl24MSHQleIeKVkRxLnxslWpNI9pmO6jwSNyBY3NX5Y0+OucRmvM9GGpTlKd JymiB70g2KdAMsgvLqjdabT/h6e0wTiqQynrhbtb6/zjStg0ZnBeZRckHeU841lPNXBA m4zH7e4TaxSTNV44nUhWHzyXqzM8PUeOQhG2mGwShkQPbVdHNkHZIzp6xpyXb95PkxiO gfMg== 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=17lAPdZ/wrC5MQWHWYujyp8BZtV5RPbk2EUbs/RKr5Y=; b=Qne5gxbwP920cufWK2MlLYkjDpAqgwlWrKuMLwM0adEQMd4Cg5wQ79XlhuqbSXY04N e7UHFZ7ZiQhlqX1VeZp3Sw6xLzKzoDIM5n4/jiJH7qFbv5pucLkMjlCWxAqjqZ469uWM tg0tA38QR279ANRMuZH/X0aMt+aMX3++sOkHLbRUxg5qxxCGKNAaqUAnv0Yg2+EGTeXe ldDtCvJ9KKMtrMggCo6AeB2LLuGxH6RK+G/uh9FO3RLHgMl8hqm+dhtUkkczhsM5nexN ZGWdUzzE+xky78QJJEoyUWaJgcOgy+RC9k9rjrX99cHHVeTzDR1JF2ccj5NTPKtaKKop vU8Q== X-Gm-Message-State: AOAM530qWW4OyX9ZCuprcEBv21a/imKFxiWT5z61I8USE0q/AsYRmiLI OmGjw0fcGv2GaBJGOXg3WPM= X-Google-Smtp-Source: ABdhPJw6v5mraRqYTfIkNChWpvs73b6BY/vyVc7/YjnI1vijps0erveCsIWOw7ofbOwqV8nesCDApg== X-Received: by 2002:a1c:a713:: with SMTP id q19mr5984719wme.42.1632559607176; Sat, 25 Sep 2021 01:46: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 y9sm17222997wmj.36.2021.09.25.01.46.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 01:46: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 v2 3/6] MIPS: ralink: set PCI_IOBASE to 'mips_io_port_base' Date: Sat, 25 Sep 2021 10:46:38 +0200 Message-Id: <20210925084642.5642-4-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925084642.5642-1-sergio.paracuellos@gmail.com> References: <20210925084642.5642-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@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") Signed-off-by: Sergio Paracuellos --- 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 08:46: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: 12517323 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 66FB7C4167B for ; Sat, 25 Sep 2021 08:47:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45C3B6108B for ; Sat, 25 Sep 2021 08:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235880AbhIYIse (ORCPT ); Sat, 25 Sep 2021 04:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235079AbhIYIsY (ORCPT ); Sat, 25 Sep 2021 04:48:24 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C6BAC061570; Sat, 25 Sep 2021 01:46:49 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id i23so34655415wrb.2; Sat, 25 Sep 2021 01:46: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=7J/eKw85aOccYjSVMNGJibIwRKQiWh9ftrBZOBFy2g8=; b=TH1lvqPI5Wu0X6zAw/ADa05wm4/08lgsLaffdzbJD/hVw7xIE7cKD84HUkuVFkkP0J YtIAqQGpexosa0d323h5/PEE9czxilaHrtemk0pbCLfuO4OpT2/69uwxraez8axJMz0O TRil2Eqc57lk4TbjpxBy0UOvE3q/sI4DlTKzO+ZVnmXrTijSGDJ0a43K50HmjgD+CKPp s2kR8FfMdNMxa8VjyX4gSHitjKP/6+MRwdKZgczblrXNRWsLb3io7DNWkcqNCeeVe7PU c2sHVYKaFu8UtjBsFplFg3EUpeD8m0H3xvano+Ch41gjUoS/IvTZbsnPmXAHdl8C/lkI oWNw== 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=7J/eKw85aOccYjSVMNGJibIwRKQiWh9ftrBZOBFy2g8=; b=v1Wk4vvo7Yc4ECfiDTPK/hEJWU0lwgeV0QyCOXEvaPrbZrFx1Qq+qdsS9MVaBz8sa2 ChTMNHd6sbtRIQL/Zqz4h93RYEJkgKnEGWiq67prpRsJtOH0a3e1rx+uR4QYlNMtnI6m h7mmflo8k4KLU4hXpNMfoAfGD17ceoNweIj0fjMOwJeb1uNXntnucGH7KSQGwbg5otoq 6jj6swEsarHaugUj06gQtVWZlqH4UZ4tHWuQxjPUhquoPH1TyYXYrD1ke98XlMqpqQEf Kc17/mIq7fz4s93WI6xNQ4B/bJ8oaQe4M+BftPAbb8rg+pt/J7q57GuLsfFKhKI5WN99 +9sQ== X-Gm-Message-State: AOAM531peXgZy1ZbYxT2FcOJtOgMey3qPFgtz2irfGdjQDGDOXgtgO0n Yb+Q1z1Pxb6H0ub5lPRM6MY= X-Google-Smtp-Source: ABdhPJwuVOqIQBjcBSCQWuS1vJce4ZX/Ly4UDRWJE94+zyyFnornpcUREkh3OAOu2o63wgKNseoM/w== X-Received: by 2002:a05:6000:184e:: with SMTP id c14mr15982534wri.242.1632559608227; Sat, 25 Sep 2021 01:46: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 y9sm17222997wmj.36.2021.09.25.01.46.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 01:46: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 v2 4/6] PCI: Allow architecture-specific pci_remap_iospace() Date: Sat, 25 Sep 2021 10:46:39 +0200 Message-Id: <20210925084642.5642-5-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925084642.5642-1-sergio.paracuellos@gmail.com> References: <20210925084642.5642-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 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 08:46:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12517327 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 9B2DDC433F5 for ; Sat, 25 Sep 2021 08:47:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86077610C7 for ; Sat, 25 Sep 2021 08:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237161AbhIYIsk (ORCPT ); Sat, 25 Sep 2021 04:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237010AbhIYIsg (ORCPT ); Sat, 25 Sep 2021 04:48:36 -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 ADF10C061570; Sat, 25 Sep 2021 01:46:50 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id t28so21172815wra.7; Sat, 25 Sep 2021 01:46:50 -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=hoVQ6nm7yhZuUAmxNlI1q/YX8dH0BGqO1HRvmeFsLAnpscnORT96SbHyxvVMPXhxTn PDIEfftEwmYgZ6w5oxkLINNBZlWmkfy83T5LZwODQa7yDJFvNa4Mf1NGJFtxe+RXLJ7v 28gqRJt9fo5EVXP70a9TPoW3PJ86eNIE8hc/Y8mPhRu3O3rDwu2ESBMPeqoaaQ+psYuN 1PAUyYm6EDDSfG2999aZy3zRYyZaKmU+hGmue7KQqA3Aw7el7Psi6PmSqSGGBRPeHAkX 98QEZjhngfD29uHbEPTr9Eo6QZzgBW42R7Ree/cXzh0DK9y1tFZwzunTSCB3ZUZ6dWM8 7Zbw== 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=b4mnqCusjU51katd0zBi3TFiIkMgzeYDxMCWl9wiAAgaNGpGJjo9PSLzot9CyqnJzm Ub7fJKZQaeXqUbQFmTxKA4pMliwcPjanwa9Gw117VET40+VfaMfclelx3xJroZiHnMwV /sfrqzs31nsFbvKQACBmv6cAfsDa4rj4+peb819D4dYCbmY1Y9/hQXciXYAes2IBtoHD tiMsQAsPb0FinPLixxZjsQUVWz0oBKrTGkhOZbGK4xWfrIAJZkbnP9thEA+ZrIOD2O9G /oTP2w5fuYrYPKalFrHb7UKPm+z/XxuK0DOGi0ELizLva+GU0S+rmmGBXYw7DP0B+Z1V IFqw== X-Gm-Message-State: AOAM531p1rSA2fhP+eaeJ/jDsFLaFVeIq8FpsPzrJbjJ0UDb+dwgjrng TjdfAZimgrbMcYnVLmt/IrM= X-Google-Smtp-Source: ABdhPJy/2JiHVCtpZqyGPxj+FixQ15sAVbATyh0UqzskjKHeIwWnt2HxbRbTu3kiitLIgVHeBoRS3w== X-Received: by 2002:a1c:ed13:: with SMTP id l19mr6086272wmh.48.1632559609342; Sat, 25 Sep 2021 01:46:49 -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 y9sm17222997wmj.36.2021.09.25.01.46.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 01:46:49 -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 v2 5/6] MIPS: implement architecture-specific 'pci_remap_iospace()' Date: Sat, 25 Sep 2021 10:46:40 +0200 Message-Id: <20210925084642.5642-6-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925084642.5642-1-sergio.paracuellos@gmail.com> References: <20210925084642.5642-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 --- 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 Sat Sep 25 08:46:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12517325 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 26909C433EF for ; Sat, 25 Sep 2021 08:47:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FB4E610D1 for ; Sat, 25 Sep 2021 08:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232860AbhIYIsl (ORCPT ); Sat, 25 Sep 2021 04:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237067AbhIYIsg (ORCPT ); Sat, 25 Sep 2021 04:48:36 -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 CF198C061604; Sat, 25 Sep 2021 01:46:51 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id w29so34480134wra.8; Sat, 25 Sep 2021 01:46:51 -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=PIJxllT69paC9PSPnGweRS7+dl4W6XwBhxX3NJEfjhKXs2OgetHWGsVMM+/xlYnpkJ yE067R/ulXFWu0+Nb22zbtRi8id5cEPSI4UwX4hUP/vr8+fIKm0RSc1dshmlkRiEEO4e a8Ev6kbxZ7iEMMiCbQvYroehkiSsHhWWckVb729l7AVvPOvm2uRGq7JtMYujgGJyM8xw 0JeGRmnCEqhmtxTCWUhlCgG3Qp4q4kP9jJT2zWwu/jNuV22dva3L3R04ETxhI8U4+Tzr jurnDvW9kIcg4JM/zHGJQKU+WHZQcULwW9HWmexNR7JaaNFn+8vixbUKHUTkeYPeLUL1 7gVg== 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=u+83xcNnXrp8acai9DlI4z4py/ZFyDTC+b35STZYir4QapJJ9QLcbA0vPHRA3StBea yYJv4/y+E9GtJm0L7be3VHMEQVHdzgfRaEg2L3laHCm6bHeP4ArBh9BXrm2BqmmOa3aA hVuPHF/PI+CcTCYfHMP1RdeUinfUv8SqHeHbO9N+s46OPVTnsDNNmS+FJuFEnKUMq5HS adsJk21DrV7ZqZkUygBmVe96dXTEoAkA61R1L49ISTEeA0Yt+LF5+0CuHPAvhWeznXyP kDIC2p1q1dqfOQ94KM8slVVLC/aydcnAAgKqcynFHolGILU/+EhE5EYuBLzNfehwv6ov T9Pw== X-Gm-Message-State: AOAM533g+ry+INIzLhtZXtKXQq6TchWmQ23GMK0LpOc3ltT1QH5o7uqC U+Ve6eedn3/gd13QunONw68= X-Google-Smtp-Source: ABdhPJwbFGgQ4QqaYZwkc1R+U45nYpniQk1gbE3hEL7mfMPfDk8HqaaEUp/5WE47sL6izCrEYT8uVg== X-Received: by 2002:adf:eec3:: with SMTP id a3mr16448514wrp.276.1632559610460; Sat, 25 Sep 2021 01:46:50 -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 y9sm17222997wmj.36.2021.09.25.01.46.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Sep 2021 01:46:50 -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 v2 6/6] staging: mt7621-pci: properly adjust base address for the IO window Date: Sat, 25 Sep 2021 10:46:41 +0200 Message-Id: <20210925084642.5642-7-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210925084642.5642-1-sergio.paracuellos@gmail.com> References: <20210925084642.5642-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 --- 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) {