Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4437413iog; Tue, 21 Jun 2022 21:02:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t0MILjKXCR2yF5uBiFiILtVHIbZkkLzPxAldQH5UmoqbOz5RAd3J8eSvVb7ovcn/mxYtDK X-Received: by 2002:a63:6e4f:0:b0:40c:9251:d4a4 with SMTP id j76-20020a636e4f000000b0040c9251d4a4mr1194876pgc.516.1655870530108; Tue, 21 Jun 2022 21:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655870530; cv=none; d=google.com; s=arc-20160816; b=JZYtsbx1EQbqVlZTbwFHOqNhvm9CrbarxSnIz0w2ct/QeOT3EGAql+CpW+eD1NOr+R gVmr6SBesgosxb2Zxm4GChpByRX+LjueG9P7OWLTyt+iO0bU7KNftVRUiyAlpnPFb9+w O3f62ag3zjzGWYgel2+5sMiK8so6Hbc1Q2IUoQqVejWeFo7exrF0fQ/ekLbR8szjCjVo oCULEuI/jl/Qs86pUefR0Btu6l7YzlFuV9HAqu9hANV3FP2qDx5aC3XsGGkY+35Ex3jZ zdWb+9nLaTljWORv8uWAIXbRjwFX650xeTkgkXr0gD/hyZRToF91ggvhKfJb7Z5DfrG1 UByw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to; bh=JzYOrztp+FFQfrkp7jk0+wfl4YPAuURJQwKc8+HlrR0=; b=GiyilRL3fZqTC58//sINgOK2Z38QyOJRyQv3jdJsEK1at9HAFDP7es+IZsHakXEovg YnQ7jjTbBICbGBacferBTnETpXIIcKn0mminxlpJVK8eGFcTbZqbCqCd2Q0QqoXVMs3a R/mD9UgdBqHSk8r8Tp4qWoEbmpa3ft0oWuTqzXgkhdNosPRMkPS8ciwGCh9df6NGoYo9 EVcfSXrk46fOCxyfl5z2jyjlHl0hC8Yy3AFcYg70vDRrKr21nx1NvPd79qf7/68x8us3 ARZdCwXuZvh+KdC5pNxnPPxK8/MiGnCIV0Wd4Wcru5W2ONdbNfVHFwzQyTGxZG4LJieg Uzlg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd15-20020a656e0f000000b0040c702d1448si13804169pgb.540.2022.06.21.21.01.47; Tue, 21 Jun 2022 21:02:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; 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 S1356605AbiFVDo2 (ORCPT + 99 others); Tue, 21 Jun 2022 23:44:28 -0400 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 S232276AbiFVDo0 (ORCPT ); Tue, 21 Jun 2022 23:44:26 -0400 X-Greylist: delayed 903 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 21 Jun 2022 20:44:25 PDT Received: from ZXSHCAS2.zhaoxin.com (ZXSHCAS2.zhaoxin.com [210.0.225.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 051E519C03; Tue, 21 Jun 2022 20:44:24 -0700 (PDT) Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS2.zhaoxin.com (10.28.252.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 22 Jun 2022 11:29:10 +0800 Received: from [10.32.56.37] (10.32.56.37) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 22 Jun 2022 11:29:09 +0800 To: , , , CC: , , , From: Tony W Wang-oc Subject: [PATCH] cpufreq: Add Zhaoxin turbo boost control interface support Message-ID: <8b748cc6-09c9-081c-c0c5-2e75f017b032@zhaoxin.com> Date: Wed, 22 Jun 2022 11:29:08 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.32.56.37] X-ClientProxiedBy: ZXSHCAS1.zhaoxin.com (10.28.252.161) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recent Zhaoxin CPUs support X86_FEATURE_IDA and the turbo boost can be dynamically enabled or disabled through MSR 0x1a0[38] in the same way as Intel. So add turbo boost control support for Zhaoxin too. Signed-off-by: Tony W Wang-oc --- drivers/cpufreq/acpi-cpufreq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 3d514b8..1bb2b90 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -78,6 +78,8 @@ static bool boost_state(unsigned int cpu) switch (boot_cpu_data.x86_vendor) { case X86_VENDOR_INTEL: + case X86_VENDOR_CENTAUR: + case X86_VENDOR_ZHAOXIN: rdmsr_on_cpu(cpu, MSR_IA32_MISC_ENABLE, &lo, &hi); msr = lo | ((u64)hi << 32); return !(msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE); @@ -97,6 +99,8 @@ static int boost_set_msr(bool enable) switch (boot_cpu_data.x86_vendor) { case X86_VENDOR_INTEL: + case X86_VENDOR_CENTAUR: + case X86_VENDOR_ZHAOXIN: msr_addr = MSR_IA32_MISC_ENABLE; msr_mask = MSR_IA32_MISC_ENABLE_TURBO_DISABLE; break; -- 2.7.4