From patchwork Mon Sep 16 15:20:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20349 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8047D2486B for ; Mon, 16 Sep 2013 15:20:15 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lf12sf978709vcb.10 for ; Mon, 16 Sep 2013 08:20:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=USDjjIb0kb3HEqHhEbV41kztPIu1ofwwJ/+qjZGGhJA=; b=ZKLgdohzUtrWWY5VYWPZcjK3NPxk5d2zJdqXYUABvVKOqCNeRtz73AKwWAvoN9QEp3 XDStvAczQCTPB/jEpqVTWqkb4dcLxfLDhYVWpSC0Jj72uNNOxCkcnYUFJ1QHHNSk0eTi j8nuSzUErcaUtqO2WDE9GrDYdJTjfNdj1/3IyMdcTwI5zVXBFLdHHomu7kEhN0DJKnRd 2Q2hHLHwoapAyJX7tp+KqcPjWCKJYt0u2FvbiyqjN3p0fE2uRcpjLdC4OIJgnw7tdpZx CGqsGYWL3u5QdQ5BPWS7DOoaN3iLPBM+9ZE1VyLp53rjjwQAOnnL2jUDBsDBDgkmFv+w eGDg== X-Gm-Message-State: ALoCoQkTT5lN5nskBxoMKVSL1hvONJ+2hnoCtQ29fKjtlkwtXQzWtyxXWOXlXMsPyGCDUfeOUKce X-Received: by 10.236.53.70 with SMTP id f46mr10714701yhc.17.1379344815298; Mon, 16 Sep 2013 08:20:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.11.179 with SMTP id r19ls2331400qeb.76.gmail; Mon, 16 Sep 2013 08:20:15 -0700 (PDT) X-Received: by 10.58.19.233 with SMTP id i9mr82595vee.36.1379344815217; Mon, 16 Sep 2013 08:20:15 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id he13si7207513veb.121.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 08:20:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jy13so3017199veb.6 for ; Mon, 16 Sep 2013 08:20:15 -0700 (PDT) X-Received: by 10.52.108.230 with SMTP id hn6mr1583967vdb.28.1379344815072; Mon, 16 Sep 2013 08:20:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp102704vcz; Mon, 16 Sep 2013 08:20:14 -0700 (PDT) X-Received: by 10.15.91.3 with SMTP id r3mr44108748eez.4.1379344813656; Mon, 16 Sep 2013 08:20:13 -0700 (PDT) Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by mx.google.com with ESMTPS id k2si16620024eey.92.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 08:20:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.177 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.177; Received: by mail-ea0-f177.google.com with SMTP id f15so2048795eak.8 for ; Mon, 16 Sep 2013 08:20:13 -0700 (PDT) X-Received: by 10.14.3.9 with SMTP id 9mr2594135eeg.72.1379344813155; Mon, 16 Sep 2013 08:20:13 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id a43sm42736941eep.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 08:20:12 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH 2/2] xen/dts: Support Linux initrd DT bindings Date: Mon, 16 Sep 2013 16:20:08 +0100 Message-Id: <1379344808-26917-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379344808-26917-1-git-send-email-julien.grall@linaro.org> References: <1379344808-26917-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Linux uses the property linux,initrd-start and linux,initrd-end to know where the initrd lives in memory. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/common/device_tree.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 9a16650..906f9f9 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -382,6 +382,29 @@ static void __init process_multiboot_node(const void *fdt, int node, early_info.modules.nr_mods = nr; } +static void __init process_chosen_node(const void *fdt, int node, + const char *name, + u32 address_cells, u32 size_cells) +{ + struct dt_mb_module *mod = &early_info.modules.module[MOD_INITRD]; + u32 start, end; + + dt_printk("Checking for initrd in /chosen\n"); + + start = device_tree_get_u32(fdt, node, "linux,initrd-start", 0); + end = device_tree_get_u32(fdt, node, "linux,initrd-end", 0); + + if ( !start || !end || (start >= end) ) + return; + + dt_printk("Initrd 0x%x-0x%x\n", start, end); + + mod->start = start; + mod->size = end - start; + + early_info.modules.nr_mods = MAX(MOD_INITRD, early_info.modules.nr_mods); +} + static int __init early_scan_node(const void *fdt, int node, const char *name, int depth, u32 address_cells, u32 size_cells, @@ -391,6 +414,8 @@ static int __init early_scan_node(const void *fdt, process_memory_node(fdt, node, name, address_cells, size_cells); else if ( device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) ) process_multiboot_node(fdt, node, name, address_cells, size_cells); + else if ( depth == 1 && device_tree_node_matches(fdt, node, "chosen") ) + process_chosen_node(fdt, node, name, address_cells, size_cells); return 0; }