projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
efi_loader: use logical and in do_env_print_efi()
[oweals/u-boot.git]
/
cmd
/
cbfs.c
diff --git
a/cmd/cbfs.c
b/cmd/cbfs.c
index 779e9c043bdcc585cc04469e2cce952d29513edf..98e652a4e7bf26b4c58934683a3b142ed5c30af2 100644
(file)
--- a/
cmd/cbfs.c
+++ b/
cmd/cbfs.c
@@
-1,7
+1,6
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
/*
* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
/*
*/
/*
@@
-9,9
+8,11
@@
*/
#include <common.h>
#include <command.h>
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <cbfs.h>
#include <cbfs.h>
-int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc,
+ char *const argv[])
{
uintptr_t end_of_rom = 0xffffffff;
char *ep;
{
uintptr_t end_of_rom = 0xffffffff;
char *ep;
@@
-21,14
+22,14
@@
int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
if (argc == 2) {
return 0;
}
if (argc == 2) {
- end_of_rom =
(int)
simple_strtoul(argv[1], &ep, 16);
+ end_of_rom = simple_strtoul(argv[1], &ep, 16);
if (*ep) {
puts("\n** Invalid end of ROM **\n");
return 1;
}
}
file_cbfs_init(end_of_rom);
if (*ep) {
puts("\n** Invalid end of ROM **\n");
return 1;
}
}
file_cbfs_init(end_of_rom);
- if (
file_cbfs_result
!= CBFS_SUCCESS) {
+ if (
cbfs_get_result()
!= CBFS_SUCCESS) {
printf("%s.\n", file_cbfs_error());
return 1;
}
printf("%s.\n", file_cbfs_error());
return 1;
}
@@
-44,7
+45,8
@@
U_BOOT_CMD(
" CBFS is in. It defaults to 0xFFFFFFFF\n"
);
" CBFS is in. It defaults to 0xFFFFFFFF\n"
);
-int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc,
+ char *const argv[])
{
const struct cbfs_cachenode *file;
unsigned long offset;
{
const struct cbfs_cachenode *file;
unsigned long offset;
@@
-65,7
+67,7
@@
int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
file = file_cbfs_find(argv[2]);
if (!file) {
file = file_cbfs_find(argv[2]);
if (!file) {
- if (
file_cbfs_result
== CBFS_FILE_NOT_FOUND)
+ if (
cbfs_get_result()
== CBFS_FILE_NOT_FOUND)
printf("%s: %s\n", file_cbfs_error(), argv[2]);
else
printf("%s.\n", file_cbfs_error());
printf("%s: %s\n", file_cbfs_error(), argv[2]);
else
printf("%s.\n", file_cbfs_error());
@@
-78,7
+80,7
@@
int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
printf("\n%ld bytes read\n", size);
printf("\n%ld bytes read\n", size);
-
setenv
_hex("filesize", size);
+
env_set
_hex("filesize", size);
return 0;
}
return 0;
}
@@
-90,7
+92,8
@@
U_BOOT_CMD(
" - load binary file 'filename' from the cbfs to address 'addr'\n"
);
" - load binary file 'filename' from the cbfs to address 'addr'\n"
);
-int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc,
+ char *const argv[])
{
const struct cbfs_cachenode *file = file_cbfs_get_first();
int files = 0;
{
const struct cbfs_cachenode *file = file_cbfs_get_first();
int files = 0;
@@
-110,12
+113,21
@@
int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
printf(" %8d", file_cbfs_size(file));
switch (type) {
printf(" %8d", file_cbfs_size(file));
switch (type) {
+ case CBFS_TYPE_BOOTBLOCK:
+ type_name = "bootblock";
+ break;
+ case CBFS_TYPE_CBFSHEADER:
+ type_name = "cbfs header";
+ break;
case CBFS_TYPE_STAGE:
type_name = "stage";
break;
case CBFS_TYPE_PAYLOAD:
type_name = "payload";
break;
case CBFS_TYPE_STAGE:
type_name = "stage";
break;
case CBFS_TYPE_PAYLOAD:
type_name = "payload";
break;
+ case CBFS_TYPE_FIT:
+ type_name = "fit";
+ break;
case CBFS_TYPE_OPTIONROM:
type_name = "option rom";
break;
case CBFS_TYPE_OPTIONROM:
type_name = "option rom";
break;
@@
-134,10
+146,31
@@
int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
case CBFS_TYPE_MICROCODE:
type_name = "microcode";
break;
case CBFS_TYPE_MICROCODE:
type_name = "microcode";
break;
- case CBFS_COMPONENT_CMOS_DEFAULT:
+ case CBFS_TYPE_FSP:
+ type_name = "fsp";
+ break;
+ case CBFS_TYPE_MRC:
+ type_name = "mrc";
+ break;
+ case CBFS_TYPE_MMA:
+ type_name = "mma";
+ break;
+ case CBFS_TYPE_EFI:
+ type_name = "efi";
+ break;
+ case CBFS_TYPE_STRUCT:
+ type_name = "struct";
+ break;
+ case CBFS_TYPE_CMOS_DEFAULT:
type_name = "cmos default";
break;
type_name = "cmos default";
break;
- case CBFS_COMPONENT_CMOS_LAYOUT:
+ case CBFS_TYPE_SPD:
+ type_name = "spd";
+ break;
+ case CBFS_TYPE_MRC_CACHE:
+ type_name = "mrc cache";
+ break;
+ case CBFS_TYPE_CMOS_LAYOUT:
type_name = "cmos layout";
break;
case -1:
type_name = "cmos layout";
break;
case -1:
@@
-168,7
+201,8
@@
U_BOOT_CMD(
" - list the files in the cbfs\n"
);
" - list the files in the cbfs\n"
);
-int do_cbfs_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_cbfs_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
+ char *const argv[])
{
const struct cbfs_header *header = file_cbfs_get_header();
{
const struct cbfs_header *header = file_cbfs_get_header();