]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
dm: Remove pre-schema tag support
authorTom Rini <trini@konsulko.com>
Sun, 2 Nov 2025 20:08:12 +0000 (14:08 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 10 Nov 2025 17:30:56 +0000 (11:30 -0600)
Support for using "u-boot,dm-..." rather than "bootph-..." has been
deprecated since February 2023. Any platforms using this have had a
console message saying to migrate by 2023.07. Go and remove all support
here now, for the v2026.01 release.

The results of this change that aren't clear from the above are that we
still have a checkpatch.pl error message, and document in
doc/develop/spl.rst that they have been migrated since 2023. We also
change the key2dtsi.py tool to use the correct bootph phase rather than
the legacy phase.

Signed-off-by: Tom Rini <trini@konsulko.com>
19 files changed:
.azure-pipelines.yml
.gitlab-ci.yml
common/board_r.c
configs/ibex-ast2700_defconfig
configs/jaguar-rk3588_defconfig
configs/sama5d29_curiosity_mmc1_defconfig
configs/sama5d29_curiosity_mmc_defconfig
configs/sama5d29_curiosity_qspiflash_defconfig
configs/sama7g54_curiosity_mmc_defconfig
configs/sama7g54_curiosity_nandflash_defconfig
configs/sama7g54_curiosity_qspiflash_defconfig
configs/tiger-rk3588_defconfig
drivers/core/ofnode.c
dts/Kconfig
include/asm-generic/global_data.h
scripts/Makefile.lib
test/py/tests/test_of_migrate.py [deleted file]
tools/key2dtsi.py
tools/patman/test_checkpatch.py

index 3b684ec73ba8eae7d5f1ed412481e36fe976cf86..5314a8b2444cac3539029632c628fecbc02d9167 100644 (file)
@@ -190,18 +190,6 @@ stages:
           export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
           make pylint_err
 
-  - job: check_for_pre_schema_tags
-    displayName: 'Check for pre-schema driver model tags'
-    pool:
-      vmImage: $(ubuntu_vm)
-    container:
-      image: $(ci_runner_image)
-      options: $(container_option)
-    steps:
-      # If grep succeeds and finds a match the test fails as we should
-      # have no matches.
-      - script: git grep u-boot,dm- -- '*.dts*' && exit 1 || exit 0
-
   - job: check_packing_of_python_tools
     displayName: 'Check we can package the Python tools'
     pool:
index 0337380f98ec33027eda5e7641b2e886a9903f53..a5d7f4dc738a3f1ebc3aa3b612104bdf6e5fb7e7 100644 (file)
@@ -249,15 +249,6 @@ Run pylint:
     - export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
     - make pylint_err
 
-# Check for pre-schema driver model tags
-Check for pre-schema tags:
-  extends: .testsuites
-  script:
-    - git config --global --add safe.directory "${CI_PROJECT_DIR}";
-    # If grep succeeds and finds a match the test fails as we should
-    # have no matches.
-    - git grep u-boot,dm- -- '*.dts*' && exit 1 || exit 0
-
 # Check we can package the Python tools
 Check packing of Python tools:
   extends: .testsuites
index 143d51d06330922d293c122e5197f65948672ac7..76f9fc090fbe44b0855ff87c22f04261cd02dd0c 100644 (file)
@@ -572,13 +572,6 @@ static int dm_announce(void)
                        printf("Warning: Unexpected devicetree source (not from a prior stage)");
                        printf("Warning: U-Boot may not function properly\n");
                }
-               if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE) &&
-                   (gd->flags & GD_FLG_OF_TAG_MIGRATE))
-                       /*
-                        * U-Boot will silently fail to work after 2023.07 if
-                        * there are old tags present
-                        */
-                       printf("Warning: Device tree includes old 'u-boot,dm-' tags: please fix by 2023.07!\n");
        }
 
        return 0;
index 088eec1ec702c7f00b0f7561e02684c12f4fffa4..a4090f0551333b4c28c4af362931e748b97d23b6 100644 (file)
@@ -65,7 +65,6 @@ CONFIG_CMD_SYSBOOT=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_DEVICE_TREE_INCLUDES="ast2700-u-boot.dtsi"
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_RX_ETH_BUFFER=2
 # CONFIG_DM_DEVICE_REMOVE is not set
index 3ed07d18e1035db8645f54acde622a149ee16989..def0acf6cfdcf16ccba90417fba12daee5128bf4 100644 (file)
@@ -57,7 +57,6 @@ CONFIG_CMD_SQUASHFS=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_OF_SPL_REMOVE_PROPS="interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
index 4e56c670357e3d8196a8c16b116f79df91bbce41..ad835af5dbd9b4061bcdf05a950161d7c46c6b2c 100644 (file)
@@ -65,7 +65,6 @@ CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y
 CONFIG_MTDIDS_DEFAULT="nor0=nor0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:256k(bootstrap)ro,1M(u-boot)ro,256k(env)ro,512k(dtb)ro,6M(kernel)ro"
 CONFIG_OF_CONTROL=y
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_ENV_IS_IN_FAT=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="1:1"
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
index 28d5626a2a59d3fec8ace361b7181021c13e44f7..e01332768b1f5c553bf268c1a681bd795792d9db 100644 (file)
@@ -65,7 +65,6 @@ CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y
 CONFIG_MTDIDS_DEFAULT="nor0=nor0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:256k(bootstrap)ro,1M(u-boot)ro,256k(env)ro,512k(dtb)ro,6M(kernel)ro"
 CONFIG_OF_CONTROL=y
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_ENV_IS_IN_FAT=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_HOSTNAME=y
index e19e39cd6dc1753855f74cf0c09e955b22792f43..17504f5de14bb337a2b61c4345dce37b387c4358 100644 (file)
@@ -65,7 +65,6 @@ CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y
 CONFIG_MTDIDS_DEFAULT="nor0=nor0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:256k(bootstrap)ro,1M(u-boot)ro,256k(env)ro,512k(dtb)ro,6M(kernel)ro"
 CONFIG_OF_CONTROL=y
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_HOSTNAME=y
index 557173d1af0116442fe5e3e864d4a2e5e2bf582f..f6f552c0087924fcd6dc759a2652ca93226d4709 100644 (file)
@@ -68,7 +68,6 @@ CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y
 CONFIG_MTDIDS_DEFAULT="nand0=nand0,nor0=nor0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nand0:256k(bootstrap-nand)ro,1M(u-boot-nand)ro,256k(env-nand)ro,512k(dtb-nand)ro,6M(kernel-nand)ro,-(rootfs-nand)ro;nor0:256k(bootstrap-nor)ro,1M(u-boot-nor)ro,256k(env-nor)ro,512k(dtb-nor)ro,6M(kernel-nor)ro"
 CONFIG_OF_CONTROL=y
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_ENV_IS_IN_FAT=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="1:1"
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
index 4a3b5e5f5b3612714aedf480f3d9084a23ca5646..830454705c2cee2ba618f2956d489a80499f5c6b 100644 (file)
@@ -67,7 +67,6 @@ CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y
 CONFIG_MTDIDS_DEFAULT="nand0=nand0,nor0=nor0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nand0:256k(bootstrap-nand)ro,1M(u-boot-nand)ro,256k(env-nand)ro,512k(dtb-nand)ro,6M(kernel-nand)ro,-(rootfs-nand)ro;nor0:256k(bootstrap-nor)ro,1M(u-boot-nor)ro,256k(env-nor)ro,512k(dtb-nor)ro,6M(kernel-nor)ro"
 CONFIG_OF_CONTROL=y
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_HOSTNAME=y
index fee0a8bac0409ee2d0518f70c6bbb1b64c8f3e8e..d91eb28db0ff127dc6b55a91f3305e07590b54fd 100644 (file)
@@ -68,7 +68,6 @@ CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y
 CONFIG_MTDIDS_DEFAULT="nand0=nand0,nor0=nor0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nand0:256k(bootstrap-nand)ro,1M(u-boot-nand)ro,256k(env-nand)ro,512k(dtb-nand)ro,6M(kernel-nand)ro,-(rootfs-nand)ro;nor0:256k(bootstrap-nor)ro,1M(u-boot-nor)ro,256k(env-nor)ro,512k(dtb-nor)ro,6M(kernel-nor)ro"
 CONFIG_OF_CONTROL=y
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_HOSTNAME=y
index 8ba2a996ee206ea6f732c9deb1cc06ec368848d6..50a3b553a111eb69c5901f49953e935ac844ea6d 100644 (file)
@@ -57,7 +57,6 @@ CONFIG_CMD_SQUASHFS=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-# CONFIG_OF_TAG_MIGRATE is not set
 CONFIG_OF_SPL_REMOVE_PROPS="interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
index e040e3f2806ffe74c58dcd82f36307351acd5a99..071d998a0a51311e73fe14e16605c22e83033003 100644 (file)
@@ -1629,18 +1629,6 @@ bool ofnode_pre_reloc(ofnode node)
            ofnode_read_bool(node, "bootph-pre-sram"))
                return gd->flags & GD_FLG_RELOC;
 
-       if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE)) {
-               /* detect and handle old tags */
-               if (ofnode_read_bool(node, "u-boot,dm-pre-reloc") ||
-                   ofnode_read_bool(node, "u-boot,dm-pre-proper") ||
-                   ofnode_read_bool(node, "u-boot,dm-spl") ||
-                   ofnode_read_bool(node, "u-boot,dm-tpl") ||
-                   ofnode_read_bool(node, "u-boot,dm-vpl")) {
-                       gd->flags |= GD_FLG_OF_TAG_MIGRATE;
-                       return true;
-               }
-       }
-
        return false;
 #endif
 }
index 4e2622d48d04cb7c6088b260fa52c9186528c2ac..870f75ad3ec3583459c8548900ab8f486deb652f 100644 (file)
@@ -408,16 +408,6 @@ config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
           at compilation time. This is the address of this area. It must be
           aligned on 2-byte boundary.
 
-config OF_TAG_MIGRATE
-       bool "Ease migration from old device trees with u-boot,dm- tags"
-       default y
-       help
-         U-Boot moved over to use new tags to mark device tree nodes which need
-         to be processed in SPL, before relocation, etc. Enable this option to
-         detect old tags and handle them.
-
-         Note: This option will be removed after the 2023.07 release.
-
 config OF_SPL_REMOVE_PROPS
        string "List of device tree properties to drop for SPL"
        depends on SPL_OF_CONTROL
