From patchwork Mon May 15 05:49:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 93861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6690911vqo; Sun, 14 May 2023 22:59:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fIGgUIFW7J0YNO/L1UO1xyOM4814dDf8DJOIDZTSnfK7FHvEJHmzs54m6HINo3BTnvjfG X-Received: by 2002:a05:6a20:7354:b0:104:7a4c:6cbf with SMTP id v20-20020a056a20735400b001047a4c6cbfmr12220223pzc.46.1684130370735; Sun, 14 May 2023 22:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684130370; cv=none; d=google.com; s=arc-20160816; b=SGEwz6cNuR2ozS2CVN4HhkBBFGjnS1ufRHbSYtfstGIz/ZjzGGWi0P5Hz88AJnBGcr VZe08RR9plIN9Zo/VR4CVrWmAtD0bfRO0k7jkxdkyu3G0sVz/gQPp2AOUAegjk8tIIig pQBAS53Odap8MppXaYD8zxXM3hKt2cUo/6z6e29DcSimgZYOs6frmsQT2kCKgdbzHxLc 6p2IgUDTYra7mazAc4W1CQPc69dJbGzkohcGlKAFI4p6wd1F2Uu7n3hhW6xONMj9oks9 n1HYSrLtkymHI25+43zMsjHAF79Pi+jNxuCu7Dhw+Q5pJW7IbEf6SKP9j+kxffMJF/D5 IJHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yTcS6ERydBi3sd7UUw2QFTJaMwmeqvxl7dgO0DDj6Ys=; b=BmpRmdxJXWs7TXONra2dV9p3wLGrdIaBrTtVA4wb9mHC4QLepWoD64iRHElOR0rX3n jizu2Miy45rhzO3u0ao+frZ375xwUl6lxdW5Yuc6nlV7e4AAgMC7IbSSxXbWU8lwZ096 tTBh6uceVp+odC7qPcbdvKLdN+W4D+tLy8vKLsq5s1JS8tyCRStMBDiMKW6++0Sv2lUA h6XMVNu8aglq9WjPLLeCbGX7JGZXMFlwn8vtwkDgLX6ZoZ3kuITz/nYr+AoOChISO3kt ACzstuTiIEXctBn29uBOITTZSZ/3Blj7xhcbxCeAw1RPkQs9fH1RgHemkiKhXf4eqFap pmkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="B/2s07xO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v17-20020a63b951000000b005342966f497si375086pgo.712.2023.05.14.22.59.18; Sun, 14 May 2023 22:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="B/2s07xO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238790AbjEOF4B (ORCPT + 99 others); Mon, 15 May 2023 01:56:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238340AbjEOFyu (ORCPT ); Mon, 15 May 2023 01:54:50 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D27784231 for ; Sun, 14 May 2023 22:51:40 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1aaf21bb427so87345025ad.1 for ; Sun, 14 May 2023 22:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1684129900; x=1686721900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yTcS6ERydBi3sd7UUw2QFTJaMwmeqvxl7dgO0DDj6Ys=; b=B/2s07xO4JsvpjeFQXLK9epGxKSolGR137ahXL6Xqpu6cvJdjAuvwFfJTToBH27hFx iU1eFj0lfQMJxAK3JCa7YpUoLShxQppRs9krLSWJt0lywC6dWcEPg/rXvsy8hGJZBrZQ aAqH2ZDdzbSNReetY5GYcij66xNie7S3Ek1SV0mHfB2S6EjF5fy4DYd2rkos7AXiUp7r A7mM1MxwDNuHsULDMKmoeD2CS+aY1S1YK7CEPqzDEfCTjgx/DjSdsn3f6HZ1Og81975E 71WOPu6Hm4MeLzAZvw6s1lAIaAMu94JwdS+HB8ZmbyvdOAqMnV3uLCalVpLAenNxNcVi 9S1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684129900; x=1686721900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yTcS6ERydBi3sd7UUw2QFTJaMwmeqvxl7dgO0DDj6Ys=; b=KgREoq3fkVzskgFlPKwlccQ2coKMhdONV4xxj3vfG1RjFguANr/YWpp+xX9kmjfGIt oD9eDZ7ZOLM9neptgQYpA4iTgBcmSFnacHWMSTbP5rMAO6pOgUe14XR2LhYfdObxQt0o Fq7+IPLu+pWy8o+qEJfmw0Bb9qoBjLzQhFg1/mnxsu5zubqitc83WefLmKeCX5KWqDtM DiykavZsuKYidCKMhlZ3HL7TfYfL658i8Q0uRXUME809qeMJiM/aDvxlN+z6uZJ2YX0d ZqRcX+A4OqLYvv/p4l3IKiUPPnc8ysvpoIlRoQQtWGblxk/rqrn2Vme/zKoPZLUcxiuw wi0Q== X-Gm-Message-State: AC+VfDxlcQmGxzcaNR8fH04BK9eevTbxCJtgYLSTjeIH8jV5uZAxqiNt CwSK/lo3NkbwbaGFXmbn/7iREg== X-Received: by 2002:a17:902:e80c:b0:1ab:1dff:9540 with SMTP id u12-20020a170902e80c00b001ab1dff9540mr41677533plg.14.1684129899921; Sun, 14 May 2023 22:51:39 -0700 (PDT) Received: from localhost.localdomain ([106.51.191.118]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b001ab28f620d0sm12423277plt.290.2023.05.14.22.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 May 2023 22:51:39 -0700 (PDT) From: Sunil V L To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-crypto@vger.kernel.org, platform-driver-x86@vger.kernel.org, llvm@lists.linux.dev Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Sunil V L , Daniel Lezcano , Thomas Gleixner , Weili Qian , Zhou Wang , Herbert Xu , "David S . Miller" , Marc Zyngier , Maximilian Luz , Hans de Goede , Mark Gross , Nathan Chancellor , Nick Desaulniers , Tom Rix , "Rafael J . Wysocki" , Andrew Jones , Conor Dooley Subject: [PATCH V6 18/21] clocksource/timer-riscv: Add ACPI support Date: Mon, 15 May 2023 11:19:25 +0530 Message-Id: <20230515054928.2079268-19-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230515054928.2079268-1-sunilvl@ventanamicro.com> References: <20230515054928.2079268-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765938687755718873?= X-GMAIL-MSGID: =?utf-8?q?1765938687755718873?= Initialize the timer driver based on RHCT table on ACPI based platforms. Currently, ACPI doesn't support a flag to indicate that the timer interrupt can wake up the cpu irrespective of its power state. It will be added in future update. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley --- drivers/clocksource/timer-riscv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index cecc4662293b..da3071b387eb 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -10,6 +10,7 @@ #define pr_fmt(fmt) "riscv-timer: " fmt +#include #include #include #include @@ -207,3 +208,13 @@ static int __init riscv_timer_init_dt(struct device_node *n) } TIMER_OF_DECLARE(riscv_timer, "riscv", riscv_timer_init_dt); + +#ifdef CONFIG_ACPI +static int __init riscv_timer_acpi_init(struct acpi_table_header *table) +{ + return riscv_timer_init_common(); +} + +TIMER_ACPI_DECLARE(aclint_mtimer, ACPI_SIG_RHCT, riscv_timer_acpi_init); + +#endif