clear wakeup enable bit upon resuming from suspend

The FVP specific code that gets called after a cpu has been physically
powered on after having been turned off or suspended earlier does not
clear the PWRC.PWKUPR.WEN bit. Not doing so causes problems if: a cpu
is suspended, woken from suspend, powered down through a cpu_off call
& receives a spurious interrupt. Since the WEN bit is not cleared
after the cpu woke up from suspend, the spurious wakeup will power the
cpu on. Since the cpu_off call clears the jump address in the mailbox
this spurious wakeup will cause the cpu to crash.

This patch fixes this issue by clearing the WEN bit whenever a cpu is
powered up.

Change-Id: Ic91f5dffe1ed01d76bc7fc807acf0ecd3e38ce5b
diff --git a/plat/fvp/fvp_pm.c b/plat/fvp/fvp_pm.c
index fd92526..658a285 100644
--- a/plat/fvp/fvp_pm.c
+++ b/plat/fvp/fvp_pm.c
@@ -251,7 +251,7 @@
 			 * Program the power controller to power this
 			 * cpu off and enable wakeup interrupts.
 			 */
-			fvp_pwrc_write_pwkupr(mpidr);
+			fvp_pwrc_set_wen(mpidr);
 			fvp_pwrc_write_ppoffr(mpidr);
 		}
 		break;
@@ -309,6 +309,12 @@
 			write_cpuectlr(ectlr);
 		}
 
+		/*
+		 * Clear PWKUPR.WEN bit to ensure interrupts do not interfere
+		 * with a cpu power down unless the bit is set again
+		 */
+		fvp_pwrc_clr_wen(mpidr);
+
 		/* Zero the jump address in the mailbox for this cpu */
 		fvp_mboxes = (mailbox *) (TZDRAM_BASE + MBOX_OFF);
 		linear_id = platform_get_core_pos(mpidr);