From patchwork Thu Apr 14 06:44:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 12812976 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 7A89CC433F5 for ; Thu, 14 Apr 2022 06:46:19 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=pW11UK1bXyNef/RJeJLVbwfQR9FkxhEkDgokb9iH2X0=; b=uESWeTH03xmjDt NAHeYLTvfYtGi7nhLLzdDmzbFOh/bAEd5NxaDpTtUQ6pbTmKzqmYvT7PQjWfCRjVzH0lPChjMcsJd Dhbvt0uNTMotrVLYmJoZLTVql7sji9chCB/dv/x9aPwe9eHhkY+Qk7V4R78b5B/z1VMfiH6j+GTBZ snP2vYLhd4hxAUwQFg24H6iVJqi7kfk5khIearLL58Q88ZSDbzc2ciNVAL3fagktIqr675HVBuhLe qNfrym3zpQn8PCI4awS3tSqkUFWejfbHgHM2QJPVz4ur7zXOpAFuMXzJn3rIp6GJwfahfRtjvtgXA 8zX01oWhQWBwarV4fz8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1netE1-0049TV-4V; Thu, 14 Apr 2022 06:45:05 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1netDy-0049RG-0v for linux-arm-kernel@lists.infradead.org; Thu, 14 Apr 2022 06:45:03 +0000 Received: by mail-wm1-x335.google.com with SMTP id m33-20020a05600c3b2100b0038ec0218103so2522183wms.3 for ; Wed, 13 Apr 2022 23:45:00 -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=HlWGrznrHThYtAIuAJR7+9ztoBUuinJbQJ7Q8CK2FjY=; b=U2c+Dg3A1Yp4rgaW8uyCn4W5gW9YHZOkR/lO0qXSW5vXMo5O/qeO3TIrTgSQekWP+t i4CKwKik+gK52jIhGBrhjkQEJJIc0I1MUt/t1SmnTW03YHMaIFdJWmT2uFK0l7vCpcu+ zxEUQJSF3d+4HY7queFS3HnRE/6Leli1INMwrfEm9FcxfAwC5sELMlx0D1wYS/mihB5l HgYjadT2YhvLavB4P7fRlVIGkcYzQ+WecdBRUNfvPBFX2+N0oiNbDTVyo9rSzKtka+Zv ZYvNwC+3IIhRGd+tmmQFrv2gFexD85PkKwrWp5qlGe66rwLqktwtUSL5UcncBc8toUW1 0usg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HlWGrznrHThYtAIuAJR7+9ztoBUuinJbQJ7Q8CK2FjY=; b=IBUZJtVjx83eWBFlAg1ABJp1r6EkfgACFioNhFakINArFrsVJjSMhH2607PrGOHC73 ra+GMEUpY1HCw7TFQ6fleuygZID/ccWuYEIRM0DmDu24H9v01XADvCeceg6SpNSy52Pz vaarCBA3dUWk/itWNDepEPdWe1ggj+Z7o2nwo7c/t/6wYr5CCf2xEVrqIVZXfQc7MmpH RhVRPSQpRoIVvFwr7psMh4JVQIpqBUcYaTWBdFdz6tLirDDnfLe4cBiCnhb7cbQtee8L U8dWFnUWPAkYavh3BoipHFL99RhCxJaooC8yKAPQuDNoH96cqrt1GXm3D+9S8mewKdiQ Cs+g== X-Gm-Message-State: AOAM532xNUyLUBW96mBlBG4zXJVryyaos5YPO2gDT/EqegK+iNB1y9ms s2Xgma31sNN1lp3mLLbeNvZ7vEvRovzI8A== X-Google-Smtp-Source: ABdhPJzuyhLCI/gILRAN8/n2BlTk4GouxJ+OlQ2K0VB6s3BFlyGXIAFqWHtIW173Xs+8NCkzYFKvbg== X-Received: by 2002:a05:600c:2c50:b0:38e:bc60:fcaa with SMTP id r16-20020a05600c2c5000b0038ebc60fcaamr2185603wmg.52.1649918699491; Wed, 13 Apr 2022 23:44:59 -0700 (PDT) Received: from linaro.org ([2a00:23c5:6809:2201:e4bb:355f:cdcf:ea80]) by smtp.gmail.com with ESMTPSA id c18-20020a7bc852000000b0038ebf5f191esm5395954wml.45.2022.04.13.23.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 23:44:59 -0700 (PDT) From: Mike Leach To: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, mathieu.poirier@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, Mike Leach Subject: [PATCH v3 0/5] coresight: syscfg: Extend configfs for config load Date: Thu, 14 Apr 2022 07:44:52 +0100 Message-Id: <20220414064457.12052-1-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_234502_113958_A01ABA69 X-CRM114-Status: GOOD ( 12.67 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This set extends the configfs support to allow loading and unloading of configurations as binary files via configfs. Additional attributes - load and unload are provided to in the configurations group to implement the load functionality. Routines to generate binary configuration files are supplied in ./tools/coresight. Example generator and reader applications are provided. Tools may be cross compiled or built for use on host system. Documentation is updated to describe feature usage. Changes since v2: 1) Rebased & tested oo coresight/next - 5.18-rc2 2) Moved coresight config generator and reader programs from samples to tools/coresight. Docs updated to match. (suggested by Mathieu) 3) userspace builds now use userspace headers from tools/... 4) Other minor fixes from Mathieu's review. Changes since v1: 1) Rebased to coresight/next - 5.16-rc1 with previous coresight config set applied. 2) Makefile.host fixed to default to all target. Mike Leach (5): coresight: configfs: Add in functionality for load via configfs coresight: configfs: Add in binary attributes to load files coresight: configfs: Modify config files to allow userspace use coresight: tools: Add config file write and reader tools Documentation: coresight: docs for config load via configfs .../trace/coresight/coresight-config.rst | 166 +++++- MAINTAINERS | 2 + drivers/hwtracing/coresight/Makefile | 2 +- .../coresight/coresight-config-file.c | 475 ++++++++++++++++++ .../coresight/coresight-config-file.h | 126 +++++ .../hwtracing/coresight/coresight-config.h | 27 + .../coresight/coresight-syscfg-configfs.c | 91 ++++ .../hwtracing/coresight/coresight-syscfg.c | 37 ++ .../hwtracing/coresight/coresight-syscfg.h | 2 + tools/coresight/Makefile | 51 ++ tools/coresight/coresight-cfg-bufw.c | 303 +++++++++++ tools/coresight/coresight-cfg-bufw.h | 26 + tools/coresight/coresight-cfg-example1.c | 65 +++ tools/coresight/coresight-cfg-examples.h | 27 + tools/coresight/coresight-cfg-file-read.c | 197 ++++++++ tools/coresight/coresight-cfg-filegen.c | 58 +++ tools/include/uapi/coresight-config-uapi.h | 76 +++ 17 files changed, 1724 insertions(+), 7 deletions(-) create mode 100644 drivers/hwtracing/coresight/coresight-config-file.c create mode 100644 drivers/hwtracing/coresight/coresight-config-file.h create mode 100644 tools/coresight/Makefile create mode 100644 tools/coresight/coresight-cfg-bufw.c create mode 100644 tools/coresight/coresight-cfg-bufw.h create mode 100644 tools/coresight/coresight-cfg-example1.c create mode 100644 tools/coresight/coresight-cfg-examples.h create mode 100644 tools/coresight/coresight-cfg-file-read.c create mode 100644 tools/coresight/coresight-cfg-filegen.c create mode 100644 tools/include/uapi/coresight-config-uapi.h