index 506ee51cdb08ba72eb1db37d2e55738b24ead054..745d2c3a96634feff2f079701de5c100b9282e71 100644 (file)
@@ -671,10 +671,10 @@ enum gd_flags {
         * @GD_FLG_FDT_CHANGED: Device tree change has been detected by tests
         */
        GD_FLG_FDT_CHANGED = 0x100000,
-       /**
-        * @GD_FLG_OF_TAG_MIGRATE: Device tree has old u-boot,dm- tags
+       /*
+        * @GD_FLG_OF_TAG_MIGRATE: Previously had the value of 0x200000 but was
+        * freed when migration support was removed.
         */
-       GD_FLG_OF_TAG_MIGRATE = 0x200000,
        /**
         * @GD_FLG_DM_DEAD: Driver model is not accessible. This can be set when
         * the memory used to holds its tables has been mapped out.
index 5db2fbc418a17dd6897359bad8ab9e02a2e754bd..791eb1cb3276cd486208de00d0313637ad3592c8 100644 (file)
@@ -671,15 +671,6 @@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
 # pass removes various unused properties from the remaining nodes.
 # The output is typically a much smaller device tree file.
 
-ifdef CONFIG_OF_TAG_MIGRATE
-# Support the old tags for a migration period
-migrate_tpl := -b u-boot,dm-pre-reloc -b u-boot,dm-tpl
-migrate_vpl := -b u-boot,dm-pre-reloc -b u-boot,dm-vpl
-migrate_spl := -b u-boot,dm-pre-reloc -b u-boot,dm-spl
-migrate_all := -P u-boot,dm-pre-reloc \
-       -P u-boot,dm-spl -P u-boot,dm-tpl -P u-boot,dm-vpl
-endif
-
 ifeq ($(CONFIG_VPL_BUILD),y)
 fdtgrep_props := -b bootph-all -b bootph-verify $(migrate_vpl)
 else
diff --git a/test/py/tests/test_of_migrate.py b/test/py/tests/test_of_migrate.py
deleted file mode 100644 (file)
index ab89332..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-# Copyright 2023 Google LLC
-# Written by Simon Glass <sjg@chromium.org>
-
-"""Test handling of unmigrated u-boot,dm- tags"""
-
-import os
-import pytest
-
-import utils
-
-# This is needed for Azure, since the default '..' directory is not writeable
-TMPDIR1 = '/tmp/test_no_migrate'
-TMPDIR2 = '/tmp/test_no_migrate_spl'
-TMPDIR3 = '/tmp/test_migrate'
-
-def build_for_migrate(ubman, replace_pair, board, tmpdir, disable_migrate=True):
-    """Build an updated U-Boot with a slightly modified device tree
-
-    Args:
-        ubman (ConsoleBase): U-Boot console
-        replace_pair (tuple):
-            String to find
-            String to replace it with
-        board (str): Board to build
-        tmpdir (str): Temporary directory to use
-        disable_migrate (bool): True to disable CONFIG_OF_TAG_MIGRATE in build
-    """
-    srcdir = ubman.config.source_dir
-    build_dir = ubman.config.build_dir
-
-    # Get the source for the existing dts
-    dt_dir = os.path.join(build_dir, 'arch', 'sandbox', 'dts')
-    orig_fname = os.path.join(dt_dir, 'sandbox.dtb')
-    out_dts = os.path.join(dt_dir, 'sandbox_out.dts')
-    utils.run_and_log(ubman, ['dtc', orig_fname, '-I', 'dtb', '-O', 'dts',
-                             '-o', out_dts])
-
-    # Update it to use an old tag
-    with open(out_dts) as inf:
-        data = inf.read()
-    data = data.replace(*replace_pair)
-
-    dts_fname = os.path.join(dt_dir, 'sandbox_oldtag.dts')
-    with open(dts_fname, 'w') as outf:
-        print(data, file=outf)
-    dtb_fname = os.path.join(dt_dir, 'sandbox_oldtag.dtb')
-    utils.run_and_log(ubman, ['dtc', dts_fname, '-o', dtb_fname])
-
-    migrate = ['-a', '~CONFIG_OF_TAG_MIGRATE'] if disable_migrate else []
-
-    # Build sandbox with this new dtb, turning off OF_TAG_MIGRATE
-    env = dict(os.environ)
-    env['EXT_DTB'] = dtb_fname
-    env['DEVICE_TREE'] = 'sandbox_new'
-    env['NO_LTO'] = '1'  # Speed up build
-    out = utils.run_and_log(
-        ubman, ['./tools/buildman/buildman', '-m', '--board', board,
-               *migrate, '-w', '-o', tmpdir], ignore_errors=True, env=env)
-    return out
-
-@pytest.mark.slow
-@pytest.mark.boardspec('sandbox')
-def test_of_no_migrate(ubman):
-    """Test sandbox with old boot phase tags like u-boot,dm-pre-proper"""
-
-    build_for_migrate(ubman, ['bootph-some-ram', 'u-boot,dm-pre-proper'],
-                      'sandbox', TMPDIR1)
-
-    # It should fail to run, since the lcd device will not be bound before
-    # relocation. so won't get its frame-buffer memory
-    out = utils.run_and_log(
-        ubman, [os.path.join(TMPDIR1, 'u-boot'), '-D', '-c', 'help'],
-        ignore_errors=True)
-    assert "Video device 'lcd' cannot allocate frame buffer memory" in out
-
-
-@pytest.mark.slow
-@pytest.mark.boardspec('sandbox_spl')
-@pytest.mark.boardspec('spl_of_platdata_inst')
-@pytest.mark.boardspec('!sandbox_tpl')
-def test_of_no_migrate_spl(ubman):
-    """Test sandbox with old boot phase tags like u-boot,dm-spl"""
-
-    out = build_for_migrate(ubman, ['bootph-pre-ram', 'u-boot,dm-spl'],
-                            'sandbox_spl', TMPDIR2)
-
-    # It should fail to build, since the SPL DT will not include 'spl-test'
-    # node, among others
-    assert "undefined type â€˜struct dtd_sandbox_spl_test’" in out
-
-
-@pytest.mark.slow
-@pytest.mark.boardspec('sandbox')
-def test_of_migrate(ubman):
-    """Test sandbox shows a message when tags were migrated"""
-
-    build_for_migrate(ubman, ['bootph-some-ram', 'u-boot,dm-pre-proper'],
-                      'sandbox', TMPDIR3, disable_migrate=False)
-
-    # It should show a migration message
-    out = utils.run_and_log(
-        ubman, [os.path.join(TMPDIR3, 'u-boot'), '-D', '-c', 'help'],
-        ignore_errors=True)
-    assert "Warning: Device tree includes old 'u-boot,dm-' tags" in out
index 320ea930a97854020fa86bb209a28f4c5397ee0a..66facc02d87a5b9bd9f419410746321d2b939f5b 100755 (executable)
@@ -59,7 +59,7 @@ if args.required_conf:
 elif args.required_image:
     out.write('\t\t\trequired = "image";\n')
 if args.spl:
-    out.write('\t\t\tu-boot,dm-spl;\n')
+    out.write('\t\t\tbootph-pre-ram;\n')
 out.write('\t\t};\n')
 out.write('\t};\n')
 out.write('};\n')
index 4e8d163184e19554f0b1d037f43e5887046c8886..b4722330f8676a194cf2eff055de0533b6ab9173 100644 (file)
@@ -522,11 +522,5 @@ index 0000000..2234c87
         self.check_strl("cat");
         self.check_strl("cpy");
 
-    def test_schema(self):
-        """Check for uses of strn(cat|cpy)"""
-        pm = PatchMaker()
-        pm.add_line('arch/sandbox/dts/sandbox.dtsi', '\tu-boot,dm-pre-proper;')
-        self.check_single_message(pm, 'PRE_SCHEMA', 'error')
-
 if __name__ == "__main__":
     unittest.main()