From patchwork Tue Oct 10 05:34:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 823703 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="WDBBbevK"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yB5Qc3mztz9tY9 for ; Tue, 10 Oct 2017 16:34:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751919AbdJJFeb (ORCPT ); Tue, 10 Oct 2017 01:34:31 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:44218 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751897AbdJJFea (ORCPT ); Tue, 10 Oct 2017 01:34:30 -0400 Received: by mail-pf0-f177.google.com with SMTP id x7so5812973pfa.1 for ; Mon, 09 Oct 2017 22:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=LCLH0FA8Tx4CsQureA1NcDbxGMLX1tyn1BlymYMC+wY=; b=WDBBbevKazvG9GfMEJRo9+vwyTrVN0tITFh2h3RFfOaqnkV90dx6gPANWL7+dzG81I A/3A1WeoCL8/od5oAPP+7e0Uc4N7aSOah4EtOjlPSZGb0CyuzQBMWj6+iiq1vAFtwPcf 4I8IJ+nwfsAisXUSyq4XivTTL3Aklff6SMbKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LCLH0FA8Tx4CsQureA1NcDbxGMLX1tyn1BlymYMC+wY=; b=iVwibANi8V7HT9DBCfOzk9VKgD10YWmMgFM/twgsc0n4t2I6gG2a1oFh9pv6FoqWAA 2CrHwgoo125X2TnEi6MvioMmupwWb+qk7tkCMSaPkxOihd7Uxvr0bIv+m9w0Jh8QxF22 uAYkMLLRge91USnTouOMZt+57zJng/MQ649o7uBacTMQLW1SfxUBCT3xq9JJjnf8oRbD EYRJAoZXEENU2w6BXbTDmvr8Hh1ROeKARWJ6LGnopuT1cpAWwwM0rEia5gxA0T7p0H7j N7lyxSm5td/DOIl709+gbLOJd8CazE4B1Q6XZ/6JX0iUccqVptS1pp/3rtSvmsjT+lbU tQFA== X-Gm-Message-State: AMCzsaXf34ukqMGSy/UhswdfHSsoxwU30AxiiMYzglzftiz/Xts6fdcN +oQ8T3mFPaK5caG2MYAlxn8JTQ== X-Google-Smtp-Source: AOwi7QCm9OH3CqmTI5VA2ZmxVCThtrEjavo6xTG9zcK0cRvJ0Xxf5qmspMziEgt+im4TeuRN7dSvVA== X-Received: by 10.84.131.69 with SMTP id 63mr11356370pld.364.1507613669459; Mon, 09 Oct 2017 22:34:29 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id b16sm9603595pfe.58.2017.10.09.22.34.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 22:34:27 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Rob Herring , Mark Rutland , Frank Rowand , Dmitry Shmidt , devicetree@vger.kernel.org Subject: [RFC][PATCH 0/3] Overlay manager for predefined DT overlay fragments Date: Mon, 9 Oct 2017 22:34:17 -0700 Message-Id: <1507613660-27236-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In working with the HiKey and HiKey960 as targets for AOSP, Dmitry developed the following overlay manager driver, which allows a number of pre-determined DT overlay configurations to be defined, and the configurations to be enabled at boot time via a kernel boot argument. This has been submitted before, but while the earlier discussion didn't really resolve to any sort of actionable direction, this issue cropped up again and was a major discussion topic at the Linux Plumbers Conference Android Microconference, so I suspect it is worth revisiting this solution again. The overall use case is being able to configure devboards that support a number of different mezzanine peripherals which unfortunately cannot be probed. Some example mezzanines are LCD panels or sensor hubs, as well as other options. The new functionality this driver provides is a mechanism to specify multiple pre-determined dt overlay fragments in a dtb file, and providing a way to select which dt fragments should be applied via the kernel boot argument. The desire to use a kernel boot-argument as the selection mechanism, comes from the Android Boot Image format not handling dtbs independently. Usually with Android, the dtb is appended to the kernel image, and modifying that is much more difficult then changing the boot argugments. There is also a usability argument that using a kernel command option to select pre-defined entries is simpler for users to navigate. Also, since the mezzanines are unable to be probed, we cannot use other solutions, like having the bootloader specify additional dtb overlays to the kernel. Obviously the earlier objections to this approach likely still apply, but we wanted to resubmit it for feedback in order to restart the discussion to find an actionable direction as to what sort of usable and more general approach could be found. Cc: Rob Herring Cc: Mark Rutland Cc: Frank Rowand Cc: Dmitry Shmidt Cc: devicetree@vger.kernel.org Dmitry Shmidt (3): of: overlay_mgr: Add overlay manager driver of: overlay_mgr: Add ability to apply through sysfs entry of: overlay_mgr: Add ability to apply several hardware configurations .../devicetree/bindings/of/overlay_mgr.txt | 32 +++++ drivers/of/Kconfig | 10 ++ drivers/of/Makefile | 1 + drivers/of/overlay_mgr.c | 152 +++++++++++++++++++++ 4 files changed, 195 insertions(+) create mode 100644 Documentation/devicetree/bindings/of/overlay_mgr.txt create mode 100644 drivers/of/overlay_mgr.c