dm: treewide: Complete migration to new driver model schema

Update various build and test components to use the new schema.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2023-02-13 08:56:34 -07:00
parent 8c103c33fb
commit e316fbabbf
9 changed files with 24 additions and 25 deletions

View file

@ -1312,22 +1312,22 @@ bool ofnode_pre_reloc(ofnode node)
{ {
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_TPL_BUILD) #if defined(CONFIG_SPL_BUILD) || defined(CONFIG_TPL_BUILD)
/* for SPL and TPL the remaining nodes after the fdtgrep 1st pass /* for SPL and TPL the remaining nodes after the fdtgrep 1st pass
* had property dm-pre-reloc or u-boot,dm-spl/tpl. * had property bootph-all or bootph-pre-sram/bootph-pre-ram.
* They are removed in final dtb (fdtgrep 2nd pass) * They are removed in final dtb (fdtgrep 2nd pass)
*/ */
return true; return true;
#else #else
if (ofnode_read_bool(node, "u-boot,dm-pre-reloc")) if (ofnode_read_bool(node, "bootph-all"))
return true; return true;
if (ofnode_read_bool(node, "u-boot,dm-pre-proper")) if (ofnode_read_bool(node, "bootph-some-ram"))
return true; return true;
/* /*
* In regular builds individual spl and tpl handling both * In regular builds individual spl and tpl handling both
* count as handled pre-relocation for later second init. * count as handled pre-relocation for later second init.
*/ */
if (ofnode_read_bool(node, "u-boot,dm-spl") || if (ofnode_read_bool(node, "bootph-pre-ram") ||
ofnode_read_bool(node, "u-boot,dm-tpl")) ofnode_read_bool(node, "bootph-pre-sram"))
return true; return true;
if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE)) { if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE)) {

View file

@ -529,8 +529,8 @@ static int video_post_bind(struct udevice *dev)
addr = uc_priv->video_ptr; addr = uc_priv->video_ptr;
size = alloc_fb(dev, &addr); size = alloc_fb(dev, &addr);
if (addr < gd->video_bottom) { if (addr < gd->video_bottom) {
/* Device tree node may need the 'u-boot,dm-pre-reloc' or /* Device tree node may need the 'bootph-all' or
* 'u-boot,dm-pre-proper' tag * 'bootph-some-ram' tag
*/ */
printf("Video device '%s' cannot allocate frame buffer memory -ensure the device is set up before relocation\n", printf("Video device '%s' cannot allocate frame buffer memory -ensure the device is set up before relocation\n",
dev->name); dev->name);

View file

@ -362,7 +362,7 @@ config OF_SPL_REMOVE_PROPS
help help
Since SPL normally runs in a reduced memory space, the device tree Since SPL normally runs in a reduced memory space, the device tree
is cut down to only what is needed to load and start U-Boot. Only is cut down to only what is needed to load and start U-Boot. Only
nodes marked with the property "u-boot,dm-pre-reloc" will be nodes marked with the property "bootph-all" will be
included. In addition, some properties are not used by U-Boot and included. In addition, some properties are not used by U-Boot and
can be discarded. This option defines the list of properties to can be discarded. This option defines the list of properties to
discard. discard.

View file

@ -1070,7 +1070,7 @@ static inline bool device_is_on_pci_bus(const struct udevice *dev)
* sub-nodes and binds drivers for each node where a driver can be found. * sub-nodes and binds drivers for each node where a driver can be found.
* *
* If this is called prior to relocation, only pre-relocation devices will be * If this is called prior to relocation, only pre-relocation devices will be
* bound (those marked with u-boot,dm-pre-reloc in the device tree, or where * bound (those marked with bootph-all in the device tree, or where
* the driver has the DM_FLAG_PRE_RELOC flag set). Otherwise, all devices will * the driver has the DM_FLAG_PRE_RELOC flag set). Otherwise, all devices will
* be bound. * be bound.
* *

View file

@ -1188,12 +1188,12 @@ int ofnode_read_simple_size_cells(ofnode node);
* determine if a node was bound in one of SPL/TPL stages. * determine if a node was bound in one of SPL/TPL stages.
* *
* There are 4 settings currently in use * There are 4 settings currently in use
* - u-boot,dm-pre-proper: U-Boot proper pre-relocation only * - bootph-some-ram: U-Boot proper pre-relocation only
* - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL * - bootph-all: all phases
* Existing platforms only use it to indicate nodes needed in * Existing platforms only use it to indicate nodes needed in
* SPL. Should probably be replaced by u-boot,dm-spl for new platforms. * SPL. Should probably be replaced by bootph-pre-ram for new platforms.
* - u-boot,dm-spl: SPL and U-Boot pre-relocation * - bootph-pre-ram: SPL and U-Boot pre-relocation
* - u-boot,dm-tpl: TPL and U-Boot pre-relocation * - bootph-pre-sram: TPL and U-Boot pre-relocation
* *
* @node: node to check * @node: node to check
* Return: true if node is needed in SPL/TL, false otherwise * Return: true if node is needed in SPL/TL, false otherwise

View file

@ -215,7 +215,7 @@ static int dm_test_fdt_pre_reloc(struct unit_test_state *uts)
/* /*
* These are 2 pre-reloc devices: * These are 2 pre-reloc devices:
* one with "u-boot,dm-pre-reloc" property (a-test node), and the other * one with "bootph-all" property (a-test node), and the other
* one whose driver marked with DM_FLAG_PRE_RELOC flag (h-test node). * one whose driver marked with DM_FLAG_PRE_RELOC flag (h-test node).
*/ */
ut_asserteq(2, list_count_items(&uc->dev_head)); ut_asserteq(2, list_count_items(&uc->dev_head));

View file

@ -13,10 +13,10 @@ def test_spl_devicetree(u_boot_console):
fdtgrep = cons.config.build_dir + '/tools/fdtgrep' fdtgrep = cons.config.build_dir + '/tools/fdtgrep'
output = util.run_and_log(cons, [fdtgrep, '-l', dtb]) output = util.run_and_log(cons, [fdtgrep, '-l', dtb])
assert "u-boot,dm-pre-reloc" not in output assert "bootph-all" not in output
assert "u-boot,dm-pre-proper" not in output assert "bootph-some-ram" not in output
assert "u-boot,dm-spl" not in output assert "bootph-pre-ram" not in output
assert "u-boot,dm-tpl" not in output assert "bootph-pre-sram" not in output
assert "spl-test5" not in output assert "spl-test5" not in output
assert "spl-test6" not in output assert "spl-test6" not in output

View file

@ -1122,8 +1122,7 @@ It is sometimes inconvenient to add a 'binman' node to the .dts file for each
board. This can be done by using #include to bring in a common file. Another board. This can be done by using #include to bring in a common file. Another
approach supported by the U-Boot build system is to automatically include approach supported by the U-Boot build system is to automatically include
a common header. You can then put the binman node (and anything else that is a common header. You can then put the binman node (and anything else that is
specific to U-Boot, such as u-boot,dm-pre-reloc properies) in that header specific to U-Boot, such as bootph-all properies) in that header file.
file.
Binman will search for the following files in arch/<arch>/dts:: Binman will search for the following files in arch/<arch>/dts::

View file

@ -132,10 +132,10 @@ class TestFdt(unittest.TestCase):
"""Tests obtaining a list of properties""" """Tests obtaining a list of properties"""
node = self.dtb.GetNode('/spl-test') node = self.dtb.GetNode('/spl-test')
props = self.dtb.GetProps(node) props = self.dtb.GetProps(node)
self.assertEqual(['boolval', 'bytearray', 'byteval', 'compatible', self.assertEqual(['boolval', 'bootph-all', 'bytearray', 'byteval',
'int64val', 'intarray', 'intval', 'longbytearray', 'compatible', 'int64val', 'intarray', 'intval',
'maybe-empty-int', 'notstring', 'stringarray', 'longbytearray', 'maybe-empty-int', 'notstring',
'stringval', 'u-boot,dm-pre-reloc'], 'stringarray', 'stringval', ],
sorted(props.keys())) sorted(props.keys()))
def test_check_error(self): def test_check_error(self):