Merge pull request #237 from rameshi1/gen-DTB
Enabled dynamic device tree generation
diff --git a/openpower/package/Config.in b/openpower/package/Config.in
index 906b69b..f344875 100755
--- a/openpower/package/Config.in
+++ b/openpower/package/Config.in
@@ -27,3 +27,5 @@
source "$BR2_EXTERNAL_OP_BUILD_PATH/package/sb-signing-framework/Config.in"
source "$BR2_EXTERNAL_OP_BUILD_PATH/package/ocmb-explorer-fw/Config.in"
source "$BR2_EXTERNAL_OP_BUILD_PATH/package/fsp-trace/Config.in"
+source "$BR2_EXTERNAL_OP_BUILD_PATH/package/ekb/Config.in"
+source "$BR2_EXTERNAL_OP_BUILD_PATH/package/pdata/Config.in"
diff --git a/openpower/package/ekb/Config.in b/openpower/package/ekb/Config.in
new file mode 100644
index 0000000..a70fa0f
--- /dev/null
+++ b/openpower/package/ekb/Config.in
@@ -0,0 +1,36 @@
+menu "ekb"
+
+config BR2_PACKAGE_EKB
+ bool "ekb"
+ default y if (BR2_OPENPOWER_POWER10)
+ help
+ To get FAPI attributes xml files. This is required for generate
+ power processor specific device tree by using specific HWPs xmls.
+ If new processor need to support then adding required xmls
+ in this package file is sufficient by using BR2_OPENPOWER_POWERxx.
+
+if BR2_PACKAGE_EKB
+
+choice
+ prompt "EKB version"
+ default BR2_EKB_LATEST_VERSION
+
+config BR2_EKB_LATEST_VERSION
+ bool "Use latest EKB master"
+
+config BR2_EKB_CUSTOM_VERSION
+ bool "Custom EKB version"
+
+endchoice
+
+config BR2_EKB_CUSTOM_VERSION_VALUE
+ string "EKB version"
+ depends on BR2_EKB_CUSTOM_VERSION
+
+config BR2_EKB_VERSION
+ string
+ default "289ff52f89894e39211150444ff3e9fc296e67df" if BR2_EKB_LATEST_VERSION
+ default BR2_EKB_CUSTOM_VERSION_VALUE if BR2_EKB_CUSTOM_VERSION
+endif
+
+endmenu
diff --git a/openpower/package/ekb/ekb.mk b/openpower/package/ekb/ekb.mk
new file mode 100644
index 0000000..4c5c32e
--- /dev/null
+++ b/openpower/package/ekb/ekb.mk
@@ -0,0 +1,39 @@
+################################################################################
+#
+# ekb
+#
+################################################################################
+
+EKB_VERSION = $(call qstrip,$(BR2_EKB_VERSION))
+# TODO: WORKAROUND: Need to reenable next line and comment out the two lines
+# after that, when code is propagated to a public repo
+#EKB_SITE = $(call github,openbmc,ekb,$(EKB_VERSION))
+EKB_SITE = git@github.ibm.com:openbmc/ekb.git
+EKB_SITE_METHOD = git
+
+EKB_INSTALL_STAGING = YES
+EKB_INSTALL_TARGET = NO
+
+EKB_STAGING_DIR = $(STAGING_DIR)/ekb/
+
+ifeq ($(BR2_OPENPOWER_POWER10),y)
+EKB_HWP_ATTRS_XML_FILES = chips/p10/procedures/xml/attribute_info/p10_clock_attributes.xml \
+ chips/p10/procedures/xml/attribute_info/p10_freq_attributes.xml \
+ chips/p10/procedures/xml/attribute_info/p10_ipl_attributes.xml \
+ chips/p10/procedures/xml/attribute_info/p10_nest_attributes.xml \
+ chips/p10/procedures/xml/attribute_info/p10_pervasive_attributes.xml \
+ chips/p10/procedures/xml/attribute_info/p10_runn_attributes.xml \
+ chips/p10/procedures/xml/attribute_info/p10_bars_attributes.xml \
+ hwpf/fapi2/xml/attribute_info/unit_attributes.xml \
+ hwpf/fapi2/xml/attribute_info/common_attributes.xml \
+ hwpf/fapi2/xml/attribute_info/chip_attributes.xml
+endif
+
+define EKB_INSTALL_STAGING_CMDS
+ # Creating ekb staging directory
+ mkdir -p $(EKB_STAGING_DIR)
+ # Copying all required hwps attributes xml file with respective directory structures
+ cd $(@D); cp --parents $(EKB_HWP_ATTRS_XML_FILES) $(EKB_STAGING_DIR)
+endef
+
+$(eval $(generic-package))
diff --git a/openpower/package/pdata/Config.in b/openpower/package/pdata/Config.in
new file mode 100644
index 0000000..cd688ae
--- /dev/null
+++ b/openpower/package/pdata/Config.in
@@ -0,0 +1,40 @@
+menu "pdata"
+
+config BR2_PACKAGE_PDATA
+ bool "pdata"
+ default y if (BR2_OPENPOWER_POWER10)
+ depends on BR2_PACKAGE_EKB
+ depends on BR2_PACKAGE_MACHINE_XML
+ help
+ To initialize and boot a server, various software components
+ ( BMC apps and Hostboot) will interact. PDATA provides device tree
+ based infrastructure to get the attributes which are required
+ to boot the server and run time usage. Also provides API's
+ to manage the attributes data.
+
+if BR2_PACKAGE_PDATA
+
+choice
+ prompt "PDATA version"
+ default BR2_PDATA_LATEST_VERSION
+
+config BR2_PDATA_LATEST_VERSION
+ bool "Use latest PDATA master"
+
+config BR2_PDATA_CUSTOM_VERSION
+ bool "Custom PDATA version"
+
+endchoice
+
+config BR2_PDATA_CUSTOM_VERSION_VALUE
+ string "PDATA version"
+ depends on BR2_PDATA_CUSTOM_VERSION
+
+config BR2_PDATA_VERSION
+ string
+ default "d28cf26ee82b11e76daf0ab21b79421e72222cee" if BR2_PDATA_LATEST_VERSION
+ default BR2_PDATA_CUSTOM_VERSION_VALUE if BR2_PDATA_CUSTOM_VERSION
+
+endif
+
+endmenu
diff --git a/openpower/package/pdata/pdata.mk b/openpower/package/pdata/pdata.mk
new file mode 100644
index 0000000..9cb811b
--- /dev/null
+++ b/openpower/package/pdata/pdata.mk
@@ -0,0 +1,42 @@
+################################################################################
+#
+# pdata
+#
+################################################################################
+
+PDATA_VERSION = $(call qstrip,$(BR2_PDATA_VERSION))
+# TODO: WORKAROUND: Need to reenable next line and comment out the two lines
+# after that, when code is propagated to a public repo
+#PDATA_SITE = $(call github,phal,pdata,$(PDATA_VERSION))
+PDATA_SITE = git@github.ibm.com:phal/pdata.git
+PDATA_SITE_METHOD = git
+
+PDATA_LICENSE = Apache-2.0
+PDATA_LICENSE_FILES = $(@D)/LICENSE
+PDATA_INSTALL_STAGING = YES
+PDATA_INSTALL_TARGET = NO
+PDATA_AUTORECONF = YES
+PDATA_DEPENDENCIES = ekb host-dtc machine-xml
+
+EKB_STAGING_DIR = $(STAGING_DIR)/ekb
+MACHINE_XML_STAGING_DIR = $(STAGING_DIR)/openpower_mrw_scratch
+
+TARGET_PROC =
+ifeq ($(BR2_OPENPOWER_POWER10),y)
+TARGET_PROC = p10
+endif
+
+QSTRIP_MACHINE_XML = $(call qstrip,$(BR2_OPENPOWER_MACHINE_XML_FILENAME))
+
+PDATA_CONF_OPTS = --enable-gen_dynamicdt
+PDATA_MAKE_OPTS = SYSTEM_NAME=$(call qstrip,$(BR2_OPENPOWER_CONFIG_NAME)) \
+ TARGET_PROC=$(TARGET_PROC) \
+ EKB=$(EKB_STAGING_DIR) \
+ SYSTEM_MRW_XML=$(MACHINE_XML_STAGING_DIR)/$(QSTRIP_MACHINE_XML) \
+
+define PDATA_CREATE_M4_DIR
+ mkdir -p $(@D)/m4
+endef
+
+PDATA_PRE_CONFIGURE_HOOKS += PDATA_CREATE_M4_DIR
+$(eval $(autotools-package))