mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
feat(nxp-clk): add get_rate for partition objects
The partition-related objects do not participate in clock rate calculation, except the s32cc_part_block_link_t, whose call is forwarded to the parent object. Change-Id: Id9e7fa49c3c1fb5b30b4c1b97fc8441bc967578a Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
This commit is contained in:
parent
d1567da68d
commit
a74cf75f08
1 changed files with 25 additions and 0 deletions
|
@ -958,6 +958,22 @@ get_part_block_link_parent(const struct s32cc_clk_obj *module)
|
|||
return link->parent;
|
||||
}
|
||||
|
||||
static int get_part_block_link_freq(const struct s32cc_clk_obj *module,
|
||||
const struct s32cc_clk_drv *drv,
|
||||
unsigned long *rate, unsigned int depth)
|
||||
{
|
||||
const struct s32cc_part_block_link *block = s32cc_obj2partblocklink(module);
|
||||
unsigned int ldepth = depth;
|
||||
int ret;
|
||||
|
||||
ret = update_stack_depth(&ldepth);
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return get_module_rate(block->parent, drv, rate, ldepth);
|
||||
}
|
||||
|
||||
static int no_enable(struct s32cc_clk_obj *module,
|
||||
const struct s32cc_clk_drv *drv,
|
||||
unsigned int depth)
|
||||
|
@ -1667,6 +1683,15 @@ static int get_module_rate(const struct s32cc_clk_obj *module,
|
|||
case s32cc_shared_clkmux_t:
|
||||
ret = get_mux_freq(module, drv, rate, ldepth);
|
||||
break;
|
||||
case s32cc_part_t:
|
||||
ERROR("s32cc_part_t cannot be used to get rate\n");
|
||||
break;
|
||||
case s32cc_part_block_t:
|
||||
ERROR("s32cc_part_block_t cannot be used to get rate\n");
|
||||
break;
|
||||
case s32cc_part_block_link_t:
|
||||
ret = get_part_block_link_freq(module, drv, rate, ldepth);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue