* [PATCH] Longhaul - Disable arbiter CLE266
@ 2006-09-23 5:59 Rafał Bilski
0 siblings, 0 replies; 5+ messages in thread
From: Rafał Bilski @ 2006-09-23 5:59 UTC (permalink / raw)
To: Dave Jones; +Cc: cpufreq
I have datasheet for CLE266 now. It is possible to enable
port 0x22 on this chipset too.
This patch is adding support for older CPU connected to
CLE266 chipset.
Signed-off-by: Rafa³ Bilski <rafalbilski@interia.pl>
---
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -567,16 +567,23 @@ static acpi_status longhaul_walk_callbac
static int enable_arbiter_disable(void)
{
struct pci_dev *dev;
+ int port;
u8 pci_cmd;
/* Find PLE133 host bridge */
+ port = 0x78;
dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, NULL);
+ /* Find CLE266 host bridge */
+ if (dev == NULL) {
+ dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL);
+ port = 0x76;
+ }
if (dev != NULL) {
/* Enable access to port 0x22 */
- pci_read_config_byte(dev, 0x78, &pci_cmd);
+ pci_read_config_byte(dev, port, &pci_cmd);
if ( !(pci_cmd & 1<<7) ) {
pci_cmd |= 1<<7;
- pci_write_config_byte(dev, 0x78, pci_cmd);
+ pci_write_config_byte(dev, port, pci_cmd);
}
return 1;
}
----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Longhaul - Disable arbiter CLE266
@ 2006-09-24 18:28 Rafał Bilski
0 siblings, 0 replies; 5+ messages in thread
From: Rafał Bilski @ 2006-09-24 18:28 UTC (permalink / raw)
To: Dave Jones; +Cc: cpufreq
Please ignore previous message.
This patch is adding support for CPU connected to CLE266
chipset. For older CPU this is only way. For "Powersaver"
processor this way will be used if ACPI C3 isn't supported.
I have tested it. It seems to work exacly like ACPI.
But it is less safe. On CLE266 chipset port 0x22 is
blocking processor access to PCI bus too.
Signed-off-by: Rafa³ Bilski <rafalbilski@interia.pl>
---
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -178,11 +178,17 @@ static void do_powersaver(int cx_address
safe_halt();
/* Change frequency on next halt or sleep */
wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
- ACPI_FLUSH_CPU_CACHE();
- /* Invoke C3 */
- inb(cx_address);
- /* Dummy op - must do something useless after P_LVL3 read */
- t = inl(acpi_fadt.xpm_tmr_blk.address);
+ if (port22_en) {
+ ACPI_FLUSH_CPU_CACHE();
+ /* Invoke C1 */
+ halt();
+ } else {
+ ACPI_FLUSH_CPU_CACHE();
+ /* Invoke C3 */
+ inb(cx_address);
+ /* Dummy op - must do something useless after P_LVL3 read */
+ t = inl(acpi_fadt.xpm_tmr_blk.address);
+ }
/* Disable bus ratio bit */
local_irq_disable();
@@ -567,16 +573,23 @@ static acpi_status longhaul_walk_callbac
static int enable_arbiter_disable(void)
{
struct pci_dev *dev;
+ int reg;
u8 pci_cmd;
/* Find PLE133 host bridge */
+ reg = 0x78;
dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, NULL);
+ /* Find CLE266 host bridge */
+ if (dev == NULL) {
+ dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL);
+ reg = 0x76;
+ }
if (dev != NULL) {
/* Enable access to port 0x22 */
- pci_read_config_byte(dev, 0x78, &pci_cmd);
+ pci_read_config_byte(dev, reg, &pci_cmd);
if ( !(pci_cmd & 1<<7) ) {
pci_cmd |= 1<<7;
- pci_write_config_byte(dev, 0x78, pci_cmd);
+ pci_write_config_byte(dev, reg, pci_cmd);
}
return 1;
}
@@ -681,19 +694,29 @@ static int __init longhaul_cpu_init(stru
/* Check ACPI support for C3 state */
cx = &pr->power.states[ACPI_STATE_C3];
if (cx->address == 0 ||
- (cx->latency > 1000 && ignore_latency == 0) )
- goto err_acpi;
+ (cx->latency > 1000 && ignore_latency == 0) ) {
+ if (enable_arbiter_disable()) {
+ port22_en = 1;
+ } else {
+ goto err_acpi;
+ }
+ }
} else {
/* Check ACPI support for bus master arbiter disable */
if (!pr->flags.bm_control) {
- if (!enable_arbiter_disable()) {
- printk(KERN_ERR PFX "No ACPI support. No VT8601 host bridge. Aborting.\n");
- return -ENODEV;
- } else
+ if (enable_arbiter_disable()) {
port22_en = 1;
+ } else {
+ goto err_acpi;
+ }
}
}
+ if (!port22_en) {
+ printk (KERN_INFO PFX "Using ACPI support.\n");
+ } else {
+ printk (KERN_INFO PFX "Using northbridge support.\n");
+ }
ret = longhaul_get_ranges();
if (ret != 0)
@@ -716,7 +739,7 @@ static int __init longhaul_cpu_init(stru
return 0;
err_acpi:
- printk(KERN_ERR PFX "No ACPI support for CPU frequency changes.\n");
+ printk(KERN_ERR PFX "No ACPI support. No VT8601 or VT8623 northbridge. Aborting.\n");
return -ENODEV;
}
----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Longhaul - Disable arbiter CLE266
@ 2006-09-26 19:45 Rafał Bilski
2006-09-27 5:06 ` Dave Jones
0 siblings, 1 reply; 5+ messages in thread
From: Rafał Bilski @ 2006-09-26 19:45 UTC (permalink / raw)
To: Dave Jones; +Cc: cpufreq
Please ignore previous two messages. :-)
This patch is adding support for CPU connected to CLE266
chipset. For older CPU this is only way. For "Powersaver"
processor this way will be used if ACPI C3 isn't supported.
Signed-off-by: Rafa³ Bilski <rafalbilski@interia.pl>
---
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -178,11 +178,17 @@ static void do_powersaver(int cx_address
safe_halt();
/* Change frequency on next halt or sleep */
wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
- ACPI_FLUSH_CPU_CACHE();
- /* Invoke C3 */
- inb(cx_address);
- /* Dummy op - must do something useless after P_LVL3 read */
- t = inl(acpi_fadt.xpm_tmr_blk.address);
+ if (port22_en) {
+ ACPI_FLUSH_CPU_CACHE();
+ /* Invoke C1 */
+ halt();
+ } else {
+ ACPI_FLUSH_CPU_CACHE();
+ /* Invoke C3 */
+ inb(cx_address);
+ /* Dummy op - must do something useless after P_LVL3 read */
+ t = inl(acpi_fadt.xpm_tmr_blk.address);
+ }
/* Disable bus ratio bit */
local_irq_disable();
@@ -567,16 +573,23 @@ static acpi_status longhaul_walk_callbac
static int enable_arbiter_disable(void)
{
struct pci_dev *dev;
+ int reg;
u8 pci_cmd;
/* Find PLE133 host bridge */
+ reg = 0x78;
dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, NULL);
+ /* Find CLE266 host bridge */
+ if (dev == NULL) {
+ reg = 0x76;
+ dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL);
+ }
if (dev != NULL) {
/* Enable access to port 0x22 */
- pci_read_config_byte(dev, 0x78, &pci_cmd);
+ pci_read_config_byte(dev, reg, &pci_cmd);
if ( !(pci_cmd & 1<<7) ) {
pci_cmd |= 1<<7;
- pci_write_config_byte(dev, 0x78, pci_cmd);
+ pci_write_config_byte(dev, reg, pci_cmd);
}
return 1;
}
@@ -680,20 +693,25 @@ static int __init longhaul_cpu_init(stru
if (longhaul_version == TYPE_POWERSAVER) {
/* Check ACPI support for C3 state */
cx = &pr->power.states[ACPI_STATE_C3];
- if (cx->address == 0 ||
- (cx->latency > 1000 && ignore_latency == 0) )
+ if (cx->address > 0 &&
+ (cx->latency <= 1000 || ignore_latency != 0) ) {
+ goto print_support_type;
+ }
+ }
+ /* Check ACPI support for bus master arbiter disable */
+ if (!pr->flags.bm_control) {
+ if (enable_arbiter_disable()) {
+ port22_en = 1;
+ } else {
goto err_acpi;
-
- } else {
- /* Check ACPI support for bus master arbiter disable */
- if (!pr->flags.bm_control) {
- if (!enable_arbiter_disable()) {
- printk(KERN_ERR PFX "No ACPI support. No VT8601 host bridge. Aborting.\n");
- return -ENODEV;
- } else
- port22_en = 1;
}
}
+print_support_type:
+ if (!port22_en) {
+ printk (KERN_INFO PFX "Using ACPI support.\n");
+ } else {
+ printk (KERN_INFO PFX "Using northbridge support.\n");
+ }
ret = longhaul_get_ranges();
if (ret != 0)
@@ -716,7 +734,7 @@ static int __init longhaul_cpu_init(stru
return 0;
err_acpi:
- printk(KERN_ERR PFX "No ACPI support for CPU frequency changes.\n");
+ printk(KERN_ERR PFX "No ACPI support. No VT8601 or VT8623 northbridge. Aborting.\n");
return -ENODEV;
}
----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Longhaul - Disable arbiter CLE266
2006-09-26 19:45 Rafał Bilski
@ 2006-09-27 5:06 ` Dave Jones
2006-09-27 6:25 ` Rafał Bilski
0 siblings, 1 reply; 5+ messages in thread
From: Dave Jones @ 2006-09-27 5:06 UTC (permalink / raw)
To: Rafał Bilski; +Cc: cpufreq
On Tue, Sep 26, 2006 at 09:45:05PM +0200, Rafał Bilski wrote:
> Please ignore previous two messages. :-)
>
> This patch is adding support for CPU connected to CLE266
> chipset. For older CPU this is only way. For "Powersaver"
> processor this way will be used if ACPI C3 isn't supported.
>
> Signed-off-by: Rafał Bilski <rafalbilski@interia.pl>
Argh, I already applied the second of the earlier diffs.
Can you send an incremental diff to whats in cpufreq.git?
Thanks,
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Longhaul - Disable arbiter CLE266
2006-09-27 5:06 ` Dave Jones
@ 2006-09-27 6:25 ` Rafał Bilski
0 siblings, 0 replies; 5+ messages in thread
From: Rafał Bilski @ 2006-09-27 6:25 UTC (permalink / raw)
To: Dave Jones; +Cc: cpufreq
[...]
>
> Argh, I already applied the second of the earlier diffs.
> Can you send an incremental diff to whats in cpufreq.git?
>
> Thanks,
>
> Dave
>
>
Here it is. It is removing duplicated code.
Thanks
Rafa³
Signed-off-by: Rafa³ Bilski <rafalbilski@interia.pl>
---
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -581,8 +581,8 @@ static int enable_arbiter_disable(void)
dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, NULL);
/* Find CLE266 host bridge */
if (dev == NULL) {
- dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL);
reg = 0x76;
+ dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL);
}
if (dev != NULL) {
/* Enable access to port 0x22 */
@@ -693,25 +693,20 @@ static int __init longhaul_cpu_init(stru
if (longhaul_version == TYPE_POWERSAVER) {
/* Check ACPI support for C3 state */
cx = &pr->power.states[ACPI_STATE_C3];
- if (cx->address == 0 ||
- (cx->latency > 1000 && ignore_latency == 0) ) {
- if (enable_arbiter_disable()) {
- port22_en = 1;
- } else {
- goto err_acpi;
- }
+ if (cx->address > 0 &&
+ (cx->latency <= 1000 || ignore_latency != 0) ) {
+ goto print_support_type;
}
-
- } else {
- /* Check ACPI support for bus master arbiter disable */
- if (!pr->flags.bm_control) {
- if (enable_arbiter_disable()) {
- port22_en = 1;
- } else {
- goto err_acpi;
- }
+ }
+ /* Check ACPI support for bus master arbiter disable */
+ if (!pr->flags.bm_control) {
+ if (enable_arbiter_disable()) {
+ port22_en = 1;
+ } else {
+ goto err_acpi;
}
}
+print_support_type:
if (!port22_en) {
printk (KERN_INFO PFX "Using ACPI support.\n");
} else {
----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-27 6:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-24 18:28 [PATCH] Longhaul - Disable arbiter CLE266 Rafał Bilski
-- strict thread matches above, loose matches on Subject: below --
2006-09-26 19:45 Rafał Bilski
2006-09-27 5:06 ` Dave Jones
2006-09-27 6:25 ` Rafał Bilski
2006-09-23 5:59 Rafał Bilski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.