Get the cpu IDs from the FDT.

These are the IDs used to identify cores in PSCI.

Change-Id: I9e88a6c69f963864591e39f0191cdd5ce824ce6d
diff --git a/src/main.c b/src/main.c
index 969cacf..3457f25 100644
--- a/src/main.c
+++ b/src/main.c
@@ -80,8 +80,6 @@
 	mpool_init(&ppool, sizeof(struct mm_page_table));
 	mpool_add_chunk(&ppool, ptable_buf, sizeof(ptable_buf));
 
-	cpu_module_init();
-
 	if (!mm_init(&ppool)) {
 		panic("mm_init failed");
 	}
@@ -94,6 +92,8 @@
 		panic("unable to retrieve boot params");
 	}
 
+	cpu_module_init(params.cpu_ids, params.cpu_count);
+
 	for (i = 0; i < params.mem_ranges_count; ++i) {
 		dlog("Memory range:  0x%x - 0x%x\n",
 		     pa_addr(params.mem_ranges[i].begin),
@@ -174,8 +174,7 @@
 	vcpu->cpu = c;
 
 	/* Reset the registers to give a clean start for the primary's vCPU. */
-	arch_regs_reset(&vcpu->regs, true, vm->id, vm->ptable.root,
-			vcpu_index(vcpu));
+	arch_regs_reset(&vcpu->regs, true, vm->id, c->id, vm->ptable.root);
 
 	return vcpu;
 }