Merge "rcar_gen3: Add missing #{address,size}-cells into generated DT" into integration
diff --git a/docs/change-log-upcoming.rst b/docs/change-log-upcoming.rst
new file mode 100644
index 0000000..3d7d509
--- /dev/null
+++ b/docs/change-log-upcoming.rst
@@ -0,0 +1,145 @@
+Change Log for Upcoming Release
+===============================
+
+This document contains a summary of the new features, changes, fixes and known
+issues to be included in the upcoming release of Trusted Firmware-A. The contents
+of this file will be moved to the collective change-log.rst file at the time of
+release code freeze.
+
+
+Upcoming Release Version 2.3
+----------------------------
+
+**Trusted Firmware-A Contributors,
+Please log all relevant new features, changes, fixes, and known issues for the
+upcoming release.  For the CPU support, drivers, and tools sections please preface
+the log description with the relevant key word, example: "<CPU>: <CPU Support
+addition>".  Use the RST format convention already used in the Change Log.**
+
+New Features
+^^^^^^^^^^^^
+
+- Arm Architecture
+   - Example: "Add support for Branch Target Identification (BTI)"
+
+- Build System
+   - Example: "Add support for default stack-protector flag"
+
+- CPU Support
+   - Example: "cortex-a55: Workaround for erratum 1221012"
+
+- Drivers
+   - Example: "console: Allow the console to register multiple times"
+
+- Libraries
+   - Example: "Introduce BTI support in Library at ROM (romlib)"
+
+- New Platforms Support
+   - Example: "qemu/qemu_sbsa: New platform support added for QEMU SBSA platform"
+
+- Platforms
+   - Example: "arm/common: Introduce wrapper functions to setup secure watchdog"
+
+- PSCI
+   - Example: "Adding new optional PSCI hook ``pwr_domain_on_finish_late``"
+
+- Security
+   - Example: "UBSAN support and handlers"
+
+- Tools
+   - Example: "fiptool: Add support to build fiptool on Windows."
+
+
+Changed
+^^^^^^^
+
+- Arm Architecture
+   - Example: "Refactor ARMv8.3 Pointer Authentication support code"
+
+- BL-Specific
+   - Example: "BL2: Invalidate dcache build option for BL2 entry at EL3"
+
+- Boot Flow
+   - Example: "Add helper to parse BL31 parameters (both versions)"
+
+- Drivers
+   - Example: "gicv3: Prevent pending G1S interrupt from becoming G0 interrupt"
+
+- Platforms
+   - Example: "arm/common: Shorten the Firmware Update (FWU) process"
+
+- PSCI
+   - Example: "PSCI: Lookup list of parent nodes to lock only once"
+
+- Secure Partition Manager (SPM)
+   - Example: "Move shim layer to TTBR1_EL1"
+
+- Security
+   - Example: "Refactor SPSR initialisation code"
+
+- Tools
+   - Example: "cert_create: Remove RSA PKCS#1 v1.5 support"
+
+
+Resolved Issues
+^^^^^^^^^^^^^^^
+
+- Arm Architecture
+   - Example: "Fix restoration of PAuth context"
+
+- BL-Specific
+   - Example: "Fix BL31 crash reporting on AArch64 only platforms"
+
+- Build System
+   - Example: "Remove several warnings reported with W=2 and W=1"
+
+- Code Quality
+   - Example: "Unify type of "cpu_idx" across PSCI module"
+
+- CPU Support
+   - Example: "cortex-a12: Fix MIDR mask"
+
+- Drivers
+   - Example: "scmi: Fix wrong payload length"
+
+- Library Code
+   - Example: "libc: Fix memchr implementation"
+
+- Platforms
+   - Example: "rpi: rpi3: Fix compilation error when stack protector is enabled"
+
+- Security
+   - Example: "AArch32: Disable Secure Cycle Counter"
+
+Deprecations
+^^^^^^^^^^^^
+
+- Common Code
+   - Example: "Remove MULTI_CONSOLE_API flag and references to it"
+
+- Drivers
+   - Example: "console: Remove deprecated finish_console_register"
+
+- Secure Partition Manager (SPM):
+   - Example: "Prototype SPCI-based SPM (services/std_svc/spm) will be replaced
+     with alternative methods of secure partitioning support."
+
+Known Issues
+^^^^^^^^^^^^
+
+- Build System
+   - dtb: DTB creation not supported when building on a Windows host.
+
+     This step in the build process is skipped when running on a Windows host. A
+     known issue from the 1.6 release.
+
+- Platforms
+   - arm/juno: System suspend from Linux does not function as documented in the
+     user guide
+
+     Following the instructions provided in the user guide document does not
+     result in the platform entering system suspend state as expected. A message
+     relating to the hdlcd driver failing to suspend will be emitted on the
+     Linux terminal.
+
+   - mediatek/mt6795: This platform does not build in this release
diff --git a/include/plat/marvell/a8k/common/armada_common.h b/include/plat/marvell/a8k/common/armada_common.h
index dd2a24a..709d009 100644
--- a/include/plat/marvell/a8k/common/armada_common.h
+++ b/include/plat/marvell/a8k/common/armada_common.h
@@ -124,5 +124,6 @@
 			       uint32_t *size, uintptr_t base);
 int marvell_get_ccu_memory_map(int ap_idx, struct addr_map_win **win,
 			       uint32_t *size);
+int system_power_off(void);
 
 #endif /* ARMADA_COMMON_H */
diff --git a/plat/allwinner/common/allwinner-common.mk b/plat/allwinner/common/allwinner-common.mk
index e717e20..98bcf3e 100644
--- a/plat/allwinner/common/allwinner-common.mk
+++ b/plat/allwinner/common/allwinner-common.mk
@@ -61,8 +61,5 @@
 # BL31 gets loaded alongside BL33 (U-Boot) by U-Boot's SPL
 RESET_TO_BL31			:=	1
 
-# We are short on memory, so save 3.5KB by not having an extra coherent page.
-USE_COHERENT_MEM		:=	0
-
 # This platform is single-cluster and does not require coherency setup.
 WARMBOOT_ENABLE_DCACHE_EARLY	:=	1
diff --git a/plat/allwinner/common/include/platform_def.h b/plat/allwinner/common/include/platform_def.h
index 4de8b0b..0a00076 100644
--- a/plat/allwinner/common/include/platform_def.h
+++ b/plat/allwinner/common/include/platform_def.h
@@ -32,7 +32,7 @@
 #define CACHE_WRITEBACK_SHIFT		6
 #define CACHE_WRITEBACK_GRANULE		(1 << CACHE_WRITEBACK_SHIFT)
 
-#define MAX_MMAP_REGIONS		(3 + PLATFORM_MMAP_REGIONS)
+#define MAX_MMAP_REGIONS		(4 + PLATFORM_MMAP_REGIONS)
 #define MAX_XLAT_TABLES			1
 
 #define PLAT_MAX_PWR_LVL_STATES		U(2)
diff --git a/plat/allwinner/common/sunxi_common.c b/plat/allwinner/common/sunxi_common.c
index 1e21a42..cff8268 100644
--- a/plat/allwinner/common/sunxi_common.c
+++ b/plat/allwinner/common/sunxi_common.c
@@ -57,6 +57,10 @@
 	mmap_add_region(BL_RO_DATA_BASE, BL_RO_DATA_BASE,
 			BL_RO_DATA_END - BL_RO_DATA_BASE,
 			MT_RO_DATA | MT_SECURE);
+	mmap_add_region(BL_COHERENT_RAM_BASE, BL_COHERENT_RAM_BASE,
+			BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE,
+			MT_DEVICE | MT_RW | MT_SECURE | MT_EXECUTE_NEVER);
+
 	mmap_add(sunxi_mmap);
 	init_xlat_tables();
 
diff --git a/plat/intel/soc/common/include/platform_def.h b/plat/intel/soc/common/include/platform_def.h
index 06f3a1b..8d04479 100644
--- a/plat/intel/soc/common/include/platform_def.h
+++ b/plat/intel/soc/common/include/platform_def.h
@@ -29,7 +29,7 @@
 #define L2_RESET_DONE_STATUS			0x1228E5E7
 
 /* Define next boot image name and offset */
-#define PLAT_NS_IMAGE_OFFSET			0x50000
+#define PLAT_NS_IMAGE_OFFSET			0x10000000
 #define PLAT_HANDOFF_OFFSET			0xFFE3F000
 
 /*******************************************************************************
diff --git a/plat/intel/soc/common/socfpga_sip_svc.c b/plat/intel/soc/common/socfpga_sip_svc.c
index f58b58f..ce88fb4 100644
--- a/plat/intel/soc/common/socfpga_sip_svc.c
+++ b/plat/intel/soc/common/socfpga_sip_svc.c
@@ -42,7 +42,7 @@
 		0xa85273b0, 0xe85a, 0x4862, 0xa6, 0x2a,
 		0xfa, 0x88, 0x88, 0x17, 0x68, 0x81);
 
-uint64_t socfpga_sip_handler(uint32_t smc_fid,
+static uint64_t socfpga_sip_handler(uint32_t smc_fid,
 				   uint64_t x1,
 				   uint64_t x2,
 				   uint64_t x3,
@@ -93,7 +93,7 @@
 	return 0;
 }
 
-uint32_t intel_mailbox_fpga_config_isdone(void)
+static uint32_t intel_mailbox_fpga_config_isdone(void)
 {
 	uint32_t ret = intel_mailbox_get_config_status(MBOX_RECONFIG_STATUS);
 
@@ -129,7 +129,7 @@
 	return -1;
 }
 
-int intel_fpga_config_completed_write(uint32_t *completed_addr,
+static int intel_fpga_config_completed_write(uint32_t *completed_addr,
 					uint32_t *count)
 {
 	uint32_t status = INTEL_SIP_SMC_STATUS_OK;
@@ -186,7 +186,7 @@
 	return status;
 }
 
-int intel_fpga_config_start(uint32_t config_type)
+static int intel_fpga_config_start(uint32_t config_type)
 {
 	uint32_t response[3];
 	int status = 0;
@@ -239,7 +239,7 @@
 	return false;
 }
 
-uint32_t intel_fpga_config_write(uint64_t mem, uint64_t size)
+static uint32_t intel_fpga_config_write(uint64_t mem, uint64_t size)
 {
 	int i;
 
diff --git a/plat/marvell/a8k/common/a8k_common.mk b/plat/marvell/a8k/common/a8k_common.mk
index ccb662b..bf79ebe 100644
--- a/plat/marvell/a8k/common/a8k_common.mk
+++ b/plat/marvell/a8k/common/a8k_common.mk
@@ -37,6 +37,13 @@
 ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin
 DOIMAGE_FLAGS	+= -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS)
 
+# Check whether to build system_power.c for the platform
+ifneq ("$(wildcard $(PLAT_FAMILY_BASE)/$(PLAT)/board/system_power.c)","")
+SYSTEM_POWER_SUPPORT = 1
+else
+SYSTEM_POWER_SUPPORT = 0
+endif
+
 # This define specifies DDR type for BLE
 $(eval $(call add_define,CONFIG_DDR4))
 
@@ -82,6 +89,10 @@
 
 BL31_PORTING_SOURCES	:=	$(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
 
+ifeq ($(SYSTEM_POWER_SUPPORT),1)
+BL31_PORTING_SOURCES	+=	$(PLAT_FAMILY_BASE)/$(PLAT)/board/system_power.c
+endif
+
 BL31_SOURCES		+=	lib/cpus/aarch64/cortex_a72.S		       \
 				$(PLAT_COMMON_BASE)/aarch64/plat_helpers.S     \
 				$(PLAT_COMMON_BASE)/aarch64/plat_arch_config.c \
diff --git a/plat/marvell/a8k/common/plat_pm.c b/plat/marvell/a8k/common/plat_pm.c
index d07601a..96e95c2 100644
--- a/plat/marvell/a8k/common/plat_pm.c
+++ b/plat/marvell/a8k/common/plat_pm.c
@@ -792,8 +792,20 @@
  * A8K handlers to shutdown/reboot the system
  *****************************************************************************
  */
+
+/* Set a weak stub for platforms that don't configure system power off */
+#pragma weak system_power_off
+int system_power_off(void)
+{
+	return 0;
+}
+
 static void __dead2 a8k_system_off(void)
 {
+	/* Call the platform specific system power off function */
+	system_power_off();
+
+	/* board doesn't have a system off implementation */
 	ERROR("%s:  needs to be implemented\n", __func__);
 	panic();
 }