--- title: Flashing the Dell Latitude E6400 x-toc-enable: true ... Introduction ============ Initial flashing instructions for the E6400. **ROM images are available in the [Libreboot 20230423 release](../../news/libreboot20230423.md), and subsequent releases.** **Variants with Nvidia GPUs are NOT supported in Libreboot 20230423 or 20230625. Please see below for further guidance (experimental support available in `lbmk.git`).** This guide is for those who want libreboot on their Latitude E6400 while they still have the original Dell BIOS present. This guide can also be followed (adapted) if you brick your E6400, and you want to recover it. Variants (nvidia or intel graphics) ======== Dell E6400, E6400 XFR and E6400 ATG are all believed to work. The flashing instructions are identical, on all of them. Blob-free initialisation (on Intel GPU variants) ========================= This board can boot entirely blob-free in the flash. The hardware is similar to that of ThinkPad X200, T400 etc where no-ME setup is possible. No-microcode setup feasible ---------------------------- The [microcode bugfixes/mitigations added for GM45](../../news/gm45microcode.md) are also applicable to this board, for users who are interested. Read that article for more information. Libreboot still recommends that boot with CPU microcode updates, by default, for all the reasons described by Libreboot's [Binary Blobs Reductions Policy](../../news/policy.md) but this board run reasonably well without them. A note about GPUs ----------------- We *confirm that* the Nvidia models are PM45, and therefore will require a VGA blob for initialisation. This is [experimentally supported](../../news/e6400nvidia.md) in Libreboot. - **A Video BIOS Option ROM is used, in this configuration, which is a binary blob. Libreboot's build system automatically downloads this at build time, or it can handle that for you in the same way if it was scrubbed from a release ROM.** Models with Intel graphics are GM45, and fully supported in Libreboot with native initialisation; ROM images are available since Libreboot 20230423. **The Intel video initialisation is libre, implemented with publicly available source code via libgfxinit, from the coreboot project.** Flash chip size {#flashchips} =============== Use this to find out: flashrom -p internal We believe most/all are 4MB (32Mb) flash sizes, but larger ROM images are provided for people who wish to upgrade. MAC address {#macaddress} =========== The MAC address is part of the ROM image that you're flashing. You can change it at any time, before or after you've flashed Libreboot; you can also change it in the *Dell* BIOS, if you really want to. This is for the onboard gigabit ethernet device. Refer to [mac\_address.md](../hardware/mac_address.md). It is recommended that you run *nvmutil*. See: [nvmutil usage manual](nvmutil.md) The `nvmutil` software is specifically designed for changing MAC addresses, and it implements a few more safeguards (e.g. prevents multicast/all-zero MAC addresses) and features (MAC address randomisation, ability to correct or intententionally corrupt(disable) GbE sections if you wish, swap GbE parts, etc). You can *also* run ich9gen, if you wish: [ich9gen usage manual](ich9utils.md) Intel GPU: libre video initialisation available =============================================== Libreboot uses coreboot's native `libgfxinit` on this platform, for variants with Intel graphics. For Intel GPU variants, Libreboot 20230423 and up have full support. Simply flash a release ROM, if you wish. Nvidia GPU: Video BIOS Option ROM required ========================================== **NOTE: `nouveau` (Linux video driver) is unstable when it was last tested, in this setup. Either specify `nomodeset` kernel option, or use another operating system such as OpenBSD. More information is written on the [E6400 hardware page](../hardware/e6400.md), regarding OS compatibility.** This is *unavailable* in Libreboot 20230423 and 20230625, but a future release will contain support for these variants; for now, you must compile Libreboot from Git. Download the Libreboot build system, lbmk, like so: git clone https://codeberg.org/libreboot/lbmk When you clone the Libreboot git repository `lbmk.git`, go in there and do this: git checkout e6400nvidia_wip Actual installation is the same as with regular E6400 (Intel GPU) variants. Refer to the [E6400 flashing instructions](../docs/install/e6400.md). The `e6400nvidia_wip` is used, because this version is still under development. Refer to [development discussion](https://codeberg.org/libreboot/lbmk/issues/14#issuecomment-907758) for more information - [testers needed!](../maintain/testing.md) Obtaining the VGA Option ROM (Nvidia) ------------------------------------- Libreboot does not (and will not) directly distribute the Nvidia ROM, but this WIP branch has logic added to `blobutil`, which automatically fetches Dell update files and extracts the Video BIOS from it. This is inserted during the build process, *automatically*. Everything has been figured out *for you*, as is the purpose of Libreboot's [automated build system](../maintain/). In Libreboot release ROMs after Libreboot 20230423, this Video BIOS ROM will *not* be present, but you'll be able to run the same script that lbmk uses, to manually re-download and re-add it. The Libreboot build system scrubs certain binary blobs, in the scripts from lbmk that create release archives. [Please read the Libreboot build guide](../build/) for more general guidance on compiling Libreboot. You should *especially* set name/email in Git, like so: git config --global user.name "John Doe" git config --global user.email "you@example.com" Ensure that the `python` command on your system is python *3*, not 2. You should ensure that you have the correct *build dependencies* installed; check the script names inside `resources/scripts/build/dependencies` and pick one that matches your Linux distro; if one isn't available, adapt accordingly. Then run it as root. For example, on Debian (stable, testing or sid all confirmed to work, as of 9 May 2023): ./build dependencies debian With build dependencies installed, and Git configured, you may then run lbmk commands to compile the ROM image. Libreboot's `blobutil`, while in the `e6400nvidia_wip` branch, can be executed like so: ./blobutil download e6400nvidia_4mb *The above command is executed automatically, when Libreboot's build system is called, to build the full E6400 ROM image like so:* ./build boot roms e6400nvidia_4mb The `download` command (see above) pulls down Dell's BIOS update (A34 release), and extracts the VGA ROM from that. This is then saved to `pciroms/` under lbmk. The `./build boot roms` command (see above) automatically inserts this PCI ROM, and it is downloaded automatically if the PCI ROM is missing; if downloading and/or extraction (of the Option ROM) fails, the entire build process will fail (non-zero exit status). DO NOT flash it until you confirm that the build went successfully. For example, try: make -BC coreboot/default/util/cbfstool/cbfstool cp coreboot/default/util/cbfstool/cbfstool . Then check the E6400 ROM under `bin/`. Let's say the ROM was named `libreboot.rom`, you would do: ./cbfstool libreboot.rom print This would print the files that have been inserted into the ROM image (rom stage, car, payloads etc), and it should list the PCI option ROM as the following file, by name: `pci10de,06eb.rom`. DO NOT flash it unless that file is present. If you've confirmed that the ROM has compiled successfully, you can flash it. **BEFORE** you flash it, please know that support for Nvidia variants is a **work in progress**. Known issues exist. For more information, please read the [E6400 info page](../hardware/e6400.md), [E6400 nvidia news page](../../news/e6400nvidia.md) and the [development discussion via codeberg](https://codeberg.org/libreboot/lbmk/issues/14#issuecomment-907758). How to flash internally (no diassembly) ======================================= Warning for BSD users --------------------- BSD *boots* and works properly on these machines, but take note: Nicholas's [e6400-flash-unlock](https://browse.libreboot.org/lbmk.git/plain/util/e6400-flash-unlock/e6400_flash_unlock.c) utility has not yet been ported to BSD systems. The `flashrom` software is available on BSD systems. Libreboot's build system has not yet been ported to the BSDs. BSD users could run Linux from USB to run `flashrom` and `e6400-flash-unlock`. Virtualisation is available in BSDs, where it should be feasible to run the Libreboot build system, in Linux, under virtualisation. Flashing from Linux ------------------- MAKE SURE you boot with this Linux kernel parameter: `iomem=relaxed` - this disables memory protections, permitting `/dev/mem` access needed by flashrom. The flash is memory mapped and flashrom accesses it via `/dev/mem`. You can flash Libreboot directly from the vendor (Dell) BIOS, without taking the machine apart. It can be done entirely from Linux. It will probably also work on BSD systems, but it has only been testing on Linux thus far. Check `util/e6400-flash-unlock` in the `lbmk.git` repository, or in release archives for Libreboot releases from 20230423 onwards. Go in there: cd util/e6400-flash-unlock make With this program, you can unlock the flash in such a way where everything is writeable. Information about how to use it is in the `README.md` file which is included in that program's directory, or you can read it online here: Literally just run that program, and do what it says. You run it once, and shut down, and when you do, the system brings itself back up automatically. Then you run it and flash it unlocked. Then you run it again. The source code is intuitive enough that you can easily get the gist of it; it's writing some EC commands and changing some chipset config bits. The EC on this machine is hooked up to the `GPIO33` signal, sometimes called `HDA_DOCK_EN`, which sets the flash descriptor override thus disabling any flash protection by the IFD. It also bypasses the SMM BIOS lock protection by disabling SMIs, and Dell's BIOS doesn't set any other type of protection either such as writing to Protected Range registers. When you flash it, you can use this command: flashrom -p internal -w libreboot.rom Where `libreboot.rom` is your E6400 ROM. *Make sure* it's the right one. If flashrom complains about multiple flash chips detected, just pick one of them (doesn't matter which one). On *most* Dell machines, the most correct would probably be this option in flashrom: `-c MX25L3205D/MX25L3208D`. So: flashrom -p internal -w libreboot.rom -c MX25L3205D/MX25L3208D When you see flashrom say `VERIFIED` at the end, that means the flash was successful. If you don't see that, or you're unsure, please [contact the Libreboot project via IRC](../../contact.md). BACK UP THE FACTORY BIOS ======================== The `-w` option flashes `libreboot.rom`. You may consider *backing up* the original Dell BIOS first, using the -r option: flashrom -p internal -r backup.rom -c MX25L3205D/MX25L3208D Do this while in a flashable state, after the 2nd run of `e6400-flash-unlock`. Make sure the `backup.rom` file gets backed up to an external storage media, not the E6400 itself. With this method, you can probably flash it within 5 minutes. Again, zero disassembly required! How to flash externally ========================= Refer to [spi.md](spi.md) as a guide for external re-flashing. The SPI flash chip shares a voltage rail with the ICH9 southbridge, which is not isolated using a diode. As a result, powering the flash chip externally causes the ICH9 to partially power up and attempt to drive the SPI clock pin low, which can interfere with programmers such as the Raspberry Pi. See [RPi Drive Strength](spi.md#rpi-drive-strength) for a workaround. Have a look online for videos showing how to disassemble, if you wish to externally re-flash.