linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mike Leach <mike.leach@linaro.org>
To: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org, mathieu.poirier@linaro.org,
	suzuki.poulose@arm.com, leo.yan@linaro.org,
	Mike Leach <mike.leach@linaro.org>
Subject: [PATCH 6/6] Documentation: coresight: Update coresight configuration docs
Date: Mon,  1 Nov 2021 22:47:31 +0000	[thread overview]
Message-ID: <20211101224731.27870-7-mike.leach@linaro.org> (raw)
In-Reply-To: <20211101224731.27870-1-mike.leach@linaro.org>

Add documentation covering the configfs updates that allow
binary configuration files to be loaded and unloaded, along
with the demonstration programs in samples.

Signed-off-by: Mike Leach <mike.leach@linaro.org>
---
 .../trace/coresight/coresight-config.rst      | 65 +++++++++++++++++--
 1 file changed, 59 insertions(+), 6 deletions(-)

diff --git a/Documentation/trace/coresight/coresight-config.rst b/Documentation/trace/coresight/coresight-config.rst
index 911db4da7f99..8ea640b3f6f9 100644
--- a/Documentation/trace/coresight/coresight-config.rst
+++ b/Documentation/trace/coresight/coresight-config.rst
@@ -152,7 +152,7 @@ follows::
 
     $ cd configurations/
     $ ls
-    autofdo
+    autofdo last_load_status  load  unload
     $ cd autofdo/
     $ ls
     description   preset1  preset3  preset5  preset7  preset9
@@ -247,9 +247,19 @@ Creating and Loading Custom Configurations
 ==========================================
 
 Custom configurations and / or features can be dynamically loaded into the
-system by using a loadable module.
+system by using a loadable module, or by loading a binary configuration
+file in configfs.
+
+Loaded configurations can use previously loaded features. The system will
+ensure that it is not possible to unload a feature that is currently in
+use, by enforcing the unload order as the strict reverse of the load order.
+
+An example of a custom configuration module, and generators for binary
+configuration files are found in './samples/coresight'.
+
 
-An example of a custom configuration is found in ./samples/coresight.
+Using a Loadable Module
+-----------------------
 
 This creates a new configuration that uses the existing built in
 strobing feature, but provides a different set of presets.
@@ -258,6 +268,49 @@ When the module is loaded, then the configuration appears in the configfs
 file system and is selectable in the same way as the built in configuration
 described above.
 
-Configurations can use previously loaded features. The system will ensure
-that it is not possible to unload a feature that is currently in use, by
-enforcing the unload order as the strict reverse of the load order.
+The file 'coresight-cfg-sample.c' contains the configuration and module
+initialisation code needed to create the loadable module.
+
+This will be built alongside the kernel modules if select in KConfig.
+
+
+Using a Binary Configuration File
+---------------------------------
+
+Building the samples creates the 'coresight-cfg-filegen' program that will
+generate a configuration binary 'example1.cscfg' that can be loaded into the
+system using configfs. The configuration declared in the source file
+'coresight-cfg-filegen.c' is named 'autofdo3' - the name that will be used
+once loaded.
+
+The source files 'coresight-cfg-bufw.h' and 'coresight-cfg-bufw.c' provide a
+standard function to convert a configuration declared in 'C' into the correct
+binary buffer format. These files can be re-used to create new custom
+configurations.
+
+The program  'coresight-cfg-file-read' can read back and print a configuration
+binary. This is built using the reader from the driver code.
+
+There are additional attributes in the configurations directory - load, unload
+and last_load_status that can be used to load and unload configuration
+binary files. To load, 'cat' the binary config into the load attribute::
+
+    $ ls /config/cs-syscfg/configurations/
+    autofdo last_load_status  load  unload
+    $ cat example1.cscfg > /config/cs-syscfg/configurations/load
+    $ ls /config/cs-syscfg/configurations/
+    autofdo  autofdo3  last_load_status  load  unload
+    $ cat /config/cs-syscfg/configurations/last_load_status
+    OK: configuration file loaded (autofdo3).
+
+To unload, use the same file in the unload attribute::
+
+    $ cat example1.cscfg > /config/cs-syscfg/configurations/unload
+    $ cat /config/cs-syscfg/configurations/last_load_status
+    OK: configuration file unloaded (autofdo3).
+    ls /config/cs-syscfg/configurations/
+    autofdo  last_load_status  load  unload
+
+The generator and reader programs can also be built directly, separately from
+the kernel build by using the 'Makefile.host' file. This allows binaries to be
+created on the host machine when cross compiling.
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      parent reply	other threads:[~2021-11-01 22:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01 22:47 [PATCH 0/6] coresight: syscfg: Extend configfs for config load Mike Leach
2021-11-01 22:47 ` [PATCH 1/6] coresight: configfs: Add in functionality for load via configfs Mike Leach
2021-11-01 22:47 ` [PATCH 2/6] coresight: configfs: Add in binary attributes to load files Mike Leach
2021-11-01 22:47 ` [PATCH 3/6] coresight: configfs: Modify config files to allow userspace use Mike Leach
2021-11-01 22:47 ` [PATCH 4/6] coresight: samples: Add an example config writer for configfs load Mike Leach
2021-11-01 22:47 ` [PATCH 5/6] coresight: samples: Add coresight file reader sample program Mike Leach
2021-11-01 22:47 ` Mike Leach [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211101224731.27870-7-mike.leach@linaro.org \
    --to=mike.leach@linaro.org \
    --cc=coresight@lists.linaro.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).