rainier_defconfig: Add multi-target support

Through OpenBMC and PLDM file.io, Power10 will support multiple MRW
definitions as part of one driver.

In order to achieve this in a staged approach, this commit introduces a
new 'openpower-pnor-p10' package that still creates the expected
pnor-related artifacts and intermediate files, while also creating the
individual files for each of the PNOR partitions (PAYLOAD, BOOTKERNEL)
inside the images/mmc directory. Each of those files will be suffixed
with ".P10" for target-agnostic files, or "uppercase-xml-name" (i.e.,
RAINIER_2U_XML) for target-specific files.

This patch also creates packages rainier-2u-xml and rainier-4u-xml(based
on machine-xml) that are both built and included in rainier_defconfig,
with rainier_2u_xml also serving as the 'legacy' pnor for smooth
transitions purposes.

Several other packages makefiles had to be reworked, but that should
allow both legacy openpower-pnor as well as the new mmc variant to build.

Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
diff --git a/openpower/package/pdata/Config.in b/openpower/package/pdata/Config.in
index df8ba38..622f0aa 100644
--- a/openpower/package/pdata/Config.in
+++ b/openpower/package/pdata/Config.in
@@ -3,8 +3,9 @@
 config BR2_PACKAGE_PDATA
         bool "pdata"
         default y if (BR2_OPENPOWER_POWER10)
+        select BR2_PACKAGE_HOST_DTC
         depends on BR2_PACKAGE_EKB
-        depends on BR2_PACKAGE_MACHINE_XML
+        depends on (BR2_PACKAGE_MACHINE_XML || BR2_PACKAGE_RAINIER_2U_XML || BR2_PACKAGE_RAINIER_4U_XML)
         help
           To initialize and boot a server, various software components
           ( BMC apps and Hostboot) will interact. PDATA provides device tree
@@ -15,6 +16,20 @@
 if BR2_PACKAGE_PDATA
 
 choice
+    prompt "PDATA location"
+
+config BR2_PDATA_GITHUB_PROJECT
+    bool "PDATA located at default Github project"
+
+config BR2_PDATA_CUSTOM_GIT
+    bool "PDATA located at Custom Git repository"
+
+endchoice
+
+config BR2_PDATA_CUSTOM_GIT_VALUE
+    string "URL of PDATA Custom Git repository"
+
+choice
     prompt "PDATA version"
     default BR2_PDATA_LATEST_VERSION
 
diff --git a/openpower/package/pdata/pdata.mk b/openpower/package/pdata/pdata.mk
index 4ebe703..b1500ba 100644
--- a/openpower/package/pdata/pdata.mk
+++ b/openpower/package/pdata/pdata.mk
@@ -5,11 +5,15 @@
 ################################################################################
 
 PDATA_VERSION = $(call qstrip,$(BR2_PDATA_VERSION))
-# TODO: WORKAROUND: Need to reenable next line and comment out the two lines
+ifeq ($(BR2_PDATA_GITHUB_PROJECT),y)
 # 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
+else ifeq ($(BR2_PDATA_CUSTOM_GIT),y)
+PDATA_SITE = $(BR2_PDATA_CUSTOM_GIT_VALUE)
+PDATA_SITE_METHOD = git
+endif
 
 PDATA_LICENSE = Apache-2.0
 PDATA_LICENSE_FILES = $(@D)/LICENSE
@@ -17,7 +21,7 @@
 PDATA_INSTALL_TARGET = NO
 PDATA_AUTORECONF = YES
 PDATA_AUTORECONF_OPTS += -I $(HOST_DIR)/share/autoconf-archive
-PDATA_DEPENDENCIES = ekb host-dtc machine-xml host-autoconf-archive
+PDATA_DEPENDENCIES = ekb host-dtc host-autoconf-archive
 
 EKB_STAGING_DIR = $(STAGING_DIR)/ekb
 MACHINE_XML_STAGING_DIR = $(STAGING_DIR)/openpower_mrw_scratch
@@ -27,13 +31,18 @@
 TARGET_PROC = p10
 endif
 
-QSTRIP_MACHINE_XML = $(call qstrip,$(BR2_OPENPOWER_MACHINE_XML_FILENAME))
+ifeq ($(BR2_PACKAGE_OPENPOWER_PNOR_P10),y)
+PDATA_DEPENDENCIES += $(call qstrip,$(BR2_OPENPOWER_P10_XMLS))
+QSTRIP_MACHINE_XMLS = $(call qstrip,$(foreach xml,$(BR2_OPENPOWER_P10_XMLS),$(MACHINE_XML_STAGING_DIR)/$(BR2_$(call UPPERCASE,$(call qstrip,$(xml)))_FILENAME)))
+else
+PDATA_DEPENDENCIES += machine-xml
+QSTRIP_MACHINE_XMLS = $(call qstrip,$(MACHINE_XML_STAGING_DIR)/$(BR2_OPENPOWER_MACHINE_XML_FILENAME))
+endif
 
-PDATA_CONF_OPTS = --enable-gen_dynamicdt \
-                  CHIP=$(TARGET_PROC) \
+PDATA_CONF_OPTS = --enable-gen_dynamicdt CHIP=$(TARGET_PROC)
 
-PDATA_MAKE_OPTS =  EKB=$(EKB_STAGING_DIR) \
-                   SYSTEMS_MRW_XML=$(MACHINE_XML_STAGING_DIR)/$(QSTRIP_MACHINE_XML) \
+PDATA_MAKE_OPTS = EKB=$(EKB_STAGING_DIR) \
+                  SYSTEMS_MRW_XML="$(QSTRIP_MACHINE_XMLS)"
 
 define PDATA_CREATE_M4_DIR
 		mkdir -p $(@D)/m4