cbfs: Rename CBFS_TYPE_PAYLOAD to CBFS_TYPE_SELF
In preparation of having FIT payloads, which aren't converted to simple ELF, rename the CBFS type payload to actually show the format the payload is encoded in. Another type CBFS_TYPE_FIT will be added to have two different payload formats. For now this is only a cosmetic change. Change-Id: I39ee590d063b3e90f6153fe655aa50e58d45e8b0 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/25986 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
41aa5ec2d6
commit
4f5bed5210
|
@ -28,7 +28,7 @@
|
||||||
#define COMPONENT_BOOTBLOCK 0x01
|
#define COMPONENT_BOOTBLOCK 0x01
|
||||||
#define COMPONENT_CBFSHEADER 0x02
|
#define COMPONENT_CBFSHEADER 0x02
|
||||||
#define COMPONENT_STAGE 0x10
|
#define COMPONENT_STAGE 0x10
|
||||||
#define COMPONENT_PAYLOAD 0x20
|
#define COMPONENT_SELF 0x20
|
||||||
#define COMPONENT_OPTIONROM 0x30
|
#define COMPONENT_OPTIONROM 0x30
|
||||||
#define COMPONENT_RAW 0x50
|
#define COMPONENT_RAW 0x50
|
||||||
#define COMPONENT_MICROCODE 0x53
|
#define COMPONENT_MICROCODE 0x53
|
||||||
|
@ -187,8 +187,8 @@ static int cbfs_module_redraw(WINDOW * win)
|
||||||
case COMPONENT_STAGE:
|
case COMPONENT_STAGE:
|
||||||
mvwprintw(win, row++, 38, "stage");
|
mvwprintw(win, row++, 38, "stage");
|
||||||
break;
|
break;
|
||||||
case COMPONENT_PAYLOAD:
|
case COMPONENT_SELF:
|
||||||
mvwprintw(win, row++, 38, "payload");
|
mvwprintw(win, row++, 38, "simple ELF");
|
||||||
break;
|
break;
|
||||||
case COMPONENT_OPTIONROM:
|
case COMPONENT_OPTIONROM:
|
||||||
mvwprintw(win, row++, 38, "optionrom");
|
mvwprintw(win, row++, 38, "optionrom");
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
components */
|
components */
|
||||||
|
|
||||||
#define CBFS_TYPE_STAGE 0x10
|
#define CBFS_TYPE_STAGE 0x10
|
||||||
#define CBFS_TYPE_PAYLOAD 0x20
|
#define CBFS_TYPE_SELF 0x20
|
||||||
#define CBFS_TYPE_OPTIONROM 0x30
|
#define CBFS_TYPE_OPTIONROM 0x30
|
||||||
#define CBFS_TYPE_BOOTSPLASH 0x40
|
#define CBFS_TYPE_BOOTSPLASH 0x40
|
||||||
#define CBFS_TYPE_RAW 0x50
|
#define CBFS_TYPE_RAW 0x50
|
||||||
|
|
|
@ -158,7 +158,7 @@ int cbfs_execute_stage(struct cbfs_media *media, const char *name)
|
||||||
void *cbfs_load_payload(struct cbfs_media *media, const char *name)
|
void *cbfs_load_payload(struct cbfs_media *media, const char *name)
|
||||||
{
|
{
|
||||||
return (struct cbfs_payload *)cbfs_get_file_content(
|
return (struct cbfs_payload *)cbfs_get_file_content(
|
||||||
media, name, CBFS_TYPE_PAYLOAD, NULL);
|
media, name, CBFS_TYPE_SELF, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct cbfs_file *cbfs_find(const char *name) {
|
struct cbfs_file *cbfs_find(const char *name) {
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
#define CBFS_TYPE_DELETED 0x00000000
|
#define CBFS_TYPE_DELETED 0x00000000
|
||||||
#define CBFS_TYPE_DELETED2 0xffffffff
|
#define CBFS_TYPE_DELETED2 0xffffffff
|
||||||
#define CBFS_TYPE_STAGE 0x10
|
#define CBFS_TYPE_STAGE 0x10
|
||||||
#define CBFS_TYPE_PAYLOAD 0x20
|
#define CBFS_TYPE_SELF 0x20
|
||||||
#define CBFS_TYPE_OPTIONROM 0x30
|
#define CBFS_TYPE_OPTIONROM 0x30
|
||||||
#define CBFS_TYPE_BOOTSPLASH 0x40
|
#define CBFS_TYPE_BOOTSPLASH 0x40
|
||||||
#define CBFS_TYPE_RAW 0x50
|
#define CBFS_TYPE_RAW 0x50
|
||||||
|
|
|
@ -171,7 +171,7 @@ struct cbfs_payload {
|
||||||
#define CBFS_COMPONENT_BOOTBLOCK 0x01
|
#define CBFS_COMPONENT_BOOTBLOCK 0x01
|
||||||
#define CBFS_COMPONENT_CBFSHEADER 0x02
|
#define CBFS_COMPONENT_CBFSHEADER 0x02
|
||||||
#define CBFS_COMPONENT_STAGE 0x10
|
#define CBFS_COMPONENT_STAGE 0x10
|
||||||
#define CBFS_COMPONENT_PAYLOAD 0x20
|
#define CBFS_COMPONENT_SELF 0x20
|
||||||
#define CBFS_COMPONENT_OPTIONROM 0x30
|
#define CBFS_COMPONENT_OPTIONROM 0x30
|
||||||
#define CBFS_COMPONENT_BOOTSPLASH 0x40
|
#define CBFS_COMPONENT_BOOTSPLASH 0x40
|
||||||
#define CBFS_COMPONENT_RAW 0x50
|
#define CBFS_COMPONENT_RAW 0x50
|
||||||
|
@ -204,7 +204,7 @@ static struct typedesc_t filetypes[] unused = {
|
||||||
{CBFS_COMPONENT_BOOTBLOCK, "bootblock"},
|
{CBFS_COMPONENT_BOOTBLOCK, "bootblock"},
|
||||||
{CBFS_COMPONENT_CBFSHEADER, "cbfs header"},
|
{CBFS_COMPONENT_CBFSHEADER, "cbfs header"},
|
||||||
{CBFS_COMPONENT_STAGE, "stage"},
|
{CBFS_COMPONENT_STAGE, "stage"},
|
||||||
{CBFS_COMPONENT_PAYLOAD, "payload"},
|
{CBFS_COMPONENT_SELF, "simple elf"},
|
||||||
{CBFS_COMPONENT_OPTIONROM, "optionrom"},
|
{CBFS_COMPONENT_OPTIONROM, "optionrom"},
|
||||||
{CBFS_COMPONENT_BOOTSPLASH, "bootsplash"},
|
{CBFS_COMPONENT_BOOTSPLASH, "bootsplash"},
|
||||||
{CBFS_COMPONENT_RAW, "raw"},
|
{CBFS_COMPONENT_RAW, "raw"},
|
||||||
|
|
|
@ -1328,7 +1328,7 @@ int cbfs_export_entry(struct cbfs_image *image, const char *entry_name,
|
||||||
buffer_delete(&buffer);
|
buffer_delete(&buffer);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else if (ntohl(entry->type) == CBFS_COMPONENT_PAYLOAD) {
|
} else if (ntohl(entry->type) == CBFS_COMPONENT_SELF) {
|
||||||
if (cbfs_payload_make_elf(&buffer, arch)) {
|
if (cbfs_payload_make_elf(&buffer, arch)) {
|
||||||
buffer_delete(&buffer);
|
buffer_delete(&buffer);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1522,7 +1522,7 @@ int cbfs_print_entry_info(struct cbfs_image *image, struct cbfs_file *entry,
|
||||||
CBFS_SUBHEADER(entry), fp);
|
CBFS_SUBHEADER(entry), fp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CBFS_COMPONENT_PAYLOAD:
|
case CBFS_COMPONENT_SELF:
|
||||||
payload = (struct cbfs_payload_segment *)
|
payload = (struct cbfs_payload_segment *)
|
||||||
CBFS_SUBHEADER(entry);
|
CBFS_SUBHEADER(entry);
|
||||||
while (payload) {
|
while (payload) {
|
||||||
|
|
|
@ -410,7 +410,7 @@ static int cbfs_add_component(const char *filename,
|
||||||
if (type == CBFS_COMPONENT_STAGE)
|
if (type == CBFS_COMPONENT_STAGE)
|
||||||
attrs->position = htonl(offset +
|
attrs->position = htonl(offset +
|
||||||
sizeof(struct cbfs_stage));
|
sizeof(struct cbfs_stage));
|
||||||
else if (type == CBFS_COMPONENT_PAYLOAD)
|
else if (type == CBFS_COMPONENT_SELF)
|
||||||
attrs->position = htonl(offset +
|
attrs->position = htonl(offset +
|
||||||
sizeof(struct cbfs_payload));
|
sizeof(struct cbfs_payload));
|
||||||
else
|
else
|
||||||
|
@ -737,7 +737,7 @@ static int cbfs_add_payload(void)
|
||||||
{
|
{
|
||||||
return cbfs_add_component(param.filename,
|
return cbfs_add_component(param.filename,
|
||||||
param.name,
|
param.name,
|
||||||
CBFS_COMPONENT_PAYLOAD,
|
CBFS_COMPONENT_SELF,
|
||||||
param.baseaddress,
|
param.baseaddress,
|
||||||
param.headeroffset,
|
param.headeroffset,
|
||||||
cbfstool_convert_mkpayload);
|
cbfstool_convert_mkpayload);
|
||||||
|
@ -757,7 +757,7 @@ static int cbfs_add_flat_binary(void)
|
||||||
}
|
}
|
||||||
return cbfs_add_component(param.filename,
|
return cbfs_add_component(param.filename,
|
||||||
param.name,
|
param.name,
|
||||||
CBFS_COMPONENT_PAYLOAD,
|
CBFS_COMPONENT_SELF,
|
||||||
param.baseaddress,
|
param.baseaddress,
|
||||||
param.headeroffset,
|
param.headeroffset,
|
||||||
cbfstool_convert_mkflatpayload);
|
cbfstool_convert_mkflatpayload);
|
||||||
|
|
|
@ -67,7 +67,7 @@ typedef uint8_t u8;
|
||||||
components */
|
components */
|
||||||
|
|
||||||
#define CBFS_TYPE_STAGE 0x10
|
#define CBFS_TYPE_STAGE 0x10
|
||||||
#define CBFS_TYPE_PAYLOAD 0x20
|
#define CBFS_TYPE_SELF 0x20
|
||||||
#define CBFS_TYPE_OPTIONROM 0x30
|
#define CBFS_TYPE_OPTIONROM 0x30
|
||||||
#define CBFS_TYPE_BOOTSPLASH 0x40
|
#define CBFS_TYPE_BOOTSPLASH 0x40
|
||||||
#define CBFS_TYPE_RAW 0x50
|
#define CBFS_TYPE_RAW 0x50
|
||||||
|
|
Loading…
Reference in New Issue