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 985CEC43461 for ; Sun, 13 Sep 2020 02:41:59 +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 1FBB820770 for ; Sun, 13 Sep 2020 02:41:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kjvAggHF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VpmEpVSk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FBB820770 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=htYyzFuv051mmwoKxu6BKnd+mYt9DFw5YtCusJLZGj4=; b=kjvAggHFX2y6BUz5XCDNnI6ez +OtXiwItRIeE+7zAUQkcZl6CWj31q0VyIqsdSbuZUWfXskGCe46Zk2SZsynB8mxpP29WvHA5NTh0d pI0YVC3TxBAa8QZr9B+CR9IHJ1X5BfIHkZNf2SPxMOGuYyE8V/9GBtoosLzAX1VSCVIGEDsHdBEEK /t+PuIjEy7X7jZUyLSqiWuDHbNY9CTGulKzCDXg/1lnR5pWhErVC23fT0ceu0HNzSo0Uq/I27c+JH imWVq52tJxicYM4aY+JdRvGUX8gG8uXiBtdd0qo8/HVJASvhajcgLFIbPid61bRyNq/joADGhUaiU VguaBfXNA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHHwa-0004kK-9U; Sun, 13 Sep 2020 02:40:44 +0000 Received: from mail-oo1-xc43.google.com ([2607:f8b0:4864:20::c43]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHHwX-0004k1-1A for linux-arm-kernel@lists.infradead.org; Sun, 13 Sep 2020 02:40:42 +0000 Received: by mail-oo1-xc43.google.com with SMTP id h9so3202788ooo.10 for ; Sat, 12 Sep 2020 19:40:40 -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=zOdtPToEcRCUNxG1/0JeqZlo2ECp8NX7tbhb34OB2Hk=; b=VpmEpVSkAoTxqp24d1c0u203Y2vihec9/xKibNoGz1R8WBwybmSb1PKcTLWLbhLaCK rPSPdmTsJTP7G34gBdwURewqFkys7/8FQrlOZgCv1cu568lTpYOCwVosOYqJgAOQ9xIB 3468EiRFtcrfYYwOyh3vP2NWJAZKiHWAxESe4TxXjw7+7YBnQL6Lhohrm9g14roMmP32 JSo5+3SCP8YxMDvf0kzJcK+lvxdL0NY0226Oe3q8pNECoOl0AgLaOMRG7H1WsSRio2Ay vrstcS9LbuMC0nfSQhjsbi6vjvXogSDJNkJErdXbsd6aXfye3gtnIanYna35Kevbt6yn tYWQ== 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=zOdtPToEcRCUNxG1/0JeqZlo2ECp8NX7tbhb34OB2Hk=; b=H6izV9CgkSlDQ/UNETy7Uo0gC7n7Vxp1hmqfJaYLV1pOOh572rTtG0VmG3iBa6pqGN dJikO6diSUj6bYLjk3Um3yvBlsiCrpdH2jwSv1DUyn5z/+F2uyyEWv+TDT7YEBba3Pz/ lmoOs5FYF9vBDPHwN/wlUAtau52gfO4FFuTc9rOpV6/hyWNoIY0AgaadnZabyAnTb+fR CpIiVLtU4hYg2dtzqBD0F2PlEEenCYSls2H5iWju/K1YGAULN8shugnMCQUCqNUNTRCF d/MOzgXPfXBe+8bLHaP0IgM9XzuESfFVEqGUrZPew39oon6EAJ8DU2eWznImENX2kdHa KUWw== X-Gm-Message-State: AOAM532NZKmuAem/Bx2br8KbsaKg9WRLGGmdwNoEK3KK2C1FTPT35IoA Y1yA7HG1tNVpWB+MH4GYp1t1zg== X-Google-Smtp-Source: ABdhPJwJQVrSzau5M9MM0GUZj1xFu0GsYVvrc9zZxcjYLP9XFZOjPb3HJkrw6vsWUydINdr2ZTXE9A== X-Received: by 2002:a4a:b28a:: with SMTP id k10mr5979768ooo.93.1599964838920; Sat, 12 Sep 2020 19:40:38 -0700 (PDT) Received: from yoga ([2605:6000:e5cb:c100:8898:14ff:fe6d:34e]) by smtp.gmail.com with ESMTPSA id a2sm1269332ooo.26.2020.09.12.19.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2020 19:40:38 -0700 (PDT) Date: Sat, 12 Sep 2020 21:40:28 -0500 From: Bjorn Andersson To: Marc Zyngier Subject: Re: [PATCH 1/6] of: Add basic infrastructure to create early probe arrays Message-ID: <20200913024028.GO3715@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_224041_410290_B193AAED X-CRM114-Status: GOOD ( 23.20 ) 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 s/infratstructure/infrastructure/ > 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 > > 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