of: overlay: add overlay unittest data for node names and symbols

Add nodes and properties to overlay_base and overlay dts files to
test for
   - incorrect existing node name detection when overlay node name
     has a unit-address
   - adding overlay __symbols__ properties to live tree when an
     overlay is added to the live tree

The following console messages will appear near the end of unittest
until the code errors are corrected:

   OF: Duplicate name in fairway-1, renamed to "ride@100#1"

   ### dt-test ### FAIL of_unittest_overlay_high_level():2296 Adding overlay 'overlay_bad_symbol' failed

   ### dt-test ### end of unittest - 190 passed, 1 failed

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
Frank Rowand
2017-07-19 09:25:20 -07:00
committed by Rob Herring
parent 0d638a07d3
commit 60a0004cc9
5 changed files with 81 additions and 10 deletions

View File

@@ -1994,6 +1994,8 @@ out:
static inline void __init of_unittest_overlay(void) { }
#endif
#ifdef CONFIG_OF_OVERLAY
/*
* __dtb_ot_begin[] and __dtb_ot_end[] are created by cmd_dt_S_dtb
* in scripts/Makefile.lib
@@ -2021,14 +2023,14 @@ struct overlay_info {
OVERLAY_INFO_EXTERN(overlay_base);
OVERLAY_INFO_EXTERN(overlay);
OVERLAY_INFO_EXTERN(overlay_bad_phandle);
#ifdef CONFIG_OF_OVERLAY
OVERLAY_INFO_EXTERN(overlay_bad_symbol);
/* order of entries is hard-coded into users of overlays[] */
static struct overlay_info overlays[] = {
OVERLAY_INFO(overlay_base, -9999),
OVERLAY_INFO(overlay, 0),
OVERLAY_INFO(overlay_bad_phandle, -EINVAL),
OVERLAY_INFO(overlay_bad_symbol, -EINVAL),
{}
};
@@ -2300,6 +2302,10 @@ static __init void of_unittest_overlay_high_level(void)
unittest(overlay_data_add(2),
"Adding overlay 'overlay_bad_phandle' failed\n");
unittest(overlay_data_add(3),
"Adding overlay 'overlay_bad_symbol' failed\n");
return;
err_unlock: