From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 10/10] xen/arm: Handle different bootwrapper locations for Hip04 platform Date: Mon, 03 Nov 2014 14:13:59 +0000 Message-ID: <54578DA7.9080505@linaro.org> References: <1415009522-6344-1-git-send-email-frediano.ziglio@huawei.com> <1415009522-6344-11-git-send-email-frediano.ziglio@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1415009522-6344-11-git-send-email-frediano.ziglio@huawei.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Frediano Ziglio , Ian Campbell , Stefano Stabellini , Tim Deegan Cc: Zoltan Kiss , zoltan.kiss@huawei.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi Frediano, This could be merged in #1. Regards, On 11/03/2014 10:12 AM, Frediano Ziglio wrote: > From: Zoltan Kiss > > 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 024c8a0..dec4984 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); > -- Julien Grall