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
1f06ca8a
Commit
1f06ca8a
authored
Jul 17, 2015
by
danh-arm
Browse files
Merge pull request #332 from jcastillo-arm/jc/tf-issues/214
Use uintptr_t as base address type in ARM driver APIs
parents
7bcbb962
02462972
Changes
15
Show whitespace changes
Inline
Side-by-side
drivers/arm/cci/cci.c
View file @
1f06ca8a
...
...
@@ -33,8 +33,9 @@
#include <cci.h>
#include <debug.h>
#include <mmio.h>
#include <stdint.h>
static
u
nsigned
long
g_cci_base
;
static
u
intptr_t
g_cci_base
;
static
unsigned
int
g_max_master_id
;
static
const
int
*
g_cci_slave_if_map
;
...
...
@@ -74,7 +75,7 @@ static int validate_cci_map(const int *map)
}
#endif
/* DEBUG */
void
cci_init
(
u
nsigned
long
cci_base
,
void
cci_init
(
u
intptr_t
cci_base
,
const
int
*
map
,
unsigned
int
num_cci_masters
)
{
...
...
drivers/arm/cci400/cci400.c
View file @
1f06ca8a
...
...
@@ -33,14 +33,15 @@
#include <cci400.h>
#include <debug.h>
#include <mmio.h>
#include <stdint.h>
#define MAX_CLUSTERS 2
static
u
nsigned
long
cci_base_addr
;
static
u
intptr_t
cci_base_addr
;
static
unsigned
int
cci_cluster_ix_to_iface
[
MAX_CLUSTERS
];
void
cci_init
(
u
nsigned
long
cci_base
,
void
cci_init
(
u
intptr_t
cci_base
,
int
slave_iface3_cluster_ix
,
int
slave_iface4_cluster_ix
)
{
...
...
drivers/arm/gic/arm_gic.c
View file @
1f06ca8a
...
...
@@ -47,9 +47,9 @@
(GIC_HIGHEST_NS_PRIORITY << 16) | \
(GIC_HIGHEST_NS_PRIORITY << 24))
static
u
nsigned
in
t
g_gicc_base
;
static
u
nsigned
in
t
g_gicd_base
;
static
u
nsigned
long
g_gicr_base
;
static
u
intptr_
t
g_gicc_base
;
static
u
intptr_
t
g_gicd_base
;
static
u
intptr_t
g_gicr_base
;
static
const
unsigned
int
*
g_irq_sec_ptr
;
static
unsigned
int
g_num_irqs
;
...
...
@@ -323,12 +323,11 @@ static void arm_gic_distif_setup(void)
/*******************************************************************************
* Initialize the ARM GIC driver with the provided platform inputs
******************************************************************************/
void
arm_gic_init
(
u
nsigned
in
t
gicc_base
,
unsigned
in
t
gicd_base
,
unsigned
long
gicr_base
,
void
arm_gic_init
(
u
intptr_
t
gicc_base
,
uintptr_
t
gicd_base
,
uintptr_t
gicr_base
,
const
unsigned
int
*
irq_sec_ptr
,
unsigned
int
num_irqs
)
unsigned
int
num_irqs
)
{
unsigned
int
val
;
...
...
drivers/arm/gic/gic_v2.c
View file @
1f06ca8a
...
...
@@ -38,73 +38,73 @@
* GIC Distributor interface accessors for reading entire registers
******************************************************************************/
unsigned
int
gicd_read_igroupr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_igroupr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
IGROUPR_SHIFT
;
return
mmio_read_32
(
base
+
GICD_IGROUPR
+
(
n
<<
2
));
}
unsigned
int
gicd_read_isenabler
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_isenabler
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
ISENABLER_SHIFT
;
return
mmio_read_32
(
base
+
GICD_ISENABLER
+
(
n
<<
2
));
}
unsigned
int
gicd_read_icenabler
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_icenabler
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
ICENABLER_SHIFT
;
return
mmio_read_32
(
base
+
GICD_ICENABLER
+
(
n
<<
2
));
}
unsigned
int
gicd_read_ispendr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_ispendr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
ISPENDR_SHIFT
;
return
mmio_read_32
(
base
+
GICD_ISPENDR
+
(
n
<<
2
));
}
unsigned
int
gicd_read_icpendr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_icpendr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
ICPENDR_SHIFT
;
return
mmio_read_32
(
base
+
GICD_ICPENDR
+
(
n
<<
2
));
}
unsigned
int
gicd_read_isactiver
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_isactiver
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
ISACTIVER_SHIFT
;
return
mmio_read_32
(
base
+
GICD_ISACTIVER
+
(
n
<<
2
));
}
unsigned
int
gicd_read_icactiver
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_icactiver
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
ICACTIVER_SHIFT
;
return
mmio_read_32
(
base
+
GICD_ICACTIVER
+
(
n
<<
2
));
}
unsigned
int
gicd_read_ipriorityr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_ipriorityr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
IPRIORITYR_SHIFT
;
return
mmio_read_32
(
base
+
GICD_IPRIORITYR
+
(
n
<<
2
));
}
unsigned
int
gicd_read_itargetsr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_itargetsr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
ITARGETSR_SHIFT
;
return
mmio_read_32
(
base
+
GICD_ITARGETSR
+
(
n
<<
2
));
}
unsigned
int
gicd_read_icfgr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_icfgr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
ICFGR_SHIFT
;
return
mmio_read_32
(
base
+
GICD_ICFGR
+
(
n
<<
2
));
}
unsigned
int
gicd_read_cpendsgir
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_cpendsgir
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
CPENDSGIR_SHIFT
;
return
mmio_read_32
(
base
+
GICD_CPENDSGIR
+
(
n
<<
2
));
}
unsigned
int
gicd_read_spendsgir
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_read_spendsgir
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
n
=
id
>>
SPENDSGIR_SHIFT
;
return
mmio_read_32
(
base
+
GICD_SPENDSGIR
+
(
n
<<
2
));
...
...
@@ -114,73 +114,73 @@ unsigned int gicd_read_spendsgir(unsigned int base, unsigned int id)
* GIC Distributor interface accessors for writing entire registers
******************************************************************************/
void
gicd_write_igroupr
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_igroupr
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
IGROUPR_SHIFT
;
mmio_write_32
(
base
+
GICD_IGROUPR
+
(
n
<<
2
),
val
);
}
void
gicd_write_isenabler
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_isenabler
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
ISENABLER_SHIFT
;
mmio_write_32
(
base
+
GICD_ISENABLER
+
(
n
<<
2
),
val
);
}
void
gicd_write_icenabler
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_icenabler
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
ICENABLER_SHIFT
;
mmio_write_32
(
base
+
GICD_ICENABLER
+
(
n
<<
2
),
val
);
}
void
gicd_write_ispendr
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_ispendr
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
ISPENDR_SHIFT
;
mmio_write_32
(
base
+
GICD_ISPENDR
+
(
n
<<
2
),
val
);
}
void
gicd_write_icpendr
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_icpendr
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
ICPENDR_SHIFT
;
mmio_write_32
(
base
+
GICD_ICPENDR
+
(
n
<<
2
),
val
);
}
void
gicd_write_isactiver
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_isactiver
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
ISACTIVER_SHIFT
;
mmio_write_32
(
base
+
GICD_ISACTIVER
+
(
n
<<
2
),
val
);
}
void
gicd_write_icactiver
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_icactiver
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
ICACTIVER_SHIFT
;
mmio_write_32
(
base
+
GICD_ICACTIVER
+
(
n
<<
2
),
val
);
}
void
gicd_write_ipriorityr
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_ipriorityr
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
IPRIORITYR_SHIFT
;
mmio_write_32
(
base
+
GICD_IPRIORITYR
+
(
n
<<
2
),
val
);
}
void
gicd_write_itargetsr
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_itargetsr
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
ITARGETSR_SHIFT
;
mmio_write_32
(
base
+
GICD_ITARGETSR
+
(
n
<<
2
),
val
);
}
void
gicd_write_icfgr
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_icfgr
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
ICFGR_SHIFT
;
mmio_write_32
(
base
+
GICD_ICFGR
+
(
n
<<
2
),
val
);
}
void
gicd_write_cpendsgir
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_cpendsgir
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
CPENDSGIR_SHIFT
;
mmio_write_32
(
base
+
GICD_CPENDSGIR
+
(
n
<<
2
),
val
);
}
void
gicd_write_spendsgir
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
val
)
void
gicd_write_spendsgir
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
val
)
{
unsigned
n
=
id
>>
SPENDSGIR_SHIFT
;
mmio_write_32
(
base
+
GICD_SPENDSGIR
+
(
n
<<
2
),
val
);
...
...
@@ -189,7 +189,7 @@ void gicd_write_spendsgir(unsigned int base, unsigned int id, unsigned int val)
/*******************************************************************************
* GIC Distributor interface accessors for individual interrupt manipulation
******************************************************************************/
unsigned
int
gicd_get_igroupr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
unsigned
int
gicd_get_igroupr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
IGROUPR_SHIFT
)
-
1
);
unsigned
int
reg_val
=
gicd_read_igroupr
(
base
,
id
);
...
...
@@ -197,7 +197,7 @@ unsigned int gicd_get_igroupr(unsigned int base, unsigned int id)
return
(
reg_val
>>
bit_num
)
&
0x1
;
}
void
gicd_set_igroupr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
void
gicd_set_igroupr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
IGROUPR_SHIFT
)
-
1
);
unsigned
int
reg_val
=
gicd_read_igroupr
(
base
,
id
);
...
...
@@ -205,7 +205,7 @@ void gicd_set_igroupr(unsigned int base, unsigned int id)
gicd_write_igroupr
(
base
,
id
,
reg_val
|
(
1
<<
bit_num
));
}
void
gicd_clr_igroupr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
void
gicd_clr_igroupr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
IGROUPR_SHIFT
)
-
1
);
unsigned
int
reg_val
=
gicd_read_igroupr
(
base
,
id
);
...
...
@@ -213,42 +213,42 @@ void gicd_clr_igroupr(unsigned int base, unsigned int id)
gicd_write_igroupr
(
base
,
id
,
reg_val
&
~
(
1
<<
bit_num
));
}
void
gicd_set_isenabler
(
u
nsigned
in
t
base
,
unsigned
int
id
)
void
gicd_set_isenabler
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
ISENABLER_SHIFT
)
-
1
);
gicd_write_isenabler
(
base
,
id
,
(
1
<<
bit_num
));
}
void
gicd_set_icenabler
(
u
nsigned
in
t
base
,
unsigned
int
id
)
void
gicd_set_icenabler
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
ICENABLER_SHIFT
)
-
1
);
gicd_write_icenabler
(
base
,
id
,
(
1
<<
bit_num
));
}
void
gicd_set_ispendr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
void
gicd_set_ispendr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
ISPENDR_SHIFT
)
-
1
);
gicd_write_ispendr
(
base
,
id
,
(
1
<<
bit_num
));
}
void
gicd_set_icpendr
(
u
nsigned
in
t
base
,
unsigned
int
id
)
void
gicd_set_icpendr
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
ICPENDR_SHIFT
)
-
1
);
gicd_write_icpendr
(
base
,
id
,
(
1
<<
bit_num
));
}
void
gicd_set_isactiver
(
u
nsigned
in
t
base
,
unsigned
int
id
)
void
gicd_set_isactiver
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
ISACTIVER_SHIFT
)
-
1
);
gicd_write_isactiver
(
base
,
id
,
(
1
<<
bit_num
));
}
void
gicd_set_icactiver
(
u
nsigned
in
t
base
,
unsigned
int
id
)
void
gicd_set_icactiver
(
u
intptr_
t
base
,
unsigned
int
id
)
{
unsigned
bit_num
=
id
&
((
1
<<
ICACTIVER_SHIFT
)
-
1
);
...
...
@@ -259,7 +259,7 @@ void gicd_set_icactiver(unsigned int base, unsigned int id)
* Make sure that the interrupt's group is set before expecting
* this function to do its job correctly.
*/
void
gicd_set_ipriorityr
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
pri
)
void
gicd_set_ipriorityr
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
pri
)
{
unsigned
int
reg
=
base
+
GICD_IPRIORITYR
+
(
id
&
~
3
);
unsigned
int
shift
=
(
id
&
3
)
<<
3
;
...
...
@@ -283,7 +283,7 @@ void gicd_set_ipriorityr(unsigned int base, unsigned int id, unsigned int pri)
mmio_write_32
(
reg
,
reg_val
);
}
void
gicd_set_itargetsr
(
u
nsigned
in
t
base
,
unsigned
int
id
,
unsigned
int
target
)
void
gicd_set_itargetsr
(
u
intptr_
t
base
,
unsigned
int
id
,
unsigned
int
target
)
{
unsigned
byte_off
=
id
&
((
1
<<
ITARGETSR_SHIFT
)
-
1
);
unsigned
int
reg_val
=
gicd_read_itargetsr
(
base
,
id
);
...
...
drivers/arm/pl011/pl011_console.S
View file @
1f06ca8a
...
...
@@ -44,7 +44,7 @@
/
*
-----------------------------------------------
*
int
console_core_init
(
u
nsigned
long
base_addr
,
*
int
console_core_init
(
u
intptr_t
base_addr
,
*
unsigned
int
uart_clk
,
unsigned
int
baud_rate
)
*
Function
to
initialize
the
console
without
a
*
C
Runtime
to
print
debug
information
.
This
...
...
@@ -90,7 +90,7 @@ core_init_fail:
endfunc
console_core_init
/
*
--------------------------------------------------------
*
int
console_core_putc
(
int
c
,
u
nsigned
long
base_addr
)
*
int
console_core_putc
(
int
c
,
u
intptr_t
base_addr
)
*
Function
to
output
a
character
over
the
console
.
It
*
returns
the
character
printed
on
success
or
-
1
on
error
.
*
In
:
w0
-
character
to
be
printed
...
...
@@ -123,7 +123,7 @@ putc_error:
endfunc
console_core_putc
/
*
---------------------------------------------
*
int
console_core_getc
(
u
nsigned
long
base_addr
)
*
int
console_core_getc
(
u
intptr_t
base_addr
)
*
Function
to
get
a
character
from
the
console
.
*
It
returns
the
character
grabbed
on
success
*
or
-
1
on
error
.
...
...
drivers/arm/tzc400/tzc400.c
View file @
1f06ca8a
...
...
@@ -41,7 +41,7 @@
* Address width : Values between 32 to 64
*/
typedef
struct
tzc_instance
{
uint
64
_t
base
;
uint
ptr
_t
base
;
uint8_t
addr_width
;
uint8_t
num_filters
;
uint8_t
num_regions
;
...
...
@@ -50,27 +50,27 @@ typedef struct tzc_instance {
tzc_instance_t
tzc
;
static
inline
uint32_t
tzc_read_build_config
(
uint
64
_t
base
)
static
inline
uint32_t
tzc_read_build_config
(
uint
ptr
_t
base
)
{
return
mmio_read_32
(
base
+
BUILD_CONFIG_OFF
);
}
static
inline
uint32_t
tzc_read_gate_keeper
(
uint
64
_t
base
)
static
inline
uint32_t
tzc_read_gate_keeper
(
uint
ptr
_t
base
)
{
return
mmio_read_32
(
base
+
GATE_KEEPER_OFF
);
}
static
inline
void
tzc_write_gate_keeper
(
uint
64
_t
base
,
uint32_t
val
)
static
inline
void
tzc_write_gate_keeper
(
uint
ptr
_t
base
,
uint32_t
val
)
{
mmio_write_32
(
base
+
GATE_KEEPER_OFF
,
val
);
}
static
inline
void
tzc_write_action
(
uint
64
_t
base
,
tzc_action_t
action
)
static
inline
void
tzc_write_action
(
uint
ptr
_t
base
,
tzc_action_t
action
)
{
mmio_write_32
(
base
+
ACTION_OFF
,
action
);
}
static
inline
void
tzc_write_region_base_low
(
uint
64
_t
base
,
static
inline
void
tzc_write_region_base_low
(
uint
ptr
_t
base
,
uint32_t
region
,
uint32_t
val
)
{
...
...
@@ -78,7 +78,7 @@ static inline void tzc_write_region_base_low(uint64_t base,
REGION_NUM_OFF
(
region
),
val
);
}
static
inline
void
tzc_write_region_base_high
(
uint
64
_t
base
,
static
inline
void
tzc_write_region_base_high
(
uint
ptr
_t
base
,
uint32_t
region
,
uint32_t
val
)
{
...
...
@@ -86,7 +86,7 @@ static inline void tzc_write_region_base_high(uint64_t base,
REGION_NUM_OFF
(
region
),
val
);
}
static
inline
void
tzc_write_region_top_low
(
uint
64
_t
base
,
static
inline
void
tzc_write_region_top_low
(
uint
ptr
_t
base
,
uint32_t
region
,
uint32_t
val
)
{
...
...
@@ -94,7 +94,7 @@ static inline void tzc_write_region_top_low(uint64_t base,
REGION_NUM_OFF
(
region
),
val
);
}
static
inline
void
tzc_write_region_top_high
(
uint
64
_t
base
,
static
inline
void
tzc_write_region_top_high
(
uint
ptr
_t
base
,
uint32_t
region
,
uint32_t
val
)
{
...
...
@@ -102,7 +102,7 @@ static inline void tzc_write_region_top_high(uint64_t base,
REGION_NUM_OFF
(
region
),
val
);
}
static
inline
void
tzc_write_region_attributes
(
uint
64
_t
base
,
static
inline
void
tzc_write_region_attributes
(
uint
ptr
_t
base
,
uint32_t
region
,
uint32_t
val
)
{
...
...
@@ -110,7 +110,7 @@ static inline void tzc_write_region_attributes(uint64_t base,
REGION_NUM_OFF
(
region
),
val
);
}
static
inline
void
tzc_write_region_id_access
(
uint
64
_t
base
,
static
inline
void
tzc_write_region_id_access
(
uint
ptr
_t
base
,
uint32_t
region
,
uint32_t
val
)
{
...
...
@@ -118,7 +118,7 @@ static inline void tzc_write_region_id_access(uint64_t base,
REGION_NUM_OFF
(
region
),
val
);
}
static
uint32_t
tzc_read_component_id
(
uint
64
_t
base
)
static
uint32_t
tzc_read_component_id
(
uint
ptr
_t
base
)
{
uint32_t
id
;
...
...
@@ -130,7 +130,7 @@ static uint32_t tzc_read_component_id(uint64_t base)
return
id
;
}
static
uint32_t
tzc_get_gate_keeper
(
uint
64
_t
base
,
uint8_t
filter
)
static
uint32_t
tzc_get_gate_keeper
(
uint
ptr
_t
base
,
uint8_t
filter
)
{
uint32_t
tmp
;
...
...
@@ -141,7 +141,7 @@ static uint32_t tzc_get_gate_keeper(uint64_t base, uint8_t filter)
}
/* This function is not MP safe. */
static
void
tzc_set_gate_keeper
(
uint
64
_t
base
,
uint8_t
filter
,
uint32_t
val
)
static
void
tzc_set_gate_keeper
(
uint
ptr
_t
base
,
uint8_t
filter
,
uint32_t
val
)
{
uint32_t
tmp
;
...
...
@@ -164,7 +164,7 @@ static void tzc_set_gate_keeper(uint64_t base, uint8_t filter, uint32_t val)
}
void
tzc_init
(
uint
64
_t
base
)
void
tzc_init
(
uint
ptr
_t
base
)
{
uint32_t
tzc_id
,
tzc_build
;
...
...
drivers/console/console.S
View file @
1f06ca8a
...
...
@@ -44,7 +44,7 @@
console_base
:
.
quad
0x0
/
*
-----------------------------------------------
*
int
console_init
(
u
nsigned
long
base_addr
,
*
int
console_init
(
u
intptr_t
base_addr
,
*
unsigned
int
uart_clk
,
unsigned
int
baud_rate
)
*
Function
to
initialize
the
console
without
a
*
C
Runtime
to
print
debug
information
.
It
saves
...
...
drivers/console/skeleton_console.S
View file @
1f06ca8a
...
...
@@ -40,7 +40,7 @@
.
globl
console_core_getc
/
*
-----------------------------------------------
*
int
console_core_init
(
u
nsigned
long
base_addr
,
*
int
console_core_init
(
u
intptr_t
base_addr
,
*
unsigned
int
uart_clk
,
unsigned
int
baud_rate
)
*
Function
to
initialize
the
console
without
a
*
C
Runtime
to
print
debug
information
.
This
...
...
@@ -68,7 +68,7 @@ core_init_fail:
endfunc
console_core_init
/
*
--------------------------------------------------------
*
int
console_core_putc
(
int
c
,
u
nsigned
long
base_addr
)
*
int
console_core_putc
(
int
c
,
u
intptr_t
base_addr
)
*
Function
to
output
a
character
over
the
console
.
It
*
returns
the
character
printed
on
success
or
-
1
on
error
.
*
In
:
w0
-
character
to
be
printed
...
...
@@ -88,7 +88,7 @@ putc_error:
endfunc
console_core_putc
/
*
---------------------------------------------
*
int
console_core_getc
(
u
nsigned
long
base_addr
)
*
int
console_core_getc
(
u
intptr_t
base_addr
)
*
Function
to
get
a
character
from
the
console
.
*
It
returns
the
character
grabbed
on
success
*
or
-
1
on
error
.
...
...
include/drivers/arm/arm_gic.h
View file @
1f06ca8a
...
...
@@ -36,9 +36,9 @@
/*******************************************************************************
* Function declarations
******************************************************************************/
void
arm_gic_init
(
u
nsigned
in
t
gicc_base
,
unsigned
in
t
gicd_base
,
unsigned
long
gicr_base
,
void
arm_gic_init
(
u
intptr_
t
gicc_base
,
uintptr_
t
gicd_base
,
uintptr_t
gicr_base
,
const
unsigned
int
*
irq_sec_ptr
,
unsigned
int
num_irqs
);
void
arm_gic_setup
(
void
);
...
...
include/drivers/arm/cci.h
View file @
1f06ca8a
...
...
@@ -146,7 +146,7 @@
* SLAVE_IF_UNUSED should be used in the map to represent no AMBA 4 master exists
* for that interface.
*/
void
cci_init
(
u
nsigned
long
cci_base
,
void
cci_init
(
u
intptr_t
cci_base
,
const
int
*
map
,
unsigned
int
num_cci_masters
);
...
...
include/drivers/arm/cci400.h
View file @
1f06ca8a
...
...
@@ -68,6 +68,8 @@
#ifndef __ASSEMBLY__
#include <stdint.h>
/* Function declarations */
/*
...
...
@@ -79,7 +81,7 @@
* affinity instance of the mpidr representing the cluster. A negative cluster
* index indicates that no cluster is present on that slave interface.
*/
void
cci_init
(
u
nsigned
long
cci_base
,
void
cci_init
(
u
intptr_t
cci_base
,
int
slave_iface3_cluster_ix
,
int
slave_iface4_cluster_ix
);
...
...
include/drivers/arm/gic_v2.h
View file @
1f06ca8a
...
...
@@ -145,64 +145,64 @@
#ifndef __ASSEMBLY__
#include <mmio.h>
#include <stdint.h>
/*******************************************************************************
* GIC Distributor function prototypes
******************************************************************************/
unsigned
int
gicd_read_igroupr
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_isenabler
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_icenabler
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_ispendr
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_icpendr
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_isactiver
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_icactiver
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_ipriorityr
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_itargetsr
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_icfgr
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_cpendsgir
(
u
nsigned
in
t
,
unsigned
int
);
unsigned
int
gicd_read_spendsgir
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_write_igroupr
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_isenabler
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_icenabler
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_ispendr
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_icpendr
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_isactiver
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_icactiver
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_ipriorityr
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_itargetsr
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_icfgr
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_cpendsgir
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_spendsgir
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
unsigned
int
gicd_get_igroupr
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_set_igroupr
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_clr_igroupr
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_set_isenabler
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_set_icenabler
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_set_ispendr
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_set_icpendr
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_set_isactiver
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_set_icactiver
(
u
nsigned
in
t
,
unsigned
int
);
void
gicd_set_ipriorityr
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
void
gicd_set_itargetsr
(
u
nsigned
in
t
,
unsigned
int
,
unsigned
int
);
unsigned
int
gicd_read_igroupr
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_isenabler
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_icenabler
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_ispendr
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_icpendr
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_isactiver
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_icactiver
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_ipriorityr
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_itargetsr
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_icfgr
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_cpendsgir
(
u
intptr_
t
,
unsigned
int
);
unsigned
int
gicd_read_spendsgir
(
u
intptr_
t
,
unsigned
int
);
void
gicd_write_igroupr
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_isenabler
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_icenabler
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_ispendr
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_icpendr
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_isactiver
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_icactiver
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_ipriorityr
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_itargetsr
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_icfgr
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_cpendsgir
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_write_spendsgir
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
unsigned
int
gicd_get_igroupr
(
u
intptr_
t
,
unsigned
int
);
void
gicd_set_igroupr
(
u
intptr_
t
,
unsigned
int
);
void
gicd_clr_igroupr
(
u
intptr_
t
,
unsigned
int
);
void
gicd_set_isenabler
(
u
intptr_
t
,
unsigned
int
);
void
gicd_set_icenabler
(
u
intptr_
t
,
unsigned
int
);
void
gicd_set_ispendr
(
u
intptr_
t
,
unsigned
int
);
void
gicd_set_icpendr
(
u
intptr_
t
,
unsigned
int
);
void
gicd_set_isactiver
(
u
intptr_
t
,
unsigned
int
);
void
gicd_set_icactiver
(
u
intptr_
t
,
unsigned
int
);
void
gicd_set_ipriorityr
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
void
gicd_set_itargetsr
(
u
intptr_
t
,
unsigned
int
,
unsigned
int
);
/*******************************************************************************
* GIC Distributor interface accessors for reading entire registers
******************************************************************************/
static
inline
unsigned
int
gicd_read_ctlr
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicd_read_ctlr
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICD_CTLR
);
}
static
inline
unsigned
int
gicd_read_typer
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicd_read_typer
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICD_TYPER
);
}
static
inline
unsigned
int
gicd_read_sgir
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicd_read_sgir
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICD_SGIR
);
}
...
...
@@ -212,12 +212,12 @@ static inline unsigned int gicd_read_sgir(unsigned int base)
* GIC Distributor interface accessors for writing entire registers
******************************************************************************/
static
inline
void
gicd_write_ctlr
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicd_write_ctlr
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICD_CTLR
,
val
);
}
static
inline
void
gicd_write_sgir
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicd_write_sgir
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICD_SGIR
,
val
);
}
...
...
@@ -227,47 +227,47 @@ static inline void gicd_write_sgir(unsigned int base, unsigned int val)
* GIC CPU interface accessors for reading entire registers
******************************************************************************/
static
inline
unsigned
int
gicc_read_ctlr
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_ctlr
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_CTLR
);
}
static
inline
unsigned
int
gicc_read_pmr
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_pmr
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_PMR
);
}
static
inline
unsigned
int
gicc_read_BPR
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_BPR
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_BPR
);
}
static
inline
unsigned
int
gicc_read_IAR
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_IAR
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_IAR
);
}
static
inline
unsigned
int
gicc_read_EOIR
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_EOIR
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_EOIR
);
}
static
inline
unsigned
int
gicc_read_hppir
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_hppir
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_HPPIR
);
}
static
inline
unsigned
int
gicc_read_ahppir
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_ahppir
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_AHPPIR
);
}
static
inline
unsigned
int
gicc_read_dir
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_dir
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_DIR
);
}
static
inline
unsigned
int
gicc_read_iidr
(
u
nsigned
in
t
base
)
static
inline
unsigned
int
gicc_read_iidr
(
u
intptr_
t
base
)
{
return
mmio_read_32
(
base
+
GICC_IIDR
);
}
...
...
@@ -277,38 +277,38 @@ static inline unsigned int gicc_read_iidr(unsigned int base)
* GIC CPU interface accessors for writing entire registers
******************************************************************************/
static
inline
void
gicc_write_ctlr
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicc_write_ctlr
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICC_CTLR
,
val
);
}
static
inline
void
gicc_write_pmr
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicc_write_pmr
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICC_PMR
,
val
);
}
static
inline
void
gicc_write_BPR
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicc_write_BPR
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICC_BPR
,
val
);
}
static
inline
void
gicc_write_IAR
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicc_write_IAR
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICC_IAR
,
val
);
}
static
inline
void
gicc_write_EOIR
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicc_write_EOIR
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICC_EOIR
,
val
);
}
static
inline
void
gicc_write_hppir
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicc_write_hppir
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICC_HPPIR
,
val
);
}
static
inline
void
gicc_write_dir
(
u
nsigned
in
t
base
,
unsigned
int
val
)
static
inline
void
gicc_write_dir
(
u
intptr_
t
base
,
unsigned
int
val
)
{
mmio_write_32
(
base
+
GICC_DIR
,
val
);
}
...
...
include/drivers/arm/tzc400.h
View file @
1f06ca8a
...
...
@@ -189,7 +189,7 @@ typedef enum {
}
tzc_region_attributes_t
;
void
tzc_init
(
uint
64
_t
base
);
void
tzc_init
(
uint
ptr
_t
base
);
void
tzc_configure_region0
(
tzc_region_attributes_t
sec_attr
,
uint32_t
ns_device_access
);
void
tzc_configure_region
(
uint32_t
filters
,
...
...
include/drivers/console.h
View file @
1f06ca8a
...
...
@@ -31,7 +31,9 @@
#ifndef __CONSOLE_H__
#define __CONSOLE_H__
int
console_init
(
unsigned
long
base_addr
,
#include <stdint.h>
int
console_init
(
uintptr_t
base_addr
,
unsigned
int
uart_clk
,
unsigned
int
baud_rate
);
int
console_putc
(
int
c
);
int
console_getc
(
void
);
...
...
include/plat/arm/common/arm_config.h
View file @
1f06ca8a
...
...
@@ -30,6 +30,7 @@
#ifndef __ARM_CONFIG_H__
#define __ARM_CONFIG_H__
#include <stdint.h>
enum
arm_config_flags
{
/* Whether Base memory map is in use */
...
...
@@ -41,10 +42,10 @@ enum arm_config_flags {
};
typedef
struct
arm_config
{
u
nsigned
in
t
gicd_base
;
u
nsigned
in
t
gicc_base
;
u
nsigned
in
t
gich_base
;
u
nsigned
in
t
gicv_base
;
u
intptr_
t
gicd_base
;
u
intptr_
t
gicc_base
;
u
intptr_
t
gich_base
;
u
intptr_
t
gicv_base
;
unsigned
int
max_aff0
;
unsigned
int
max_aff1
;
unsigned
long
flags
;
...
...
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