2019-05-28 20:10:00

by Richard Gong

[permalink] [raw]
Subject: [PATCHv4 3/4] firmware: rsu: document sysfs interface

From: Richard Gong <[email protected]>

Describe Intel Stratix10 Remote System Update (RSU) device attributes

Signed-off-by: Richard Gong <[email protected]>
Reviewed-by: Alan Tull <[email protected]>
---
v2: changed to use tab everywhere and wrap lines at 72 colums
s/soc:firmware:svc:rsu/stratix10-rsu.0
added for watchdog
v3: s/KernelVersion:5.2/KernelVersion:5.3
v4: replaced /sys/devices/platform/stratix10-rsu.0/ with
/sys/devices/.../stratix10-rsu.0/driver/
removed spaces
---
.../testing/sysfs-devices-platform-stratix10-rsu | 100 +++++++++++++++++++++
1 file changed, 100 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-stratix10-rsu

diff --git a/Documentation/ABI/testing/sysfs-devices-platform-stratix10-rsu b/Documentation/ABI/testing/sysfs-devices-platform-stratix10-rsu
new file mode 100644
index 0000000..29ae1c7
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-platform-stratix10-rsu
@@ -0,0 +1,100 @@
+ Intel Stratix10 Remote System Update (RSU) device attributes
+
+What: /sys/devices/.../stratix10-rsu.0/driver/current_image
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (RO) the address of image currently running in flash.
+
+What: /sys/devices/.../stratix10-rsu.0/driver/fail_image
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (RO) the address of failed image in flash.
+
+What: /sys/devices/.../stratix10-rsu.0/driver/state
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (RO) the state of RSU system.
+ The state field has two parts: major error code in upper 16 bits and
+ minor error code in lower 16 bits.
+
+ Major error code:
+ 0xF001 bitstream error
+ 0xF002 hardware access failure
+ 0xF003 bitstream corruption
+ 0xF004 internal error
+ 0xF005 device error
+ 0xF006 CPU watchdog timeout
+ 0xF007 internal unknown error
+ Minor error code:
+ Currently used only when major error is 0xF006
+ (CPU watchdog timeout), in which case the minor
+ error code is the value reported by CPU to
+ firmware through the RSU notify command before
+ the watchdog timeout occurs.
+
+What: /sys/devices/.../stratix10-rsu.0/driver/fail_image
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (RO) the version number of RSU firmware.
+
+What: /sys/devices/.../stratix10-rsu.0/driver/error_location
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (RO) the error offset inside the image that failed.
+
+What: /sys/devices/.../stratix10-rsu.0/driver/error_details
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (RO) error code.
+
+What: /sys/devices/.../stratix10-rsu.0/driver/reboot_image
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (WO) the address of image to be loaded on next reboot command.
+
+What: /sys/devices/.../stratix10-rsu.0/driver/notify
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (WO) inform firmware that the current software state as
+ a 16-bit numerical value below:
+ 0 is for the first stage bootloader didn't run
+ or didn't reach the point of launching second
+ stage bootloader.
+ 1 is for failed in second bootloader or didn't
+ get to the point of launching the operating
+ system.
+ 2 is for both first and second stage bootloader
+ ran and the operating system launch was
+ attempted.
+
+What: /sys/devices/.../stratix10-rsu.0/driver/watchdog
+Date: May 2019
+KernelVersion: 5.3
+Contact: Richard Gong <[email protected]>
+Description:
+ (WO) instruct firmware what to do when rebooting due to
+ a watchdog timer expiration. The attribute takes a
+ 32 bits word as the parameter indicating the action for
+ firmware to take:
+
+ b[0] is set to 0, the firmware should reboot
+ with the normal RSU flow.
+ b[0] is set to 1, the firmware shall always
+ reboot with the current running image.
+ b[31:1] reserved.
--
2.7.4


2019-05-28 23:20:37

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCHv4 3/4] firmware: rsu: document sysfs interface

On Tue, May 28, 2019 at 03:20:32PM -0500, [email protected] wrote:
> +What: /sys/devices/.../stratix10-rsu.0/driver/fail_image
> +Date: May 2019
> +KernelVersion: 5.3
> +Contact: Richard Gong <[email protected]>
> +Description:
> + (RO) the version number of RSU firmware.

"fail_image" is the version number? That doesn't match up with what the
code says :(

What happened to the version sysfs file?

thanks,

greg k-h

2019-05-29 15:23:02

by Richard Gong

[permalink] [raw]
Subject: Re: [PATCHv4 3/4] firmware: rsu: document sysfs interface


Hi Greg,

On 5/28/19 6:19 PM, Greg KH wrote:
> On Tue, May 28, 2019 at 03:20:32PM -0500, [email protected] wrote:
>> +What: /sys/devices/.../stratix10-rsu.0/driver/fail_image
>> +Date: May 2019
>> +KernelVersion: 5.3
>> +Contact: Richard Gong <[email protected]>
>> +Description:
>> + (RO) the version number of RSU firmware.
>
> "fail_image" is the version number? That doesn't match up with what the
> code says :(
>
> What happened to the version sysfs file?
>

Sorry, my typo.

It should be /sys/devices/.../stratix10-rsu.0/driver/version, (RO) the
version number of RSU firmware.

I will correct that in the next submission.

> thanks,
>
> greg k-h
>
Regards,
Richard