Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1475521ybt; Sat, 27 Jun 2020 09:21:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJG9x5G86hEK5SB0NJX5IBm2W+Ju+wbVbII494HNqbC7oCqtnWiG9LokmKawEy+7AjAcgj X-Received: by 2002:a50:fc97:: with SMTP id f23mr833240edq.255.1593274909333; Sat, 27 Jun 2020 09:21:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1593274909; cv=pass; d=google.com; s=arc-20160816; b=pydSvJHFnRpZof8moWh1q+OOcHO7eNxnmQIyi/PhC+TGpEs8mrMpG1KtpMAr1EC7aK 22V3GTzBm19A0/ewDHvIeBt9iYwoshJGHDI4fpYJtzoUsfL49cGG1uCxqrUytuaKdh9c /mzyMHtFuNpa9MZgbSgITmQrLuP14QSmTZ40177G33g3k8yDXMWMHSD+tOjUHRyERv8D YInBxVsq4AdxhYCutjB/R9eYshXzN5ncH1M3ffUwwuHWceS/YXC9BdNQXRFL2lJG0Rz/ mgsmVpNqIfDP23q/BLkGI64ttPNLVErK3QqGLI3/McYwmcuUBv+2l0YhVvz8XNGb9+/9 iRog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:wdcipoutbound:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:ironport-sdr:dkim-signature; bh=NXO6/Ml+4QoRipL83FXkEzvgldcs4Pe3bR5xg20zgv0=; b=fAh6qLgtRQWha6K344CnHnOW0XKkpgiGWUEVUAWcdccqW2AyHi8swcCEIG11IN3/jS q6isBijPJmkiakvwdXSK1PgpbcKBWxKlJ7NfZTMMyIfBa4UZW3HYJK6nTK1WMtuYeYOL 4OUstWqwo1ZGNoro9rM59oEKcNHdMMXME5Pw345kEe9+01utvB551NE/nFQzMabLdKZ5 OpyZHFRNueQOQ0DtoyebHwa0z5TzbGFrt4CgwUEnbv/vZ9UedvoVWqm6oRI4l2QkHjcy ny1zDgP05IkRFGpW4jjXHt96HDndjFH+K8KT40hEDcdW0bxywCocNOCQgZV8thWgYdVF fEzg== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=e8PhapEG; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector2-sharedspace-onmicrosoft-com header.b="e4AQ/GwH"; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si13297934ejy.71.2020.06.27.09.21.25; Sat, 27 Jun 2020 09:21:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=e8PhapEG; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector2-sharedspace-onmicrosoft-com header.b="e4AQ/GwH"; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbgF0QVE (ORCPT + 99 others); Sat, 27 Jun 2020 12:21:04 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:38680 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgF0QVD (ORCPT ); Sat, 27 Jun 2020 12:21:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1593274862; x=1624810862; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=iHbtAhYJQsR1I6m1HrEoA+bmLAN3h104ziV0BZfDKlI=; b=e8PhapEGOTDmjBDM/u8h7i9hTP5L0L0vj11BsM1Hsq3RsnQGToB1WglJ 6/BfOKCvnRC1XF4GVDBnfwYacCH0cEiLXC78IvZpKdYq4gS73r3hubgjN xNuhrQ5mdLhvYC96NRdquAGIOD2ojhmZIj+sROu+RSsT7OqLpfX3K2X3P UALxLcI16A52vibR7BTdO2Iue3I2r1dflEA04Xx41oLmeBfZDWvVjiPn2 Fy42Hh3doj1t+a4jEVT9hLssib646Lvb94GNO6e5U6neMsoCn+/CIYcAH 4HhwxO2vzhCBYuCDFC8ULJ9OiAk42JAiKlPB0UWi3UREV4Fw75r3FNM3c A==; IronPort-SDR: 2qHTPwPSd+y79t3yilgVualTuO+BY1rzKghPkwxP7BCH5bU0ghorx7goshKvKHN7G28hMss7SS 6LCKK6tNdFwwH0DSvjjdky2rrrvXJVdTMeRhaI6a8EruGolkyX1creBtPlkafRFjr/4riuikwQ OA851cVoOLWQa8Bw6o1XlfiPGMMGPkOIZ4ovEnsezTBfDr6IYR2W5I9ikovDpWNvwqu7EVeBei jgplUT8BYZ3FdSgTCIjy29X4dsvtnxJ2cYr8tDtfoGYJP9ZXMfdCkUE/u6PwkGYwK4gtPw408o Z6U= X-IronPort-AV: E=Sophos;i="5.75,287,1589212800"; d="scan'208";a="250304531" Received: from mail-bn8nam12lp2175.outbound.protection.outlook.com (HELO NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.175]) by ob1.hgst.iphmx.com with ESMTP; 28 Jun 2020 00:20:59 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n7SLG2+qH3lGQm6eUydAirHDnqqWmIA/TXWwogkBeLGl+8UcxmjMTGdFfpp+2N0FBOFXB50GN4d4XJUlCE0R7BcCC1IwZK+2wqYfQkb7EecHpa3hQXApwvVQsqPt3Z4l8ISSd4kBkYObSbz54DBSbcNKt1xHMNLYwXzRoVvlwrCvM1umnM9mc9B+WH4OFgreZ4zjUZdNAZHYT/7kRPhZlDrH6fnNFf1BR/Np1f1xyD6wjiSz78oAU1zl/Kk0K89TA8F0Qyk4pH2peYMdpQBcFbJGOE7YfDfedPXOGhE2Hl9kNlIbLoahOpD7YPMuvLJm6hddOhuiPU4DyIUqRJtC5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NXO6/Ml+4QoRipL83FXkEzvgldcs4Pe3bR5xg20zgv0=; b=gRcDHGzBftqTJfhRF2usmazzNw+aboAzSlpo89srTi6yPPm5v7V+JB+OH1D70g0NWUEILDtbiEIKkir2YZ3XohbwX9U0HASk5nJR50Y0l1PpX7HMNf0mpxmNZCDms1YY+LrKgR9K4PS2qmtAI7Ehmpi916SQcC8X+t+eBDwkGnZyN7tldBM9U+KxECtPMQPJe0MQuokUr+LixgIZkKEKwU3hu6MM6SixcpZsn0KauNEBE4Q7OOIqGRBevymB0dqccYJhUz36SjMgBbdHAP9t7+oOZq/lYpNz9W1+5P3WxwzLNODbfQRTtheNTl/Cl9wySo+gaUwd3JGWI2i4DSCNQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NXO6/Ml+4QoRipL83FXkEzvgldcs4Pe3bR5xg20zgv0=; b=e4AQ/GwHg+NmjBQV73LtdJZQZ3lu52znavUamnWTngaYJQ57QZX1p6yjNBDgaF9YEGBwJDhjcPesgQmB1p729HhE85FZtslYLsEwmGna0BIsSD4Q/BjiWHSLyZtYI+D93cHs3h4VRqr+23XSAbWGeDfljhGCwxt2N05BSpX4S90= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from MN2PR04MB6207.namprd04.prod.outlook.com (2603:10b6:208:de::32) by MN2PR04MB5725.namprd04.prod.outlook.com (2603:10b6:208:a2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Sat, 27 Jun 2020 16:20:57 +0000 Received: from MN2PR04MB6207.namprd04.prod.outlook.com ([fe80::e0ef:7fce:ff0d:f580]) by MN2PR04MB6207.namprd04.prod.outlook.com ([fe80::e0ef:7fce:ff0d:f580%7]) with mapi id 15.20.3131.026; Sat, 27 Jun 2020 16:20:57 +0000 From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Albert Ou , Rob Herring , Daniel Lezcano , Thomas Gleixner Cc: Damien Le Moal , Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [PATCH v2 2/5] RISC-V: Remove CLINT related code Date: Sat, 27 Jun 2020 21:49:54 +0530 Message-Id: <20200627161957.134376-3-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200627161957.134376-1-anup.patel@wdc.com> References: <20200627161957.134376-1-anup.patel@wdc.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MAXPR0101CA0029.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::15) To MN2PR04MB6207.namprd04.prod.outlook.com (2603:10b6:208:de::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (42.109.128.251) by MAXPR0101CA0029.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Sat, 27 Jun 2020 16:20:48 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [42.109.128.251] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9c37d784-a1e5-4c12-6a43-08d81ab61234 X-MS-TrafficTypeDiagnostic: MN2PR04MB5725: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-Forefront-PRVS: 0447DB1C71 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pwPdm4elaMKYk2o6jx5/1eO1tSZF0Mbnnam9e0PQ/6vsL3ROM7r4fv3Rvwami2pKAVvsap+GURuUM4EQGymmHeD8JcN8F7FwIrz8zYa6LVTGKpdSQa2BzKgkqLh1bM5kUYU8O39AMtTOU41mFD4tIr+CPDi447UtvVSWQUU0htEixwWWKbLl+fD77Jkh5O9PzSHjZOdvE27yiAtJs961xHpckdQUWHr7oqPXZADlWnInt/7DwpKW9u+Fa7JEatXtcs9Fec/yWn47KtPmPa52gK8Kn9S0uORE+06GpKlviKGVWkJ/GawSyb+P7MotITr8G74HTrhyGLy9xYSPgsk72A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR04MB6207.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(136003)(346002)(376002)(396003)(366004)(1076003)(8886007)(186003)(16526019)(52116002)(86362001)(55016002)(6666004)(1006002)(36756003)(7696005)(66946007)(5660300002)(83380400001)(26005)(66556008)(66476007)(110136005)(2616005)(4326008)(54906003)(478600001)(44832011)(8676002)(8936002)(2906002)(316002)(7416002)(956004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 3q/+IVxPQNc6wCuYIDKRX2qd8iDXAHjb8VCCygu9RbELuHVk/UtiZTNFFPwI1mfgPJmw+gicfNFQl2cbDC5q+cgvjKOiczoexZwb3EI53IXK7RzSaPfdVnLxm/Cpr+YAn94nlCsy3IxQD2LEj9wsmp3DdkE2NBMvxcn1PteRJ04erD8WakEujm1bjpQP/TG70lhKmq8YokMGFn7wHGCeA/sP0iaRuauLMLsHgCD2fKgvSZZFr/tbKrclyfgYwzhBSJ9gQMikGozSke35wbMmd4fymQlNaD19++Kc+5/o0BFdNvs6CDfRsprCU1Fl/3SsvFRdcN6X9KdFeTEf6nHPc6SC/fykf4cTb+aeEsK7FH32L6mzOHNmruHAIThabwP41RqMd8UxdHheGJldhj0gRXwASeVhi63a3+kAwv5B7gGq37ojGujhQPCiL2gwU6xSt3uJnA17Z0KTF0xEuvsrga2J8oUuBgiAqOM0vh9iuDTmPvLKmH5i10LiiVhoj9/V X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c37d784-a1e5-4c12-6a43-08d81ab61234 X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6207.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2020 16:20:57.2295 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UwYJgLNbqACptmZWhoz62QXhvImdeXFXbqjBJTyqFBJz46YtetNtygbHJR+GbuJXbjSycqcq/wX75Zc3Ro0S/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5725 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We will be having separate CLINT timer driver which will also provide CLINT based IPI operations so let's remove CLINT related code from arch/riscv directory. Signed-off-by: Anup Patel --- arch/riscv/include/asm/clint.h | 39 ------------------------------ arch/riscv/kernel/Makefile | 2 +- arch/riscv/kernel/clint.c | 44 ---------------------------------- arch/riscv/kernel/setup.c | 2 -- arch/riscv/kernel/smp.c | 1 - arch/riscv/kernel/smpboot.c | 1 - 6 files changed, 1 insertion(+), 88 deletions(-) delete mode 100644 arch/riscv/include/asm/clint.h delete mode 100644 arch/riscv/kernel/clint.c diff --git a/arch/riscv/include/asm/clint.h b/arch/riscv/include/asm/clint.h deleted file mode 100644 index a279b17a6aad..000000000000 --- a/arch/riscv/include/asm/clint.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_RISCV_CLINT_H -#define _ASM_RISCV_CLINT_H 1 - -#include -#include - -#ifdef CONFIG_RISCV_M_MODE -extern u32 __iomem *clint_ipi_base; - -void clint_init_boot_cpu(void); - -static inline void clint_send_ipi_single(unsigned long hartid) -{ - writel(1, clint_ipi_base + hartid); -} - -static inline void clint_send_ipi_mask(const struct cpumask *mask) -{ - int cpu; - - for_each_cpu(cpu, mask) - clint_send_ipi_single(cpuid_to_hartid_map(cpu)); -} - -static inline void clint_clear_ipi(unsigned long hartid) -{ - writel(0, clint_ipi_base + hartid); -} -#else /* CONFIG_RISCV_M_MODE */ -#define clint_init_boot_cpu() do { } while (0) - -/* stubs to for code is only reachable under IS_ENABLED(CONFIG_RISCV_M_MODE): */ -void clint_send_ipi_single(unsigned long hartid); -void clint_send_ipi_mask(const struct cpumask *hartid_mask); -void clint_clear_ipi(unsigned long hartid); -#endif /* CONFIG_RISCV_M_MODE */ - -#endif /* _ASM_RISCV_CLINT_H */ diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile index b355cf485671..7edf15643146 100644 --- a/arch/riscv/kernel/Makefile +++ b/arch/riscv/kernel/Makefile @@ -31,7 +31,7 @@ obj-y += cacheinfo.o obj-y += patch.o obj-$(CONFIG_MMU) += vdso.o vdso/ -obj-$(CONFIG_RISCV_M_MODE) += clint.o traps_misaligned.o +obj-$(CONFIG_RISCV_M_MODE) += traps_misaligned.o obj-$(CONFIG_FPU) += fpu.o obj-$(CONFIG_SMP) += smpboot.o obj-$(CONFIG_SMP) += smp.o diff --git a/arch/riscv/kernel/clint.c b/arch/riscv/kernel/clint.c deleted file mode 100644 index 3647980d14c3..000000000000 --- a/arch/riscv/kernel/clint.c +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (c) 2019 Christoph Hellwig. - */ - -#include -#include -#include -#include -#include -#include -#include - -/* - * This is the layout used by the SiFive clint, which is also shared by the qemu - * virt platform, and the Kendryte KD210 at least. - */ -#define CLINT_IPI_OFF 0 -#define CLINT_TIME_CMP_OFF 0x4000 -#define CLINT_TIME_VAL_OFF 0xbff8 - -u32 __iomem *clint_ipi_base; - -void clint_init_boot_cpu(void) -{ - struct device_node *np; - void __iomem *base; - - np = of_find_compatible_node(NULL, NULL, "riscv,clint0"); - if (!np) { - panic("clint not found"); - return; - } - - base = of_iomap(np, 0); - if (!base) - panic("could not map CLINT"); - - clint_ipi_base = base + CLINT_IPI_OFF; - riscv_time_cmp = base + CLINT_TIME_CMP_OFF; - riscv_time_val = base + CLINT_TIME_VAL_OFF; - - clint_clear_ipi(boot_cpu_hartid); -} diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index f04373be54a6..2c6dd329312b 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -79,7 +78,6 @@ void __init setup_arch(char **cmdline_p) #else unflatten_device_tree(); #endif - clint_init_boot_cpu(); #ifdef CONFIG_SWIOTLB swiotlb_init(1); diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index 8b85683ce203..07626be78c23 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 5fe849791bf0..a6cfa9842d4b 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include -- 2.25.1