cpufreq Archive on lore.kernel.org
 help / color / mirror / Atom feed
* SpeedStep New Driver for Pentium III (-M) using SMI interface
@ 2003-09-02  4:36 Hiroshi Miura
  2003-09-02  5:35 ` Norbert Preining
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Hiroshi Miura @ 2003-09-02  4:36 UTC (permalink / raw)
  To: cpufreq; +Cc: Ducrot Bruno

[-- Attachment #1: Type: text/plain, Size: 2094 bytes --]

Hi,

I have tried to make the driver which use Intel Speedstep applet's 
SMI interface for 3 months. 

This driver is based on the information from

1. Microsoft Windows XP Document.
	we can get the SMI interface values from ax=E980/int15 BIOS call. 

2. Intel SpeedStep Applet Document.(from HP.com)
	http://h18007.www1.hp.com/support/files/evonotebook/us/download/10631.html
	" Adds code to request transition ownership when processing 
	the system critical resume message. When a critical hibernate occurs, 
	the Applet does not receive any system level notification. The change forces
	 the Applet to re-acquire transition ownership upon resume from a critical hibernate. "

	This is informative. This saied that  something 'ownership' call is needed on SMI 
	interface first.
	
3. Grover, Andrew's int 15h patch posted to cpufreq ml
	Message-ID: <F760B14C9561B941B89469F59BA3A847E96E28@orsmsx401.jf.intel.com>
	code which call BIOS to get SMI values. I included it.

4. Malik Martin's rev engineering results.
	call is made with BX, CX, EDI register values.
	and need signature 'ISG' when call.
	find function values. bx=1(get) and bx=2(set) 

5. Marc Lehmann's 'speedstep' utility,
	sample of assembler code to call SMI.

6. My work.
	find function to return max/min freq which system supportd. (bx=4)
	more values are gotten, but I cannot understand... 
	find 'ownership' function value(bx=0, which is other than 1 2 4..). 

ToDo(in pregress)
	support governor "auto" and using smi_event call, imprement auto freq change
	fearture.
	test on 440BX/ZX platform.

Memo
	module parameters are override result of an int 15h/eax=E890h call.
	these parameter value are gotten from Windows XP registory.
	HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\P3\Parameters\SmiCmdPort== smi_port
	HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\P3\Parameters\SmiCmdData== smi_cmd
	If there are no values in the registory, you don't need to set module parameters.

It's just an alpha status.  This may be useful with PIIX4 or ICH based M-P-III.
This patch (changeset) is against 2.6.0-test4.


[-- Attachment #2: speedstep-smi.cset --]
[-- Type: application/octet-stream, Size: 14928 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1276  -> 1.1277 
#	arch/i386/kernel/cpu/cpufreq/Kconfig	1.8     -> 1.9    
#	arch/i386/kernel/cpu/cpufreq/Makefile	1.8     -> 1.9    
#	arch/i386/kernel/setup.c	1.92    -> 1.93   
#	arch/i386/boot/setup.S	1.22    -> 1.23   
#	include/asm-i386/setup.h	1.5     -> 1.6    
#	               (new)	        -> 1.1     include/asm-i386/ist.h
#	               (new)	        -> 1.1     arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/20	miura@da-cha.org	1.1277
# This is new CPUFreq driver for Intel SpeedStep Technology.
# This use SMI interface that is also use in Intel Apoplet,
# defined by the Intel BIOS writer's guide. 
# 
# The interface is behined NDA wall.
# I am unaware of an interface, that's why I write code with
# a try-and-error basis and open documents.
# 
# It supports Mobile Pentium III(Coppermine), Pentium III-M(Tullantin)
# with 440BX/ZX/MX chipset. It also intend to support ICH based system,
# but not tested.
# --------------------------------------------
#
diff -Nru a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
--- a/arch/i386/boot/setup.S	Wed Aug 20 09:28:33 2003
+++ b/arch/i386/boot/setup.S	Wed Aug 20 09:28:33 2003
@@ -506,6 +506,17 @@
 	movw	$0xAA, (0x1ff)			# device present
 no_psmouse:
 
+#if defined(CONFIG_X86_SPEEDSTEP_SMI) || defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
+	movl	$0x0000E980, %eax		# IST Support 
+	movl	$0x47534943, %edx		# Request value
+	int	$0x15
+
+	movl	%eax, (96)
+	movl	%ebx, (100)
+	movl	%ecx, (104)
+	movl	%edx, (108)
+#endif
+
 #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
 # Then check for an APM BIOS...
 						# %ds points to the bootsector
diff -Nru a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig	Wed Aug 20 09:28:33 2003
+++ b/arch/i386/kernel/cpu/cpufreq/Kconfig	Wed Aug 20 09:28:33 2003
@@ -128,6 +128,18 @@
        depends on X86_SPEEDSTEP_ICH
        default X86_SPEEDSTEP_ICH
 
+config X86_SPEEDSTEP_SMI
+	tristate "Intel SpeedStep with 440BX/MX"
+	depends on CPU_FREQ
+	help
+	  This adds the CPUFreq driver for mobile Intel Pentium III
+	  (Coppermine), all mobile Intel Pentium III-M (Tualatin)  
+	  with an Intel 440BX/ZX/MX southbridge.
+
+	  For details, take a look at linux/Documentation/cpu-freq.
+
+	  If in doubt, say N.
+
 config X86_P4_CLOCKMOD
 	tristate "Intel Pentium 4 clock modulation"
 	depends on CPU_FREQ_TABLE
diff -Nru a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/i386/kernel/cpu/cpufreq/Makefile
--- a/arch/i386/kernel/cpu/cpufreq/Makefile	Wed Aug 20 09:28:33 2003
+++ b/arch/i386/kernel/cpu/cpufreq/Makefile	Wed Aug 20 09:28:33 2003
@@ -9,6 +9,7 @@
 obj-$(CONFIG_X86_SPEEDSTEP_ICH)	+= speedstep-ich.o
 obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
 obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o
+obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o
 
 ifdef CONFIG_X86_ACPI_CPUFREQ
   ifdef CONFIG_ACPI_DEBUG
diff -Nru a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	Wed Aug 20 09:28:34 2003
@@ -0,0 +1,334 @@
+/*
+ * Intel SpeedStep SMI driver.
+ *
+ * (C) 2003  Hiroshi Miura <miura@da-cha.org>
+ *
+ *  Licensed under the terms of the GNU GPL License version 2.
+ *
+ */
+
+
+/*********************************************************************
+ *                        SPEEDSTEP - DEFINITIONS                    *
+ *********************************************************************/
+
+#include <linux/kernel.h>
+#include <linux/module.h> 
+#include <linux/init.h>
+#include <linux/cpufreq.h>
+#include <linux/pci.h>
+#include <linux/slab.h>
+#include <linux/pm.h>
+#include <asm/ist.h>
+
+/* speedstep system management interface port/command.
+ *
+ * These parameters are got from IST-SMI BIOS call.
+ * If user gives it, these are used.
+ * 
+ */
+static int		smi_port	= 0;
+static int		smi_cmd		= 0;
+
+
+#define SPEEDSTEP_HIGH	0x00000000
+#define SPEEDSTEP_LOW   0x00000001
+
+/* 
+ *   There are only two frequency states for each processor. Values
+ * are in kHz for the time being.
+ */
+static struct cpufreq_frequency_table speedstep_freqs[] = {
+	{SPEEDSTEP_HIGH, 	0},
+	{SPEEDSTEP_LOW,		0},
+	{0,			CPUFREQ_TABLE_END},
+};
+
+static struct pm_dev *smi_pm_dev;
+
+#define GET_SPEEDSTEP_OWNER 0
+#define GET_SPEEDSTEP_STATE 1
+#define SET_SPEEDSTEP_STATE 2
+#define GET_SPEEDSTEP_FREQS 4
+
+/* DEBUG
+ *   Define it if you want verbose debug output, e.g. for bug reporting
+ */
+#define SPEEDSTEP_DEBUG
+
+#ifdef SPEEDSTEP_DEBUG
+#define dprintk(msg...) printk(msg)
+#else
+#define dprintk(msg...) do { } while(0)
+#endif
+
+/**
+ * speedstep_smi_ownership
+ */
+static int speedstep_smi_ownership (void)
+{
+        u32     command, result, magic;
+        u32     function = GET_SPEEDSTEP_OWNER;
+	unsigned char magic_data[] = "Copyright (c) 1999 Intel Corporation";
+
+        command = (ist_info.signature & 0xffffff00) | (smi_cmd & 0xff);
+	magic = virt_to_phys(magic_data);
+
+        __asm__ __volatile__(
+            "out %%al, (%%dx)\n"
+            : "=D" (result)
+            : "a" (command), "b" (function), "c" (0), "d" (smi_port), "D" (0), "S" (magic)
+        );
+
+        return result;
+}
+/**
+ * speedstep_smi_get_freqs - get SpeedStep preferred & current freq.
+ *
+ */
+static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high)
+{
+        u32     command, result, edi, high_mhz, low_mhz;
+        u32     state=0;
+        u32	function = GET_SPEEDSTEP_FREQS;
+
+        command = (ist_info.signature & 0xffffff00) | (smi_cmd & 0xff);
+
+        __asm__ __volatile__("movl $0, %%edi\n"
+            "out %%al, (%%dx)\n"
+            : "=a" (result), "=b" (high_mhz), "=c" (low_mhz), "=d" (state), "=D" (edi)
+            : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0)
+        );
+	*high = high_mhz * 1000;
+	*low  = low_mhz  * 1000;
+
+	return result;
+} 
+/**
+ * speedstep_get_state - set the SpeedStep state
+ * @state: processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
+ *
+ */
+static int speedstep_get_state (void)
+{
+	u32		function=GET_SPEEDSTEP_STATE;
+	u32		result, state, edi, command;
+
+        command = (ist_info.signature & 0xffffff00) | (smi_cmd & 0xff);
+
+        __asm__ __volatile__("movl $0, %%edi\n"
+            "out %%al, (%%dx)\n"
+            : "=a" (result), "=b" (state), "=D" (edi)
+            : "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0)
+        );
+	
+	return state;
+}
+
+/**
+ * speedstep_set_state - set the SpeedStep state
+ * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
+ *
+ */
+static void speedstep_set_state (unsigned int state, unsigned int notify)
+{
+	unsigned int		old_state, result, command, new_state;
+	unsigned long		flags;
+	struct cpufreq_freqs	freqs;
+	unsigned int		function=SET_SPEEDSTEP_STATE;
+
+	if (state > 0x1)
+		return;
+
+	old_state = speedstep_get_state();
+	freqs.old = speedstep_freqs[old_state].frequency;
+	freqs.new = speedstep_freqs[state].frequency;
+	freqs.cpu = 0; /* speedstep.c is UP only driver */
+	
+	if (old_state == state)
+		return;
+
+	if (notify)
+		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+
+	/* Disable IRQs */
+	local_irq_save(flags);
+
+        command = (ist_info.signature & 0xffffff00) | (smi_cmd & 0xff);
+        __asm__ __volatile__(
+	    "movl $0, %%edi\n"
+            "out %%al, (%%dx)\n"
+            : "=b" (new_state), "=D" (result)
+            : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0)
+        );
+
+	/* enable IRQs */
+	local_irq_restore(flags);
+
+	if (new_state == state) {
+		dprintk(KERN_INFO "cpufreq: change to %u MHz succeded\n", (freqs.new / 1000));
+	} else {
+		printk(KERN_ERR "cpufreq: change failed\n");
+	}
+
+	if (notify)
+		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+
+	return;
+}
+
+
+/**
+ * speedstep_target - set a new CPUFreq policy
+ * @policy: new policy
+ * @target_freq: new freq
+ * @relation: 
+ *
+ * Sets a new CPUFreq policy/freq.
+ */
+static int speedstep_target (struct cpufreq_policy *policy,
+			     unsigned int target_freq,
+			     unsigned int relation)
+{
+	unsigned int	newstate = 0;
+
+	if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
+		return -EINVAL;
+
+	speedstep_set_state(newstate, 1);
+
+	return 0;
+}
+
+
+/**
+ * speedstep_verify - verifies a new CPUFreq policy
+ * @freq: new policy
+ *
+ * Limit must be within speedstep_low_freq and speedstep_high_freq, with
+ * at least one border included.
+ */
+static int speedstep_verify (struct cpufreq_policy *policy)
+{
+	return cpufreq_frequency_table_verify(policy, &speedstep_freqs[0]);
+}
+
+
+static int speedstep_cpu_init(struct cpufreq_policy *policy)
+{
+	int		result;
+	unsigned int	speed,state;
+
+	/* capability check */
+	if (policy->cpu != 0)
+		return -ENODEV;
+
+	result = speedstep_smi_ownership();
+
+	if (result)
+		dprintk(KERN_INFO "cpufreq: fails an aquiring ownership of a SMI interface.\n");
+
+	/* detect low and high frequency */
+	result = speedstep_smi_get_freqs(&speedstep_freqs[SPEEDSTEP_LOW].frequency,
+				         &speedstep_freqs[SPEEDSTEP_HIGH].frequency);
+	if (result)
+		return result;
+
+	/* get current speed setting */
+	state = speedstep_get_state();
+	speed = speedstep_freqs[state].frequency;
+
+	dprintk(KERN_INFO "cpufreq: currently at %s speed setting - %i MHz\n", 
+		(speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high",
+		(speed / 1000));
+
+	/* cpuinfo and default policy values */
+	policy->policy = (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? 
+		CPUFREQ_POLICY_POWERSAVE : CPUFREQ_POLICY_PERFORMANCE;
+	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
+	policy->cur = speed;
+
+	return cpufreq_frequency_table_cpuinfo(policy, &speedstep_freqs[0]);
+}
+
+
+static struct cpufreq_driver speedstep_driver = {
+	.name		= "speedstep",
+	.verify 	= speedstep_verify,
+	.target 	= speedstep_target,
+	.init		= speedstep_cpu_init,
+};
+
+static int speedstep_pm_resume(struct pm_dev *dev, pm_request_t rqst, void *data)
+{
+	int result = 0;
+
+	switch (rqst) {
+		case PM_RESUME:
+			result = speedstep_smi_ownership();
+			if (result)
+				dprintk(KERN_INFO "cpufreq: fails an aquiring ownership of a SMI interface.\n");
+			break;
+		case PM_SUSPEND:
+		default:
+			/* no need actions */
+			break;
+	}
+	return result;
+}
+
+/**
+ * speedstep_init - initializes the SpeedStep CPUFreq driver
+ *
+ *   Initializes the SpeedStep support. Returns -ENODEV on unsupported
+ * BIOS, -EINVAL on problems during initiatization, and zero on
+ * success.
+ */
+static int __init speedstep_init(void)
+{
+	/* Error if no IST-SMI BIOS or no PARM 
+		 sig= 'ISGE' aka 'Intel Speedstep Gate E' */
+	if ((ist_info.signature !=  0x47534943) && ( 
+	    (smi_port == 0) || (smi_cmd == 0)))
+		return -ENODEV;
+
+	/* setup smi_port from MODLULE_PARM or BIOS */
+	if ((smi_port > 0xff) || (smi_port < 0)) {
+		return -EINVAL;
+	} else if (smi_port == 0) {
+		smi_port = ist_info.command & 0xff;
+	}
+
+	if ((smi_cmd > 0xff) || (smi_cmd < 0)) {
+		return -EINVAL;
+	} else if (smi_cmd == 0) {
+		smi_cmd = (ist_info.command >> 16) & 0xff;
+	}
+
+	smi_pm_dev = pm_register(PM_SYS_DEV, PM_SYS_UNKNOWN, speedstep_pm_resume);
+
+	return cpufreq_register_driver(&speedstep_driver);
+}
+
+
+/**
+ * speedstep_exit - unregisters SpeedStep support
+ *
+ *   Unregisters SpeedStep support.
+ */
+static void __exit speedstep_exit(void)
+{
+	if (smi_pm_dev)
+		pm_unregister(smi_pm_dev);
+	cpufreq_unregister_driver(&speedstep_driver);
+}
+
+MODULE_PARM (smi_port, "i");
+MODULE_PARM (smi_cmd, "i");
+
+MODULE_AUTHOR ("Hiroshi Miura");
+MODULE_DESCRIPTION ("Speedstep driver for IST applet SMI interface.");
+MODULE_LICENSE ("GPL");
+
+module_init(speedstep_init);
+module_exit(speedstep_exit);
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c	Wed Aug 20 09:28:33 2003
+++ b/arch/i386/kernel/setup.c	Wed Aug 20 09:28:33 2003
@@ -43,6 +43,7 @@
 #include <asm/setup.h>
 #include <asm/arch_hooks.h>
 #include <asm/sections.h>
+#include <asm/ist.h>
 #include "setup_arch_pre.h"
 #include "mach_resources.h"
 
@@ -100,6 +101,7 @@
 	unsigned char table[0];
 };
 struct edid_info edid_info;
+struct ist_info ist_info;
 struct e820map e820;
 
 unsigned char aux_device_present;
@@ -952,6 +954,9 @@
  	screen_info = SCREEN_INFO;
 	edid_info = EDID_INFO;
 	apm_info.bios = APM_BIOS_INFO;
+	ist_info = IST_INFO;
+	printk("IST_SMI: signature:0x%.8x, command:0x%.8x, event:0x%.8x, perf_level:0x%.8x.\n", 
+		ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level);
 	saved_videomode = VIDEO_MODE;
 	printk("Video mode to be used for restore is %lx\n", saved_videomode);
 	if( SYS_DESC_TABLE.length != 0 ) {
diff -Nru a/include/asm-i386/ist.h b/include/asm-i386/ist.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/asm-i386/ist.h	Wed Aug 20 09:28:34 2003
@@ -0,0 +1,32 @@
+#ifndef _ASM_IST_H
+#define _ASM_IST_H
+
+/*
+ * Include file for the interface to IST BIOS
+ * Copyright 2002 Andy Grover <andrew.grover@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+
+#ifdef __KERNEL__
+
+struct ist_info {
+	unsigned long	signature;
+	unsigned long	command;
+	unsigned long	event;
+	unsigned long	perf_level;
+};
+
+extern struct ist_info ist_info;
+
+#endif	/* __KERNEL__ */
+#endif	/* _ASM_IST_H */
diff -Nru a/include/asm-i386/setup.h b/include/asm-i386/setup.h
--- a/include/asm-i386/setup.h	Wed Aug 20 09:28:33 2003
+++ b/include/asm-i386/setup.h	Wed Aug 20 09:28:34 2003
@@ -26,6 +26,7 @@
 #define E820_MAP_NR (*(char*) (PARAM+E820NR))
 #define E820_MAP    ((struct e820entry *) (PARAM+E820MAP))
 #define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40))
+#define IST_INFO   (*(struct ist_info *) (PARAM+0x60))
 #define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80))
 #define SYS_DESC_TABLE (*(struct sys_desc_table_struct*)(PARAM+0xa0))
 #define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2))

[-- Attachment #3: Type: text/plain, Size: 250 bytes --]

-- 
Hiroshi Miura  --- http://www.da-cha.org/ 
NTTDATA Corp. Marketing & Business Strategy Planning Dept. --- miurahr@nttdata.co.jp 
Key fingerprint = 9117 9407 5684 FBF1 4063  15B4 401D D077 04AB 8617
-- My hacking life is happy as the day is long


[-- Attachment #4: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  4:36 SpeedStep New Driver for Pentium III (-M) using SMI interface Hiroshi Miura
@ 2003-09-02  5:35 ` Norbert Preining
  2003-09-03  4:02   ` Hiroshi Miura
  2003-09-02  8:18 ` Ducrot Bruno
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Norbert Preining @ 2003-09-02  5:35 UTC (permalink / raw)
  To: Hiroshi Miura; +Cc: cpufreq

On Die, 02 Sep 2003, Hiroshi Miura wrote:
> It's just an alpha status.  This may be useful with PIIX4 or ICH based M-P-III.

I am ready to try it, but need a patch against 2.4(22,23pre):

model name      : Mobile Intel(R) Pentium(R) 4 - M CPU 2.20GHz
stepping        : 7

cpufreq: Intel(R) SpeedStep(TM) for this chipset not (yet) available.
cpufreq: P4/Xeon(TM) CPU On-Demand Clock Modulation available

Best wishes

Norbert

-------------------------------------------------------------------------------
Norbert Preining <preining AT logic DOT at>         Technische Universität Wien
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BEREPPER
The irrevocable and sturdy fart released in the presence of royalty,
which sounds quite like a small motorbike passing by (but not enough
to be confused with one).
			--- Douglas Adams, The Meaning of Liff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  4:36 SpeedStep New Driver for Pentium III (-M) using SMI interface Hiroshi Miura
  2003-09-02  5:35 ` Norbert Preining
@ 2003-09-02  8:18 ` Ducrot Bruno
  2003-09-02  8:31 ` Dominik Brodowski
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-02  8:18 UTC (permalink / raw)
  To: Hiroshi Miura; +Cc: Ducrot Bruno, cpufreq

On Tue, Sep 02, 2003 at 01:36:33PM +0900, Hiroshi Miura wrote:
> Hi,
> 
> I have tried to make the driver which use Intel Speedstep applet's 
> SMI interface for 3 months. 
> 
> This driver is based on the information from
> 
> 1. Microsoft Windows XP Document.
> 	we can get the SMI interface values from ax=E980/int15 BIOS call. 
> 
> 2. Intel SpeedStep Applet Document.(from HP.com)
> 	http://h18007.www1.hp.com/support/files/evonotebook/us/download/10631.html
> 	" Adds code to request transition ownership when processing 
> 	the system critical resume message. When a critical hibernate occurs, 
> 	the Applet does not receive any system level notification. The change forces
> 	 the Applet to re-acquire transition ownership upon resume from a critical hibernate. "
> 
> 	This is informative. This saied that  something 'ownership' call is needed on SMI 
> 	interface first.

Fine, point 2 actually killed me.  One little question though, the magic string need
all that?  Are you sure it can not be replaced by something else?  After all, you have
to download the applet from the OEM, not necessary from Intel.

I need probably to rewritte it a little though (some stuff in speedstep-lib.c
should be used), but anyway, that one will be commited soon, eventually
replacing speedstep-piix4 if all tests are ok.

Cheers,

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  4:36 SpeedStep New Driver for Pentium III (-M) using SMI interface Hiroshi Miura
  2003-09-02  5:35 ` Norbert Preining
  2003-09-02  8:18 ` Ducrot Bruno
@ 2003-09-02  8:31 ` Dominik Brodowski
  2003-09-02  8:42   ` Ducrot Bruno
                     ` (2 more replies)
  2003-09-02 15:13 ` Dominik Brodowski
  2003-09-04 12:42 ` Ducrot Bruno
  4 siblings, 3 replies; 18+ messages in thread
From: Dominik Brodowski @ 2003-09-02  8:31 UTC (permalink / raw)
  To: Hiroshi Miura; +Cc: Ducrot Bruno, cpufreq

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]

Thanks for this very interesting work. Unfortunately, it doesn't work on my
aged notebook, but well, the GPO driver didn't work either....

Attached are a couple of patches for your driver:

fix-warnings
	fixes a couple of warnings

core-update-followup
	->policy shall not be set any longer in ->target cpufreq drivers
	[followup to the core patches I've posted previously]

less-verbose-and-export
	to run as a module, we need to export ist_info. Also, only show the
	IST_INFO line in dmesg if speedstep_smi is enabled.

resume
	use a new ->resume callback in the cpufreq core.


	Dominik

[-- Attachment #2: speedstep-2.6.0-test4-core_update_followup --]
[-- Type: text/plain, Size: 656 bytes --]

diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
--- linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	2003-09-02 08:40:59.748663248 +0200
+++ linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	2003-09-02 08:47:32.039026048 +0200
@@ -243,8 +243,7 @@
 		(speed / 1000));
 
 	/* cpuinfo and default policy values */
-	policy->policy = (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? 
-		CPUFREQ_POLICY_POWERSAVE : CPUFREQ_POLICY_PERFORMANCE;
+	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 	policy->cur = speed;
 

[-- Attachment #3: speedstep-2.6.0-test4-fix_warnings --]
[-- Type: text/plain, Size: 771 bytes --]

fix warning: unsigned int format, long unsigned int arg (arg 2..4)

diff -ruN linux-original/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- linux-original/arch/i386/kernel/setup.c	2003-09-02 08:40:59.749663096 +0200
+++ linux/arch/i386/kernel/setup.c	2003-09-02 08:41:55.844135440 +0200
@@ -957,7 +957,7 @@
 	edid_info = EDID_INFO;
 	apm_info.bios = APM_BIOS_INFO;
 	ist_info = IST_INFO;
-	printk("IST_SMI: signature:0x%.8x, command:0x%.8x, event:0x%.8x, perf_level:0x%.8x.\n", 
+	printk("IST_SMI: signature:0%.8lx, command:0lx%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n", 
 		ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level);
 	saved_videomode = VIDEO_MODE;
 	printk("Video mode to be used for restore is %lx\n", saved_videomode);

[-- Attachment #4: speedstep-2.6.0-test4-less_verbose_and_export --]
[-- Type: text/plain, Size: 1386 bytes --]

diff -ruN linux-original/arch/i386/kernel/i386_ksyms.c linux/arch/i386/kernel/i386_ksyms.c
--- linux-original/arch/i386/kernel/i386_ksyms.c	2003-09-02 08:31:36.121347624 +0200
+++ linux/arch/i386/kernel/i386_ksyms.c	2003-09-02 08:59:29.684927288 +0200
@@ -33,6 +33,7 @@
 #include <asm/tlbflush.h>
 #include <asm/nmi.h>
 #include <asm/edd.h>
+#include <asm/ist.h>
 
 extern void dump_thread(struct pt_regs *, struct user *);
 extern spinlock_t rtc_lock;
@@ -209,3 +210,7 @@
 EXPORT_SYMBOL(edd);
 EXPORT_SYMBOL(eddnr);
 #endif
+
+#if defined(CONFIG_X86_SPEEDSTEP_SMI) || defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
+EXPORT_SYMBOL(ist_info);
+#endif
diff -ruN linux-original/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- linux-original/arch/i386/kernel/setup.c	2003-09-02 08:48:14.965500232 +0200
+++ linux/arch/i386/kernel/setup.c	2003-09-02 08:58:52.739543840 +0200
@@ -957,8 +957,10 @@
 	edid_info = EDID_INFO;
 	apm_info.bios = APM_BIOS_INFO;
 	ist_info = IST_INFO;
+#if defined(CONFIG_X86_SPEEDSTEP_SMI) || defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE) 
 	printk("IST_SMI: signature:0%.8lx, command:0lx%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n", 
 		ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level);
+#endif
 	saved_videomode = VIDEO_MODE;
 	printk("Video mode to be used for restore is %lx\n", saved_videomode);
 	if( SYS_DESC_TABLE.length != 0 ) {

[-- Attachment #5: speedstep-2.6.0-test4-resume --]
[-- Type: text/plain, Size: 1998 bytes --]

diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
--- linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	2003-09-02 08:48:54.192536816 +0200
+++ linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	2003-09-02 09:05:57.532965424 +0200
@@ -18,7 +18,6 @@
 #include <linux/cpufreq.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
-#include <linux/pm.h>
 #include <asm/ist.h>
 
 /* speedstep system management interface port/command.
@@ -44,8 +43,6 @@
 	{0,			CPUFREQ_TABLE_END},
 };
 
-static struct pm_dev *smi_pm_dev;
-
 #define GET_SPEEDSTEP_OWNER 0
 #define GET_SPEEDSTEP_STATE 1
 #define SET_SPEEDSTEP_STATE 2
@@ -251,31 +248,25 @@
 }
 
 
+static int speedstep_resume(struct cpufreq_policy *policy)
+{
+	int result = speedstep_smi_ownership();
+
+	if (result)
+		dprintk(KERN_INFO "cpufreq: fails an aquiring ownership of a SMI interface.\n");
+
+	return result;
+}
+
+
 static struct cpufreq_driver speedstep_driver = {
 	.name		= "speedstep",
 	.verify 	= speedstep_verify,
 	.target 	= speedstep_target,
 	.init		= speedstep_cpu_init,
+	.resume		= speedstep_resume,
 };
 
-static int speedstep_pm_resume(struct pm_dev *dev, pm_request_t rqst, void *data)
-{
-	int result = 0;
-
-	switch (rqst) {
-		case PM_RESUME:
-			result = speedstep_smi_ownership();
-			if (result)
-				dprintk(KERN_INFO "cpufreq: fails an aquiring ownership of a SMI interface.\n");
-			break;
-		case PM_SUSPEND:
-		default:
-			/* no need actions */
-			break;
-	}
-	return result;
-}
-
 /**
  * speedstep_init - initializes the SpeedStep CPUFreq driver
  *
@@ -304,8 +295,6 @@
 		smi_cmd = (ist_info.command >> 16) & 0xff;
 	}
 
-	smi_pm_dev = pm_register(PM_SYS_DEV, PM_SYS_UNKNOWN, speedstep_pm_resume);
-
 	return cpufreq_register_driver(&speedstep_driver);
 }
 
@@ -317,8 +306,6 @@
  */
 static void __exit speedstep_exit(void)
 {
-	if (smi_pm_dev)
-		pm_unregister(smi_pm_dev);
 	cpufreq_unregister_driver(&speedstep_driver);
 }
 

[-- Attachment #6: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  8:31 ` Dominik Brodowski
@ 2003-09-02  8:42   ` Ducrot Bruno
  2003-09-02 12:35   ` Ducrot Bruno
  2003-09-03  7:33   ` Ducrot Bruno
  2 siblings, 0 replies; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-02  8:42 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: Hiroshi Miura, Ducrot Bruno, cpufreq

On Tue, Sep 02, 2003 at 10:31:50AM +0200, Dominik Brodowski wrote:
> Thanks for this very interesting work. Unfortunately, it doesn't work on my
> aged notebook, but well, the GPO driver didn't work either....
> 

I guess the ownership stuff need to be explained more.  How to know the
magic_string stuff for example?  If that can be included in detect-speedstep
utility...


-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  8:31 ` Dominik Brodowski
  2003-09-02  8:42   ` Ducrot Bruno
@ 2003-09-02 12:35   ` Ducrot Bruno
  2003-09-02 14:54     ` Dominik Brodowski
  2003-09-03  7:33   ` Ducrot Bruno
  2 siblings, 1 reply; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-02 12:35 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: Hiroshi Miura, Ducrot Bruno, cpufreq

On Tue, Sep 02, 2003 at 10:31:50AM +0200, Dominik Brodowski wrote:
> Thanks for this very interesting work. Unfortunately, it doesn't work on my
> aged notebook, but well, the GPO driver didn't work either....
> 

Dominik, the command is 0x80 for you, but actually it should be 0x82.
I do have the exact same trouble with my toshiba.  Try then to pass
the correct option in order to overide that value.  Unfortunately, I
don't have my toshiba handy (even though it is ICH based, it
may be usefull to play with).

The flags stuff is not actually exploited.
For mine (and for Dominik) it is 0x07d00100
whereas Miura-san is 0x0x07d00000

When I receive report from speedstep-detect (and also send
something called speedtep-bios privatly), if bit 8 == 1, then it do not
work, but I don't have the ownership stuff, though.  When that
bit is 0, it may or may not work.  I think it is related to 
state on battery.

More related to the driver: I don't see any special reason to disable
interrupts in-between the smi call when setting the state.  Also,
you don't use the speedstep_get_freqs, but use a SMI function for
that (which is probably more usefull), therefore, there is no
need to do the notification stuff (it was done only at _init stage,
and to avoid duplicating codes).

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02 12:35   ` Ducrot Bruno
@ 2003-09-02 14:54     ` Dominik Brodowski
  2003-09-02 17:02       ` Ducrot Bruno
  2003-09-03  7:57       ` Ducrot Bruno
  0 siblings, 2 replies; 18+ messages in thread
From: Dominik Brodowski @ 2003-09-02 14:54 UTC (permalink / raw)
  To: Ducrot Bruno; +Cc: Hiroshi Miura, Ducrot Bruno, cpufreq

Fantastic, speedstep finally works on my notebook!!! Wow... Congratulations
to Bruno Ducrot and Hiroshi Miura. 

On Tue, Sep 02, 2003 at 02:35:38PM +0200, Ducrot Bruno wrote:
> On Tue, Sep 02, 2003 at 10:31:50AM +0200, Dominik Brodowski wrote:
> > Thanks for this very interesting work. Unfortunately, it doesn't work on my
> > aged notebook, but well, the GPO driver didn't work either....
> > 
> 
> Dominik, the command is 0x80 for you, but actually it should be 0x82.
> I do have the exact same trouble with my toshiba.  Try then to pass
> the correct option in order to overide that value.  Unfortunately, I
> don't have my toshiba handy (even though it is ICH based, it
> may be usefull to play with).

0x82 was one part of the story...
 
> The flags stuff is not actually exploited.
> For mine (and for Dominik) it is 0x07d00100
> whereas Miura-san is 0x0x07d00000
> 
> When I receive report from speedstep-detect (and also send
> something called speedtep-bios privatly), if bit 8 == 1, then it do not
> work, but I don't have the ownership stuff, though.  When that
> bit is 0, it may or may not work.  I think it is related to 
> state on battery.
> 
> More related to the driver: I don't see any special reason to disable
> interrupts in-between the smi call when setting the state.  Also,
> you don't use the speedstep_get_freqs, but use a SMI function for
> that (which is probably more usefull), therefore, there is no
> need to do the notification stuff (it was done only at _init stage,
> and to avoid duplicating codes).

the other part of the story is here: the speedstep_smi_get_freqs call does
not work on my system -- it returns the ist_info.signature as result, and
"0" and "4" as high and low frequency which is obviously bogus. Replacing it
with hard-coded values for testing made it go -- BTW, GPO 0 did indeed
change again, but changing GPO _alone_ [which is what the speedstep-piix4
module does] did not work.

	Dominik

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  4:36 SpeedStep New Driver for Pentium III (-M) using SMI interface Hiroshi Miura
                   ` (2 preceding siblings ...)
  2003-09-02  8:31 ` Dominik Brodowski
@ 2003-09-02 15:13 ` Dominik Brodowski
  2003-09-04 12:42 ` Ducrot Bruno
  4 siblings, 0 replies; 18+ messages in thread
From: Dominik Brodowski @ 2003-09-02 15:13 UTC (permalink / raw)
  To: Hiroshi Miura; +Cc: Ducrot Bruno, cpufreq

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

Yet more patches for your speedstep-smi driver:

naming
	let's call this driver "speedstep-smi" in cpufreq_driver also

frequency_detection_fallback
	if the smi_get_freqs call fails, fall back to the "let's try it out
and see what frequency we are at" mechanism. Needed on my notebook (at
least).


	Dominik

[-- Attachment #2: speedstep-2.6.0-test4-frequency_detection_fallback --]
[-- Type: text/plain, Size: 3792 bytes --]

diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/Kconfig linux/arch/i386/kernel/cpu/cpufreq/Kconfig
--- linux-original/arch/i386/kernel/cpu/cpufreq/Kconfig	2003-09-02 16:14:28.533376808 +0200
+++ linux/arch/i386/kernel/cpu/cpufreq/Kconfig	2003-09-02 16:29:26.763825024 +0200
@@ -99,19 +99,6 @@
 
 	 If in doubt, say N.
 
-config X86_SPEEDSTEP_ICH
-	tristate "Intel Speedstep"
-	depends on CPU_FREQ_TABLE
-	help
-	  This adds the CPUFreq driver for certain mobile Intel Pentium III
-	  (Coppermine), all mobile Intel Pentium III-M (Tualatin) and all
-	  mobile Intel Pentium 4 P4-Ms, with an Intel ICH2, ICH3,
-	  or ICH4 southbridge.
-
-	  For details, take a look at linux/Documentation/cpu-freq. 
-
-	  If in doubt, say N.
-
 config X86_SPEEDSTEP_CENTRINO
 	tristate "Intel Enhanced SpeedStep"
 	depends on CPU_FREQ_TABLE
@@ -123,23 +110,36 @@
 	  
 	  If in doubt, say N.
 
-config X86_SPEEDSTEP_LIB
-       tristate
-       depends on X86_SPEEDSTEP_ICH
-       default X86_SPEEDSTEP_ICH
+config X86_SPEEDSTEP_ICH
+	tristate "Intel Speedstep on ICH-M chipsets (ioport interface)"
+	depends on CPU_FREQ_TABLE
+	help
+	  This adds the CPUFreq driver for certain mobile Intel Pentium III
+	  (Coppermine), all mobile Intel Pentium III-M (Tualatin) and all
+	  mobile Intel Pentium 4 P4-M on systems which have an Intel ICH2, 
+	  ICH3 or ICH4 southbridge.
+
+	  For details, take a look at linux/Documentation/cpu-freq. 
+
+	  If in doubt, say N.
 
 config X86_SPEEDSTEP_SMI
-	tristate "Intel SpeedStep with 440BX/MX"
+	tristate "Intel SpeedStep on 440BX/ZX/MX chipsets (SMI interface)"
 	depends on CPU_FREQ
 	help
-	  This adds the CPUFreq driver for mobile Intel Pentium III
+	  This adds the CPUFreq driver for certain mobile Intel Pentium III
 	  (Coppermine), all mobile Intel Pentium III-M (Tualatin)  
-	  with an Intel 440BX/ZX/MX southbridge.
+	  on systems which have an Intel 440BX/ZX/MX southbridge.
 
 	  For details, take a look at linux/Documentation/cpu-freq.
 
 	  If in doubt, say N.
 
+config X86_SPEEDSTEP_LIB
+	tristate
+	depends on (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI)
+	default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI)
+
 config X86_P4_CLOCKMOD
 	tristate "Intel Pentium 4 clock modulation"
 	depends on CPU_FREQ_TABLE
diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
--- linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	2003-09-02 16:26:15.956832096 +0200
+++ linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	2003-09-02 16:41:36.060955008 +0200
@@ -20,6 +20,8 @@
 #include <linux/slab.h>
 #include <asm/ist.h>
 
+#include "speedstep-lib.h"
+
 /* speedstep system management interface port/command.
  *
  * These parameters are got from IST-SMI BIOS call.
@@ -228,8 +230,25 @@
 	/* detect low and high frequency */
 	result = speedstep_smi_get_freqs(&speedstep_freqs[SPEEDSTEP_LOW].frequency,
 				         &speedstep_freqs[SPEEDSTEP_HIGH].frequency);
-	if (result)
-		return result;
+	if (result) {
+		/* fall back to speedstep_lib.c dection mechanism: try both states out */
+		unsigned int speedstep_processor = speedstep_detect_processor();
+
+		dprintk(KERN_INFO "speedstep-smi: could not detect low and high frequencies by SMI call.\n");
+		if (!speedstep_processor)
+			return -ENODEV;
+
+		result = (int) speedstep_get_freqs(speedstep_processor,
+					     &speedstep_freqs[SPEEDSTEP_LOW].frequency,
+					     &speedstep_freqs[SPEEDSTEP_HIGH].frequency,
+					     &speedstep_set_state);
+
+		if (result) {
+			dprintk(KERN_INFO "speedstep-smi: could not detect two different speeds -- aborting.\n");
+			return result;
+		} else
+			dprintk(KERN_INFO "speedstep-smi: workaround worked.\n");
+	}
 
 	/* get current speed setting */
 	state = speedstep_get_state();

[-- Attachment #3: speedstep-2.6.0-test4-naming --]
[-- Type: text/plain, Size: 532 bytes --]

diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
--- linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	2003-09-02 16:14:28.532376960 +0200
+++ linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c	2003-09-02 16:16:34.896166744 +0200
@@ -260,7 +260,7 @@
 
 
 static struct cpufreq_driver speedstep_driver = {
-	.name		= "speedstep",
+	.name		= "speedstep-smi",
 	.verify 	= speedstep_verify,
 	.target 	= speedstep_target,
 	.init		= speedstep_cpu_init,

[-- Attachment #4: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02 14:54     ` Dominik Brodowski
@ 2003-09-02 17:02       ` Ducrot Bruno
  2003-09-03  7:57       ` Ducrot Bruno
  1 sibling, 0 replies; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-02 17:02 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: Hiroshi Miura, Ducrot Bruno, cpufreq

On Tue, Sep 02, 2003 at 04:54:52PM +0200, Dominik Brodowski wrote:
> Fantastic, speedstep finally works on my notebook!!! Wow... Congratulations
> to Bruno Ducrot and Hiroshi Miura. 

Congratulations must go to Miura-san.  He was the one who find at last
the missing bits (the ownership call) for that work.

Still I am confused for the need to setup the esi to point
to a string.  That sound like at first as a strange way for obfuscating
things.
I really would like some comments from Intel.


-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  5:35 ` Norbert Preining
@ 2003-09-03  4:02   ` Hiroshi Miura
  2003-09-03  5:58     ` Norbert Preining
  2003-09-03  7:31     ` Ducrot Bruno
  0 siblings, 2 replies; 18+ messages in thread
From: Hiroshi Miura @ 2003-09-03  4:02 UTC (permalink / raw)
  To: Norbert Preining; +Cc: cpufreq


Hi,

I think you can use speedstep-centrino driver or acpi P-state instead.

At Tue, 2 Sep 2003 07:35:57 +0200,
Norbert Preining wrote:
> 
> I am ready to try it, but need a patch against 2.4(22,23pre):
> 
> model name      : Mobile Intel(R) Pentium(R) 4 - M CPU 2.20GHz
> stepping        : 7
> 
> cpufreq: Intel(R) SpeedStep(TM) for this chipset not (yet) available.
> cpufreq: P4/Xeon(TM) CPU On-Demand Clock Modulation available

-- 
Hiroshi Miura  --- http://www.da-cha.org/ 
NTTDATA Corp. Marketing & Business Strategy Planning Dept. --- miurahr@nttdata.co.jp 
Key fingerprint = 9117 9407 5684 FBF1 4063  15B4 401D D077 04AB 8617
-- My hacking life is happy as the day is long

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-03  4:02   ` Hiroshi Miura
@ 2003-09-03  5:58     ` Norbert Preining
  2003-09-03  7:31     ` Ducrot Bruno
  1 sibling, 0 replies; 18+ messages in thread
From: Norbert Preining @ 2003-09-03  5:58 UTC (permalink / raw)
  To: Hiroshi Miura; +Cc: cpufreq

On Mit, 03 Sep 2003, Hiroshi Miura wrote:
> I think you can use speedstep-centrino driver or acpi P-state instead.

no, either p4-clockmod or speedstep-ich

Best wishes

Norbert

-------------------------------------------------------------------------------
Norbert Preining <preining AT logic DOT at>         Technische Universität Wien
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
KETTERING (n.)
The marks left on your bottom or thighs after sunbathing on a
wickerwork chair.
			--- Douglas Adams, The Meaning of Liff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-03  4:02   ` Hiroshi Miura
  2003-09-03  5:58     ` Norbert Preining
@ 2003-09-03  7:31     ` Ducrot Bruno
  1 sibling, 0 replies; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-03  7:31 UTC (permalink / raw)
  To: Hiroshi Miura; +Cc: cpufreq

On Wed, Sep 03, 2003 at 01:02:00PM +0900, Hiroshi Miura wrote:
> 
> 
> At Tue, 2 Sep 2003 07:35:57 +0200,
> Norbert Preining wrote:
> > 
> > I am ready to try it, but need a patch against 2.4(22,23pre):
> > 
> > model name      : Mobile Intel(R) Pentium(R) 4 - M CPU 2.20GHz
> > stepping        : 7
> > 
> > cpufreq: Intel(R) SpeedStep(TM) for this chipset not (yet) available.
> > cpufreq: P4/Xeon(TM) CPU On-Demand Clock Modulation available

> I think you can use speedstep-centrino driver or acpi P-state instead.

No, it is not a banias.  But speedstep-ich should work, though.

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  8:31 ` Dominik Brodowski
  2003-09-02  8:42   ` Ducrot Bruno
  2003-09-02 12:35   ` Ducrot Bruno
@ 2003-09-03  7:33   ` Ducrot Bruno
  2 siblings, 0 replies; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-03  7:33 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: Hiroshi Miura, Ducrot Bruno, cpufreq

On Tue, Sep 02, 2003 at 10:31:50AM +0200, Dominik Brodowski wrote:
> Thanks for this very interesting work. Unfortunately, it doesn't work on my
> aged notebook, but well, the GPO driver didn't work either....
> 
> less-verbose-and-export
> 	to run as a module, we need to export ist_info. Also, only show the
> 	IST_INFO line in dmesg if speedstep_smi is enabled.

Showing the IST_INFO line should be done in the driver, not in arch/i386/kernel/setup.c


-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02 14:54     ` Dominik Brodowski
  2003-09-02 17:02       ` Ducrot Bruno
@ 2003-09-03  7:57       ` Ducrot Bruno
  2003-09-03  9:06         ` Dominik Brodowski
  1 sibling, 1 reply; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-03  7:57 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: Hiroshi Miura, Ducrot Bruno, cpufreq

On Tue, Sep 02, 2003 at 04:54:52PM +0200, Dominik Brodowski wrote:
> the other part of the story is here: the speedstep_smi_get_freqs call does
> not work on my system -- it returns the ist_info.signature as result, and
> "0" and "4" as high and low frequency which is obviously bogus. Replacing it
> with hard-coded values for testing made it go -- BTW, GPO 0 did indeed
> change again, but changing GPO _alone_ [which is what the speedstep-piix4
> module does] did not work.
> 

Changing GPO alone still require a read to LVL3.  Think the same
kind of techno like throttling (hint, hint :)

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-03  7:57       ` Ducrot Bruno
@ 2003-09-03  9:06         ` Dominik Brodowski
  0 siblings, 0 replies; 18+ messages in thread
From: Dominik Brodowski @ 2003-09-03  9:06 UTC (permalink / raw)
  To: Ducrot Bruno; +Cc: Hiroshi Miura, Ducrot Bruno, cpufreq

On Wed, Sep 03, 2003 at 09:57:26AM +0200, Ducrot Bruno wrote:
> On Tue, Sep 02, 2003 at 04:54:52PM +0200, Dominik Brodowski wrote:
> > the other part of the story is here: the speedstep_smi_get_freqs call does
> > not work on my system -- it returns the ist_info.signature as result, and
> > "0" and "4" as high and low frequency which is obviously bogus. Replacing it
> > with hard-coded values for testing made it go -- BTW, GPO 0 did indeed
> > change again, but changing GPO _alone_ [which is what the speedstep-piix4
> > module does] did not work.
> > 
> 
> Changing GPO alone still require a read to LVL3.  Think the same
> kind of techno like throttling (hint, hint :)

Well, with "changing GPO _alone_" I meant your speedstep-piix4 driver ;-)

	Dominik

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-02  4:36 SpeedStep New Driver for Pentium III (-M) using SMI interface Hiroshi Miura
                   ` (3 preceding siblings ...)
  2003-09-02 15:13 ` Dominik Brodowski
@ 2003-09-04 12:42 ` Ducrot Bruno
  2003-09-04 13:13   ` Hiroshi Miura
  4 siblings, 1 reply; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-04 12:42 UTC (permalink / raw)
  To: Hiroshi Miura; +Cc: Ducrot Bruno, cpufreq


I have commited both in trunk and tag LINUX_2_4 your driver.

For tag LINUX_2_4, I have to update at first the core especially
for resume stuff, so the .resume callback is not impletemented as
it should.

Cheers,

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-04 12:42 ` Ducrot Bruno
@ 2003-09-04 13:13   ` Hiroshi Miura
  2003-09-04 15:34     ` Ducrot Bruno
  0 siblings, 1 reply; 18+ messages in thread
From: Hiroshi Miura @ 2003-09-04 13:13 UTC (permalink / raw)
  To: Ducrot Bruno; +Cc: cpufreq


Ok, kernel 2.4 has no hibernation staff,
then not so big problem about it.

I didn't test it with apm, so I don't know 
what happens. to work-around, user can unload/load the module. 

At Thu, 4 Sep 2003 14:42:30 +0200,
Ducrot Bruno wrote:
> 
> I have commited both in trunk and tag LINUX_2_4 your driver.
> 
> For tag LINUX_2_4, I have to update at first the core especially
> for resume stuff, so the .resume callback is not impletemented as
> it should.

-- 
Hiroshi Miura  --- http://www.da-cha.org/ 
NTTDATA Corp. Marketing & Business Strategy Planning Dept. --- miurahr@nttdata.co.jp 
Key fingerprint = 9117 9407 5684 FBF1 4063  15B4 401D D077 04AB 8617
-- My hacking life is happy as the day is long

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: SpeedStep New Driver for Pentium III (-M) using SMI interface
  2003-09-04 13:13   ` Hiroshi Miura
@ 2003-09-04 15:34     ` Ducrot Bruno
  0 siblings, 0 replies; 18+ messages in thread
From: Ducrot Bruno @ 2003-09-04 15:34 UTC (permalink / raw)
  To: Hiroshi Miura; +Cc: cpufreq

On Thu, Sep 04, 2003 at 10:13:49PM +0900, Hiroshi Miura wrote:
> 
> Ok, kernel 2.4 has no hibernation staff,
> then not so big problem about it.
> 
> I didn't test it with apm, so I don't know 
> what happens. to work-around, user can unload/load the module. 

Most systems with a piii and piix4 are somehow 'old' and work
like a charm with apm, so I have to fix it (but i need to
update core at first).

S1 may work also, and is supported by acpi, I guest it should
be ok, but who knows.

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2003-09-04 15:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-02  4:36 SpeedStep New Driver for Pentium III (-M) using SMI interface Hiroshi Miura
2003-09-02  5:35 ` Norbert Preining
2003-09-03  4:02   ` Hiroshi Miura
2003-09-03  5:58     ` Norbert Preining
2003-09-03  7:31     ` Ducrot Bruno
2003-09-02  8:18 ` Ducrot Bruno
2003-09-02  8:31 ` Dominik Brodowski
2003-09-02  8:42   ` Ducrot Bruno
2003-09-02 12:35   ` Ducrot Bruno
2003-09-02 14:54     ` Dominik Brodowski
2003-09-02 17:02       ` Ducrot Bruno
2003-09-03  7:57       ` Ducrot Bruno
2003-09-03  9:06         ` Dominik Brodowski
2003-09-03  7:33   ` Ducrot Bruno
2003-09-02 15:13 ` Dominik Brodowski
2003-09-04 12:42 ` Ducrot Bruno
2003-09-04 13:13   ` Hiroshi Miura
2003-09-04 15:34     ` Ducrot Bruno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox