From: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
To: Sean Young <sean@mess.org>,
linux-kernel@vger.kernel.org,
"Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org, zhongqiu.han@oss.qualcomm.com
Subject: Re: [PATCH 7/8] cpufreq: sc520_freq: Drop support for AMD Elan SC520
Date: Thu, 7 May 2026 12:44:37 +0800 [thread overview]
Message-ID: <22cab2f4-1538-44e2-ac96-fb2b39d92bbf@oss.qualcomm.com> (raw)
In-Reply-To: <12a3abd097fda750ae905290c86ddb8d2b0a716c.1778071745.git.sean@mess.org>
On 5/6/2026 10:42 PM, Sean Young wrote:
> Since commit 8b793a92d862 ("x86/cpu: Remove M486/M486SX/ELAN support"),
> the AMD Elan SC520 is no longer supported, so the cpu frequency
> driver is no longer needed.
>
> Signed-off-by: Sean Young <sean@mess.org>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
> ---
> drivers/cpufreq/Kconfig.x86 | 11 ---
> drivers/cpufreq/Makefile | 1 -
> drivers/cpufreq/sc520_freq.c | 136 -----------------------------------
> 3 files changed, 148 deletions(-)
> delete mode 100644 drivers/cpufreq/sc520_freq.c
>
> diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86
> index 027e6ea2e038..865b290b01ff 100644
> --- a/drivers/cpufreq/Kconfig.x86
> +++ b/drivers/cpufreq/Kconfig.x86
> @@ -141,17 +141,6 @@ config ELAN_CPUFREQ
>
> If in doubt, say N.
>
> -config SC520_CPUFREQ
> - tristate "AMD Elan SC520"
> - depends on MELAN
> - help
> - This adds the CPUFreq driver for AMD Elan SC520 processor.
> -
> - For details, take a look at <file:Documentation/cpu-freq/>.
> -
> - If in doubt, say N.
> -
> -
> config X86_POWERNOW_K6
> tristate "AMD Mobile K6-2/K6-3 PowerNow!"
> depends on X86_32
> diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
> index 385c9fcc65c6..96196edf79d5 100644
> --- a/drivers/cpufreq/Makefile
> +++ b/drivers/cpufreq/Makefile
> @@ -41,7 +41,6 @@ obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o
> obj-$(CONFIG_X86_LONGHAUL) += longhaul.o
> obj-$(CONFIG_X86_E_POWERSAVER) += e_powersaver.o
> obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o
> -obj-$(CONFIG_SC520_CPUFREQ) += sc520_freq.o
> obj-$(CONFIG_X86_LONGRUN) += longrun.o
> obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o
> obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o
> diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c
> deleted file mode 100644
> index b360f03a116f..000000000000
> --- a/drivers/cpufreq/sc520_freq.c
> +++ /dev/null
> @@ -1,136 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * sc520_freq.c: cpufreq driver for the AMD Elan sc520
> - *
> - * Copyright (C) 2005 Sean Young <sean@mess.org>
> - *
> - * Based on elanfreq.c
> - *
> - * 2005-03-30: - initial revision
> - */
> -
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/init.h>
> -
> -#include <linux/delay.h>
> -#include <linux/cpufreq.h>
> -#include <linux/timex.h>
> -#include <linux/io.h>
> -
> -#include <asm/cpu_device_id.h>
> -
> -#define MMCR_BASE 0xfffef000 /* The default base address */
> -#define OFFS_CPUCTL 0x2 /* CPU Control Register */
> -
> -static __u8 __iomem *cpuctl;
> -
> -static struct cpufreq_frequency_table sc520_freq_table[] = {
> - {0, 0x01, 100000},
> - {0, 0x02, 133000},
> - {0, 0, CPUFREQ_TABLE_END},
> -};
> -
> -static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
> -{
> - u8 clockspeed_reg = *cpuctl;
> -
> - switch (clockspeed_reg & 0x03) {
> - default:
> - pr_err("error: cpuctl register has unexpected value %02x\n",
> - clockspeed_reg);
> - fallthrough;
> - case 0x01:
> - return 100000;
> - case 0x02:
> - return 133000;
> - }
> -}
> -
> -static int sc520_freq_target(struct cpufreq_policy *policy, unsigned int state)
> -{
> -
> - u8 clockspeed_reg;
> -
> - local_irq_disable();
> -
> - clockspeed_reg = *cpuctl & ~0x03;
> - *cpuctl = clockspeed_reg | sc520_freq_table[state].driver_data;
> -
> - local_irq_enable();
> -
> - return 0;
> -}
> -
> -/*
> - * Module init and exit code
> - */
> -
> -static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
> -{
> - struct cpuinfo_x86 *c = &cpu_data(0);
> -
> - /* capability check */
> - if (c->x86_vendor != X86_VENDOR_AMD ||
> - c->x86 != 4 || c->x86_model != 9)
> - return -ENODEV;
> -
> - /* cpuinfo and default policy values */
> - policy->cpuinfo.transition_latency = 1000000; /* 1ms */
> - policy->freq_table = sc520_freq_table;
> -
> - return 0;
> -}
> -
> -
> -static struct cpufreq_driver sc520_freq_driver = {
> - .get = sc520_freq_get_cpu_frequency,
> - .verify = cpufreq_generic_frequency_table_verify,
> - .target_index = sc520_freq_target,
> - .init = sc520_freq_cpu_init,
> - .name = "sc520_freq",
> -};
> -
> -static const struct x86_cpu_id sc520_ids[] = {
> - X86_MATCH_VENDOR_FAM_MODEL(AMD, 4, 9, NULL),
> - {}
> -};
> -MODULE_DEVICE_TABLE(x86cpu, sc520_ids);
> -
> -static int __init sc520_freq_init(void)
> -{
> - int err;
> -
> - if (!x86_match_cpu(sc520_ids))
> - return -ENODEV;
> -
> - cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1);
> - if (!cpuctl) {
> - pr_err("sc520_freq: error: failed to remap memory\n");
> - return -ENOMEM;
> - }
> -
> - err = cpufreq_register_driver(&sc520_freq_driver);
> - if (err)
> - iounmap(cpuctl);
> -
> - return err;
> -}
> -
> -
> -static void __exit sc520_freq_exit(void)
> -{
> - cpufreq_unregister_driver(&sc520_freq_driver);
> - iounmap(cpuctl);
> -}
> -
> -
> -MODULE_LICENSE("GPL");
> -MODULE_AUTHOR("Sean Young <sean@mess.org>");
> -MODULE_DESCRIPTION("cpufreq driver for AMD's Elan sc520 CPU");
> -
> -module_init(sc520_freq_init);
> -module_exit(sc520_freq_exit);
> -
--
Thx and BRs,
Zhongqiu Han
next prev parent reply other threads:[~2026-05-07 4:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 14:42 [PATCH 0/8] Remove remaining AMD Elan drivers Sean Young
2026-05-06 14:42 ` [PATCH 1/8] x86/platform: Remove Technology Systems 5500 board Sean Young
2026-05-06 14:42 ` [PATCH 2/8] mtd: ts5500_flash: Remove mapping since board is no longer supported Sean Young
2026-05-06 14:42 ` [PATCH 3/8] mtd: netsc520: " Sean Young
2026-05-06 14:42 ` [PATCH 4/8] mtd: sc520cdp: " Sean Young
2026-05-06 14:42 ` [PATCH 5/8] gpio: ts5500: Remove gpio driver as board " Sean Young
2026-05-07 8:06 ` Bartosz Golaszewski
2026-05-06 14:42 ` [PATCH 6/8] watchdog: sc520: Drop AMD Elan SC520 support Sean Young
2026-05-06 14:51 ` Guenter Roeck
2026-05-06 14:42 ` [PATCH 7/8] cpufreq: sc520_freq: Drop support for AMD Elan SC520 Sean Young
2026-05-07 4:44 ` Zhongqiu Han [this message]
2026-05-07 6:35 ` Viresh Kumar
2026-05-06 14:42 ` [PATCH 8/8] cpufreq: elanfreq: Drop support for AMD Elan SC4* Sean Young
2026-05-07 4:50 ` Zhongqiu Han
2026-05-07 8:58 ` Sean Young
2026-05-07 6:35 ` Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22cab2f4-1538-44e2-ac96-fb2b39d92bbf@oss.qualcomm.com \
--to=zhongqiu.han@oss.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sean@mess.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox