From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BC2AC433E2 for ; Sat, 12 Sep 2020 23:22:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04FF221531 for ; Sat, 12 Sep 2020 23:22:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="L52eRfGE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QawhA8g6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04FF221531 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mkabZWFq45FbRhVBYgS9YKGlgPb38nRbaym/pmjnQAI=; b=L52eRfGEkUn6swoA8U+61Hn2J U1dgEwJ2lLabpzyDQUg7VSB0wQ8BTC+shfbsfJbaRs1g28/Rh7mFE6wGR0WPiXVjQC/k9v6WSonZs GENi9+Wk0Ukaj7qrvxJ5bS8JXHAMT3oOZoIO1BE6e/Oz8NFTJUUmYovPyC4MHk0CQBTqHfGxnwFvK LPrP3Je55ui+WfY0ANPeNIYhhxx5Dunx4geG7iUhHror1cd42AKDypZ63YzQbuydOFqmyi5sWn8ZQ fjTNF8db8cdNN3iKJL9LBDtghDXTyscHTAmNfFywoHcInvlqzsdSbWWXB2Y8M9Pzgiw3EIAIzw4xc vzEEzfZYA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHEor-0004Cr-J1; Sat, 12 Sep 2020 23:20:33 +0000 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHEop-0004CM-Eu for linux-arm-kernel@lists.infradead.org; Sat, 12 Sep 2020 23:20:32 +0000 Received: by mail-oi1-x242.google.com with SMTP id x14so13540935oic.9 for ; Sat, 12 Sep 2020 16:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=w8MxReSq2289s6KRy6zcF2bLhh+v6ydzvlexh6r8g8o=; b=QawhA8g6TBJUmiixWWo4qCuU/qQKXOVOfiNKDxK5T/62TOYC+ETaqPVMcu/SAoCQcn xEfTyBNAu5NLrLjEyHjfE4P0pcMP9KgkSqsqavtZtMTgQVFwskoynQM0O3AXkDD8vv4v ucvHNzVZyxu8iTafep6sGwAYAJpIETdDUPBgIa2yN5PVDmJwpI8PDEowMizIpUAcV3Fk SapcBF6UvFwtHp285i1UYOCUNN5qUpOD9WXptUE9lvayEcfmr3GMQXx/9qYSCVi5uTH1 SRQ29vNDrBkT4Lo6PUlD+3UB2+s1m2/Cf0KV9mZJMnUm635Nu6PLUcA+miGWehZQN9Ke tSLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=w8MxReSq2289s6KRy6zcF2bLhh+v6ydzvlexh6r8g8o=; b=FkuBCkXDrUZwgUXkETyropLSFIP5ZyKMRjb/o4EonWFLeU2BK7XQpMbr7NIcG4n8Qf J+v4XSPqouTplNyUV7kBWf+V4Jqf1Zt/1ZONyJ+oo3oaXl8nj56rXcnjhOq6EWpJevTX bFI7njm2HKVRI441euDVLxOdEzwC9f2R9IEULI6+mZ23NmpxuBB+uZNk6QvdrdczhWzB /T3PXtV82xbxbdocnG1mrYLmNDmIbRWcXbRZFkrh5RRHrIFx0dSMJbQVZfI8uo5ClcuO e+dpXWo5FmgRf84ALAx0e5tncnMWvA3vrGGqL+SUdb27WjfX4GeFYYbwSjp5YPiqM8Sq jlBw== X-Gm-Message-State: AOAM531/K8TMb0ylvPSiedpfKqHen2o9oMpZLauxAzrv5jxhnAO55Svw g8oeQnB+jBLwwBnedAXAoKWSww== X-Google-Smtp-Source: ABdhPJyB3GGG49Y2Ut2ycn9KSHdrrDcRPSymJyoz6FZ0vlWLbNaLYQZ2NidAwHytw8G8JzXCAh5Daw== X-Received: by 2002:a54:408d:: with SMTP id i13mr4680179oii.156.1599952826913; Sat, 12 Sep 2020 16:20:26 -0700 (PDT) Received: from yoga ([2605:6000:e5cb:c100:8898:14ff:fe6d:34e]) by smtp.gmail.com with ESMTPSA id 189sm994100oid.40.2020.09.12.16.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2020 16:20:26 -0700 (PDT) Date: Sat, 12 Sep 2020 18:20:22 -0500 From: Bjorn Andersson To: Marc Zyngier Subject: Re: [PATCH 1/6] of: Add basic infrastructure to create early probe arrays Message-ID: <20200912232022.GE3715@yoga> References: <20200912125148.1271481-1-maz@kernel.org> <20200912125148.1271481-2-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200912125148.1271481-2-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200912_192031_540375_2447A920 X-CRM114-Status: GOOD ( 22.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Jason Cooper , Saravana Kannan , kernel-team@android.com, Hanks Chen , linux-kernel@vger.kernel.org, Rob Herring , Matthias Brugger , Andy Gross , John Stultz , Enric Balletbo i Serra , Frank Wunderlich , Frank Rowand , Thomas Gleixner , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat 12 Sep 07:51 CDT 2020, Marc Zyngier wrote: > We currently probe interrupt controller and timers that need > to be available very early using an infratstructure that creates > struct of_device_id instances in a special section. These are > individual structures that are ultimately collated by the linker. > > In order to facilitate further use of this infrastructure for > drivers that can either be built modular or as an early driver, > let's add a couple of helpers that will make it look like a > "normal" device_id array, like this: > > _OF_DECLARE_ARRAY_START(table, name) > _OF_DECLARE_ELMT("compat-1", probe, type) > _OF_DECLARE_ELMT("compat-2", probe, type) > _OF_DECLARE_ELMT("compat-3", other_probe, type) > _OF_DECLARE_ARRAY_END > Reviewed-by: Bjorn Andersson Regards, Bjorn > Signed-off-by: Marc Zyngier > --- > include/linux/of.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/include/linux/of.h b/include/linux/of.h > index 5cf7ae0465d1..08f78da95378 100644 > --- a/include/linux/of.h > +++ b/include/linux/of.h > @@ -1291,20 +1291,35 @@ static inline int of_get_available_child_count(const struct device_node *np) > return num; > } > > +#define __OF_DECLARE_ARRAY_START(name, section) \ > + static const struct of_device_id __of_table_##name[] \ > + __used __section(section) = { > + > #if defined(CONFIG_OF) && !defined(MODULE) > #define _OF_DECLARE(table, name, compat, fn, fn_type) \ > static const struct of_device_id __of_table_##name \ > __used __section(__##table##_of_table) \ > = { .compatible = compat, \ > .data = (fn == (fn_type)NULL) ? fn : fn } > +#define _OF_DECLARE_ARRAY_START(table, name) \ > + __OF_DECLARE_ARRAY_START(name, __##table##_of_table) > #else > #define _OF_DECLARE(table, name, compat, fn, fn_type) \ > static const struct of_device_id __of_table_##name \ > __attribute__((unused)) \ > = { .compatible = compat, \ > .data = (fn == (fn_type)NULL) ? fn : fn } > +#define _OF_DECLARE_ARRAY_START(table, name) \ > + __OF_DECLARE_ARRAY_START(name, unused) > #endif > > +#define _OF_DECLARE_ARRAY_END } > +#define _OF_DECLARE_ELMT(compat, fn, fn_type) \ > + { \ > + .compatible = compat, \ > + .data = (fn == (fn_type)NULL) ? fn : fn, \ > + }, > + > typedef int (*of_init_fn_2)(struct device_node *, struct device_node *); > typedef int (*of_init_fn_1_ret)(struct device_node *); > typedef void (*of_init_fn_1)(struct device_node *); > -- > 2.28.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel