From 452b0d5e0fb5b3829081700cc51597d315ed6b6b Mon Sep 17 00:00:00 2001 From: Zoltan Kiss Date: Wed, 22 Oct 2014 13:34:17 +0100 Subject: xen/arm: Handle different bootwrapper locations for Hip04 platform Signed-off-by: Zoltan Kiss --- xen/arch/arm/platforms/hip04.c | 63 ++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/xen/arch/arm/platforms/hip04.c b/xen/arch/arm/platforms/hip04.c index 024c8a014f..dec49849ee 100644 --- a/xen/arch/arm/platforms/hip04.c +++ b/xen/arch/arm/platforms/hip04.c @@ -136,7 +136,7 @@ static void hip04_cluster_up(unsigned int cluster) static int __init hip04_smp_init(void) { - struct dt_device_node *np, *np_fab; + struct dt_device_node *np, *np_fab, *bw; const char *msg; u64 addr, size; @@ -150,30 +150,45 @@ static int __init hip04_smp_init(void) if ( !np_fab ) goto err; - msg = "failed to get bootwrapper-phys\n"; if ( !dt_property_read_u32(np, "bootwrapper-phys", - &hip04_boot.bootwrapper_phys) ) - goto err; - - msg = "failed to get bootwrapper-size\n"; - if ( !dt_property_read_u32(np, "bootwrapper-size", - &hip04_boot.bootwrapper_size) ) - goto err; - - msg = "failed to get bootwrapper-magic\n"; - if ( !dt_property_read_u32(np, "bootwrapper-magic", - &hip04_boot.bootwrapper_magic) ) - goto err; - - msg = "failed to get relocation-entry\n"; - if ( !dt_property_read_u32(np, "relocation-entry", - &hip04_boot.relocation_entry) ) - goto err; - - msg = "failed to get relocation-size\n"; - if ( !dt_property_read_u32(np, "relocation-size", - &hip04_boot.relocation_size) ) - goto err; + &hip04_boot.bootwrapper_phys) ) { + u32 boot_method[4]; + bw = dt_find_compatible_node(NULL, NULL, "hisilicon,hip04-bootwrapper"); + msg = "hisilicon,hip04-bootwrapper missing in DT\n"; + if ( !bw ) + goto err; + + msg = "failed to get boot-method\n"; + if ( !dt_property_read_u32_array(bw, "boot-method", boot_method, 4) ) + goto err; + hip04_boot.bootwrapper_phys = boot_method[0]; + hip04_boot.bootwrapper_size = boot_method[1]; + hip04_boot.bootwrapper_magic = 0xa5a5a5a5; + hip04_boot.relocation_entry = boot_method[2]; + hip04_boot.relocation_size = boot_method[3]; + } + else + { + msg = "failed to get bootwrapper-size\n"; + if ( !dt_property_read_u32(np, "bootwrapper-size", + &hip04_boot.bootwrapper_size) ) + goto err; + + msg = "failed to get bootwrapper-magic\n"; + if ( !dt_property_read_u32(np, "bootwrapper-magic", + &hip04_boot.bootwrapper_magic) ) + goto err; + + msg = "failed to get relocation-entry\n"; + if ( !dt_property_read_u32(np, "relocation-entry", + &hip04_boot.relocation_entry) ) + goto err; + + msg = "failed to get relocation-size\n"; + if ( !dt_property_read_u32(np, "relocation-size", + &hip04_boot.relocation_size) ) + goto err; + } relocation = ioremap_nocache(hip04_boot.relocation_entry, hip04_boot.relocation_size); -- cgit v1.2.3