Lines Matching +full:attr +full:- +full:cnt +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0+
6 * software to manage reset-time actions.
12 #include <linux/arm-smccc.h>
19 #include "mlxbf-bootctl.h"
29 "89c036b4-e7d7-11e6-8797-001aca00bfc4";
33 const char *name; member
54 [MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE] = "GA Non-Secured",
135 ((ETH_ALEN * 2) + (ETH_ALEN - 1))
153 if (sysfs_streq(boot_names[i].name, action)) in mlxbf_bootctl_reset_action_to_val()
156 return -EINVAL; in mlxbf_bootctl_reset_action_to_val()
166 return boot_names[i].name; in mlxbf_bootctl_action_to_string()
172 struct device_attribute *attr, char *buf) in post_reset_wdog_show() argument
184 struct device_attribute *attr, in post_reset_wdog_store() argument
228 struct device_attribute *attr, char *buf) in reset_action_show() argument
234 struct device_attribute *attr, in reset_action_store() argument
241 struct device_attribute *attr, in second_reset_action_show() argument
248 struct device_attribute *attr, in second_reset_action_store() argument
256 struct device_attribute *attr, char *buf) in lifecycle_state_show() argument
288 struct device_attribute *attr, in secure_boot_fuse_state_show() argument
317 for (key = MLXBF_SB_KEY_NUM - 1; key >= 0; key--) { in secure_boot_fuse_state_show()
343 struct device_attribute *attr, in fw_reset_store() argument
354 return -EINVAL; in fw_reset_store()
359 /* Size(8-byte words) of the log buffer. */
379 struct device_attribute *attr, in rsh_log_store() argument
387 return -EINVAL; in rsh_log_store()
390 return -EOPNOTSUPP; in rsh_log_store()
393 if (buf[size - 1] == '\n') in rsh_log_store()
394 size--; in rsh_log_store()
402 size -= len; in rsh_log_store()
410 size--; in rsh_log_store()
422 RSH_SCRATCH_BUF_CTL_IDX_MASK - idx - 1); in rsh_log_store()
440 size -= sizeof(u64); in rsh_log_store()
455 struct device_attribute *attr, char *buf) in large_icm_show() argument
464 return -EPERM; in large_icm_show()
470 struct device_attribute *attr, in large_icm_store() argument
483 return -EPERM; in large_icm_store()
489 return res.a0 ? -EPERM : count; in large_icm_store()
493 struct device_attribute *attr, in os_up_store() argument
505 return -EINVAL; in os_up_store()
515 struct device_attribute *attr, char *buf) in oob_mac_show() argument
525 return -EPERM; in oob_mac_show()
533 struct device_attribute *attr, in oob_mac_store() argument
542 if ((count - 1) != MLNX_MFG_OOB_MAC_FORMAT_LEN) in oob_mac_store()
543 return -EINVAL; in oob_mac_store()
549 return -EINVAL; in oob_mac_store()
561 return res.a0 ? -EPERM : count; in oob_mac_store()
565 struct device_attribute *attr, char *buf) in opn_show() argument
578 return -EPERM; in opn_show()
588 struct device_attribute *attr, in opn_store() argument
596 return -EINVAL; in opn_store()
607 return -EPERM; in opn_store()
616 struct device_attribute *attr, char *buf) in sku_show() argument
629 return -EPERM; in sku_show()
639 struct device_attribute *attr, in sku_store() argument
647 return -EINVAL; in sku_store()
658 return -EPERM; in sku_store()
667 struct device_attribute *attr, char *buf) in modl_show() argument
680 return -EPERM; in modl_show()
690 struct device_attribute *attr, in modl_store() argument
698 return -EINVAL; in modl_store()
709 return -EPERM; in modl_store()
718 struct device_attribute *attr, char *buf) in sn_show() argument
731 return -EPERM; in sn_show()
741 struct device_attribute *attr, in sn_store() argument
749 return -EINVAL; in sn_store()
760 return -EPERM; in sn_store()
769 struct device_attribute *attr, char *buf) in uuid_show() argument
782 return -EPERM; in uuid_show()
792 struct device_attribute *attr, in uuid_store() argument
800 return -EINVAL; in uuid_store()
811 return -EPERM; in uuid_store()
820 struct device_attribute *attr, char *buf) in rev_show() argument
833 return -EPERM; in rev_show()
843 struct device_attribute *attr, in rev_store() argument
851 return -EINVAL; in rev_store()
862 return -EPERM; in rev_store()
871 struct device_attribute *attr, in mfg_lock_store() argument
883 return -EINVAL; in mfg_lock_store()
911 &dev_attr_post_reset_wdog.attr,
912 &dev_attr_reset_action.attr,
913 &dev_attr_second_reset_action.attr,
914 &dev_attr_lifecycle_state.attr,
915 &dev_attr_secure_boot_fuse_state.attr,
916 &dev_attr_fw_reset.attr,
917 &dev_attr_rsh_log.attr,
918 &dev_attr_large_icm.attr,
919 &dev_attr_os_up.attr,
920 &dev_attr_oob_mac.attr,
921 &dev_attr_opn.attr,
922 &dev_attr_sku.attr,
923 &dev_attr_modl.attr,
924 &dev_attr_sn.attr,
925 &dev_attr_uuid.attr,
926 &dev_attr_rev.attr,
927 &dev_attr_mfg_lock.attr,
948 u64 data, cnt = 0; in mlxbf_bootctl_bootfifo_read() local
953 if (!cnt) { in mlxbf_bootctl_bootfifo_read()
954 cnt = readq(mlxbf_rsh_boot_cnt); in mlxbf_bootctl_bootfifo_read()
955 if (!cnt) { in mlxbf_bootctl_bootfifo_read()
965 count -= sizeof(data); in mlxbf_bootctl_bootfifo_read()
967 cnt--; in mlxbf_bootctl_bootfifo_read()
971 return p - buf; in mlxbf_bootctl_bootfifo_read()
975 .attr = { .name = "bootfifo", .mode = 0400 },
982 guid_t id = GUID_INIT(res->a0, res->a1, res->a1 >> 16, in mlxbf_bootctl_guid_match()
983 res->a2, res->a2 >> 8, res->a2 >> 16, in mlxbf_bootctl_guid_match()
984 res->a2 >> 24, res->a3, res->a3 >> 8, in mlxbf_bootctl_guid_match()
985 res->a3 >> 16, res->a3 >> 24); in mlxbf_bootctl_guid_match()
1023 return -ENODEV; in mlxbf_bootctl_probe()
1034 dev_warn(&pdev->dev, "Unable to reset the EMMC boot mode\n"); in mlxbf_bootctl_probe()
1036 ret = sysfs_create_bin_file(&pdev->dev.kobj, in mlxbf_bootctl_probe()
1046 sysfs_remove_bin_file(&pdev->dev.kobj, in mlxbf_bootctl_remove()
1054 .name = "mlxbf-bootctl",