meta-google: image_types_hoth: add way to embed 2 RoT firmware

Merge 2 platform BMC image, so need to have both RoT fw inside.

Tested:

1. Make sure target BMC image have both RoTs and they are
in right address.
2. Make sure other platforms are not affected.
3. Test on the target BMC image to make sure both platforms
are working well with both RoTs.

Change-Id: Icbe1b34b1a3fcd26433054b36e6cbbb52036d003
Signed-off-by: Claire Liao <claireliao@google.com>
diff --git a/meta-google/classes/image_types_hoth.bbclass b/meta-google/classes/image_types_hoth.bbclass
index e0bce25..78df090 100644
--- a/meta-google/classes/image_types_hoth.bbclass
+++ b/meta-google/classes/image_types_hoth.bbclass
@@ -12,13 +12,22 @@
 # Leave a zero-size u-boot env partition.
 FLASH_UBOOT_ENV_OFFSET = "${FLASH_KERNEL_OFFSET}"
 
+# Support BMC image to have secondary hoth firmware
+ENABLE_HOTH_SECONDARY ?= "no"
+
 python do_generate_static:append() {
     _append_image(os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True),
                                'image-hoth-update'),
                   int(d.getVar('FLASH_HOTH_UPDATE_OFFSET', True)),
                   int(d.getVar('FLASH_SIZE', True)))
+    if d.getVar('ENABLE_HOTH_SECONDARY',True) == 'yes':
+        _append_image(os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True),
+                               'image-hoth-update-2nd'),
+                  int(d.getVar('FLASH_HOTH_SECONDARY_OFFSET', True)),
+                  int(d.getVar('FLASH_SIZE', True)))
 }
 do_generate_static[depends] += "virtual/hoth-firmware:do_deploy"
+do_generate_static[depends] += "${@'virtual/hoth-firmware-2nd:do_deploy' if ENABLE_HOTH_SECONDARY == 'yes' else ''}"
 
 python do_generate_layout () {
     import time