Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
6ef96ab4
Unverified
Commit
6ef96ab4
authored
7 years ago
by
davidcunado-arm
Committed by
GitHub
7 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #1204 from davidcunado-arm/rv/fip_tool
Add padding at the end of the last entry
parents
86188567
4069fb5f
master
v2.5
v2.5-rc1
v2.5-rc0
v2.4
v2.4-rc2
v2.4-rc1
v2.4-rc0
v2.3
v2.3-rc2
v2.3-rc1
v2.3-rc0
v2.2
v2.2-rc2
v2.2-rc1
v2.2-rc0
v2.1
v2.1-rc1
v2.1-rc0
v2.0
v2.0-rc0
v1.6
v1.6-rc1
v1.6-rc0
v1.5
v1.5-rc3
v1.5-rc2
v1.5-rc1
v1.5-rc0
arm_cca_v0.2
arm_cca_v0.1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/firmware-design.rst
+5
-3
docs/firmware-design.rst
tools/fiptool/fiptool.c
+14
-3
tools/fiptool/fiptool.c
with
19 additions
and
6 deletions
+19
-6
docs/firmware-design.rst
View file @
6ef96ab4
...
...
@@ -1868,9 +1868,11 @@ Firmware Image Package layout
The FIP layout consists of a table of contents (ToC) followed by payload data.
The ToC itself has a header followed by one or more table entries. The ToC is
terminated by an end marker entry. All ToC entries describe some payload data
that has been appended to the end of the binary package. With the information
provided in the ToC entry the corresponding payload data can be retrieved.
terminated by an end marker entry, and since the size of the ToC is 0 bytes,
the offset equals the total size of the FIP file. All ToC entries describe some
payload data that has been appended to the end of the binary package. With the
information provided in the ToC entry the corresponding payload data can be
retrieved.
::
...
...
This diff is collapsed.
Click to expand it.
tools/fiptool/fiptool.c
View file @
6ef96ab4
...
...
@@ -492,7 +492,7 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a
fip_toc_header_t
*
toc_header
;
fip_toc_entry_t
*
toc_entry
;
char
*
buf
;
uint64_t
entry_offset
,
buf_size
,
payload_size
=
0
;
uint64_t
entry_offset
,
buf_size
,
payload_size
=
0
,
pad_size
;
size_t
nr_images
=
0
;
for
(
desc
=
image_desc_head
;
desc
!=
NULL
;
desc
=
desc
->
next
)
...
...
@@ -526,9 +526,13 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a
entry_offset
+=
image
->
toc_e
.
size
;
}
/* Append a null uuid entry to mark the end of ToC entries. */
/*
* Append a null uuid entry to mark the end of ToC entries.
* NOTE the offset address for the last toc_entry must match the fip
* size.
*/
memset
(
toc_entry
,
0
,
sizeof
(
*
toc_entry
));
toc_entry
->
offset_address
=
entry_offset
;
toc_entry
->
offset_address
=
(
entry_offset
+
align
-
1
)
&
~
(
align
-
1
)
;
/* Generate the FIP file. */
fp
=
fopen
(
filename
,
"wb"
);
...
...
@@ -555,6 +559,13 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a
xfwrite
(
image
->
buffer
,
image
->
toc_e
.
size
,
fp
,
filename
);
}
if
(
fseek
(
fp
,
entry_offset
,
SEEK_SET
))
log_errx
(
"Failed to set file position"
);
pad_size
=
toc_entry
->
offset_address
-
entry_offset
;
while
(
pad_size
--
)
fputc
(
0x0
,
fp
);
fclose
(
fp
);
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help