Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1271117lqa; Mon, 29 Apr 2024 03:47:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVerosGwiuSXhc09nJMr9p4wVSW+oj3gMG2y2xs9yNt4ayPr5WhykEyyxxjbL1wIr4n52hLR86XtDv7rgu5oDTb0OiHd40hHKZvkZCmg== X-Google-Smtp-Source: AGHT+IHZsywaRG+NTTG6L9nVC79ceILGJgUY7YbSZ7SswCBL8vGWw4q3C5jeKIGCNdK4BqDjzCt1 X-Received: by 2002:a05:6512:2242:b0:51d:804a:6b31 with SMTP id i2-20020a056512224200b0051d804a6b31mr3265397lfu.62.1714387670857; Mon, 29 Apr 2024 03:47:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714387670; cv=pass; d=google.com; s=arc-20160816; b=pw7wws96FrmGkH4S3Etj+xEFSYg2X5Zn8fylNEiaGQnPOKoSiGjrs0rj3LtA2hPqUj ORy+IlJpJC5P3FuKipDO00DoF9RQCVgU52eEUCOUeKFfM5R3OEMqjWwCbyQaSQjlQ2/U r7eR9riSFQB7EIMY/bQZg6SY1V3vHGbdIc3L+VKc5IUCQZ/eA5ntKOlFXVqktFaweeyh jyJG5UHqkBLr+a0D9PE7jgBPFelV6K4oHaoBFSVONI8kyjDIyZ56tspCybXZhJogh6AK kSBSwChaaOfa5L7agshSw2sQOAGOs7UU0Hyb6OY4wQcLraOzIYT0TEIpeneSvF3SZOyL uoHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=whtPAjJo4NTMFiwuYjVeCgtylKkCg67B8IlZgtsRPdA=; fh=EeK44p6sN/vZ4CcEfLIxrufQWBKmf0QirEulg1xfRsw=; b=L8RN2ityUMu89Bk9scgD9qcQd8mgWG1uvNDRAe0MqJyAqno0waf5mXOr/VeT8xrz8w M31J0M8hK+6w5Equgd9Bg3IXg3SYpMYkejfIiCx+FVsHF0Y4vHkycYWfEU5X4j5xPC+m tuSx0YS2ajudZFIsQKOHAj7eAMYIRMhDG16d4Ci6VJXJ5PomESMHeubuCrVnIZPXEOHd TK+QeCHpZGiwnNrht0hhUD3AtK41cAf3GwT/kX81cxOKKqh8UKMjzRcutsy3jFTtTzWJ 9ceX+Oz0MLhBG4ND1T9AoqU7aRNUWY21u2CUQXBvOKIAJRTiIplsh53WXqrWuK51yUYM 2gGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qu3vcQ5U; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-162088-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gn38-20020a1709070d2600b00a558f3a43ffsi13498078ejc.1031.2024.04.29.03.47.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 03:47:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162088-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qu3vcQ5U; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-162088-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9233D1F23419 for ; Mon, 29 Apr 2024 10:47:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D46A53BBF9; Mon, 29 Apr 2024 10:47:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Qu3vcQ5U" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC8B539AC7; Mon, 29 Apr 2024 10:47:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714387643; cv=none; b=e4pTWmeMCBy6wx8KUg2WyQdL2acq2fW+89Pi2hCB0KoQVbH1nMOP9Ldl2ioZraPHEE3qsDeOcRmPkn8kmoXSxtDjA8FaIgkvY4nRwCVft6r3vtG8V8fk/vSDeG5xzD7CSmOIeW+Org0FL4dEhXVx394G4+1+TXFqskZb1S6InWM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714387643; c=relaxed/simple; bh=xm79CcWQkryZA5hqm6JEw6+gJt6rJs0jHDkc/Fm0Kvo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=PMkCPamOIaZciajlXTZUehtyCBPm+9i2AakerHu2nVKu2k6AV7/CGMwmBPsfiS7O3GbPvsSYzgEHf6/OJOiPwADW7ek1SEmah7vprQJ26EwxlITeiA7U5vkx60RwBgqSE4kBBG72vNKD+tiLsZMu9XqRRPJA5Cz8Qn+9zozARFg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Qu3vcQ5U; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714387642; x=1745923642; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xm79CcWQkryZA5hqm6JEw6+gJt6rJs0jHDkc/Fm0Kvo=; b=Qu3vcQ5UG/cmqwNXpYZe7J/1dzkv/nGko92CM2YZCtuhfNbxAnRv4zgM /+fPjCgG41S60LisqFNIDBbrbgewYVQa6UJrFd/Huqqc626xD9/VLH3mB uk6A1yGvlk2OI6vkFsUJLE5/Z4s1oDqhrgEB3/+Jdeq0xfIR/L+s6s+An 5LPxbIYMNLSQ048cmQyTsJ2rKPq5kIz//eiFFu+wQmWs1TVESTdbbeVBR 5Wu3yAZhJbG52I1JLGeAxYzDUIBldUJqAcLwqOm/3w77MZt2Qrg8SuopW cyDtp1XqYk/q1ug8IRbyUFO1DrttgoIltbM9ElGnwcnWl/pAF7UXdADA5 A==; X-CSE-ConnectionGUID: wDQjT4U1T7SbMyjplIAeFQ== X-CSE-MsgGUID: DxJIkC6lQjesVH6XCElxqg== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9966408" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9966408" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 03:47:21 -0700 X-CSE-ConnectionGUID: 4DvHrAC2QZakeUA59jFLEA== X-CSE-MsgGUID: d/YhKH28ScaMZhNP8uPcwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26037455" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.45]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 03:47:18 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 04/10] ARM: orion5x: Use generic PCI Conf Type 1 helper Date: Mon, 29 Apr 2024 13:46:27 +0300 Message-Id: <20240429104633.11060-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240429104633.11060-1-ilpo.jarvinen@linux.intel.com> References: <20240429104633.11060-1-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert orion5x PCI code to use pci_conf1_ext_addr() from PCI core to calculate PCI Configuration Type 1 address. Signed-off-by: Ilpo Järvinen --- arch/arm/mach-orion5x/pci.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index 6376e1db6386..8b7d67549adf 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c @@ -216,15 +216,6 @@ static int __init pcie_setup(struct pci_sys_data *sys) #define PCI_P2P_DEV_OFFS 24 #define PCI_P2P_DEV_MASK (0x1f << PCI_P2P_DEV_OFFS) -/* - * PCI_CONF_ADDR bits - */ -#define ORION5X_PCI_CONF_REG(reg) ((reg) & 0xfc) -#define ORION5X_PCI_CONF_FUNC(func) (((func) & 0x3) << 8) -#define PCI_CONF_DEV(dev) (((dev) & 0x1f) << 11) -#define PCI_CONF_BUS(bus) (((bus) & 0xff) << 16) -#define PCI_CONF_ADDR_EN (1 << 31) - /* * Internal configuration space */ @@ -276,9 +267,7 @@ static int orion5x_pci_hw_rd_conf(int bus, u8 devfn, u32 where, unsigned long flags; spin_lock_irqsave(&orion5x_pci_lock, flags); - writel(PCI_CONF_BUS(bus) | - PCI_CONF_DEV(PCI_SLOT(devfn)) | ORION5X_PCI_CONF_REG(where) | - ORION5X_PCI_CONF_FUNC(PCI_FUNC(devfn)) | PCI_CONF_ADDR_EN, PCI_CONF_ADDR); + writel(pci_conf1_addr(bus, devfn, where, true), PCI_CONF_ADDR); *val = readl(PCI_CONF_DATA); @@ -300,9 +289,7 @@ static int orion5x_pci_hw_wr_conf(int bus, u8 devfn, u32 where, spin_lock_irqsave(&orion5x_pci_lock, flags); - writel(PCI_CONF_BUS(bus) | - PCI_CONF_DEV(PCI_SLOT(devfn)) | ORION5X_PCI_CONF_REG(where) | - ORION5X_PCI_CONF_FUNC(PCI_FUNC(devfn)) | PCI_CONF_ADDR_EN, PCI_CONF_ADDR); + writel(pci_conf1_addr(bus, devfn, where, true), PCI_CONF_ADDR); if (size == 4) { __raw_writel(val, PCI_CONF_DATA); -- 2.39.2