From: Andrew Jeffery <andrew@aj.id.au> To: linux-kernel@vger.kernel.org Cc: Andrew Jeffery <andrew@aj.id.au>, robh+dt@kernel.org, mark.rutland@arm.com, joel@jms.id.au, gregkh@linuxfoundation.org, Eugene.Cho@dell.com, a.amelkin@yadro.com, stewart@linux.ibm.com, benh@kernel.crashing.org, openbmc@lists.ozlabs.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH v2 2/4] Documentation: ABI: Add sysfs-devices-platform-field to testing Date: Wed, 11 Jul 2018 15:01:20 +0930 [thread overview] Message-ID: <20180711053122.30773-3-andrew@aj.id.au> (raw) In-Reply-To: <20180711053122.30773-1-andrew@aj.id.au> "Fields" expose control of hardware directly to userspace where appropriate. Examples of expected use are single bit switches or other small masks of registers where the range of values is entirely policy driven and the field is not part of a larger, coherent design. These fields can be from read-only, read-write or write-1-set/write-1-clear register sets. Using fields to control the behaviour of hardware local to the kernel exposing them is likely incorrect. The use-case motivating the fields feature is for Baseboard Management Controllers (BMCs) to expose policy controls for booting and running their host systems. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> --- Since RFC v1: * Describe a 'type' attribute that determines the behaviour of the remaining attributes * Rework paths to point through /sys/devices/platform * Add a description to the commit message .../ABI/testing/sysfs-devices-platform-field | 95 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 96 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-field diff --git a/Documentation/ABI/testing/sysfs-devices-platform-field b/Documentation/ABI/testing/sysfs-devices-platform-field new file mode 100644 index 000000000000..216481d8bc99 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-platform-field @@ -0,0 +1,95 @@ +This document defines the sysfs attributes provided by the bmc-misc-ctrl +driver. See Documentation/devicetree/bindings/misc/bmc-misc-ctrl.txt for +exhaustive list of field definitions. + +What: /sys/devices/platform/.../<field>/<label>/label +Date: July, 2018 +KernelVersion: v4.19 +Contact: openbmc@lists.ozlabs.org +Description: + An RO attribute providing the name of the field of interest. + Corresponds to the value of <label> in the path +Users: openbmc@lists.ozlabs.org + +What: /sys/devices/platform/.../<field>/<label>/type +Date: July, 2018 +KernelVersion: v4.19 +Contact: openbmc@lists.ozlabs.org +Description: + An RO attribute describing the type of the field. The type + takes one of three values: + + 'ro': The field is read-only. The 'value' attribute will be + read-only and neither 'set' nor 'clear' attributes will + be present. + 'rw': The field is read-write. The 'value' attribute will be + both readable and writable and neither 'set' nor + 'clear' attributes will be present. Values written to + the 'value' attribute will be atomically updated. + 'w1sc': The field uses write-1-{set,clear} semantics. The + 'value' attribute will be read-only, and both 'set' and + 'clear' attributes will be present to manipulate + 'value'. 'set' and 'clear' will both be write-only. +Users: openbmc@lists.ozlabs.org + +What: /sys/devices/platform/.../<field>/<label>/mask +Date: July, 2018 +KernelVersion: v4.19 +Contact: openbmc@lists.ozlabs.org +Description: + An RO attribute providing the mask applied to the value + read/written from the 'value' attribute. +Users: openbmc@lists.ozlabs.org + +What: /sys/devices/platform/.../<field>/<label>/value +Date: July, 2018 +KernelVersion: v4.19 +Contact: openbmc@lists.ozlabs.org +Description: + The value of the field of interest. + + If the field is exposed from a read-modify-write register this + attribute will be RW, where writes will set the field to the + value written. Writing values that exceed the width of the + field will return an error. + + If the field is exposed from a write-1-set/write-1-clear + register this attribute will be RO, and the attributes 'set' + and 'clear' will be present as write-only. +Users: openbmc@lists.ozlabs.org + +What: /sys/devices/platform/.../<field>/<label>/set +Users: openbmc@lists.ozlabs.org +Date: July, 2018 +KernelVersion: v4.19 +Contact: openbmc@lists.ozlabs.org +Description: + A WO attribute that when written will set bits in the backing + register corresponding to set bits in the value written. + Register bits corresponding to cleared bits in the written + value will remain unchanged. + + This attribute is exposed when the field is identified as being + composed of write-1-set and write-1-clear registers. + + Writing values that exceed the width of the mask value will + return an error. +Users: openbmc@lists.ozlabs.org + +What: /sys/devices/platform/.../<field>/<label>/clear +Users: openbmc@lists.ozlabs.org +Date: July, 2018 +KernelVersion: v4.19 +Contact: openbmc@lists.ozlabs.org +Description: + A WO attribute that when written will clear bits in the backing + register corresponding to set bits in the value written. + Register bits corresponding to cleared bits in the written + value will remain unchanged. + + This attribute is exposed when the field is identified as being + composed of write-1-set and write-1-clear registers. + + Writing values that exceed the width of the mask value will + return an error. +Users: openbmc@lists.ozlabs.org diff --git a/MAINTAINERS b/MAINTAINERS index fa2033a522f2..d167f0340c11 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2741,6 +2741,7 @@ R: Andrew Jeffery <andrew@aj.id.au> L: openbmc@lists.ozlabs.org (moderated for non-subscribers) S: Supported F: Documentation/devicetree/bindings/misc/bmc-misc-ctrl.txt +F: Documentation/ABI/testing/sysfs-devices-platform-field BPF (Safe dynamic programs and tools) M: Alexei Starovoitov <ast@kernel.org> -- 2.17.1
next prev parent reply other threads:[~2018-07-11 5:32 UTC|newest] Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-11 5:31 [RFC PATCH v2 0/4] sysfs interface to miscellaneous BMC controls and fields Andrew Jeffery 2018-07-11 5:31 ` [RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields Andrew Jeffery 2018-07-11 20:04 ` Rob Herring 2018-07-12 0:14 ` Benjamin Herrenschmidt 2018-07-12 0:53 ` Andrew Jeffery 2018-07-12 15:11 ` Rob Herring 2018-07-13 0:55 ` Benjamin Herrenschmidt 2018-07-13 6:31 ` Andrew Jeffery 2018-07-13 15:14 ` Alexander Amelkin 2018-07-13 18:49 ` Eugene.Cho 2018-07-13 19:03 ` Greg KH 2018-07-13 19:06 ` Eugene.Cho 2018-07-15 14:21 ` Avi Fishman 2018-07-16 0:57 ` Andrew Jeffery 2018-07-16 13:55 ` Rob Herring 2018-07-17 1:04 ` Andrew Jeffery 2018-07-17 4:56 ` Benjamin Herrenschmidt 2018-07-17 23:28 ` Andrew Jeffery 2018-07-18 19:07 ` Rob Herring 2018-07-19 1:57 ` Andrew Jeffery 2018-07-18 19:50 ` Rob Herring 2018-07-18 23:58 ` Benjamin Herrenschmidt 2018-07-19 2:28 ` Andrew Jeffery 2018-07-19 4:35 ` Benjamin Herrenschmidt 2018-07-20 0:07 ` Andrew Jeffery 2018-07-20 4:56 ` Benjamin Herrenschmidt 2018-08-10 0:22 ` Kun Yi 2018-08-23 15:32 ` Alexander Amelkin 2018-07-11 5:31 ` Andrew Jeffery [this message] 2018-07-11 5:31 ` [RFC PATCH v2 3/4] misc: Add bmc-misc-ctrl Andrew Jeffery 2018-07-11 5:31 ` [RFC PATCH v2 4/4] dts: aspeed-g5: Describe VGA, SIO scratch and DAC mux fields Andrew Jeffery
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=20180711053122.30773-3-andrew@aj.id.au \ --to=andrew@aj.id.au \ --cc=Eugene.Cho@dell.com \ --cc=a.amelkin@yadro.com \ --cc=benh@kernel.crashing.org \ --cc=devicetree@vger.kernel.org \ --cc=gregkh@linuxfoundation.org \ --cc=joel@jms.id.au \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=openbmc@lists.ozlabs.org \ --cc=robh+dt@kernel.org \ --cc=stewart@linux.ibm.com \ --subject='Re: [RFC PATCH v2 2/4] Documentation: ABI: Add sysfs-devices-platform-field to testing' \ /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
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).