From 076c87ccf68f7fe5a3998e8cd8edd2033a2f2ef0 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 18 Sep 2026 21:04:00 +0100 Subject: xbmk: make all projects multi-tree we currently distinguish, by virtue of logic, multi- and single-tree projects. this introduces a lot of complexity, so the following patch has removed this distinction. all single-tree projects are now multi tree, but with only one tree. other design changes: config/git removed. rev/tree now handled with mkhelper and target configs. this allows per-tree remote handling, so we could (for example) add the mrchromebox coreboot fork easily, for specific chromebook models. config/project is now config/module/project. this cleans up the main config/ directory. cfgname variable: .config no longer hardcoded when doing configs in projects. it is configurable with this variable. if unset, the previous .cfg is used noconfig variable: set this in target/mkhelper configs, and config/module/project/tree/config/ is unused; instead, make is called without config copying. a "noconfig" placeholder is used. this enables cleaner usage of previously single-tree projects in the new multi-tree-only structure. cfgvars: variables reinitialised in project config are cleaned more reliably. in particular, several variables e.g. autogenargs were not being reset between projects, although the autogenargs variable is currently unused. general cleanup has been conducted across the build system, as part of this redesign. several parts of the build system more over-engineered as a result of the previous design, and the new design enabled a severe reduction in sloccount (75 lines reduced in lbmk). yes, this change *adds features* but there are fewer lines of code than before. this is the best kind of change. way better than the 3-line-diff. yes. rev= and tree= are set more centrally in configs. the mkhelper config can be used to set url/url_bkup, but individual trees can override them. configs have been cleaned up, with several variables now much more heavily centralised. config/git/ was used before to first download the bare repository, and then the real clone was made with patches. this allows git repositories to be cached for future re-builds. with config/git/ gone, the download logic for projects is more centrally implemented. a separate call to ./mk -f is no longer performed, and in fact ./mk -f never needs to be used anymore as a result. ./mk -f now is basically the same thing as -b, just without any action performed. this change will allow rapid expansion of the libreboot project. i want to add hundreds of chromebooks to the project, using mrchromebox, but the previous design did not permit this. this change means that i can easily have unlimited upstreams per project. coreboot will, in some follow-up changes, have the following upstreams: coreboot/default: coreboot.org coreboot/fam15h: 15h.org fork coreboot/chromebook: mrchromebox fork this can now be done freely without massive changes to the build system. under the previous design, i worked on a now-abandoned patch to do N remotes per project, reading repo links from a file. this meant that i'd have coreboot.org first (main and backup), then mrchromebox. this meant that lbmk would failover through to mrchromebox, wasting time for the user. this new design is much cleaner, and will enable the project to be maintained much more easily. Signed-off-by: Leah Rowe --- .../patches/0001-Workaround-for-MX25-chips.patch | 91 ---------------------- ...002-lbmk-hack-add-config-Makefile-options.patch | 48 ------------ config/flashprog/target.cfg | 3 - 3 files changed, 142 deletions(-) delete mode 100644 config/flashprog/patches/0001-Workaround-for-MX25-chips.patch delete mode 100644 config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch delete mode 100644 config/flashprog/target.cfg (limited to 'config/flashprog') diff --git a/config/flashprog/patches/0001-Workaround-for-MX25-chips.patch b/config/flashprog/patches/0001-Workaround-for-MX25-chips.patch deleted file mode 100644 index 77c05577..00000000 --- a/config/flashprog/patches/0001-Workaround-for-MX25-chips.patch +++ /dev/null @@ -1,91 +0,0 @@ -From f57f12e4aac690ebbfda40d92d1d0c5ff2b74c0a Mon Sep 17 00:00:00 2001 -From: consts -Date: Fri, 2 Mar 2018 07:03:37 +0000 -Subject: [PATCH 1/2] Workaround for MX25 chips - -TEST: In-system programming a ThinkPad X200 using a clip and -pico-serprog works now. It just doesn't without this hack. - -Chip: MX25L6405D - -Tested-by: Riku Viitanen -Change-Id: I43a306b67862b59c1dcd02729e189f3bf73f481b ---- - cli_classic.c | 5 +++++ - include/programmer.h | 1 + - spi.c | 11 ++++++++++- - 3 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/cli_classic.c b/cli_classic.c -index a49e0458..0b85a80e 100644 ---- a/cli_classic.c -+++ b/cli_classic.c -@@ -68,6 +68,7 @@ static void cli_classic_usage(const char *name) - " -o | --output log output to \n" - " --flash-contents assume flash contents to be \n" - " -L | --list-supported print supported devices\n" -+ " -m | --workaround-mx keep flash busy before sending command\n" - #if CONFIG_PRINT_WIKI == 1 - " -z | --list-supported-wiki print supported devices in wiki syntax\n" - #endif -@@ -231,6 +232,7 @@ int flashprog_classic_main(int argc, char *argv[]) - {"version", 0, NULL, 'R'}, - {"output", 1, NULL, 'o'}, - {"progress", 0, NULL, OPTION_PROGRESS}, -+ {"workaround-mx", 0, NULL, 'm'}, - {NULL, 0, NULL, 0}, - }; - -@@ -357,6 +359,9 @@ int flashprog_classic_main(int argc, char *argv[]) - cli_classic_usage(argv[0]); - exit(0); - break; -+ case 'm': /* --workaround-mx */ -+ workaround_mx = 1; -+ break; - case OPTION_PROGRESS: - show_progress = true; - break; -diff --git a/include/programmer.h b/include/programmer.h -index 11d15a84..3b33d5ae 100644 ---- a/include/programmer.h -+++ b/include/programmer.h -@@ -372,6 +372,7 @@ enum ich_chipset { - CHIPSET_LUNAR_LAKE, - CHIPSET_ARROW_LAKE, - }; -+extern int workaround_mx; /* workaround for MX25* chips, makes flash operations more reliable, less failures */ - - /* ichspi.c */ - #if CONFIG_INTERNAL == 1 -diff --git a/spi.c b/spi.c -index 748ef994..9bbdee9a 100644 ---- a/spi.c -+++ b/spi.c -@@ -27,13 +27,22 @@ - #include "spi_command.h" - #include "spi.h" - -+int workaround_mx; /* Make operations with MX25* chips more reliable */ -+ - int spi_send_command(const struct flashctx *flash, unsigned int writecnt, - unsigned int readcnt, const unsigned char *writearr, - unsigned char *readarr) - { -- if (spi_current_io_mode(flash) != SINGLE_IO_1_1_1) -+ if (spi_current_io_mode(flash) != SINGLE_IO_1_1_1) { - return default_spi_send_command(flash, writecnt, readcnt, writearr, readarr); -+ } else if (workaround_mx) { -+ const unsigned char cmd[JEDEC_READ_OUTSIZE] = {JEDEC_READ, 0, 0, 0}; -+ unsigned char buf[256]; -+ /* keep flash busy for some time, keep CS warm before sending actual command */ -+ flash->mst.spi->command(flash, sizeof(cmd), sizeof(buf), cmd, buf); -+ } - -+ /* actual command */ - return flash->mst.spi->command(flash, writecnt, readcnt, writearr, - readarr); - } --- -2.47.3 - diff --git a/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch b/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch deleted file mode 100644 index 15fc0916..00000000 --- a/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 10b23a84799c7b81a8b0b974529e67cc3f22429d Mon Sep 17 00:00:00 2001 -From: Leah Rowe -Date: Thu, 22 May 2025 11:25:42 +0100 -Subject: [PATCH 2/2] lbmk hack: add config Makefile options - -this prevents a build error when running the --u, -m, -s, -l and -n options in lbmk without -argument. - -this makes no functional changes to flashprog. - -Signed-off-by: Leah Rowe ---- - Makefile | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 2d94afea..e514e300 100644 ---- a/Makefile -+++ b/Makefile -@@ -1116,7 +1116,23 @@ libpayload: clean - gitconfig: - ./util/getrevision.sh -c 2>/dev/null && ./util/git-hooks/install.sh - --.PHONY: all install clean distclean config branch tag versioninfo _export export tarball libpayload gitconfig -+oldconfig: -+ : -+ -+menuconfig: -+ : -+ -+savedefconfig: -+ : -+ -+olddefconfig: -+ : -+ -+nconfig: -+ : -+ -+ -+.PHONY: all install clean distclean config branch tag versioninfo _export export tarball libpayload gitconfig oldconfig menuconfig savedefconfig olddefconfig nconfig - - # Disable implicit suffixes and built-in rules (for performance and profit) - .SUFFIXES: --- -2.47.3 - diff --git a/config/flashprog/target.cfg b/config/flashprog/target.cfg deleted file mode 100644 index 2d9243b7..00000000 --- a/config/flashprog/target.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -makeargs="WARNERROR=no" -- cgit v1.2.1