Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp78708pxb; Mon, 8 Feb 2021 15:53:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKWTE0NTC40038zbMGwcghrl0QDqWhUZjELsmOW8saaxY9nbocE3C1QJ939kHNzFQAX1Cj X-Received: by 2002:a17:907:7605:: with SMTP id jx5mr19789998ejc.340.1612828394842; Mon, 08 Feb 2021 15:53:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612828394; cv=none; d=google.com; s=arc-20160816; b=f4bhAggzFxLGR4oR6dBBZ6AL7pcNGJnAr6fuvIb6MOLkelfV0ulUJfsJjAVJmaT29f XQRTDn9xlrRUolrLmGqh/4zNHFfbNTWRYZXLberh0gCFGAvIdbS4Va7S6AeSK3OR9tfF Yq7aolYgVQPv/A8WAVT1N4urqnnW7VDbvEQmG63QBvsGZHNDBJgDEx3/kYa4p9DTDniT zG5ZIwm0+DpDNp6NEFFt/2YXMRP3dd02vVK55l6NdZZZxhVu71Eop3fmL/EBIbxipdHP UPk56hjJB3ejSk+8iha3GSHYZGr7wVt1+l/kEiwH7UN+BqV59E/E0V9diZ6oi5u2eVXs 9TvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Om/ZYrETNuDaseSSM0b9y4pRaRfY2AhoZzsj4tVyytw=; b=tf7rJBHRVG+rfLbtmnX+QMnOTARXW4RP55wKJ5XiPe7063X3faMrm6ABdohwfcBMZC 0o4OKGH7I0scSqT3PZJCOcBwwdcGNQbgB9aDtEWKhslp/DE5FT2+vn4GCbG0OQezL5j6 jY4q2qwVd5V+I2KDr/8BvTvORUcdARE69G4xI5QiJR5N3tOKdU4d6k+8Si7OeFnO3H9V 7qVC/hwJ3q+Wv0k0+BTD6EOiC5gITZqg1ZtgVQoyOADPcdUvk/pZXG7mku32LLXQ2lUV UEe9Fpt+hv5OkbEX4OlEds7Mvh/lFr88Egv5gpGgpStaW+RWNhJ+dNtdpuMXe9+yaYzZ Fdrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fUWL1mbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si12360283ejj.217.2021.02.08.15.52.51; Mon, 08 Feb 2021 15:53:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fUWL1mbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbhBHXta (ORCPT + 99 others); Mon, 8 Feb 2021 18:49:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:34004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbhBHXt2 (ORCPT ); Mon, 8 Feb 2021 18:49:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0595A64E9A; Mon, 8 Feb 2021 23:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612828127; bh=cmdwZ4a6bUBFmfrZQNo71CTGPOcdnPqfAXXmNEvqVgc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fUWL1mbIkWT79Zn55+uY9X7SN+LOgH+aQgHzr3yZOl6MidpFg73v3bfAWuwyWVI7E /64IeyHlICat37I0hlNrJqWqstWfxj/V8v3l+dgjn8VCnZby3hFbAaU+UzZ0wrA8jE bEQkKDro5hYjWCSz/X4sAkV+cnIqSTgdyjO5M8H5fZG+czuJttNc3TFwN0F/Zjljzq t+wIR9A3hrtwrRclPsdYqKedGeqzTeMXNcd7NHH/JnW0swH3GOUtG9M+5S+SAYDKw2 +n2B+2N/UoGN4JTlJrnLC/xLCqLgYQN1DKYgEB3EICl09DN69/DzAKOajagrLqCznX /oXPi7bZqlTCg== Received: by mail-qk1-f182.google.com with SMTP id m144so589007qke.10; Mon, 08 Feb 2021 15:48:46 -0800 (PST) X-Gm-Message-State: AOAM533BlyLIxUsugtY+aAdUaAJhqxcLi4jUdyoZoKr/ulkn6VVvRntF gEzC+FcZMNbiTmbHyQtJmQN4KxTf37BvBqVB2g== X-Received: by 2002:ae9:f20b:: with SMTP id m11mr19942215qkg.464.1612828126133; Mon, 08 Feb 2021 15:48:46 -0800 (PST) MIME-Version: 1.0 References: <20210208222203.22335-1-info@metux.net> In-Reply-To: <20210208222203.22335-1-info@metux.net> From: Rob Herring Date: Mon, 8 Feb 2021 17:48:33 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: RFC: oftree based setup of composite board devices To: "Enrico Weigelt, metux IT consult" Cc: "linux-kernel@vger.kernel.org" , "Rafael J. Wysocki" , Linus Walleij , Bartosz Golaszewski , Frank Rowand , Pantelis Antoniou , "open list:GPIO SUBSYSTEM" , devicetree@vger.kernel.org, Johan Hovold Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Johan H On Mon, Feb 8, 2021 at 4:22 PM Enrico Weigelt, metux IT consult wrote: > > Hello folks, > > here's an RFC for using compiled-in dtb's for initializing board devices > that can't be probed via bus'es or firmware. I'm not convinced compiled in is the mechanism we want. > Use cases are boards with non-oftree firmware (ACPI, etc) where certain > platform devices can't be directly enumerated via firmware. Traditionally > we had to write board specific drivers that check for board identification > (DMI strings, etc), then initialize the actual devices and their links > (eg. gpio<->leds/buttons, ...). Often this can be expressed just by DT. This is something I've wanted to see for a while. There's use cases for DT based systems too. The example I'd like to see supported are USB serial adapters with downstream serdev, GPIO, I2C, SPI, etc. Then plug more than one of those in. > This patch queue does a bunch of preparations in oftree code, so we can > support multiple fully independent DT's (not using DT overlays). And then > adds a generic driver parses compiled-in fdt blobs, checks for mathing > DMI strings and initializes the devices. As an example, the last patch > adds an alternative implementation for the PC engines APU2/3/4 board > family based on device tree. I think there's a couple of approaches we could take. Either support multiple root nodes as you have done or keep a single root and add child nodes to them. I think the latter would be less invasive. In the non-DT cases, we'd just always create an empty skeleton DT. A 3rd variation on a DT system is we could want to create parent nodes if they don't exist to attach this DT to so we have a full hierarchy. I'm not saying which one we should do, just laying out some of the options. > The approach can be easily be extended to other kinds of composite devices, > eg. PCI cards or USB dongles. > > > Yet some drawbacks of the current implementation: > > * individual FDT's can't be modularized yet (IMHO, we don't have DMI-based > modprobing anyways) I think we need to use either firmware loading or udev mechanisms to load the FDTs. > * can't reconfigure or attach to devices outside the individual DT's > (eg. probed by PCI, etc) Not sure I follow. Rob