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
51b57481
Commit
51b57481
authored
Feb 01, 2016
by
danh-arm
Browse files
Merge pull request #501 from jcastillo-arm/jc/tf-issues/300
Disable PL011 UART before configuring it
parents
7b46d0d8
9400b40e
Changes
7
Hide whitespace changes
Inline
Side-by-side
docs/porting-guide.md
View file @
51b57481
...
...
@@ -1860,7 +1860,7 @@ they can be invoked without a C Runtime stack.
Return : int
This API is used by the crash reporting mechanism to initialize the crash
console. It
should
only use the general purpose registers x0 to x
2
to do the
console. It
must
only use the general purpose registers x0 to x
4
to do the
initialization and returns 1 on success.
### Function : plat_crash_console_putc
...
...
@@ -1869,7 +1869,7 @@ initialization and returns 1 on success.
Return : int
This API is used by the crash reporting mechanism to print a character on the
designated crash console. It
should
only use general purpose registers x1 and
designated crash console. It
must
only use general purpose registers x1 and
x2 to do its work. The parameter and the return value are in general purpose
register x0.
...
...
drivers/arm/pl011/pl011_console.S
View file @
51b57481
...
...
@@ -54,7 +54,7 @@
*
w1
-
Uart
clock
in
Hz
*
w2
-
Baud
rate
*
Out
:
return
1
on
success
else
0
on
error
*
Clobber
list
:
x1
,
x2
*
Clobber
list
:
x1
,
x2
,
x3
,
x4
*
-----------------------------------------------
*/
func
console_core_init
...
...
@@ -64,6 +64,20 @@ func console_core_init
/
*
Check
baud
rate
and
uart
clock
for
sanity
*/
cbz
w1
,
core_init_fail
cbz
w2
,
core_init_fail
/
*
Disable
uart
before
programming
*/
ldr
w3
,
[
x0
,
#
UARTCR
]
mov
w4
,
#
PL011_UARTCR_UARTEN
bic
w3
,
w3
,
w4
str
w3
,
[
x0
,
#
UARTCR
]
/
*
Flush
the
transmit
FIFO
*/
ldr
w3
,
[
x0
,
#
UARTLCR_H
]
mov
w4
,
#
PL011_UARTLCR_H_FEN
bic
w3
,
w3
,
w4
str
w3
,
[
x0
,
#
UARTLCR_H
]
/
*
Wait
for
the
end
of
Tx
of
current
character
*/
busy_loop
:
ldr
w3
,
[
x0
,
#
UARTFR
]
tbnz
w3
,
#
PL011_UARTFR_BUSY_BIT
,
busy_loop
/
*
Program
the
baudrate
*/
/
*
Divisor
=
(
Uart
clock
*
4
)
/
baudrate
*/
lsl
w1
,
w1
,
#
2
...
...
drivers/console/console.S
View file @
51b57481
...
...
@@ -54,7 +54,7 @@
*
w1
-
Uart
clock
in
Hz
*
w2
-
Baud
rate
*
out
:
return
1
on
success
else
0
on
error
*
Clobber
list
:
x1
-
x
3
*
Clobber
list
:
x1
-
x
4
*
-----------------------------------------------
*/
func
console_init
...
...
include/drivers/arm/pl011.h
View file @
51b57481
...
...
@@ -71,6 +71,7 @@
#define PL011_UARTFR_TXFF_BIT 5
/* Transmit FIFO full bit in UARTFR register */
#define PL011_UARTFR_RXFE_BIT 4
/* Receive FIFO empty bit in UARTFR register */
#define PL011_UARTFR_BUSY_BIT 3
/* UART busy bit in UARTFR register */
/* Control reg bits */
#if !PL011_GENERIC_UART
...
...
plat/arm/common/aarch64/arm_helpers.S
View file @
51b57481
...
...
@@ -66,7 +66,7 @@ endfunc plat_arm_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
,
x1
,
x
2
*
Clobber
list
:
x0
-
x
4
*
---------------------------------------------
*/
func
plat_crash_console_init
...
...
plat/mediatek/mt8173/aarch64/plat_helpers.S
View file @
51b57481
...
...
@@ -63,7 +63,7 @@ endfunc platform_is_primary_cpu
*
int
plat_crash_console_init
(
void
)
*
Function
to
initialize
the
crash
console
*
without
a
C
Runtime
to
print
crash
report
.
*
Clobber
list
:
x0
,
x1
,
x
2
*
Clobber
list
:
x0
-
x
4
*
---------------------------------------------
*/
func
plat_crash_console_init
...
...
plat/nvidia/tegra/common/aarch64/tegra_helpers.S
View file @
51b57481
...
...
@@ -186,7 +186,7 @@ endfunc platform_mem_init
*
int
plat_crash_console_init
(
void
)
*
Function
to
initialize
the
crash
console
*
without
a
C
Runtime
to
print
crash
report
.
*
Clobber
list
:
x0
,
x1
,
x
2
*
Clobber
list
:
x0
-
x
4
*
---------------------------------------------
*/
func
plat_crash_console_init
...
...
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