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",
135 ((ETH_ALEN * 2) + (ETH_ALEN - 1))
156 return -EINVAL; in mlxbf_bootctl_reset_action_to_val()
317 for (key = MLXBF_SB_KEY_NUM - 1; key >= 0; key--) { in secure_boot_fuse_state_show()
354 return -EINVAL; in fw_reset_store()
359 /* Size(8-byte words) of the log buffer. */
383 size_t size = count; in rsh_log_store() local
386 if (!size) in rsh_log_store()
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()
399 if (len + 1 < size && in rsh_log_store()
402 size -= len; in rsh_log_store()
409 while (size > 0 && buf[0] == ' ') { in rsh_log_store()
410 size--; in rsh_log_store()
421 num = min((int)DIV_ROUND_UP(size, sizeof(u64)), in rsh_log_store()
422 RSH_SCRATCH_BUF_CTL_IDX_MASK - idx - 1); in rsh_log_store()
433 for (idx = 0; idx < num && size > 0; idx++) { in rsh_log_store()
434 if (size < sizeof(u64)) { in rsh_log_store()
436 memcpy(&data, buf, size); in rsh_log_store()
437 size = 0; in rsh_log_store()
440 size -= sizeof(u64); in rsh_log_store()
464 return -EPERM; in large_icm_show()
483 return -EPERM; in large_icm_store()
489 return res.a0 ? -EPERM : count; in large_icm_store()
505 return -EINVAL; in os_up_store()
525 return -EPERM; in oob_mac_show()
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()
569 int word; in opn_show() local
572 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(OPN); word++) { in opn_show()
574 MLNX_MFG_TYPE_OPN_0 + word, in opn_show()
578 return -EPERM; in opn_show()
580 opn_data[word] = res.a1; in opn_show()
593 int word; in opn_store() local
596 return -EINVAL; in opn_store()
601 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(OPN); word++) { in opn_store()
603 MLNX_MFG_TYPE_OPN_0 + word, in opn_store()
604 sizeof(u64), opn[word], 0, 0, 0, 0, &res); in opn_store()
607 return -EPERM; in opn_store()
620 int word; in sku_show() local
623 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SKU); word++) { in sku_show()
625 MLNX_MFG_TYPE_SKU_0 + word, in sku_show()
629 return -EPERM; in sku_show()
631 sku_data[word] = res.a1; in sku_show()
644 int word; in sku_store() local
647 return -EINVAL; in sku_store()
652 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SKU); word++) { in sku_store()
654 MLNX_MFG_TYPE_SKU_0 + word, in sku_store()
655 sizeof(u64), sku[word], 0, 0, 0, 0, &res); in sku_store()
658 return -EPERM; in sku_store()
671 int word; in modl_show() local
674 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(MODL); word++) { in modl_show()
676 MLNX_MFG_TYPE_MODL_0 + word, in modl_show()
680 return -EPERM; in modl_show()
682 modl_data[word] = res.a1; in modl_show()
695 int word; in modl_store() local
698 return -EINVAL; in modl_store()
703 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(MODL); word++) { in modl_store()
705 MLNX_MFG_TYPE_MODL_0 + word, in modl_store()
706 sizeof(u64), modl[word], 0, 0, 0, 0, &res); in modl_store()
709 return -EPERM; in modl_store()
722 int word; in sn_show() local
725 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SN); word++) { in sn_show()
727 MLNX_MFG_TYPE_SN_0 + word, in sn_show()
731 return -EPERM; in sn_show()
733 sn_data[word] = res.a1; in sn_show()
746 int word; in sn_store() local
749 return -EINVAL; in sn_store()
754 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SN); word++) { in sn_store()
756 MLNX_MFG_TYPE_SN_0 + word, in sn_store()
757 sizeof(u64), sn[word], 0, 0, 0, 0, &res); in sn_store()
760 return -EPERM; in sn_store()
773 int word; in uuid_show() local
776 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(UUID); word++) { in uuid_show()
778 MLNX_MFG_TYPE_UUID_0 + word, in uuid_show()
782 return -EPERM; in uuid_show()
784 uuid_data[word] = res.a1; in uuid_show()
797 int word; in uuid_store() local
800 return -EINVAL; in uuid_store()
805 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(UUID); word++) { in uuid_store()
807 MLNX_MFG_TYPE_UUID_0 + word, in uuid_store()
808 sizeof(u64), uuid[word], 0, 0, 0, 0, &res); in uuid_store()
811 return -EPERM; in uuid_store()
824 int word; in rev_show() local
827 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(REV); word++) { in rev_show()
829 MLNX_MFG_TYPE_REV + word, in rev_show()
833 return -EPERM; in rev_show()
835 rev_data[word] = res.a1; in rev_show()
848 int word; in rev_store() local
851 return -EINVAL; in rev_store()
856 for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(REV); word++) { in rev_store()
858 MLNX_MFG_TYPE_REV + word, in rev_store()
859 sizeof(u64), rev[word], 0, 0, 0, 0, &res); in rev_store()
862 return -EPERM; in rev_store()
883 return -EINVAL; in mfg_lock_store()
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()
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",