From patchwork Tue Sep 10 14:49:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19914 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CF34F25E85 for ; Tue, 10 Sep 2013 14:49:39 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id r5sf8798740qcx.4 for ; Tue, 10 Sep 2013 07:49:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state: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=cRuhnVU3OOPdIlmUmYQqi28SlPiew5VNGk0HxzcgLJw=; b=lAZJSvmtw307CccX2mbYPC/2Xdip1V5+yCy73MYvtwyj5m0OgcTYti2v1zS6qHIGbr NjsG9eTgM7X0XMT8nEgGAfWBpTOkl5NALSlVcOZgxwy36GDBqcXfYi59fhpqVZjY+Wbi 2CLUoRC1y2TPIrIhJApiNcWQp0NmX6Tf8glsqytMRq5tdEdOuyHL9Ac3Lfn++ZOs2Apb VZs1nsCD0xx8CLTCdYdOYG0lZHGj4jZabIJ9zEtdKJ8xptId5ZR06pLVIhroTKQwnd88 3f4gqDCfVxXooNDC1aJbYwPR79s6wdNN1viJXNyb/ixQ+Wv4K4FC/lO9/HjC8q6bfJwG 8Y/Q== X-Received: by 10.236.163.67 with SMTP id z43mr8378632yhk.27.1378824579615; Tue, 10 Sep 2013 07:49:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.51.40 with SMTP id h8ls2276675qeo.28.gmail; Tue, 10 Sep 2013 07:49:39 -0700 (PDT) X-Received: by 10.52.119.139 with SMTP id ku11mr253287vdb.42.1378824579348; Tue, 10 Sep 2013 07:49:39 -0700 (PDT) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id bl10si4540586vcb.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.53; Received: by mail-vb0-f53.google.com with SMTP id i3so4971605vbh.40 for ; Tue, 10 Sep 2013 07:49:39 -0700 (PDT) X-Gm-Message-State: ALoCoQnBvAgS/fEHuo8zrgjauqNh2gJySJgde4w73JiUhbaIH+sD2+X17+q7sp47moS12Ep9zfCS X-Received: by 10.221.64.17 with SMTP id xg17mr23187839vcb.5.1378824579264; Tue, 10 Sep 2013 07:49:39 -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 u4csp4661vcz; Tue, 10 Sep 2013 07:49:38 -0700 (PDT) X-Received: by 10.15.54.199 with SMTP id t47mr13684092eew.46.1378824578199; Tue, 10 Sep 2013 07:49:38 -0700 (PDT) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by mx.google.com with ESMTPS id 7si15298658eeu.218.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:38 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.53 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.53; Received: by mail-ee0-f53.google.com with SMTP id b15so3961204eek.40 for ; Tue, 10 Sep 2013 07:49:37 -0700 (PDT) X-Received: by 10.15.35.196 with SMTP id g44mr39756661eev.18.1378824577498; Tue, 10 Sep 2013 07:49:37 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id i1sm31911644eeg.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:36 -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 v3 12/27] xen/dts: dt_find_interrupt_controller: accept multiple compatible strings Date: Tue, 10 Sep 2013 15:49:00 +0100 Message-Id: <1378824555-16564-13-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378824555-16564-1-git-send-email-julien.grall@linaro.org> References: <1378824555-16564-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.212.53 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: , Signed-off-by: Julien Grall --- xen/arch/arm/gic.c | 7 ++++++- xen/common/device_tree.c | 5 +++-- xen/include/asm-arm/gic.h | 2 ++ xen/include/xen/device_tree.h | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 7c24811..aff57b9 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -355,10 +355,15 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize, /* Set up the GIC */ void __init gic_init(void) { + static const struct dt_device_match gic_ids[] __initconst = + { + DT_MATCH_GIC, + { /* sentinel */ }, + }; struct dt_device_node *node; int res; - node = dt_find_interrupt_controller("arm,cortex-a15-gic"); + node = dt_find_interrupt_controller(gic_ids); if ( !node ) panic("Unable to find compatible GIC in the device tree\n"); diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index d2262ce..215592e 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -1834,11 +1834,12 @@ static void __init dt_alias_scan(void) } } -struct dt_device_node * __init dt_find_interrupt_controller(const char *compat) +struct dt_device_node * __init +dt_find_interrupt_controller(const struct dt_device_match *matches) { struct dt_device_node *np = NULL; - while ( (np = dt_find_compatible_node(np, NULL, compat)) ) + while ( (np = dt_find_matching_node(np, matches)) ) { if ( !dt_find_property(np, "interrupt-controller", NULL) ) continue; diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 513c1fc..92a3349 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -135,6 +135,8 @@ #ifndef __ASSEMBLY__ #include +#define DT_MATCH_GIC DT_MATCH_COMPATIBLE("arm,cortex-a15-gic") + extern int domain_vgic_init(struct domain *d); extern void domain_vgic_free(struct domain *d); diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 5a51ab6..fae9f97 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -240,7 +240,8 @@ extern const struct dt_device_node *dt_interrupt_controller; * * If found, return the interrupt controller device node. */ -struct dt_device_node * __init dt_find_interrupt_controller(const char *compat); +struct dt_device_node * __init +dt_find_interrupt_controller(const struct dt_device_match *matches); #define dt_prop_cmp(s1, s2) strcmp((s1), (s2)) #define dt_node_cmp(s1, s2) strcasecmp((s1), (s2))