Better use of address types in mm.h.

These functions are called to map physical pages in and out of the
address space. It makes more sense for the APIs to use those physical
addresses and avoid mistakes or confusion in the conversions.

Once the physical address has been mapped it will be available as a
virtual address or pointer in the hypervisor and an intermediate
physical address in the VMs. The corresponding type is now returned from
the mapping functions to avoid complication or mistakes in conversion by
the caller and the vast majority of the address type conversions now
happen within mm.

Internally to mm, the stage 1 and stage 2 tables still share the same
management code so that is made generic for the type of input address
being used.

Change-Id: I9201b98b7329ead304903b8b8968c4378eb5a4db
diff --git a/src/main.c b/src/main.c
index d41b1b3..0b21bbf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -48,6 +48,7 @@
 	paddr_t new_mem_end;
 	struct memiter primary_initrd;
 	struct memiter cpio;
+	void *initrd;
 
 	dlog("Initialising hafnium\n");
 
@@ -68,12 +69,13 @@
 	     pa_addr(params.initrd_end) - 1);
 
 	/* Map initrd in, and initialise cpio parser. */
-	if (!mm_identity_map(va_from_pa(params.initrd_begin),
-			     va_from_pa(params.initrd_end), MM_MODE_R)) {
+	initrd = mm_identity_map(params.initrd_begin, params.initrd_end,
+				 MM_MODE_R);
+	if (!initrd) {
 		panic("unable to map initrd in");
 	}
 
-	memiter_init(&cpio, ptr_from_va(va_from_pa(params.initrd_begin)),
+	memiter_init(&cpio, initrd,
 		     pa_addr(params.initrd_end) - pa_addr(params.initrd_begin));
 
 	/* Load all VMs. */