Add OCC buildroot tooling
diff --git a/openpower/configs/habanero_defconfig b/openpower/configs/habanero_defconfig
index c979e18..cad44ef 100644
--- a/openpower/configs/habanero_defconfig
+++ b/openpower/configs/habanero_defconfig
@@ -8,6 +8,8 @@
BR2_HOSTBOOT_BINARY_SBE_FILENAME="venice_sbe.img.ecc"
BR2_HOSTBOOT_BINARY_SBEC_FILENAME="centaur_sbec_pad.img.ecc"
+BR2_OCC_BIN_FILENAME="occ.bin"
+
BR2_OPENPOWER_TARGETING_SYSTEM_XML_FILENAME="HABANERO_hb.system.xml"
BR2_OPENPOWER_TARGETING_MRW_XML_FILENAME="HABANERO_hb.mrw.xml"
BR2_OPENPOWER_TARGETING_BIN_FILENAME="HABANERO_HB.targeting.bin"
diff --git a/openpower/configs/palmetto_defconfig b/openpower/configs/palmetto_defconfig
index 75de67b..86da41c 100644
--- a/openpower/configs/palmetto_defconfig
+++ b/openpower/configs/palmetto_defconfig
@@ -8,6 +8,8 @@
BR2_HOSTBOOT_BINARY_SBE_FILENAME="venice_sbe.img.ecc"
BR2_HOSTBOOT_BINARY_SBEC_FILENAME="centaur_sbec_pad.img.ecc"
+BR2_OCC_BIN_FILENAME="occ.bin"
+
BR2_OPENPOWER_TARGETING_SYSTEM_XML_FILENAME="PALMETTO_hb.system.xml"
BR2_OPENPOWER_TARGETING_MRW_XML_FILENAME="PALMETTO_hb.mrw.xml"
BR2_OPENPOWER_TARGETING_BIN_FILENAME="PALMETTO_HB.targeting.bin"
diff --git a/openpower/package/Config.in b/openpower/package/Config.in
index 33b7b8c..ca858d6 100644
--- a/openpower/package/Config.in
+++ b/openpower/package/Config.in
@@ -3,3 +3,5 @@
source "$BR2_EXTERNAL/package/hostboot-binaries/Config.in"
source "$BR2_EXTERNAL/package/openpower-targeting/Config.in"
source "$BR2_EXTERNAL/package/openpower-pnor/Config.in"
+source "$BR2_EXTERNAL/package/p8-pore-binutils/Config.in"
+source "$BR2_EXTERNAL/package/occ/Config.in"
diff --git a/openpower/package/occ/Config.in b/openpower/package/occ/Config.in
new file mode 100644
index 0000000..f00396d
--- /dev/null
+++ b/openpower/package/occ/Config.in
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_OCC
+ bool "occ"
+ default y if (BR2_OPENPOWER_PLATFORM && BR2_powerpc_power8)
+ select BR2_CPP
+ help
+ Project to build OCC
+
+config BR2_OCC_BIN_FILENAME
+ string "Name of OCC image file"
+ help
+ String used to define name of the OCC binary image file
diff --git a/openpower/package/occ/occ.mk b/openpower/package/occ/occ.mk
new file mode 100644
index 0000000..3d68d4e
--- /dev/null
+++ b/openpower/package/occ/occ.mk
@@ -0,0 +1,28 @@
+################################################################################
+#
+# occ
+#
+################################################################################
+
+OCC_VERSION ?= 6d6e33e87de7f4413f8a6c4712059d439159fded
+OCC_SITE ?= $(call github,open-power,occ,$(OCC_VERSION))
+OCC_LICENSE = Apache-2.0
+OCC_DEPENDENCIES = host-binutils p8-pore-binutils
+
+OCC_INSTALL_IMAGES = YES
+OCC_INSTALL_TARGET = NO
+
+OCC_STAGING_DIR = $(STAGING_DIR)/occ
+
+define OCC_BUILD_CMDS
+ cd $(@D)/src && \
+ make POREPATH=$(P8_PORE_BINUTILS_BIN)/bin/ OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) all && \
+ make combineImage
+endef
+
+define OCC_INSTALL_IMAGES_CMDS
+ mkdir -p $(STAGING_DIR)/occ
+ cp $(@D)/src/image.bin $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME)
+endef
+
+$(eval $(generic-package))
diff --git a/openpower/package/openpower-pnor/openpower-pnor.mk b/openpower/package/openpower-pnor/openpower-pnor.mk
index adff008..db427fc 100644
--- a/openpower/package/openpower-pnor/openpower-pnor.mk
+++ b/openpower/package/openpower-pnor/openpower-pnor.mk
@@ -5,10 +5,11 @@
################################################################################
-OPENPOWER_PNOR_VERSION ?= 121e1ff744eb87b2bcfa277f5eb10511fd78019e
+OPENPOWER_PNOR_VERSION ?= e0e46ec7327edd6b24947706f074cd04d239cc86
OPENPOWER_PNOR_SITE ?= $(call github,open-power,pnor,$(OPENPOWER_PNOR_VERSION))
+
OPENPOWER_PNOR_LICENSE = Apache-2.0
-OPENPOWER_PNOR_DEPENDENCIES = hostboot hostboot-binaries openpower-targeting skiboot host-openpower-ffs
+OPENPOWER_PNOR_DEPENDENCIES = hostboot hostboot-binaries openpower-targeting skiboot host-openpower-ffs occ
OPENPOWER_PNOR_INSTALL_IMAGES = YES
OPENPOWER_PNOR_INSTALL_TARGET = NO
@@ -28,7 +29,8 @@
-targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
-targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \
-sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
- -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME)
+ -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
+ -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME)
mkdir -p $(STAGING_DIR)/pnor/
$(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \
@@ -40,6 +42,7 @@
-payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) \
-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) \
-targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME)
$(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR)
diff --git a/openpower/package/p8-pore-binutils/Config.in b/openpower/package/p8-pore-binutils/Config.in
new file mode 100644
index 0000000..7fd414c
--- /dev/null
+++ b/openpower/package/p8-pore-binutils/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_P8_PORE_BINUTILS
+ bool "p8-pore-binutils"
+ default y if (BR2_OPENPOWER_PLATFORM && BR2_powerpc_power8)
+ select BR2_CPP
+ help
+ Project to build the P8 PORE binutils
diff --git a/openpower/package/p8-pore-binutils/p8-pore-binutils.mk b/openpower/package/p8-pore-binutils/p8-pore-binutils.mk
new file mode 100644
index 0000000..3009f7d
--- /dev/null
+++ b/openpower/package/p8-pore-binutils/p8-pore-binutils.mk
@@ -0,0 +1,32 @@
+################################################################################
+#
+# p8-pore-binutils
+#
+################################################################################
+
+P8_PORE_BINUTILS_VERSION ?= 94a1a56cb3ce72a2d6202ab54206912cf9e1feb1
+P8_PORE_BINUTILS_SITE ?= $(call github,open-power,p8-pore-inutils,$(P8_PORE_BINUTILS_VERSION))
+P8_PORE_BINUTILS_LICENSE = Apache-2.0
+P8_PORE_BINUTILS_DEPENDENCIES = host-binutils
+
+P8_PORE_BINUTILS_INSTALL_IMAGES = YES
+P8_PORE_BINUTILS_INSTALL_TARGET = NO
+
+P8_PORE_BINUTILS_DIR = $(STAGING_DIR)/p8-pore-binutils
+P8_PORE_BINUTILS_BIN = $(STAGING_DIR)/p8-pore-binutils/linux
+
+define P8_PORE_BINUTILS_BUILD_CMDS
+ cd $(@D) && \
+ ./configure --prefix=$(P8_PORE_BINUTILS_DIR) \
+ --exec-prefix=$(P8_PORE_BINUTILS_BIN) \
+ --target=pore-elf64 \
+ --build=i386-unknown-linux-gnu && \
+ make configure-host && \
+ make LDFLAGS=-all-static
+endef
+
+define P8_PORE_BINUTILS_INSTALL_IMAGES_CMDS
+ bash -c 'cd $(@D) && make install'
+endef
+
+$(eval $(generic-package))