Skip to content
GitLab
Menu
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
aa47d59d
Commit
aa47d59d
authored
Dec 08, 2020
by
Manish Pandey
Committed by
TrustedFirmware Code Review
Dec 08, 2020
Browse files
Merge "rcar_gen3: drivers: console: Treat log as device memory" into integration
parents
f0f3d368
60576747
Changes
1
Hide whitespace changes
Inline
Side-by-side
drivers/renesas/rcar/console/rcar_printf.c
View file @
aa47d59d
/*
* Copyright (c) 2015-20
19
, Renesas Electronics Corporation. All rights reserved.
* Copyright (c) 2015-20
20
, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -19,11 +19,22 @@
#define INDEX_TIMER_COUNT (4U)
#define RCAR_LOG_HEAD (('T' << 0) | ('L' << 8) | ('O' << 16) | ('G' << 24))
/*
* The log is initialized and used before BL31 xlat tables are initialized,
* therefore the log memory is a device memory at that point. Make sure the
* memory is correclty aligned and accessed only with up-to 32bit, aligned,
* writes.
*/
CASSERT
((
RCAR_BL31_LOG_BASE
&
0x7
)
==
0
,
assert_bl31_log_base_unaligned
);
CASSERT
((
RCAR_BL31_LOG_MAX
&
0x7
)
==
0
,
assert_bl31_log_max_unaligned
);
extern
RCAR_INSTANTIATE_LOCK
typedef
struct
log_head
{
uint
8
_t
head
[
4
]
;
uint
32
_t
head
;
uint32_t
index
;
uint32_t
size
;
uint
8
_t
res
[
4
]
;
uint
32
_t
res
;
}
loghead_t
;
typedef
struct
log_map
{
...
...
@@ -66,15 +77,12 @@ int32_t rcar_set_log_data(int32_t c)
int32_t
rcar_log_init
(
void
)
{
static
const
uint8_t
const_header
[]
=
"TLOG"
;
logmap_t
*
t_log
;
logmap_t
*
t_log
=
(
logmap_t
*
)
RCAR_BL31_LOG_BASE
;
uint32_t
*
log_data
=
(
uint32_t
*
)
t_log
->
log_data
;
int16_t
init_flag
=
0
;
int
i
;
t_log
=
(
logmap_t
*
)
RCAR_BL31_LOG_BASE
;
if
(
memcmp
((
const
void
*
)
t_log
->
header
.
head
,
(
const
void
*
)
const_header
,
sizeof
(
t_log
->
header
.
head
))
!=
0
)
{
if
(
t_log
->
header
.
head
!=
RCAR_LOG_HEAD
)
{
/*
* Log header is not "TLOG", then log area initialize
*/
...
...
@@ -87,11 +95,10 @@ int32_t rcar_log_init(void)
init_flag
=
1
;
}
if
(
init_flag
==
1
)
{
(
void
)
memset
((
void
*
)
t_log
->
log_data
,
0
,
(
size_t
)
RCAR_BL31_LOG_MAX
);
(
void
)
memcpy
((
void
*
)
t_log
->
header
.
head
,
(
const
void
*
)
const_header
,
sizeof
(
t_log
->
header
.
head
));
for
(
i
=
0
;
i
<
RCAR_BL31_LOG_MAX
;
i
+=
4
)
*
log_data
++
=
0
;
t_log
->
header
.
head
=
RCAR_LOG_HEAD
;
t_log
->
header
.
index
=
0U
;
t_log
->
header
.
size
=
0U
;
}
...
...
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