From patchwork Tue Feb 1 05:04:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 12731396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE11AC433EF for ; Tue, 1 Feb 2022 05:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9J2ylPgolPWuRBNGMDG/6QhoxjNEcOdnNPz17hplVqw=; b=edw0Pzk15hiii0 OWCUdOUAffPBAWUxOauiYFhlgBYAxj5/c1+QUgOz4C2fftoZLN+LHVgRlJfcdmi2AJORnUBV3nZVL IbKfjyfT09vOFV5xv2dYgBjz1EmLnd4QGbhYdyIzXWNeZmevDR3cC+hPkVN3K9k2ruJHQIQmPEZGJ sQNAXHzygC1eseuCowWeGXJchUXdzIw3H7T9bxpAOI+o5DzUAIr1ELsZ9Y1TGDiMM+mQqR5pLHKfo ueeCY1cdER7dl5jRu5k1dZz3v1Kuh3yLCUfepATx8XxzcX23I65yHIEMQ8Xyhr6m3yE9miN0n7O0g VdJjuDui4IlwPKl6jyYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nElLx-00B9Z8-FV; Tue, 01 Feb 2022 05:05:17 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nElLt-00B9Xu-E2 for linux-arm-kernel@lists.infradead.org; Tue, 01 Feb 2022 05:05:15 +0000 Received: by mail-pj1-x102b.google.com with SMTP id d5so16001719pjk.5 for ; Mon, 31 Jan 2022 21:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=p0Mf1pHgKLt44R6XPdoONMmYbFvFAfcUL2WgqQxrsAY=; b=aT+IUQJ6Tt/CjegESk7cg0DT2FeroIJIIxaAFM5G4s8Rg9QaxwObqyxMkHrOpDqdLg 3AIN1rDqnk2AOG46cY+qPoNfxx/06EvO6ynGhfs84jy2PYJAWzMDw+UISt2bkTSvSxOg /+G4lOkLLapdAReBuzi3cR8vuqmK2XjKgnnwRioZGKPZeSfdMltm//5XBQxQJL39xykk AqhWCw6dJ4HN7dUWK3SIP+32xm28SMwV4fCY1RJXKqp3YFsZpPJwoIh5onfsUsZ4i5mo k0BWmQmFFFEbEjtq/sO7VzmDefsPYUPw/gFvfy9tkp45tri0qyO27vXYdQpZSHrwj19H tZkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=p0Mf1pHgKLt44R6XPdoONMmYbFvFAfcUL2WgqQxrsAY=; b=eCXSMjp5fHqGlhlEVjx0QqXXmSazm3kjVkKwQMUlsUyl0YpP7Hos7FGB4YQV7lVnUL OvGg5kqkdtgdFxZnfx0kQ0FpaF94rEWWxhwIv1JfyQ1hMQpVIE8VF1N3Q1BbAG0K2GqX sAGcKPbHcM0vnEGyfIcp7j48lWMQHQ4m+r7bAJOZtRPYT4YcQWgoDEPXPpmCywh2QdTn ilcP7Fe1MIzwpcVKpO9FCkbl3ydNCKNzf+8H4FqXO3tcEcll6t3pCC2N3u5iKKyCd9L/ S2SOuaimRZMAIMSCRajOh+5VBrfVA4VzJlbE9LpCM5GT1dRd9wKPvk2WAeW8oZMyuD/P lWSw== X-Gm-Message-State: AOAM530cDfxq783ti0fQ5iUIDdMs4+GKjjYHxC1/XIn7Ku4/iIAvyQYm OU9tINHjmUJm/WW83kwokCM= X-Google-Smtp-Source: ABdhPJx1OxZZ3RKrxjSrKQtiVOjcEKe2hZLtXa+SV4AiPF06dGcRfVxGwqlxXacD5FNY1dgeGx+M6g== X-Received: by 2002:a17:902:d4ca:: with SMTP id o10mr24427520plg.28.1643691910056; Mon, 31 Jan 2022 21:05:10 -0800 (PST) Received: from voyager.lan ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id u37sm6181991pga.2.2022.01.31.21.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 21:05:09 -0800 (PST) From: Joel Stanley To: Arnd Bergmann , Andrew Jeffery , Greg Kroah-Hartman , "Rafael J . Wysocki" Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Subject: [PATCH 0/2] firmware: Add boot information to sysfs Date: Tue, 1 Feb 2022 15:34:59 +1030 Message-Id: <20220201050501.182961-1-joel@jms.id.au> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220131_210513_511220_8F99F16D X-CRM114-Status: GOOD ( 13.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is the second iteration of this idea. The first used socinfo custom attribute groups, but Arnd suggested we make this something standardised under /sys/firmware instead: http://lore.kernel.org/all/CAK8P3a3MRf0aGt1drkgsuZyBbeoy+S7Ha18SBM01q+3f33oL+Q@mail.gmail.com Some ARM systems have a firmware that provides a hardware root of trust. It's useful for the system to know how this root of trust has been configured, so provide a standardised interface that expose this information to userspace. This is implemented as a sysfs attribute group registration to be called at boot, with the properties described in the ABI document. Alternatively we could put the properties in the driver core, and have platforms register callbacks for each supported property. This would make it harder to insert non-standard properties, with the trade off of more code to selectively show supported properties. An user of the properties is provided in the second patch. Joel Stanley (2): firmware: Add boot information sysfs ARM: aspeed: Add secure boot controller support .../ABI/testing/sysfs-firmware-bootinfo | 43 ++++++++++ drivers/base/firmware.c | 14 ++++ drivers/soc/aspeed/aspeed-socinfo.c | 84 ++++++++++++++++++- include/linux/firmware_bootinfo.h | 8 ++ 4 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-firmware-bootinfo create mode 100644 include/linux/firmware_bootinfo.h