From c74e03417bdcb2930fa027e78cc8cebed384a975 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 13 Feb 2023 08:56:32 -0700 Subject: dm: Add support for handling old u-boot,dm- tags Add a CONFIG option to deal with this automatically, printing a warning when U-Boot starts up. This can be useful if the device tree comes from another project. We will maintain this through the 2023.07 release, providing 6 months for people to notice. Signed-off-by: Simon Glass Version 4: Acked-by: Michal Simek --- drivers/core/ofnode.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/core/ofnode.c') diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index d08578e9c4f..5fdac2b6638 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -1330,6 +1330,18 @@ bool ofnode_pre_reloc(ofnode node) ofnode_read_bool(node, "u-boot,dm-tpl")) return true; + 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 } -- cgit v1.2.3 From e316fbabbf1fe505162e35044c7924cbca0d73fd Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 13 Feb 2023 08:56:34 -0700 Subject: 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 --- drivers/core/ofnode.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/core/ofnode.c') diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 5fdac2b6638..f49ee493d3c 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -1312,22 +1312,22 @@ bool ofnode_pre_reloc(ofnode node) { #if defined(CONFIG_SPL_BUILD) || defined(CONFIG_TPL_BUILD) /* 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) */ return true; #else - if (ofnode_read_bool(node, "u-boot,dm-pre-reloc")) + if (ofnode_read_bool(node, "bootph-all")) return true; - if (ofnode_read_bool(node, "u-boot,dm-pre-proper")) + if (ofnode_read_bool(node, "bootph-some-ram")) return true; /* * In regular builds individual spl and tpl handling both * count as handled pre-relocation for later second init. */ - if (ofnode_read_bool(node, "u-boot,dm-spl") || - ofnode_read_bool(node, "u-boot,dm-tpl")) + if (ofnode_read_bool(node, "bootph-pre-ram") || + ofnode_read_bool(node, "bootph-pre-sram")) return true; if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE)) { -- cgit v1.2.3