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
ad8922fc
Commit
ad8922fc
authored
Feb 25, 2020
by
Mark Dykes
Committed by
TrustedFirmware Code Review
Feb 25, 2020
Browse files
Merge "meson: Use generic console_t data structure" into integration
parents
b857b833
489e2987
Changes
3
Hide whitespace changes
Inline
Side-by-side
drivers/amlogic/console/aarch64/meson_console.S
View file @
ad8922fc
...
@@ -46,14 +46,14 @@
...
@@ -46,14 +46,14 @@
/
*
-----------------------------------------------
/
*
-----------------------------------------------
*
int
console_meson_register
(
uintptr_t
base
,
*
int
console_meson_register
(
uintptr_t
base
,
*
uint32_t
clk
,
uint32_t
baud
,
*
uint32_t
clk
,
uint32_t
baud
,
*
console_
meson_
t
*
console
)
;
*
console_t
*
console
)
;
*
Function
to
initialize
and
register
a
new
MESON
*
Function
to
initialize
and
register
a
new
MESON
*
console
.
Storage
passed
in
for
the
console
struct
*
console
.
Storage
passed
in
for
the
console
struct
*
*
must
*
be
persistent
(
i
.
e
.
not
from
the
stack
)
.
*
*
must
*
be
persistent
(
i
.
e
.
not
from
the
stack
)
.
*
In
:
x0
-
UART
register
base
address
*
In
:
x0
-
UART
register
base
address
*
w1
-
UART
clock
in
Hz
*
w1
-
UART
clock
in
Hz
*
w2
-
Baud
rate
*
w2
-
Baud
rate
*
x3
-
pointer
to
empty
console_
meson_
t
struct
*
x3
-
pointer
to
empty
console_t
struct
*
Out
:
return
1
on
success
,
0
on
error
*
Out
:
return
1
on
success
,
0
on
error
*
Clobber
list
:
x0
,
x1
,
x2
,
x6
,
x7
,
x14
*
Clobber
list
:
x0
,
x1
,
x2
,
x6
,
x7
,
x14
*
-----------------------------------------------
*
-----------------------------------------------
...
@@ -62,7 +62,7 @@ func console_meson_register
...
@@ -62,7 +62,7 @@ func console_meson_register
mov
x7
,
x30
mov
x7
,
x30
mov
x6
,
x3
mov
x6
,
x3
cbz
x6
,
register_fail
cbz
x6
,
register_fail
str
x0
,
[
x6
,
#
CONSOLE_T_
MESON_
BASE
]
str
x0
,
[
x6
,
#
CONSOLE_T_BASE
]
bl
console_meson_init
bl
console_meson_init
cbz
x0
,
register_fail
cbz
x0
,
register_fail
...
@@ -128,7 +128,7 @@ init_fail:
...
@@ -128,7 +128,7 @@ init_fail:
endfunc
console_meson_init
endfunc
console_meson_init
/
*
--------------------------------------------------------
/
*
--------------------------------------------------------
*
int
console_meson_putc
(
int
c
,
console_
meson_
t
*
console
)
*
int
console_meson_putc
(
int
c
,
console_t
*
console
)
*
Function
to
output
a
character
over
the
console
.
It
*
Function
to
output
a
character
over
the
console
.
It
*
returns
the
character
printed
on
success
or
-
1
on
error
.
*
returns
the
character
printed
on
success
or
-
1
on
error
.
*
In
:
w0
-
character
to
be
printed
*
In
:
w0
-
character
to
be
printed
...
@@ -142,7 +142,7 @@ func console_meson_putc
...
@@ -142,7 +142,7 @@ func console_meson_putc
cmp
x1
,
#
0
cmp
x1
,
#
0
ASM_ASSERT
(
ne
)
ASM_ASSERT
(
ne
)
#endif /* ENABLE_ASSERTIONS */
#endif /* ENABLE_ASSERTIONS */
ldr
x1
,
[
x1
,
#
CONSOLE_T_
MESON_
BASE
]
ldr
x1
,
[
x1
,
#
CONSOLE_T_BASE
]
b
console_meson_core_putc
b
console_meson_core_putc
endfunc
console_meson_putc
endfunc
console_meson_putc
...
@@ -179,7 +179,7 @@ func console_meson_core_putc
...
@@ -179,7 +179,7 @@ func console_meson_core_putc
endfunc
console_meson_core_putc
endfunc
console_meson_core_putc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_meson_getc
(
console_
meson_
t
*
console
)
*
int
console_meson_getc
(
console_t
*
console
)
*
Function
to
get
a
character
from
the
console
.
*
Function
to
get
a
character
from
the
console
.
*
It
returns
the
character
grabbed
on
success
*
It
returns
the
character
grabbed
on
success
*
or
-
1
if
no
character
is
available
.
*
or
-
1
if
no
character
is
available
.
...
@@ -193,7 +193,7 @@ func console_meson_getc
...
@@ -193,7 +193,7 @@ func console_meson_getc
cmp
x0
,
#
0
cmp
x0
,
#
0
ASM_ASSERT
(
ne
)
ASM_ASSERT
(
ne
)
#endif /* ENABLE_ASSERTIONS */
#endif /* ENABLE_ASSERTIONS */
ldr
x0
,
[
x0
,
#
CONSOLE_T_
MESON_
BASE
]
ldr
x0
,
[
x0
,
#
CONSOLE_T_BASE
]
b
console_meson_core_getc
b
console_meson_core_getc
endfunc
console_meson_getc
endfunc
console_meson_getc
...
@@ -224,7 +224,7 @@ func console_meson_core_getc
...
@@ -224,7 +224,7 @@ func console_meson_core_getc
endfunc
console_meson_core_getc
endfunc
console_meson_core_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_meson_flush
(
console_
meson_
t
*
console
)
*
int
console_meson_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
pointer
to
console_t
structure
*
In
:
x0
-
pointer
to
console_t
structure
...
@@ -237,7 +237,7 @@ func console_meson_flush
...
@@ -237,7 +237,7 @@ func console_meson_flush
cmp
x0
,
#
0
cmp
x0
,
#
0
ASM_ASSERT
(
ne
)
ASM_ASSERT
(
ne
)
#endif /* ENABLE_ASSERTIONS */
#endif /* ENABLE_ASSERTIONS */
ldr
x0
,
[
x0
,
#
CONSOLE_T_
MESON_
BASE
]
ldr
x0
,
[
x0
,
#
CONSOLE_T_BASE
]
b
console_meson_core_flush
b
console_meson_core_flush
endfunc
console_meson_flush
endfunc
console_meson_flush
...
...
include/drivers/amlogic/meson_console.h
View file @
ad8922fc
...
@@ -9,17 +9,10 @@
...
@@ -9,17 +9,10 @@
#include <drivers/console.h>
#include <drivers/console.h>
#define CONSOLE_T_MESON_BASE CONSOLE_T_DRVDATA
#ifndef __ASSEMBLER__
#ifndef __ASSEMBLER__
#include <stdint.h>
#include <stdint.h>
typedef
struct
{
console_t
console
;
uintptr_t
base
;
}
console_meson_t
;
/*
/*
* Initialize a new meson console instance and register it with the console
* Initialize a new meson console instance and register it with the console
* framework. The |console| pointer must point to storage that will be valid
* framework. The |console| pointer must point to storage that will be valid
...
@@ -30,7 +23,7 @@ typedef struct {
...
@@ -30,7 +23,7 @@ typedef struct {
* order to make this function future-proof.
* order to make this function future-proof.
*/
*/
int
console_meson_register
(
uintptr_t
baseaddr
,
uint32_t
clock
,
uint32_t
baud
,
int
console_meson_register
(
uintptr_t
baseaddr
,
uint32_t
clock
,
uint32_t
baud
,
console_
meson_
t
*
console
);
console_t
*
console
);
#endif
/*__ASSEMBLER__*/
#endif
/*__ASSEMBLER__*/
...
...
plat/amlogic/common/aml_console.c
View file @
ad8922fc
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
/*******************************************************************************
/*******************************************************************************
* Function that sets up the console
* Function that sets up the console
******************************************************************************/
******************************************************************************/
static
console_
meson_
t
aml_console
;
static
console_t
aml_console
;
void
aml_console_init
(
void
)
void
aml_console_init
(
void
)
{
{
...
@@ -28,6 +28,6 @@ void aml_console_init(void)
...
@@ -28,6 +28,6 @@ void aml_console_init(void)
panic
();
panic
();
}
}
console_set_scope
(
&
aml_console
.
console
,
console_set_scope
(
&
aml_console
,
CONSOLE_FLAG_BOOT
|
CONSOLE_FLAG_RUNTIME
);
CONSOLE_FLAG_BOOT
|
CONSOLE_FLAG_RUNTIME
);
}
}
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