Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6880654imm; Tue, 24 Jul 2018 04:55:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeEmUnRaQJEzKG8trsSwqWtF9Vu/uc6x9fubOwm9LxDR/aYyZms8UJ0Mc4gBVN+hzQpMEIp X-Received: by 2002:a65:4304:: with SMTP id j4-v6mr16589460pgq.109.1532433330823; Tue, 24 Jul 2018 04:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532433330; cv=none; d=google.com; s=arc-20160816; b=f5okgTA2MQM7lZTyoPnN2D8qQasB65Pebj0iiLWFMYk8xErplClN5SloW0qYO9Iq21 ZUnNrWM/bixdoIt2nX8XiJI+5qOQb4nufOYmbcPE8TWOQ8oYccbPKIKzTi8s2usqh9Kx /8FC+bsjAsO9+m4PsY8Kkc4Ra7+JYERwMlK5+0z7mGUAny49furleC72sc2a1KPiAG/B kUlmMhTASPjNkpKyA8DgY9yZKKOXY+Qj8y7/JZDVpZTtJU/W/v4pOXhRtw+blBb61f6J HFStLv4iVgxTZNEikPPw6gZ+/MlzRIICfqm72aRayu7FpKSPidi1czKgfjntFavbvR+C Un6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=u/sfnhu4XmJgMjhKCO5VKSxo5HQvmqiYQp6LvyB57XU=; b=TWwASyvL9PAry/xt5MeM8TI+QHsJ8dXPVQPUoXxjz6t2AAAxiOZZ96w17GrrtPvtKv m3CdUPtRygE7HS3f19JedwZ6VORiOskFYnxrYMa7fcpK7Muyz21TSlLsnCgU1a7MqS39 ZVcum0wV/R8FKA5rEK+XhX8Z4z+kDun3YGAf/3plv0bxylp+Ed3ypu1VhgpHNxptgiyp KpMBtvC2eBYAQFx6LBPK3Rk2eIOmPyN7R+7YVowgbLldxFojThubcySxwOKo2MbE1n48 KvqD5lic3/+5IwhCfDsMhofEeehFXvcZjsA/RbtoCpEOXZazbaUiXqsp32QIIFlQQHvf 9aJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m18-v6si11272899pgg.693.2018.07.24.04.55.16; Tue, 24 Jul 2018 04:55:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388476AbeGXM7U (ORCPT + 99 others); Tue, 24 Jul 2018 08:59:20 -0400 Received: from mail.bootlin.com ([62.4.15.54]:57527 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388254AbeGXM7U (ORCPT ); Tue, 24 Jul 2018 08:59:20 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 66F9820756; Tue, 24 Jul 2018 13:53:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (176.199.29.109.rev.sfr.net [109.29.199.176]) by mail.bootlin.com (Postfix) with ESMTPSA id 1D50C203EC; Tue, 24 Jul 2018 13:53:11 +0200 (CEST) From: Thomas Petazzoni To: "David S . Miller" Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Marc Zyngier , Hanna Hawa , Thomas Petazzoni Subject: [PATCH 1/2] sparc: move MSI related definitions to where they are used Date: Tue, 24 Jul 2018 13:53:04 +0200 Message-Id: <20180724115305.11289-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.14.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The definitions in arch/sparc/include/asm/msi.h are only used in arch/sparc/mm/srmmu.c, so it makes sense to have them in the C file directly. In addition, having a custom arch/sparc/include/asm/msi.h prevents from using the asm-generic version of this header, which is necessary to be able to include when CONFIG_GENERIC_MSI_IRQ_DOMAIN is enabled. Signed-off-by: Thomas Petazzoni --- arch/sparc/include/asm/msi.h | 32 -------------------------------- arch/sparc/mm/srmmu.c | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 33 deletions(-) delete mode 100644 arch/sparc/include/asm/msi.h diff --git a/arch/sparc/include/asm/msi.h b/arch/sparc/include/asm/msi.h deleted file mode 100644 index 3c17c1074431..000000000000 --- a/arch/sparc/include/asm/msi.h +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * msi.h: Defines specific to the MBus - Sbus - Interface. - * - * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) - */ - -#ifndef _SPARC_MSI_H -#define _SPARC_MSI_H - -/* - * Locations of MSI Registers. - */ -#define MSI_MBUS_ARBEN 0xe0001008 /* MBus Arbiter Enable register */ - -/* - * Useful bits in the MSI Registers. - */ -#define MSI_ASYNC_MODE 0x80000000 /* Operate the MSI asynchronously */ - - -static inline void msi_set_sync(void) -{ - __asm__ __volatile__ ("lda [%0] %1, %%g3\n\t" - "andn %%g3, %2, %%g3\n\t" - "sta %%g3, [%0] %1\n\t" : : - "r" (MSI_MBUS_ARBEN), - "i" (ASI_M_CTL), "r" (MSI_ASYNC_MODE) : "g3"); -} - -#endif /* !(_SPARC_MSI_H) */ diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 1d70c3f6d986..be9cb0065179 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -116,6 +115,25 @@ static inline void srmmu_ctxd_set(ctxd_t *ctxp, pgd_t *pgdp) set_pte((pte_t *)ctxp, pte); } +/* + * Locations of MSI Registers. + */ +#define MSI_MBUS_ARBEN 0xe0001008 /* MBus Arbiter Enable register */ + +/* + * Useful bits in the MSI Registers. + */ +#define MSI_ASYNC_MODE 0x80000000 /* Operate the MSI asynchronously */ + +static void msi_set_sync(void) +{ + __asm__ __volatile__ ("lda [%0] %1, %%g3\n\t" + "andn %%g3, %2, %%g3\n\t" + "sta %%g3, [%0] %1\n\t" : : + "r" (MSI_MBUS_ARBEN), + "i" (ASI_M_CTL), "r" (MSI_ASYNC_MODE) : "g3"); +} + void pmd_set(pmd_t *pmdp, pte_t *ptep) { unsigned long ptp; /* Physical address, shifted right by 4 */ -- 2.14.4