diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 6668933a568..8e8a3d93b08 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -348,6 +348,14 @@ config MAKEFILE_EXPORTS Generates a file with build information that can be read by third party Makefile-based build systems. +config LEGACY_DEVICETREE_MACROS + bool "Allow use of legacy devicetree macros" + default y + help + Allows use of legacy devicetree macros which were used in + Zephyr 2.2 and previous versions, rather than the devicetree.h + API introduced during the Zephyr 2.3 development cycle. + endmenu endmenu diff --git a/doc/releases/release-notes-2.3.rst b/doc/releases/release-notes-2.3.rst index 67e39ff3ac5..0ff6bd81770 100644 --- a/doc/releases/release-notes-2.3.rst +++ b/doc/releases/release-notes-2.3.rst @@ -73,6 +73,12 @@ Deprecated in this release * nrf52_pca20020 has been renamed to thingy52_nrf52832 * nrf5340_dk_nrf5340 has been renamed to nrf5340pdk_nrf5340 +* Devicetree + + * The C macros generated from devicetree. Use the new ```` + accessor API instead; see :ref:`dt-guide` for details. Use of the legacy + macros requires enabling :option:`CONFIG_LEGACY_DEVICETREE_MACROS`. + Removed APIs in this release ============================ diff --git a/include/devicetree.h b/include/devicetree.h index af4890ec659..8208cac6ffe 100644 --- a/include/devicetree.h +++ b/include/devicetree.h @@ -16,8 +16,20 @@ #ifndef DEVICETREE_H #define DEVICETREE_H +#ifdef _LINKER +/* + * Linker scripts include this file too, and autoconf.h isn't + * automatically included for those files the way it is for C source + * files. Make sure we pull it in before using + * CONFIG_LEGACY_DEVICETREE_MACROS in that case. + */ +#include +#endif + #include +#ifdef CONFIG_LEGACY_DEVICETREE_MACROS #include +#endif #include #include