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
deca6584
Unverified
Commit
deca6584
authored
Oct 25, 2018
by
Antonio Niño Díaz
Committed by
GitHub
Oct 25, 2018
Browse files
Merge pull request #1636 from antonio-nino-diaz-arm/an/console
Deprecate weak crash console functions
parents
583cb003
e74afb65
Changes
21
Hide whitespace changes
Inline
Side-by-side
docs/porting-guide.rst
View file @
deca6584
...
@@ -2554,8 +2554,13 @@ NOTE: This section assumes that your platform is enabling the MULTI_CONSOLE_API
...
@@ -2554,8 +2554,13 @@ NOTE: This section assumes that your platform is enabling the MULTI_CONSOLE_API
flag in its platform.mk. Not using this flag is deprecated for new platforms.
flag in its platform.mk. Not using this flag is deprecated for new platforms.
BL31 implements a crash reporting mechanism which prints the various registers
BL31 implements a crash reporting mechanism which prints the various registers
of the CPU to enable quick crash analysis and debugging. By default, the
of the CPU to enable quick crash analysis and debugging. This mechanism relies
definitions in ``plat/common/aarch64/platform\_helpers.S`` will cause the crash
on the platform implementating ``plat_crash_console_init``,
``plat_crash_console_putc`` and ``plat_crash_console_flush``.
The file ``plat/common/aarch64/crash_console_helpers.S`` contains sample
implementation of all of them. Platforms may include this file to their
makefiles in order to benefit from them. By default, they will cause the crash
output to be routed over the normal console infrastructure and get printed on
output to be routed over the normal console infrastructure and get printed on
consoles configured to output in crash state. ``console_set_scope()`` can be
consoles configured to output in crash state. ``console_set_scope()`` can be
used to control whether a console is used for crash output.
used to control whether a console is used for crash output.
...
@@ -2565,8 +2570,12 @@ normal boot console can be set up), platforms may want to control crash output
...
@@ -2565,8 +2570,12 @@ normal boot console can be set up), platforms may want to control crash output
more explicitly. For these, the following functions can be overridden by
more explicitly. For these, the following functions can be overridden by
platform code. They are executed outside of a C environment and without a stack.
platform code. They are executed outside of a C environment and without a stack.
Function : plat\_crash\_console\_init
If this behaviour is not desirable, the platform may implement functions that
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
redirect the prints to the console driver (``console_xxx_core_init``, etc). Most
platforms (including Arm platforms) do this and they can be used as an example.
Function : plat\_crash\_console\_init [mandatory]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
::
...
@@ -2577,9 +2586,10 @@ This API is used by the crash reporting mechanism to initialize the crash
...
@@ -2577,9 +2586,10 @@ This API is used by the crash reporting mechanism to initialize the crash
console. It must only use the general purpose registers x0 through x7 to do the
console. It must only use the general purpose registers x0 through x7 to do the
initialization and returns 1 on success.
initialization and returns 1 on success.
If you are trying to debug crashes before the console driver would normally get
When using the sample implementation, if you are trying to debug crashes before
registered, you can use this to register a driver from assembly with hardcoded
the console driver would normally get registered, you can use this to register a
parameters. For example, you could register the 16550 driver like this:
driver from assembly with hardcoded parameters. For example, you could register
the 16550 driver like this:
::
::
...
@@ -2595,11 +2605,11 @@ parameters. For example, you could register the 16550 driver like this:
...
@@ -2595,11 +2605,11 @@ parameters. For example, you could register the 16550 driver like this:
b console_16550_register /* tail call, returns 1 on success */
b console_16550_register /* tail call, returns 1 on success */
endfunc plat_crash_console_init
endfunc plat_crash_console_init
If you're trying to debug crashes in BL1, you can call the
console_xxx_core_init
If you're trying to debug crashes in BL1, you can call the
function exported by some console drivers from here.
``console_xxx_core_init``
function exported by some console drivers from here.
Function : plat\_crash\_console\_putc
Function : plat\_crash\_console\_putc
[mandatory]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~
::
::
...
@@ -2612,13 +2622,13 @@ x2 to do its work. The parameter and the return value are in general purpose
...
@@ -2612,13 +2622,13 @@ x2 to do its work. The parameter and the return value are in general purpose
register x0.
register x0.
If you have registered a normal console driver in ``plat_crash_console_init``,
If you have registered a normal console driver in ``plat_crash_console_init``,
you can keep the
default
implementation here (which calls ``console_putc()``).
you can keep the
sample
implementation here (which calls ``console_putc()``).
If you're trying to debug crashes in BL1, you can call the
console_xxx_core_putc
If you're trying to debug crashes in BL1, you can call the
function exported by some console drivers from here.
``console_xxx_core_putc``
function exported by some console drivers from here.
Function : plat\_crash\_console\_flush
Function : plat\_crash\_console\_flush
[mandatory]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~
::
::
...
@@ -2631,7 +2641,7 @@ registers x0 through x5 to do its work. The return value is 0 on successful
...
@@ -2631,7 +2641,7 @@ registers x0 through x5 to do its work. The return value is 0 on successful
completion; otherwise the return value is -1.
completion; otherwise the return value is -1.
If you have registered a normal console driver in ``plat_crash_console_init``,
If you have registered a normal console driver in ``plat_crash_console_init``,
you can keep the
default
implementation here (which calls ``console_flush()``).
you can keep the
sample
implementation here (which calls ``console_flush()``).
If you're trying to debug crashes in BL1, you can call the console_xx_core_flush
If you're trying to debug crashes in BL1, you can call the console_xx_core_flush
function exported by some console drivers from here.
function exported by some console drivers from here.
...
...
plat/arm/common/aarch64/arm_helpers.S
View file @
deca6584
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
.
weak
plat_arm_calc_core_pos
.
weak
plat_arm_calc_core_pos
.
weak
plat_my_core_pos
.
weak
plat_my_core_pos
.
weak
plat_crash_console_init
.
globl
plat_crash_console_init
.
weak
plat_crash_console_putc
.
globl
plat_crash_console_putc
.
weak
plat_crash_console_flush
.
globl
plat_crash_console_flush
.
globl
platform_mem_init
.
globl
platform_mem_init
...
...
plat/common/aarch32/crash_console_helpers.S
0 → 100644
View file @
deca6584
/*
*
Copyright
(
c
)
2018
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
/*
*
If
a
platform
wishes
to
use
the
functions
in
this
file
it
has
to
be
added
to
*
the
Makefile
of
the
platform
.
It
is
not
included
in
the
common
Makefile
.
*/
#include <asm_macros.S>
#include <console.h>
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
#if MULTI_CONSOLE_API
/
*
-----------------------------------------------------
*
int
plat_crash_console_init
(
void
)
*
Use
normal
console
by
default
.
Switch
it
to
crash
*
mode
so
serial
consoles
become
active
again
.
*
NOTE
:
This
default
implementation
will
only
work
for
*
crashes
that
occur
after
a
normal
console
(
marked
*
valid
for
the
crash
state
)
has
been
registered
with
*
the
console
framework
.
To
debug
crashes
that
occur
*
earlier
,
the
platform
has
to
override
these
functions
*
with
an
implementation
that
initializes
a
console
*
driver
with
hardcoded
parameters
.
See
*
docs
/
porting
-
guide
.
rst
for
more
information
.
*
-----------------------------------------------------
*/
func
plat_crash_console_init
#if defined(IMAGE_BL1)
/
*
*
BL1
code
can
possibly
crash
so
early
that
the
data
segment
is
not
yet
*
accessible
.
Don
't risk undefined behavior by trying to run the normal
*
console
framework
.
Platforms
that
want
to
debug
BL1
will
need
to
*
override
this
with
custom
functions
that
can
run
from
registers
only
.
*/
mov
r0
,
#
0
bx
lr
#else /* IMAGE_BL1 */
mov
r3
,
lr
mov
r0
,
#
CONSOLE_FLAG_CRASH
bl
console_switch_state
mov
r0
,
#
1
bx
r3
#endif
endfunc
plat_crash_console_init
/
*
-----------------------------------------------------
*
void
plat_crash_console_putc
(
int
character
)
*
Output
through
the
normal
console
by
default
.
*
-----------------------------------------------------
*/
func
plat_crash_console_putc
b
console_putc
endfunc
plat_crash_console_putc
/
*
-----------------------------------------------------
*
void
plat_crash_console_flush
(
void
)
*
Flush
normal
console
by
default
.
*
-----------------------------------------------------
*/
func
plat_crash_console_flush
b
console_flush
endfunc
plat_crash_console_flush
#else /* MULTI_CONSOLE_API */
/
*
-----------------------------------------------------
*
In
the
old
API
these
are
all
no
-
op
stubs
that
need
to
*
be
overridden
by
the
platform
to
be
useful
.
*
-----------------------------------------------------
*/
func
plat_crash_console_init
mov
r0
,
#
0
bx
lr
endfunc
plat_crash_console_init
func
plat_crash_console_putc
bx
lr
endfunc
plat_crash_console_putc
func
plat_crash_console_flush
bx
lr
endfunc
plat_crash_console_flush
#endif
plat/common/aarch32/platform_helpers.S
View file @
deca6584
...
@@ -8,9 +8,11 @@
...
@@ -8,9 +8,11 @@
#include <asm_macros.S>
#include <asm_macros.S>
.
weak
plat_report_exception
.
weak
plat_report_exception
#if !ERROR_DEPRECATED
.
weak
plat_crash_console_init
.
weak
plat_crash_console_init
.
weak
plat_crash_console_putc
.
weak
plat_crash_console_putc
.
weak
plat_crash_console_flush
.
weak
plat_crash_console_flush
#endif
.
weak
plat_reset_handler
.
weak
plat_reset_handler
.
weak
plat_disable_acp
.
weak
plat_disable_acp
.
weak
bl1_plat_prepare_exit
.
weak
bl1_plat_prepare_exit
...
@@ -26,6 +28,7 @@ func plat_report_exception
...
@@ -26,6 +28,7 @@ func plat_report_exception
bx
lr
bx
lr
endfunc
plat_report_exception
endfunc
plat_report_exception
#if !ERROR_DEPRECATED
/
*
-----------------------------------------------------
/
*
-----------------------------------------------------
*
Placeholder
function
which
should
be
redefined
by
*
Placeholder
function
which
should
be
redefined
by
*
each
platform
.
*
each
platform
.
...
@@ -54,6 +57,7 @@ func plat_crash_console_flush
...
@@ -54,6 +57,7 @@ func plat_crash_console_flush
mov
r0
,
#
0
mov
r0
,
#
0
bx
lr
bx
lr
endfunc
plat_crash_console_flush
endfunc
plat_crash_console_flush
#endif
/
*
-----------------------------------------------------
/
*
-----------------------------------------------------
*
Placeholder
function
which
should
be
redefined
by
*
Placeholder
function
which
should
be
redefined
by
...
...
plat/common/aarch64/crash_console_helpers.S
0 → 100644
View file @
deca6584
/*
*
Copyright
(
c
)
2018
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
/*
*
If
a
platform
wishes
to
use
the
functions
in
this
file
it
has
to
be
added
to
*
the
Makefile
of
the
platform
.
It
is
not
included
in
the
common
Makefile
.
*/
#include <asm_macros.S>
#include <console.h>
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
#if MULTI_CONSOLE_API
/
*
-----------------------------------------------------
*
int
plat_crash_console_init
(
void
)
*
Use
normal
console
by
default
.
Switch
it
to
crash
*
mode
so
serial
consoles
become
active
again
.
*
NOTE
:
This
default
implementation
will
only
work
for
*
crashes
that
occur
after
a
normal
console
(
marked
*
valid
for
the
crash
state
)
has
been
registered
with
*
the
console
framework
.
To
debug
crashes
that
occur
*
earlier
,
the
platform
has
to
override
these
functions
*
with
an
implementation
that
initializes
a
console
*
driver
with
hardcoded
parameters
.
See
*
docs
/
porting
-
guide
.
rst
for
more
information
.
*
-----------------------------------------------------
*/
func
plat_crash_console_init
#if defined(IMAGE_BL1)
/
*
*
BL1
code
can
possibly
crash
so
early
that
the
data
segment
is
not
yet
*
accessible
.
Don
't risk undefined behavior by trying to run the normal
*
console
framework
.
Platforms
that
want
to
debug
BL1
will
need
to
*
override
this
with
custom
functions
that
can
run
from
registers
only
.
*/
mov
x0
,
#
0
ret
#else /* IMAGE_BL1 */
mov
x3
,
x30
mov
x0
,
#
CONSOLE_FLAG_CRASH
bl
console_switch_state
mov
x0
,
#
1
ret
x3
#endif
endfunc
plat_crash_console_init
/
*
-----------------------------------------------------
*
void
plat_crash_console_putc
(
int
character
)
*
Output
through
the
normal
console
by
default
.
*
-----------------------------------------------------
*/
func
plat_crash_console_putc
b
console_putc
endfunc
plat_crash_console_putc
/
*
-----------------------------------------------------
*
void
plat_crash_console_flush
(
void
)
*
Flush
normal
console
by
default
.
*
-----------------------------------------------------
*/
func
plat_crash_console_flush
b
console_flush
endfunc
plat_crash_console_flush
#else /* MULTI_CONSOLE_API */
/
*
-----------------------------------------------------
*
In
the
old
API
these
are
all
no
-
op
stubs
that
need
to
*
be
overridden
by
the
platform
to
be
useful
.
*
-----------------------------------------------------
*/
func
plat_crash_console_init
mov
x0
,
#
0
ret
endfunc
plat_crash_console_init
func
plat_crash_console_putc
ret
endfunc
plat_crash_console_putc
func
plat_crash_console_flush
ret
endfunc
plat_crash_console_flush
#endif
plat/common/aarch64/platform_helpers.S
View file @
deca6584
...
@@ -10,9 +10,11 @@
...
@@ -10,9 +10,11 @@
#include <platform_def.h>
#include <platform_def.h>
.
weak
plat_report_exception
.
weak
plat_report_exception
#if !ERROR_DEPRECATED
.
weak
plat_crash_console_init
.
weak
plat_crash_console_init
.
weak
plat_crash_console_putc
.
weak
plat_crash_console_putc
.
weak
plat_crash_console_flush
.
weak
plat_crash_console_flush
#endif
.
weak
plat_reset_handler
.
weak
plat_reset_handler
.
weak
plat_disable_acp
.
weak
plat_disable_acp
.
weak
bl1_plat_prepare_exit
.
weak
bl1_plat_prepare_exit
...
@@ -37,6 +39,7 @@ func plat_report_exception
...
@@ -37,6 +39,7 @@ func plat_report_exception
ret
ret
endfunc
plat_report_exception
endfunc
plat_report_exception
#if !ERROR_DEPRECATED
#if MULTI_CONSOLE_API
#if MULTI_CONSOLE_API
/
*
-----------------------------------------------------
/
*
-----------------------------------------------------
*
int
plat_crash_console_init
(
void
)
*
int
plat_crash_console_init
(
void
)
...
@@ -109,6 +112,7 @@ func plat_crash_console_flush
...
@@ -109,6 +112,7 @@ func plat_crash_console_flush
ret
ret
endfunc
plat_crash_console_flush
endfunc
plat_crash_console_flush
#endif
#endif
#endif /* ERROR_DEPRECATED */
/
*
-----------------------------------------------------
/
*
-----------------------------------------------------
*
Placeholder
function
which
should
be
redefined
by
*
Placeholder
function
which
should
be
redefined
by
...
...
plat/hisilicon/hikey/aarch64/hikey_helpers.S
View file @
deca6584
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
.
globl
platform_mem_init
.
globl
platform_mem_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
.
globl
plat_report_exception
.
globl
plat_report_exception
.
globl
plat_reset_handler
.
globl
plat_reset_handler
...
@@ -60,6 +61,19 @@ func plat_crash_console_putc
...
@@ -60,6 +61,19 @@ func plat_crash_console_putc
b
console_core_putc
b
console_core_putc
endfunc
plat_crash_console_putc
endfunc
plat_crash_console_putc
/
*
---------------------------------------------
*
int
plat_crash_console_flush
()
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
Out
:
return
-
1
on
error
else
return
0
.
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*/
func
plat_crash_console_flush
mov_imm
x0
,
CRASH_CONSOLE_BASE
b
console_core_flush
endfunc
plat_crash_console_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
void
plat_report_exception
(
unsigned
int
type
)
*
void
plat_report_exception
(
unsigned
int
type
)
*
Function
to
report
an
unhandled
exception
*
Function
to
report
an
unhandled
exception
...
...
plat/hisilicon/hikey960/aarch64/hikey960_helpers.S
View file @
deca6584
/*
/*
*
Copyright
(
c
)
2017
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2017
-
2018
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
.
globl
platform_mem_init
.
globl
platform_mem_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
.
globl
plat_report_exception
.
globl
plat_report_exception
.
globl
plat_reset_handler
.
globl
plat_reset_handler
.
globl
clr_ex
.
globl
clr_ex
...
@@ -64,6 +65,19 @@ func plat_crash_console_putc
...
@@ -64,6 +65,19 @@ func plat_crash_console_putc
b
console_core_putc
b
console_core_putc
endfunc
plat_crash_console_putc
endfunc
plat_crash_console_putc
/
*
---------------------------------------------
*
int
plat_crash_console_flush
()
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
Out
:
return
-
1
on
error
else
return
0
.
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*/
func
plat_crash_console_flush
mov_imm
x0
,
CRASH_CONSOLE_BASE
b
console_core_flush
endfunc
plat_crash_console_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
void
plat_report_exception
(
unsigned
int
type
)
*
void
plat_report_exception
(
unsigned
int
type
)
*
Function
to
report
an
unhandled
exception
*
Function
to
report
an
unhandled
exception
...
...
plat/imx/common/imx8_helpers.S
View file @
deca6584
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
.
globl
plat_secondary_cold_boot_setup
.
globl
plat_secondary_cold_boot_setup
.
globl
plat_crash_console_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
.
globl
platform_mem_init
.
globl
platform_mem_init
.
globl
imx_mailbox_init
.
globl
imx_mailbox_init
...
@@ -106,6 +107,7 @@ func plat_secondary_cold_boot_setup
...
@@ -106,6 +107,7 @@ func plat_secondary_cold_boot_setup
endfunc
plat_secondary_cold_boot_setup
endfunc
plat_secondary_cold_boot_setup
func
plat_crash_console_init
func
plat_crash_console_init
mov
x0
,
#
1
ret
ret
endfunc
plat_crash_console_init
endfunc
plat_crash_console_init
...
@@ -113,6 +115,11 @@ func plat_crash_console_putc
...
@@ -113,6 +115,11 @@ func plat_crash_console_putc
ret
ret
endfunc
plat_crash_console_putc
endfunc
plat_crash_console_putc
func
plat_crash_console_flush
mov
x0
,
#
0
ret
endfunc
plat_crash_console_flush
func
platform_mem_init
func
platform_mem_init
ret
ret
endfunc
platform_mem_init
endfunc
platform_mem_init
plat/imx/imx7/warp7/aarch32/warp7_helpers.S
View file @
deca6584
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
.
globl
plat_get_my_entrypoint
.
globl
plat_get_my_entrypoint
.
globl
plat_crash_console_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
.
globl
plat_panic_handler
.
globl
plat_panic_handler
/
*
---------------------------------------------
/
*
---------------------------------------------
...
@@ -45,6 +46,12 @@ func plat_crash_console_putc
...
@@ -45,6 +46,12 @@ func plat_crash_console_putc
b
imx_crash_uart_putc
b
imx_crash_uart_putc
endfunc
plat_crash_console_putc
endfunc
plat_crash_console_putc
func
plat_crash_console_flush
/
*
Placeholder
*/
mov
r0
,
#
0
bx
lr
endfunc
plat_crash_console_flush
func
plat_panic_handler
func
plat_panic_handler
mov
r3
,
#
HAB_ROM_VECTOR_TABLE_FAILSAFE
mov
r3
,
#
HAB_ROM_VECTOR_TABLE_FAILSAFE
ldr
r3
,
[
r3
,
#
0
]
ldr
r3
,
[
r3
,
#
0
]
...
...
plat/marvell/common/aarch64/marvell_helpers.S
View file @
deca6584
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
.
weak
plat_my_core_pos
.
weak
plat_my_core_pos
.
globl
plat_crash_console_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
.
globl
platform_mem_init
.
globl
platform_mem_init
.
globl
disable_mmu_dcache
.
globl
disable_mmu_dcache
.
globl
invalidate_tlb_all
.
globl
invalidate_tlb_all
...
@@ -79,6 +80,19 @@ func plat_crash_console_putc
...
@@ -79,6 +80,19 @@ func plat_crash_console_putc
b
console_core_putc
b
console_core_putc
endfunc
plat_crash_console_putc
endfunc
plat_crash_console_putc
/
*
---------------------------------------------
*
int
plat_crash_console_flush
()
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
Out
:
return
-
1
on
error
else
return
0
.
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*/
func
plat_crash_console_flush
mov_imm
x0
,
PLAT_MARVELL_CRASH_UART_BASE
b
console_core_flush
endfunc
plat_crash_console_flush
/
*
---------------------------------------------------------------------
/
*
---------------------------------------------------------------------
*
We
don
't need to carry out any memory initialization on ARM
*
We
don
't need to carry out any memory initialization on ARM
*
platforms
.
The
Secure
RAM
is
accessible
straight
away
.
*
platforms
.
The
Secure
RAM
is
accessible
straight
away
.
...
...
plat/nvidia/tegra/common/aarch64/tegra_helpers.S
View file @
deca6584
/*
/*
*
Copyright
(
c
)
2015
-
201
7
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2015
-
201
8
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
.
globl
platform_mem_init
.
globl
platform_mem_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
.
globl
tegra_secure_entrypoint
.
globl
tegra_secure_entrypoint
.
globl
plat_reset_handler
.
globl
plat_reset_handler
...
@@ -240,6 +241,20 @@ func plat_crash_console_putc
...
@@ -240,6 +241,20 @@ func plat_crash_console_putc
b
console_core_putc
b
console_core_putc
endfunc
plat_crash_console_putc
endfunc
plat_crash_console_putc
/
*
---------------------------------------------
*
int
plat_crash_console_flush
()
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
Out
:
return
-
1
on
error
else
return
0
.
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*/
func
plat_crash_console_flush
adr
x0
,
tegra_console_base
ldr
x0
,
[
x0
]
b
console_core_flush
endfunc
plat_crash_console_flush
/
*
---------------------------------------------------
/
*
---------------------------------------------------
*
Function
to
handle
a
platform
reset
and
store
*
Function
to
handle
a
platform
reset
and
store
*
input
parameters
passed
by
BL2
.
*
input
parameters
passed
by
BL2
.
...
...
plat/rockchip/rk3328/platform.mk
View file @
deca6584
...
@@ -29,6 +29,7 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
...
@@ -29,6 +29,7 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
PLAT_BL_COMMON_SOURCES
:=
lib/xlat_tables/aarch64/xlat_tables.c
\
PLAT_BL_COMMON_SOURCES
:=
lib/xlat_tables/aarch64/xlat_tables.c
\
lib/xlat_tables/xlat_tables_common.c
\
lib/xlat_tables/xlat_tables_common.c
\
plat/common/aarch64/crash_console_helpers.S
\
plat/common/plat_psci_common.c
plat/common/plat_psci_common.c
BL31_SOURCES
+=
${RK_GIC_SOURCES}
\
BL31_SOURCES
+=
${RK_GIC_SOURCES}
\
...
...
plat/rockchip/rk3368/platform.mk
View file @
deca6584
...
@@ -26,6 +26,7 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
...
@@ -26,6 +26,7 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
PLAT_BL_COMMON_SOURCES
:=
lib/xlat_tables/xlat_tables_common.c
\
PLAT_BL_COMMON_SOURCES
:=
lib/xlat_tables/xlat_tables_common.c
\
lib/xlat_tables/aarch64/xlat_tables.c
\
lib/xlat_tables/aarch64/xlat_tables.c
\
plat/common/aarch64/crash_console_helpers.S
\
plat/common/plat_psci_common.c
plat/common/plat_psci_common.c
BL31_SOURCES
+=
${RK_GIC_SOURCES}
\
BL31_SOURCES
+=
${RK_GIC_SOURCES}
\
...
...
plat/rockchip/rk3399/platform.mk
View file @
deca6584
...
@@ -32,6 +32,7 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
...
@@ -32,6 +32,7 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
PLAT_BL_COMMON_SOURCES
:=
lib/xlat_tables/xlat_tables_common.c
\
PLAT_BL_COMMON_SOURCES
:=
lib/xlat_tables/xlat_tables_common.c
\
lib/xlat_tables/aarch64/xlat_tables.c
\
lib/xlat_tables/aarch64/xlat_tables.c
\
plat/common/aarch64/crash_console_helpers.S
\
plat/common/plat_psci_common.c
plat/common/plat_psci_common.c
BL31_SOURCES
+=
${RK_GIC_SOURCES}
\
BL31_SOURCES
+=
${RK_GIC_SOURCES}
\
...
...
plat/ti/k3/common/k3_helpers.S
View file @
deca6584
...
@@ -100,13 +100,13 @@ endfunc plat_my_core_pos
...
@@ -100,13 +100,13 @@ endfunc plat_my_core_pos
*
Clobber
list
:
x0
-
x4
*
Clobber
list
:
x0
-
x4
*
---------------------------------------------
*
---------------------------------------------
*/
*/
.
globl
plat_crash_console_init
func
plat_crash_console_init
func
plat_crash_console_init
mov_imm
x0
,
CRASH_CONSOLE_BASE
mov_imm
x0
,
CRASH_CONSOLE_BASE
mov_imm
x1
,
CRASH_CONSOLE_CLK
mov_imm
x1
,
CRASH_CONSOLE_CLK
mov_imm
x2
,
CRASH_CONSOLE_BAUD_RATE
mov_imm
x2
,
CRASH_CONSOLE_BAUD_RATE
mov
w3
,
#
0x0
mov
w3
,
#
0x0
b
console_core_init
b
console_16550_core_init
endfunc
plat_crash_console_init
endfunc
plat_crash_console_init
/
*
---------------------------------------------
/
*
---------------------------------------------
...
@@ -116,7 +116,22 @@ endfunc plat_crash_console_init
...
@@ -116,7 +116,22 @@ endfunc plat_crash_console_init
*
Clobber
list
:
x1
,
x2
*
Clobber
list
:
x1
,
x2
*
---------------------------------------------
*
---------------------------------------------
*/
*/
.
globl
plat_crash_console_putc
func
plat_crash_console_putc
func
plat_crash_console_putc
mov_imm
x1
,
CRASH_CONSOLE_BASE
mov_imm
x1
,
CRASH_CONSOLE_BASE
b
console_core_putc
b
console_
16550_
core_putc
endfunc
plat_crash_console_putc
endfunc
plat_crash_console_putc
/
*
---------------------------------------------
*
int
plat_crash_console_flush
()
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
Out
:
return
-
1
on
error
else
return
0
.
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*/
.
globl
plat_crash_console_flush
func
plat_crash_console_flush
mov_imm
x0
,
CRASH_CONSOLE_BASE
b
console_16550_core_flush
endfunc
plat_crash_console_flush
plat/xilinx/zynqmp/aarch64/zynqmp_helpers.S
View file @
deca6584
/*
/*
*
Copyright
(
c
)
2013
-
201
6
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2013
-
201
8
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -10,6 +10,12 @@
...
@@ -10,6 +10,12 @@
.
globl
plat_secondary_cold_boot_setup
.
globl
plat_secondary_cold_boot_setup
.
globl
plat_is_my_cpu_primary
.
globl
plat_is_my_cpu_primary
.
globl
zynqmp_calc_core_pos
.
globl
plat_my_core_pos
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_crash_console_flush
.
globl
platform_mem_init
/
*
-----------------------------------------------------
/
*
-----------------------------------------------------
*
void
plat_secondary_cold_boot_setup
(
void
)
;
*
void
plat_secondary_cold_boot_setup
(
void
)
;
...
@@ -47,3 +53,76 @@ func plat_is_my_cpu_primary
...
@@ -47,3 +53,76 @@ func plat_is_my_cpu_primary
cset
x0
,
eq
cset
x0
,
eq
ret
x9
ret
x9
endfunc
plat_is_my_cpu_primary
endfunc
plat_is_my_cpu_primary
/
*
-----------------------------------------------------
*
unsigned
int
plat_my_core_pos
(
void
)
*
This
function
uses
the
zynqmp_calc_core_pos
()
*
definition
to
get
the
index
of
the
calling
CPU
.
*
-----------------------------------------------------
*/
func
plat_my_core_pos
mrs
x0
,
mpidr_el1
b
zynqmp_calc_core_pos
endfunc
plat_my_core_pos
/
*
-----------------------------------------------------
*
unsigned
int
zynqmp_calc_core_pos
(
u_register_t
mpidr
)
*
Helper
function
to
calculate
the
core
position
.
*
With
this
function
:
CorePos
=
(
ClusterId
*
4
)
+
*
CoreId
*
-----------------------------------------------------
*/
func
zynqmp_calc_core_pos
and
x1
,
x0
,
#
MPIDR_CPU_MASK
and
x0
,
x0
,
#
MPIDR_CLUSTER_MASK
add
x0
,
x1
,
x0
,
LSR
#
6
ret
endfunc
zynqmp_calc_core_pos
/
*
---------------------------------------------
*
int
plat_crash_console_init
(
void
)
*
Function
to
initialize
the
crash
console
*
without
a
C
Runtime
to
print
crash
report
.
*
Clobber
list
:
x0
-
x4
*
---------------------------------------------
*/
func
plat_crash_console_init
mov_imm
x0
,
ZYNQMP_CRASH_UART_BASE
mov_imm
x1
,
ZYNQMP_CRASH_UART_CLK_IN_HZ
mov_imm
x2
,
ZYNQMP_UART_BAUDRATE
b
console_core_init
endfunc
plat_crash_console_init
/
*
---------------------------------------------
*
int
plat_crash_console_putc
(
int
c
)
*
Function
to
print
a
character
on
the
crash
*
console
without
a
C
Runtime
.
*
Clobber
list
:
x1
,
x2
*
---------------------------------------------
*/
func
plat_crash_console_putc
mov_imm
x1
,
ZYNQMP_CRASH_UART_BASE
b
console_core_putc
endfunc
plat_crash_console_putc
/
*
---------------------------------------------
*
int
plat_crash_console_flush
()
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
Out
:
return
-
1
on
error
else
return
0
.
*
Clobber
list
:
r0
*
---------------------------------------------
*/
func
plat_crash_console_flush
mov_imm
x0
,
ZYNQMP_CRASH_UART_BASE
b
console_core_flush
endfunc
plat_crash_console_flush
/
*
---------------------------------------------------------------------
*
We
don
't need to carry out any memory initialization on ARM
*
platforms
.
The
Secure
RAM
is
accessible
straight
away
.
*
---------------------------------------------------------------------
*/
func
platform_mem_init
ret
endfunc
platform_mem_init
plat/xilinx/zynqmp/plat_zynqmp.c
View file @
deca6584
/*
/*
* Copyright (c) 2015-201
6
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
#include <plat_arm.h>
#include <platform.h>
#include "zynqmp_private.h"
int
plat_core_pos_by_mpidr
(
u_register_t
mpidr
)
int
plat_core_pos_by_mpidr
(
u_register_t
mpidr
)
{
{
...
@@ -14,5 +15,5 @@ int plat_core_pos_by_mpidr(u_register_t mpidr)
...
@@ -14,5 +15,5 @@ int plat_core_pos_by_mpidr(u_register_t mpidr)
if
((
mpidr
&
MPIDR_CPU_MASK
)
>=
PLATFORM_CORE_COUNT
)
if
((
mpidr
&
MPIDR_CPU_MASK
)
>=
PLATFORM_CORE_COUNT
)
return
-
1
;
return
-
1
;
return
plat_arm
_calc_core_pos
(
mpidr
);
return
zynqmp
_calc_core_pos
(
mpidr
);
}
}
plat/xilinx/zynqmp/platform.mk
View file @
deca6584
...
@@ -64,7 +64,6 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
...
@@ -64,7 +64,6 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
drivers/arm/gic/v2/gicv2_helpers.c
\
drivers/arm/gic/v2/gicv2_helpers.c
\
drivers/cadence/uart/aarch64/cdns_console.S
\
drivers/cadence/uart/aarch64/cdns_console.S
\
drivers/console/aarch64/console.S
\
drivers/console/aarch64/console.S
\
plat/arm/common/aarch64/arm_helpers.S
\
plat/arm/common/arm_cci.c
\
plat/arm/common/arm_cci.c
\
plat/arm/common/arm_common.c
\
plat/arm/common/arm_common.c
\
plat/arm/common/arm_gicv2.c
\
plat/arm/common/arm_gicv2.c
\
...
...
plat/xilinx/zynqmp/zynqmp_def.h
View file @
deca6584
...
@@ -145,13 +145,11 @@
...
@@ -145,13 +145,11 @@
# error "invalid ZYNQMP_CONSOLE"
# error "invalid ZYNQMP_CONSOLE"
#endif
#endif
#define
PLAT_ARM
_CRASH_UART_BASE ZYNQMP_UART_BASE
#define
ZYNQMP
_CRASH_UART_BASE
ZYNQMP_UART_BASE
/* impossible to call C routine how it is done now - hardcode any value */
/* impossible to call C routine how it is done now - hardcode any value */
#define PLAT_ARM_CRASH_UART_CLK_IN_HZ 100000000
/* FIXME */
#define ZYNQMP_CRASH_UART_CLK_IN_HZ 100000000
/* FIXME */
/* Must be non zero */
/* Must be non zero */
#define ZYNQMP_UART_BAUDRATE 115200
#define ZYNQMP_UART_BAUDRATE 115200
#define ARM_CONSOLE_BAUDRATE ZYNQMP_UART_BAUDRATE
/* Silicon version detection */
/* Silicon version detection */
#define ZYNQMP_SILICON_VER_MASK 0xF000
#define ZYNQMP_SILICON_VER_MASK 0xF000
...
...
Prev
1
2
Next
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