diff options
Diffstat (limited to 'Documentation/acpi')
-rw-r--r-- | Documentation/acpi/dsdt-initrd.txt | 99 | ||||
-rw-r--r-- | Documentation/acpi/dsdt-override.txt | 15 | ||||
-rwxr-xr-x | Documentation/acpi/initramfs-add-dsdt.sh | 43 |
3 files changed, 58 insertions, 99 deletions
diff --git a/Documentation/acpi/dsdt-initrd.txt b/Documentation/acpi/dsdt-initrd.txt deleted file mode 100644 index 736043359dfb..000000000000 --- a/Documentation/acpi/dsdt-initrd.txt +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | ACPI Custom DSDT read from initramfs | ||
2 | |||
3 | 2003 by Markus Gaugusch < dsdt at gaugusch dot at > | ||
4 | Special thanks go to Thomas Renninger from SuSE, who updated the patch for | ||
5 | 2.6.0 and later modified it to read inside initramfs | ||
6 | 2004 - 2008 maintained by Eric Piel < eric dot piel at tremplin-utc dot net > | ||
7 | |||
8 | This option is intended for people who would like to hack their DSDT and don't | ||
9 | want to recompile their kernel after every change. It can also be useful to | ||
10 | distros which offers pre-compiled kernels and want to allow their users to use | ||
11 | a modified DSDT. In the Kernel config, enable the initial RAM filesystem | ||
12 | support (in General Setup) and enable ACPI_CUSTOM_DSDT_INITRD at the ACPI | ||
13 | options (General Setup|ACPI Support|Read Custom DSDT from initramfs). | ||
14 | |||
15 | A custom DSDT (Differentiated System Description Table) is useful when your | ||
16 | computer uses ACPI but problems occur due to broken implementation. Typically, | ||
17 | your computer works but there are some troubles with the hardware detection or | ||
18 | the power management. You can check that troubles come from errors in the DSDT by | ||
19 | activating the ACPI debug option and reading the logs. This table is provided | ||
20 | by the BIOS, therefore it might be a good idea to check for BIOS update on your | ||
21 | vendor website before going any further. Errors are often caused by vendors | ||
22 | testing their hardware only with Windows or because there is code which is | ||
23 | executed only on a specific OS with a specific version and Linux hasn't been | ||
24 | considered during the development. | ||
25 | |||
26 | Before you run away from customising your DSDT, you should note that already | ||
27 | corrected tables are available for a fair amount of computers on this web-page: | ||
28 | http://acpi.sf.net/dsdt . Be careful though, to work correctly a DSDT has to | ||
29 | match closely the hardware, including the amount of RAM, the frequency of the | ||
30 | processor and the PCI cards present! If you are part of the unluckies who | ||
31 | cannot find their hardware in this database, you can modify your DSDT by | ||
32 | yourself. This process is less painful than it sounds. Download the Intel ASL | ||
33 | compiler/decompiler at http://www.intel.com/technology/IAPC/acpi/downloads.htm . | ||
34 | As root, you then have to dump your DSDT and decompile it. By using the | ||
35 | compiler messages as well as the kernel ACPI debug messages and the reference | ||
36 | book (available at the Intel website and also at http://www.acpi.info), it is | ||
37 | quite easy to obtain a fully working table. | ||
38 | |||
39 | Once your new DSDT is ready you'll have to add it to an initramfs so that the | ||
40 | kernel can read the table at the very beginning of the boot. As the file has to | ||
41 | be accessed very early during the boot process the initramfs has to be an | ||
42 | initramfs. The file is contained into the initramfs under the name /DSDT.aml . | ||
43 | To obtain such an initramfs, you might have to modify your initramfs script or | ||
44 | you can add it later to the initramfs with the script appended to this | ||
45 | document. The command will look like: | ||
46 | initramfs-add-dsdt initramfs.img my-dsdt.aml | ||
47 | |||
48 | In case you don't use any initramfs, the possibilities you have are to either | ||
49 | start using one (try mkinitrd or yaird), or use the "Include Custom DSDT" | ||
50 | configure option to directly include your DSDT inside the kernel. | ||
51 | |||
52 | The message "Looking for DSDT in initramfs..." will tell you if the DSDT was | ||
53 | found or not. If you need to update your DSDT, generate a new initramfs and | ||
54 | perform the steps above. Don't forget that with Lilo, you'll have to re-run it. | ||
55 | |||
56 | |||
57 | ====================== Here starts initramfs-add-dsdt ========================== | ||
58 | #!/bin/bash | ||
59 | # Adds a DSDT file to the initrd (if it's an initramfs) | ||
60 | # first argument is the name of archive | ||
61 | # second argument is the name of the file to add | ||
62 | # The file will be copied as /DSDT.aml | ||
63 | |||
64 | # 20060126: fix "Premature end of file" with some old cpio (Roland Robic) | ||
65 | # 20060205: this time it should really work | ||
66 | |||
67 | # check the arguments | ||
68 | if [ $# -ne 2 ]; then | ||
69 | program_name=$(basename $0) | ||
70 | echo "\ | ||
71 | $program_name: too few arguments | ||
72 | Usage: $program_name initrd-name.img DSDT-to-add.aml | ||
73 | Adds a DSDT file to an initrd (in initramfs format) | ||
74 | |||
75 | initrd-name.img: filename of the initrd in initramfs format | ||
76 | DSDT-to-add.aml: filename of the DSDT file to add | ||
77 | " 1>&2 | ||
78 | exit 1 | ||
79 | fi | ||
80 | |||
81 | # we should check it's an initramfs | ||
82 | |||
83 | tempcpio=$(mktemp -d) | ||
84 | # cleanup on exit, hangup, interrupt, quit, termination | ||
85 | trap 'rm -rf $tempcpio' 0 1 2 3 15 | ||
86 | |||
87 | # extract the archive | ||
88 | gunzip -c "$1" > "$tempcpio"/initramfs.cpio || exit 1 | ||
89 | |||
90 | # copy the DSDT file at the root of the directory so that we can call it "/DSDT.aml" | ||
91 | cp -f "$2" "$tempcpio"/DSDT.aml | ||
92 | |||
93 | # add the file | ||
94 | cd "$tempcpio" | ||
95 | (echo DSDT.aml | cpio --quiet -H newc -o -A -O "$tempcpio"/initramfs.cpio) || exit 1 | ||
96 | cd "$OLDPWD" | ||
97 | |||
98 | # re-compress the archive | ||
99 | gzip -c "$tempcpio"/initramfs.cpio > "$1" | ||
diff --git a/Documentation/acpi/dsdt-override.txt b/Documentation/acpi/dsdt-override.txt new file mode 100644 index 000000000000..5008f256a2db --- /dev/null +++ b/Documentation/acpi/dsdt-override.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | Linux supports two methods of overriding the BIOS DSDT: | ||
2 | |||
3 | CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel. | ||
4 | |||
5 | CONFIG_ACPI_CUSTOM_DSDT_INITRD adds the image to the initrd. | ||
6 | |||
7 | When to use these methods is described in detail on the | ||
8 | Linux/ACPI home page: | ||
9 | http://www.lesswatts.org/projects/acpi/overridingDSDT.php | ||
10 | |||
11 | Note that if both options are used, the DSDT supplied | ||
12 | by the INITRD method takes precedence. | ||
13 | |||
14 | Documentation/initramfs-add-dsdt.sh is provided for convenience | ||
15 | for use with the CONFIG_ACPI_CUSTOM_DSDT_INITRD method. | ||
diff --git a/Documentation/acpi/initramfs-add-dsdt.sh b/Documentation/acpi/initramfs-add-dsdt.sh new file mode 100755 index 000000000000..17ef6e838e14 --- /dev/null +++ b/Documentation/acpi/initramfs-add-dsdt.sh | |||
@@ -0,0 +1,43 @@ | |||
1 | #!/bin/bash | ||
2 | # Adds a DSDT file to the initrd (if it's an initramfs) | ||
3 | # first argument is the name of archive | ||
4 | # second argument is the name of the file to add | ||
5 | # The file will be copied as /DSDT.aml | ||
6 | |||
7 | # 20060126: fix "Premature end of file" with some old cpio (Roland Robic) | ||
8 | # 20060205: this time it should really work | ||
9 | |||
10 | # check the arguments | ||
11 | if [ $# -ne 2 ]; then | ||
12 | program_name=$(basename $0) | ||
13 | echo "\ | ||
14 | $program_name: too few arguments | ||
15 | Usage: $program_name initrd-name.img DSDT-to-add.aml | ||
16 | Adds a DSDT file to an initrd (in initramfs format) | ||
17 | |||
18 | initrd-name.img: filename of the initrd in initramfs format | ||
19 | DSDT-to-add.aml: filename of the DSDT file to add | ||
20 | " 1>&2 | ||
21 | exit 1 | ||
22 | fi | ||
23 | |||
24 | # we should check it's an initramfs | ||
25 | |||
26 | tempcpio=$(mktemp -d) | ||
27 | # cleanup on exit, hangup, interrupt, quit, termination | ||
28 | trap 'rm -rf $tempcpio' 0 1 2 3 15 | ||
29 | |||
30 | # extract the archive | ||
31 | gunzip -c "$1" > "$tempcpio"/initramfs.cpio || exit 1 | ||
32 | |||
33 | # copy the DSDT file at the root of the directory so that we can call it "/DSDT.aml" | ||
34 | cp -f "$2" "$tempcpio"/DSDT.aml | ||
35 | |||
36 | # add the file | ||
37 | cd "$tempcpio" | ||
38 | (echo DSDT.aml | cpio --quiet -H newc -o -A -O "$tempcpio"/initramfs.cpio) || exit 1 | ||
39 | cd "$OLDPWD" | ||
40 | |||
41 | # re-compress the archive | ||
42 | gzip -c "$tempcpio"/initramfs.cpio > "$1" | ||
43 | |||