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: 115334 Delivered-To: patches@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3355550qgn; Mon, 9 Oct 2017 22:34:29 -0700 (PDT) X-Received: by 10.99.123.78 with SMTP id k14mr11206902pgn.351.1507613669863; Mon, 09 Oct 2017 22:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507613669; cv=none; d=google.com; s=arc-20160816; b=e1NnUOB7niQLQkYBeLfLBtwnjIWjJoM6z64ISllqMo1OXTnqQQmTrQ1j02wwviu0ej QppfKQ3gPXshqgzrNqxvOC4GzSb26fjY4Tz2eMAe/I89vfjE8kr1zHcASR7516gcZ9Qi pVUgBTMOqccRtc7gIZd7dgtCXt4IKS+pwxAfn8SK7or27undQtYs8sdTb3VEwpoHcBMH OLHD2HSJiOIiBtT/mnRVyP5htADHeixZPRXrbljL0wdOF3tGThqmUrC3NSe9jeJdGQSn aNZgFn7QtXzjX8qptMql2bHQnpx+2Ue6EOWNAEfD/WhXyxffyrbmq3K+qaIBULbnDGba 9PGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=LCLH0FA8Tx4CsQureA1NcDbxGMLX1tyn1BlymYMC+wY=; b=Hs2KgbMHV4PFHKaYha/pZD2Ez78bTNeObUXXyf4T7Hb4+m27vSkdPWC6D8wrhpXKy8 ELlBOl/i8E+xG8sScU/UathZJpVwdcYHTw8HDp635DHTQh5c6/hwEI/7Vc9hV0KHV8rN zYPFJ1zddikTRzMFPeIrQA6VT48On10YfdPEsTJ1GVEw8r2emTJ9imWW18w5syIm55H/ wvwb17TfTOmYCF6gZmqelD3xjkamP0N/U5cUGOvmjb/WeaYxKTMhzTMytm52+7ASNMn1 fFNgXgjLcMl4ptuozEeXGedljOMaD4DF5Jnbc1/ZRgai1FV3PeCssDtLJDH5deWyIyv0 RYvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WDBBbevK; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id s3sor1507907plb.125.2017.10.09.22.34.29 for (Google Transport Security); Mon, 09 Oct 2017 22:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WDBBbevK; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=OE/1qLNnw5jVbCYFBCLso2m86ymiWK7CrlrxDM2Js2fTRmJLLNkMJi86WYkL2cMqxd rcaRwjsgAxP2v60QXNDnRshPW9rwVYHdDKqACk/9W7Tq0WIdDgwlPthA4QBBELgQARg0 amfV05LorAxasJLQi+6BBtwO3OL4wi8KJiPdxJPiSlgeSeALQIQWKFpFXdBS7sM289C3 7GZD7P4imidH0h+MZwM1T5QHEgid8d68nuRh/gkQeu8FZ/RiC4U/CuoFXOvALiInBBdI LkI5lk6DgPrkq9hY/30FkED1vTxLp8irv9hUsbxoHkeRKcVaKErTqthj6WgmR5IwPXd0 Zyfg== X-Gm-Message-State: AMCzsaUWQDjo8rZcp/r+XURSscb4hzQHK5KjToqrgzzueHfbd2ofIqsz DR4y73+r38itDf4Hzv2qfGx+mpwm 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) Return-Path: 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 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 -- 2.7.4