Merge pull request #1024 from wak-google/fix-build

ppe42-gcc: Fix implicit dependencies
diff --git a/openpower/configs/linux/skiroot_defconfig b/openpower/configs/linux/skiroot_defconfig
index d8b8b1b..a43fdd9 100644
--- a/openpower/configs/linux/skiroot_defconfig
+++ b/openpower/configs/linux/skiroot_defconfig
@@ -39,7 +39,6 @@
 # CONFIG_PPC_PSERIES is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_CPU_IDLE=y
-CONFIG_GEN_RTC=y
 CONFIG_HZ_100=y
 CONFIG_KEXEC=y
 CONFIG_IRQ_ALL_CPUS=y
@@ -189,6 +188,8 @@
 # CONFIG_USB_EHCI_HCD_PPC_OF is not set
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_STORAGE=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_GENERIC=m
 CONFIG_VIRT_DRIVERS=y
 CONFIG_VIRTIO_PCI=y
 # CONFIG_IOMMU_SUPPORT is not set
diff --git a/openpower/configs/linux/skiroot_p9_defconfig b/openpower/configs/linux/skiroot_p9_defconfig
index a6f9452..bb96f51 100644
--- a/openpower/configs/linux/skiroot_p9_defconfig
+++ b/openpower/configs/linux/skiroot_p9_defconfig
@@ -39,7 +39,6 @@
 # CONFIG_PPC_PSERIES is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_CPU_IDLE=y
-CONFIG_GEN_RTC=y
 CONFIG_HZ_100=y
 CONFIG_KEXEC=y
 CONFIG_IRQ_ALL_CPUS=y
@@ -180,6 +179,8 @@
 # CONFIG_USB_EHCI_HCD_PPC_OF is not set
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_STORAGE=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_GENERIC=m
 CONFIG_VIRT_DRIVERS=y
 CONFIG_VIRTIO_PCI=y
 # CONFIG_IOMMU_SUPPORT is not set
diff --git a/openpower/package/hostboot/hostboot.mk b/openpower/package/hostboot/hostboot.mk
index 87c5ee3..d16228a 100644
--- a/openpower/package/hostboot/hostboot.mk
+++ b/openpower/package/hostboot/hostboot.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 HOSTBOOT_VERSION_BRANCH_MASTER_P8 ?= 695bd891343faf1f0ef85fe53148590e58239efd
-HOSTBOOT_VERSION_BRANCH_MASTER ?= d76f1bc4576fbe04a51c5ba45f52b01e0cea6006
+HOSTBOOT_VERSION_BRANCH_MASTER ?= 5799315afe7246ffb3609819cb27224e6e91c378
 
 HOSTBOOT_VERSION ?= $(if $(BR2_OPENPOWER_POWER9),$(HOSTBOOT_VERSION_BRANCH_MASTER),$(HOSTBOOT_VERSION_BRANCH_MASTER_P8))
 HOSTBOOT_SITE ?= $(call github,open-power,hostboot,$(HOSTBOOT_VERSION))
diff --git a/openpower/package/hostboot/p9Patches/hostboot-0003-Apply-RINGOVD-to-SBE-image-prior-to-core-data.patch b/openpower/package/hostboot/p9Patches/hostboot-0003-Apply-RINGOVD-to-SBE-image-prior-to-core-data.patch
new file mode 100644
index 0000000..39db238
--- /dev/null
+++ b/openpower/package/hostboot/p9Patches/hostboot-0003-Apply-RINGOVD-to-SBE-image-prior-to-core-data.patch
@@ -0,0 +1,113 @@
+From 71be7757544b29527ac75fcbc0dc32b9cff16b95 Mon Sep 17 00:00:00 2001
+From: Dean Sanner <dsanner@us.ibm.com>
+Date: Thu, 20 Apr 2017 13:03:13 -0500
+Subject: [PATCH] Apply RINGOVD to SBE image prior to core data
+
+  -SBE is tight on space and if ALL core data is applied
+   then ring override section doesn't fit.  Since this is
+   debug only, apply ring overrides to the base and let
+   code winnow down the boot cores to fit constraints
+
+Change-Id: Ic0338e94b65d0481c51aac1dfa42f1c95abc9a4c
+---
+ src/usr/sbe/sbe_update.C | 54 ++++++++++++++++++++++++------------------------
+ src/usr/sbe/sbe_update.H |  4 ++++
+ 2 files changed, 31 insertions(+), 27 deletions(-)
+
+diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C
+index 3b33345..8bbc471 100644
+--- a/src/usr/sbe/sbe_update.C
++++ b/src/usr/sbe/sbe_update.C
+@@ -930,8 +930,6 @@ namespace SBE
+             TRACFCOMP( g_trac_sbe,
+                        INFO_MRK"ringOvd():Valid overrides, applying them");
+ 
+-            // Hard coded value, pass in 2KB max
+-            uint32_t RING_OVD_SIZE = 0x800;
+             FAPI_INVOKE_HWP(l_err,p9_xip_section_append,
+                             (void *)l_pnorRingOvd.vaddr,
+                             RING_OVD_SIZE,
+@@ -1047,31 +1045,6 @@ namespace SBE
+                 // Check for no error and use of input cores
+                 if ( (NULL == err) && (procIOMask == coreMask))
+                 {
+-                    // Check if we have a valid ring override section and
+-                    // append it in if so
+-                    uint32_t l_ovdImgSize = static_cast<uint32_t>(i_maxImgSize);
+-                    err = ringOvd(io_imgPtr,l_ovdImgSize);
+-                    if(err)
+-                    {
+-                        TRACFCOMP( g_trac_sbe,
+-                              ERR_MRK"procCustomizeSbeImg(): "
+-                              "Error in call to ringOvd!");
+-                        break;
+-                    }
+-                    // If it's larger then the original size then we added some
+-                    // overrides
+-                    if(l_ovdImgSize > tmpImgSize)
+-                    {
+-                        // We added an override so adjust tmpImgSize
+-                        TRACFCOMP( g_trac_sbe,
+-                              INFO_MRK"procCustomizeSbeImg(): We added some "
+-                              "ring overrides, initial image size:%u "
+-                              "new image size:%u",
+-                              tmpImgSize, l_ovdImgSize);
+-
+-                        tmpImgSize = l_ovdImgSize;
+-                    }
+-
+                     // Procedure was successful
+                     procedure_success = true;
+ 
+@@ -1879,6 +1852,33 @@ namespace SBE
+                 break;
+             }
+ 
++            /*******************************************/
++            /*  Append RINGOVD Image from PNOR to SBE  */
++            /*******************************************/
++            // Check if we have a valid ring override section and
++            // append it in if so
++            uint32_t l_ovdImgSize =
++              static_cast<uint32_t>(sbeHbblImgSize+RING_OVD_SIZE);
++            err = ringOvd(sbeHbblImgPtr,l_ovdImgSize);
++            if(err)
++            {
++                TRACFCOMP( g_trac_sbe,
++                           ERR_MRK"procCustomizeSbeImg(): "
++                           "Error in call to ringOvd!");
++                break;
++            }
++
++            //If it's larger then the original size then we added some overrides
++            if(l_ovdImgSize > sbeHbblImgSize)
++            {
++                // We added an override so adjust tmpImgSize
++                TRACFCOMP( g_trac_sbe,
++                           INFO_MRK"procCustomizeSbeImg(): We added some "
++                           "ring overrides, initial image size:%u "
++                           "new image size:%u",
++                           sbeHbblImgSize, l_ovdImgSize);
++            }
++
+ 
+             /*******************************************/
+             /*  Customize SBE/HBBL Image and           */
+diff --git a/src/usr/sbe/sbe_update.H b/src/usr/sbe/sbe_update.H
+index d4ed027..8d82cb5 100644
+--- a/src/usr/sbe/sbe_update.H
++++ b/src/usr/sbe/sbe_update.H
+@@ -85,6 +85,10 @@ namespace SBE
+     // (PERV_SB_CS_SCOM 0x00050008 or PERV_SB_CS_FSI 0x2808)
+     const uint64_t SBE_BOOT_SELECT_MASK = 0x0000400000000000;
+ 
++    // Hard coded value, pass in 1KB max
++    const uint32_t RING_OVD_SIZE = 0x400;
++
++
+     // PNOR SBE and SBEC Partition constants
+     const uint32_t MAX_SBE_ENTRIES = 9;
+     const uint32_t SBETOC_EYECATCH = 0x53424500;  //'SBE\0'
+-- 
+1.8.2.2
+
diff --git a/openpower/package/petitboot/petitboot.mk b/openpower/package/petitboot/petitboot.mk
index 5d28fc7..2835be3 100644
--- a/openpower/package/petitboot/petitboot.mk
+++ b/openpower/package/petitboot/petitboot.mk
@@ -44,8 +44,6 @@
 	$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/petitboot/boot.d
 	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/01-create-default-dtb \
 		$(TARGET_DIR)/etc/petitboot/boot.d/
-	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-dtb-updates \
-		$(TARGET_DIR)/etc/petitboot/boot.d/
 	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \
 		$(TARGET_DIR)/etc/petitboot/boot.d/
 
@@ -72,6 +70,15 @@
 	$(MAKE) -C $(@D)/po DESTDIR=$(TARGET_DIR) install
 endef
 
+define PETITBOOT_POST_INSTALL_DTB
+	$(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-dtb-updates \
+		$(TARGET_DIR)/etc/petitboot/boot.d/
+endef
+
 PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL
 
+ifeq ($(BR2_PACKAGE_DTC),y)
+	PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL_DTB
+endif
+
 $(eval $(autotools-package))
diff --git a/openpower/package/witherspoon-xml/witherspoon.mk b/openpower/package/witherspoon-xml/witherspoon.mk
index c34eee7..ef9f19f 100644
--- a/openpower/package/witherspoon-xml/witherspoon.mk
+++ b/openpower/package/witherspoon-xml/witherspoon.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-WITHERSPOON_XML_VERSION ?= 07ef29dcfbfe88943a0fde35bebeec79d0fee62d
+WITHERSPOON_XML_VERSION ?= 9f27890d189eb79f1365e53d3350881060a75448
 WITHERSPOON_XML_SITE ?= $(call github,open-power,witherspoon-xml,$(WITHERSPOON_XML_VERSION))
 
 WITHERSPOON_XML_LICENSE = Apache-2.0