From patchwork Thu Feb 16 18:20:23 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: 58182 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp456585wrn; Thu, 16 Feb 2023 10:22:37 -0800 (PST) X-Google-Smtp-Source: AK7set+DzLyqA3G2syus4IQW6jIGrZQ/V/OsEXTxl0kNaWlT9fQbpDKJwtxNkFDezourb0ZjHPKm X-Received: by 2002:a05:6a20:1443:b0:b9:7a47:bca5 with SMTP id a3-20020a056a20144300b000b97a47bca5mr7100574pzi.43.1676571757462; Thu, 16 Feb 2023 10:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571757; cv=none; d=google.com; s=arc-20160816; b=pFr2O3HaOVjSHmpo3pJmaclNCaVCiPjZspb43N+LdrW6HGZA3np9r27EAWvsBeoYxo dXgMXAwN/yMlK9pDr7iPXZ7gaheT1CK+eap0i/8t+XG8KCfgPdZkK5WIPA47zLmhwnA1 DZSJWrgtxKbY85q02d7ZXV4ar8GBIrt6blhyuYiu5d7XTn3YxS/sXBlppMIbBfRuoJF7 5+Z65krXrzsmpqOGTQq/X2qJlaTuOh77ejvmaciCQMCLS3jh1Y1EI6JQlUhBXMpYnKNF ezIeZyqxrAo6yYtot/XtrpA/FM0L3dj2pyJTxBRIkwjNvW5JuXGaCnh6nkMwhsAyFSlk hlhQ== 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=zt5AKTEcwHiFDwLgavojOfY1pFXS3U3JrowEB907ryU=; b=j1yBMBH9lgRStifZdGXQrpwOzp7VIco1fVL2omOjucmgFkCsE/7Xe+pXlnU0Q9ZBWC SxPSWef5jPuK90KCTpJQ/O85xXhw/033XaEBf6FtxNpOvGq/+YLewLYpX1iJE7c8WqUk 1W7Jmz4xdKacslbbIsML7be7fY3qQQtZpHksOllq4sRBUXLaTk/N4F7WOXZ6L3WaQ+Ek CCDvqCheLKCWiuHTwf6HJD6uYLoaMLhhfCFIf7YVhQpTmg4jR4nWuKdEwgCKgv1ODu7E mdaEP0s0WKaVEXyLMTC99vGsJN4Wisbt3iifxNi2yA8VpnSzIKocqCwoJI1baJALYME8 aFJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=hh3s2Oim; 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 g7-20020a056a000b8700b0058e1b16c4dcsi2617932pfj.142.2023.02.16.10.22.23; Thu, 16 Feb 2023 10:22:37 -0800 (PST) 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=hh3s2Oim; 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 S229448AbjBPSVE (ORCPT + 99 others); Thu, 16 Feb 2023 13:21:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjBPSVB (ORCPT ); Thu, 16 Feb 2023 13:21:01 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3442750ADF for ; Thu, 16 Feb 2023 10:20:57 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id z14-20020a17090abd8e00b00233bb9d6bdcso2955261pjr.4 for ; Thu, 16 Feb 2023 10:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=zt5AKTEcwHiFDwLgavojOfY1pFXS3U3JrowEB907ryU=; b=hh3s2OimS73QDs15kWCc2k+lI5tdH7x4xpQgd7UXBzADhjqkPdoP9zDNLKlvXIcB3j WhapBBPx3FQ50Ef9UATRHacKSfPD51PY94qt/38FAuRex3S4rktbxTUVWewRc4eTYN40 JzddLtS9xtnca0cYhHjA8PPX+Fg2/plv2OigHAVwz7TcxcFWTyONo/Iy/ttkziIKqRJE 7gyNPrVRvfy1tgsW3pJO7dUBOd018tUx1cmCfyC7+4Q7P/xXrxcqGYWDpBJXntex4zNG tNdkvuY106SjtLM/sh3J66oTgx61nmV0t4JUqJc+AhDSIrDtCm3S9H4csLsaqCx/DFi6 CrtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=zt5AKTEcwHiFDwLgavojOfY1pFXS3U3JrowEB907ryU=; b=jHorHXagXsbX+xNMB/97OFoKMFo5cEyjoIM8DgEHVZalz3so0KgpbdIb7A1qc3IHw9 ujzqrjkNJgn8wvvDakbpVzoBNJxhzaZOJM5F1nLcEcdx5Tqks16600bN8Enc3NLyZT6u TpY2A9iBSqm2RSlW4Yt2/1HeCInqoaMsM67HT5cfpcat2iJS/62Mv6mHZ5AADu99MrYp mmlSjPKzDnv70xB8j3FS/sjz2bomq3hsxgBZVCQVIoqcDAN8CnZQnlwEX+u7gS6bItMQ 9zppTcOM/N3PJnJ+pypbgU5CQTDybtQ8PBZhSKqMxpECTlbco6C1BTM35t5BLMGlslvv p1rg== X-Gm-Message-State: AO0yUKU80+vZdCzE/llpuOzG6b2O2EsmOhSC6w3PwjVwDmFXvM3cxNxA Xr4eFs033vraV5Y3S4vgtkUlIw== X-Received: by 2002:a05:6a21:9814:b0:be:c217:9580 with SMTP id ue20-20020a056a21981400b000bec2179580mr5065551pzb.49.1676571656477; Thu, 16 Feb 2023 10:20:56 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:20:56 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Jisheng Zhang , Anup Patel Subject: [PATCH V2 01/21] riscv: move sbi_init() earlier before jump_label_init() Date: Thu, 16 Feb 2023 23:50:23 +0530 Message-Id: <20230216182043.1946553-2-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758012906898300351?= X-GMAIL-MSGID: =?utf-8?q?1758012906898300351?= From: Jisheng Zhang We call jump_label_init() in setup_arch() is to use static key mechanism earlier, but riscv jump label relies on the sbi functions, If we enable static key before sbi_init(), the code path looks like: static_branch_enable() .. arch_jump_label_transform() patch_text_nosync() flush_icache_range() flush_icache_all() sbi_remote_fence_i() for CONFIG_RISCV_SBI case __sbi_rfence() Since sbi isn't initialized, so NULL deference! Here is a typical panic log: [ 0.000000] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 0.000000] Oops [#1] [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #79 [ 0.000000] Hardware name: riscv-virtio,qemu (DT) [ 0.000000] epc : 0x0 [ 0.000000] ra : sbi_remote_fence_i+0x1e/0x26 [ 0.000000] epc : 0000000000000000 ra : ffffffff80005826 sp : ffffffff80c03d50 [ 0.000000] gp : ffffffff80ca6178 tp : ffffffff80c0ad80 t0 : 6200000000000000 [ 0.000000] t1 : 0000000000000000 t2 : 62203a6b746e6972 s0 : ffffffff80c03d60 [ 0.000000] s1 : ffffffff80001af6 a0 : 0000000000000000 a1 : 0000000000000000 [ 0.000000] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 [ 0.000000] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000000080200 [ 0.000000] s2 : ffffffff808b3e48 s3 : ffffffff808bf698 s4 : ffffffff80cb2818 [ 0.000000] s5 : 0000000000000001 s6 : ffffffff80c9c345 s7 : ffffffff80895aa0 [ 0.000000] s8 : 0000000000000001 s9 : 000000000000007f s10: 0000000000000000 [ 0.000000] s11: 0000000000000000 t3 : ffffffff80824d08 t4 : 0000000000000022 [ 0.000000] t5 : 000000000000003d t6 : 0000000000000000 [ 0.000000] status: 0000000000000100 badaddr: 0000000000000000 cause: 000000000000000c [ 0.000000] ---[ end trace 0000000000000000 ]--- [ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task! [ 0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]--- Fix this issue by moving sbi_init() earlier before jump_label_init() Signed-off-by: Jisheng Zhang Reviewed-by: Anup Patel Reviewed-by: Atish Patra --- arch/riscv/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 86acd690d529..4335f08ffaf2 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -270,6 +270,7 @@ void __init setup_arch(char **cmdline_p) *cmdline_p = boot_command_line; early_ioremap_setup(); + sbi_init(); jump_label_init(); parse_early_param(); @@ -287,7 +288,6 @@ void __init setup_arch(char **cmdline_p) misc_mem_init(); init_resources(); - sbi_init(); #ifdef CONFIG_KASAN kasan_init(); From patchwork Thu Feb 16 18:20:24 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: 58183 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp456634wrn; Thu, 16 Feb 2023 10:22:41 -0800 (PST) X-Google-Smtp-Source: AK7set+UVDA5CQ7/hnMfneOBjTQiWwXL4DclUUU09A7fP1sSH/0OLMEYljhGhW9PCF3eNOS/WWY7 X-Received: by 2002:a17:90b:4a8a:b0:233:bc73:a926 with SMTP id lp10-20020a17090b4a8a00b00233bc73a926mr8052355pjb.20.1676571761642; Thu, 16 Feb 2023 10:22:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571761; cv=none; d=google.com; s=arc-20160816; b=A9y+HZvJo5omOLAKSDEjgybafm7aWzXucyn3jQ8JrojpBPXE95NNwXBVLDee58iSas ZGM3YZ5Be27USAMLQe9AO7Mh9IdEDPcWWFNsuTjqwuhkj4ZbrzGBtKxglG3HxYQbRI6U kx67WpaxnEZ5/zv96dF/zPgsrKwLf9Dc/3X40GuZRUVjiZxHAQ052K+Z0k/3767Et6xm vN/3YgCAngALcr/X4KfSPv76zZTBb4+Zesj6jJXX34lC1gWpEG/h+AS658RhkWsYp3if kRDgqYwt3HeotqNQKTZVNECFD3tsmLUyCZoIw4ipWWemZgJJJAotYfAA+PEkr8AfKSf+ 7M4g== 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=3T/9WMqfcgE40kVyTz05I09P0F9v/Zdvsnucdf4/Z5g=; b=RbgNewcxCF6qo+KthSEWxY7pfaM/9W7zDw2+HEQPw3YGKYq74Bu6P422+ohRfMppBW BDl52Udi1h9x0reavrOtHpjd5cvaHzLkfphMkZPnK2cXZaTGHNgDIzEUDXu38zBUqoGz KEFBK+7AL1eAE4Awkv/C3i/DV5Mub2t7vVo9ey7rOGWduq+YfWapwr2tBsmwohpkO62l YKQWVVbpeUwfrJ3Bs7DrjGws1Y5PXZRXLpq0COppps3ijuCJJ32yyjf22lHuM+J0OtZZ U2eiBEXxLe//gDeDLJtEH9MzoNLWtyxOAqXAC4fIVy61RdJrbFtk1K0QCBYZ4TZ7NF3n suzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=MBRj07iU; 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 p6-20020a17090a284600b002341bdd031fsi5335069pjf.69.2023.02.16.10.22.29; Thu, 16 Feb 2023 10:22:41 -0800 (PST) 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=MBRj07iU; 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 S229616AbjBPSVN (ORCPT + 99 others); Thu, 16 Feb 2023 13:21:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbjBPSVL (ORCPT ); Thu, 16 Feb 2023 13:21:11 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 103BA3A08A for ; Thu, 16 Feb 2023 10:21:02 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id pg6-20020a17090b1e0600b002349579949aso2560245pjb.5 for ; Thu, 16 Feb 2023 10:21:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=3T/9WMqfcgE40kVyTz05I09P0F9v/Zdvsnucdf4/Z5g=; b=MBRj07iUrgHWwP/PL9m6AtLW+qb8U18eyO6/36bns9c6UoAOz2OzMnR2e4Cdh6Kv4c 5U3H0CPnIrADmR9yLkbugn1hcLCwwqX07zxNNUuoWIr+c6fZODCF7wT2aZuT+AzlLvOa Q1ROw/0yRUOXRLx+2eqd2dsbqX+/BhpdhlpB5hqPlV9ELFw9Sc/nDaT/FlGczY596ewa V3OBgDoq6t1w7RJfsd72MzeoWGcwoO9R7yCsPe0OdQTxO/2T1f/tTd9iv2nhXTZPKIzc 3dZUhwf3Fr6ueWe9wpMBUEMC2rqOMV0kbLLOHPkBfH84LyRg+JVQuMaOop0ElzXAP9ut jG5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=3T/9WMqfcgE40kVyTz05I09P0F9v/Zdvsnucdf4/Z5g=; b=KRI2i9jtzyDb79vPuRFxsrtg9TkWnARm4dQeUWh2c1nteHDfhO3+eBMyawzhZ4g689 SovKFWwZalCYRDiSXdb8YjGjms6FZ+4wps0sNhWRSXDaGX/TmgYdzCETYluk8jmQwMVU xgnd4Rrs/579+/2YVaqXbfAvHdefS8cMewKGr5jtyWEmtTDblT9yCw03TOHoh70kQklg oNKd56V5GAVjS+vA15AilfMNAF2FFGFZppzOWdx1N/kPbjDAb7CNJxUy/+DVryk1xE4t CLwxCOXpJjONmDvdlbU2DcW7jmlNr7Vrv5XFTy/H3kw8WkqEzXPMkincGV/id5hxnClg FWuA== X-Gm-Message-State: AO0yUKXvyTnYrJqOUNm2+yePimsNvH1NWOBuI8qm5IuCbpL0FSrFyfj6 9VJddMIxl+MLS5qoaQNKmwRb+A== X-Received: by 2002:a05:6a20:8f07:b0:bc:7bdd:551b with SMTP id b7-20020a056a208f0700b000bc7bdd551bmr9022499pzk.45.1676571661568; Thu, 16 Feb 2023 10:21:01 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:01 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , Robert Moore , acpica-devel@lists.linuxfoundation.org, "Rafael J . Wysocki" Subject: [PATCH V2 02/21] ACPICA: MADT: Add RISC-V INTC interrupt controller Date: Thu, 16 Feb 2023 23:50:24 +0530 Message-Id: <20230216182043.1946553-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758012911447027943?= X-GMAIL-MSGID: =?utf-8?q?1758012911447027943?= The ECR to add RISC-V INTC interrupt controller is approved by the UEFI forum and will be available in the next revision of the ACPI specification. This patch is not yet merged in ACPICA but a PR is raised. ACPICA PR: https://github.com/acpica/acpica/pull/804 Reference: Mantis ID: 2348 Cc: Robert Moore Cc: acpica-devel@lists.linuxfoundation.org Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- include/acpi/actbl2.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index b2973dbe37ee..abb700d246df 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -891,7 +891,8 @@ enum acpi_madt_type { ACPI_MADT_TYPE_MSI_PIC = 21, ACPI_MADT_TYPE_BIO_PIC = 22, ACPI_MADT_TYPE_LPC_PIC = 23, - ACPI_MADT_TYPE_RESERVED = 24, /* 24 to 0x7F are reserved */ + ACPI_MADT_TYPE_RINTC = 24, + ACPI_MADT_TYPE_RESERVED = 25, /* 25 to 0x7F are reserved */ ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */ }; @@ -1250,6 +1251,24 @@ enum acpi_madt_lpc_pic_version { ACPI_MADT_LPC_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ }; +/* 24: RISC-V INTC */ +struct acpi_madt_rintc { + struct acpi_subtable_header header; + u8 version; + u8 reserved; + u32 flags; + u64 hart_id; + u32 uid; /* ACPI processor UID */ +}; + +/* Values for RISC-V INTC Version field above */ + +enum acpi_madt_rintc_version { + ACPI_MADT_RINTC_VERSION_NONE = 0, + ACPI_MADT_RINTC_VERSION_V1 = 1, + ACPI_MADT_RINTC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ +}; + /* 80: OEM data */ struct acpi_madt_oem_data { From patchwork Thu Feb 16 18:20: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: 58185 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp456676wrn; Thu, 16 Feb 2023 10:22:47 -0800 (PST) X-Google-Smtp-Source: AK7set9PsJFTwVRcHYDFtj1ux/1J3buX0CYDTlKUvNHWb3JQaGu2cBppChudWDEsrqLDzWLfo/QD X-Received: by 2002:a17:903:2291:b0:19b:33c0:4092 with SMTP id b17-20020a170903229100b0019b33c04092mr281794plh.24.1676571766977; Thu, 16 Feb 2023 10:22:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571766; cv=none; d=google.com; s=arc-20160816; b=Jmlh/QlTlnRBwBDh/3UkwEBJy95pcMGiOMGxpPLM4T7FZe2n83P4bHxmderemTfYzh ajUqsqAEA2GMs+GM89NH7g5t5bs8EMwj8lxAsUMPZvC8DUmlzXrl78tO2bVBmUTdUhTI wR6h3mJqRzKx90dU2eD8PAcq3cIDaPZ7xha3qj2uwIr+spstoTBzfvY09nmSJdC6vygW JJC/vGz4ebuDLzueqQoR4/0d7SV1I0PEBeu7VQk1UdR3/Gs1TDSTEzK+Ftb4hP1tejDu 5tN2pSu7K6o9r1MJr9SV3uNIzRa2nrECRuJTM+O53rzUiRCeu9hExApX0UovqatOtQaF VDXQ== 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=pfyzZGOgFR8JpdppLMBGRahWign1okVbjuzaxShQLj4=; b=BuRRpBwYaqXzEyDFY53v15CSHN+z5DQfLdrULBVmxmP9ROglgXolRKqlEXrmkectNK n3zH7BVUPs3dDcpnNUwske94c29uRcyOsJWrWAV4FwV6fgX/jQmzNL5AmNKV2GS+U81t +dItpXtuVUU8Oi14IXtZKEq8R7yrNoI4du8xCMl9sKcojH/mXB7gC7VGeqXwyGZeL4c7 QuYs6aqJjNPx1coOyZlOb3R35/G4giclUAlrVUwxgzzh3hu6vJQKYXpYef/V0982SsgX 2LOLXHz3EdPHpQdL0RfyAW7vfuJT/oEfMGFrpSNOsBzghGwEN5T/9VuDZ3TLSHVAAG5J Xk9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=UUpqTB6A; 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 kf14-20020a17090305ce00b00198b022d9d0si1992752plb.12.2023.02.16.10.22.33; Thu, 16 Feb 2023 10:22:46 -0800 (PST) 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=UUpqTB6A; 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 S230007AbjBPSVZ (ORCPT + 99 others); Thu, 16 Feb 2023 13:21:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbjBPSVW (ORCPT ); Thu, 16 Feb 2023 13:21:22 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45C48552B4 for ; Thu, 16 Feb 2023 10:21:07 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id pg6-20020a17090b1e0600b002349579949aso2560449pjb.5 for ; Thu, 16 Feb 2023 10:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=pfyzZGOgFR8JpdppLMBGRahWign1okVbjuzaxShQLj4=; b=UUpqTB6AUMM+Rdx7uT+Js1SJiUxUEqdBUlVRwfmgNPvgDY5tG85Wxm3Gwp/IEKUHuZ ENhr7womW2HoZ2BMwxNaM80t9Mvqr8Up6T/0VnSGLxjBCRKnZWmt4kPZ7ak3QDJZv38W qJ3Eq+45h+1FPXzR2jouMZbuuDxkDkqWPQU7lF74NAfc9C2Llq3uqjKOOiXVLcP+8X6z vlBl/lo7NfD/254ux+cQuNFC7vQUjHKUORmYpITy0o+zFBNrvthGinJGsCd+7+5jXJMq vbkDxrrOWBj6Rv701fRDlfv0umCjx8f2ReLN9OtGGlcJq8i+Fm+1hQ53vTXUZ91JcZDU 4sLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=pfyzZGOgFR8JpdppLMBGRahWign1okVbjuzaxShQLj4=; b=yb2zueNM5FBHAZvLVuif8See3EpZfOFw/8Xrc9b7DxwDaEoSLSyt6OCXHQzelWPhZM rAkZ11Wy2L13E+gCriCowP/OyKhjmIQg9oFQrVTAztuM4NmvK0tjK0XQAi/DSpGuoNLr r3AuoZDbtV8JvtftYxN6MiqAhLef0bBy70BvaQjzLfOKkhTcs8bvw8xde0BS2AUuHfkE /VTgS1bgRl++608TKpM47T98VGGm1Ci4dCBAKiyZfUR68xEGVwBoRSV8yxy1mYUO4UV6 SQDyTJVdDpoXhROHfuU3GfHFGIKgD5LeBrkXeAP21Vd54BYTdicU4DJCdhODeL2eeyUG Lb4A== X-Gm-Message-State: AO0yUKWOaQQgAhgDQM3aPKj4iwkEHJhr6TL61Iw1gzJHVlzfh1xp40+N JT9pfiDCtf59FRnayvbti/xLjA== X-Received: by 2002:a05:6a21:6d88:b0:c7:20d8:dc1e with SMTP id wl8-20020a056a216d8800b000c720d8dc1emr3483559pzb.27.1676571666717; Thu, 16 Feb 2023 10:21:06 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:06 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , Robert Moore , acpica-devel@lists.linuxfoundation.org, "Rafael J . Wysocki" Subject: [PATCH V2 03/21] ACPICA: Add structure definitions for RISC-V RHCT Date: Thu, 16 Feb 2023 23:50:25 +0530 Message-Id: <20230216182043.1946553-4-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758012917155638182?= X-GMAIL-MSGID: =?utf-8?q?1758012917155638182?= RISC-V Hart Capabilities Table (RHCT) is a new static table. The ECR to add RHCT is approved by the UEFI forum and will be available in the next version of the ACPI spec. This patch is not yet merged in ACPICA but a PR is raised. ACPICA PR: https://github.com/acpica/acpica/pull/804 Reference: Mantis: 2349 Cc: Robert Moore Cc: acpica-devel@lists.linuxfoundation.org Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- include/acpi/actbl2.h | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index abb700d246df..0715e937a453 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -47,6 +47,7 @@ #define ACPI_SIG_PRMT "PRMT" /* Platform Runtime Mechanism Table */ #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ #define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */ +#define ACPI_SIG_RHCT "RHCT" /* RISC-V Hart Capabilities Table */ #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ #define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */ #define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */ @@ -2606,6 +2607,52 @@ enum acpi_rgrt_image_type { /******************************************************************************* * + * RHCT - RISC-V Hart Capabilities Table + * Version 1 + * + ******************************************************************************/ + +struct acpi_table_rhct { + struct acpi_table_header header; /* Common ACPI table header */ + u32 reserved; + u64 time_base_freq; + u32 node_count; + u32 node_offset; +}; + +/* + * RHCT subtables + */ +struct acpi_rhct_node_header { + u16 type; + u16 length; + u16 revision; +}; + +/* Values for RHCT subtable Type above */ + +enum acpi_rhct_node_type { + ACPI_RHCT_NODE_TYPE_ISA_STRING = 0x0000, + ACPI_RHCT_NODE_TYPE_HART_INFO = 0xFFFF, +}; + +/* + * RHCT node specific subtables + */ + +/* ISA string node structure */ +struct acpi_rhct_isa_string { + u16 isa_length; + char isa[]; +}; + +/* Hart Info node structure */ +struct acpi_rhct_hart_info { + u16 num_offsets; + u32 uid; /* ACPI processor UID */ +}; + +/******************************************************************************* * SBST - Smart Battery Specification Table * Version 1 * From patchwork Thu Feb 16 18:20:26 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: 58186 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp456781wrn; Thu, 16 Feb 2023 10:23:00 -0800 (PST) X-Google-Smtp-Source: AK7set8UADgiQX/CugRS4erxIC9s7yRd0/SsVM2tjYeVA4Rhve6RXTaHHv5EE8KY5IIrU6AEa7ES X-Received: by 2002:a05:6a20:4414:b0:b6:a6c4:87b0 with SMTP id ce20-20020a056a20441400b000b6a6c487b0mr8374378pzb.41.1676571779763; Thu, 16 Feb 2023 10:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571779; cv=none; d=google.com; s=arc-20160816; b=o43zHKvM0XR8vG9vlexXJlCJZ9aVvsEgpUpLtrXKXGF2FDEvUnboB/MxBaHW3o0EB3 BKBqUyhHMBKzETKeV2bnKpGbKrH9pP++CFPMqiAk7sBJgbG3JqiGTWCOZVaUApyeFckC L/mvC5CdXpZ7EEeNKT3lM0dLe8GsgjqrhBHYlvU94db4TN9QPlhkEaHVtFqgzEoekiWK L12iMWkyyk5BPwM0UFVB9PbXD4pu7aSYAxezgMCAqqaVb0zQbJ2UaYhw12MA18q4CmlQ ggAaQGEw1ah3nifmO0us0usAJWz1Tnb83EBclmoWhzyX4HB3fS4N/+KJ4NRtPkbKI21h vXsA== 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=yWquo8X215yUxlcuMVI51NmUYIJJYyh2AH39DTzBzA0=; b=B4UKqRGg8pNuP1+Ne7RBfdxUl9o/ZSKK2PFZS1d5S/6Jq9hvJAIcff3bCJeuBRicCa LwYlFiaIfkUW20l7PiaLK63ufznzeGQPGr7C4tjj6Z60aw/7rmVChhn9heJh/AzJY+UT piNkgvxSkYAwsGRP9F8xoYElG3VEpZvT8VO86Uh1jKwMxjfy9sqDCaNLoNUpSBiEdRei +vInIO0KARBfJtsQ45soUBXz/Z2xSwwt24YFaMlVP2tXuCU/KFGsWBewoXC1O0/JelER ohjgWsxG1wgOTIldjL2SLYYwP54njD18mUEkIdfA5L07dqZFFKDLFj45IvI+LjwyJVCK j0wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="Y/uNQfau"; 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 bs185-20020a6328c2000000b004cf7904ba60si2129400pgb.25.2023.02.16.10.22.47; Thu, 16 Feb 2023 10:22:59 -0800 (PST) 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="Y/uNQfau"; 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 S229609AbjBPSVe (ORCPT + 99 others); Thu, 16 Feb 2023 13:21:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjBPSVd (ORCPT ); Thu, 16 Feb 2023 13:21:33 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D88EC2A15A for ; Thu, 16 Feb 2023 10:21:12 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id ja21so2896933plb.13 for ; Thu, 16 Feb 2023 10:21:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=yWquo8X215yUxlcuMVI51NmUYIJJYyh2AH39DTzBzA0=; b=Y/uNQfauyNwP1IebYIQnlrUvDZZmMoA/yun6sqqObhrrmiVowECJlHh8IDwLwV6Mrs MjS//bPzSDjS9aQqAvZYuPwYcBFXD/WKKP12nV6ruoSWOybXib04rUTACCOh8K+yF7w3 z8b4XUnhO+8LxWp/iyPecQcHqNkdQYH8UNVz7ndvMGv62gbahohUlDOgfsoGAxMCRC5H aDVpYVp+KXwC27ZIHotI/AbjsnKL9OYUF78nrwsdf32A0KZk1BpkDo0RODVnzm4q6gEd 5OyE7L6NhGwfXlNfVZZL7vCzosH0KzahtK60qK5vQeHopoWXAvKpE+jw48MKjYmEyq54 nLXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=yWquo8X215yUxlcuMVI51NmUYIJJYyh2AH39DTzBzA0=; b=bUusBPOCQ+Brc/Yjm0qlFr115wEVqvmZFgz40VZYqAYDDVcyUrwIw1QEhV+QrYsUP0 Txm4Kn1TA9fxAwGfO7PdlQy3nzLMg145FvxuekniVKenP6dHTIJBBUzItn0qTofF+RVU q3FY2RLRET8WeVUx1DdlMe8VoRmNgVAw0eT/uXxPYX5kSFHarGcOOn8PRQhaV+ofJWbg rGCLmlq0kC2zf7qpAWkLgdw1lagsko4l2RM5bXmKrjU/+D//kK/N7uTaXsbavCE/mD9G X1Y6CmoiGzXbrv6fGmVrqchWZVtSEnSrVJgzh5OsDvo7uLwun/lQ2BBvQlW2vXgCJkiH 0HJA== X-Gm-Message-State: AO0yUKVwCIO9wzpfeiEkzxGd7phaDk8xLgQ3buOFWB3tBGHzevf1RneV w4b0Hdds36obe2xgTZNHKq4K/g== X-Received: by 2002:a05:6a20:a10c:b0:b6:40ae:823e with SMTP id q12-20020a056a20a10c00b000b640ae823emr7326203pzk.5.1676571672339; Thu, 16 Feb 2023 10:21:12 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:11 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 04/21] RISC-V: Add support to build the ACPI core Date: Thu, 16 Feb 2023 23:50:26 +0530 Message-Id: <20230216182043.1946553-5-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758012930612869406?= X-GMAIL-MSGID: =?utf-8?q?1758012930612869406?= Enable ACPI core for RISC-V after adding architecture-specific interfaces and header files required to build the ACPI core. 1) Couple of header files are required unconditionally by the ACPI core. Add empty acenv.h and cpu.h header files. 2) If CONFIG_PCI is enabled, a few PCI related interfaces need to be provided by the architecture. Define dummy interfaces for now so that build succeeds. Actual implementation will be added when PCI support is added for ACPI along with external interrupt controller support. 3) A few globals and memory mapping related functions specific to the architecture need to be provided. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones --- arch/riscv/Kconfig | 5 +++ arch/riscv/include/asm/acenv.h | 11 +++++ arch/riscv/include/asm/acpi.h | 60 +++++++++++++++++++++++++ arch/riscv/include/asm/cpu.h | 8 ++++ arch/riscv/kernel/Makefile | 2 + arch/riscv/kernel/acpi.c | 80 ++++++++++++++++++++++++++++++++++ 6 files changed, 166 insertions(+) create mode 100644 arch/riscv/include/asm/acenv.h create mode 100644 arch/riscv/include/asm/acpi.h create mode 100644 arch/riscv/include/asm/cpu.h create mode 100644 arch/riscv/kernel/acpi.c diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index d153e1cd890b..3ba701b26389 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -12,6 +12,8 @@ config 32BIT config RISCV def_bool y + select ACPI_GENERIC_GSI if ACPI + select ACPI_REDUCED_HARDWARE_ONLY if ACPI select ARCH_CLOCKSOURCE_INIT select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 @@ -598,6 +600,7 @@ config EFI_STUB config EFI bool "UEFI runtime support" depends on OF && !XIP_KERNEL + select ARCH_SUPPORTS_ACPI if 64BIT select LIBFDT select UCS2_STRING select EFI_PARAMS_FROM_FDT @@ -703,3 +706,5 @@ source "drivers/cpufreq/Kconfig" endmenu # "CPU Power Management" source "arch/riscv/kvm/Kconfig" + +source "drivers/acpi/Kconfig" diff --git a/arch/riscv/include/asm/acenv.h b/arch/riscv/include/asm/acenv.h new file mode 100644 index 000000000000..22123c5a4883 --- /dev/null +++ b/arch/riscv/include/asm/acenv.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * RISC-V specific ACPICA environments and implementation + */ + +#ifndef _ASM_ACENV_H +#define _ASM_ACENV_H + +/* It is required unconditionally by ACPI core */ + +#endif /* _ASM_ACENV_H */ diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h new file mode 100644 index 000000000000..7f9dce3c39d0 --- /dev/null +++ b/arch/riscv/include/asm/acpi.h @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Al Stone + * Author: Graeme Gregory + * Author: Hanjun Guo + * + * Copyright (C) 2021-2023, Ventana Micro Systems Inc. + * Author: Sunil V L + */ + +#ifndef _ASM_ACPI_H +#define _ASM_ACPI_H + +/* Basic configuration for ACPI */ +#ifdef CONFIG_ACPI + +/* ACPI table mapping after acpi_permanent_mmap is set */ +void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); +#define acpi_os_ioremap acpi_os_ioremap + +#define acpi_strict 1 /* No out-of-spec workarounds on RISC-V */ +extern int acpi_disabled; +extern int acpi_noirq; +extern int acpi_pci_disabled; +static inline void disable_acpi(void) +{ + acpi_disabled = 1; + acpi_pci_disabled = 1; + acpi_noirq = 1; +} + +static inline void enable_acpi(void) +{ + acpi_disabled = 0; + acpi_pci_disabled = 0; + acpi_noirq = 0; +} + +/* + * The ACPI processor driver for ACPI core code needs this macro + * to find out this cpu was already mapped (mapping from CPU hardware + * ID to CPU logical ID) or not. + */ +#define cpu_physical_id(cpu) cpuid_to_hartid_map(cpu) + +/* + * Since MADT must provide at least one RINTC structure, the + * CPU will be always available in MADT on RISC-V. + */ +static inline bool acpi_has_cpu_in_madt(void) +{ + return true; +} + +static inline void arch_fix_phys_package_id(int num, u32 slot) { } + +#endif /* CONFIG_ACPI */ + +#endif /*_ASM_ACPI_H*/ diff --git a/arch/riscv/include/asm/cpu.h b/arch/riscv/include/asm/cpu.h new file mode 100644 index 000000000000..ea1a88b3d5f2 --- /dev/null +++ b/arch/riscv/include/asm/cpu.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _ASM_CPU_H +#define _ASM_CPU_H + +/* It is required unconditionally by ACPI core */ + +#endif /* _ASM_CPU_H */ diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile index 67f542be1bea..f979dc8cf47d 100644 --- a/arch/riscv/kernel/Makefile +++ b/arch/riscv/kernel/Makefile @@ -90,3 +90,5 @@ obj-$(CONFIG_EFI) += efi.o obj-$(CONFIG_COMPAT) += compat_syscall_table.o obj-$(CONFIG_COMPAT) += compat_signal.o obj-$(CONFIG_COMPAT) += compat_vdso/ + +obj-$(CONFIG_ACPI) += acpi.o diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c new file mode 100644 index 000000000000..81d448c41714 --- /dev/null +++ b/arch/riscv/kernel/acpi.c @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * RISC-V Specific Low-Level ACPI Boot Support + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Al Stone + * Author: Graeme Gregory + * Author: Hanjun Guo + * Author: Tomasz Nowicki + * Author: Naresh Bhat + * + * Copyright (C) 2021-2023, Ventana Micro Systems Inc. + * Author: Sunil V L + */ + +#include +#include +#include + +int acpi_noirq = 1; /* skip ACPI IRQ initialization */ +int acpi_disabled = 1; +EXPORT_SYMBOL(acpi_disabled); + +int acpi_pci_disabled = 1; /* skip ACPI PCI scan and IRQ initialization */ +EXPORT_SYMBOL(acpi_pci_disabled); + +/* + * __acpi_map_table() will be called before paging_init(), so early_ioremap() + * or early_memremap() should be called here to for ACPI table mapping. + */ +void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size) +{ + if (!size) + return NULL; + + return early_memremap(phys, size); +} + +void __init __acpi_unmap_table(void __iomem *map, unsigned long size) +{ + if (!map || !size) + return; + + early_memunmap(map, size); +} + +void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) +{ + return memremap(phys, size, MEMREMAP_WB); +} + +#ifdef CONFIG_PCI + +/* + * These interfaces are defined just to enable building ACPI core. + * TODO: Update it with actual implementation when external interrupt + * controller support is added in RISC-V ACPI. + */ +int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 *val) +{ + return PCIBIOS_DEVICE_NOT_FOUND; +} + +int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 val) +{ + return PCIBIOS_DEVICE_NOT_FOUND; +} + +int acpi_pci_bus_find_domain_nr(struct pci_bus *bus) +{ + return -1; +} + +struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) +{ + return NULL; +} +#endif /* CONFIG_PCI */ From patchwork Thu Feb 16 18:20:27 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: 58188 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp456899wrn; Thu, 16 Feb 2023 10:23:14 -0800 (PST) X-Google-Smtp-Source: AK7set88cVYdoEbMDuLXuE/oXGskchVjPG2O/s+KeZox5fitmvqYiKxngtWy5eydd2BNP2ZC2shg X-Received: by 2002:a05:6402:3890:b0:4ab:10c8:6af0 with SMTP id fd16-20020a056402389000b004ab10c86af0mr2242058edb.0.1676571794142; Thu, 16 Feb 2023 10:23:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571794; cv=none; d=google.com; s=arc-20160816; b=gCIjHmgh85ngnum1nVYLpxIWxSVgLoKWuU0BuslInW6opJKxe3USMb3z7SButEgErS O487DCvWUfmjLvzDsH++py6ooT9Z8lmNv6YCNRgqC4jL69D+Js2vItJsl7JJfUuPUYl2 D/IEppL6bavRIl9M8Be4xd9P1KrDbQjP2VUKi0CYupFP/Y5bwhekfV7f5BgdqenMIw1R CwcySrNrYcqKaDUbfhuyy+kDweYzOVD9nlKo9LMacAfPkG/qZk0gAdtaEll7fdxjYFn0 f54L7sZnH+H/OUpCcqt69q/LKwl4zYc24CCVsTTPcglfUMRBt1qhE4A/dToMeCYzEHYT gkjw== 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=IRX9Rh9lefADAfWYEbY0yIAAiynI9MZaTYH+yetjREM=; b=vdoUKTX3rdZsYczajW6tZZJ3y4dRGIz5o0Mse/dfqhbgg0VlfnTiMR7GWT7W75VeFu s6jkk6ZBZTxvqYy8GcoKKm4n4kh59MhNNUbpSSoQ6ySbAejti8pwZ1OQI3T55NPjlKIY 5Uh+oi+ici/JtBqVCNrd2PqQdb53WCOOI/isi3I1MpSVxPZJn8xzLr1JHiwJzbc64IvP SALPJWrJYjWIwJdJ1V+mu1W8tJTrGhlM5Hb+Ia6fraBe1YfZaGV2/AJ7FVFAF/gzkchi BwwDVCF36WvUfKiavE6wHXuXeuiUwMN0yRwfBIKVPbL3rtYjK913xEK8H2DfN2pJwlrU +Pug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=IaeR6uCO; 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 q1-20020aa7d441000000b004aac545e7fesi2816672edr.174.2023.02.16.10.22.50; Thu, 16 Feb 2023 10:23:14 -0800 (PST) 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=IaeR6uCO; 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 S229524AbjBPSVq (ORCPT + 99 others); Thu, 16 Feb 2023 13:21:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbjBPSVm (ORCPT ); Thu, 16 Feb 2023 13:21:42 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757E250340 for ; Thu, 16 Feb 2023 10:21:17 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id kk7-20020a17090b4a0700b00234463de251so6706382pjb.3 for ; Thu, 16 Feb 2023 10:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=IRX9Rh9lefADAfWYEbY0yIAAiynI9MZaTYH+yetjREM=; b=IaeR6uCOYqxkxcPO2OyZK+7eC6B5XWUpETzkV429cXcAgdslHLazNahirlmg6GJ8nt ZxrE9y/gCeS9R3rDQdwL6ajjbBDd26jf7ah+E/ozJpUScU2Hs+caXXwpejxxCR18bBU5 QNKpQffB0OL67KNEN3pFW1lBC/gH9rY9bKHvtpm6/Plg4D4UklunHYOF9ee3xh/FJ8fg YWtE0U1o4BV11Ioa48QOdk/Y5DLLCGTR9ZcNpwCOm0D6MtRbodmOEuxChDMNlSDPHFN5 VLFqJLp/kX3fdGCWO4vPoek08/oItOINvIreIDT7iodgxsdmmImQdjNXsthZ5FVMYJ15 EWaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=IRX9Rh9lefADAfWYEbY0yIAAiynI9MZaTYH+yetjREM=; b=LeJleGuRabsfzRAAgRdRXThIyXQxFNY3QXKXTYJX1Xz0Nl8PTtaWGaWs4mhpnTfThe bDjA7W48YxN4/Y6eCr89xzbPbGHRQLmXuIUG++RMUlARhve6lfmGzRGwr6j69Vbd0Jc7 igIUcWm7j7RS9s7eob9eY65LlOL882+MRgxtWWfhI5FoSRKs+M7bF21m5w1BOF40zUq/ UrlDie5BAlg/m3VMo9za5PSwDJTAi/Ux/1Svl06LxzN8Nm+eLZDmPJ5qCjfwBDqoWfXQ 754omaPAml/J1jnPZxteSH905CJEYQJC9oDw7zNXesExGGOQKbEwSgzOEnZFXJ1mvOuQ I+5g== X-Gm-Message-State: AO0yUKXD3CHr+t6FmC9wzWwKUMW5pkG0ChcnUba7UPheXDRj0BAV1Txl j/XxHXsCb+YseiHnwrkyFulfsQ== X-Received: by 2002:a05:6a20:3d0c:b0:bc:61d5:7bf2 with SMTP id y12-20020a056a203d0c00b000bc61d57bf2mr7783217pzi.34.1676571676972; Thu, 16 Feb 2023 10:21:16 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:16 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 05/21] ACPI: Kconfig: Enable ACPI_PROCESSOR for RISC-V Date: Thu, 16 Feb 2023 23:50:27 +0530 Message-Id: <20230216182043.1946553-6-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758012945818722061?= X-GMAIL-MSGID: =?utf-8?q?1758012945818722061?= Enable the ACPI processor driver for RISC-V. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- drivers/acpi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index ccbeab9500ec..b44ac8e55b54 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -281,7 +281,7 @@ config ACPI_CPPC_LIB config ACPI_PROCESSOR tristate "Processor" - depends on X86 || IA64 || ARM64 || LOONGARCH + depends on X86 || IA64 || ARM64 || LOONGARCH || RISCV select ACPI_PROCESSOR_IDLE select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH select THERMAL From patchwork Thu Feb 16 18:20:28 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: 58187 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp456873wrn; Thu, 16 Feb 2023 10:23:10 -0800 (PST) X-Google-Smtp-Source: AK7set/Y2VxHSNB2WfS+avnpQC03XoXhlKfaTspaBZLG6ZVrkcHLWu/NyBVNhsMYqGBveMVcIQfU X-Received: by 2002:a17:902:d4c8:b0:198:e4a2:f88c with SMTP id o8-20020a170902d4c800b00198e4a2f88cmr3120634plg.11.1676571789752; Thu, 16 Feb 2023 10:23:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571789; cv=none; d=google.com; s=arc-20160816; b=JwpMg3om/H6PIejyt98stjNSkMTCMS39Vf/Zg+pV0XD8SHQfPxqavavD13jdI6Gw+/ u977f+0v2gYftY96STm+JbG6iZqMrayRkar2PwWlz9YIDL7L+FvAscCn17Nia6tAvvEv 6IeHVsEqJLAqjm8dabyjPU4jpxEV6Tp5fOYTwjUC9R05RgInQr5JTNQMbSaNMSX4jdQP bQQqkJ2bYdv0iRucIHRiG2ZGtH9JbGqPfbHaDZcAi9eKMYCQhIsZF1MelCMijNP31EcE gpqJMEXVS61WA2Bn2GLkpQZWmEY9jtOkF99bjLxrUD6met+hFSUvXWRQKaMNrW87Thbz 4/JA== 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=g9sxg5LZ/1sJSiDItv56ESM72UWoohRRXZed1vK0StQ=; b=FiunIY+3rfBaUknl4RAm2RM2rp3wEzbW0ok0UcpbGVczvOJkV8bq5nB1AjEU7t60Hy 3NbPPwgjwfGJjw9uxxrJeLUOMkTUEYpKTRLQFuU2nWsndPoUqiK4JxuS/yxzYMrCqCCR agLRiXQe0qSQ9RpOPuykxaoSGcY8OT6XzlcMxXP2Z+cfa2yTDBH+CsEqUGx2NLeftD/C ebpodJVT2SVcKsp92ZEw+uzY1uK3WdfJbQSWebLUIfjj5DPzu3SyFlPkF+CrzhdTdibf vP0VtQ7TlUVP/R/tb6uvaejXtE3a+378gSsXcawFHyMJdle3WCCkznZI/Y0/Xm7f9y5F Sbtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=I5b4Vocr; 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 u3-20020a170902e80300b0019a9726391bsi856541plg.78.2023.02.16.10.22.56; Thu, 16 Feb 2023 10:23:09 -0800 (PST) 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=I5b4Vocr; 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 S230193AbjBPSV6 (ORCPT + 99 others); Thu, 16 Feb 2023 13:21:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjBPSVy (ORCPT ); Thu, 16 Feb 2023 13:21:54 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC6CA5036D for ; Thu, 16 Feb 2023 10:21:24 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id fu4-20020a17090ad18400b002341fadc370so6734661pjb.1 for ; Thu, 16 Feb 2023 10:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=g9sxg5LZ/1sJSiDItv56ESM72UWoohRRXZed1vK0StQ=; b=I5b4VocraQIzy74N6/WkUSoEflR7yik4OQfTnlBnTTAhyc9/7L7kZrDieGxf5g+3nm 8jov6jOgh5KiNaZd5Eaa7Vfd+keKgSYotzhC6UN9lRBO7zglAi7u1MIu4JtEtffb1qC4 dtXduPqacGJKwS4he3LX/xaSnKLvpeDfpeAtrCDtAUe5w4SXN4V3liCjE7jYSJxAhPp8 DASKy2oFicLS4SBOSKLvGzogHewOZG+O+NkMXBohSjcp/cq1irt5j+D1lDQxPVx9M2Ni dBAbL6WViE6T6Vldp2yhiqPJLShLBhApPxCeMBFjOnsg9MH8T1AV3a3db480pdXDA4YB xymw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=g9sxg5LZ/1sJSiDItv56ESM72UWoohRRXZed1vK0StQ=; b=nn1anCpd5wvzEuu/x1OtzAF2x7+zDXke8M3AC2XxHvs877ZccirYaphDCLvI8BPNcs 0VwCHFUThv/KRGMwHtXJNX7t2QvFum0+YtsF2mwzCHmKo1ypWG3BOPyvIJfdj7XjCYM6 iQobls4Z9cwTnitdCL1CQ9JhN8SlnK7txmTunEICvLDBz1aMCkCpnmNCrbMe+Yup7fiP uKb+h/EI2fmHi/jL1NZRxUtUXcK9H5/oJiEuwf+hvdqJB6BY3sGcgrjOK4E3PDpJmK3C xsckZqooHh4hCkSLOXOHirCqi4l7QNECIaXrp0fj4KlIhhPXmQe7si4s4fi6xCZHsiKI TCnw== X-Gm-Message-State: AO0yUKUDr3I5pAb0y2f771tzzVHxjy0tr4pbUqe6l2uj+crXqiL6QNI7 D79+bgJU2Wwd3A+1GCwBaEgrWw== X-Received: by 2002:a17:902:c943:b0:199:1f42:8bed with SMTP id i3-20020a170902c94300b001991f428bedmr3110483pla.12.1676571681615; Thu, 16 Feb 2023 10:21:21 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:21 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 06/21] ACPI: OSL: Make should_use_kmap() 0 for RISC-V. Date: Thu, 16 Feb 2023 23:50:28 +0530 Message-Id: <20230216182043.1946553-7-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758012940731510745?= X-GMAIL-MSGID: =?utf-8?q?1758012940731510745?= Without this, if the tables are larger than 4K, acpi_map() will fail. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- drivers/acpi/osl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 3269a888fb7a..f725813d0cce 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -276,7 +276,7 @@ acpi_map_lookup_virt(void __iomem *virt, acpi_size size) return NULL; } -#if defined(CONFIG_IA64) || defined(CONFIG_ARM64) +#if defined(CONFIG_IA64) || defined(CONFIG_ARM64) || defined(CONFIG_RISCV) /* ioremap will take care of cache attributes */ #define should_use_kmap(pfn) 0 #else From patchwork Thu Feb 16 18:20:29 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: 58189 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp456979wrn; Thu, 16 Feb 2023 10:23:23 -0800 (PST) X-Google-Smtp-Source: AK7set8c6soR6oir113K1hUHXayADT8Ox9YUb+RMNr8WYb0SyqsTFL9ethkicefea7OnBBE/WTb0 X-Received: by 2002:a17:90b:4c8f:b0:234:84ca:7f7f with SMTP id my15-20020a17090b4c8f00b0023484ca7f7fmr3847494pjb.19.1676571803078; Thu, 16 Feb 2023 10:23:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571803; cv=none; d=google.com; s=arc-20160816; b=oe1Z6R4WJT/E/IL4YjKReVAE2Jk0bsrp/uCiGGz0kpdimE7yMpcLmqhD5m7GhTNs+P 8bcq6D5P9bmqJEXXE4GscTu0BUJhK7ZO/tjxG4kGXg+usyS30ZXT8oKhvopCj8p4mYzA osrbym1etBYRXK2maGrWUFKZsvmJsYJIGYf8WcXfOyDJoCyfB8lDjgIGqBrgOKG7+jxp MWkUECzK5N7O5XfuHLECKywoTOACO9Y2VIBt4VBVt7t2Qwv8m3hRZEK/snwmuEpt8pcJ ZqoCSVF22hOqKD+F7Yw8G7fN+HQHNRqy2/NAbuMaaLaQqAul99/fsWl/sguMBKXVXHyM U2sw== 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=BcT4AtxywBaHPbxQbaGHDpYZBRDu3wCeHMqaXv1EYt0=; b=AsVcyl3Ef9dGuYiWxdh34QJrp6HTL544BKT5G/3kGgBQ82hL96jD0vBRIx24rkiqEB V1q2Brnz0WlSk8ZfB+Y7WLbuJmRJNtaZJFqoQSEgmHPn8HwEhCsuvQ8jGnpt8dIxGJuB bffAkXiqXUCTJkZiio5+he0oKdYIXAYIwUG+XhNkc6X1pnAiNBL+j/w/nFqJA5SzDwRa rdVnhNpw8uALDN83Ibu8WT0U8Akv5SlOhZBuCjI4h9j7QTrSQa3Eui+aCwwkoJeC4vve ZH+riV8esi2L705tIHdzCw1I9YyIXEoLfUs0MskZAK7GaB9dCZysEpxXFX/Wol/Ms/49 HrfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=DBvjTCZI; 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 g5-20020a636b05000000b004d184dbf598si2421493pgc.519.2023.02.16.10.23.10; Thu, 16 Feb 2023 10:23:23 -0800 (PST) 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=DBvjTCZI; 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 S230096AbjBPSWM (ORCPT + 99 others); Thu, 16 Feb 2023 13:22:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbjBPSWE (ORCPT ); Thu, 16 Feb 2023 13:22:04 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 173365037E for ; Thu, 16 Feb 2023 10:21:29 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id c11so2165430ple.9 for ; Thu, 16 Feb 2023 10:21:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=BcT4AtxywBaHPbxQbaGHDpYZBRDu3wCeHMqaXv1EYt0=; b=DBvjTCZIk+vcPUW8htmerk0xAsi1O8tw5BcDSym3jNNFaZhhj3sFESEoaQ0Yhv+703 j8AYTC/u7Z/JO44B/X+ZAXpYgAeZo6CliuHuUiaI2SCgIHy08Vso71L7TFcQ5jrXVdXU +8DDEuVrWcKm2wX9Z65//j6ETTkMzUIUCeacXa28ze6Z91EQ+V9RcPVlcirQdwLHMQ7L Tb3icHXPx7r/fuy+GHWyv6oMBMJ0RbQNMBQT1CGYvHYJA9xXnvOHefF7BG38Ka/VjJj6 dzyVpCKn22c8RKIuz91QYGwKHayKz4n9RlwrYMCMj1lzUiRCr7SMicUmQQmj7eXcCd2B 6kkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=BcT4AtxywBaHPbxQbaGHDpYZBRDu3wCeHMqaXv1EYt0=; b=brHfB+UmOAOVEEMQU6DiOlkpafNJ7VtNX35mjYqlyjH39kgYUgbL2IZnzbqxnIfbFa 5TasFhetfvMqWPhUOf/n1jguUc9l0Tp4D+tUtgpIKd8A6bBIb2frCDmWbqWdqv9ncrhV KLxP+IFlLt6zoyUzz3FiWGa3czzzfccgchpOZFPTn5sStSXM7zl6g7otaZjNiPIGAEIZ jwzkKQ3OE0XW1taxb6QRdJ1JnWRGgzaHG+lREvXtX0biu7Mo7RcXhUPo0xCS1SjCV2R0 FZjuEXYA5Fy5KAoXFoNt7drvnlxrDr6Be3Kx0YaBruQfIzCVcIzWDS9fQ2Z9PmtDRet1 bO0Q== X-Gm-Message-State: AO0yUKWB8CEg7RSuiYefleTH1U7JTh2v/Mv10o1ZfmPVaLD+trX8AoXM XpJXTgDIkB+RWJ3Wr2etg1sQkw== X-Received: by 2002:a17:902:f312:b0:19a:a647:1880 with SMTP id c18-20020a170902f31200b0019aa6471880mr5075210ple.24.1676571686430; Thu, 16 Feb 2023 10:21:26 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:26 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 07/21] ACPI: processor_core: RISC-V: Enable mapping processor to the hartid Date: Thu, 16 Feb 2023 23:50:29 +0530 Message-Id: <20230216182043.1946553-8-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758012954783096320?= X-GMAIL-MSGID: =?utf-8?q?1758012954783096320?= processor_core needs arch-specific functions to map the ACPI ID to the physical ID. In RISC-V platforms, hartid is the physical id and RINTC structure in MADT provides this mapping. Add arch-specific function to get this mapping from RINTC. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones --- arch/riscv/include/asm/acpi.h | 3 +++ drivers/acpi/processor_core.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h index 7f9dce3c39d0..4a3622b38159 100644 --- a/arch/riscv/include/asm/acpi.h +++ b/arch/riscv/include/asm/acpi.h @@ -15,6 +15,9 @@ /* Basic configuration for ACPI */ #ifdef CONFIG_ACPI +typedef u64 phys_cpuid_t; +#define PHYS_CPUID_INVALID INVALID_HARTID + /* ACPI table mapping after acpi_permanent_mmap is set */ void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); #define acpi_os_ioremap acpi_os_ioremap diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 2ac48cda5b20..d6606a9f2da6 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -106,6 +106,32 @@ static int map_gicc_mpidr(struct acpi_subtable_header *entry, return -EINVAL; } +/* + * Retrieve the RISC-V hartid for the processor + */ +static int map_rintc_hartid(struct acpi_subtable_header *entry, + int device_declaration, u32 acpi_id, + phys_cpuid_t *hartid) +{ + struct acpi_madt_rintc *rintc = + container_of(entry, struct acpi_madt_rintc, header); + + if (!(rintc->flags & ACPI_MADT_ENABLED)) + return -ENODEV; + + /* device_declaration means Device object in DSDT, in the + * RISC-V, logical processors are required to + * have a Processor Device object in the DSDT, so we should + * check device_declaration here + */ + if (device_declaration && rintc->uid == acpi_id) { + *hartid = rintc->hart_id; + return 0; + } + + return -EINVAL; +} + static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt, int type, u32 acpi_id) { @@ -136,6 +162,9 @@ static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt, } else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT) { if (!map_gicc_mpidr(header, type, acpi_id, &phys_id)) break; + } else if (header->type == ACPI_MADT_TYPE_RINTC) { + if (!map_rintc_hartid(header, type, acpi_id, &phys_id)) + break; } entry += header->length; } From patchwork Thu Feb 16 18:20:30 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: 58192 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457160wrn; Thu, 16 Feb 2023 10:23:44 -0800 (PST) X-Google-Smtp-Source: AK7set+tPb1M5EQ9u1Pn1jRwak+xDGMLcRjQhVVwnhmz4/jj/jt01+jVx2ARtxJp1zWat7tDbs4u X-Received: by 2002:a17:90b:1c09:b0:234:4187:1acc with SMTP id oc9-20020a17090b1c0900b0023441871accmr3020567pjb.19.1676571823693; Thu, 16 Feb 2023 10:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571823; cv=none; d=google.com; s=arc-20160816; b=0+rnZ8QQzSM66u2kh8V9+Xj0Wy3mSwF1bHoUD1oRbEHds5ucFt+lSfIA5K0MsdqbqX UuVy+isMWA+zUp2m1y9m2QBvDN1zGHAzks2J4D6bQ79MP9xI9MbqAc2m7Ml2yS6Rwgbv B0YG44Zz04znSzXeWXu9b1Z7Ax0FxivPMZwyRmULz098mVMzgMUnXT0eFyuCsOQg36qm Vrq0aPQ/ybAtebphOa3cOtaJHZeKZw0+rqh09vF2xFdr4mL+o2xMPptIKh+6+xwYnZsx WUCE4SUwCvAnieKLy27OGlkcV6NQzi67S08Zpe9Yhb9RkvjGaiAStE2WLWwmAPcvsreC OInw== 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=DbqUdM0Np7Pk7D6Eh4B7c+w7Zw8p8e1vDp1GKV/olkQ=; b=TodCOdsCXU0ovZdqXHUbqjnxEvHilf++9U5TvmT+PfHG/p4j0ZBzMrskLNQWrcw736 mdGQwYdlBee4tLk79L+x/5SAWwFLhkfVWH2lobrqbBe4pt0nzs6stjqT4yZ7uk6RXDf6 JN6BFT27sA1LQclRSOyN5UCtIfU00w/fMLC/65UPvxmp3ZR3fUSDdlk0AloBwZiEp0hr z12Zh4HQxw2viPP3QTejxm9rTK5YwytSNmDf9Ui6IGGG/huTpnWRyKnhHVWW28Grh4x/ /4beyF+rzxmovSfMap0YntYolmqTkWZtV4a+3KwVb506y5Aw6nR+vzBCai+XIObZ5zPT YV2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Cxq4zjw6; 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 u14-20020a63790e000000b004fb9b058ebdsi2482321pgc.405.2023.02.16.10.23.30; Thu, 16 Feb 2023 10:23:43 -0800 (PST) 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=Cxq4zjw6; 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 S230309AbjBPSWU (ORCPT + 99 others); Thu, 16 Feb 2023 13:22:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbjBPSWJ (ORCPT ); Thu, 16 Feb 2023 13:22:09 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C52746144 for ; Thu, 16 Feb 2023 10:21:34 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id o8so2906777pls.11 for ; Thu, 16 Feb 2023 10:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=DbqUdM0Np7Pk7D6Eh4B7c+w7Zw8p8e1vDp1GKV/olkQ=; b=Cxq4zjw6jiDo0nQwfwBieSzkX5YKjnoBEYHQiqtfjZyMdT4h+ntnTqUCdo5Wqdqta0 ioZNZDx7RU8k2x6nUSYhWooOIkqR54fOtPJeGxRsVBAa2ZZhRP7TZhrr9owiZz2GGBHB WAJQzXBVDEFvJeqrn3TzwwT/s+EK3ralTgIMJ0mUMgjQLJLLfRkOGru9dJWPcJltXLjk LEOXzMqeDhuBiJAagG3w6+jB/nEB0QtgvXnzpPFKnRGFFfuF3aUeByZJIwKRfL+S7u02 /+D1ANFIH2qVAGIRGe1SiPpvpVsX95nacHF8qpOzjqVvk+TuwDzE2mPhUyhw7eSnGm6q UGHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=DbqUdM0Np7Pk7D6Eh4B7c+w7Zw8p8e1vDp1GKV/olkQ=; b=zvKZdfJYkGfZK+AlHCd7lVwQuxPouaeUSghd2c1huuJ0RPGI8Z9zAcwmrPmJR/dU5i 6eWNaSEcwbdnLELejV+U9wGbyATj0ojnmASfc7sjKJSkt+lvogJs2kr90CRIjdPUSUvA FGPqzqCxh7tVXJyCxxkoxuRZtjwkC4No5Wl+oHTeIKeze11RvLglMYec9rEioYv44KxZ AoC2nsJD3+aELbohuGRjHoY0nUcWmpxNqUertYNva5i5tXQZI3UVxanWuOcccSdcj0qi mhUBwzAnVuhWiXB6omh7ZarDWypv8JJ0Vd6QJhgdkRsbPBHsx2pklB1YHYW62Hx1RRrz CW1A== X-Gm-Message-State: AO0yUKUy62m50UYH/RRG9CYgptFVat+Ydu/W9kLldNqQGWkXiKULPXZJ s+6sXOuY5OWmVyYiq2S29Qg27A== X-Received: by 2002:a05:6a20:4287:b0:c6:d742:681d with SMTP id o7-20020a056a20428700b000c6d742681dmr3527284pzj.12.1676571691092; Thu, 16 Feb 2023 10:21:31 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:30 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 08/21] drivers/acpi: RISC-V: Add RHCT related code Date: Thu, 16 Feb 2023 23:50:30 +0530 Message-Id: <20230216182043.1946553-9-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758012976745713718?= X-GMAIL-MSGID: =?utf-8?q?1758012976745713718?= RHCT is a new table defined for RISC-V to communicate the features of the CPU to the OS. Create a new architecture folder in drivers/acpi and add RHCT parsing code. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones --- arch/riscv/include/asm/acpi.h | 9 ++++ drivers/acpi/Makefile | 2 + drivers/acpi/riscv/Makefile | 2 + drivers/acpi/riscv/rhct.c | 92 +++++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 drivers/acpi/riscv/Makefile create mode 100644 drivers/acpi/riscv/rhct.c diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h index 4a3622b38159..7bc49f65c86b 100644 --- a/arch/riscv/include/asm/acpi.h +++ b/arch/riscv/include/asm/acpi.h @@ -58,6 +58,15 @@ static inline bool acpi_has_cpu_in_madt(void) static inline void arch_fix_phys_package_id(int num, u32 slot) { } +int acpi_get_riscv_isa(struct acpi_table_header *table, + unsigned int cpu, const char **isa); +#else +static inline int acpi_get_riscv_isa(struct acpi_table_header *table, + unsigned int cpu, const char **isa) +{ + return -EINVAL; +} + #endif /* CONFIG_ACPI */ #endif /*_ASM_ACPI_H*/ diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index feb36c0b9446..3fc5a0d54f6e 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -131,3 +131,5 @@ obj-y += dptf/ obj-$(CONFIG_ARM64) += arm64/ obj-$(CONFIG_ACPI_VIOT) += viot.o + +obj-$(CONFIG_RISCV) += riscv/ diff --git a/drivers/acpi/riscv/Makefile b/drivers/acpi/riscv/Makefile new file mode 100644 index 000000000000..8b3b126e0b94 --- /dev/null +++ b/drivers/acpi/riscv/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-y += rhct.o diff --git a/drivers/acpi/riscv/rhct.c b/drivers/acpi/riscv/rhct.c new file mode 100644 index 000000000000..5bafc236d627 --- /dev/null +++ b/drivers/acpi/riscv/rhct.c @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2022-2023, Ventana Micro Systems Inc + * Author: Sunil V L + * + */ + +#define pr_fmt(fmt) "ACPI: RHCT: " fmt + +#include + +static void acpi_rhct_warn_missing(void) +{ + pr_warn_once("No RHCT table found\n"); +} + +static struct acpi_table_header *acpi_get_rhct(void) +{ + static struct acpi_table_header *rhct; + acpi_status status; + + /* + * RHCT will be used at runtime on every CPU, so we + * don't need to call acpi_put_table() to release the table mapping. + */ + if (!rhct) { + status = acpi_get_table(ACPI_SIG_RHCT, 0, &rhct); + if (ACPI_FAILURE(status)) + acpi_rhct_warn_missing(); + } + + return rhct; +} + +/* + * During early boot, the caller should call acpi_get_table() and pass its pointer to + * these functions(and free up later). At run time, since this table can be used + * multiple times, pass NULL so that the table remains in memory + */ +int acpi_get_riscv_isa(struct acpi_table_header *table, unsigned int acpi_cpu_id, const char **isa) +{ + struct acpi_rhct_node_header *node, *ref_node, *end; + struct acpi_table_rhct *rhct; + struct acpi_rhct_hart_info *hart_info; + struct acpi_rhct_isa_string *isa_node; + u32 *hart_info_node_offset; + int i, j; + u32 size_hdr = sizeof(struct acpi_rhct_node_header); + u32 size_hartinfo = sizeof(struct acpi_rhct_hart_info); + + if (acpi_disabled) { + pr_debug("%s: acpi is disabled\n", __func__); + return -1; + } + + if (!table) { + rhct = (struct acpi_table_rhct *)acpi_get_rhct(); + if (!rhct) + return -ENOENT; + } else { + rhct = (struct acpi_table_rhct *)table; + } + + node = ACPI_ADD_PTR(struct acpi_rhct_node_header, rhct, rhct->node_offset); + end = ACPI_ADD_PTR(struct acpi_rhct_node_header, rhct, rhct->header.length); + + for (i = 0; i < rhct->node_count; i++) { + if (node >= end) + break; + switch (node->type) { + case ACPI_RHCT_NODE_TYPE_HART_INFO: + hart_info = ACPI_ADD_PTR(struct acpi_rhct_hart_info, node, size_hdr); + hart_info_node_offset = ACPI_ADD_PTR(u32, hart_info, size_hartinfo); + if (acpi_cpu_id != hart_info->uid) + break; + for (j = 0; j < hart_info->num_offsets; j++) { + ref_node = ACPI_ADD_PTR(struct acpi_rhct_node_header, + rhct, hart_info_node_offset[j]); + if (ref_node->type == ACPI_RHCT_NODE_TYPE_ISA_STRING) { + isa_node = ACPI_ADD_PTR(struct acpi_rhct_isa_string, + ref_node, size_hdr); + *isa = isa_node->isa; + return 0; + } + } + break; + } + node = ACPI_ADD_PTR(struct acpi_rhct_node_header, node, node->length); + } + + return -1; +} From patchwork Thu Feb 16 18:20:31 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: 58190 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457029wrn; Thu, 16 Feb 2023 10:23:29 -0800 (PST) X-Google-Smtp-Source: AK7set+/5xF82o+1ptbRKfrqPI7J2559zwIbrMMdWozhxC3I7YYLCCIsvN/vezpWlqYQNCfO5+nz X-Received: by 2002:a17:902:e548:b0:198:ec2c:d4e6 with SMTP id n8-20020a170902e54800b00198ec2cd4e6mr8376963plf.38.1676571808834; Thu, 16 Feb 2023 10:23:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571808; cv=none; d=google.com; s=arc-20160816; b=mY8GubQq+a10EcVyZ6wFOrdo5b7PKG0aKNgZAcYjKHM8WDCKymFPv8U0SENr6UxdXo QXLf+wYqpV3mmL5lVYnmXMkDHNW5pAXx4dCuEVgh1PttQyhXekLIKdsJxZmtSIO5+KzR rEhASRpAD+6XmB6G5lyeEuAelvgUQyaHfQajm6nlGeXreCzsmrlsPztypXzkecOPnRMy 6BfW8w6/34EVP+Ma9dU03MHvjdoNyefiT7WuX2P7aEZyygzrZ/WT0us39PpZ4Hn6pphk vl4GgP4QeqqQILxgxSwA5OUAQMJNR2ZXPu1Aq72M9Qtu0oFLtEi8s5UgDwG0Ap6QBa/H 53Dg== 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=1TvuJr54uYfZYo8HSlRmVGPkAT+/kE+f0Y+wFUBrfiQ=; b=OmxdExlvDSxP1FVlSHV1ylVg1/JhD59+ja95w/DJKgL7CJOvXrklaOWtFokHGNZr5V iPgs/guYGKYjaTW7nLswI0vNV6odlGhX/cK0nh9R+2zK9hCrI7aE1lvmIzXLtLWsmv3j ci2q6fg4cn2y2toUXI9fRg8wsFdkEHZei0YsxP/8t9T3ZYd2bd+toIOGlGeFYyUXOrTy Biu57r4OEZoZXMRlT99FdoNfEwbzwAUy/cw1o4JcZwlbk3/nDRrfWX3EXC4ibokdqefD +jZxHx3qNW0e+Q5zPCYT/GVw0QalzSv1IK7SzCGe90C8pf+swEDAjaUT+E+BhnIxp5ve H+hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=T8ZVYzQ3; 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 q14-20020a170902a3ce00b00176b3c7d158si1981294plb.99.2023.02.16.10.23.16; Thu, 16 Feb 2023 10:23:28 -0800 (PST) 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=T8ZVYzQ3; 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 S230315AbjBPSWW (ORCPT + 99 others); Thu, 16 Feb 2023 13:22:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230263AbjBPSWK (ORCPT ); Thu, 16 Feb 2023 13:22:10 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4840150AF0 for ; Thu, 16 Feb 2023 10:21:37 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id cp18so515482pjb.0 for ; Thu, 16 Feb 2023 10:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=1TvuJr54uYfZYo8HSlRmVGPkAT+/kE+f0Y+wFUBrfiQ=; b=T8ZVYzQ363zfTHRmFc9Jj62v2RoZaVNJV/KSLrEC3vZXuFiM0hJTn+RLJkF6ILJA7J GArJJR5zxRlWWcUdo50vWXdvsthFhIsuTgkdCKDo47kU8XsBJ29b1FymHg2Js835U/mo CEtDFau+/1jI1mXWRLBnP1SKWAduXmIY1avdHCWj+//ufeIXUlnRmWt1M/tHVZ49S1X8 BGwXlXGsaHbjRi8enrhc7NwEq9AKnN2ZUDIvySSMJNmYsbmn1beDmvNsglEV0svadKar 6ptrElsOtU4YSa/V+Mxs9dnfeRU17fORaYp3yaFy6yiycz8YTqNd/lGtv2t/s6LLgUXB GrcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=1TvuJr54uYfZYo8HSlRmVGPkAT+/kE+f0Y+wFUBrfiQ=; b=yPqlUn8xj4G2tOhcjj8PyuQuYhp+cV7FXvW8CdgFIWYDUk+DBLbcNmD44bP0rBvGD2 1qNbVS3vjxIZ4dPnf/xZmIHgfOSOEM7YqBGyd+RquUsDRCG3kKmht2FrgU6GnYBgLY5h 6RpGULT3Y1q5qz8SZngp2shV+uuYF0/+7bWM00Fda0S+AQ2B75shEo08KfnDCl+Szg48 iv135cAECcVc/99LUm9HfRc6u2uJznXZsPAoN3k4BLeck5fFF0Mxs11sp4d5jdgbzen0 V7eQqdlYFVBERuTKr5iSPGhrmPlPE/xPuG/dghtfgCoFzVWgqukiGQOJuu+Q5XhGYtJ6 NT+w== X-Gm-Message-State: AO0yUKXfOPN2hmZHZOo09DPOOcvDwbbpqegYyQnfXftgmzV4VDiS8g5G o00BiMa9PL0ABWxo+dwe4eKxUg== X-Received: by 2002:a05:6a20:7f92:b0:c7:1bd0:c575 with SMTP id d18-20020a056a207f9200b000c71bd0c575mr4133361pzj.19.1676571695888; Thu, 16 Feb 2023 10:21:35 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:35 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 09/21] RISC-V: smpboot: Create wrapper smp_setup() Date: Thu, 16 Feb 2023 23:50:31 +0530 Message-Id: <20230216182043.1946553-10-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758012961321270448?= X-GMAIL-MSGID: =?utf-8?q?1758012961321270448?= smp_setup() currently assumes DT-based platforms. To enable ACPI, first make this a wrapper function and move existing code to a separate DT-specific function. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones --- arch/riscv/kernel/smpboot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 00b53913d4c6..26214ddefaa4 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -70,7 +70,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } } -void __init setup_smp(void) +static void __init of_parse_and_init_cpus(void) { struct device_node *dn; unsigned long hart; @@ -116,6 +116,11 @@ void __init setup_smp(void) } } +void __init setup_smp(void) +{ + of_parse_and_init_cpus(); +} + static int start_secondary_cpu(int cpu, struct task_struct *tidle) { if (cpu_ops[cpu]->cpu_start) From patchwork Thu Feb 16 18:20:32 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: 58191 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457056wrn; Thu, 16 Feb 2023 10:23:31 -0800 (PST) X-Google-Smtp-Source: AK7set8CAxfZaqrVZAZ3UMh5jI46GBEnAWyigbpfGryyxPX/x4QVyWhDEDEvxTb+Gu3zEmSD/jF4 X-Received: by 2002:a17:903:2306:b0:19a:a4fc:7f80 with SMTP id d6-20020a170903230600b0019aa4fc7f80mr7868793plh.26.1676571811671; Thu, 16 Feb 2023 10:23:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571811; cv=none; d=google.com; s=arc-20160816; b=ImHZWa5C1umlf2NSsrSiqcOQ4qWiOqpxlrOTuuRGrdgfqoqUD2KpdzWpR5Po34iWi0 akfbagHsHEKxWrmFgToaSjwjueEQ0svUZnx8d78FnceOdAHG628j8L1A30beUeEYVJUZ MONu3oCAwZDcUiBXDv5DVTSdz4dez+g0UH8tZvD6EV/u7fGuetzzcUNgPSX1FoXCDxlg vTt9QCdarSgBTwUi9cfCVnU/Lx5vxygy2fAPF/iMTRCD8Q44VovZgiUvQSz+8FMN+Aaw Emfpa+Jic2akLfXZiUEkoN4mWhL/E1e2goKO3C4mdizEN+8CxCIhSFue0ty67WhV0gYv G+WQ== 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=s8gLVy86DoWbnyaOmwt3yk4bIOk4obRTX8YOySNU6bM=; b=bAfO+kCBEa8/KJ2VoCd8dhvU2BvESzvn7C0IwOqERH39YububUpXzKU6AtlxTahEeX otzUXUc7Gokhee7/IxpKnCRR+aae2ODRnUmebMFenSl98q8MSv5wWHvvuH0tVGtMBMPB ZV+TkcEuPHVXOrhHzYyx70HEIG4z1PUPeX85UDMai6xsuAoYlZ0FrPsdMq29rIp6Z+u5 3aghVRoWJelxgIxB2WehwpRUYnqhDATi2SrLEbsjFiXD/NVWbNOdGeKkpGBtNdiICkVZ xjGTdCc5r7ZFOA9vvhbicjSrYgbBmiE7o7A1xKVi6xhZ9lgQXSMtUqtA9xDPOONrn8Rl gc9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=VpdtjEii; 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 a5-20020a170902710500b0019b007ce788si1390415pll.269.2023.02.16.10.23.18; Thu, 16 Feb 2023 10:23:31 -0800 (PST) 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=VpdtjEii; 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 S230285AbjBPSWd (ORCPT + 99 others); Thu, 16 Feb 2023 13:22:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbjBPSWL (ORCPT ); Thu, 16 Feb 2023 13:22:11 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722D32A15A for ; Thu, 16 Feb 2023 10:21:42 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id d2so2703229pjd.5 for ; Thu, 16 Feb 2023 10:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=s8gLVy86DoWbnyaOmwt3yk4bIOk4obRTX8YOySNU6bM=; b=VpdtjEii+t5cvC5ibTSbTwjU4Vx3GiWKkzTOXqXjUr0YDKlzh2RTmRhrfafw6GTtsc YTQqnR6kqj6GRIgl9yX/vR6IHxTBJo7vdDNEj8DswgI7MPqnnTKk6CnOzErmcN5CCH2b ZwMNZtNf6oZbN7d+YG/54CFyPCKr7rLx8eQKziHq+F0+XPYQXsrOqlge5KMGhUXVQVMo nT8fZ/aoGGnmZ86ZY/5kHh7e+61wbBNj1IkEy+Sk4r9srBbf2euRVlaJls3S5LTMegLN dC+DQ9pSlYuPW3W5SR4Zgw/zMM7vqJOQ/chaI5xf2TMznWD+BoyMvGkFM9XtER5brYcS 3B8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=s8gLVy86DoWbnyaOmwt3yk4bIOk4obRTX8YOySNU6bM=; b=X3R3YhtFHJK7KrE+lt8kx9dMceWYu42hO0fu30jfM0bKyrZg2Wkabd8rD5JLnVqy7f 4Xcn6eSnFDEQFOMyclKkJQLC52DVo+XjopQMwam4moL+wbfgoc2m1I4XWx27wJwF/4p6 q1cn0/QuG+fZzjdqIpjDMAahQBXfWUamUGHU7tawkjAzOVM0Hmts/Su+2kZznJEvUmZQ A2c5dQB2BMDQx3iCH+2T0lxKQUSFJoUdGWV/hlyKqflt+eBqzMCOj0UJzGlPRe9CJa0R ZxcYXSEgZiEyAFwwDZlP0EiOzWmukZ+I/zVyX1IM8sVTj5y8tDGAOtXhkLZBSzPy8De7 cIuw== X-Gm-Message-State: AO0yUKX+jJ9kd37t7meME/WX93yrwpWMIAzHExY4oyaXOIygX1cpb4LW 1NvRKYZ4hPjStekXPFZSFRzjLQ== X-Received: by 2002:a17:90b:1d87:b0:233:d4fd:38a3 with SMTP id pf7-20020a17090b1d8700b00233d4fd38a3mr7710027pjb.41.1676571700518; Thu, 16 Feb 2023 10:21:40 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:40 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 10/21] RISC-V: smpboot: Add ACPI support in smp_setup() Date: Thu, 16 Feb 2023 23:50:32 +0530 Message-Id: <20230216182043.1946553-11-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758012964023029861?= X-GMAIL-MSGID: =?utf-8?q?1758012964023029861?= Enable SMP boot on ACPI based platforms by using the RINTC structures in the MADT table. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Conor Dooley --- arch/riscv/include/asm/acpi.h | 7 ++++ arch/riscv/kernel/smpboot.c | 70 ++++++++++++++++++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h index 7bc49f65c86b..3c3a8ac3b37a 100644 --- a/arch/riscv/include/asm/acpi.h +++ b/arch/riscv/include/asm/acpi.h @@ -60,6 +60,13 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) { } int acpi_get_riscv_isa(struct acpi_table_header *table, unsigned int cpu, const char **isa); + +#ifdef CONFIG_ACPI_NUMA +int acpi_numa_get_nid(unsigned int cpu); +#else +static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; } +#endif /* CONFIG_ACPI_NUMA */ + #else static inline int acpi_get_riscv_isa(struct acpi_table_header *table, unsigned int cpu, const char **isa) diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 26214ddefaa4..77630f8ed12b 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -8,6 +8,7 @@ * Copyright (C) 2017 SiFive */ +#include #include #include #include @@ -70,6 +71,70 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } } +#ifdef CONFIG_ACPI +static unsigned int cpu_count = 1; + +static int __init acpi_parse_rintc(union acpi_subtable_headers *header, const unsigned long end) +{ + unsigned long hart; + bool found_boot_cpu = false; + struct acpi_madt_rintc *processor = (struct acpi_madt_rintc *)header; + + /* + * Each RINTC structure in MADT will have a flag. If ACPI_MADT_ENABLED + * bit in the flag is not enabled, it means OS should not try to enable + * the cpu to which RINTC belongs. + */ + if (!(processor->flags & ACPI_MADT_ENABLED)) + return 0; + + hart = processor->hart_id; + if (hart < 0) + return 0; + if (hart == cpuid_to_hartid_map(0)) { + BUG_ON(found_boot_cpu); + found_boot_cpu = true; + early_map_cpu_to_node(0, acpi_numa_get_nid(cpu_count)); + return 0; + } + + if (cpu_count >= NR_CPUS) { + pr_warn("Invalid cpuid [%d] for hartid [%lu]\n", + cpu_count, hart); + return 0; + } + + cpuid_to_hartid_map(cpu_count) = hart; + early_map_cpu_to_node(cpu_count, acpi_numa_get_nid(cpu_count)); + cpu_count++; + + return 0; +} + +static void __init acpi_parse_and_init_cpus(void) +{ + int cpuid; + + cpu_set_ops(0); + + /* + * do a walk of MADT to determine how many CPUs + * we have including disabled CPUs, and get information + * we need for SMP init. + */ + acpi_table_parse_madt(ACPI_MADT_TYPE_RINTC, acpi_parse_rintc, 0); + + for (cpuid = 1; cpuid < nr_cpu_ids; cpuid++) { + if (cpuid_to_hartid_map(cpuid) != INVALID_HARTID) { + cpu_set_ops(cpuid); + set_cpu_possible(cpuid, true); + } + } +} +#else +#define acpi_parse_and_init_cpus(...) do { } while (0) +#endif + static void __init of_parse_and_init_cpus(void) { struct device_node *dn; @@ -118,7 +183,10 @@ static void __init of_parse_and_init_cpus(void) void __init setup_smp(void) { - of_parse_and_init_cpus(); + if (acpi_disabled) + of_parse_and_init_cpus(); + else + acpi_parse_and_init_cpus(); } static int start_secondary_cpu(int cpu, struct task_struct *tidle) From patchwork Thu Feb 16 18:20:33 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: 58198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457477wrn; Thu, 16 Feb 2023 10:24:23 -0800 (PST) X-Google-Smtp-Source: AK7set/0EYORgR7toiT0vr4HRy5BoosbnPV2ztejNaIaZ4PyY9ZQynPnQA/NtjWgbyVGjRKiyFTF X-Received: by 2002:a17:903:88d:b0:19a:95ab:6b38 with SMTP id kt13-20020a170903088d00b0019a95ab6b38mr6428639plb.1.1676571863386; Thu, 16 Feb 2023 10:24:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571863; cv=none; d=google.com; s=arc-20160816; b=n0I0IUH1mD4lDSA0NgwD2zFG5lpRtenkF1QoIrHxrZ1LUlwofMYrUHA21GxqTB0uEk +XD0GTO6KF5pCca+zWdTS6dXTDeKRy/xMU+k3FFxxrBK1hrVFRSA7gB1rQYzhohM5vUA wiXzuRfRKg4cWTUwJQQNJgoc/BTDKUpDcdJGDY48AXQLAWh21GSgZxz6iZ2WYXIEVEHD H2yHxCWm2QONjgXxN9SS01Q69HtGrsh8g9WQZdxcCIxVCw3NlKRVsLsYi7v5qioZMBXk 0pY1ZBEfAWapEARLDRWr/AI9z4Mc/56fFnC/2uxAYfP8VqMRFfsDHq7EGs0DaWT3l+UV /q/g== 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=GipxeDCOyjMj8YF40M4Hg7LI5rDefQ4n1sWRXQ5Wf4A=; b=m5gNdaH+1aKnee5711+8r0xNRYazc5lJ9ahLCPa3hmfRiU2jaNJR/5zxdq9XeRQ9Za 69hrSdJ2W+2sTfFjF8VbFoFaWVglzHiJhpQCRNumICZ27rAdDwOKZhX9O0Ht9L2xMsfT jQUby4B9PsjF8K05HmGb4RK+72uVajKke3Tznkp/gOEy8b0IemGTYkT8O+QVQWWLEYu+ S6W+zkv3PrrH7noo7nFlEf7sdi+rqN5fSRWzUvtF+PeFb3ghbKSAzGylMj7SGuyZOT5u wLBzTVEJHbQyVLPyZ8Oo2vBluvkFFR6MVwKw2dTT4APE6lOlyEgp6+4o3cmMTRKkEjk8 LEmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="eEFXo/Gf"; 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 h2-20020a170902f54200b001968a5d4107si2431831plf.398.2023.02.16.10.24.09; Thu, 16 Feb 2023 10:24:23 -0800 (PST) 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="eEFXo/Gf"; 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 S230350AbjBPSWh (ORCPT + 99 others); Thu, 16 Feb 2023 13:22:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbjBPSWO (ORCPT ); Thu, 16 Feb 2023 13:22:14 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3B4F50ADD for ; Thu, 16 Feb 2023 10:21:46 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id bx22so2712451pjb.3 for ; Thu, 16 Feb 2023 10:21:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=GipxeDCOyjMj8YF40M4Hg7LI5rDefQ4n1sWRXQ5Wf4A=; b=eEFXo/GfQ56r4rtPgsxzNpFtJ23EjjcqYMMKhNbgLjE2Uuuy6P1bpuyH7mca/UbFYP aBNx3N2EIanq/lyuvYX2QMPg6Z1XipqO6QH1D/VjXzNzHfwBixUTZ/HkyjgfC9haFo78 Y12zsDunSkOjC4xURoqcxMZVCuD9ZLuBo70InXbPD6zU79CNTJXTYKIqcnJ1InzY+flJ //f7yL3N67uDxSS8o5mkf0Pe86BtKQRee5sbU4av6NbYmLZowEkxCR9khQ3johCdCu8S KY1xIiFS6em7YokS3n0jAZZwM4ZAuhjIaWBjjPllKiungJ3uK7QAE9DuaATKsqxVIfyc phdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=GipxeDCOyjMj8YF40M4Hg7LI5rDefQ4n1sWRXQ5Wf4A=; b=46mEJe8olB0Gb6FWWcDsGiFrqouJCYesTnxfoXgE12KTCcHm6XQqSWWwQm8H95Q17/ ZOGgQsdAi4alWXLXb099SbZxV4N8mHgUlZXHh2UxAHlKi5mRo8zpm59JyoS9DuMygRTn wRIpdTnTI967X7EsyHRYvs5B6BgivMCBAhOVLAINQFrlT5BFC+VOQRwZyg/rpsx/yoZb 1JK0wNxyJp3HsIABirl7Tm33rwxJpR1NgLwrgEB9auLP4egMhNBbL89wHb4soCrXZ4y+ 72pb44qu+qx20nOF7BSHRssxhrOpyUUl1Q1mduMXcP8eTZxBMQ2I5w7NKCog3ME4bHFW QBlA== X-Gm-Message-State: AO0yUKVUXywJj0lz6iYy8vaA/GIvwnF9im8g5Ty9hUVvolaBVxAyrX7w WfoUsFAuO2t34LDxpEAyxiasxg== X-Received: by 2002:a05:6a20:6a0c:b0:9f:3197:bfa1 with SMTP id p12-20020a056a206a0c00b0009f3197bfa1mr7989098pzk.7.1676571705447; Thu, 16 Feb 2023 10:21:45 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:45 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 11/21] RISC-V: ACPI: Add a function to retrieve the hartid Date: Thu, 16 Feb 2023 23:50:33 +0530 Message-Id: <20230216182043.1946553-12-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758013018245099862?= X-GMAIL-MSGID: =?utf-8?q?1758013018245099862?= The hartid is in the RINTC structure of the MADT table. Instead of parsing the ACPI table every time, cache it and provide a function to read it. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- arch/riscv/include/asm/acpi.h | 8 +++++ arch/riscv/kernel/acpi.c | 55 +++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h index 3c3a8ac3b37a..b9d7b713fb43 100644 --- a/arch/riscv/include/asm/acpi.h +++ b/arch/riscv/include/asm/acpi.h @@ -67,6 +67,9 @@ int acpi_numa_get_nid(unsigned int cpu); static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; } #endif /* CONFIG_ACPI_NUMA */ +struct acpi_madt_rintc *acpi_cpu_get_madt_rintc(int cpu); + +u32 get_acpi_id_for_cpu(int cpu); #else static inline int acpi_get_riscv_isa(struct acpi_table_header *table, unsigned int cpu, const char **isa) @@ -74,6 +77,11 @@ static inline int acpi_get_riscv_isa(struct acpi_table_header *table, return -EINVAL; } +static inline u32 get_acpi_id_for_cpu(int cpu) +{ + return -1; +} + #endif /* CONFIG_ACPI */ #endif /*_ASM_ACPI_H*/ diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c index 81d448c41714..13b26c87c136 100644 --- a/arch/riscv/kernel/acpi.c +++ b/arch/riscv/kernel/acpi.c @@ -24,6 +24,61 @@ EXPORT_SYMBOL(acpi_disabled); int acpi_pci_disabled = 1; /* skip ACPI PCI scan and IRQ initialization */ EXPORT_SYMBOL(acpi_pci_disabled); +static unsigned int intc_count; +static struct acpi_madt_rintc cpu_madt_rintc[NR_CPUS]; + +static int acpi_parse_madt_rintc(union acpi_subtable_headers *header, const unsigned long end) +{ + struct acpi_madt_rintc *rintc = (struct acpi_madt_rintc *)header; + + if (!(rintc->flags & ACPI_MADT_ENABLED)) + return 0; + + cpu_madt_rintc[intc_count++] = *rintc; + + return 0; +} + +static int acpi_init_rintc_array(void) +{ + if (acpi_table_parse_madt(ACPI_MADT_TYPE_RINTC, acpi_parse_madt_rintc, 0) > 0) + return 0; + + pr_info("No valid RINTC entries exist\n"); + return -ENODEV; +} + +struct acpi_madt_rintc *acpi_cpu_get_madt_rintc(int cpu) +{ + static bool rintc_init_done; + unsigned int i; + + if (!rintc_init_done) { + if (acpi_init_rintc_array()) { + pr_err("Failed to initialize RINTC array\n"); + return NULL; + } + rintc_init_done = true; + } + + for (i = 0; i < intc_count; i++) { + if (cpu_madt_rintc[i].hart_id == cpuid_to_hartid_map(cpu)) + return &cpu_madt_rintc[i]; + } + + return NULL; +} + +u32 get_acpi_id_for_cpu(int cpu) +{ + struct acpi_madt_rintc *rintc = acpi_cpu_get_madt_rintc(cpu); + + if (!rintc) + return -1; + + return rintc->uid; +} + /* * __acpi_map_table() will be called before paging_init(), so early_ioremap() * or early_memremap() should be called here to for ACPI table mapping. From patchwork Thu Feb 16 18:20:34 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: 58193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457193wrn; Thu, 16 Feb 2023 10:23:49 -0800 (PST) X-Google-Smtp-Source: AK7set+IEgUYWzcBz6DsXMAh45l2hu29SyjoPU7irz09ccE0jlCxE4F4BcWSDMvLns+tJEku5qHM X-Received: by 2002:a05:6a21:9986:b0:b8:c6ec:a269 with SMTP id ve6-20020a056a21998600b000b8c6eca269mr7321849pzb.16.1676571828878; Thu, 16 Feb 2023 10:23:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571828; cv=none; d=google.com; s=arc-20160816; b=fvhldQ8TLxaljT1rkNdWAUTLOJa81Ln16XVPjqHIfRu5H3bHCjwbLJ2GMP5yxKBnWB Juo6smODM68uq96LVVbpjMzCS13Y/qEHwRmUoMchQDUbv6EFNeJFw9gXJ89RHu1K6kki GaWSZHgn2zYgZBpDIqDjna7mgRA9UhjgBSo/fz8+xYRszDZ+/jaWdjRH7QUBaW4IlGhc Q5XuADmGrYgk20OL1m9Ql6WJK7BLjKrlpv2TUqGPq25INWzAaadQRRAnC1Sn1Lcy1agN iM5nZTWDG897FdVUJiC8cRNJHQN8RLLT77xCF6H2T5RUU1HFpYeV9r4/6lNmzuHZRkpT 3oIA== 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=oVlhq9jJF5fkqCwNhAPs1olNplFdF6B5WclRLPqFQkc=; b=L7T+smwIisAX8yPSd0hnB5ODiIk5VSlDKw5tciZx2C27UYOXkFVEZCBsfxRUsNTSTN 3Mk6GtNjVfCilmxff5Lkw1oBx1eKValviXXQfGS/6vei9KiP3aQVfeG5DZZz+rcvbgnS 5DPsS7szeD2CJD3JT870i2HydnM5e7KT4OZizBkpif/XxJlQGYVOzK92TZAbQbTMxH9p oJwYGYT6eZNKMAGyrqmYUwht27W6q80LNcT6VYQmiEK8Jj6bC+iBV2SxOabn1SR20x9Y A8mViVL/7tmBS59TrgDiWVsPHbQpCY/Z5MRTSmzQYhjjmmugb06MGPRj04975gfd3oTE nx8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Ih5cdvHU; 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 h34-20020a631222000000b004fae19eac8bsi2350499pgl.810.2023.02.16.10.23.36; Thu, 16 Feb 2023 10:23:48 -0800 (PST) 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=Ih5cdvHU; 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 S230263AbjBPSW4 (ORCPT + 99 others); Thu, 16 Feb 2023 13:22:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbjBPSWV (ORCPT ); Thu, 16 Feb 2023 13:22:21 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AD0B552B4 for ; Thu, 16 Feb 2023 10:21:51 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id ja21so2898894plb.13 for ; Thu, 16 Feb 2023 10:21:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=oVlhq9jJF5fkqCwNhAPs1olNplFdF6B5WclRLPqFQkc=; b=Ih5cdvHUc+6binLwjpr9QH0EbQBhTLyXOn/RYXvnmLofBP2hcHPkdG0+7hRgOIc02B 5GjCVp29i00cLIPLwY831s+ehgLGUY5ccr/5K8Ey+Q9UIFlTzXxleMG/mmV+zz0rmfxx EeCcij3QYpom+JUlpOhqSPVU14ZW5Q01dfQ9xD0heAmdGyuYsIbPcwN2dc6YsfWyPYvh liTNxl3kFNv75Su6bUJ37zkzS0WxwE7ZOgsJ4PWqf/bMl4qPijkYC+2QM6Y2e1gJ/1DG szGLGMguiud/r0MyWRTMx0xryUd8EIMUNOEcamcLUNJP+REakrD9PxQOyILiHtEZ2zJ+ im/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=oVlhq9jJF5fkqCwNhAPs1olNplFdF6B5WclRLPqFQkc=; b=FJBTkwJo2jJdK/TQh5Uguo198HTMd8W0sJrKNjdwn22CMm0Ep8SoIC4ZAGo1j6sKPG GfXIkXHxDXst1LXj6fYQnFrFAjB2h9B5k3rNFKO7Ot3RzOUU0zScr+OnWqX9Qggop3Br KWI/taMAmID/0d2NP/79Nq24QaJw+WOszZO8tChS2PVqaDicwxmpG2x0MZ8EruoQD24A IN7+yV2PY/c/SwYxY2Y+dlFnhYZYrpUDKkDg2SQaLOwxy5y7XcVUjKArcckrqqQtc3Di F3D0UGsinCQK9Msb4cnClviKgUl3h86pSRekPF0mRiaoGfIRPvQiU+9iJ1gZNQocBwOS WCMw== X-Gm-Message-State: AO0yUKVtP9EvdHX8yLJtE4XJWTDN37DMkI+nAWuv2BD9QQSyt8MpQRNI oWLvvaouqUam1psblSMbOQvEWA== X-Received: by 2002:a05:6a21:7899:b0:c7:6664:1e07 with SMTP id bf25-20020a056a21789900b000c766641e07mr202270pzc.28.1676571710197; Thu, 16 Feb 2023 10:21:50 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:49 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 12/21] RISC-V: cpufeature: Add ACPI support in riscv_fill_hwcap() Date: Thu, 16 Feb 2023 23:50:34 +0530 Message-Id: <20230216182043.1946553-13-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758012982260434111?= X-GMAIL-MSGID: =?utf-8?q?1758012982260434111?= On ACPI based systems, the information about the hart like ISA is provided by the RISC-V Hart Capabilities Table (RHCT). Enable filling up hwcap structure based on the information in RHCT. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- arch/riscv/kernel/cpufeature.c | 41 ++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 93e45560af30..cb67d3fcbb56 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -6,12 +6,15 @@ * Copyright (C) 2017 SiFive */ +#include #include #include #include #include #include #include +#include +#include #include #include #include @@ -93,7 +96,10 @@ void __init riscv_fill_hwcap(void) char print_str[NUM_ALPHA_EXTS + 1]; int i, j, rc; unsigned long isa2hwcap[26] = {0}; + struct acpi_table_header *rhct; + acpi_status status; unsigned long hartid; + unsigned int cpu; isa2hwcap['i' - 'a'] = COMPAT_HWCAP_ISA_I; isa2hwcap['m' - 'a'] = COMPAT_HWCAP_ISA_M; @@ -106,18 +112,36 @@ void __init riscv_fill_hwcap(void) bitmap_zero(riscv_isa, RISCV_ISA_EXT_MAX); - for_each_of_cpu_node(node) { + if (!acpi_disabled) { + status = acpi_get_table(ACPI_SIG_RHCT, 0, &rhct); + if (ACPI_FAILURE(status)) + return; + } + + for_each_possible_cpu(cpu) { unsigned long this_hwcap = 0; DECLARE_BITMAP(this_isa, RISCV_ISA_EXT_MAX); const char *temp; - rc = riscv_of_processor_hartid(node, &hartid); - if (rc < 0) - continue; + if (acpi_disabled) { + node = of_cpu_device_node_get(cpu); + if (node) { + rc = riscv_of_processor_hartid(node, &hartid); + if (rc < 0) + continue; - if (of_property_read_string(node, "riscv,isa", &isa)) { - pr_warn("Unable to find \"riscv,isa\" devicetree entry\n"); - continue; + if (of_property_read_string(node, "riscv,isa", &isa)) { + pr_warn("Unable to find \"riscv,isa\" devicetree entry\n"); + continue; + } + of_node_put(node); + } + } else { + rc = acpi_get_riscv_isa(rhct, get_acpi_id_for_cpu(cpu), &isa); + if (rc < 0) { + pr_warn("Unable to get ISA for the hart - %d\n", cpu); + continue; + } } temp = isa; @@ -248,6 +272,9 @@ void __init riscv_fill_hwcap(void) bitmap_and(riscv_isa, riscv_isa, this_isa, RISCV_ISA_EXT_MAX); } + if (!acpi_disabled) + acpi_put_table((struct acpi_table_header *)rhct); + /* We don't support systems with F but without D, so mask those out * here. */ if ((elf_hwcap & COMPAT_HWCAP_ISA_F) && !(elf_hwcap & COMPAT_HWCAP_ISA_D)) { From patchwork Thu Feb 16 18:20:35 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: 58194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457219wrn; Thu, 16 Feb 2023 10:23:51 -0800 (PST) X-Google-Smtp-Source: AK7set/M2j2RJxfnW3xK8pS1LDOQsAuk87Sr0xp3VRwovUAy4dnCsMW8LPHCuxacfIHuVgkPv7Yp X-Received: by 2002:aa7:9987:0:b0:593:da8:6f34 with SMTP id k7-20020aa79987000000b005930da86f34mr5644398pfh.5.1676571831317; Thu, 16 Feb 2023 10:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571831; cv=none; d=google.com; s=arc-20160816; b=xcudagw78UHT/kdlc/lTk8XSYOHOTGmv1sfbSy6vla7rYS2dqS4GAUgzjT3SQ8Jpib Nht/x6ib5JyY3hL7iTqKQPfffPsqfvFmz3cSZOL/DVFG7NqQvdcBwJty8hBMqyDE7Soz m4MZuXTxqmfyq9fAaayEUNcPgorzEuhAhRQeRBoU4mWVD143s2F0r3plZFMj4Ir3EwHz U99QM44CXOVTXVSy2mYtR1J1CKs8oedl5GZvDKk56v2DssT/5xWbR5TtyRV6T7NWUmIB egxOXUwFAWHGPNbb8eQAkcmPqmoTAovJFTAevpDJBRZetzav8rvo6oCEZfiEUEXS7Acb 8bXg== 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=Y/B7oU0oZMzvSlnZ6Slk2M4LeGqm6SOf/DwHx2JHpN8=; b=G/LUuMQaX14qURlria3U3GBhxZZ/kGTyKm9ugfXe9D/0E4JKY+J3pAr8K7SKXtgC8O 3/fTdmBXm92rBkkyvJ2nQF6fxftnKLOoH+H9pqL5UU9NnRIZpa9y0tAAvX0Z1byJTQov oF7hKWcUEMx84+aCtf96Dy49N7UIHSDYDa06utVtXh+cV1Rk7OwaUSffJT4F9mKj1OJM dkNZgKUqCqjYOPflqCt/aLDAg2qqMdPbXLNzkYqUXxNvax973iCJsgQnNFs839vDKZtX 4oYJ/B31alJwNTOGMUhQ/wWZlW4CeK223sONdMsHupfzYiVWCqeKlTU8IeBJbYIad60S 77jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=JhzKrMk2; 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 r5-20020aa79ec5000000b005a908081c02si2111152pfq.94.2023.02.16.10.23.38; Thu, 16 Feb 2023 10:23:51 -0800 (PST) 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=JhzKrMk2; 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 S230326AbjBPSXG (ORCPT + 99 others); Thu, 16 Feb 2023 13:23:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230321AbjBPSWb (ORCPT ); Thu, 16 Feb 2023 13:22:31 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DE415035B for ; Thu, 16 Feb 2023 10:21:57 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id bx22so2712865pjb.3 for ; Thu, 16 Feb 2023 10:21:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=Y/B7oU0oZMzvSlnZ6Slk2M4LeGqm6SOf/DwHx2JHpN8=; b=JhzKrMk2y0c0UJJY9R3LAeDqup2Vy26n7fKJF2EJ8p9IKFWGnI1YedBoBhqO8F3LkM tVZ+fGNaffll2OfDmYRq+19mu8tuigJ54kj92JxCQHc1ux9gKkHGlD6/60HYZK/ZNGTo M3kerTUxSK6phuUl/DKNjGQyHWtPG5QMv4mHhe3+juD7WJQynDSgsNO+hKRxoKLPXcyg fk5/451Gdasyf10nauCTje7081IndfdWP2CXIZbgriIouer1UlPFOB6pBqXuYsTQcSO9 xbPXfLEPHK2SFHFpnQZA7O6nt+QPejZjwMal7uNgk+Hakcw4VJJ7MArqKBxLJzJHHUF0 L2nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Y/B7oU0oZMzvSlnZ6Slk2M4LeGqm6SOf/DwHx2JHpN8=; b=bk679GfmW5My1KhqVzOLsPM5VAeBzIKbdWCj+5sjUX9Jgk3xVcj3v1i32dVGobhh1H BVUJgETque/FUBoEUwzRMh+/yP07JnMj+wQRL9Z/K3+smkxs3+LvZfSeBE+wrylEWOZr /ibaOqrYf98nlyBzrOH0MhsgdZbeOOuFddpYBn6+lfzqidEXDT6wszPtWmU8PvXmHVW5 xJxogTgRNQlnsCxr9JJAMbj/Uh/VgUqfvr6WcxEFH5TKhnI72nqNr0gQi4viYlCI9P9Y evEugvdvfHpCmsBer/JlLV8WZ1P1JWVSADylPZCdsqXHZ/eFElO89IIhkwXcCI2Sb6iv ZNLw== X-Gm-Message-State: AO0yUKX1dpjmkZOSa7RN3WpiGC8r2qaGrl5DmK0x8l/LeE0GX2E30nDi ODNmp3NRkYVnjH5f+vfLoX9dNQ== X-Received: by 2002:a05:6a20:8e16:b0:c6:dfe3:8663 with SMTP id y22-20020a056a208e1600b000c6dfe38663mr6729908pzj.9.1676571715195; Thu, 16 Feb 2023 10:21:55 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:54 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 13/21] RISC-V: cpu: Enable cpuinfo for ACPI systems Date: Thu, 16 Feb 2023 23:50:35 +0530 Message-Id: <20230216182043.1946553-14-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758012984116810908?= X-GMAIL-MSGID: =?utf-8?q?1758012984116810908?= On ACPI based platforms, few details like ISA need to be read from the ACPI table. Enable cpuinfo on ACPI based systems. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- arch/riscv/kernel/cpu.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 1b9a5a66e55a..a227c0661b19 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -3,10 +3,12 @@ * Copyright (C) 2012 Regents of the University of California */ +#include #include #include #include #include +#include #include #include #include @@ -256,26 +258,41 @@ static void c_stop(struct seq_file *m, void *v) { } +static void acpi_print_hart_info(struct seq_file *m, unsigned long cpu) +{ + const char *isa; + + if (!acpi_get_riscv_isa(NULL, get_acpi_id_for_cpu(cpu), &isa)) + print_isa(m, isa); +} + static int c_show(struct seq_file *m, void *v) { unsigned long cpu_id = (unsigned long)v - 1; - struct device_node *node = of_get_cpu_node(cpu_id, NULL); struct riscv_cpuinfo *ci = per_cpu_ptr(&riscv_cpuinfo, cpu_id); + struct device_node *node; const char *compat, *isa; seq_printf(m, "processor\t: %lu\n", cpu_id); seq_printf(m, "hart\t\t: %lu\n", cpuid_to_hartid_map(cpu_id)); - if (!of_property_read_string(node, "riscv,isa", &isa)) - print_isa(m, isa); + + if (acpi_disabled) { + node = of_get_cpu_node(cpu_id, NULL); + if (!of_property_read_string(node, "riscv,isa", &isa)) + print_isa(m, isa); + if (!of_property_read_string(node, "compatible", &compat) && + strcmp(compat, "riscv")) + seq_printf(m, "uarch\t\t: %s\n", compat); + of_node_put(node); + } else { + acpi_print_hart_info(m, cpu_id); + } + print_mmu(m); - if (!of_property_read_string(node, "compatible", &compat) - && strcmp(compat, "riscv")) - seq_printf(m, "uarch\t\t: %s\n", compat); seq_printf(m, "mvendorid\t: 0x%lx\n", ci->mvendorid); seq_printf(m, "marchid\t\t: 0x%lx\n", ci->marchid); seq_printf(m, "mimpid\t\t: 0x%lx\n", ci->mimpid); seq_puts(m, "\n"); - of_node_put(node); return 0; } From patchwork Thu Feb 16 18:20:36 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: 58195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457272wrn; Thu, 16 Feb 2023 10:23:57 -0800 (PST) X-Google-Smtp-Source: AK7set/TJJn1VJEdce2hCkhM2mxGP2uC1nDI+kqDYMmyGWN4gR1V+FboxAjNg30rzN17bB1JBiXw X-Received: by 2002:a62:6344:0:b0:596:78f:1531 with SMTP id x65-20020a626344000000b00596078f1531mr4963892pfb.3.1676571837468; Thu, 16 Feb 2023 10:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571837; cv=none; d=google.com; s=arc-20160816; b=gFH497dgr1RFx+lJoB/DJ9tUQlDUa/hN1+uDyRXLFePa+frl7jrOYMvGAkKG4DT//Z nhRR1CBzOEyoDgFcCIq0A5HhItsQA7vQcdZk6NewS85nSLnpFclz03v46xTVyJr/IOfO ubvtKRvW6QrCf1sjnNVc3XG4FXC9IZiEGUdXNi4t0uPhAUICGqhFBj9nV9APzN6LQ+9u dVH8d9hKQcid3QHhsPHfaGrruZNWkf5NfMn+kTNQpvc8apQJ8oXPK/jDJdxpfXMaMoKg RDj6NapncVhgjG9s8hOPZ4/uVu6Lp31FD6TKWzBmoAQl3OCZY6SHlTEG4n/LUH0UuJmN p2FQ== 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=8+mNmph7z+0hgeAPhfRjYNKRnC89i/LR46jyYpJ0Apo=; b=l1SUaTkcYBRmnnpv9BUcSxEs/bydcCCl29gKm7w4WaeL/N8IN58azPNqtTi51G0VST hfq1ndb4rMXR/XgOXrCT0AnrfK2ioF1VZskkrOr75jlR2lAtRYg3n3ookHvefPpcU2ni 0yhSv5wjy17eYfSFq3dawlgadj0GA90bKOTO7Ouix5a4hKTQN2i+Khs+HtpnzEJAoK+s i56saAcAIVMw4dEJvPD5FUqG5gW8gZNlQODAAI+zRXcUwWVUAhO+p/YG8PkqH1+3zcSY 7ztqhkfRvMf8XG3gszBURFf6qBgrUyj5+UaroeJQMVGFtjQW0w7StAkgrEE1VebrY9kr 14bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="l+E/4mGv"; 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 c8-20020aa78c08000000b005a9abc063e3si1376981pfd.113.2023.02.16.10.23.44; Thu, 16 Feb 2023 10:23:57 -0800 (PST) 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="l+E/4mGv"; 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 S230257AbjBPSXL (ORCPT + 99 others); Thu, 16 Feb 2023 13:23:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbjBPSWc (ORCPT ); Thu, 16 Feb 2023 13:22:32 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5604050368 for ; Thu, 16 Feb 2023 10:22:02 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id cp18so516514pjb.0 for ; Thu, 16 Feb 2023 10:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=8+mNmph7z+0hgeAPhfRjYNKRnC89i/LR46jyYpJ0Apo=; b=l+E/4mGvkIJFMOx3vpketHl6w+OVgKH1DxDQBosv+JiXnn3EnFIE5kJx5+YzS6lLiS 0rYHRmZl+afg6HhbnviJ+eKMj5yIjob50D2ExCAbohUNkrRvegMgK53TL+DatL6okNB1 f+4FlaxZq63X6ZwMSDhpiwE6X2KLXp7s5x+yRBbSxUoHZgSQtI87+UVq0Z2HgJ9Ay/Zd yif3+oeSS9ykcKUaZq3ZNvy7s4zFmSY3VYzDbAcXZ0n7WsSQoMo4LXuYcp5xcp9ruJdm 7QGg+T1xe2cQhLpXyD5XCOSgPN0bqnBE7qZdpVxAexRvSprB2mokXcWga7rVPXqE1fX0 d8Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=8+mNmph7z+0hgeAPhfRjYNKRnC89i/LR46jyYpJ0Apo=; b=DKIFYYPKmGOUmY1TrYXju4ttMH93wsd+YEPUaUjBfzGhwZIyr5OFB9AMDkqD5TOuTr eKd6J0zdgA60Bbc8SGDuVcQTAtHDU7z+QD4L1DQfEaPM1sHnPyx/BBtEHedqnYLq5To0 suVNWx+w6HPiaDenmz7S7eT6j3EjsBohrRhKchr7aL5HeACVGj8ugzzPbSh01LxsjmuD nYxSy1unrOmTh6AWq6jrtltlu5nDiINSEnnWbbXvpDdluItArKjaIU13//N4bfIBwLZn 35Mk3OfLJbciG223hl+CVFb+maZv4XcIgKNDd/6EwPeRemgiUODRTTll/WR76eX6lRL4 rzwg== X-Gm-Message-State: AO0yUKVOyLsb8jOE8n94t2HKT077+n6JZIhbV6F4WcAAXwAcIyNQ2JZD spMobn6kYWEPzMAiFpBKI8pNgA== X-Received: by 2002:a17:90a:1ca:b0:234:106a:34b7 with SMTP id 10-20020a17090a01ca00b00234106a34b7mr7684245pjd.46.1676571719882; Thu, 16 Feb 2023 10:21:59 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.21.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:21:59 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 14/21] irqchip/riscv-intc: Add ACPI support Date: Thu, 16 Feb 2023 23:50:36 +0530 Message-Id: <20230216182043.1946553-15-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758012991227176668?= X-GMAIL-MSGID: =?utf-8?q?1758012991227176668?= Add support for initializing the RISC-V INTC driver on ACPI platforms. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones --- drivers/irqchip/irq-riscv-intc.c | 78 +++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c index f229e3e66387..97a8db0fbc6c 100644 --- a/drivers/irqchip/irq-riscv-intc.c +++ b/drivers/irqchip/irq-riscv-intc.c @@ -6,6 +6,7 @@ */ #define pr_fmt(fmt) "riscv-intc: " fmt +#include #include #include #include @@ -112,6 +113,30 @@ static struct fwnode_handle *riscv_intc_hwnode(void) return intc_domain->fwnode; } +static int __init riscv_intc_init_common(struct fwnode_handle *fn) +{ + int rc; + + intc_domain = irq_domain_create_linear(fn, BITS_PER_LONG, + &riscv_intc_domain_ops, NULL); + if (!intc_domain) { + pr_err("unable to add IRQ domain\n"); + return -ENXIO; + } + + rc = set_handle_irq(&riscv_intc_irq); + if (rc) { + pr_err("failed to set irq handler\n"); + return rc; + } + + riscv_set_intc_hwnode_fn(riscv_intc_hwnode); + + pr_info("%d local interrupts mapped\n", BITS_PER_LONG); + + return 0; +} + static int __init riscv_intc_init(struct device_node *node, struct device_node *parent) { @@ -133,24 +158,53 @@ static int __init riscv_intc_init(struct device_node *node, if (riscv_hartid_to_cpuid(hartid) != smp_processor_id()) return 0; - intc_domain = irq_domain_add_linear(node, BITS_PER_LONG, - &riscv_intc_domain_ops, NULL); - if (!intc_domain) { - pr_err("unable to add IRQ domain\n"); - return -ENXIO; - } - - rc = set_handle_irq(&riscv_intc_irq); + rc = riscv_intc_init_common(of_node_to_fwnode(node)); if (rc) { - pr_err("failed to set irq handler\n"); + pr_err("failed to initialize INTC\n"); return rc; } - riscv_set_intc_hwnode_fn(riscv_intc_hwnode); + return 0; +} - pr_info("%d local interrupts mapped\n", BITS_PER_LONG); +IRQCHIP_DECLARE(riscv, "riscv,cpu-intc", riscv_intc_init); + +#ifdef CONFIG_ACPI + +static int __init +riscv_intc_acpi_init(union acpi_subtable_headers *header, + const unsigned long end) +{ + int rc; + struct fwnode_handle *fn; + struct acpi_madt_rintc *rintc; + + rintc = (struct acpi_madt_rintc *)header; + + /* + * The ACPI MADT will have one INTC for each CPU (or HART) + * so riscv_intc_acpi_init() function will be called once + * for each INTC. We only do INTC initialization + * for the INTC belonging to the boot CPU (or boot HART). + */ + if (riscv_hartid_to_cpuid(rintc->hart_id) != smp_processor_id()) + return 0; + + fn = irq_domain_alloc_named_fwnode("RISCV-INTC"); + if (!fn) { + pr_err("unable to allocate INTC FW node\n"); + return -ENOMEM; + } + + rc = riscv_intc_init_common(fn); + if (rc) { + pr_err("failed to initialize INTC\n"); + return rc; + } return 0; } -IRQCHIP_DECLARE(riscv, "riscv,cpu-intc", riscv_intc_init); +IRQCHIP_ACPI_DECLARE(riscv_intc, ACPI_MADT_TYPE_RINTC, NULL, + ACPI_MADT_RINTC_VERSION_V1, riscv_intc_acpi_init); +#endif From patchwork Thu Feb 16 18:20:37 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: 58196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457440wrn; Thu, 16 Feb 2023 10:24:16 -0800 (PST) X-Google-Smtp-Source: AK7set+orSC4LvDVP0fv9gEK+dj/uJJgDaP4Ll4MAJs3RTXI019Njlo5x050FGHTcF7r/aO1MMfJ X-Received: by 2002:a05:6a20:12d1:b0:be:da1c:df7a with SMTP id v17-20020a056a2012d100b000beda1cdf7amr7551242pzg.40.1676571855953; Thu, 16 Feb 2023 10:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571855; cv=none; d=google.com; s=arc-20160816; b=TMDnEXD99R6HDSP0s4UFn9gGggcTHrw55JbO23RSJNdOcpMnJfsYISNUsDmb1AfDc7 yBI+NJ3ojSmHBUw8YUpRyZM9WUrLispOuv/MMw8vsin7qW9vuVoUqkQ9haWKg0TGZEpx YcRL8nFbYLroxY/OMOO/tU6aPxjWJ8FHS+KOXoHHPJ2yZDEbcnexOLJwl0Gyg6WAUjve rtpzvrCEetpsRSSiIf05hN8Wu32hEkVeZcQB3b+tvX7fVtOK4vz4KwGDJVfzTurAZHjL rjM7seS7KidOndbbkHF1WgVNskU2EoEkzGJrdoImBO1rV6wbMcS72sus00kn72U81YT/ VA5Q== 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=4phaq6quaw8OEd5i/LKAI0eg66LQgH0oflAjuJIR3hM=; b=Xohjxk4TJhRs8MRT228odjjqYjjhxJS7OgDrTzhobW1G6Ak/nGSO8eKWkwjznxiEhN vWRBxcbZXQbu94w9povSD2ATWJyxNLDRpjgr4Yj4f9QricwA0WfKp7r35f6YwqekLhxQ Y8KJHrg3nEk5qDXL2ewkgyBRhmZ1JGPUwvlsv5ClvsTrW5Z4b12mv/Gf1cdUDmvo88C3 7SAspfxpjcE6xXfWGDE68NGitxDcW+RQWx2xcQhStkJxguhejQCwpiLd3Cb1PyCUyAai ZdM/JD/4EugW8266ttcYRxLyZb/CYxQJ6/+K3YNBz7/XdgUZXHBM/Es75psUNtiv63CL wHtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=assdfSn7; 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 d4-20020a633604000000b004fb760561a3si2363033pga.595.2023.02.16.10.24.03; Thu, 16 Feb 2023 10:24:15 -0800 (PST) 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=assdfSn7; 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 S230338AbjBPSXV (ORCPT + 99 others); Thu, 16 Feb 2023 13:23:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230284AbjBPSWe (ORCPT ); Thu, 16 Feb 2023 13:22:34 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F7BE5036E for ; Thu, 16 Feb 2023 10:22:07 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id z14-20020a17090abd8e00b00233bb9d6bdcso2958097pjr.4 for ; Thu, 16 Feb 2023 10:22:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=4phaq6quaw8OEd5i/LKAI0eg66LQgH0oflAjuJIR3hM=; b=assdfSn79vHm0/djewQo2bAQqyjoTdSiGlBucWz/vkwhlh0gcU4AzKvvNGpbvajSzo pyLddLDI91C5MOJAqpvr+uIMgruD0aMCS5ZkzhicFmN14+x8C7nDK2QPkEwxAZY0cHrN njQ2zJIhkyPA0oCk8owapfaEaiAVm/jFqJqZHUtqhNpdOsJj6oyEzlmxzG7BmxRHGnTl 010zIM+wIuONTlBkSYFy/AXiy57JLHaoy1nGIKW/GgvturAOhwh37d7TDfwp1XJZOcol NymKVNVqiyDZoXLOoFLIZsBv8PZxexq/CRxJGVCU0XPdAsT0x8D1+iC3ghJYaXGI5Q0c l0hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4phaq6quaw8OEd5i/LKAI0eg66LQgH0oflAjuJIR3hM=; b=uYcze6KUU1xk3RF0gwDBnz4XLhn5VHHvhY54seNQKYymNc91lRfeGbtWBL9Bofv9ai KaWU9E0GjUOD51OrBNE2jrq0dHDyWaHYt8AK/YM3Nr47/M0ByBvas8EDj7YYwbws7I4I iPha21Bme3k6xH1blD9Xlu23mJYUonVUeefCJQx48lQgkV31Cj0KQqqxelWAgQCNn/9W NQNXYhXuif5d2whfopIZ8aJw/OCvlGIsv+UZOrZZWQNHe2RvcrQZ5dOYpbZp5Mkg6vVt qVEJv2+3NhIMa5Zc/ZjMJumGUq+KFYWEHsTjavI4XMdrf1cSv8VMVFGk6+QHaeJ8baDB cu4w== X-Gm-Message-State: AO0yUKX/JF9kzEehCAQLXzP4f2J5r+YdsYImAJNBlNJgxHLR4lNqXuJE jNNWp9RjDygl6qsMSUwb86yV0w== X-Received: by 2002:a05:6a20:7350:b0:bc:80bd:462d with SMTP id v16-20020a056a20735000b000bc80bd462dmr8512373pzc.46.1676571724598; Thu, 16 Feb 2023 10:22:04 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:22:04 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 15/21] clocksource/timer-riscv: Refactor riscv_timer_init_dt() Date: Thu, 16 Feb 2023 23:50:37 +0530 Message-Id: <20230216182043.1946553-16-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758013010641610560?= X-GMAIL-MSGID: =?utf-8?q?1758013010641610560?= Refactor the timer init function such that few things can be shared by both DT and ACPI based platforms. Co-developed-by: Anup Patel Signed-off-by: Anup Patel Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones --- drivers/clocksource/timer-riscv.c | 82 +++++++++++++++---------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index 1b4b36df5484..2ae8e300d303 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -119,61 +119,28 @@ static irqreturn_t riscv_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static int __init riscv_timer_init_dt(struct device_node *n) +static int __init riscv_timer_init_common(void) { - int cpuid, error; - unsigned long hartid; - struct device_node *child; - struct irq_domain *domain; + int error; + struct irq_domain *domain = NULL; + struct fwnode_handle *intc_fwnode = riscv_get_intc_hwnode(); - error = riscv_of_processor_hartid(n, &hartid); - if (error < 0) { - pr_warn("Not valid hartid for node [%pOF] error = [%lu]\n", - n, hartid); - return error; - } - - cpuid = riscv_hartid_to_cpuid(hartid); - if (cpuid < 0) { - pr_warn("Invalid cpuid for hartid [%lu]\n", hartid); - return cpuid; - } - - if (cpuid != smp_processor_id()) - return 0; - - child = of_find_compatible_node(NULL, NULL, "riscv,timer"); - if (child) { - riscv_timer_cannot_wake_cpu = of_property_read_bool(child, - "riscv,timer-cannot-wake-cpu"); - of_node_put(child); - } - - domain = NULL; - child = of_get_compatible_child(n, "riscv,cpu-intc"); - if (!child) { - pr_err("Failed to find INTC node [%pOF]\n", n); - return -ENODEV; - } - domain = irq_find_host(child); - of_node_put(child); + domain = irq_find_matching_fwnode(intc_fwnode, DOMAIN_BUS_ANY); if (!domain) { - pr_err("Failed to find IRQ domain for node [%pOF]\n", n); + pr_err("Failed to find irq_domain for INTC node [%pfwP]\n", + intc_fwnode); return -ENODEV; } riscv_clock_event_irq = irq_create_mapping(domain, RV_IRQ_TIMER); if (!riscv_clock_event_irq) { - pr_err("Failed to map timer interrupt for node [%pOF]\n", n); + pr_err("Failed to map timer interrupt for node [%pfwP]\n", intc_fwnode); return -ENODEV; } - pr_info("%s: Registering clocksource cpuid [%d] hartid [%lu]\n", - __func__, cpuid, hartid); error = clocksource_register_hz(&riscv_clocksource, riscv_timebase); if (error) { - pr_err("RISCV timer register failed [%d] for cpu = [%d]\n", - error, cpuid); + pr_err("RISCV timer registration failed [%d]\n", error); return error; } @@ -202,4 +169,35 @@ static int __init riscv_timer_init_dt(struct device_node *n) return error; } +static int __init riscv_timer_init_dt(struct device_node *n) +{ + int cpuid, error; + unsigned long hartid; + struct device_node *child; + + error = riscv_of_processor_hartid(n, &hartid); + if (error < 0) { + pr_warn("Invalid hartid for node [%pOF] error = [%lu]\n", + n, hartid); + return error; + } + + cpuid = riscv_hartid_to_cpuid(hartid); + if (cpuid < 0) { + pr_warn("Invalid cpuid for hartid [%lu]\n", hartid); + return cpuid; + } + + if (cpuid != smp_processor_id()) + return 0; + + child = of_find_compatible_node(NULL, NULL, "riscv,timer"); + if (child) { + riscv_timer_cannot_wake_cpu = of_property_read_bool(child, + "riscv,timer-cannot-wake-cpu"); + of_node_put(child); + } + return riscv_timer_init_common(); +} + TIMER_OF_DECLARE(riscv_timer, "riscv", riscv_timer_init_dt); From patchwork Thu Feb 16 18:20:38 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: 58197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457452wrn; Thu, 16 Feb 2023 10:24:19 -0800 (PST) X-Google-Smtp-Source: AK7set/9xn2RonEHp2Z5nfljih/bmau9Wl8mjGOodUI6pX17AN7G4eWSMk87P3+WWl7tKdXvYOXV X-Received: by 2002:a17:902:e545:b0:19a:b427:232d with SMTP id n5-20020a170902e54500b0019ab427232dmr8788601plf.45.1676571859416; Thu, 16 Feb 2023 10:24:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571859; cv=none; d=google.com; s=arc-20160816; b=pieMk3MQNzgo221Ezvw5ILitlXoqmeIsEz2AxG4Bww1Z3gV0sCv5IxCUTYDOS84O10 H8b8QZSGcZyDWwbnisnYhzr5DPnjw5Kh1BSPJMBXiQ3kE+XrKpSoIqUP//XHOu+Diaud JkQPnEw+XGqEF2A3m4+DaNvqjk3DQBzYVvJZTppB9cH4B/G7YB+Uci6Pvh2Zra+66cKf XrgVtvIRyukSqjn9ALjYp7DEWJB+9Lpu5BwQIF3h5ThzHifZMMLqw/HQKfkwrC9bKwS9 f6BrFoggzTYR4bF8i4C8IMX3uuQKVYPyWmTogK4J3eovyUm1WPXzH2fi0kzUn9kUx9hx ORwA== 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=vv/SJn971dfjdTrZfssRImVac3G99NBb7ONmt1Vsq2I=; b=xoauhEy/HAFgFvSQeS8HmQomOK/+95wkk4dN88wwA4t6io7eiwDZTEafEbFdxV/RIS dMEZlCbhpqUyFUdBXQBiOW/4TPiNBqAxwTWhwd4NYGFoO38jR4XKt7RbFJf6Y9LeoX2Q StZGRfHd4QqGY41RAQbn+meAY5R4NeE9QH6FueF0G7DeetbRjHWo6t5vxgQo+FKlZtIq qRF9B0l9XcByM7hFsM404AbUktrB0OKBCZd24ALVdJJPWuSEZXxyQ5Pejo7eOQfSf+2e sev87t4MeFpjiOTbBW3Me0MEuo5+4jv411kO+fE9hFGG1VMQvQSUPyGPFaFuZDfxIL80 g4Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=myJLNPbR; 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 u14-20020a17090341ce00b0019909c2569dsi2137568ple.528.2023.02.16.10.24.07; Thu, 16 Feb 2023 10:24:19 -0800 (PST) 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=myJLNPbR; 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 S230256AbjBPSX1 (ORCPT + 99 others); Thu, 16 Feb 2023 13:23:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230300AbjBPSWk (ORCPT ); Thu, 16 Feb 2023 13:22:40 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 099A55037C for ; Thu, 16 Feb 2023 10:22:14 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id pg6-20020a17090b1e0600b002349579949aso2563058pjb.5 for ; Thu, 16 Feb 2023 10:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=vv/SJn971dfjdTrZfssRImVac3G99NBb7ONmt1Vsq2I=; b=myJLNPbRJLi/wYDYC+up98t51CDSvleQNl+jgG0GytS3WhARAlv6QffJ1MZuDRuhyU 8nx+Iqk3/0KdzmA3KZj7nwInkmfGs4j8tDN+L8Vu+X478ausemy9Wu5+S7F96/g0/aP4 6SJcqu0eqxByONPkPg6XnsFYBAkhdoWdSfHoNJetFsAg24XKyXXc6ALuunxuhMjGApeS 3RJQ1bIyZZJRcBM/v640JXSPpA8mjzq5s2a72ChX7W0uTYD2fOAIchRGYp/4yOEjIl5D tDnC5SXkZ9P0rYtWqNgSCJ5fpvmDvMwd9aOziTUVR0hXElPSBVuov+zz6/eecwNO7wHJ xDmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vv/SJn971dfjdTrZfssRImVac3G99NBb7ONmt1Vsq2I=; b=AKlht4ssptjB88chfBl/l5Ab3B7q/QYGN8yoAQAVnPEGLA/ADZVNi02zalRIPZzdHV B+aAEz9YxzxRXtJUMGn8oc7NbVYbket/bYSvR/iZ4YQ2oO/d/hr/sjINpj+sQ+fW9adn QPupPDcHenY5El+lUnhL9vOVliyQh24Pkq0qciMzpPmb1bE8qnVh96R9MEyek1sWD3aR 2Ed2FI3tUI/fyIjInXK+fH4ByCed4ycwOs2JlWJgcIxjypwnwjo8aQlQ7ldN8V+jGGz8 Xi37taWVL1txeLKsGZhsrXxccq59Gpan2wbdZzOTNrlE+zjxx5oXCm10V/1OXw30m0+v yPng== X-Gm-Message-State: AO0yUKWk85TMG6OnqdtGe/qoECCK7FXhhH4iZAV/uITYwCGGIuXH833c ANxKLlEheAj5Cr06ny4cg6Tlug== X-Received: by 2002:a05:6a21:338c:b0:bc:b1ec:89f3 with SMTP id yy12-20020a056a21338c00b000bcb1ec89f3mr7638758pzb.50.1676571729309; Thu, 16 Feb 2023 10:22:09 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:22:08 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 16/21] clocksource/timer-riscv: Add ACPI support Date: Thu, 16 Feb 2023 23:50:38 +0530 Message-Id: <20230216182043.1946553-17-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758013013989447056?= X-GMAIL-MSGID: =?utf-8?q?1758013013989447056?= Initialize the timer driver based on RHCT table on ACPI based platforms. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones --- 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 2ae8e300d303..5fb0eac52bdd 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 @@ -201,3 +202,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 From patchwork Thu Feb 16 18:20:39 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: 58199 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457483wrn; Thu, 16 Feb 2023 10:24:25 -0800 (PST) X-Google-Smtp-Source: AK7set8zzi5nH8jQ1Bn9GwezQKrpwNqGrUfoKnFjGwj/vtrP1TbU3Lt+kZ/CeElk5l/e+lc+muM7 X-Received: by 2002:a05:6a00:2388:b0:594:1f1c:3d2f with SMTP id f8-20020a056a00238800b005941f1c3d2fmr3473193pfc.4.1676571865036; Thu, 16 Feb 2023 10:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571865; cv=none; d=google.com; s=arc-20160816; b=XCpRxMRVWfFkYeOBohtZ4LXeNMiVIuhsewSwBF6xNhuJgD+iTbbVVyK7+5qU85Gju9 P/Ggw07PShNmdjLkjNCrgWnxAasQPEfBBpuSGLpislQyOXXL9iYZsLauQLfyVDcK8paw ZFwZaR2xlSFICGhTtLtfACWW5y73wG5JGUwJRhMfoSefSBo4WhB2acC8wgrCzU+9xgS9 drhqGCiolmtdW6XQsVZm1A2eHARdYbeevLVVeYlJ4jaFVoNZLJfrkionhNKu2gm4P2Xn 2YKSFHoEq1ZmSNAmRwuFrBEvdAlt/Wt20Om+ujZDL7cF5gpwpFHE9fzFCGFjMUKlUYV4 xIXg== 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=JjXwYmjlb4qLXAQKk4p+crKVMVgfMLiURDuGCOAQBXo=; b=Tkh2dMY0mPG0Q2y1eZmUhpDxC5MESgTnLPEUrASlJFVhoog1YWaLqOM4JLkmnmrKwE GLcOHNT7wDTMsI4aoTk9bWNVPC0bZztOsusQbBtHvr7A4iAvas/WY20958cHi9egK1hP UG81oZCMiSFqr3WxwaeiUhvyodbALymoseVc1Q6QV80vm4uBcJ2GQvras8NK9fXoY8eF EvQjYXPHS6j30ZrBHdE5Rh34leINwiDp+yrmKSxG0jqAWPi047HYb/vT6cTJqGj7RkF3 Xq9hUuBxSBtA2R7mesRW6Ta3w8jWEW9nZKOeVrm9n+tItkEORovOIsIQPyT8SW0Q3adB SmLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=V1EWcSn7; 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 204-20020a6216d5000000b005a8e0855ae6si2102432pfw.179.2023.02.16.10.24.10; Thu, 16 Feb 2023 10:24:25 -0800 (PST) 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=V1EWcSn7; 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 S229640AbjBPSXj (ORCPT + 99 others); Thu, 16 Feb 2023 13:23:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbjBPSWz (ORCPT ); Thu, 16 Feb 2023 13:22:55 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 917B046144 for ; Thu, 16 Feb 2023 10:22:18 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id o8so2909097pls.11 for ; Thu, 16 Feb 2023 10:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=JjXwYmjlb4qLXAQKk4p+crKVMVgfMLiURDuGCOAQBXo=; b=V1EWcSn7s/zB5yoo0RZlAv/kS8CPk7pGWmyW8MmvfWwyIqESMo1MjwuqWg/GrXiycT IRlhq2vH4TRPjqX7MhEUvuxf2HAMFxTno3nTwzqLN7Hys2vkxT4VnLIRWoCjpgFE0OGJ eZNi5pce+I9VZkznd7sJnnhv14NvLcNNVkclgh3iyop6uIXFFD2lUYXuJWfNeZ2TEHfF lCb0ifNzr28mTfFrREt2B20mnaE0wHeFTC18v0zervqlQypET2v2Y6LCXohFYiPAjlyX CjBcMaogRlRp7aF3LrWJxWmuaT3vZhVsKyUcOAkehGm6q4i6NVgluPC6KGFe+nedMJnn 9I5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JjXwYmjlb4qLXAQKk4p+crKVMVgfMLiURDuGCOAQBXo=; b=uccisDOoFWE/LGhzBppwr2cJJVSPLLqrOA3tqCYCA0y/p5IwC1QYf+e36nx1PM7tmQ e9Wox3Pq8+F3RyG7hswfFJLEt1Oq5mD6Etz23TK36sAqozIvrxkdHtd7UQ9gLiVZdvUQ bsuZe1L7j+P4mRRygwqu3FtT+526Y9spzdG3qPnnXQFyT1ld6fCeBZb4fZdSub/vYIvw UwILcfJb8s4kYPjagIXPgH83SrXCnf7UjvOwXNbNe24INZli9+9NJ1znzH4ba5y2847g 1aXHg02D1TwGb0RLUqs4JCurWjOoZNlAdGKtbpbu9OOSIffYQkmsWu/vw5p+BuZA9TCW ex+Q== X-Gm-Message-State: AO0yUKWft0OQQRSbStPYZ61HpnF5qavS9dPz47kn/4Nxd406/iX3ZjyT BV/pdG0RodMXtgihHl5O/AeSig== X-Received: by 2002:a17:90b:3852:b0:234:7ccf:3c7c with SMTP id nl18-20020a17090b385200b002347ccf3c7cmr3048070pjb.9.1676571733991; Thu, 16 Feb 2023 10:22:13 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:22:13 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 17/21] RISC-V: time.c: Add ACPI support for time_init() Date: Thu, 16 Feb 2023 23:50:39 +0530 Message-Id: <20230216182043.1946553-18-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758013019513835245?= X-GMAIL-MSGID: =?utf-8?q?1758013019513835245?= On ACPI based platforms, timer related information is available in RHCT. Add ACPI based probe support to the timer initialization. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones --- arch/riscv/kernel/time.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c index 1cf21db4fcc7..e49b897fc657 100644 --- a/arch/riscv/kernel/time.c +++ b/arch/riscv/kernel/time.c @@ -4,6 +4,7 @@ * Copyright (C) 2017 SiFive */ +#include #include #include #include @@ -18,17 +19,29 @@ EXPORT_SYMBOL_GPL(riscv_timebase); void __init time_init(void) { struct device_node *cpu; + struct acpi_table_rhct *rhct; + acpi_status status; u32 prop; - cpu = of_find_node_by_path("/cpus"); - if (!cpu || of_property_read_u32(cpu, "timebase-frequency", &prop)) - panic(KERN_WARNING "RISC-V system with no 'timebase-frequency' in DTS\n"); - of_node_put(cpu); - riscv_timebase = prop; + if (acpi_disabled) { + cpu = of_find_node_by_path("/cpus"); + if (!cpu || of_property_read_u32(cpu, "timebase-frequency", &prop)) + panic("RISC-V system with no 'timebase-frequency' in DTS\n"); + of_node_put(cpu); + riscv_timebase = prop; + } else { + status = acpi_get_table(ACPI_SIG_RHCT, 0, (struct acpi_table_header **)&rhct); + if (ACPI_FAILURE(status)) + panic("RISC-V ACPI system with no RHCT table\n"); + riscv_timebase = rhct->time_base_freq; + acpi_put_table((struct acpi_table_header *)rhct); + } lpj_fine = riscv_timebase / HZ; - of_clk_init(NULL); + if (acpi_disabled) + of_clk_init(NULL); + timer_probe(); tick_setup_hrtimer_broadcast(); From patchwork Thu Feb 16 18:20:40 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: 58200 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457541wrn; Thu, 16 Feb 2023 10:24:34 -0800 (PST) X-Google-Smtp-Source: AK7set9qun/ytF6MjNYE8A8lPViPHlq1jq/SfJ5wftRBzfjkkMNAFo8w4GA5TWNzjijmQR1wjYd/ X-Received: by 2002:a17:903:2291:b0:19b:33c0:4097 with SMTP id b17-20020a170903229100b0019b33c04097mr288058plh.27.1676571874050; Thu, 16 Feb 2023 10:24:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571874; cv=none; d=google.com; s=arc-20160816; b=jC72xCaI4M6Ag5/3iLxvO2KoFcCOMm9SuG6+ptE3SjzeAC0PMQiruiIVzwmAPtb2/7 kVwvrc4Q84CBE9W2dxtQBJRt8RKcUiqU67rFPfjOAj/tFOF5fC9yOVaizXf8yA97BDX5 JyEZbQqMWOZURUG5QB9MPpjRFeHwEC1c9DyQbuxt4KM80lziR3kZQAqOE9U8Ka5HxLBz Ufh7+BkzzbHKY9PZNzwSQ0sNv6g3mtif1Uxf9Czh5W7O5N39Yn+OSocIE+n1bPEPCe6N 0J9GbYXTn7iX3mFU1UhPEdCJZe3JfItlDh2KkUAe8Gr5VBDKseFk5DZq4cih8K/7huyY Jnzw== 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=6k9kFgHhGrniFtz38iNTmjHDIue+Ed5Mfkw3G0DBXLc=; b=eBYVP3x8ESmWKT/9xlill25Vr43vYsg6PGBW844VtyjUYsV3w7973PwsDeBrRH8usV qLGWj9WzLtPa4bic8n8P/g95EHHfUVyJqak/c2gEir9sz6jhf4UoTvF6gF8ehl7oT++X Z7z8SxqFG0jIhvi3qzQQ4VOa6c32x0ZgE/dF1vS0gjsodpLHfVC2JPPqhu8TZkT5sqkH WcPk++g9vY7/2TKAX3mzZkooIhMNZwci6VOSR6bUaaRvMd22NfCPKpbUN+qOf+HfDSZ1 vnToVta65OoEjZPBErZiAl3sqzhiphq2PbqitcRET1n/P4TnXctvZhW/sQlIpqVs/KRh qohw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=kK5aVj5X; 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 b130-20020a633488000000b00478c967a84esi2457491pga.748.2023.02.16.10.24.20; Thu, 16 Feb 2023 10:24:34 -0800 (PST) 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=kK5aVj5X; 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 S230405AbjBPSXn (ORCPT + 99 others); Thu, 16 Feb 2023 13:23:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbjBPSW4 (ORCPT ); Thu, 16 Feb 2023 13:22:56 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79A6359B5F for ; Thu, 16 Feb 2023 10:22:21 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id cp18so517224pjb.0 for ; Thu, 16 Feb 2023 10:22:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=6k9kFgHhGrniFtz38iNTmjHDIue+Ed5Mfkw3G0DBXLc=; b=kK5aVj5XXgADplAjlm4YI2+at0WD39rzqE/oIyTucqgfAxPxz7s7VY0dLKzFQG5tS9 ohX9Fg8TbtfoL8ktTHsnWOfizVCmB8RTZWvbpQ3KV+LgYLfvrtpdXcpHf793sUDvzNMg lrBMnAjwcfhd9iQm5CeiEPB3lza3dy4hn9W8Tsx6uN7FO+cuhc1xO65+BQY6JS50/PmX ak8JWUQbkP69ZNG5odZ2HxxwPL4oirSxHRqb9SJ1QeT06nvilKmAjBuqESK7HvhO7Oss K77HkI2Oy23RBT+GMy9TTpF9xWGTHgx/4UNeOUZ28D/80kgEFkadRcIz47s4KDKFKP6k svHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=6k9kFgHhGrniFtz38iNTmjHDIue+Ed5Mfkw3G0DBXLc=; b=ZtCXs7Sk+sJvTJDz6jcrkEesWJRPF05o5LU+0QSIudpp/uoHoPqra30An99ts2xQc2 Nrx39fg7F3Wi8IsL8LwNSLdyBo1t/f0LnJE1WQihUXxQcV+SxypXBl+OngvZYqn9ZfR0 gEJUB7ohH4/vanyZexx/WBqYrjQFl2dnlV7+qSDNPx5FaO0taCQ/NZi4+aIjQ9+7J/0D pqhBfSrk0lwY99lYwYewQ/K9kuuItQ9r+4l/vzr6oFqN5J6DhQHNZAE4f9lVvw7mH3cf 2+wo+Cj82Z4ORF3hm1yGzP/oCM1kUqqaFAb6k4hAh71TF6sz2UbJGFKp1CVWRL9132l9 wftQ== X-Gm-Message-State: AO0yUKX/i4C3lgI5zkwPUeWIi6S6aeP9cdmIryppCzRPE6shca3TWdbo quftqZ7fr4uDTOmU9PGUkV0O4g== X-Received: by 2002:a05:6a20:8f04:b0:bf:73d:485e with SMTP id b4-20020a056a208f0400b000bf073d485emr7842207pzk.54.1676571738700; Thu, 16 Feb 2023 10:22:18 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:22:18 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 18/21] RISC-V: Add ACPI initialization in setup_arch() Date: Thu, 16 Feb 2023 23:50:40 +0530 Message-Id: <20230216182043.1946553-19-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758013029476726901?= X-GMAIL-MSGID: =?utf-8?q?1758013029476726901?= Initialize the ACPI core for RISC-V during boot. ACPI tables and interpreter are initialized based on the information passed from the firmware and the value of the kernel parameter 'acpi'. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones --- arch/riscv/kernel/acpi.c | 113 ++++++++++++++++++++++++++++++++++++++ arch/riscv/kernel/setup.c | 25 ++++++--- 2 files changed, 130 insertions(+), 8 deletions(-) diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c index 13b26c87c136..35e7b24a30c8 100644 --- a/arch/riscv/kernel/acpi.c +++ b/arch/riscv/kernel/acpi.c @@ -16,6 +16,7 @@ #include #include #include +#include int acpi_noirq = 1; /* skip ACPI IRQ initialization */ int acpi_disabled = 1; @@ -26,6 +27,118 @@ EXPORT_SYMBOL(acpi_pci_disabled); static unsigned int intc_count; static struct acpi_madt_rintc cpu_madt_rintc[NR_CPUS]; +static bool param_acpi_off __initdata; +static bool param_acpi_on __initdata; +static bool param_acpi_force __initdata; + +static int __init parse_acpi(char *arg) +{ + if (!arg) + return -EINVAL; + + /* "acpi=off" disables both ACPI table parsing and interpreter */ + if (strcmp(arg, "off") == 0) + param_acpi_off = true; + else if (strcmp(arg, "on") == 0) /* prefer ACPI over DT */ + param_acpi_on = true; + else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */ + param_acpi_force = true; + else + return -EINVAL; /* Core will print when we return error */ + + return 0; +} +early_param("acpi", parse_acpi); + +/* + * acpi_fadt_sanity_check() - Check FADT presence and carry out sanity + * checks on it + * + * Return 0 on success, <0 on failure + */ +static int __init acpi_fadt_sanity_check(void) +{ + struct acpi_table_header *table; + struct acpi_table_fadt *fadt; + acpi_status status; + int ret = 0; + + /* + * FADT is required on riscv; retrieve it to check its presence + * and carry out revision and ACPI HW reduced compliancy tests + */ + status = acpi_get_table(ACPI_SIG_FADT, 0, &table); + if (ACPI_FAILURE(status)) { + const char *msg = acpi_format_exception(status); + + pr_err("Failed to get FADT table, %s\n", msg); + return -ENODEV; + } + + fadt = (struct acpi_table_fadt *)table; + + if (!(fadt->flags & ACPI_FADT_HW_REDUCED)) { + pr_err("FADT not ACPI hardware reduced compliant\n"); + ret = -EINVAL; + } + + /* + * acpi_get_table() creates FADT table mapping that + * should be released after parsing and before resuming boot + */ + acpi_put_table(table); + return ret; +} + +/* + * acpi_boot_table_init() called from setup_arch(), always. + * 1. find RSDP and get its address, and then find XSDT + * 2. extract all tables and checksums them all + * 3. check ACPI FADT HW reduced flag + * + * We can parse ACPI boot-time tables such as MADT after + * this function is called. + * + * On return ACPI is enabled if either: + * + * - ACPI tables are initialized and sanity checks passed + * - acpi=force was passed in the command line and ACPI was not disabled + * explicitly through acpi=off command line parameter + * + * ACPI is disabled on function return otherwise + */ +void __init acpi_boot_table_init(void) +{ + /* + * Enable ACPI instead of device tree unless + * - ACPI has been disabled explicitly (acpi=off), or + * - firmware has not populated ACPI ptr in EFI system table + * and ACPI has not been [force] enabled (acpi=on|force) + */ + if (param_acpi_off || + (!param_acpi_on && !param_acpi_force && + efi.acpi20 == EFI_INVALID_TABLE_ADDR)) + return; + + /* + * ACPI is disabled at this point. Enable it in order to parse + * the ACPI tables and carry out sanity checks + */ + enable_acpi(); + + /* + * If ACPI tables are initialized and FADT sanity checks passed, + * leave ACPI enabled and carry on booting; otherwise disable ACPI + * on initialization error. + * If acpi=force was passed on the command line it forces ACPI + * to be enabled even if its initialization failed. + */ + if (acpi_table_init() || acpi_fadt_sanity_check()) { + pr_err("Failed to init ACPI tables\n"); + if (!param_acpi_force) + disable_acpi(); + } +} static int acpi_parse_madt_rintc(union acpi_subtable_headers *header, const unsigned long end) { diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 4335f08ffaf2..c2ee7f4427a1 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -8,6 +8,7 @@ * Nick Kossifidis */ +#include #include #include #include @@ -276,14 +277,22 @@ void __init setup_arch(char **cmdline_p) efi_init(); paging_init(); -#if IS_ENABLED(CONFIG_BUILTIN_DTB) - unflatten_and_copy_device_tree(); -#else - if (early_init_dt_verify(__va(XIP_FIXUP(dtb_early_pa)))) - unflatten_device_tree(); - else - pr_err("No DTB found in kernel mappings\n"); -#endif + + /* Parse the ACPI tables for possible boot-time configuration */ + acpi_boot_table_init(); + if (acpi_disabled) { + if (IS_ENABLED(CONFIG_BUILTIN_DTB)) { + unflatten_and_copy_device_tree(); + } else { + if (early_init_dt_verify(__va(XIP_FIXUP(dtb_early_pa)))) + unflatten_device_tree(); + else + pr_err("No DTB found in kernel mappings\n"); + } + } else { + early_init_dt_verify(__va(XIP_FIXUP(dtb_early_pa))); + } + early_init_fdt_scan_reserved_mem(); misc_mem_init(); From patchwork Thu Feb 16 18:20:41 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: 58201 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp457898wrn; Thu, 16 Feb 2023 10:25:16 -0800 (PST) X-Google-Smtp-Source: AK7set+Istm0oEsw5t12agkg/xiyedLaZhFg0p1ylWSS2QK9KJY44HwXE5HcYb/oKpxcVed3XVqb X-Received: by 2002:a05:6402:b19:b0:4ac:b559:4730 with SMTP id bm25-20020a0564020b1900b004acb5594730mr6600654edb.25.1676571916434; Thu, 16 Feb 2023 10:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571916; cv=none; d=google.com; s=arc-20160816; b=j4MHPZPQKuILAsJ17Qb6uwpAwiVnwr3uomC+Zj5y8uFHMFnJU+Wj7vqD6uZSEWkqWI yOuHtn/6yH3LG1kkLLdqy4U/t+Ex4YoFb5/6bgFZc/rj3U1twLi/EEIfMP/cb+4h2oUH uinw9nsmKIV+ES7kZdWUUQ3607QbMczai3OnXLK7bkfKguVG5A7zB72qbDe0tiemb3NA KmbVc2c9W0DLZ8A0jOWnxWn/Q/V8qYMfvDhKF3zl1ZCDzE5VsSvteNLNqnJrVOhnRdSL ix3CudUN12atlFeRPE50qOpJmJLU3gbJ4OhSVo5G9FeYDC6q0C4yQtkSYR/ZTDQ/DONS xOJg== 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=6w2bEiZ6pur5iCJunBAbzO2Rizq6VDyDF+3QNnzo8W4=; b=BEon5u1pDZy3YC3+h4WoPmhIGMj18oSilZsuL+dW4gWNaiBYXgktLdKTfZaeFQ21Ka EWBiKKSa2NSrPNfqsTdcw4TWgtwmyZXA8YZSSqyKdfgVrziydzmD4VVrnrutBYv7Ibm0 5XQpXLRl19TP5w7tjjbkiFcOmhm9Q+IP1mA9RVo+MEtLq5bSz0x0T6N3/KwTrHIllmEG EXwXusugDnyWl3k9PGFzzkHDlwFaSF379E3UPCBbjVQ6R69vvWQBOV69cAomKTejuhi+ jhMabr7UMNtUmvIJSV5YM38+aQOOP0+AwPGrdfyJmqEX37jdAcZEtIRG/B8L8FfWgxrf rIUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="l+Os/mGF"; 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 q1-20020aa7d441000000b004aac545e7fesi2816672edr.174.2023.02.16.10.24.53; Thu, 16 Feb 2023 10:25:16 -0800 (PST) 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="l+Os/mGF"; 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 S229667AbjBPSXp (ORCPT + 99 others); Thu, 16 Feb 2023 13:23:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbjBPSXE (ORCPT ); Thu, 16 Feb 2023 13:23:04 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D190A85F47 for ; Thu, 16 Feb 2023 10:22:23 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id gd1so2739964pjb.1 for ; Thu, 16 Feb 2023 10:22:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=6w2bEiZ6pur5iCJunBAbzO2Rizq6VDyDF+3QNnzo8W4=; b=l+Os/mGF5YrQc2akg1w1/Es5B6/JyAn8aMu4QNlpR0eLtL5rBvzBv3N+L4c4RAn3e2 NWNQNJpm0yKXy2rpw8YXGRC9gfaABRTsrNzT+6q9AHftHO6EqPvXXlSHVqvE8MtnkG85 bkEslI8Ab9s0kLn040AFK2BWrECBEs0qEbPrv3vIrmvB5unRFZw2u0Xmp3oQ1YiYuy6l QKR0UKd+kZ/ZLd2MHjaHuhKZOfw+RDFIMRDmKg0/OU6e4Fd/uRFx6uWrpRekjAgwbbyv S89p0dZYt/HbQdps6oczHvziFLZv8Bt1VvD3m/LjDuwwTgBZm5zAel2igXlkA6trDU69 cioQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=6w2bEiZ6pur5iCJunBAbzO2Rizq6VDyDF+3QNnzo8W4=; b=ONfen58CUBpDe3vSWG8iA0/eHR/KbHIDfWNd5/s2PVi8leCqnz/IRlnQBOILv/HCzU v36qCB+l0BHRSw0GvJc+DUBqUf9QjllBLe/UReqo4yYAN/S558Fs9gLpdm4RJRrM01HZ E+/nO7dIwtBUaYH3slugx9XGkcF3wkHMmSD6Rm8DCzF3sT6XMUCQFUKii5uN7H6ywmm3 T/FT3KqKZy0miwOsAUfDp4z7qttjYv+7y/stqHKd6H7slxdRVz89lozsfSVhkEI6tRdU 93fwwnZ/jOYKwBibb2VmINlLEf3G7W9npw5Q7pah7KSU4q8Uh4iKvsJVWKX74b3woAeV 3exA== X-Gm-Message-State: AO0yUKUxMuc722O2EsGaQPhhZLvDnXo6L6e3XgvEsDFwWiXbZKJTEGr3 ZvQkWlooGcHcMGo9/KPBje6qNQ== X-Received: by 2002:a05:6a20:c5a9:b0:c6:d84a:ce1c with SMTP id gn41-20020a056a20c5a900b000c6d84ace1cmr4929180pzb.35.1676571743596; Thu, 16 Feb 2023 10:22:23 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:22:23 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 19/21] RISC-V: Enable ACPI in defconfig Date: Thu, 16 Feb 2023 23:50:41 +0530 Message-Id: <20230216182043.1946553-20-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758013074088810084?= X-GMAIL-MSGID: =?utf-8?q?1758013074088810084?= Add support to build ACPI subsystem in defconfig. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- arch/riscv/configs/defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig index 128dcf4c0814..f89f79294b34 100644 --- a/arch/riscv/configs/defconfig +++ b/arch/riscv/configs/defconfig @@ -218,3 +218,5 @@ CONFIG_RCU_EQS_DEBUG=y # CONFIG_FTRACE is not set # CONFIG_RUNTIME_TESTING_MENU is not set CONFIG_MEMTEST=y +CONFIG_ACPI=y +# CONFIG_PCI_QUIRKS is not set From patchwork Thu Feb 16 18:20:42 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: 58202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp458360wrn; Thu, 16 Feb 2023 10:26:13 -0800 (PST) X-Google-Smtp-Source: AK7set+N0SfqHQ76kBT13NWB49aswbDyybFk0bu5dCUVPSYa1grd8bCGvLYzPQMBbUM7RHdTuJN/ X-Received: by 2002:a17:903:28c4:b0:19a:abb0:1e with SMTP id kv4-20020a17090328c400b0019aabb0001emr5324575plb.38.1676571973110; Thu, 16 Feb 2023 10:26:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676571973; cv=none; d=google.com; s=arc-20160816; b=Twi0kL4iZnerr85mHdKN4LKFpobk11m5VKekqbcbGZOjexfj68Yg0y+9+Aud2pquPK 04t1noUrwLwSvNwCgVsHp1ecUHqOnJq7nJNM4KBV8xwIuz6JKp4GhrCaE/Zg2GnUOJxo 9iXY3gdMsOx1rC/oSFXyZXVc43omDtjfmkJsoXFKiVX8ZemBU9b5bwtlIHKMZsk1HBpO Ct1vyWahx6kCnDMvVUw4JLX6hioGlwpJyk0H4rtn/qY0e/z9yOdLB8/MhUSLzZ3NOzwR ZB8IxWic47ap7FYbJiYzCSQys0Ht5Bos3bedD94Vtf9eD1frEvUFvtisYW5GpR73yH/D 5auQ== 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=k6uh9i4Yg2UK+dtGNl63Dd2v2b9w/htIfSHYIG3sIgo=; b=mTn9k8wi+DAOSzNsArYPnR6UpMBG2UFgl2DqhIintpYzVmvBiIFN/eXJymwByMEtkw qNC+CMcN3yCgUraOvc2FYoJC5TTuP6KjQSAj1l9iW2foq07WeQSdLIaRf4DqcrSPAkJQ w6flDMN6K7O52rqeAGZcbiST5c6v3SQvv4dsevIT39M2vgMxdmLj8JV+qZ+dKT5twnBF CUk+OOWDU0qRJrTv4VIlVnHlTTddKE+FtwGswHieGADYhrYhR+ECYypFsOCoz6CJDMuY A4onB/8J4tqQBEpkyRn6K96R9TATK/8kwOgOgMgkaeKQ0OtT4S6hY3pT1LYMOnURMlJ/ fy4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=mVXuI8tX; 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 je1-20020a170903264100b0019b0da81cebsi618617plb.107.2023.02.16.10.25.59; Thu, 16 Feb 2023 10:26:13 -0800 (PST) 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=mVXuI8tX; 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 S230170AbjBPSXu (ORCPT + 99 others); Thu, 16 Feb 2023 13:23:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230380AbjBPSXH (ORCPT ); Thu, 16 Feb 2023 13:23:07 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CE3C50AF2 for ; Thu, 16 Feb 2023 10:22:30 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id z14-20020a17090abd8e00b00233bb9d6bdcso2959047pjr.4 for ; Thu, 16 Feb 2023 10:22:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=k6uh9i4Yg2UK+dtGNl63Dd2v2b9w/htIfSHYIG3sIgo=; b=mVXuI8tX22NJDu6yVW/g1R+u+kgg7UXHeVhfNyF0TbYKOj0ZLb3xWMXyv+ME0Gy0rG tVCkdPYlWPmzvGBICTXFxxMRlSS8pK/B2pxXGD9Sc36/petkDWVVq6qQSlCJSPy1sEg4 6AEhM/RTUff4Vh1y1IE6JfJ8iJDn39isEDMJI5giDQ4EWkEQRw9J6xFOwqvn4VmXNGM+ Ws+txz0rVy1NiDnjoPhdWs8J1x1YM1/HGFFOzizB5CJuJMkMuD6f2JS8IUgzj1T42PEs u7s3Js0bFqORE8smkyQu+P363zbCeyeYdVQRhTHs9bfJBw+/SiFAtZAR2SXhVgOjav4v YBsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=k6uh9i4Yg2UK+dtGNl63Dd2v2b9w/htIfSHYIG3sIgo=; b=mXQauJfs+0khAU468/g1edfeA8LEg79FMQxt2buIzUOHbX9BhB9RYuAkZh6byadBfi 73bS7PMwfmYlvYwbfI3RB2HP3CK5MKrZKlLuD8/Qw+2PTnnlonXFOhxL6onMuXeZdhMI Yn0W1xBjAsUkpUSjULSBhA4XOhjn5ENzOqiMKbo4MbJlHeLmUNNkeF/qAn+Y0vqBhp+b VXTDVGGqrnS/6GczpNKJx/Pu+n6mToGmTu2l+bpCUXUzBjfbdo9EJP3d7pw+ufKfTnPe ZjejVrUdsTbpWirYRl5PZ1j4f8PPUwQ8IxxTrTeMEP2ZSXW8VV2QOBu2Y76KUXyEi7CY EVfQ== X-Gm-Message-State: AO0yUKWdbVWDOOzFTFceFT50lOAR6EGgYzYEzFG5Nqo+lyznZUI4j3k5 6UOTWGEtsW1YDjnrYjErLGWFzQ== X-Received: by 2002:a17:902:e88d:b0:199:15bb:8316 with SMTP id w13-20020a170902e88d00b0019915bb8316mr8101008plg.68.1676571748298; Thu, 16 Feb 2023 10:22:28 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:22:27 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 20/21] MAINTAINERS: Add entry for drivers/acpi/riscv Date: Thu, 16 Feb 2023 23:50:42 +0530 Message-Id: <20230216182043.1946553-21-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 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?1758013133015774465?= X-GMAIL-MSGID: =?utf-8?q?1758013133015774465?= ACPI defines few RISC-V specific tables which need parsing code added in drivers/acpi/riscv. Add maintainer entries for this newly created folder. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 39ff1a717625..d47212194457 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -450,6 +450,13 @@ S: Orphan F: drivers/platform/x86/wmi.c F: include/uapi/linux/wmi.h +ACPI FOR RISC-V (ACPI/riscv) +M: Sunil V L +L: linux-acpi@vger.kernel.org +L: linux-riscv@lists.infradead.org +S: Maintained +F: drivers/acpi/riscv + ACRN HYPERVISOR SERVICE MODULE M: Fei Li L: acrn-dev@lists.projectacrn.org (subscribers-only) From patchwork Thu Feb 16 18:20:43 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: 58204 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp465021wrn; Thu, 16 Feb 2023 10:40:06 -0800 (PST) X-Google-Smtp-Source: AK7set+cD201pOM2uuuffrT3guxeuCW4OfmO2LNw/V24cc4YtttJLUsbDnr3WyI714zEGLvFVe5j X-Received: by 2002:a17:906:f75b:b0:88c:a43d:81bc with SMTP id jp27-20020a170906f75b00b0088ca43d81bcmr6236639ejb.58.1676572806735; Thu, 16 Feb 2023 10:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676572806; cv=none; d=google.com; s=arc-20160816; b=ZOGxjMtYxpQfqcO3UO+llYhs1UHS6T6/+PYOE09FuKFNVvj+HNh75uNXBwPlnnzVF8 6865NojO5v6BeHxQ4aik9Q8Yxypf/FMybOEXo/PW6NmLYBwPNK/XzmMQc4f1lM1cLcvS d6CMTSYqZLub9l4DfUXiWGO6szEhqbMnETTThX7alcDC0kz9xUwQCnihVbXREPqBwov5 Latt0LBkXSoPRyeTgjpzAZSBY9WSXWIuE3VHvfqCO9BeIl0Ddl4dtiUTRqYr8LSAAitO 4mJUU3TnwkJTyZPG1H3h9bGyN4BEH+KERYJK+x9agz5OBbF8lIjiCpXfKvi7lrqK3F4y 8DEw== 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=Rc+EdRzJ0SRGUPyQRF18IAjDuJpqdPevv1iUeqHNSDY=; b=w8lC2ZKD/EK6jk/f9vrBKPdCR8hDQIfK/AGggSdh1uA7+3zFN82xAIfypPfeb1nfHJ NYZrHWGHfwI5pLotp6yjh2S55pAjCnLOko9/qQJH/jteybhfUHRtQ8zf5wtW9jyo1vC9 e4fLAcMLKfpS/XwtkVfb3Dfbz7Y86R5+vmL9sPPbFayJSSPUXagMljVQxtAONkhVda0I 0J5Djz0G8Bk7UA7/mUdawlVaQHgsAAXDyan2ciRWNLxsHakf33Y/LIUE7JL4mAZZ1GPe oUiXNMq/Sfk/TLbmuQpSKG1phyar8Jvol8hab9aZOj3yeXh14StmiCXFA+00QEjC48NF AD1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=MT+u6Ji2; 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 29-20020a170906015d00b008b17569ad76si1891422ejh.241.2023.02.16.10.39.43; Thu, 16 Feb 2023 10:40:06 -0800 (PST) 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=MT+u6Ji2; 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 S230260AbjBPSYJ (ORCPT + 99 others); Thu, 16 Feb 2023 13:24:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230304AbjBPSXg (ORCPT ); Thu, 16 Feb 2023 13:23:36 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC20152CDF for ; Thu, 16 Feb 2023 10:22:40 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id m2so2946804plg.4 for ; Thu, 16 Feb 2023 10:22:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; 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=Rc+EdRzJ0SRGUPyQRF18IAjDuJpqdPevv1iUeqHNSDY=; b=MT+u6Ji2DSotNL/3ZJ31+4cfLb/HUgIEAzHyb/4A3W3hXKL7CuBMT7DFaf8PRm7cRi hkX1t1QcAn6Fsh4g9bblEZv+ilGLrh4phGy+dWKqmPb5y5cpQtlH3TAu+YOU0SnV0Luk HDucHKXRMGxNFDuLtGBJm3I9tnzVAAQ1MUc6DNMO077XW2R/1eEDaW0Jd2emJHRAWPjM HGm8QIKeax6/ljYPvC/5GtfUEcuV0hqZzqfkU0/3+9ZK0znENu0rEkld1JzriqhbZHHh XyGAE624cdyEKo/bR2ibxnm20fA1861ECmsz+HbEDZY/Me4+oPLiv4hAMXBd3+rQsqSP LmUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Rc+EdRzJ0SRGUPyQRF18IAjDuJpqdPevv1iUeqHNSDY=; b=lKwQnnrGYw51g7B7FhEIGOgyZre3MLVQNpQrYOQ9hb50wg9kUOjFpZrQluqSRPK+9s CSJ8oFIEAdkWja9xOvAnHWz2aRI7gLcCrYcImEY/CfKbCf7pyTbaukjcUOYyicK+SPH7 pP0iygEs1qEqYR3YA4m++Mv/TSY/JFGtbfgT4FgPxxW0W3LesvlrJJccazypqprikqD5 +2gq0c1yNHxcy5tOsI+/Pd/BoQCvRJ018Rwy2xaSzb8m0IZS56pWUHT3Wd32OTInXFwz sYVxr/QBY8WOqgTNT6DMwEuNe+S2e1q5chWRIE+tjCHTFuBPBBhui7KyUNrp+z3KDEFc Kz3Q== X-Gm-Message-State: AO0yUKUw11K/UoquW9+rGP6U6Oo4dI0i0EeICTA6XVi4hpt57bf9szPR 0XI320jd0Y7/o4dMe5rl2gJguQ== X-Received: by 2002:a05:6a20:d49b:b0:bd:278:f68f with SMTP id im27-20020a056a20d49b00b000bd0278f68fmr6832215pzb.52.1676571753281; Thu, 16 Feb 2023 10:22:33 -0800 (PST) Received: from kerodi.Dlink ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id n21-20020a637215000000b004dff15fc121sm1517574pgc.36.2023.02.16.10.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 10:22:32 -0800 (PST) From: Sunil V L To: Palmer Dabbelt , Albert Ou , Paul Walmsley , "Rafael J . Wysocki" , Len Brown , Thomas Gleixner , Marc Zyngier , Jonathan Corbet Cc: linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Andrew Jones , Anup Patel , Atish Patra , Sunil V L , "Rafael J . Wysocki" Subject: [PATCH V2 21/21] Documentation/kernel-parameters.txt: Add RISC-V for ACPI parameter Date: Thu, 16 Feb 2023 23:50:43 +0530 Message-Id: <20230216182043.1946553-22-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216182043.1946553-1-sunilvl@ventanamicro.com> References: <20230216182043.1946553-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 autolearn=unavailable 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?1758014007324160772?= X-GMAIL-MSGID: =?utf-8?q?1758014007324160772?= With ACPI support added for RISC-V, this kernel parameter is also supported on RISC-V. Hence, update the documentation. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki --- Documentation/admin-guide/kernel-parameters.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 6cfa6e3996cf..b3a5a5844daa 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1,17 +1,17 @@ - acpi= [HW,ACPI,X86,ARM64] + acpi= [HW,ACPI,X86,ARM64,RISC-V] Advanced Configuration and Power Interface Format: { force | on | off | strict | noirq | rsdt | copy_dsdt } force -- enable ACPI if default was off - on -- enable ACPI but allow fallback to DT [arm64] + on -- enable ACPI but allow fallback to DT [arm64,riscv] off -- disable ACPI if default was on noirq -- do not use ACPI for IRQ routing strict -- Be less tolerant of platforms that are not strictly ACPI specification compliant. rsdt -- prefer RSDT over (default) XSDT copy_dsdt -- copy DSDT to memory - For ARM64, ONLY "acpi=off", "acpi=on" or "acpi=force" - are available + For ARM64 and RISC-V, ONLY "acpi=off", "acpi=on" or + "acpi=force" are available See also Documentation/power/runtime_pm.rst, pci=noacpi