summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-11-02 14:08:12 -0600
committerTom Rini <[email protected]>2025-11-10 11:30:56 -0600
commit6d04828b45202312c93892b4be834809c795d4d2 (patch)
treef4438b2287c85b2479109ff4ecdff1f80ec53000 /test
parentd3b691c9d32260a262382f464bae62ad16d82225 (diff)
dm: Remove pre-schema tag support
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 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_of_migrate.py105
1 files changed, 0 insertions, 105 deletions
diff --git a/test/py/tests/test_of_migrate.py b/test/py/tests/test_of_migrate.py
deleted file mode 100644
index ab89332331e..00000000000
--- a/test/py/tests/test_of_migrate.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-# Copyright 2023 Google LLC
-# Written by Simon Glass <[email protected]>
-
-"""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
-
-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
-
-
[email protected]('sandbox_spl')
[email protected]('spl_of_platdata_inst')
[email protected]('!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
-
-
-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