From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 03/12] xen/dt: Extend dt_device_match to possibly store data Date: Tue, 27 Jan 2015 16:07:16 +0000 Message-ID: <54C7B7B4.2030405@linaro.org> References: <1421418247-30068-1-git-send-email-julien.grall@linaro.org> <1421418247-30068-4-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YG8g6-00059K-5J for xen-devel@lists.xenproject.org; Tue, 27 Jan 2015 16:07:46 +0000 Received: by mail-we0-f176.google.com with SMTP id w62so15761605wes.7 for ; Tue, 27 Jan 2015 08:07:44 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Stefano, On 27/01/15 15:57, Stefano Stabellini wrote: >> const struct dt_device_node *dt_get_parent(const struct dt_device_node *node) >> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h >> index 08db8bc..6502369 100644 >> --- a/xen/include/xen/device_tree.h >> +++ b/xen/include/xen/device_tree.h >> @@ -28,6 +28,7 @@ struct dt_device_match { >> const char *type; >> const char *compatible; >> const bool_t not_available; >> + const void *data; > > Why are you adding this field? It doesn't seem to be required by the > changes to dt_match_node you are making in this patch. It's required for the SMMU drivers. The version of the SMMU is stored in the field data. +static const struct of_device_id arm_smmu_of_match[] = { + { .compatible = "arm,smmu-v1", .data = (void *)ARM_SMMU_V1 }, + { .compatible = "arm,smmu-v2", .data = (void *)ARM_SMMU_V2 }, + { .compatible = "arm,mmu-400", .data = (void *)ARM_SMMU_V1 }, + { .compatible = "arm,mmu-401", .data = (void *)ARM_SMMU_V1 }, + { .compatible = "arm,mmu-500", .data = (void *)ARM_SMMU_V2 }, + { }, +}; The main goal of this patch is too add the field data. The change of dt_match_node is only a side effect. Regards, -- Julien Grall