cros_bundle_firmware: Push hashes in nodes rather than subnodes

For snow we had a hack to allow the EC to be packed in with U-Boot so that it
could be signed. We added a feature to hash each of the blobs in the section,
and add a hash for each, like:

   ro-boot {
      ...
      boot {
         hash = <...>;
      };
      fdt {
         hash = <...>;
      };
      ec {
         hash = <...>;
      };
   }

We are doing this differently now. There is only one blob per section (except
for FDT) and it is a pain to go into each subnode to get the hash.

Keep the old behavior behind a 'with_index' flag, which is only used by
depthcharge at present (for no good reason, since it already has code to deal
with device tree and could just use that).

Add new behavior which is to hash each section that has an 'add-hash'
property in it. This will be easy for U-Boot to pick up, without traversing
into subnodes.

The new structure is much more sane:

   ro-boot {
      ...
      hash = <...>;
   };

BUG=chrome-os-partner:21115
TEST=FEATURES=test sudo -E  emerge cros-devutils
In U-Boot, use 'vboot_test fmap' to see that it can read the hashes correctly.

Change-Id: Ia660e3236f200ad0e147071725e1195b9cf5755c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64741
1 file changed