Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: zynqmp: Add documentation for runtime feature config

Add documentation for sysfs entries like feature_config_id and
feature_config_value for runtime feature configuration. The support is
added for an over temperature and external watchdog features.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Ronak Jain <ronak.jain@xilinx.com>
Link: https://lore.kernel.org/r/20220209082709.32378-3-ronak.jain@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ronak Jain and committed by
Greg Kroah-Hartman
de851233 f1d0821b

+141
+141
Documentation/ABI/stable/sysfs-driver-firmware-zynqmp
··· 113 113 # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/health_status 114 114 115 115 Users: Xilinx 116 + 117 + What: /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 118 + Date: Feb 2022 119 + KernelVersion: 5.18 120 + Contact: "Ronak Jain" <ronak.jain@xilinx.com> 121 + Description: 122 + This sysfs interface allows user to configure features at 123 + runtime. The user can enable or disable features running at 124 + firmware as well as the user can configure the parameters of 125 + the features at runtime. The supported features are over 126 + temperature and external watchdog. Here, the external watchdog 127 + is completely different than the /dev/watchdog as the external 128 + watchdog is running on the firmware and it is used to monitor 129 + the health of firmware not APU(Linux). Also, the external 130 + watchdog is interfaced outside of the zynqmp soc. 131 + 132 + The supported config ids are for the feature configuration is, 133 + 1. PM_FEATURE_OVERTEMP_STATUS = 1, the user can enable or 134 + disable the over temperature feature. 135 + 2. PM_FEATURE_OVERTEMP_VALUE = 2, the user can configure the 136 + over temperature limit in Degree Celsius. 137 + 3. PM_FEATURE_EXTWDT_STATUS = 3, the user can enable or disable 138 + the external watchdog feature. 139 + 4. PM_FEATURE_EXTWDT_VALUE = 4, the user can configure the 140 + external watchdog feature. 141 + 142 + Usage: 143 + 144 + Select over temperature config ID to enable/disable feature 145 + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 146 + 147 + Check over temperature config ID is selected or not 148 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 149 + The expected result is 1. 150 + 151 + Select over temperature config ID to configure OT limit 152 + # echo 2 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 153 + 154 + Check over temperature config ID is selected or not 155 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 156 + The expected result is 2. 157 + 158 + Select external watchdog config ID to enable/disable feature 159 + # echo 3 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 160 + 161 + Check external watchdog config ID is selected or not 162 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 163 + The expected result is 3. 164 + 165 + Select external watchdog config ID to configure time interval 166 + # echo 4 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 167 + 168 + Check external watchdog config ID is selected or not 169 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 170 + The expected result is 4. 171 + 172 + Users: Xilinx 173 + 174 + What: /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 175 + Date: Feb 2022 176 + KernelVersion: 5.18 177 + Contact: "Ronak Jain" <ronak.jain@xilinx.com> 178 + Description: 179 + This sysfs interface allows to configure features at runtime. 180 + The user can enable or disable features running at firmware. 181 + Also, the user can configure the parameters of the features 182 + at runtime. The supported features are over temperature and 183 + external watchdog. Here, the external watchdog is completely 184 + different than the /dev/watchdog as the external watchdog is 185 + running on the firmware and it is used to monitor the health 186 + of firmware not APU(Linux). Also, the external watchdog is 187 + interfaced outside of the zynqmp soc. 188 + 189 + By default the features are disabled in the firmware. The user 190 + can enable features by querying appropriate config id of the 191 + features. 192 + 193 + The default limit for the over temperature is 90 Degree Celsius. 194 + The default timer interval for the external watchdog is 570ms. 195 + 196 + The supported config ids are for the feature configuration is, 197 + 1. PM_FEATURE_OVERTEMP_STATUS = 1, the user can enable or 198 + disable the over temperature feature. 199 + 2. PM_FEATURE_OVERTEMP_VALUE = 2, the user can configure the 200 + over temperature limit in Degree Celsius. 201 + 3. PM_FEATURE_EXTWDT_STATUS = 3, the user can enable or disable 202 + the external watchdog feature. 203 + 4. PM_FEATURE_EXTWDT_VALUE = 4, the user can configure the 204 + external watchdog feature. 205 + 206 + Usage: 207 + 208 + Enable over temperature feature 209 + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 210 + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 211 + 212 + Check whether the over temperature feature is enabled or not 213 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 214 + The expected result is 1. 215 + 216 + Disable over temperature feature 217 + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 218 + # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 219 + 220 + Check whether the over temperature feature is disabled or not 221 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 222 + The expected result is 0. 223 + 224 + Configure over temperature limit to 50 Degree Celsius 225 + # echo 2 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 226 + # echo 50 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 227 + 228 + Check whether the over temperature limit is configured or not 229 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 230 + The expected result is 50. 231 + 232 + Enable external watchdog feature 233 + # echo 3 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 234 + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 235 + 236 + Check whether the external watchdog feature is enabled or not 237 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 238 + The expected result is 1. 239 + 240 + Disable external watchdog feature 241 + # echo 3 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 242 + # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 243 + 244 + Check whether the external watchdog feature is disabled or not 245 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 246 + The expected result is 0. 247 + 248 + Configure external watchdog timer interval to 500ms 249 + # echo 4 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id 250 + # echo 500 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 251 + 252 + Check whether the external watchdog timer interval is configured or not 253 + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value 254 + The expected result is 500. 255 + 256 + Users: Xilinx