Skip to content

Commit bbea8b1

Browse files
wzyy2rkhuangtao
authored andcommitted
clk: rockchip: do not register ddrclk if PSCI is not enabled on arm32
ARM32 system can run without trustos, we should prevent arm_smccc_smc being called in such system. Change-Id: Ic87b78107b464e3ab8dc72a3ca1fa9a64e358580 Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
1 parent 20694a9 commit bbea8b1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/clk/rockchip/clk-ddr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#include <soc/rockchip/rockchip_sip.h>
2727
#include <soc/rockchip/scpi.h>
2828
#include <uapi/drm/drm_mode.h>
29+
#ifdef CONFIG_ARM
30+
#include <asm/psci.h>
31+
#endif
2932

3033
#include "clk.h"
3134

@@ -312,6 +315,11 @@ struct clk *rockchip_clk_register_ddrclk(const char *name, int flags,
312315
struct clk_init_data init;
313316
struct clk *clk;
314317

318+
#ifdef CONFIG_ARM
319+
if (!psci_smp_available())
320+
return NULL;
321+
#endif
322+
315323
ddrclk = kzalloc(sizeof(*ddrclk), GFP_KERNEL);
316324
if (!ddrclk)
317325
return ERR_PTR(-ENOMEM);

0 commit comments

Comments
 (0)