Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Humbert
reform-boundary-uboot
Commits
ab857f26
Commit
ab857f26
authored
12 years ago
by
Troy Kisky
Committed by
Stefano Babic
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
imximage: make set_imx_hdr_v1/v2 easier to read
Signed-off-by:
Troy Kisky
<
troy.kisky@boundarydevices.com
>
parent
ad0826dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/imximage.c
+11
-19
11 additions, 19 deletions
tools/imximage.c
with
11 additions
and
19 deletions
tools/imximage.c
+
11
−
19
View file @
ab857f26
...
@@ -201,25 +201,19 @@ static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
...
@@ -201,25 +201,19 @@ static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
imx_header_v1_t
*
hdr_v1
=
&
imxhdr
->
header
.
hdr_v1
;
imx_header_v1_t
*
hdr_v1
=
&
imxhdr
->
header
.
hdr_v1
;
flash_header_v1_t
*
fhdr_v1
=
&
hdr_v1
->
fhdr
;
flash_header_v1_t
*
fhdr_v1
=
&
hdr_v1
->
fhdr
;
dcd_v1_t
*
dcd_v1
=
&
hdr_v1
->
dcd_table
;
dcd_v1_t
*
dcd_v1
=
&
hdr_v1
->
dcd_table
;
uint32_t
base
_offset
;
uint32_t
hdr_
base
;
uint32_t
header_length
=
(((
char
*
)
&
dcd_v1
->
addr_data
[
dcd_len
].
addr
)
uint32_t
header_length
=
(((
char
*
)
&
dcd_v1
->
addr_data
[
dcd_len
].
addr
)
-
((
char
*
)
imxhdr
));
-
((
char
*
)
imxhdr
));
/* Set magic number */
/* Set magic number */
fhdr_v1
->
app_code_barker
=
APP_CODE_BARKER
;
fhdr_v1
->
app_code_barker
=
APP_CODE_BARKER
;
f
hdr_
v1
->
app_dest_ptr
=
entry_point
-
flash_offset
-
hdr_
base
=
entry_point
-
sizeof
(
struct
imx_header
);
sizeof
(
struct
imx_header
)
;
fhdr_v1
->
app_dest_ptr
=
hdr_base
-
flash_offset
;
fhdr_v1
->
app_code_jump_vector
=
entry_point
;
fhdr_v1
->
app_code_jump_vector
=
entry_point
;
base_offset
=
fhdr_v1
->
app_dest_ptr
+
flash_offset
;
fhdr_v1
->
dcd_ptr_ptr
=
hdr_base
+
offsetof
(
flash_header_v1_t
,
dcd_ptr
);
fhdr_v1
->
dcd_ptr_ptr
=
fhdr_v1
->
dcd_ptr
=
hdr_base
+
offsetof
(
imx_header_v1_t
,
dcd_table
);
(
uint32_t
)
(
offsetof
(
flash_header_v1_t
,
dcd_ptr
)
-
offsetof
(
flash_header_v1_t
,
app_code_jump_vector
)
+
base_offset
);
fhdr_v1
->
dcd_ptr
=
base_offset
+
offsetof
(
imx_header_v1_t
,
dcd_table
);
/* Security feature are not supported */
/* Security feature are not supported */
fhdr_v1
->
app_code_csf
=
0
;
fhdr_v1
->
app_code_csf
=
0
;
...
@@ -232,6 +226,7 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
...
@@ -232,6 +226,7 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
{
{
imx_header_v2_t
*
hdr_v2
=
&
imxhdr
->
header
.
hdr_v2
;
imx_header_v2_t
*
hdr_v2
=
&
imxhdr
->
header
.
hdr_v2
;
flash_header_v2_t
*
fhdr_v2
=
&
hdr_v2
->
fhdr
;
flash_header_v2_t
*
fhdr_v2
=
&
hdr_v2
->
fhdr
;
uint32_t
hdr_base
;
/* Set magic number */
/* Set magic number */
fhdr_v2
->
header
.
tag
=
IVT_HEADER_TAG
;
/* 0xD1 */
fhdr_v2
->
header
.
tag
=
IVT_HEADER_TAG
;
/* 0xD1 */
...
@@ -240,15 +235,12 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
...
@@ -240,15 +235,12 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
fhdr_v2
->
entry
=
entry_point
;
fhdr_v2
->
entry
=
entry_point
;
fhdr_v2
->
reserved1
=
fhdr_v2
->
reserved2
=
0
;
fhdr_v2
->
reserved1
=
fhdr_v2
->
reserved2
=
0
;
fhdr_v2
->
self
=
entry_point
-
sizeof
(
struct
imx_header
);
fhdr_v2
->
self
=
hdr_base
=
entry_point
-
sizeof
(
struct
imx_header
);
fhdr_v2
->
dcd_ptr
=
fhdr_v2
->
self
+
offsetof
(
imx_header_v2_t
,
dcd_table
);
fhdr_v2
->
boot_data_ptr
=
fhdr_v2
->
self
+
offsetof
(
imx_header_v2_t
,
boot_data
);
hdr_v2
->
boot_data
.
start
=
fhdr_v2
->
self
-
flash_offset
;
fhdr_v2
->
dcd_ptr
=
hdr_base
+
offsetof
(
imx_header_v2_t
,
dcd_table
);
fhdr_v2
->
boot_data_ptr
=
hdr_base
+
offsetof
(
imx_header_v2_t
,
boot_data
);
hdr_v2
->
boot_data
.
start
=
hdr_base
-
flash_offset
;
/* Security feature are not supported */
/* Security feature are not supported */
fhdr_v2
->
csf
=
0
;
fhdr_v2
->
csf
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment