Palmetto PNOR Build Process Functionality
diff --git a/openpower/configs/hostboot/palmetto.config b/openpower/configs/hostboot/palmetto.config
new file mode 100755
index 0000000..b2f330d
--- /dev/null
+++ b/openpower/configs/hostboot/palmetto.config
@@ -0,0 +1,16 @@
+# The Serial Flash Controller is the AST2400 BMC.
+set LPC_SLAVE_AST2400
+set SFC_IS_AST2400
+set BMC_DOES_SFC_INIT
+unset SFC_IS_IBM_DPSS
+
+# VPD options.
+unset MVPD_READ_FROM_PNOR
+unset DJVPD_READ_FROM_PNOR
+unset HAVE_MBVPD
+set SKIP_RESTRICT_EX_UNITS
+
+# gpio config
+set GPIODD
+set PALMETTO_VDDR
+
diff --git a/openpower/configs/palmetto_defconfig b/openpower/configs/palmetto_defconfig
index 382bf6a..483c976 100644
--- a/openpower/configs/palmetto_defconfig
+++ b/openpower/configs/palmetto_defconfig
@@ -2,4 +2,44 @@
BR2_powerpc_power8=y
BR2_OPENPOWER_PLATFORM=y
-BR2_LINUX_KERNEL=n
+BR2_OPENPOWER_CONFIG_NAME="palmetto"
+BR2_HOSTBOOT_CONFIG_FILE="palmetto.config"
+
+BR2_HOSTBOOT_BINARY_SBE_FILENAME="palmetto_sbe.img.ecc"
+BR2_HOSTBOOT_BINARY_SBEC_FILENAME="palmetto_sbec_pad.img.ecc"
+
+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"
+
+BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME="PalmettoPnorLayout.xml"
+BR2_OPENPOWER_PNOR_FILENAME="palmetto.pnor"
+
+# skiboot requirements
+BR2_TARGET_SKIBOOT=y
+BR2_TARGET_SKIBOOT_EMBED_PAYLOAD=y
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_USE_DEFCONFIG=y
+BR2_LINUX_KERNEL_DEFCONFIG="pseries_defconfig"
+BR2_LINUX_KERNEL_ZIMAGE_EPAPR=y
+
+# petitboot requirements
+BR2_ENABLE_LOCALE_PURGE=y
+BR2_ENABLE_LOCALE_WHITELIST="C en_US"
+BR2_GENERATE_LOCALE="en_US.UTF-8"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="hvc0"
+BR2_ROOTFS_OVERLAY="overlay"
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
+BR2_PACKAGE_LINUX_FIRMWARE_CXGB4=y
+BR2_PACKAGE_NCURSES_WCHAR=y
+BR2_PACKAGE_DROPBEAR=y
+BR2_PACKAGE_ETHTOOL=y
+BR2_PACKAGE_NETCAT=y
+BR2_PACKAGE_RSYNC=y
+BR2_PACKAGE_PETITBOOT=y
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_XZ=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
diff --git a/openpower/package/Config.in b/openpower/package/Config.in
index 45b8e46..33b7b8c 100644
--- a/openpower/package/Config.in
+++ b/openpower/package/Config.in
@@ -1 +1,5 @@
source "$BR2_EXTERNAL/package/openpower-ffs/Config.in"
+source "$BR2_EXTERNAL/package/hostboot/Config.in"
+source "$BR2_EXTERNAL/package/hostboot-binaries/Config.in"
+source "$BR2_EXTERNAL/package/openpower-targeting/Config.in"
+source "$BR2_EXTERNAL/package/openpower-pnor/Config.in"
diff --git a/openpower/package/hostboot-binaries/Config.in b/openpower/package/hostboot-binaries/Config.in
new file mode 100644
index 0000000..eccf3e3
--- /dev/null
+++ b/openpower/package/hostboot-binaries/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOSTBOOT_BINARIES
+ bool "hostboot_binaries"
+ default y if (BR2_OPENPOWER_PLATFORM && BR2_powerpc_power8)
+ help
+ Project to stage hostboot binary images
diff --git a/openpower/package/hostboot-binaries/hostboot_binaries.mk b/openpower/package/hostboot-binaries/hostboot_binaries.mk
new file mode 100644
index 0000000..c6941fa
--- /dev/null
+++ b/openpower/package/hostboot-binaries/hostboot_binaries.mk
@@ -0,0 +1,21 @@
+################################################################################
+#
+# hostboot_binaries
+#
+################################################################################
+
+HOSTBOOT_BINARIES_VERSION = d4702ceb2b55bc9cba6b80b1088f61d9b65b3c1c
+HOSTBOOT_BINARIES_SITE = $(call github,open-power,hostboot-binaries,$(HOSTBOOT_BINARIES_VERSION))
+HOSTBOOT_BINARIES_LICENSE = Apache-2.0
+
+HOSTBOOT_BINARIES_INSTALL_IMAGES = YES
+HOSTBOOT_BINARIES_INSTALL_TARGET = NO
+
+define HOSTBOOT_BINARIES_INSTALL_IMAGES_CMDS
+ $(INSTALL) -D $(@D)/cvpd.bin $(STAGING_DIR)/hostboot_binaries/cvpd.bin
+ $(INSTALL) -D $(@D)/p8.ref_image.hdr.bin.ecc $(STAGING_DIR)/hostboot_binaries/p8.ref_image.hdr.bin.ecc
+ $(INSTALL) -D $(@D)/palmetto_sbec_pad.img.ecc $(STAGING_DIR)/hostboot_binaries/palmetto_sbec_pad.img.ecc
+ $(INSTALL) -D $(@D)/palmetto_sbe.img.ecc $(STAGING_DIR)/hostboot_binaries/palmetto_sbe.img.ecc
+endef
+
+$(eval $(generic-package))
diff --git a/openpower/package/hostboot/Config.in b/openpower/package/hostboot/Config.in
new file mode 100644
index 0000000..f7f8005
--- /dev/null
+++ b/openpower/package/hostboot/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_HOSTBOOT
+ bool "hostboot"
+ default y if (BR2_OPENPOWER_PLATFORM && BR2_powerpc_power8)
+ select BR2_CPP
+ help
+ Project to build the hostboot firmware codebase
+
+
+config BR2_HOSTBOOT_CONFIG_FILE
+ string "Hostboot configuration file for compilation"
+ default default
+ help
+ String used to define hw specific make config file
diff --git a/openpower/package/hostboot/hostboot.mk b/openpower/package/hostboot/hostboot.mk
new file mode 100644
index 0000000..0d09702
--- /dev/null
+++ b/openpower/package/hostboot/hostboot.mk
@@ -0,0 +1,27 @@
+################################################################################
+#
+# hostboot
+#
+################################################################################
+
+HOSTBOOT_VERSION = 38a5b53f55fbccced9b6f4bc0134dcbfe5fe39d0
+HOSTBOOT_SITE = $(call github,open-power,hostboot,$(HOSTBOOT_VERSION))
+HOSTBOOT_LICENSE = Apache-2.0
+HOSTBOOT_DEPENDENCIES = host-binutils
+
+HOSTBOOT_INSTALL_IMAGES = YES
+HOSTBOOT_INSTALL_TARGET = NO
+
+HOSTBOOT_ENV_VARS=$(TARGET_MAKE_ENV) \
+ CONFIG_FILE=$(BR2_EXTERNAL)/configs/hostboot/$(BR2_HOSTBOOT_CONFIG_FILE) \
+ OPENPOWER_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) HOST_PREFIX="" HOST_BINUTILS_DIR=$(HOST_BINUTILS_DIR)
+
+define HOSTBOOT_BUILD_CMDS
+ $(HOSTBOOT_ENV_VARS) sh -c 'cd $(@D) && source ./env.bash && $(MAKE)'
+endef
+
+define HOSTBOOT_INSTALL_IMAGES_CMDS
+ cd $(@D) && $(@D)/src/build/tools/hbDistribute --openpower $(STAGING_DIR)/hostboot_build_images/
+endef
+
+$(eval $(generic-package))
diff --git a/openpower/package/openpower-ffs/openpower-ffs.mk b/openpower/package/openpower-ffs/openpower-ffs.mk
index 1949138..3a3ea2d 100644
--- a/openpower/package/openpower-ffs/openpower-ffs.mk
+++ b/openpower/package/openpower-ffs/openpower-ffs.mk
@@ -1,6 +1,5 @@
-OPENPOWER_FFS_VERSION = b28fef379c786c3eb5c36af01ac6ece6163d54b2
-OPENPOWER_FFS_SITE = /gsa/ausgsa/home/i/a/iawillia/web/public/openpower/openpower-ffs
-OPENPOWER_FFS_SITE_METHOD = git
+OPENPOWER_FFS_VERSION = bf4630076762d9c20c16c80c1c791f352b046dd1
+OPENPOWER_FFS_SITE = $(call github,open-power,ffs,$(OPENPOWER_FFS_VERSION))
OPENPOWER_FFS_LICENSE = GPLv2+
define HOST_OPENPOWER_FFS_BUILD_CMDS
diff --git a/openpower/package/openpower-pnor/Config.in b/openpower/package/openpower-pnor/Config.in
new file mode 100644
index 0000000..5078824
--- /dev/null
+++ b/openpower/package/openpower-pnor/Config.in
@@ -0,0 +1,42 @@
+config BR2_PACKAGE_OPENPOWER_PNOR
+ bool "openpower_pnor"
+ default y if (BR2_OPENPOWER_PLATFORM && BR2_powerpc_power8)
+ help
+ Utilites for building a targeting binary image
+
+config BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME
+ string "Name of Openpower pnor xml layout file"
+ help
+ String used to define hw specific make config file
+
+config BR2_OPENPOWER_CONFIG_NAME
+ string "Name of configuration"
+ help
+ String used to define configuration name
+
+config BR2_OPENPOWER_PNOR_FILENAME
+ string "Name of pnor file to be created"
+ help
+ String used to define pnor filename to be created
+
+config BR2_SKIBOOT_LID_NAME
+ string "Name of skiboot lid name to be used"
+ default "skiboot.lid"
+ help
+ String used to define sapphire lid filename
+
+config BR2_HOSTBOOT_BINARY_SBE_FILENAME
+ string "Name of sbe hostboot binary"
+ help
+ String used to define name of sbe hostboot binary file
+
+
+config BR2_HOSTBOOT_BINARY_SBEC_FILENAME
+ string "Name of sbec hostboot binary"
+ help
+ String used to define name of sbec hostboot binary file
+
+config BR2_OPENPOWER_TARGETING_BIN_FILENAME
+ string "Name of openpower binary targeting file"
+ help
+ String used to define name of openpower targeting binary file
diff --git a/openpower/package/openpower-pnor/openpower-pnor.mk b/openpower/package/openpower-pnor/openpower-pnor.mk
new file mode 100644
index 0000000..62c9a69
--- /dev/null
+++ b/openpower/package/openpower-pnor/openpower-pnor.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# openpower_pnor
+#
+################################################################################
+
+OPENPOWER_PNOR_VERSION = a7f9b25eb1e7fac405bc1a54597cfc812a07fb3f
+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_INSTALL_IMAGES = YES
+OPENPOWER_PNOR_INSTALL_TARGET = NO
+
+#OPENPOWER_PNOR_FILENAME = palmetto.pnor
+#OPENPOWER_PNOR_TARGETING_FILE = $(STAGING_DIR)/openpower_targeting/PALMETTO_HB_targeting.bin
+
+
+#ECC_TOOL_DIR ???
+OPENPOWER_TARGETING_DIR=$(STAGING_DIR)/openpower_targeting/
+HOSTBOOT_IMAGE_DIR=$(STAGING_DIR)/hostboot_build_images/
+HOSTBOOT_BINARY_DIR = $(STAGING_DIR)/hostboot_binaries/
+OPENPOWER_PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch/
+
+define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
+ mkdir -p $(OPENPOWER_PNOR_SCRATCH_DIR)
+ $(TARGET_MAKE_ENV) $(@D)/update_image_$(BR2_OPENPOWER_CONFIG_NAME).pl -op_target_dir $(STAGING_DIR)/openpower_targeting/ -hb_image_dir $(HOSTBOOT_IMAGE_DIR) -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) -hb_binary_dir $(HOSTBOOT_BINARY_DIR);
+
+ mkdir -p $(STAGING_DIR)/pnor/
+ $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl -xml_layout_file $(@D)/$(BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME) -pnor_filename $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) -hb_image_dir $(HOSTBOOT_IMAGE_DIR) -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) -outdir $(STAGING_DIR)/pnor/ -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_BIN_FILENAME)
+
+ $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR)
+endef
+
+$(eval $(generic-package))
diff --git a/openpower/package/openpower-targeting/Config.in b/openpower/package/openpower-targeting/Config.in
new file mode 100755
index 0000000..bfbd6b2
--- /dev/null
+++ b/openpower/package/openpower-targeting/Config.in
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_OPENPOWER_TARGETING
+ bool "openpower_targeting"
+ default y if (BR2_OPENPOWER_PLATFORM && BR2_powerpc_power8)
+ help
+ Utilites for building a targeting binary image
+
+config BR2_OPENPOWER_TARGETING_BIN_FILENAME
+ string "openpower targeting binary file name"
+ default ""
+ help
+ Defines targeting binary file name created
+
+config BR2_OPENPOWER_TARGETING_SYSTEM_XML_FILENAME
+ string "openpower targeting system xml filename"
+ default ""
+ help
+ Defines the name of the system XML filename to be used when creating targeting binary image
+
+config BR2_OPENPOWER_TARGETING_MRW_XML_FILENAME
+ string "openpower targeting mrw xml filename"
+ default ""
+ help
+ Defines the name of the mrw XML filename to be used when creating targeting binary image
diff --git a/openpower/package/openpower-targeting/openpower-targeting.mk b/openpower/package/openpower-targeting/openpower-targeting.mk
new file mode 100644
index 0000000..af22f78
--- /dev/null
+++ b/openpower/package/openpower-targeting/openpower-targeting.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# openpower_targeting
+#
+################################################################################
+
+OPENPOWER_TARGETING_VERSION = 525d7b2eedab1708a53dfda94aad47128a62d40b
+OPENPOWER_TARGETING_SITE = $(call github,open-power,hostboot-targeting,$(OPENPOWER_TARGETING_VERSION))
+OPENPOWER_TARGETING_LICENSE = Apache-2.0
+OPENPOWER_TARGETING_DEPENDENCIES = hostboot-install-images
+
+OPENPOWER_TARGETING_INSTALL_IMAGES = YES
+OPENPOWER_TARGETING_INSTALL_TARGET = NO
+
+define OPENPOWER_TARGETING_INSTALL_IMAGES_CMDS
+ mkdir -p $(STAGING_DIR)/openpower_targeting/;
+
+ $(STAGING_DIR)/hostboot_build_images/mergexml.sh $(@D)/$(BR2_OPENPOWER_TARGETING_SYSTEM_XML_FILENAME) $(STAGING_DIR)/hostboot_build_images/attribute_types.xml $(STAGING_DIR)/hostboot_build_images/attribute_types_hb.xml $(STAGING_DIR)/hostboot_build_images/target_types_merged.xml $(STAGING_DIR)/hostboot_build_images/target_types_hb.xml $(@D)/$(BR2_OPENPOWER_TARGETING_MRW_XML_FILENAME) > $(STAGING_DIR)/openpower_targeting/temporary_hb.hb.xml;
+
+ $(STAGING_DIR)/hostboot_build_images/xmltohb.pl --hb-xml-file=$(STAGING_DIR)/openpower_targeting/temporary_hb.hb.xml --fapi-attributes-xml-file=$(STAGING_DIR)/hostboot_build_images/fapiattrs.xml --src-output-dir=none --img-output-dir=$(STAGING_DIR)/openpower_targeting/ --vmm-consts-file=$(STAGING_DIR)/hostboot_build_images/vmmconst.h --noshort-enums
+
+ mv $(STAGING_DIR)/openpower_targeting/targeting.bin $(STAGING_DIR)/openpower_targeting/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME)
+endef
+
+$(eval $(generic-package))