Commit 41b568f5 authored by danh-arm's avatar danh-arm Committed by GitHub
Browse files

Merge pull request #661 from dp-arm/master

Replace fip_create with fiptool
parents 3d99b17f 819281ee
......@@ -10,13 +10,14 @@ build/
# Ignore build products from tools
tools/**/*.o
tools/fip_create/fip_create
tools/fip_create/fip_create.exe
tools/fip_create/
tools/fiptool/fiptool
tools/fiptool/fiptool.exe
tools/cert_create/src/*.o
tools/cert_create/src/**/*.o
tools/cert_create/cert_create
tools/cert_create/cert_create.exe
# Ignore header files copied.
tools/fip_create/firmware_image_package.h
tools/fip_create/uuid.h
tools/fiptool/firmware_image_package.h
tools/fiptool/uuid.h
......@@ -390,7 +390,7 @@ ENABLE_PMF := 1
endif
################################################################################
# Auxiliary tools (fip_create, cert_create, etc)
# Auxiliary tools (fiptool, cert_create, etc)
################################################################################
# Variables for use with Certificate Generation Tool
......@@ -398,8 +398,8 @@ CRTTOOLPATH ?= tools/cert_create
CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT}
# Variables for use with Firmware Image Package
FIPTOOLPATH ?= tools/fip_create
FIPTOOL ?= ${FIPTOOLPATH}/fip_create${BIN_EXT}
FIPTOOLPATH ?= tools/fiptool
FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT}
################################################################################
......@@ -613,7 +613,8 @@ certificates: ${CRT_DEPS} ${CRTTOOL}
endif
${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL}
${Q}${FIPTOOL} --dump ${FIP_ARGS} $@
${Q}${FIPTOOL} create ${FIP_ARGS} $@
${Q}${FIPTOOL} info $@
@${ECHO_BLANK_LINE}
@echo "Built $@ successfully"
@${ECHO_BLANK_LINE}
......@@ -628,7 +629,8 @@ fwu_certificates: ${FWU_CRT_DEPS} ${CRTTOOL}
endif
${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL}
${Q}${FIPTOOL} --dump ${FWU_FIP_ARGS} $@
${Q}${FIPTOOL} create ${FWU_FIP_ARGS} $@
${Q}${FIPTOOL} info $@
@echo
@echo "Built $@ successfully"
@echo
......@@ -639,7 +641,7 @@ fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
.PHONY: ${FIPTOOL}
${FIPTOOL}:
${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH}
${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${FIPTOOLPATH}
cscope:
@echo " CSCOPE"
......
......@@ -1513,11 +1513,16 @@ The ToC header and entry formats are described in the header file
ARM Trusted firmware.
The ToC header has the following fields:
`name`: The name of the ToC. This is currently used to validate the header.
`serial_number`: A non-zero number provided by the creation tool
`flags`: Flags associated with this data. None are yet defined.
`flags`: Flags associated with this data.
Bits 0-13: Reserved
Bits 32-47: Platform defined
Bits 48-63: Reserved
A ToC entry has the following fields:
`uuid`: All files are referred to by a pre-defined Universally Unique
IDentifier [UUID] . The UUIDs are defined in
`include/firmware_image_package`. The platform translates the requested
......@@ -1534,7 +1539,7 @@ that can be loaded by the ARM Trusted Firmware from platform storage. The tool
currently only supports packing bootloader images. Additional image definitions
can be added to the tool as required.
The tool can be found in `tools/fip_create`.
The tool can be found in `tools/fiptool`.
### Loading from a Firmware Image Package (FIP)
......
......@@ -229,7 +229,7 @@ Trusted Firmware build process when `GENERATE_COT=1`. It takes the boot loader
images and keys as inputs (keys must be in PEM format) and generates the
certificates (in DER format) required to establish the CoT. New keys can be
generated by the tool in case they are not provided. The certificates are then
passed as inputs to the `fip_create` tool for creating the FIP.
passed as inputs to the `fiptool` utility for creating the FIP.
The certificates are also stored individually in the in the output build
directory.
......
......@@ -269,7 +269,7 @@ performed.
* `GENERATE_COT`: Boolean flag used to build and execute the `cert_create`
tool to create certificates as per the Chain of Trust described in
[Trusted Board Boot]. The build system then calls the `fip_create` tool to
[Trusted Board Boot]. The build system then calls `fiptool` to
include the certificates in the FIP and FWU_FIP. Default value is '0'.
Specify both `TRUSTED_BOARD_BOOT=1` and `GENERATE_COT=1` to include support
......@@ -635,7 +635,7 @@ steps:
It is recommended to remove old artifacts before building the tool:
make -C tools/fip_create clean
make -C tools/fiptool clean
Build the tool:
......@@ -643,37 +643,58 @@ Build the tool:
The tool binary can be located in:
./tools/fip_create/fip_create
./tools/fiptool/fiptool
Invoking the tool with `--help` will print a help message with all available
options.
Example 1: create a new Firmware package `fip.bin` that contains BL2 and BL31:
./tools/fip_create/fip_create \
./tools/fiptool/fiptool create \
--tb-fw build/<platform>/<build-type>/bl2.bin \
--soc-fw build/<platform>/<build-type>/bl31.bin \
fip.bin
Example 2: view the contents of an existing Firmware package:
./tools/fip_create/fip_create --dump <path-to>/fip.bin
./tools/fiptool/fiptool info <path-to>/fip.bin
Example 3: update the entries of an existing Firmware package:
# Change the BL2 from Debug to Release version
./tools/fip_create/fip_create \
./tools/fiptool/fiptool update \
--tb-fw build/<platform>/release/bl2.bin \
build/<platform>/debug/fip.bin
Example 4: unpack all entries from an existing Firmware package:
# Images will be unpacked to the working directory
./tools/fip_create/fip_create --unpack <path-to>/fip.bin
./tools/fiptool/fiptool unpack <path-to>/fip.bin
Example 5: remove an entry from an existing Firmware package:
./tools/fiptool/fiptool remove \
--tb-fw build/<platform>/debug/fip.bin
Note that if the destination FIP file exists, the create, update and
remove operations will automatically overwrite it.
The unpack operation will fail if the images already exist at the
destination. In that case, use -f or --force to continue.
More information about FIP can be found in the [Firmware Design document]
[Firmware Design].
#### Migrating from fip_create to fiptool
The previous version of fiptool was called fip_create. A compatibility script
that emulates the basic functionality of the previous fip_create is provided.
However, users are strongly encouraged to migrate to fiptool.
* To create a new FIP file, replace "fip_create" with "fiptool create".
* To update a FIP file, replace "fip_create" with "fiptool update".
* To dump the contents of a FIP file, replace "fip_create --dump"
with "fiptool info".
### Building FIP images with support for Trusted Board Boot
......@@ -805,21 +826,21 @@ corrupted binaries.
2. Obtain SCP_BL2 (Juno) and BL33 (all platforms)
Use the fip_create tool to extract the SCP_BL2 and BL33 images from the FIP
Use the fiptool to extract the SCP_BL2 and BL33 images from the FIP
package included in the Linaro release:
# Build the fip_create tool
# Build the fiptool
make [DEBUG=1] [V=1] fiptool
# Unpack firmware images from Linaro FIP
./tools/fip_create/fip_create --unpack \
./tools/fiptool/fiptool unpack \
<path/to/linaro/release>/fip.bin
The unpack operation will result in a set of binary images extracted to the
working directory. The SCP_BL2 image corresponds to `scp-fw.bin` and BL33
corresponds to `nt-fw.bin`.
Note: the fip_create tool will complain if the images to be unpacked already
Note: the fiptool will complain if the images to be unpacked already
exist in the current directory. If that is the case, either delete those
files or use the `--force` option to overwrite.
......
......@@ -112,7 +112,7 @@ define IMG_BIN
${BUILD_PLAT}/bl$(1).bin
endef
# FIP_ADD_PAYLOAD appends the command line arguments required by the FIP tool
# FIP_ADD_PAYLOAD appends the command line arguments required by fiptool
# to package a new payload. Optionally, it adds the dependency on this payload
# $(1) = payload filename (i.e. bl31.bin)
# $(2) = command line option for the specified payload (i.e. --bl31)
......@@ -135,7 +135,7 @@ endef
# using a build option. It also adds a dependency on the image file, aborting
# the build if the file does not exist.
# $(1) = build option to specify the image filename (SCP_BL2, BL33, etc)
# $(2) = command line option for the fip_create tool (scp_bl2, bl33, etc)
# $(2) = command line option for fiptool (scp_bl2, bl33, etc)
# Example:
# $(eval $(call FIP_ADD_IMG,BL33,--bl33))
define FIP_ADD_IMG
......@@ -147,7 +147,7 @@ check_$(1):
$$(if $(value $(1)),,$$(error "Platform '${PLAT}' requires $(1). Please set $(1) to point to the right file"))
endef
# FWU_FIP_ADD_PAYLOAD appends the command line arguments required by the FIP tool
# FWU_FIP_ADD_PAYLOAD appends the command line arguments required by fiptool
# to package a new FWU payload. Optionally, it adds the dependency on this payload
# $(1) = payload filename (e.g. ns_bl2u.bin)
# $(2) = command line option for the specified payload (e.g. --fwu)
......@@ -168,7 +168,7 @@ endef
# FWU_FIP_ADD_IMG allows the platform to pack a binary image in the FWU FIP
# $(1) build option to specify the image filename (BL2U, NS_BL2U, etc)
# $(2) command line option for the fip_create tool (bl2u, ns_bl2u, etc)
# $(2) command line option for fiptool (bl2u, ns_bl2u, etc)
# Example:
# $(eval $(call FWU_FIP_ADD_IMG,BL2U,--bl2u))
define FWU_FIP_ADD_IMG
......@@ -301,7 +301,7 @@ define SOURCES_TO_OBJS
endef
# MAKE_TOOL_ARGS macro defines the command line arguments for the FIP tool for
# MAKE_TOOL_ARGS macro defines the command line arguments for fiptool for
# each BL image. Arguments:
# $(1) = BL stage (2, 30, 31, 32, 33)
# $(2) = Binary file
......
......@@ -30,7 +30,7 @@
# This file defines the keys and certificates that must be created to establish
# a Chain of Trust following the TBBR document. These definitions include the
# command line options passed to the cert_create and fip_create tools.
# command line options passed to the cert_create and fiptool commands.
#
# Expected environment:
#
......@@ -66,11 +66,11 @@ NTFW_NVCTR_VAL ?= 0
$(eval $(call CERT_ADD_CMD_OPT,${TFW_NVCTR_VAL},--tfw-nvctr))
$(eval $(call CERT_ADD_CMD_OPT,${NTFW_NVCTR_VAL},--ntfw-nvctr))
# Add Trusted Key certificate to the fip_create and cert_create command line options
# Add Trusted Key certificate to the fiptool and cert_create command line options
$(eval $(call FIP_ADD_PAYLOAD,${TRUSTED_KEY_CERT},--trusted-key-cert))
$(eval $(call CERT_ADD_CMD_OPT,${TRUSTED_KEY_CERT},--trusted-key-cert))
# Add fwu certificate to the fip_create and cert_create command line options
# Add fwu certificate to the fiptool and cert_create command line options
$(eval $(call FWU_FIP_ADD_PAYLOAD,${FWU_CERT},--fwu-cert))
$(eval $(call FWU_CERT_ADD_CMD_OPT,${FWU_CERT},--fwu-cert))
......
This diff is collapsed.
......@@ -32,10 +32,12 @@ MAKE_HELPERS_DIRECTORY := ../../make_helpers/
include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
include ${MAKE_HELPERS_DIRECTORY}build_env.mk
PROJECT := fip_create${BIN_EXT}
OBJECTS := fip_create.o
PROJECT := fiptool${BIN_EXT}
OBJECTS := fiptool.o tbbr_config.o
V := 0
COPIED_H_FILES := uuid.h firmware_image_package.h
override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700
CFLAGS := -Wall -Werror -pedantic -std=c99
ifeq (${DEBUG},1)
CFLAGS += -g -O0 -DDEBUG
......@@ -43,6 +45,12 @@ else
CFLAGS += -O2
endif
ifeq (${V},0)
Q := @
else
Q :=
endif
# Only include from local directory (see comment below).
INCLUDE_PATHS := -I.
......@@ -50,7 +58,7 @@ CC := gcc
.PHONY: all clean distclean
all: ${PROJECT}
all: ${PROJECT} fip_create
${PROJECT}: ${OBJECTS} Makefile
@echo " LD $@"
......@@ -59,9 +67,13 @@ ${PROJECT}: ${OBJECTS} Makefile
@echo "Built $@ successfully"
@${ECHO_BLANK_LINE}
fip_create: fip_create.sh
mkdir -p ../fip_create
install -m 755 fip_create.sh ../fip_create/fip_create
%.o: %.c %.h ${COPIED_H_FILES} Makefile
@echo " CC $<"
${Q}${CC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
${Q}${CC} -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
#
# Copy required library headers to a local directory so they can be included
......@@ -76,8 +88,7 @@ firmware_image_package.h : ../../include/common/firmware_image_package.h
$(call SHELL_COPY,$<,$@)
clean:
$(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS})
$(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS} fip_create)
distclean: clean
$(call SHELL_DELETE_ALL, ${COPIED_H_FILES})
#!/bin/sh
#
# Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of ARM nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# This script implements the old fip_create tool on top of
# the new fiptool.
usage() {
cat << EOF
This tool is used to create a Firmware Image Package.
Usage:
fip_create [options] FIP_FILENAME
Options:
-h,--help: Print this help message and exit
-d,--dump: Print contents of FIP after update
-u,--unpack: Unpack images from an existing FIP
-f,--force: Overwrite existing files when unpacking images
Components that can be added/updated:
--scp-fwu-cfg FILENAME SCP Firmware Updater Configuration FWU SCP_BL2U
--ap-fwu-cfg FILENAME AP Firmware Updater Configuration BL2U
--fwu FILENAME Firmware Updater NS_BL2U
--fwu-cert FILENAME Non-Trusted Firmware Updater certificate
--tb-fw FILENAME Trusted Boot Firmware BL2
--scp-fw FILENAME SCP Firmware SCP_BL2
--soc-fw FILENAME EL3 Runtime Firmware BL31
--tos-fw FILENAME Secure Payload BL32 (Trusted OS)
--nt-fw FILENAME Non-Trusted Firmware BL33
--rot-cert FILENAME Root Of Trust key certificate
--trusted-key-cert FILENAME Trusted key certificate
--scp-fw-key-cert FILENAME SCP Firmware key certificate
--soc-fw-key-cert FILENAME SoC Firmware key certificate
--tos-fw-key-cert FILENAME Trusted OS Firmware key certificate
--nt-fw-key-cert FILENAME Non-Trusted Firmware key certificate
--tb-fw-cert FILENAME Trusted Boot Firmware BL2 certificate
--scp-fw-cert FILENAME SCP Firmware content certificate
--soc-fw-cert FILENAME SoC Firmware content certificate
--tos-fw-cert FILENAME Trusted OS Firmware content certificate
--nt-fw-cert FILENAME Non-Trusted Firmware content certificate
EOF
exit
}
echo "!! The fip_create tool is deprecated. Use the new fiptool. !!"
basedir="$(dirname $0)/../fiptool"
fiptool_args=
while :; do
case "$1" in
-h | --help )
usage
break ;;
-d | --dump )
fiptool_args="info $fiptool_args"
shift ;;
-u | --unpack )
fiptool_args="unpack $fiptool_args"
shift ;;
-f | --force )
fiptool_args="$fiptool_args --force"
shift ;;
--scp-fwu-cfg | \
--ap-fwu-cfg | \
--fwu | \
--fwu-cert | \
--tb-fw | \
--scp-fw | \
--soc-fw | \
--tos-fw | \
--nt-fw | \
--rot-cert | \
--trusted-key-cert | \
--scp-fw-key-cert | \
--soc-fw-key-cert | \
--tos-fw-key-cert | \
--nt-fw-key-cert | \
--tb-fw-cert | \
--scp-fw-cert | \
--soc-fw-cert | \
--tos-fw-cert | \
--nt-fw-cert )
fiptool_args="$fiptool_args $1"
shift
if test -z $1; then
usage
fi
fiptool_args="$fiptool_args $1"
shift ;;
* )
break ;;
esac
done
# expect a FIP filename
if test -z $1; then
usage
fi
is_pack_cmd=1
for arg in $fiptool_args; do
case "$arg" in
unpack )
is_pack_cmd=0
break ;;
info )
is_pack_cmd=0
break ;;
* )
esac
done
# if --unpack and --dump were not specified
# the default action is to pack
if test "$is_pack_cmd" -eq 1; then
fiptool_args="update $fiptool_args"
fi
# append FIP filename
fiptool_args="$fiptool_args $1"
echo "Invoking fiptool with args: $fiptool_args"
"$basedir/fiptool" $fiptool_args
This diff is collapsed.
/*
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __FIPTOOL_H__
#define __FIPTOOL_H__
#include <stddef.h>
#include <stdint.h>
#include "uuid.h"
#define NELEM(x) (sizeof (x) / sizeof *(x))
/* TODO: Do not hardcode, use realloc() */
#define MAX_IMAGES 32
enum {
DO_PACK = 1,
DO_UNPACK = 2,
DO_REMOVE = 3
};
enum {
LOG_DBG,
LOG_WARN,
LOG_ERR
};
typedef struct image {
uuid_t uuid;
size_t size;
void *buffer;
struct toc_entry *toc_entry;
} image_t;
typedef struct cmd {
char *name;
int (*handler)(int, char **);
void (*usage)(void);
} cmd_t;
#endif /* __FIPTOOL_H__ */
/*
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stddef.h>
#include "firmware_image_package.h"
#include "tbbr_config.h"
/* The images used depends on the platform. */
toc_entry_t toc_entries[] = {
{ "SCP Firmware Updater Configuration FWU SCP_BL2U", UUID_TRUSTED_UPDATE_FIRMWARE_SCP_BL2U,
"scp-fwu-cfg", NULL, 0, NULL },
{ "AP Firmware Updater Configuration BL2U", UUID_TRUSTED_UPDATE_FIRMWARE_BL2U,
"ap-fwu-cfg", NULL, 0, NULL },
{ "Firmware Updater NS_BL2U", UUID_TRUSTED_UPDATE_FIRMWARE_NS_BL2U,
"fwu", NULL, 0, NULL },
{ "Non-Trusted Firmware Updater certificate", UUID_TRUSTED_FWU_CERT,
"fwu-cert", NULL, 0, NULL },
{ "Trusted Boot Firmware BL2", UUID_TRUSTED_BOOT_FIRMWARE_BL2,
"tb-fw", NULL, 0, NULL },
{ "SCP Firmware SCP_BL2", UUID_SCP_FIRMWARE_SCP_BL2,
"scp-fw", NULL, 0, NULL },
{ "EL3 Runtime Firmware BL31", UUID_EL3_RUNTIME_FIRMWARE_BL31,
"soc-fw", NULL, 0, NULL },
{ "Secure Payload BL32 (Trusted OS)", UUID_SECURE_PAYLOAD_BL32,
"tos-fw", NULL, 0, NULL },
{ "Non-Trusted Firmware BL33", UUID_NON_TRUSTED_FIRMWARE_BL33,
"nt-fw", NULL, 0, NULL },
/* Key Certificates */
{ "Root Of Trust key certificate", UUID_ROT_KEY_CERT,
"rot-cert", NULL, 0, NULL },
{ "Trusted key certificate", UUID_TRUSTED_KEY_CERT,
"trusted-key-cert", NULL, 0, NULL },
{ "SCP Firmware key certificate", UUID_SCP_FW_KEY_CERT,
"scp-fw-key-cert", NULL, 0, NULL },
{ "SoC Firmware key certificate", UUID_SOC_FW_KEY_CERT,
"soc-fw-key-cert", NULL, 0, NULL },
{ "Trusted OS Firmware key certificate", UUID_TRUSTED_OS_FW_KEY_CERT,
"tos-fw-key-cert", NULL, 0, NULL },
{ "Non-Trusted Firmware key certificate", UUID_NON_TRUSTED_FW_KEY_CERT,
"nt-fw-key-cert", NULL, 0, NULL },
/* Content certificates */
{ "Trusted Boot Firmware BL2 certificate", UUID_TRUSTED_BOOT_FW_CERT,
"tb-fw-cert", NULL, 0, NULL },
{ "SCP Firmware content certificate", UUID_SCP_FW_CONTENT_CERT,
"scp-fw-cert", NULL, 0, NULL },
{ "SoC Firmware content certificate", UUID_SOC_FW_CONTENT_CERT,
"soc-fw-cert", NULL, 0, NULL },
{ "Trusted OS Firmware content certificate", UUID_TRUSTED_OS_FW_CONTENT_CERT,
"tos-fw-cert", NULL, 0, NULL },
{ "Non-Trusted Firmware content certificate", UUID_NON_TRUSTED_FW_CONTENT_CERT,
"nt-fw-cert", NULL, 0, NULL },
{ NULL, { 0 }, NULL, NULL, 0, NULL }
};
size_t toc_entries_len = sizeof(toc_entries) / sizeof(toc_entries[0]);
/*
* Copyright (c) 2014, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
......@@ -28,33 +28,26 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __FIP_CREATE_H__
#define __FIP_CREATE_H__
#ifndef __TBBR_CONFIG_H__
#define __TBBR_CONFIG_H__
#include <stdint.h>
#include <uuid.h>
#define MAX_FILES 20
#include "uuid.h"
/* TODO: Update this number as required */
#define TOC_HEADER_SERIAL_NUMBER 0x12345678
#define TOC_HEADER_SERIAL_NUMBER 0x12345678
#define FLAG_FILENAME (1 << 0)
typedef struct toc_entry {
const char *name;
uuid_t uuid;
const char *cmdline_name;
struct image *image;
int action;
char *action_arg;
} toc_entry_t;
typedef struct entry_lookup_list {
const char *name;
uuid_t name_uuid;
const char *command_line_name;
struct file_info *info;
unsigned int flags;
} entry_lookup_list_t;
extern toc_entry_t toc_entries[];
extern size_t toc_entries_len;
typedef struct file_info {
uuid_t name_uuid;
const char *filename;
unsigned int size;
void *image_buffer;
entry_lookup_list_t *entry;
} file_info_t;
#endif /* __FIP_CREATE_H__ */
#endif /* __TBBR_CONFIG_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment