dm: Don't allow U_BOOT_DEVICE() when of-platdata is used
authorSimon Glass <sjg@chromium.org>
Sat, 3 Oct 2020 17:31:41 +0000 (11:31 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 29 Oct 2020 20:42:59 +0000 (14:42 -0600)
commitcb43ac184f71f0ba696d0effcd39a746a6f3a456
treed5b5f9b1eaa240b004ac1fd77ddc1bfe5323d1e1
parent4e28a259fd3a2025f42ad005b375aea2912c81de
dm: Don't allow U_BOOT_DEVICE() when of-platdata is used

With of-platdata, the devicetree is supposed to specify all the devices
in the system. So far this hasn't really mattered since of-platdata still
works correctly.

However, new of-platdata features rely on numbering the devices in a
particular order so that they can be referenced by a single integer. It is
tricky to implement this efficiently when other devices are present in the
build.

To address this, disable use of U_BOOT_DEVICE() when of-platdata is
enabled. This seems acceptable as it is not supposed to be used at all,
except in SPL/TPL, where of-platdata is the recommended approach.

This breaks one non-compliant boards at present: mx6cuboxi

Signed-off-by: Simon Glass <sjg@chromium.org>
(disable CONFIG_IMX_THERMAL for mx6cuboxi to avoid a build error)
include/dm/platdata.h
tools/dtoc/dtb_platdata.py
tools/dtoc/test_dtoc.py