Merge pull request #1458 from Andre-ARM/allwinner/fixes

allwinner: various smaller fixes
diff --git a/plat/ti/k3/common/k3_psci.c b/plat/ti/k3/common/k3_psci.c
index 91602c8..4d6428b 100644
--- a/plat/ti/k3/common/k3_psci.c
+++ b/plat/ti/k3/common/k3_psci.c
@@ -17,12 +17,18 @@
 
 static void k3_cpu_standby(plat_local_state_t cpu_state)
 {
-	/*
-	 * Enter standby state
-	 * dsb is good practice before using wfi to enter low power states
-	 */
+	unsigned int scr;
+
+	scr = read_scr_el3();
+	/* Enable the Non secure interrupt to wake the CPU */
+	write_scr_el3(scr | SCR_IRQ_BIT | SCR_FIQ_BIT);
+	isb();
+	/* dsb is good practice before using wfi to enter low power states */
 	dsb();
+	/* Enter standby state */
 	wfi();
+	/* Restore SCR */
+	write_scr_el3(scr);
 }
 
 static int k3_pwr_domain_on(u_register_t mpidr)
diff --git a/plat/ti/k3/common/k3_topology.c b/plat/ti/k3/common/k3_topology.c
index a77c8f3..d7ac0a5 100644
--- a/plat/ti/k3/common/k3_topology.c
+++ b/plat/ti/k3/common/k3_topology.c
@@ -9,6 +9,7 @@
 
 /* The power domain tree descriptor */
 static unsigned char power_domain_tree_desc[] = {
+	PLATFORM_SYSTEM_COUNT,
 	PLATFORM_CLUSTER_COUNT,
 	K3_CLUSTER0_CORE_COUNT,
 #if K3_CLUSTER1_MSMC_PORT != UNUSED
diff --git a/plat/ti/k3/include/platform_def.h b/plat/ti/k3/include/platform_def.h
index 8856af2..ebc9c47 100644
--- a/plat/ti/k3/include/platform_def.h
+++ b/plat/ti/k3/include/platform_def.h
@@ -62,9 +62,10 @@
 
 #define PLATFORM_CLUSTER_OFFSET		K3_CLUSTER0_MSMC_PORT
 
-#define PLAT_NUM_PWR_DOMAINS		(PLATFORM_CLUSTER_COUNT + \
+#define PLAT_NUM_PWR_DOMAINS		(PLATFORM_SYSTEM_COUNT + \
+					PLATFORM_CLUSTER_COUNT + \
 					PLATFORM_CORE_COUNT)
-#define PLAT_MAX_PWR_LVL		MPIDR_AFFLVL1
+#define PLAT_MAX_PWR_LVL		MPIDR_AFFLVL2
 
 /*******************************************************************************
  * Memory layout constants
diff --git a/tools/cert_create/src/main.c b/tools/cert_create/src/main.c
index 4abfe6d..ed56620 100644
--- a/tools/cert_create/src/main.c
+++ b/tools/cert_create/src/main.c
@@ -140,8 +140,6 @@
 		i++;
 	}
 	printf("\n");
-
-	exit(0);
 }
 
 static int get_key_alg(const char *key_alg_str)
@@ -334,7 +332,7 @@
 			break;
 		case 'h':
 			print_help(argv[0], cmd_opt);
-			break;
+			exit(0);
 		case 'k':
 			save_keys = 1;
 			break;