Received: by 10.223.185.116 with SMTP id b49csp3760395wrg; Tue, 13 Feb 2018 07:22:01 -0800 (PST) X-Google-Smtp-Source: AH8x225O6v/be0+/QJuqRpru5TKMsy9mC44fU1r1+oJOGz67ntGP7TS3EwZtzb76ZV1xUvrsatzN X-Received: by 2002:a17:902:9895:: with SMTP id s21-v6mr1411598plp.297.1518535321054; Tue, 13 Feb 2018 07:22:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518535321; cv=none; d=google.com; s=arc-20160816; b=1Erid1pAU6ced13UvqduVDIRdF3XhW0CzJM3PmS2Gctjefj+N6unPuOexmbLXeJRqI BbGXWVLo7J94YaTweF+f0mXB+4E4BAqd+ivVkxIcmtId0uzGU8EAvquQUL6oP6QuMQ0C ozNIzddHtI5SFtCnUJgXcIP/024P/ExK5PUjVblpr+srNCWDJ34KD7YKtX0rHDewr9s1 5pO8WZ5vM3JCzHsVmhhZ+jhGMouuwRU55JpMiOU/tVkvQdMr7Wop3SAROsZGuUeNjFyG 2XOvJ/tl5l5qcg05wz0MrJjjQDJa75pgWxQoiRJUiPRFs5RTWxdAXjNRXwAD6Irr1zvd gmxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=brhSIJlokr2AlH93N1YlBXpXYtpZXDXW8JBRwsA4obQ=; b=nbTvtxOTgZnagCOB6xZZ9wnrUyjTAY9yCO2YZ8naEQ1k9hxilx6HloR6vVx8vhlmdK oWxVT7aU//67lJuQv67tVim21XHcNkdPozh1XjdmfjEATB6+7fq3pwonLpHybjh5CvD8 kAsIAWUYiykf7sSd6sKegzQiRU4FJ5oSpSOV6ZDHaxkZfb1HlLlkchBjauVY4XizXsRO xJSfQ/P+eF7DWGuNtUkqNp2agZufVGTzPb6K0cx7QymmMMh55qQORXSQjg2duptUYzOX rv/YxT26+BJ35RnQXyeO7XpCOUv8R6jpCjA+5a2+dNMjd1LxiapuKbkDt7LOKWimMlY3 9hAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u85si19691pfi.5.2018.02.13.07.21.45; Tue, 13 Feb 2018 07:22:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965108AbeBMPUF (ORCPT + 99 others); Tue, 13 Feb 2018 10:20:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:36224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964828AbeBMPUD (ORCPT ); Tue, 13 Feb 2018 10:20:03 -0500 Received: from mail-qk0-f182.google.com (mail-qk0-f182.google.com [209.85.220.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39705217B9; Tue, 13 Feb 2018 15:20:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39705217B9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=robh@kernel.org Received: by mail-qk0-f182.google.com with SMTP id s198so6735533qke.5; Tue, 13 Feb 2018 07:20:03 -0800 (PST) X-Gm-Message-State: APf1xPAR+6eRqKn8iJBxSZ3AqrZrV7KZNXe4XPrAKTJTxipJkDtvK1R0 ExOVzTlTBdlWelu9HW8sNHDRVdzfN/ht9WffnA== X-Received: by 10.55.104.150 with SMTP id d144mr2427558qkc.71.1518535202392; Tue, 13 Feb 2018 07:20:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.245.147 with HTTP; Tue, 13 Feb 2018 07:19:41 -0800 (PST) In-Reply-To: References: <63f25fea-f163-f9cc-b5b2-f6f291d7f8d2@gmx.de> From: Rob Herring Date: Tue, 13 Feb 2018 09:19:41 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: RFC: build config via DT names To: Frank Rowand Cc: "Enrico Weigelt, metux IT consult" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 12, 2018 at 5:13 PM, Frank Rowand wrote: > + devicetree mail list > > On 02/10/18 07:52, Enrico Weigelt, metux IT consult wrote: >> Hi folks, >> >> I've regularily have the task of configuring a kernel for a given DT. >> To make this a little bit easier, I'd like to do this automatically. >> >> The tuff task here is getting a mapping between dt compatible strings >> and corresponding CONFIG_* flags. Automatically extracting it from the >> source code seems pretty tricky, especially w/ corner cases (eg. some >> drivers support groups of devices, depending on config options) - IMHO >> it will need some code changes anyways. >> >> Therefore I propose a simple approach using the existing Kconfig system: >> >> Add an extra (toplevel) menu and config flag naming scheme which >> directly map DT compatible strings to config flags. For example: >> >>> fsl,mpc5200-gpio <=> CONFIG_DTDEV_FSL_MPC5200_GPIO >> >>> config CONFIG_DTDEV_FSL_MPC5200_GPIO >>> tristate "fsl,mpc5200-gpio" >>> select GPIO_MPC5200 >> >> Note that these flags are separate from the actual drivers - they just >> enable them automatically. Of course they'll have to be maintained by >> the driver maintainers. >> >> >> What do you think about this idea ? Doubling the number of driver config options is not going to fly. How would you handle multiple compatible strings per driver? We want fewer config options, not more. We have all the data, so we should be able to generate this which dt_to_config tries to do. I think part of the problem is dt_to_config works at the source level for everything. Really we need a more robust way to map source files to config options and extracting match tables from drivers. Perhaps doing the latter with coccinelle which can match struct types, using the object files instead, or using module aliases (though that doesn't work for built-in drivers). Rob