]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - Documentation/acpi/dsdt-initrd.txt
ACPI: Add "acpi_no_initrd_override" kernel parameter
[linux-2.6-omap-h63xx.git] / Documentation / acpi / dsdt-initrd.txt
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"