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/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