Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
7ae80e5e
Commit
7ae80e5e
authored
5 years ago
by
Manish Pandey
Committed by
TrustedFirmware Code Review
5 years ago
Browse files
Options
Download
Plain Diff
Merge "zynqmp: pm_service: Add support to query max divisor" into integration
parents
24d7deb8
5e07b700
master
v2.5
v2.5-rc1
v2.5-rc0
v2.4
v2.4-rc2
v2.4-rc1
v2.4-rc0
v2.3
v2.3-rc2
v2.3-rc1
v2.3-rc0
arm_cca_v0.2
arm_cca_v0.1
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
plat/xilinx/zynqmp/pm_service/pm_api_clock.c
+36
-0
plat/xilinx/zynqmp/pm_service/pm_api_clock.c
plat/xilinx/zynqmp/pm_service/pm_api_clock.h
+3
-0
plat/xilinx/zynqmp/pm_service/pm_api_clock.h
plat/xilinx/zynqmp/pm_service/pm_api_sys.c
+22
-0
plat/xilinx/zynqmp/pm_service/pm_api_sys.c
plat/xilinx/zynqmp/pm_service/pm_api_sys.h
+1
-0
plat/xilinx/zynqmp/pm_service/pm_api_sys.h
with
62 additions
and
0 deletions
+62
-0
plat/xilinx/zynqmp/pm_service/pm_api_clock.c
View file @
7ae80e5e
...
...
@@ -2620,6 +2620,42 @@ enum pm_ret_status pm_api_clock_get_attributes(unsigned int clock_id,
return
PM_RET_SUCCESS
;
}
/**
* pm_api_clock_get_max_divisor - PM call to get max divisor
* @clock_id Clock ID
* @div_type Divisor Type (TYPE_DIV1 or TYPE_DIV2)
* @max_div Maximum supported divisor
*
* This function is used by master to get maximum supported value.
*
* Return: Returns status, either success or error+reason.
*/
enum
pm_ret_status
pm_api_clock_get_max_divisor
(
enum
clock_id
clock_id
,
uint8_t
div_type
,
uint32_t
*
max_div
)
{
uint32_t
i
;
struct
pm_clock_node
*
nodes
;
if
(
clock_id
>=
CLK_MAX_OUTPUT_CLK
)
return
PM_RET_ERROR_ARGS
;
nodes
=
*
clocks
[
clock_id
].
nodes
;
for
(
i
=
0
;
i
<
clocks
[
clock_id
].
num_nodes
;
i
++
)
{
if
(
nodes
[
i
].
type
==
div_type
)
{
if
(
CLK_DIVIDER_POWER_OF_TWO
&
nodes
[
i
].
typeflags
)
{
*
max_div
=
(
1
<<
(
BIT
(
nodes
[
i
].
width
)
-
1
));
}
else
{
*
max_div
=
BIT
(
nodes
[
i
].
width
)
-
1
;
}
return
PM_RET_SUCCESS
;
}
}
return
PM_RET_ERROR_ARGS
;
}
/**
* struct pm_pll - PLL related data required to map IOCTL-based PLL control
* implemented by linux to system-level EEMI APIs
...
...
This diff is collapsed.
Click to expand it.
plat/xilinx/zynqmp/pm_service/pm_api_clock.h
View file @
7ae80e5e
...
...
@@ -307,6 +307,9 @@ enum pm_ret_status pm_api_clock_get_parents(unsigned int clock_id,
uint32_t
*
parents
);
enum
pm_ret_status
pm_api_clock_get_attributes
(
unsigned
int
clock_id
,
uint32_t
*
attr
);
enum
pm_ret_status
pm_api_clock_get_max_divisor
(
enum
clock_id
clock_id
,
uint8_t
div_type
,
uint32_t
*
max_div
);
enum
pm_ret_status
pm_clock_get_pll_node_id
(
enum
clock_id
clock_id
,
enum
pm_node_id
*
node_id
);
...
...
This diff is collapsed.
Click to expand it.
plat/xilinx/zynqmp/pm_service/pm_api_sys.c
View file @
7ae80e5e
...
...
@@ -756,6 +756,23 @@ enum pm_ret_status pm_ioctl(enum pm_node_id nid,
return
pm_api_ioctl
(
nid
,
ioctl_id
,
arg1
,
arg2
,
value
);
}
/**
* pm_clock_get_max_divisor - PM call to get max divisor
* @clock_id Clock ID
* @div_type Divisor ID (TYPE_DIV1 or TYPE_DIV2)
* @max_div Maximum supported divisor
*
* This function is used by master to get maximum supported value.
*
* Return: Returns status, either success or error+reason.
*/
static
enum
pm_ret_status
pm_clock_get_max_divisor
(
unsigned
int
clock_id
,
uint8_t
div_type
,
uint32_t
*
max_div
)
{
return
pm_api_clock_get_max_divisor
(
clock_id
,
div_type
,
max_div
);
}
/**
* pm_clock_get_num_clocks - PM call to request number of clocks
* @nclockss: Number of clocks
...
...
@@ -1338,6 +1355,11 @@ enum pm_ret_status pm_query_data(enum pm_query_id qid,
ret
=
pm_clock_get_num_clocks
(
&
data
[
1
]);
data
[
0
]
=
(
unsigned
int
)
ret
;
break
;
case
PM_QID_CLOCK_GET_MAX_DIVISOR
:
ret
=
pm_clock_get_max_divisor
(
arg1
,
arg2
,
&
data
[
1
]);
data
[
0
]
=
(
unsigned
int
)
ret
;
break
;
default:
ret
=
PM_RET_ERROR_ARGS
;
WARN
(
"Unimplemented query service call: 0x%x
\n
"
,
qid
);
...
...
This diff is collapsed.
Click to expand it.
plat/xilinx/zynqmp/pm_service/pm_api_sys.h
View file @
7ae80e5e
...
...
@@ -25,6 +25,7 @@ enum pm_query_id {
PM_QID_PINCTRL_GET_FUNCTION_GROUPS
,
PM_QID_PINCTRL_GET_PIN_GROUPS
,
PM_QID_CLOCK_GET_NUM_CLOCKS
,
PM_QID_CLOCK_GET_MAX_DIVISOR
,
};
/**********************************************************
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help