-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 79707 b: refs/heads/master c: b02aae9 h: refs/heads/master i: 79705: ce7ee98 79703: 93ff2e0 v: v3
- Loading branch information
Rene Herman
authored and
Ingo Molnar
committed
Jan 30, 2008
1 parent
8b6051a
commit a861994
Showing
12 changed files
with
166 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 4c6b8b4d62fb4cb843c32db71e0a8301039908f3 | ||
refs/heads/master: b02aae9cf52956dfe1bec73f77f81a3d05d3902b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* I/O delay strategies for inb_p/outb_p | ||
*/ | ||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
#include <linux/init.h> | ||
#include <linux/delay.h> | ||
#include <linux/dmi.h> | ||
#include <asm/io.h> | ||
|
||
/* | ||
* Allow for a DMI based override of port 0x80 needed for certain HP laptops | ||
*/ | ||
#define IO_DELAY_PORT_STD 0x80 | ||
#define IO_DELAY_PORT_ALT 0xed | ||
|
||
static void standard_io_delay(void) | ||
{ | ||
asm volatile ("outb %%al, %0" : : "N" (IO_DELAY_PORT_STD)); | ||
} | ||
|
||
static void alternate_io_delay(void) | ||
{ | ||
asm volatile ("outb %%al, %0" : : "N" (IO_DELAY_PORT_ALT)); | ||
} | ||
|
||
/* | ||
* 2 usecs is an upper-bound for the outb delay but note that udelay doesn't | ||
* have the bus-level side-effects that outb does | ||
*/ | ||
#define IO_DELAY_USECS 2 | ||
|
||
/* | ||
* High on a hill was a lonely goatherd | ||
*/ | ||
static void udelay_io_delay(void) | ||
{ | ||
udelay(IO_DELAY_USECS); | ||
} | ||
|
||
#ifndef CONFIG_UDELAY_IO_DELAY | ||
static void (*io_delay)(void) = standard_io_delay; | ||
#else | ||
static void (*io_delay)(void) = udelay_io_delay; | ||
#endif | ||
|
||
/* | ||
* Paravirt wants native_io_delay to be a constant. | ||
*/ | ||
void native_io_delay(void) | ||
{ | ||
io_delay(); | ||
} | ||
EXPORT_SYMBOL(native_io_delay); | ||
|
||
#ifndef CONFIG_UDELAY_IO_DELAY | ||
static int __init dmi_alternate_io_delay_port(const struct dmi_system_id *id) | ||
{ | ||
printk(KERN_NOTICE "%s: using alternate I/O delay port\n", id->ident); | ||
io_delay = alternate_io_delay; | ||
return 0; | ||
} | ||
|
||
static struct dmi_system_id __initdata alternate_io_delay_port_dmi_table[] = { | ||
{ | ||
.callback = dmi_alternate_io_delay_port, | ||
.ident = "HP Pavilion dv9000z", | ||
.matches = { | ||
DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), | ||
DMI_MATCH(DMI_BOARD_NAME, "30B9") | ||
} | ||
}, | ||
{ | ||
} | ||
}; | ||
|
||
static int __initdata io_delay_override; | ||
|
||
void __init io_delay_init(void) | ||
{ | ||
if (!io_delay_override) | ||
dmi_check_system(alternate_io_delay_port_dmi_table); | ||
} | ||
#endif | ||
|
||
static int __init io_delay_param(char *s) | ||
{ | ||
if (!s) | ||
return -EINVAL; | ||
|
||
if (!strcmp(s, "standard")) | ||
io_delay = standard_io_delay; | ||
else if (!strcmp(s, "alternate")) | ||
io_delay = alternate_io_delay; | ||
else if (!strcmp(s, "udelay")) | ||
io_delay = udelay_io_delay; | ||
else | ||
return -EINVAL; | ||
|
||
#ifndef CONFIG_UDELAY_IO_DELAY | ||
io_delay_override = 1; | ||
#endif | ||
return 0; | ||
} | ||
|
||
early_param("io_delay", io_delay_param); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters