[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xen-ppc-devel
Subject:    Re: [XenPPC] [PATCH 2/3] linux: build start_info_t from devtree
From:       Ryan Harper <ryanh () us ! ibm ! com>
Date:       2007-01-25 19:17:59
Message-ID: 20070125191759.GT24048 () us ! ibm ! com
[Download RAW message or body]

* Ryan Harper <ryanh@us.ibm.com> [2007-01-24 11:51]:
> This patch adds support to linux:xen_init_early() to create a
> start_info_t structure from properties in /xen/start_info_t if the
> device tree does not have a pointer (/xen/start-info) to a previously
> constructed start_info_t in memory.  

Updated to create start_info_t from /xen/console and /xen/store devtree
values if /xen/start-info isn't present.

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh@us.ibm.com


diffstat output:
 setup.c |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletion(-)

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
---
diff -r ab3b5849331d arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.c	Sun Jan 21 08:36:53 2007 -0500
+++ b/arch/powerpc/platforms/xen/setup.c	Thu Jan 25 10:59:53 2007 -0600
@@ -32,6 +32,7 @@ EXPORT_SYMBOL(HYPERVISOR_shared_info);
 EXPORT_SYMBOL(HYPERVISOR_shared_info);
 
 /* Raw start-of-day parameters from the hypervisor. */
+start_info_t xsi;
 start_info_t *xen_start_info;
 
 extern struct machdep_calls mach_maple_md;
@@ -94,7 +95,32 @@ static void __init xen_init_early(void)
 	xen = of_find_node_by_path("/xen");
 
 	si = (u64 *)get_property(xen, "start-info", NULL);
-	xen_start_info = (start_info_t *)__va(*si);
+
+	/* build our own start_info_t if prop start-info not found */
+	if (si != NULL ) {
+		xen_start_info = (start_info_t *)__va(*si);
+	} else {
+		struct device_node *console;
+		struct device_node *store;
+
+		console = of_find_node_by_path("/xen/console");
+		store = of_find_node_by_path("/xen/store");
+
+		xen_start_info = &xsi;
+
+		/* fill out start_info_t from devtree */
+		xen_start_info->shared_info = *((u64 *)get_property(xen, 
+		   "shared-info", NULL));
+		xen_start_info->store_mfn = *((u64 *)get_property(store,
+		   "reg", NULL));
+		xen_start_info->store_evtchn = *((u32 *)get_property(store,
+		   "interrupts", NULL));
+		xen_start_info->console.domU.mfn = *((u64 *)get_property(console,
+		   "reg", NULL));
+		xen_start_info->console.domU.evtchn = *((u32 *)get_property(console,
+		   "interrupts", NULL));
+	}
+
 	HYPERVISOR_shared_info = __va(xen_start_info->shared_info);
 
 	udbg_init_xen();

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic