Lines Matching +full:word +full:- +full:size

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";
54 [MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE] = "GA Non-Secured",
136 ((ETH_ALEN * 2) + (ETH_ALEN - 1))
157 return -EINVAL; in mlxbf_bootctl_reset_action_to_val()
318 for (key = MLXBF_SB_KEY_NUM - 1; key >= 0; key--) { in secure_boot_fuse_state_show()
355 return -EINVAL; in fw_reset_store()
360 /* Size(8-byte words) of the log buffer. */
384 size_t size = count; in rsh_log_store() local
387 if (!size) in rsh_log_store()
388 return -EINVAL; in rsh_log_store()
391 return -EOPNOTSUPP; in rsh_log_store()
394 if (buf[size - 1] == '\n') in rsh_log_store()
395 size--; in rsh_log_store()
400 if (len + 1 < size && in rsh_log_store()
403 size -= len; in rsh_log_store()
410 while (size > 0 && buf[0] == ' ') { in rsh_log_store()
411 size--; in rsh_log_store()
422 num = min((int)DIV_ROUND_UP(size, sizeof(u64)), in rsh_log_store()
423 RSH_SCRATCH_BUF_CTL_IDX_MASK - idx - 1); in rsh_log_store()
434 for (idx = 0; idx < num && size > 0; idx++) { in rsh_log_store()
435 if (size < sizeof(u64)) { in rsh_log_store()
437 memcpy(&data, buf, size); in rsh_log_store()
438 size = 0; in rsh_log_store()
441 size -= sizeof(u64); in rsh_log_store()
465 return -EPERM; in large_icm_show()
484 return -EPERM; in large_icm_store()
490 return res.a0 ? -EPERM : count; in large_icm_store()
505 return -EPERM; in rtc_battery_show()
523 return -EINVAL; in os_up_store()
543 return -EPERM; in oob_mac_show()
560 if ((count - 1) != MLNX_MFG_OOB_MAC_FORMAT_LEN) in oob_mac_store()
561 return -EINVAL; in oob_mac_store()
567 return -EINVAL; in oob_mac_store()
579 return res.a0 ? -EPERM : count; in oob_mac_store()
587 int word; in opn_show() local
590 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(OPN); word++) { in opn_show()
592 MLNX_MFG_TYPE_OPN_0 + word, in opn_show()
596 return -EPERM; in opn_show()
598 opn_data[word] = res.a1; in opn_show()
611 int word; in opn_store() local
614 return -EINVAL; in opn_store()
619 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(OPN); word++) { in opn_store()
621 MLNX_MFG_TYPE_OPN_0 + word, in opn_store()
622 sizeof(u64), opn[word], 0, 0, 0, 0, &res); in opn_store()
625 return -EPERM; in opn_store()
638 int word; in sku_show() local
641 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SKU); word++) { in sku_show()
643 MLNX_MFG_TYPE_SKU_0 + word, in sku_show()
647 return -EPERM; in sku_show()
649 sku_data[word] = res.a1; in sku_show()
662 int word; in sku_store() local
665 return -EINVAL; in sku_store()
670 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SKU); word++) { in sku_store()
672 MLNX_MFG_TYPE_SKU_0 + word, in sku_store()
673 sizeof(u64), sku[word], 0, 0, 0, 0, &res); in sku_store()
676 return -EPERM; in sku_store()
689 int word; in modl_show() local
692 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(MODL); word++) { in modl_show()
694 MLNX_MFG_TYPE_MODL_0 + word, in modl_show()
698 return -EPERM; in modl_show()
700 modl_data[word] = res.a1; in modl_show()
713 int word; in modl_store() local
716 return -EINVAL; in modl_store()
721 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(MODL); word++) { in modl_store()
723 MLNX_MFG_TYPE_MODL_0 + word, in modl_store()
724 sizeof(u64), modl[word], 0, 0, 0, 0, &res); in modl_store()
727 return -EPERM; in modl_store()
740 int word; in sn_show() local
743 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SN); word++) { in sn_show()
745 MLNX_MFG_TYPE_SN_0 + word, in sn_show()
749 return -EPERM; in sn_show()
751 sn_data[word] = res.a1; in sn_show()
764 int word; in sn_store() local
767 return -EINVAL; in sn_store()
772 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SN); word++) { in sn_store()
774 MLNX_MFG_TYPE_SN_0 + word, in sn_store()
775 sizeof(u64), sn[word], 0, 0, 0, 0, &res); in sn_store()
778 return -EPERM; in sn_store()
791 int word; in uuid_show() local
794 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(UUID); word++) { in uuid_show()
796 MLNX_MFG_TYPE_UUID_0 + word, in uuid_show()
800 return -EPERM; in uuid_show()
802 uuid_data[word] = res.a1; in uuid_show()
815 int word; in uuid_store() local
818 return -EINVAL; in uuid_store()
823 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(UUID); word++) { in uuid_store()
825 MLNX_MFG_TYPE_UUID_0 + word, in uuid_store()
826 sizeof(u64), uuid[word], 0, 0, 0, 0, &res); in uuid_store()
829 return -EPERM; in uuid_store()
842 int word; in rev_show() local
845 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(REV); word++) { in rev_show()
847 MLNX_MFG_TYPE_REV + word, in rev_show()
851 return -EPERM; in rev_show()
853 rev_data[word] = res.a1; in rev_show()
866 int word; in rev_store() local
869 return -EINVAL; in rev_store()
874 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(REV); word++) { in rev_store()
876 MLNX_MFG_TYPE_REV + word, in rev_store()
877 sizeof(u64), rev[word], 0, 0, 0, 0, &res); in rev_store()
880 return -EPERM; in rev_store()
901 return -EINVAL; in mfg_lock_store()
985 count -= sizeof(data); in mlxbf_bootctl_bootfifo_read()
987 cnt--; in mlxbf_bootctl_bootfifo_read()
991 return p - buf; in mlxbf_bootctl_bootfifo_read()
1002 guid_t id = GUID_INIT(res->a0, res->a1, res->a1 >> 16, in mlxbf_bootctl_guid_match()
1003 res->a2, res->a2 >> 8, res->a2 >> 16, in mlxbf_bootctl_guid_match()
1004 res->a2 >> 24, res->a3, res->a3 >> 8, in mlxbf_bootctl_guid_match()
1005 res->a3 >> 16, res->a3 >> 24); in mlxbf_bootctl_guid_match()
1043 return -ENODEV; in mlxbf_bootctl_probe()
1054 dev_warn(&pdev->dev, "Unable to reset the EMMC boot mode\n"); in mlxbf_bootctl_probe()
1056 ret = sysfs_create_bin_file(&pdev->dev.kobj, in mlxbf_bootctl_probe()
1066 sysfs_remove_bin_file(&pdev->dev.kobj, in mlxbf_bootctl_remove()
1074 .name = "mlxbf-bootctl",