Skip to content

Instantly share code, notes, and snippets.

@KunYi
Last active September 18, 2025 13:52
Show Gist options
  • Select an option

  • Save KunYi/2259e4ca37eae1292ee0a4bb7489a156 to your computer and use it in GitHub Desktop.

Select an option

Save KunYi/2259e4ca37eae1292ee0a4bb7489a156 to your computer and use it in GitHub Desktop.
lattepanda mu with coreboot 25.06 and latest

prepare build environments

$ sudo apt-get install -y bison build-essential curl flex git gnat libncurses-dev libssl-dev zlib1g-dev pkgconf

pull source code

$ git clone https://github.com/KunYi/repository coreboot
$ cd coreboot
$ git submodule update --init --checkout

build toolchain

$ make crossgcc-i386 CPUS=$(nproc)
tests/Makefile.mk:31: No system cmocka, build from 3rdparty instead...
Welcome to the coreboot cross toolchain builder v2025-07-04_a9e97268fe

Building toolchain using 12 thread(s).

Target architecture is i386-elf

Found compatible Ada compiler, enabling Ada support by default.

Downloading and verifying tarballs ...
 * gmp-6.3.0.tar.xz (cached)... hash verified (b4043dd2964ab1a858109da85c44de224384f352)
 * mpfr-4.2.2.tar.xz (downloading from https://ftpmirror.gnu.org/mpfr/mpfr-4.2.2.tar.xz)... 100%... hash verified (a63a264b273a652e27518443640e69567da498ce)
 * mpc-1.3.1.tar.gz (cached)... hash verified (bac1c1fa79f5602df1e29e4684e103ad55714e02)
 * binutils-2.44.tar.xz (downloading from https://ftpmirror.gnu.org/binutils/binutils-2.44.tar.xz)... 100%... hash verified (c8c9f5ae46ab9e3722c71821982d2c270e267748)
 * gcc-14.2.0.tar.xz (cached)... hash verified (d91ecc3d20ce6298bd95f9b09cc51dc6d3c73ae3)
Downloaded tarballs ... ok
Unpacking and patching ...
 * gmp-6.3.0.tar.xz
   o gmp-6.3.0_fix-c23-prototypes.patch
   o gmp-6.3.0_generic-build.patch
 * mpfr-4.2.2.tar.xz
 * mpc-1.3.1.tar.gz
 * binutils-2.44.tar.xz
   o binutils-2.44_as-ipxe.patch
   o binutils-2.44_no-makeinfo.patch
 * gcc-14.2.0.tar.xz
   o gcc-14.2.0_asan_shadow_offset_callback.patch
   o gcc-14.2.0_gnat.patch
   o gcc-14.2.0_libcpp.patch
   o gcc-14.2.0_libgcc.patch
   o gcc-14.2.0_musl_poisoned_calloc.patch
   o gcc-14.2.0_rv32iafc.patch
Unpacked and patched ... ok
Building packages ...
Skipping GMP v6.3.0 for host as it is already built
Building MPFR v4.2.2 for host ... ok
Skipping MPC v1.3.1 for host as it is already built
Building BINUTILS v2.44 for target ... ok
Skipping GCC v14.2.0 for target as it is already built
Packages built ... ok
Copied EDK2 tools template ... ok
Cleaning up temporary files... ok

You can now run i386-elf cross GCC from /tmp/coreboot/util/crossgcc/xgcc.
Welcome to the coreboot cross toolchain builder v2025-07-04_a9e97268fe

Building toolchain using 12 thread(s).

Downloading and verifying tarballs ...
 * nasm-2.16.03.tar.bz2 (cached)... hash verified (c63080347a5c1c8904456fe6c680b722558383b4)
Downloaded tarballs ... ok
Unpacking and patching ...
 * nasm-2.16.03.tar.bz2
Unpacked and patched ... ok
Building packages ...
Skipping NASM v2.16.03 for host as it is already built
Packages built ... ok
Copied EDK2 tools template ... ok
Cleaning up temporary files... ok

You can now run NASM from /tmp/coreboot/util/crossgcc/xgcc.
Welcome to the coreboot cross toolchain builder v2025-07-04_a9e97268fe

Building toolchain using 12 thread(s).

Downloading and verifying tarballs ...
 * acpica-unix-20250404.tar.gz (downloading from https://downloadmirror.intel.com/852044/acpica-unix-20250404.tar.gz)... 100%... hash verified (aeff4d1254e73263b4f2c6f7d1e96af47fa219e0)
Downloaded tarballs ... ok
Unpacking and patching ...
 * acpica-unix-20250404.tar.gz
   o acpica-unix-20250404_iasl.patch
Unpacked and patched ... ok
Building packages ...
Building IASL v20250404 for host ... ok
Packages built ... ok
Copied EDK2 tools template ... ok
Cleaning up temporary files... ok

You can now run IASL ACPI compiler from /tmp/coreboot/util/crossgcc/xgcc.

setting default config for lattepanda mu

$ make KBUILD_DEFCONFIG=configs/config.lattepanda_mu defconfig
tests/Makefile.mk:31: No system cmocka, build from 3rdparty instead...
tests/Makefile.mk:31: No system cmocka, build from 3rdparty instead...
*** Default configuration is based on 'configs/config.lattepanda_mu'
#
# configuration written to /tmp/coreboot/.config
#

Build coreboot.rom

$ make -j12
...
...
    IFDTOOL    me.bin -> coreboot.pre
File build/coreboot.pre is 16777216 bytes
File build/me.bin is 4272128 bytes
Adding build/me.bin as the Intel ME section of build/coreboot.pre
Writing new image to build/coreboot.pre
    IFDTOOL    Unlocking Management Engine
File build/coreboot.pre is 16777216 bytes
Writing new image to build/coreboot.pre
    UPDATE-FIT set FIT pointer to table
    UPDATE-FIT Microcode
    CBFS       coreboot.rom

    FIT table:
    Index  Type                 Addr             Size    
         0 Microcode            0xffc504b0      0x00000000

    CBFSLAYOUT  coreboot.rom

This image contains the following sections that can be manipulated with this tool:

'SI_DESC' (size 4096, offset 0)
'SI_ME' (size 4272128, offset 4096)
'SI_PDR' (size 2015232, offset 4276224)
'RW_MRC_CACHE' (size 65536, offset 12582912)
'SMMSTORE' (size 262144, offset 12648448)
'COREBOOT' (CBFS, size 3865600, offset 12911616)

It is possible to perform either the write action or the CBFS add/remove actions on every section listed above.
To see the image's read-only sections as well, rerun with the -w option.
    CBFSPRINT  coreboot.rom

FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs_master_header             0x0        cbfs header        32 none
cpu_microcode_blob.bin         0x80       microcode      139264 none
intel_fit                      0x220c0    intel_fit          80 none
fallback/romstage              0x22140    stage           73480 none
fallback/ramstage              0x340c0    stage          130924 LZMA (293380 decompressed)
config                         0x54080    raw              4777 LZMA (17318 decompressed)
revision                       0x55380    raw               780 none
build_info                     0x556c0    raw               106 none
spd.bin                        0x55780    spd              1024 none
fallback/dsdt.aml              0x55bc0    raw             17176 none
rt8168-macaddress              0x59f40    raw                17 none
vbt.bin                        0x59f80    raw              1269 LZMA (9216 decompressed)
(empty)                        0x5a4c0    null             1764 none
fspm.bin                       0x5abc0    fsp            786432 none
fsps.bin                       0x11ac00   fsp            286419 LZ4  (389120 decompressed)
fallback/postcar               0x160b40   stage           25480 none
fallback/payload               0x166f40   simple elf    1444143 none
(empty)                        0x2c78c0   null           922340 none
bootblock                      0x3a8bc0   bootblock       28672 none

Built lattepanda/mu (MU_8G)

upgrade your lattepand mu

use build/coreboot.rom to upgrade your lattepanda mu board

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment