-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rk322x adds PSCI version, features and system suspend #1720
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please find some minor comments on the "system suspend" patch. The other ones LGTM.
@etienne-lms any comment?
core/arch/arm/plat-rockchip/common.h
Outdated
* you needs set the write-mask bits at the same time, the write-mask bits is | ||
* in high 16-bits. | ||
* The fllowing macro definition helps access write-mask bits reg efficient. | ||
******************************************************************************/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- No
*********
please (open comment block with/*
and close with*/
) - Spelling
core/arch/arm/plat-rockchip/common.h
Outdated
#define BITS_SHIFT(bits, shift) SHIFT_U32(bits, shift) | ||
#define BITS_WMSK(msk, shift) SHIFT_U32(msk, (shift) + REG_MSK_SHIFT) | ||
#define BITS_WITH_WMASK(bits, msk, shift)\ | ||
(BITS_SHIFT(bits, shift) | BITS_SHIFT(msk, ((shift) + REG_MSK_SHIFT))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be rewritten in a simpler way:
#define BITS_WMSK(msk, shift) SHIFT_U32(msk, (shift) + 16)
#define BITS_WITH_WMASK(bits, msk, shift) \
(SHIFT_U32(bits, shift) | BITS_WMSK(msk, shift))
0x000f, | ||
}; | ||
|
||
static void clks_gating(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's usually preferred to use a verb for functions that perform some action, what about clks_disable(void)
?
@TonyXie06 I just have a common question. rx322x is armv7 based soc, and you enabled CONFIG_ARM_PSCI_FW and suspend/low power idle are all moved to psci firmware, then in linux side, only need to smc trap to psci firmware and no touch clock and cpu_pm_cluster_entry/exit and else, right? |
@MrVan On armv7 based soc, we don't move cpuidle to psci firmware, only cpu on/off and system supend are moved. Cpuidle is still left in linux side, it will not trap into secure world by cpu_suspend(). |
48687c0
to
488f7fd
Compare
@TonyXie06 ok, then you platform do not support cpu off when low power cpu idle. |
Hi, @jforissier any comments ? |
Hi @TonyXie06, Thanks for the updates. You may add my:
...to all patches, and I think we're good to have this merged. |
1cae9c0
to
4820eba
Compare
tags applied |
Look fine to me regarding the generic psci layer. |
@etienne-lms did you post a comment? I can't see it... |
loop++; | ||
} | ||
|
||
assert(read32(va_base + CRU_PLL_CON1(pll)) & PLL_LOCK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert or panic ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You prefer panic ? Approved, because assert doesn't work if NDEBUG is defined.
Sorry, here it is. It was still pending upon an opened review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
with minor comments addressed or not.
core/arch/arm/plat-rockchip/common.h
Outdated
* Some register has write-mask bits, it means if you want to set the bits, | ||
* you need set the write-mask bits at the same time, the write-mask bits is | ||
* in high 16-bits. The following macro definition helps you access register | ||
* efficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: enficiently ?
|
||
int psci_features(uint32_t psci_fid) | ||
{ | ||
if ((psci_fid == PSCI_PSCI_FEATURES) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor: a switch(psci_fid)
looks better.
Add __weak property for the function, developers could have their own implementation. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Improve PSCI version to PSCI_VERSION_1_0. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Add currently implemented PSCI functions. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
1cd9ade
to
cdf5f93
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some late re-review
core/arch/arm/plat-rockchip/common.h
Outdated
#define WMSK_BIT(nr) BIT((nr) + REG_MSK_SHIFT) | ||
#define BIT_WITH_WMSK(nr) (BIT(nr) | WMSK_BIT(nr)) | ||
#define BITS_WMSK(msk, shift) SHIFT_U32(msk, (shift) + REG_MSK_SHIFT) | ||
#define BITS_WITH_WMASK(bits, msk, shift)\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: a space or tab before the \
.
|
||
static struct dram_data dram_d; | ||
|
||
static uint32_t clks_gating_table[CRU_CLKGATE_CON_CNT] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
Support gating clks and power down PLLs. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
cdf5f93
to
0892b0a
Compare
fix 2 minors that you commented. |
Any comments? |
@TonyXie06 sorry, somehow I was thinking we were waiting for @etienne-lms's Ack but I realize all is good. So I'm merging this PR. Thanks! |
RK322X adds PSCI version, features and system suspend implementations.
PSCI version and features must be implemented, because Linux Kernel will check whether optee supports PSCI system suspend or not by getting status from PSCI version and features.
Signed-off-by: Joseph Chen chenjh@rock-chips.com