Add CAPI ucode

This adds building the CAPI ucode into the palmetto and habenero pnor images.

Signed-off-by: Michael Neuling <mikey@neuling.org>
diff --git a/openpower/configs/habanero_defconfig b/openpower/configs/habanero_defconfig
index 4ad8ee0..37707e9 100644
--- a/openpower/configs/habanero_defconfig
+++ b/openpower/configs/habanero_defconfig
@@ -17,6 +17,7 @@
 
 BR2_OPENPOWER_TARGETING_BIN_FILENAME="HABANERO_HB.targeting.bin"
 BR2_OPENPOWER_TARGETING_ECC_FILENAME="HABANERO_HB.targeting.bin.ecc"
+BR2_CAPP_UCODE_BIN_FILENAME="cappucode.bin"
 
 BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME="defaultPnorLayoutWithGoldenSide.xml"
 BR2_OPENPOWER_PNOR_FILENAME="habanero.pnor"
diff --git a/openpower/configs/palmetto_defconfig b/openpower/configs/palmetto_defconfig
index 9bde27f..3ae1380 100644
--- a/openpower/configs/palmetto_defconfig
+++ b/openpower/configs/palmetto_defconfig
@@ -17,6 +17,7 @@
 
 BR2_OPENPOWER_TARGETING_BIN_FILENAME="PALMETTO_HB.targeting.bin"
 BR2_OPENPOWER_TARGETING_ECC_FILENAME="PALMETTO_HB.targeting.bin.ecc"
+BR2_CAPP_UCODE_BIN_FILENAME="cappucode.bin"
 
 BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME="defaultPnorLayoutSingleSide.xml"
 BR2_OPENPOWER_PNOR_FILENAME="palmetto.pnor"
diff --git a/openpower/package/Config.in b/openpower/package/Config.in
index e844bc1..c0a0dc1 100644
--- a/openpower/package/Config.in
+++ b/openpower/package/Config.in
@@ -7,3 +7,4 @@
 source "$BR2_EXTERNAL/package/openpower-pnor/Config.in"
 source "$BR2_EXTERNAL/package/p8-pore-binutils/Config.in"
 source "$BR2_EXTERNAL/package/occ/Config.in"
+source "$BR2_EXTERNAL/package/capp-ucode/Config.in"
diff --git a/openpower/package/capp-ucode/Config.in b/openpower/package/capp-ucode/Config.in
new file mode 100644
index 0000000..1bdbc23
--- /dev/null
+++ b/openpower/package/capp-ucode/Config.in
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_CAPP_UCODE
+        bool "capp_capp"
+        default y if (BR2_OPENPOWER_PLATFORM && BR2_powerpc_power8)
+        help
+            Microcode for CAPP hardware
+
+config BR2_CAPP_UCODE_BIN_FILENAME
+        string "Name of CAPP UCODE image file"
+        help
+            String used to define name of the CAPP UCODE binary image file
diff --git a/openpower/package/capp-ucode/capp-ucode.mk b/openpower/package/capp-ucode/capp-ucode.mk
new file mode 100644
index 0000000..a295f60
--- /dev/null
+++ b/openpower/package/capp-ucode/capp-ucode.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# capp-ucode.mk
+#
+################################################################################
+CAPP_UCODE_VERSION ?= e5167a6f534ea3bdc2faef80dc37ee806a3f2eb1
+CAPP_UCODE_SITE ?= $(call github,open-power,capp-ucode,$(CAPP_UCODE_VERSION))
+PETITBOOT_LICENSE = Apache-2.0
+
+CAPP_UCODE_INSTALL_IMAGES = YES
+
+define CAPP_UCODE_BUILD_CMDS
+	cd $(@D) && ./build.sh
+endef
+
+define CAPP_UCODE_INSTALL_IMAGES_CMDS
+       $(INSTALL) $(@D)/cappucode.bin $(BINARIES_DIR)
+endef
+
+$(eval $(generic-package))
diff --git a/openpower/package/openpower-pnor/openpower-pnor.mk b/openpower/package/openpower-pnor/openpower-pnor.mk
index 15e4417..206bfc2 100644
--- a/openpower/package/openpower-pnor/openpower-pnor.mk
+++ b/openpower/package/openpower-pnor/openpower-pnor.mk
@@ -8,11 +8,11 @@
 # make doesn't care for quotes in the dependencies.
 XML_PACKAGE=$(subst $\",,$(BR2_OPENPOWER_XML_PACKAGE))
 
-OPENPOWER_PNOR_VERSION ?= 94389f62eabecf00ef129b4184bf4ba2bc9cd193
+OPENPOWER_PNOR_VERSION ?= 5da1804b9be4dbbb14787719967d23857fa93e3c
 OPENPOWER_PNOR_SITE ?= $(call github,open-power,pnor,$(OPENPOWER_PNOR_VERSION))
 
 OPENPOWER_PNOR_LICENSE = Apache-2.0
-OPENPOWER_PNOR_DEPENDENCIES = hostboot hostboot-binaries $(XML_PACKAGE) skiboot host-openpower-ffs occ
+OPENPOWER_PNOR_DEPENDENCIES = hostboot hostboot-binaries $(XML_PACKAGE) skiboot host-openpower-ffs occ capp-ucode
 
 OPENPOWER_PNOR_INSTALL_IMAGES = YES
 OPENPOWER_PNOR_INSTALL_TARGET = NO
@@ -33,7 +33,8 @@
             -targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \
             -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
             -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
-            -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME)
+            -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
+            -capp_binary_filename $(BINARIES_DIR)/$(BR2_CAPP_UCODE_BIN_FILENAME)
 
         mkdir -p $(STAGING_DIR)/pnor/
         $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \