From patchwork Mon Nov 3 10:12:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 40003 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C4EF320560 for ; Mon, 3 Nov 2014 10:18:55 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf6038883lab.11 for ; Mon, 03 Nov 2014 02:18:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=XVrCFCbortl+TTjPpdbkRs9aloRZIlTwEKTR5DVskpE=; b=RhHUCjpXXSL5ukm/97lcKQ0PyKg5XKcpoYXRtQF4N48CZ5RuzKsf9zpBpxH9sfTVy3 QXVv4rnRIAC5QPc5CEUsXwCtgPL2O2huU8goNcqxpijKJNQEyUhmqrTjbDHDxarPLrmq 6hY6xiaiK4BIMRCus81A4kO1E+MgC3zen83XUHAvxKV/GzgmNTcRlwLOz2yuPcoZlEbd mknoYj9Tzp9SqlniSoADVmCvRMG59lqa3RSV4vTHDGltyjVYoAujSR5gF7k3s2HBqFM9 O/gar6CeMt3J8DtC/YrQWAlTyHVmyYEysTMs3LvnjKhtfNp5SrxpAbmaHAXCzABCkq4Q r1Ng== X-Gm-Message-State: ALoCoQk7yE1+4Rx37TxM+V4ezLbZrv1SI72wkExShu3M0mi3UumjAboZxr2V98DyK5bcLH1D44zs X-Received: by 10.180.182.164 with SMTP id ef4mr2688577wic.0.1415009933667; Mon, 03 Nov 2014 02:18:53 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.7 with SMTP id f7ls647736laa.56.gmail; Mon, 03 Nov 2014 02:18:52 -0800 (PST) X-Received: by 10.152.206.11 with SMTP id lk11mr50528226lac.42.1415009932895; Mon, 03 Nov 2014 02:18:52 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id db1si19257376lad.79.2014.11.03.02.18.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 02:18:52 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z12so570549lbi.36 for ; Mon, 03 Nov 2014 02:18:52 -0800 (PST) X-Received: by 10.112.130.41 with SMTP id ob9mr48825850lbb.74.1415009932807; Mon, 03 Nov 2014 02:18:52 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp212852lbz; Mon, 3 Nov 2014 02:18:52 -0800 (PST) X-Received: by 10.220.173.69 with SMTP id o5mr1271604vcz.35.1415009931749; Mon, 03 Nov 2014 02:18:51 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id nu10si9431360vcb.93.2014.11.03.02.18.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 02:18:51 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XlEhu-0008Oq-GS; Mon, 03 Nov 2014 10:17:54 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XlEdt-0008Ag-7q for xen-devel@lists.xen.org; Mon, 03 Nov 2014 10:13:45 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id E2/27-26858-85557545; Mon, 03 Nov 2014 10:13:44 +0000 X-Env-Sender: frediano.ziglio@huawei.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1415009619!11224654!1 X-Originating-IP: [119.145.14.64] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NCA9PiA4MDE5MQ==\n X-StarScan-Received: X-StarScan-Version: 6.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6504 invoked from network); 3 Nov 2014 10:13:43 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (119.145.14.64) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 3 Nov 2014 10:13:43 -0000 Received: from 172.24.2.119 (EHLO szxeml403-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CDW38112; Mon, 03 Nov 2014 18:13:39 +0800 (CST) Received: from localhost.localdomain (10.47.73.48) by szxeml403-hub.china.huawei.com (10.82.67.35) with Microsoft SMTP Server id 14.3.158.1; Mon, 3 Nov 2014 18:13:31 +0800 From: Frediano Ziglio To: Ian Campbell , Stefano Stabellini , Tim Deegan , Julien Grall , Date: Mon, 3 Nov 2014 10:12:02 +0000 Message-ID: <1415009522-6344-11-git-send-email-frediano.ziglio@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415009522-6344-1-git-send-email-frediano.ziglio@huawei.com> References: <1415009522-6344-1-git-send-email-frediano.ziglio@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.73.48] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Mon, 03 Nov 2014 10:17:48 +0000 Cc: Zoltan Kiss , zoltan.kiss@huawei.com, xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH 10/10] xen/arm: Handle different bootwrapper locations for Hip04 platform X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: frediano.ziglio@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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);