summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-03 06:01:02 -0700
committerSimon Glass <sjg@chromium.org>2021-03-22 19:23:27 +1300
commitb00f0066e52413e0f8fd4a84681e6e27c4270c26 (patch)
treede41f3fc135501b607ad5790b03dc27c63e32e5d /include
parentb9319c4f9b103b6c5b10e8592471a29bd9645caf (diff)
downloadu-boot-b00f0066e52413e0f8fd4a84681e6e27c4270c26.tar.gz
u-boot-b00f0066e52413e0f8fd4a84681e6e27c4270c26.tar.xz
u-boot-b00f0066e52413e0f8fd4a84681e6e27c4270c26.zip
dtoc: Support tracking the phase of U-Boot
U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/dm/device.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index bb9faa0ed9..84df5b9e95 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -370,6 +370,22 @@ struct driver {
#define DM_DRIVER_ALIAS(__name, __alias)
/**
+ * Declare a macro to indicate which phase of U-Boot this driver is fore.
+ *
+ *
+ * This macro produces no code but its information will be parsed by dtoc. The
+ * macro can be only be used once in a driver. Put it within the U_BOOT_DRIVER()
+ * declaration, e.g.:
+ *
+ * U_BOOT_DRIVER(cpu) = {
+ * .name = ...
+ * ...
+ * DM_PHASE(tpl)
+ * };
+ */
+#define DM_PHASE(_phase)
+
+/**
* dev_get_plat() - Get the platform data for a device
*
* This checks that dev is not NULL, but no other checks for now