本文整理汇总了C++中U_BOOT_CMD_MKENT函数的典型用法代码示例。如果您正苦于以下问题:C++ U_BOOT_CMD_MKENT函数的具体用法?C++ U_BOOT_CMD_MKENT怎么用?C++ U_BOOT_CMD_MKENT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了U_BOOT_CMD_MKENT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printf
printf("%c", data & (1 << i) ? '1' : '0');
printf("\n");
if (i2c_read(chip, PCA953X_OUT, 1, &data, 1))
return -1;
printf("output: ");
for (i = 7; i >= 0; i--)
printf("%c", data & (1 << i) ? '1' : '0');
printf("\n");
return 0;
}
#endif /* CONFIG_CMD_PCA953X_INFO */
cmd_tbl_t cmd_pca953x[] = {
U_BOOT_CMD_MKENT(device, 3, 0, (void *)PCA953X_CMD_DEVICE, "", ""),
U_BOOT_CMD_MKENT(output, 4, 0, (void *)PCA953X_CMD_OUTPUT, "", ""),
U_BOOT_CMD_MKENT(input, 3, 0, (void *)PCA953X_CMD_INPUT, "", ""),
U_BOOT_CMD_MKENT(invert, 4, 0, (void *)PCA953X_CMD_INVERT, "", ""),
#ifdef CONFIG_CMD_PCA953X_INFO
U_BOOT_CMD_MKENT(info, 2, 0, (void *)PCA953X_CMD_INFO, "", ""),
#endif
};
int do_pca953x(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
static uint8_t chip = CONFIG_SYS_I2C_PCA953X_ADDR;
int val;
ulong ul_arg2 = 0;
ulong ul_arg3 = 0;
cmd_tbl_t *c;
示例2: EFI_CALL
}
guid = efi_global_variable_guid;
ret = EFI_CALL(RT->set_variable(L"BootOrder", &guid,
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
size, bootorder));
ret = (ret == EFI_SUCCESS ? CMD_RET_SUCCESS : CMD_RET_FAILURE);
out:
free(bootorder);
return ret;
}
static cmd_tbl_t cmd_efidebug_boot_sub[] = {
U_BOOT_CMD_MKENT(add, CONFIG_SYS_MAXARGS, 1, do_efi_boot_add, "", ""),
U_BOOT_CMD_MKENT(rm, CONFIG_SYS_MAXARGS, 1, do_efi_boot_rm, "", ""),
U_BOOT_CMD_MKENT(dump, CONFIG_SYS_MAXARGS, 1, do_efi_boot_dump, "", ""),
U_BOOT_CMD_MKENT(next, CONFIG_SYS_MAXARGS, 1, do_efi_boot_next, "", ""),
U_BOOT_CMD_MKENT(order, CONFIG_SYS_MAXARGS, 1, do_efi_boot_order,
"", ""),
};
/**
* do_efi_boot_opt() - manage UEFI load options
*
* @cmdtp: Command table
* @flag: Command flag
* @argc: Number of arguments
* @argv: Argument array
* Return: CMD_RET_SUCCESS on success,
示例3: key_manage_query_size
ssize_t keysize = 0;
ret = key_manage_query_size(keyname, &keysize);
if (ret) {
KM_ERR("Fail in query key size, err=%d\n", ret);
return CMD_RET_FAILURE;
}
KM_MSG("key[%s] size is %zd\n", keyname, keysize);
ret = keysize ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
}
else return CMD_RET_USAGE;
return ret;
}
static cmd_tbl_t cmd_keyman_sub[] = {
U_BOOT_CMD_MKENT(init, 3, 0, do_keyman_init, "", ""),
U_BOOT_CMD_MKENT(exit, 2, 0, do_keyman_exit, "", ""),
U_BOOT_CMD_MKENT(read, 4, 0, do_keyman_read, "", ""),
U_BOOT_CMD_MKENT(write, 4, 0, do_keyman_write, "", ""),
U_BOOT_CMD_MKENT(query, 3, 0, do_keyman_query, "", ""),
};
static int do_keymanage(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
cmd_tbl_t *c;
if (argc < 2) return CMD_RET_USAGE;
c = find_cmd_tbl(argv[1], cmd_keyman_sub, ARRAY_SIZE(cmd_keyman_sub));
if (!c) { return CMD_RET_USAGE;}
示例4: printf
printf("Remote processor responds 'Pong'\n");
} else if (ret == 1) {
printf("No response from Remote processor\n");
ret = 0;
}
/* Else error.. */
}
if (ret < 0)
printf("Operation Failed with error (%d)\n", ret);
return ret ? CMD_RET_FAILURE : 0;
}
static cmd_tbl_t cmd_remoteproc_sub[] = {
U_BOOT_CMD_MKENT(init, 0, 1, do_rproc_init,
"Enumerate and initialize all processors", ""),
U_BOOT_CMD_MKENT(list, 0, 1, do_remoteproc_list,
"list remote processors", ""),
U_BOOT_CMD_MKENT(load, 5, 1, do_remoteproc_load,
"Load remote processor with provided image",
"<id> [addr] [size]\n"
"- id: ID of the remote processor(see 'list' cmd)\n"
"- addr: Address in memory of the image to loadup\n"
"- size: Size of the image to loadup\n"),
U_BOOT_CMD_MKENT(start, 1, 1, do_remoteproc_wrapper,
"Start remote processor",
"id - ID of the remote processor (see 'list' cmd)\n"),
U_BOOT_CMD_MKENT(stop, 1, 1, do_remoteproc_wrapper,
"Stop remote processor",
"id - ID of the remote processor (see 'list' cmd)\n"),
U_BOOT_CMD_MKENT(reset, 1, 1, do_remoteproc_wrapper,
示例5: printf
value = argv[2];
if (avb_ops->write_persistent_value(avb_ops, name, strlen(value) + 1,
(const uint8_t *)value) ==
AVB_IO_RESULT_OK) {
printf("Wrote %ld bytes\n", strlen(value) + 1);
return CMD_RET_SUCCESS;
}
printf("Failed to write persistent value\n");
return CMD_RET_FAILURE;
}
static cmd_tbl_t cmd_avb[] = {
U_BOOT_CMD_MKENT(init, 2, 0, do_avb_init, "", ""),
U_BOOT_CMD_MKENT(read_rb, 2, 0, do_avb_read_rb, "", ""),
U_BOOT_CMD_MKENT(write_rb, 3, 0, do_avb_write_rb, "", ""),
U_BOOT_CMD_MKENT(is_unlocked, 1, 0, do_avb_is_unlocked, "", ""),
U_BOOT_CMD_MKENT(get_uuid, 2, 0, do_avb_get_uuid, "", ""),
U_BOOT_CMD_MKENT(read_part, 5, 0, do_avb_read_part, "", ""),
U_BOOT_CMD_MKENT(read_part_hex, 4, 0, do_avb_read_part_hex, "", ""),
U_BOOT_CMD_MKENT(write_part, 5, 0, do_avb_write_part, "", ""),
U_BOOT_CMD_MKENT(verify, 1, 0, do_avb_verify_part, "", ""),
#ifdef CONFIG_OPTEE_TA_AVB
U_BOOT_CMD_MKENT(read_pvalue, 3, 0, do_avb_read_pvalue, "", ""),
U_BOOT_CMD_MKENT(write_pvalue, 3, 0, do_avb_write_pvalue, "", ""),
#endif
};
static int do_avb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
示例6: if
} else if (strcmp(argv[1], "get") == 0) {
vpu_clk_get();
} else {
ret = -1;
}
return ret;
}
static int do_vpu_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
vcbus_test();
return 0;
}
static cmd_tbl_t cmd_vpu_sub[] = {
U_BOOT_CMD_MKENT(probe, 2, 0, do_vpu_enable, "", ""),
U_BOOT_CMD_MKENT(remove, 2, 0, do_vpu_disable, "", ""),
U_BOOT_CMD_MKENT(clk, 3, 0, do_vpu_clk, "", ""),
U_BOOT_CMD_MKENT(test, 2, 0, do_vpu_test, "", ""),
};
static int do_vpu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
cmd_tbl_t *c;
/* Strip off leading 'bmp' command argument */
argc--;
argv++;
c = find_cmd_tbl(argv[0], &cmd_vpu_sub[0], ARRAY_SIZE(cmd_vpu_sub));
示例7: printf
printf("No bootstage stash area defined\n");
return 1;
}
if (0 == strcmp(argv[0], "stash"))
ret = bootstage_stash((void *)base, size);
else
ret = bootstage_unstash((void *)base, size);
if (ret)
return 1;
return 0;
}
static cmd_tbl_t cmd_bootstage_sub[] = {
U_BOOT_CMD_MKENT(report, 2, 1, do_bootstage_report, "", ""),
U_BOOT_CMD_MKENT(stash, 4, 0, do_bootstage_stash, "", ""),
U_BOOT_CMD_MKENT(unstash, 4, 0, do_bootstage_stash, "", ""),
};
/*
* Process a bootstage sub-command
*/
static int do_boostage(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
cmd_tbl_t *c;
/* Strip off leading 'bootstage' command argument */
argc--;
argv++;
示例8: simple_strtoul
addr = (volatile unsigned int *)simple_strtoul(argv[2], NULL, 10);
value = simple_strtoul(argv[3], NULL, 10);
drv->write_reg((volatile unsigned int *)addr, value);
} else if(!strcmp(argv[1], "read")) {
addr = (volatile unsigned int *)simple_strtoul(argv[2], NULL, 10);
value = simple_strtoul(argv[3], NULL, 10);
drv->read_reg((volatile unsigned int *)addr, value);
printf("read reg\n");
} else
return CMD_RET_USAGE;
return CMD_RET_SUCCESS;
}
static cmd_tbl_t cmd_ir_sub[] = {
U_BOOT_CMD_MKENT(open, 1, 1, do_ir_open, "", ""),
U_BOOT_CMD_MKENT(close, 1, 1, do_ir_close, "", ""),
U_BOOT_CMD_MKENT(test, 2, 1, do_ir_test, "", ""),
U_BOOT_CMD_MKENT(send, 2, 1, do_ir_send, "", ""),
U_BOOT_CMD_MKENT(set, 3, 1, do_ir_set, "", ""),
U_BOOT_CMD_MKENT(get, 2, 1, do_ir_get, "", ""),
U_BOOT_CMD_MKENT(reg, 4, 1, do_ir_reg, "", ""),
};
static int do_irblaster (cmd_tbl_t *cmdtp, int flag, int argc,
char *const argv[])
{
cmd_tbl_t *c;
if (argc < 2)
return CMD_RET_USAGE;
示例9: simple_strtoul
int argc, char * const argv[])
{
unsigned blocks_per_entry, max_entries;
if (argc != 3)
return CMD_RET_USAGE;
blocks_per_entry = simple_strtoul(argv[1], 0, 0);
max_entries = simple_strtoul(argv[2], 0, 0);
blkcache_configure(blocks_per_entry, max_entries);
printf("changed to max of %u entries of %u blocks each\n",
max_entries, blocks_per_entry);
return 0;
}
static cmd_tbl_t cmd_blkc_sub[] = {
U_BOOT_CMD_MKENT(show, 0, 0, blkc_show, "", ""),
U_BOOT_CMD_MKENT(configure, 3, 0, blkc_configure, "", ""),
};
static __maybe_unused void blkc_reloc(void)
{
static int relocated;
if (!relocated) {
fixup_cmdtable(cmd_blkc_sub, ARRAY_SIZE(cmd_blkc_sub));
relocated = 1;
};
}
static int do_blkcache(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
示例10: do_sandbox_ls
}
static int do_sandbox_ls(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
static int do_sandbox_save(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
return do_save(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX, 16);
}
static cmd_tbl_t cmd_sandbox_sub[] = {
U_BOOT_CMD_MKENT(load, 7, 0, do_sandbox_load, "", ""),
U_BOOT_CMD_MKENT(ls, 3, 0, do_sandbox_ls, "", ""),
U_BOOT_CMD_MKENT(save, 6, 0, do_sandbox_save, "", ""),
};
static int do_sandbox(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
cmd_tbl_t *c;
/* Skip past 'sandbox' */
argc--;
argv++;
c = find_cmd_tbl(argv[0], cmd_sandbox_sub,
ARRAY_SIZE(cmd_sandbox_sub));
示例11: printf
osd_no = -1;
printf("Current osd is %d\n", osd_no);
} else {
osd_no = simple_strtoul(argv[1], NULL, 10);
printf("Setting osd to %d\n", osd_no);
res = cmd_osd_set_osd_num(osd_no);
if (res)
printf("Failure changing osd number (err = %d)\n", res);
}
return res ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
}
static cmd_tbl_t cmd_osd_sub[] = {
U_BOOT_CMD_MKENT(show, 1, 1, do_show_osd, "", ""),
U_BOOT_CMD_MKENT(dev, 1, 1, do_osd_num, "", ""),
U_BOOT_CMD_MKENT(write, 4, 1, do_osd_write, "", ""),
U_BOOT_CMD_MKENT(print, 4, 1, do_osd_print, "", ""),
U_BOOT_CMD_MKENT(size, 2, 1, do_osd_size, "", ""),
};
static int do_osd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
cmd_tbl_t *c;
if (argc < 2)
return CMD_RET_USAGE;
/* Strip off leading 'osd' command argument */
argc--;
示例12: do_sandbox_load
#include <fs.h>
static int do_sandbox_load(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
return do_load(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX, 16);
}
static int do_sandbox_ls(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
static cmd_tbl_t cmd_sandbox_sub[] = {
U_BOOT_CMD_MKENT(load, 3, 0, do_sandbox_load, "", ""),
U_BOOT_CMD_MKENT(ls, 3, 0, do_sandbox_ls, "", ""),
};
static int do_sandbox(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
cmd_tbl_t *c;
/* Skip past 'sandbox' */
argc--;
argv++;
c = find_cmd_tbl(argv[0], cmd_sandbox_sub,
ARRAY_SIZE(cmd_sandbox_sub));
示例13: simple_strtoul
case 4:
addr = simple_strtoul(argv[1], NULL, 16);
x = simple_strtoul(argv[2], NULL, 10);
y = simple_strtoul(argv[3], NULL, 10);
break;
default:
return CMD_RET_USAGE;
}
ret = video_display_bitmap((unsigned long)addr, x, y);
return ret;
}
static cmd_tbl_t cmd_osd_sub[] = {
U_BOOT_CMD_MKENT(open, 2, 0, do_osd_open, "", ""),
U_BOOT_CMD_MKENT(enable, 2, 0, do_osd_enable, "", ""),
U_BOOT_CMD_MKENT(close, 2, 0, do_osd_close, "", ""),
U_BOOT_CMD_MKENT(clear, 2, 0, do_osd_clear, "", ""),
U_BOOT_CMD_MKENT(debug, 2, 0, do_osd_debug, "", ""),
U_BOOT_CMD_MKENT(test, 2, 0, do_osd_test, "", ""),
U_BOOT_CMD_MKENT(display, 5, 0, do_osd_display, "", ""),
};
static int do_osd(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
cmd_tbl_t *c;
/* Strip off leading 'osd' command argument */
argc--;
argv++;
示例14: store_dbg
store_dbg("command: %s\n", str);
ret = run_command(str, 0);
if (ret != 0) {
store_msg("amlmmc cmd %s failed \n",cmd);
return -1;
}
return ret;
}else{
store_dbg("CARD BOOT, %s %d ",__func__,__LINE__);
return CMD_RET_FAILURE;
}
return ret;
}
static cmd_tbl_t cmd_store_sub[] = {
U_BOOT_CMD_MKENT(init, 4, 0, do_store_init, "", ""),
U_BOOT_CMD_MKENT(exit, 3, 0, do_store_exit, "", ""),
U_BOOT_CMD_MKENT(disprotect, 3, 0, do_store_disprotect, "", ""),
U_BOOT_CMD_MKENT(rom_protect, 5, 0, do_store_rom_protect, "", ""),
U_BOOT_CMD_MKENT(size, 5, 0, do_store_size, "", ""),
U_BOOT_CMD_MKENT(scrub, 3, 0, do_store_scrub, "", ""),
U_BOOT_CMD_MKENT(erase, 5, 0, do_store_erase, "", ""),
U_BOOT_CMD_MKENT(read, 6, 0, do_store_read, "", ""),
U_BOOT_CMD_MKENT(write, 6, 0, do_store_write, "", ""),
U_BOOT_CMD_MKENT(rom_read, 5, 0, do_store_rom_read, "", ""),
U_BOOT_CMD_MKENT(rom_write, 5, 0, do_store_rom_write, "", ""),
U_BOOT_CMD_MKENT(dtb, 5, 0, do_store_dtb_ops, "", ""),
U_BOOT_CMD_MKENT(key, 5, 0, do_store_key_ops, "", ""),
};
static int do_store(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
示例15: printf
printf("\n");
printf("read ");
tmp = ds4510_gpio_read_val(chip);
if (tmp == -1)
return -1;
for (i = DS4510_NUM_IO - 1; i >= 0; i--)
printf("%d", (tmp & (1 << i)) ? 1 : 0);
printf("\n");
return 0;
}
#endif /* CONFIG_CMD_DS4510_INFO */
cmd_tbl_t cmd_ds4510[] = {
U_BOOT_CMD_MKENT(device, 3, 0, (void *)DS4510_CMD_DEVICE, "", ""),
U_BOOT_CMD_MKENT(nv, 3, 0, (void *)DS4510_CMD_NV, "", ""),
U_BOOT_CMD_MKENT(output, 4, 0, (void *)DS4510_CMD_OUTPUT, "", ""),
U_BOOT_CMD_MKENT(input, 3, 0, (void *)DS4510_CMD_INPUT, "", ""),
U_BOOT_CMD_MKENT(pullup, 4, 0, (void *)DS4510_CMD_PULLUP, "", ""),
#ifdef CONFIG_CMD_DS4510_INFO
U_BOOT_CMD_MKENT(info, 2, 0, (void *)DS4510_CMD_INFO, "", ""),
#endif
#ifdef CONFIG_CMD_DS4510_RST
U_BOOT_CMD_MKENT(rstdelay, 3, 0, (void *)DS4510_CMD_RSTDELAY, "", ""),
#endif
#ifdef CONFIG_CMD_DS4510_MEM
U_BOOT_CMD_MKENT(eeprom, 6, 0, (void *)DS4510_CMD_EEPROM, "", ""),
U_BOOT_CMD_MKENT(seeprom, 6, 0, (void *)DS4510_CMD_SEEPROM, "", ""),
U_BOOT_CMD_MKENT(sram, 6, 0, (void *)DS4510_CMD_SRAM, "", ""),
#endif