[3ae81e1] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="postlfs-firmware" xreflabel="About Firmware">
|
---|
| 9 | <?dbhtml filename="firmware.html"?>
|
---|
| 10 |
|
---|
| 11 | <sect1info>
|
---|
[d027410] | 12 | <othername>$LastChangedBy$</othername>
|
---|
| 13 | <date>$Date$</date>
|
---|
[3ae81e1] | 14 | </sect1info>
|
---|
| 15 |
|
---|
| 16 | <title>About Firmware</title>
|
---|
| 17 |
|
---|
| 18 | <indexterm zone="postlfs-firmware">
|
---|
| 19 | <primary sortas="e-lib-firmware">/lib/firmware</primary>
|
---|
| 20 | </indexterm>
|
---|
| 21 |
|
---|
| 22 | <para> On some recent PCs it can be necessary, or desirable, to load firmware
|
---|
[aaa73cfd] | 23 | to make them work at their best. There is a directory, <filename
|
---|
[3ae81e1] | 24 | class="directory">/lib/firmware</filename>, where the kernel or kernel
|
---|
[f3429309] | 25 | drivers look for firmware images.</para>
|
---|
| 26 |
|
---|
[3ae81e1] | 27 | <para>Preparing firmware for multiple different machines, as a distro would
|
---|
| 28 | do, is outside the scope of this book.</para>
|
---|
| 29 |
|
---|
| 30 | <para>Currently, most firmware can be found at a <userinput>git</userinput>
|
---|
| 31 | repository: <ulink
|
---|
| 32 | url="http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/"/>.
|
---|
| 33 | For convenience, the LFS Project has created a mirror, updated daily, where
|
---|
[cc8ccd9] | 34 | these firmware files can be accessed via <userinput>wget</userinput> or a web
|
---|
[3ae81e1] | 35 | browser at <ulink
|
---|
[a29486e4] | 36 | url="&sources-anduin-http;/linux-firmware/"/>.</para>
|
---|
[f3429309] | 37 |
|
---|
[fc03210] | 38 | <para>To get the firmware, either point a browser to one of the above
|
---|
[3ae81e1] | 39 | repositories and then download the item(s) which you need, or install
|
---|
| 40 | <userinput>git</userinput> and clone that repository.</para>
|
---|
[f3429309] | 41 |
|
---|
[3ae81e1] | 42 | <para>For some other firmware, particularly for Intel microcode and certain
|
---|
| 43 | wifi devices, the needed firmware is not available in the above repository.
|
---|
| 44 | Some of this will be addressed below, but a search of the Internet for needed
|
---|
| 45 | firmware is sometimes necessary.</para>
|
---|
| 46 |
|
---|
| 47 | <para>Firmware files are conventionally referred to as blobs because you cannot
|
---|
| 48 | determine what they will do. Note that firmware is distributed under various
|
---|
| 49 | different licenses which do not permit disassembly or reverse-engineering.</para>
|
---|
| 50 |
|
---|
| 51 | <para>Firmware for PCs falls into four categories:</para>
|
---|
| 52 |
|
---|
| 53 | <itemizedlist spacing="compact">
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>Updates to the CPU to work around errata, usually referred to as
|
---|
| 56 | microcode.</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[f2d5c26a] | 59 | <para>Firmware for video controllers. On x86 machines this seems to mostly
|
---|
[553cb25] | 60 | apply to ATI devices (Radeon and AMDGPU chips) and Nvidia
|
---|
| 61 | Maxwell and Pascal cards which all require firmware to be able to use KMS
|
---|
[3ae81e1] | 62 | (kernel modesetting - the preferred option) as well as for Xorg. For
|
---|
| 63 | earlier radeon chips (before the R600), the firmware is still in the
|
---|
| 64 | kernel.</para>
|
---|
| 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
| 67 | <para>Firmware updates for wired network ports. Mostly they work even
|
---|
[89bdbf8] | 68 | without the updates, but probably they will work better with
|
---|
| 69 | the updated firmware. For some modern laptops, firmware for both
|
---|
| 70 | wired ethernet (e.g. rtl_nic) and also for bluetooth devices (e.g. qca)
|
---|
| 71 | is <emphasis>required</emphasis> before the wired network can be used.
|
---|
| 72 | </para>
|
---|
[3ae81e1] | 73 | </listitem>
|
---|
| 74 | <listitem>
|
---|
| 75 | <para>Firmware for other devices, such as wifi. These devices are not
|
---|
| 76 | required for the PC to boot, but need the firmware before these devices
|
---|
| 77 | can be used.</para>
|
---|
| 78 | </listitem>
|
---|
| 79 | </itemizedlist>
|
---|
| 80 |
|
---|
[f3429309] | 81 | <note><para>Although not needed to load a firmware blob, the following
|
---|
| 82 | tools may be useful for determining, obtaining, or preparing the needed
|
---|
[3ae81e1] | 83 | firmware in order to load it into the system:
|
---|
| 84 | <xref linkend="cpio"/>,
|
---|
| 85 | <xref linkend="git"/>,
|
---|
| 86 | <xref linkend="pciutils"/>, and
|
---|
| 87 | <xref linkend="wget"/></para></note>
|
---|
| 88 |
|
---|
| 89 | <para condition="html" role="usernotes">User Notes:
|
---|
| 90 | <ulink url="&blfs-wiki;/aboutfirmware"/></para>
|
---|
| 91 |
|
---|
| 92 | <sect2 id="cpu-microcode">
|
---|
| 93 | <title>Microcode updates for CPUs</title>
|
---|
| 94 |
|
---|
| 95 | <para>In general, microcode can be loaded by the BIOS or UEFI, and it might
|
---|
| 96 | be updated by upgrading to a newer version of those. On linux, you can also
|
---|
| 97 | load the microcode from the kernel if you are using an AMD family 10h or
|
---|
[f885719] | 98 | later processor (first introduced late 2007), or an Intel processor from
|
---|
[3ae81e1] | 99 | 1998 and later (Pentium4, Core, etc), if updated microcode has been
|
---|
| 100 | released. These updates only last until the machine is powered off, so they
|
---|
| 101 | need to be applied on every boot.</para>
|
---|
[f3429309] | 102 |
|
---|
[0576c595] | 103 | <para>Intel provide frequent updates of their microcode. It is not uncommon
|
---|
| 104 | to find a newer version of microcode for an Intel processor even two years
|
---|
[58b07a1] | 105 | after its release. New versions of AMD firmware are rare and usually only
|
---|
| 106 | apply to a few models, although motherboard manufacturers get extra updates
|
---|
| 107 | which maybe update microcode along with the changes to support newer CPUs
|
---|
| 108 | and faster memory.</para>
|
---|
[0576c595] | 109 |
|
---|
| 110 | <para>There used to be two ways of loading the microcode, described as 'early'
|
---|
| 111 | and 'late'. Early loading happens before userspace has been started, late
|
---|
| 112 | loading happens after userspace has started. Not surprisingly, early loading
|
---|
| 113 | was preferred, (see e.g. an explanatory comment in a kernel commit noted at
|
---|
[3ae81e1] | 114 | <ulink url="https://lwn.net/Articles/530346/">x86/microcode: Early load
|
---|
| 115 | microcode </ulink> on LWN.) Indeed, it is needed to work around one
|
---|
[f885719] | 116 | particular erratum in early Intel Haswell processors which had TSX enabled.
|
---|
[3ae81e1] | 117 | (See <ulink
|
---|
| 118 | url="http://www.anandtech.com/show/8376/intel-disables-tsx-instructions-erratum-found-in-haswell-haswelleep-broadwellyi/">
|
---|
| 119 | Intel Disables TSX Instructions: Erratum Found in Haswell, Haswell-E/EP,
|
---|
| 120 | Broadwell-Y</ulink>.) Without this update glibc can do the wrong thing in
|
---|
[0576c595] | 121 | uncommon situations. </para>
|
---|
[f3429309] | 122 |
|
---|
[0576c595] | 123 | <para>As a result, early loading is now expected, although for the moment
|
---|
[c79668e] | 124 | (4.18 kernels) it is still possible to manually force late loading of
|
---|
[0576c595] | 125 | microcode for testing. You will need to reconfigure your kernel for either
|
---|
| 126 | method. The instructions here will create a kernel
|
---|
| 127 | <filename>.config</filename> to suite early loading, before forcing late
|
---|
| 128 | loading to see if there is any microcode. If there is, the instructions
|
---|
| 129 | then show you how to create an initrd for early loading.</para>
|
---|
[f3429309] | 130 |
|
---|
[3ae81e1] | 131 | <para>To confirm what processor(s) you have (if more than one, they will be
|
---|
[fc03210] | 132 | identical) look in /proc/cpuinfo.</para>
|
---|
[3ae81e1] | 133 |
|
---|
| 134 | <sect3 id="intel-microcode">
|
---|
| 135 | <title>Intel Microcode for the CPU</title>
|
---|
[ba78ebe2] | 136 |
|
---|
[f2d5c26a] | 137 | <para>The first step is to get the most recent version of the Intel
|
---|
[1ad29630] | 138 | microcode. This must be done by navigating to
|
---|
[89bdbf8] | 139 | <ulink url='https://downloadcenter.intel.com/download/28087/Linux-Processor-Microcode-Data-File'/>
|
---|
[ba78ebe2] | 140 | and following the instructions there. As of this writing the most recent
|
---|
[c79668e] | 141 | version of the microcode is <filename>microcode-20180807.tgz</filename>.
|
---|
[f2d5c26a] | 142 | Extract this file in the normal way to create an <filename>intel-ucode</filename>
|
---|
[3d0e2ff] | 143 | directory, containing various blobs with names in the form XX-YY-ZZ.
|
---|
| 144 | This tarball does not contain a top-level directory, two files
|
---|
| 145 | (microcode.dat which is the old-style of updates, still used by some
|
---|
| 146 | linux distros, and releasenote) will be extracted into the current
|
---|
| 147 | directory.</para>
|
---|
[ba78ebe2] | 148 |
|
---|
[553cb25] | 149 | <note><para>The above URL may not be the latest page. If it is not,
|
---|
[3d0e2ff] | 150 | a line at the top of the page will direct you to the latest page.
|
---|
[7dff3ca] | 151 | </para></note>
|
---|
| 152 |
|
---|
[ba78ebe2] | 153 | <para>Now you need to determine your processor's identity to see if there
|
---|
| 154 | is any microcode for it. Determine the decimal values of the cpu family,
|
---|
[f2d5c26a] | 155 | model and stepping by running the following command (it will also report
|
---|
| 156 | the current microcode version):</para>
|
---|
[3ae81e1] | 157 |
|
---|
| 158 | <screen><userinput>head -n7 /proc/cpuinfo</userinput></screen>
|
---|
| 159 |
|
---|
[ba78ebe2] | 160 | <para>Convert the cpu family, model and stepping to pairs of hexadecimal
|
---|
[0576c595] | 161 | digits. For a Haswell i7-4790 (described as Intel(R) Core(TM) i7-4790
|
---|
| 162 | CPU) the relevant values are cpu family 6, model 60, stepping 3 so in
|
---|
| 163 | this case the required identification is 06-3c-03. A look at the blobs
|
---|
[3ae81e1] | 164 | will show that there is one for this CPU (although it might
|
---|
| 165 | have already been applied by the BIOS). If there is a blob for your
|
---|
| 166 | system then test if it will be applied by copying it (replace <XX-YY-ZZ>
|
---|
[fc03210] | 167 | by the identifier for your machine) to where the kernel can find it:</para>
|
---|
[3ae81e1] | 168 |
|
---|
| 169 | <screen><userinput>mkdir -pv /lib/firmware/intel-ucode
|
---|
[ba78ebe2] | 170 | cp -v intel-ucode/<XX-YY-ZZ> /lib/firmware/intel-ucode</userinput></screen>
|
---|
[3ae81e1] | 171 |
|
---|
[f885719] | 172 | <para>Now that the Intel microcode has been prepared, use the following
|
---|
[0576c595] | 173 | options when you configure the kernel to load Intel
|
---|
[3ae81e1] | 174 | microcode:</para>
|
---|
| 175 |
|
---|
[0576c595] | 176 | <screen><literal>General Setup --->
|
---|
| 177 | [y] Initial RAM filesystem and RAM disk (initramfs/initrd) support [CONFIG_BLK_DEV_INITRD]
|
---|
| 178 | Processor type and features --->
|
---|
| 179 | [y] CPU microcode loading support [CONFIG_MICROCODE]
|
---|
| 180 | [y] Intel microcode loading support [CONFIG_MICROCODE_INTEL]</literal></screen>
|
---|
| 181 |
|
---|
| 182 | <para>After you have successfully booted the new system, force late loading by
|
---|
| 183 | using the command:</para>
|
---|
| 184 |
|
---|
| 185 | <screen><userinput>echo 1 > /sys/devices/system/cpu/microcode/reload</userinput></screen>
|
---|
| 186 |
|
---|
| 187 | <para>Then use the following command to see if anything was loaded:</para>
|
---|
| 188 |
|
---|
| 189 | <screen><userinput>dmesg | grep -e 'microcode' -e 'Linux version' -e 'Command line'</userinput></screen>
|
---|
| 190 |
|
---|
| 191 | <para>This example from the Haswell i7 which was released in Q2 2014 and is
|
---|
[c2c08bac] | 192 | not affected by the TSX errata shows it has been updated from revision 0x19
|
---|
[3d0e2ff] | 193 | in the BIOS/UEFI (which this version of the kernel now complains about) to
|
---|
| 194 | revision 0x24. Unlike in older kernels, the individual CPUs are not separately
|
---|
[1c1bdba] | 195 | reported:</para>
|
---|
| 196 |
|
---|
[c79668e] | 197 | <screen><literal>[ 0.000000] Linux version 4.18.0-rc8 (root@plexi) (gcc version 8.2.0 (GCC))
|
---|
| 198 | #2 SMP PREEMPT Sat Aug 11 22:26:26 BST 2018
|
---|
| 199 | [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.18.0-rc8-sda5 root=/dev/sda5 ro resume=/dev/sdb1
|
---|
[1c1bdba] | 200 | [ 0.000000] [Firmware Bug]: TSC_DEADLINE disabled due to Errata;
|
---|
| 201 | please update microcode to version: 0x22 (or later)
|
---|
| 202 | [ 0.482712] microcode: sig=0x306c3, pf=0x2, revision=0x19
|
---|
[c79668e] | 203 | [ 0.274963] microcode: Microcode Update Driver: v2.2.
|
---|
| 204 | [ 1475.941353] microcode: updated to revision 0x25, date = 2018-04-02
|
---|
| 205 | [ 1475.944753] x86/CPU: CPU features have changed after loading microcode, but might not take effect</literal></screen>
|
---|
[3ae81e1] | 206 |
|
---|
| 207 | <para>If the microcode was not updated, there is no new microcode for
|
---|
| 208 | this system's processor. If it did get updated, you can now proceed to <xref
|
---|
[f3429309] | 209 | linkend='early-microcode'/>.</para>
|
---|
[3ae81e1] | 210 |
|
---|
| 211 | </sect3>
|
---|
| 212 |
|
---|
| 213 | <sect3 id="and-microcode">
|
---|
| 214 | <title>AMD Microcode for the CPU</title>
|
---|
| 215 |
|
---|
| 216 | <para>Begin by downloading a container of firmware for your CPU family
|
---|
| 217 | from <ulink
|
---|
[a29486e4] | 218 | url='&sources-anduin-http;/linux-firmware/amd-ucode/'/>.
|
---|
[3ae81e1] | 219 | The family is always specified in hex. Families 10h to 14h (16 to 20)
|
---|
[58b07a1] | 220 | are in microcode_amd.bin. Families 15h, 16h and 17h have their own containers.
|
---|
[3ae81e1] | 221 | Create the required directory and put the firmware you downloaded into
|
---|
| 222 | it as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 223 |
|
---|
| 224 | <screen><userinput>mkdir -pv /lib/firmware/amd-ucode
|
---|
| 225 | cp -v microcode_amd* /lib/firmware/amd-ucode</userinput></screen>
|
---|
| 226 |
|
---|
[32bc8e4c] | 227 | <para>When you configure the kernel, use the following options
|
---|
| 228 | to load AMD microcode:</para>
|
---|
[0576c595] | 229 |
|
---|
| 230 | <screen><literal>General Setup --->
|
---|
| 231 | [y] Initial RAM filesystem and RAM disk (initramfs/initrd) support [CONFIG_BLK_DEV_INITRD]
|
---|
| 232 | Processor type and features --->
|
---|
| 233 | [y] CPU microcode loading support [CONFIG_MICROCODE]
|
---|
| 234 | [y] AMD microcode loading support [CONFIG_MICROCODE_AMD]</literal></screen>
|
---|
| 235 |
|
---|
| 236 | <para>After you have successfully booted the new system, force late loading by
|
---|
| 237 | using the command:</para>
|
---|
| 238 |
|
---|
| 239 | <screen><userinput>echo 1 > /sys/devices/system/cpu/microcode/reload</userinput></screen>
|
---|
[3ae81e1] | 240 |
|
---|
[0576c595] | 241 | <para>Then use the following command to see if anything was loaded:</para>
|
---|
[3ae81e1] | 242 |
|
---|
[0576c595] | 243 | <screen><userinput>dmesg | grep -e 'microcode' -e 'Linux version' -e 'Command line'</userinput></screen>
|
---|
[c79668e] | 244 | <para>This historic example from an old Athlon(tm) II X2 shows it has been
|
---|
| 245 | updated. At that time, all CPUs were still reported in the microcode details on
|
---|
| 246 | AMD machines (the current position for AMD machines where newer microcode is
|
---|
| 247 | available is unknown) :</para>
|
---|
[3ae81e1] | 248 |
|
---|
[c6d338e] | 249 | <screen><literal>[ 0.000000] Linux version 4.15.3 (ken@testserver) (gcc version 7.3.0 (GCC))
|
---|
| 250 | #1 SMP Sun Feb 18 02:08:12 GMT 2018
|
---|
| 251 | [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.15.3-sda5 root=/dev/sda5 ro
|
---|
| 252 | [ 0.307619] microcode: CPU0: patch_level=0x010000b6
|
---|
| 253 | [ 0.307671] microcode: CPU1: patch_level=0x010000b6
|
---|
| 254 | [ 0.307743] microcode: Microcode Update Driver: v2.2.
|
---|
| 255 | [ 187.928891] microcode: CPU0: new patch_level=0x010000c8
|
---|
| 256 | [ 187.928899] microcode: CPU1: new patch_level=0x010000c8</literal></screen>
|
---|
[3ae81e1] | 257 |
|
---|
| 258 | <para>If the microcode was not updated, there is no new microcode for
|
---|
| 259 | this system's processor. If it did get updated, you can now proceed to <xref
|
---|
[f3429309] | 260 | linkend='early-microcode'/>.</para>
|
---|
[3ae81e1] | 261 |
|
---|
| 262 | </sect3>
|
---|
| 263 |
|
---|
| 264 | <sect3 id="early-microcode">
|
---|
| 265 | <title>Early loading of microcode</title>
|
---|
| 266 |
|
---|
| 267 | <para>If you have established that updated microcode is available for
|
---|
| 268 | your system, it is time to prepare it for early loading. This requires
|
---|
[0576c595] | 269 | an additional package, <xref linkend='cpio'/> and the creation of an
|
---|
| 270 | initrd which will need to be added to grub.cfg.</para>
|
---|
[3ae81e1] | 271 |
|
---|
| 272 | <para>It does not matter where you prepare the initrd, and once it is
|
---|
| 273 | working you can apply the same initrd to later LFS systems or newer
|
---|
| 274 | kernels on this same machine, at least until any newer microcode is
|
---|
[f3429309] | 275 | released. Use the following commands:</para>
|
---|
[3ae81e1] | 276 |
|
---|
| 277 | <screen><userinput>mkdir -p initrd/kernel/x86/microcode
|
---|
| 278 | cd initrd</userinput></screen>
|
---|
| 279 |
|
---|
| 280 | <para>For an AMD machine, use the following command (replace
|
---|
| 281 | <MYCONTAINER> with the name of the container for your CPU's
|
---|
| 282 | family):</para>
|
---|
| 283 |
|
---|
[af8a78d] | 284 | <screen><userinput>cp -v /lib/firmware/amd-ucode/<MYCONTAINER> kernel/x86/microcode/AuthenticAMD.bin</userinput></screen>
|
---|
[3ae81e1] | 285 |
|
---|
| 286 | <para>Or for an Intel machine copy the appropriate blob using this command:</para>
|
---|
| 287 |
|
---|
| 288 | <screen><userinput>cp -v /lib/firmware/intel-ucode/<XX-YY-ZZ> kernel/x86/microcode/GenuineIntel.bin</userinput></screen>
|
---|
| 289 |
|
---|
| 290 | <para>Now prepare the initrd:</para>
|
---|
| 291 |
|
---|
| 292 | <screen><userinput>find . | cpio -o -H newc > /boot/microcode.img</userinput></screen>
|
---|
| 293 |
|
---|
[0576c595] | 294 | <para>You now need to add a new entry to /boot/grub/grub.cfg and
|
---|
[3ae81e1] | 295 | here you should add a new line after the linux line within the stanza.
|
---|
| 296 | If /boot is a separate mountpoint: </para>
|
---|
| 297 |
|
---|
| 298 | <screen><userinput>initrd /microcode.img</userinput></screen>
|
---|
| 299 |
|
---|
| 300 | <para>or this if it is not:</para>
|
---|
| 301 |
|
---|
| 302 | <screen><userinput>initrd /boot/microcode.img</userinput></screen>
|
---|
| 303 |
|
---|
[a7c5f47] | 304 | <para>If you are already booting with an initrd (see <xref
|
---|
| 305 | linkend="initramfs"/>) you must specify the microcode initrd first, using
|
---|
| 306 | a line such as <userinput>initrd /microcode.img
|
---|
| 307 | /other-initrd.img</userinput> (adapt that as above if /boot is not a
|
---|
| 308 | separate mountpoint).</para>
|
---|
| 309 |
|
---|
[0576c595] | 310 | <para>You can now reboot with the added initrd, and then use the same
|
---|
| 311 | command to check that the early load worked.</para>
|
---|
[3ae81e1] | 312 |
|
---|
[0576c595] | 313 | <screen><userinput>dmesg | grep -e 'microcode' -e 'Linux version' -e 'Command line'</userinput></screen>
|
---|
| 314 |
|
---|
| 315 | <para>The places and times where early loading happens are very different
|
---|
[f2d5c26a] | 316 | in AMD and Intel machines. First, an Intel example from an updated
|
---|
[0576c595] | 317 | kernel, showing that the first notification comes before the kernel version
|
---|
| 318 | is mentioned:</para>
|
---|
| 319 |
|
---|
[c79668e] | 320 | <screen><literal>[ 0.000000] microcode: microcode updated early to revision 0x25, date = 2018-04-02
|
---|
| 321 | [ 0.000000] Linux version 4.18.1-rc1 (ken@plexi) (gcc version 8.2.0 (GCC))
|
---|
| 322 | #2 SMP PREEMPT Tue Aug 14 20:22:35 BST 2018
|
---|
| 323 | [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.18.1-rc1-sda5 root=/dev/sda5 ro resume=/dev/sdb1
|
---|
| 324 | [ 0.275864] microcode: sig=0x306c3, pf=0x2, revision=0x25
|
---|
| 325 | [ 0.275911] microcode: Microcode Update Driver: v2.2.</literal></screen>
|
---|
[0576c595] | 326 |
|
---|
[c79668e] | 327 | <para>A historic AMD example:</para>
|
---|
[0576c595] | 328 |
|
---|
[c6d338e] | 329 | <screen><literal>[ 0.000000] Linux version 4.15.3 (ken@testserver) (gcc version 7.3.0 (GCC))
|
---|
| 330 | #2 SMP Sun Feb 18 02:32:03 GMT 2018
|
---|
| 331 | [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.15.3-sda5 root=/dev/sda5 ro
|
---|
| 332 | [ 0.307619] microcode: microcode updated early to new patch_level=0x010000c8
|
---|
| 333 | [ 0.307678] microcode: CPU0: patch_level=0x010000c8
|
---|
| 334 | [ 0.307723] microcode: CPU1: patch_level=0x010000c8
|
---|
| 335 | [ 0.307795] microcode: Microcode Update Driver: v2.2.</literal></screen>
|
---|
[3ae81e1] | 336 |
|
---|
| 337 | </sect3>
|
---|
| 338 |
|
---|
| 339 | </sect2>
|
---|
| 340 |
|
---|
[1cc5345] | 341 | <sect2 id="video-firmware">
|
---|
| 342 | <title>Firmware for Video Cards</title>
|
---|
| 343 |
|
---|
| 344 | <sect3 id="ati-video-firmware">
|
---|
[3ae81e1] | 345 | <title>Firmware for ATI video chips (R600 and later)</title>
|
---|
[f3429309] | 346 |
|
---|
[3ae81e1] | 347 | <para>These instructions do NOT apply to old radeons before the R600
|
---|
| 348 | family. For those, the firmware is in the kernel's <filename
|
---|
| 349 | class='directory'>/lib/firmware/</filename> directory. Nor do they apply if
|
---|
| 350 | you intend to avoid a graphical setup such as Xorg and are content to use
|
---|
| 351 | the default 80x25 display rather than a framebuffer. </para>
|
---|
| 352 |
|
---|
| 353 | <para> Early radeon devices only needed a single 2K blob of firmware.
|
---|
| 354 | Recent devices need several different blobs, and some of them are much
|
---|
| 355 | bigger. The total size of the radeon firmware directory is over 500K — on a
|
---|
| 356 | large modern system you can probably spare the space, but it is still
|
---|
| 357 | redundant to install all the unused files each time you build a system.</para>
|
---|
| 358 |
|
---|
| 359 | <para>A better approach is to install <xref linkend='pciutils'/> and then
|
---|
| 360 | use <userinput>lspci</userinput> to identify which VGA controller is
|
---|
| 361 | installed.</para>
|
---|
| 362 |
|
---|
| 363 | <para>With that information, check the RadeonFeature page of the Xorg wiki
|
---|
| 364 | for <ulink url="http://wiki.x.org/wiki/RadeonFeature/#index5h2">Decoder
|
---|
| 365 | ring for engineering vs marketing names</ulink> to identify the family (you
|
---|
| 366 | may need to know this for the Xorg driver in BLFS — Southern Islands and
|
---|
| 367 | Sea Islands use the radeonsi driver) and the specific model.</para>
|
---|
| 368 |
|
---|
[f3429309] | 369 | <para>Now that you know which controller you are using, consult the
|
---|
[3ae81e1] | 370 | <ulink url="https://wiki.gentoo.org/wiki/Radeon#Firmware">Radeon</ulink> page
|
---|
| 371 | of the Gentoo wiki which has a table listing the required firmware blobs
|
---|
| 372 | for the various chipsets. Note that Southern Islands and Sea Islands chips
|
---|
| 373 | use different firmware for kernel 3.17 and later compared to earlier
|
---|
| 374 | kernels. Identify and download the required blobs then install them:</para>
|
---|
| 375 |
|
---|
| 376 | <screen><userinput>mkdir -pv /lib/firmware/radeon
|
---|
| 377 | cp -v <YOUR_BLOBS> /lib/firmware/radeon</userinput></screen>
|
---|
| 378 |
|
---|
| 379 | <para>There are actually two ways of installing this firmware. BLFS, in the
|
---|
| 380 | 'Kernel Configuration for additional firmware' section part of the <xref
|
---|
| 381 | linkend="xorg-ati-driver"/> section gives an example of compiling the
|
---|
| 382 | firmware into the kernel - that is slightly faster to load, but uses more
|
---|
| 383 | kernel memory. Here we will use the alternative method of making the radeon
|
---|
| 384 | driver a module. In your kernel config set the following: </para>
|
---|
| 385 |
|
---|
| 386 | <screen><literal>Device Drivers --->
|
---|
| 387 | Graphics support --->
|
---|
| 388 | Direct Rendering Manager --->
|
---|
[1cc5345] | 389 | <*> Direct Rendering Manager (XFree86 ... support) [CONFIG_DRM]
|
---|
| 390 | <m> ATI Radeon [CONFIG_DRM_RADEON]</literal></screen>
|
---|
[3ae81e1] | 391 |
|
---|
| 392 | <para>Loading several large blobs from /lib/firmware takes a noticeable
|
---|
| 393 | time, during which the screen will be blank. If you do not enable the
|
---|
| 394 | penguin framebuffer logo, or change the console size by using a bigger
|
---|
| 395 | font, that probably does not matter. If desired, you can slightly
|
---|
| 396 | reduce the time if you follow the alternate method of specifying 'y' for
|
---|
| 397 | CONFIG_DRM_RADEON covered in BLFS at the link above — you must specify each
|
---|
| 398 | needed radeon blob if you do that.</para>
|
---|
| 399 |
|
---|
[1cc5345] | 400 | </sect3>
|
---|
| 401 |
|
---|
| 402 | <sect3 id="nvidia-video-firmware">
|
---|
| 403 | <title>Firmware for Nvidia video chips</title>
|
---|
| 404 |
|
---|
| 405 | <para>Some Nvidia graphics chips need firmware updates to take advantage
|
---|
| 406 | of all the card's capability. These are generally the GeForce 8, 9, 9300,
|
---|
| 407 | and 200-900 series chips. For more exact information, see <ulink
|
---|
| 408 | url="https://nouveau.freedesktop.org/wiki/VideoAcceleration/#firmware">
|
---|
| 409 | https://nouveau.freedesktop.org/wiki/VideoAcceleration/#firmware</ulink>.</para>
|
---|
| 410 |
|
---|
| 411 | <para>First, the kernel Nvidia driver must be activated:</para>
|
---|
| 412 |
|
---|
| 413 | <screen><literal>Device Drivers --->
|
---|
| 414 | Graphics support --->
|
---|
| 415 | Direct Rendering Manager --->
|
---|
| 416 | <*> Direct Rendering Manager (XFree86 ... support) [CONFIG_DRM]
|
---|
| 417 | <*/m> Nouveau (NVIDIA) cards [CONFIG_DRM_NOUVEAU]</literal></screen>
|
---|
| 418 |
|
---|
| 419 | <para>The steps to install the Nvidia firmware are:</para>
|
---|
| 420 |
|
---|
| 421 | <screen><userinput>wget https://raw.github.com/imirkin/re-vp2/master/extract_firmware.py
|
---|
| 422 | wget http://us.download.nvidia.com/XFree86/Linux-x86/325.15/NVIDIA-Linux-x86-325.15.run
|
---|
| 423 | sh NVIDIA-Linux-x86-325.15.run --extract-only
|
---|
| 424 | python extract_firmware.py
|
---|
| 425 | mkdir -p /lib/firmware/nouveau
|
---|
| 426 | cp -d nv* vuc-* /lib/firmware/nouveau/</userinput></screen>
|
---|
| 427 |
|
---|
| 428 | </sect3>
|
---|
[3ae81e1] | 429 | </sect2>
|
---|
| 430 |
|
---|
| 431 | <sect2 id="nic-firmware">
|
---|
| 432 | <title>Firmware for Network Interfaces</title>
|
---|
| 433 |
|
---|
| 434 | <para>The kernel likes to load firmware for some network drivers,
|
---|
| 435 | particularly those from Realtek (the /lib/linux-firmware/rtl_nic/) directory,
|
---|
| 436 | but they generally appear to work without it. Therefore, you can boot the
|
---|
| 437 | kernel, check dmesg for messages about this missing firmware, and if
|
---|
| 438 | necessary download the firmware and put it in the specified directory in
|
---|
| 439 | /lib/firmware so that it will be found on subsequent boots. Note that with
|
---|
| 440 | current kernels this works whether or not the driver is compiled in or
|
---|
| 441 | built as a module, there is no need to build this firmware into the kernel.
|
---|
| 442 | Here is an example where the R8169 driver has been compiled in but the
|
---|
| 443 | firmware was not made available. Once the firmware had been provided, there
|
---|
| 444 | was no mention of it on later boots. </para>
|
---|
| 445 |
|
---|
| 446 | <screen><literal>dmesg | grep firmware | grep r8169
|
---|
| 447 | [ 7.018028] r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8168g-2.fw failed with error -2
|
---|
| 448 | [ 7.018036] r8169 0000:01:00.0 eth0: unable to load firmware patch rtl_nic/rtl8168g-2.fw (-2)</literal></screen>
|
---|
| 449 |
|
---|
| 450 | </sect2>
|
---|
| 451 |
|
---|
| 452 | <sect2 id="other-firmware">
|
---|
| 453 | <title>Firmware for Other Devices</title>
|
---|
| 454 |
|
---|
| 455 | <para> Identifying the correct firmware will typically require you to
|
---|
| 456 | install <xref linkend='pciutils'/>, and then use
|
---|
| 457 | <userinput>lspci</userinput> to identify the device. You should then search
|
---|
| 458 | online to check which module it uses, which firmware, and where to obtain
|
---|
| 459 | the firmware — not all of it is in linux-firmware.</para>
|
---|
[f3429309] | 460 |
|
---|
[3ae81e1] | 461 | <para>If possible, you should begin by using a wired connection when you
|
---|
| 462 | first boot your LFS system. To use a wireless connection you will need to
|
---|
| 463 | use a network tools such as <xref linkend='wireless_tools'/> and <xref
|
---|
| 464 | linkend='wpa_supplicant'/>.</para>
|
---|
[f3429309] | 465 |
|
---|
[3ae81e1] | 466 | <para>Firmware may also be needed for other devices such as some SCSI
|
---|
| 467 | controllers, bluetooth adaptors, or TV recorders. The same principles
|
---|
| 468 | apply.</para>
|
---|
| 469 |
|
---|
| 470 | </sect2>
|
---|
| 471 |
|
---|
| 472 | </sect1>
|
---|