Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring dasharo+heads MSI boards from downstream Dasharo/heads to upstream #1753

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Commits on Sep 9, 2024

  1. Bring dasharo+heads MSI boards + code changes from downstream Dasharo…

    …/heads fork to upstream
    
    - files: boards + coreboot + linux, borrowed directly from Dasharo@cb43039 tip
    - cbfs-init modified as per downstream fork dasharo+heads used modifications (flashrom)
    - ash_functions modified as per downstream fork dasharo+heads used modifications (CBFS)
    - network-init-recovery modified as per downstream fork dasharo+heads used modifications (igc)
    - modules/linux modified as per downstream fork dasharo+heads used modifications (igc)
    - modules/coreboot modified as per downstream fork dasharo+heads used modifications (also impact nv41/ns50: coreboot version bump)
    - Circleci: added boards being dependent of nv41
    
    This requires Nk3 firmware to be 1.7.1+ as per https://www.nitrokey.com/blog/2024/heads-v25-and-nitrokey-3-firmware-v171-security-updatehttps://www.nitrokey.com/blog/2024/heads-v25-and-nitrokey-3-firmware-v171-security-update
    
    DISCLAIMER: UNTESTED
    
    Sorry, not gonna cherry-pick commits here, way too messy.
    
    Signed-off-by: Thierry Laurion <[email protected]>
    tlaurion committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    4ff7e5a View commit details
    Browse the repository at this point in the history
  2. flashrom: switch to Dasharo fork

    Signed-off-by: Thierry Laurion <[email protected]>
    tlaurion committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    fa9ec0d View commit details
    Browse the repository at this point in the history
  3. flashrom: switch back to flashrom upstream, but bump to release 1.4.0…

    … released 2 weeks ago. Expected that patches from 2 years ago were merged upstream
    
    - delete unapplied kgpe-d16 patch (will need to be brought back, was not applied currently on master
    - add patches/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/0001-Add_RaptorPoint_PCH_support.patch which was not submitted to flashrom and needed by MSI
    - point modules/flashrom to release 1.4.0 commit
    
    FAILED:
    https://github.com/Dasharo/flashrom/commit/24b8fcfccef31fbb95bc1dd308180f57d5cdb64c.patch
    Cannot be applied over 1.4.0:
    if [ -d patches/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38 ] && [ -r patches/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38 ] ; then for patch in patches/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/*.patch ; do echo "Applying patch file : $patch " ; ( git apply --verbose --reject --binary --directory build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38 ) < $patch || exit 1 ; done ; fi
    Applying patch file : patches/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/0001-Add_RaptorPoint_PCH_support.patch
    Checking patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/chipset_enable.c...
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_ELKHART_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/chipset_enable.c:607
    error: while searching for:
    		break;
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    		boot_straps = boot_straps_pch500;
    		break;
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/chipset_enable.c:714
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/chipset_enable.c:749
    Hunk #4 succeeded at 1017 (offset 5 lines).
    error: while searching for:
    	{0x8086, 0x7a83, B_S,    NT,  "Intel", "Q670",				enable_flash_pch600},
    	{0x8086, 0x7a84, B_S,    DEP, "Intel", "Z690",				enable_flash_pch600},
    	{0x8086, 0x7a88, B_S,    NT,  "Intel", "W680",				enable_flash_pch600},
    	{0x8086, 0x7a8a, B_S,    NT,  "Intel", "W685",				enable_flash_pch600},
    	{0x8086, 0x7a8d, B_S,    NT,  "Intel", "WM690",				enable_flash_pch600},
    	{0x8086, 0x7a8c, B_S,    NT,  "Intel", "HM670",				enable_flash_pch600},
    	{0x8086, 0x7e23, B_S,    DEP, "Intel", "Meteor Lake-P/M",		enable_flash_mtl},
    	{0},
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/chipset_enable.c:2175
    Checking patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c...
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_ELKHART_LAKE:
    	case CHIPSET_JASPER_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:48
    error: while searching for:
    	case CHIPSET_C620_SERIES_LEWISBURG:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    	case CHIPSET_JASPER_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:77
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:215
    error: while searching for:
    		return freq_str[2][value];
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    		return freq_str[3][value];
    	case CHIPSET_ELKHART_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:313
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:361
    error: while searching for:
    	    cs == CHIPSET_400_SERIES_COMET_POINT ||
    	    cs == CHIPSET_500_SERIES_TIGER_POINT ||
    	    cs == CHIPSET_600_SERIES_ALDER_POINT ||
    	    cs == CHIPSET_JASPER_LAKE || cs == CHIPSET_METEOR_LAKE) {
    		const char *const master_names[] = {
    			"BIOS", "ME", "GbE", "unknown", "EC",
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:489
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    	case CHIPSET_JASPER_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:1087
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:1246
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c:1291
    Checking patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ichspi.c...
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ichspi.c:1884
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ichspi.c:1923
    error: while searching for:
    	case CHIPSET_400_SERIES_COMET_POINT:
    	case CHIPSET_500_SERIES_TIGER_POINT:
    	case CHIPSET_600_SERIES_ALDER_POINT:
    	case CHIPSET_METEOR_LAKE:
    	case CHIPSET_APOLLO_LAKE:
    	case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ichspi.c:1984
    error: while searching for:
    		case CHIPSET_400_SERIES_COMET_POINT:
    		case CHIPSET_500_SERIES_TIGER_POINT:
    		case CHIPSET_600_SERIES_ALDER_POINT:
    		case CHIPSET_METEOR_LAKE:
    		case CHIPSET_APOLLO_LAKE:
    		case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ichspi.c:2064
    error: while searching for:
    		case CHIPSET_400_SERIES_COMET_POINT:
    		case CHIPSET_500_SERIES_TIGER_POINT:
    		case CHIPSET_600_SERIES_ALDER_POINT:
    		case CHIPSET_METEOR_LAKE:
    		case CHIPSET_APOLLO_LAKE:
    		case CHIPSET_GEMINI_LAKE:
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ichspi.c:2103
    error: while searching for:
    	     ich_gen == CHIPSET_300_SERIES_CANNON_POINT ||
    	     ich_gen == CHIPSET_400_SERIES_COMET_POINT ||
    	     ich_gen == CHIPSET_500_SERIES_TIGER_POINT ||
    	     ich_gen == CHIPSET_600_SERIES_ALDER_POINT)) {
    		msg_pdbg("Enabling hardware sequencing by default for 100+ series PCH.\n");
    		ich_spi_mode = ich_hwseq;
    	}
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ichspi.c:2140
    Checking patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/include/programmer.h...
    error: while searching for:
    	CHIPSET_400_SERIES_COMET_POINT,
    	CHIPSET_500_SERIES_TIGER_POINT,
    	CHIPSET_600_SERIES_ALDER_POINT,
    	CHIPSET_METEOR_LAKE,
    	CHIPSET_APOLLO_LAKE,
    	CHIPSET_GEMINI_LAKE,
    
    error: patch failed: build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/include/programmer.h:376
    Checking patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/util/ich_descriptors_tool/ich_descriptors_tool.c...
    Hunk #1 succeeded at 239 (offset 1 line).
    Applying patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/chipset_enable.c with 4 rejects...
    Rejected hunk #1.
    Rejected hunk #2.
    Rejected hunk #3.
    Hunk #4 applied cleanly.
    Rejected hunk #5.
    Applying patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ich_descriptors.c with 9 rejects...
    Rejected hunk #1.
    Rejected hunk #2.
    Rejected hunk #3.
    Rejected hunk #4.
    Rejected hunk #5.
    Rejected hunk #6.
    Rejected hunk linuxboot#7.
    Rejected hunk #8.
    Rejected hunk #9.
    Applying patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/ichspi.c with 6 rejects...
    Rejected hunk #1.
    Rejected hunk #2.
    Rejected hunk #3.
    Rejected hunk #4.
    Rejected hunk #5.
    Rejected hunk #6.
    Applying patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/include/programmer.h with 1 reject...
    Rejected hunk #1.
    Applied patch build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/util/ich_descriptors_tool/ich_descriptors_tool.c cleanly.
    make: *** [Makefile:565: /home/user/heads/build/x86/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/.canary] Error 1
    
    Signed-off-by: Thierry Laurion <[email protected]>
    tlaurion committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    576768c View commit details
    Browse the repository at this point in the history
  4. flashrom: Applying upstreamed RaptorPoint PCH support patch proposed …

    …upstream fails to build on 1.4.0
    
    2024-08-09 15:08:07+00:00 MAKE flashrom
    tail /home/user/heads/build/x86/log/flashrom.log
    -----
    ichspi.c:2152:2: note: previously used here
      case CHIPSET_METEOR_LAKE:
      ^~~~
    /home/user/heads/crossgcc/x86/bin/x86_64-linux-musl-gcc -fdebug-prefix-map=/home/user/heads=heads -gno-record-gcc-switches -D__MUSL__ --sysroot  /home/user/heads/install/x86 -isystem /home/user/heads/install/x86/include -L/home/user/heads/install/x86/lib  -MMD -Os -I/home/user/heads/install/x86/include/pci -Iinclude -I/home/user/heads/install/x86//include -D'HAVE_GETOPT_H=1'   -D'IS_WINDOWS=0' -D'__FLASHROM_LITTLE_ENDIAN__=1' -D'CONFIG_DEFAULT_PROGRAMMER_NAME=NULL' -D'CONFIG_DEFAULT_PROGRAMMER_ARGS=""' -D'CONFIG_DELAY_MINIMUM_SLEEP_US=100000' -D'CONFIG_INTERNAL=1' -D'CONFIG_INTERNAL_DMI=1' -D'__FLASHROM_HAVE_OUTB__=1' -D'HAVE_UTSNAME=1' -D'HAVE_CLOCK_GETTIME=1' -D'FLASHROM_VERSION="1.4.0 (git:v0.2.0-2284-g88513e3f06)"'  -o hwaccess_x86_io.o -c hwaccess_x86_io.c
    ichspi.c: In function 'init_ich_default':
    ichspi.c:2381:48: error: expected ';' before ')' token
           ich_gen == CHIPSET_C740_SERIES_EMMITSBURG)) {
                                                    ^
                                                    ;
    ichspi.c:2381:48: error: expected statement before ')' token
    ichspi.c:2381:49: error: expected statement before ')' token
           ich_gen == CHIPSET_C740_SERIES_EMMITSBURG)) {
                                                     ^
    ichspi.c:2504:1: error: expected declaration or statement at end of input
     }
     ^
    /home/user/heads/crossgcc/x86/bin/x86_64-linux-musl-gcc -fdebug-prefix-map=/home/user/heads=heads -gno-record-gcc-switches -D__MUSL__ --sysroot  /home/user/heads/install/x86 -isystem /home/user/heads/install/x86/include -L/home/user/heads/install/x86/lib  -MMD -Os -I/home/user/heads/install/x86/include/pci -Iinclude -I/home/user/heads/install/x86//include -D'HAVE_GETOPT_H=1'   -D'IS_WINDOWS=0' -D'__FLASHROM_LITTLE_ENDIAN__=1' -D'CONFIG_DEFAULT_PROGRAMMER_NAME=NULL' -D'CONFIG_DEFAULT_PROGRAMMER_ARGS=""' -D'CONFIG_DELAY_MINIMUM_SLEEP_US=100000' -D'CONFIG_INTERNAL=1' -D'CONFIG_INTERNAL_DMI=1' -D'__FLASHROM_HAVE_OUTB__=1' -D'HAVE_UTSNAME=1' -D'HAVE_CLOCK_GETTIME=1' -D'FLASHROM_VERSION="1.4.0 (git:v0.2.0-2284-g88513e3f06)"'  -o hwaccess_physmap.o -c hwaccess_physmap.c
    make[1]: *** [Makefile:1050: ichspi.o] Error 1
    
    Signed-off-by: Thierry Laurion <[email protected]>
    tlaurion committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    2fe8dd3 View commit details
    Browse the repository at this point in the history
  5. flashrom: 1.4.0: update pending patch to upstream master downstream u…

    …nder Heads
    
    repro:
    git fetch https://review.coreboot.org/flashrom refs/changes/54/83854/3 && git format-patch -1 --stdout FETCH_HEAD > patches/flashrom-eace095b15eb034e42d97202cad70ce979d8ca38/0001-Add_RaptorPoint_PCH_support.patch
    
    Signed-off-by: Thierry Laurion <[email protected]>
    tlaurion committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    3d60806 View commit details
    Browse the repository at this point in the history
  6. MSI board configs: clarify requirements, DDR4/DDR5 board names, unify…

    … config layout against qemu-coreboot-fbwhiptail-tpm2
    
    Signed-off-by: Thierry Laurion <[email protected]>
    tlaurion committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    b10e897 View commit details
    Browse the repository at this point in the history
  7. flashrom: disable prettyprint_ich9_reg_hsfc so that Heads flash progr…

    …ess workaround works in absence of flashrom --progress
    
    Respin of https://github.com/Dasharo/flashrom/commit/6b2061bc0699202f81aeb782f301f1bba9f8a826.patch which cannot be cherry-picked
    See Dasharo/flashrom#11 (comment)
    
    Signed-off-by: Thierry Laurion <[email protected]>
    tlaurion committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    12b7689 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    83fe731 View commit details
    Browse the repository at this point in the history