@@ -336,6 +336,11 @@ foreach my $overlay (sort(keys(%$source)))
336
336
{
337
337
error(" Error ^ in overlay $overlay \n " );
338
338
}
339
+
340
+ dormant_checker($overlay );
341
+
342
+ my $checker = $overlay_checkers {$overlay };
343
+ ($checker -> [0])-> ($overlay , $checker -> [1], $source -> {$overlay }) if ($checker );
339
344
}
340
345
341
346
if ($try_all )
@@ -353,8 +358,6 @@ if ($try_all)
353
358
next if (system (" $DTMERGE $TMPDIR /$base .dtb $MERGED_DTB $TMPDIR /$overlay .dtbo >/dev/null 2>&1" ) == ((-2 & 0xff) << 8));
354
359
error(" Failed to merge $overlay with $base " ) if (system ($DTMERGE , $verbose ? (' -d' ) : (), " $TMPDIR /$base .dtb" , $MERGED_DTB , " $TMPDIR /$overlay .dtbo" ) != 0);
355
360
}
356
- my $checker = $overlay_checkers {$overlay };
357
- ($checker -> [0])-> ($overlay , $checker -> [1], $source -> {$overlay }) if ($checker );
358
361
}
359
362
}
360
363
@@ -826,7 +829,6 @@ sub get_params
826
829
}
827
830
}
828
831
829
- # print(join("\n", @lines), "\n") if ($fail);
830
832
return ($props , sort (@params ));
831
833
}
832
834
@@ -869,6 +871,66 @@ sub container_checker
869
871
}
870
872
}
871
873
874
+ sub dormant_checker
875
+ {
876
+ my ($overlay ) = @_ ;
877
+ my $ph ;
878
+ my $fragnum ;
879
+ my %is_dormant ;
880
+ my %is_wakeable ;
881
+ my $in_overrides = 0;
882
+
883
+ die if (!open ($ph , ' -|' , " ovmerge -N ${overlay} -overlay.dts" ));
884
+ while (my $line = <$ph >)
885
+ {
886
+ chomp ($line );
887
+ if ($in_overrides )
888
+ {
889
+ if ($line =~ / }/ )
890
+ {
891
+ $in_overrides = 0;
892
+ }
893
+ elsif ($line =~ / ^\s *([-\w ]+) = (.*?;)$ / )
894
+ {
895
+ my ($param , $rol ) = ($1 ,$2 );
896
+ while ($rol =~ / \G <(&\w +|0)>, "([^"]+)"(?:, |;)/cg )
897
+ {
898
+ my ($ref , $override ) = ($1 , $2 );
899
+ if ($ref eq ' 0' )
900
+ {
901
+ while ($override =~ / \G ([-+=!])(\d +)/cg )
902
+ {
903
+ my ($type , $num ) = ($1 , $2 );
904
+ $is_wakeable {$num } = 1 if ($type ne ' -' );
905
+ }
906
+ }
907
+ elsif ($override =~ / =$ / )
908
+ {
909
+ $rol =~ / \G [^,;]+(?:, |;)/cg ;
910
+ }
911
+ }
912
+ }
913
+ }
914
+ elsif ($line =~ / \b fragment@(\d +)\s\{ / )
915
+ {
916
+ $fragnum = $1 ;
917
+ }
918
+ elsif ($line =~ / \b __dormant__\b / )
919
+ {
920
+ $is_dormant {$fragnum } = 1;
921
+ }
922
+ elsif ($line =~ / \b __overrides__\b / )
923
+ {
924
+ $in_overrides = 1;
925
+ }
926
+ }
927
+
928
+ foreach my $frag (sort { $a <=> $b } keys (%is_dormant ))
929
+ {
930
+ error(" $overlay : fragment $frag is dormant and cannot be activated" ) if (!$is_wakeable {$frag });
931
+ }
932
+ }
933
+
872
934
sub error
873
935
{
874
936
print (" * $_ [0]\n " );
0 commit comments