mirror of
https://github.com/apache/nuttx.git
synced 2026-10-08 23:05:20 +00:00
arch: imx9: allow last CCM root index
CCM_CR_COUNT is defined as the last CCM root index in the non-SCMI tables, and CCM_CR_PALCAMESCAN also uses that value. Use a strict greater-than check so root 94 reaches the CCM register helpers. Generated-by: OpenAI Codex Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
This commit is contained in:
parent
147134a3fb
commit
0841476239
2 changed files with 4 additions and 4 deletions
|
|
@ -67,7 +67,7 @@ int imx9_ccm_configure_root_clock(int root, int mux, uint32_t div)
|
|||
{
|
||||
uint32_t value;
|
||||
|
||||
if (root >= CCM_CR_COUNT || div == 0 || div > 255 || mux >= ROOT_MUX_MAX)
|
||||
if (root > CCM_CR_COUNT || div == 0 || div > 255 || mux >= ROOT_MUX_MAX)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ int imx9_ccm_configure_root_clock(int root, int mux, uint32_t div)
|
|||
|
||||
int imx9_ccm_root_clock_on(int root, bool enabled)
|
||||
{
|
||||
if (root >= CCM_CR_COUNT)
|
||||
if (root > CCM_CR_COUNT)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ int imx9_ccm_configure_root_clock(int root, int src, uint32_t div)
|
|||
uint32_t value;
|
||||
int i;
|
||||
|
||||
if (root >= CCM_CR_COUNT || div == 0 || div > 255)
|
||||
if (root > CCM_CR_COUNT || div == 0 || div > 255)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ int imx9_ccm_configure_root_clock(int root, int src, uint32_t div)
|
|||
|
||||
int imx9_ccm_root_clock_on(int root, bool enabled)
|
||||
{
|
||||
if (root >= CCM_CR_COUNT)
|
||||
if (root > CCM_CR_COUNT)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue