Skip to content

Commit 1555547

Browse files
committed
Merge branch 'for-5.8/arm/core' into for-5.8/cpuidle
2 parents 8f3d9f3 + 38743e4 commit 1555547

File tree

5 files changed

+33
-9
lines changed

5 files changed

+33
-9
lines changed

arch/arm/mach-tegra/pm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ int tegra_pm_enter_lp2(void)
216216
restore_cpu_complex();
217217
cpu_cluster_pm_exit();
218218

219+
call_firmware_op(prepare_idle, TF_PM_MODE_NONE);
220+
219221
return err;
220222
}
221223

@@ -391,6 +393,8 @@ static int tegra_suspend_enter(suspend_state_t state)
391393

392394
local_fiq_enable();
393395

396+
call_firmware_op(prepare_idle, TF_PM_MODE_NONE);
397+
394398
return 0;
395399
}
396400

arch/arm/mach-tegra/reset-handler.S

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ ENTRY(tegra_resume_trusted_foundations)
9898
reteq lr
9999

100100
.arch_extension sec
101-
/* First call after suspend wakes firmware. No arguments required. */
101+
/*
102+
* First call after suspend wakes firmware. No arguments required
103+
* for some firmware versions. Downstream kernel of ASUS TF300T uses
104+
* r0=3 for the wake-up notification.
105+
*/
106+
mov r0, #3
102107
smc #0
103108

104109
b cpu_resume

drivers/firmware/tegra/bpmp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/clk/tegra.h>
77
#include <linux/genalloc.h>
88
#include <linux/mailbox_client.h>
9+
#include <linux/module.h>
910
#include <linux/of.h>
1011
#include <linux/of_address.h>
1112
#include <linux/of_device.h>
@@ -869,12 +870,8 @@ static struct platform_driver tegra_bpmp_driver = {
869870
.name = "tegra-bpmp",
870871
.of_match_table = tegra_bpmp_match,
871872
.pm = &tegra_bpmp_pm_ops,
873+
.suppress_bind_attrs = true,
872874
},
873875
.probe = tegra_bpmp_probe,
874876
};
875-
876-
static int __init tegra_bpmp_init(void)
877-
{
878-
return platform_driver_register(&tegra_bpmp_driver);
879-
}
880-
core_initcall(tegra_bpmp_init);
877+
builtin_platform_driver(tegra_bpmp_driver);

drivers/firmware/trusted_foundations.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#define TF_CACHE_ENABLE 1
2121
#define TF_CACHE_DISABLE 2
22+
#define TF_CACHE_REENABLE 4
2223

2324
#define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200
2425

@@ -29,6 +30,7 @@
2930
#define TF_CPU_PM_S1 0xffffffe4
3031
#define TF_CPU_PM_S1_NOFLUSH_L2 0xffffffe7
3132

33+
static unsigned long tf_idle_mode = TF_PM_MODE_NONE;
3234
static unsigned long cpu_boot_addr;
3335

3436
static void tf_generic_smc(u32 type, u32 arg1, u32 arg2)
@@ -85,25 +87,40 @@ static int tf_prepare_idle(unsigned long mode)
8587
cpu_boot_addr);
8688
break;
8789

90+
case TF_PM_MODE_NONE:
91+
break;
92+
8893
default:
8994
return -EINVAL;
9095
}
9196

97+
tf_idle_mode = mode;
98+
9299
return 0;
93100
}
94101

95102
#ifdef CONFIG_CACHE_L2X0
96103
static void tf_cache_write_sec(unsigned long val, unsigned int reg)
97104
{
98-
u32 l2x0_way_mask = 0xff;
105+
u32 enable_op, l2x0_way_mask = 0xff;
99106

100107
switch (reg) {
101108
case L2X0_CTRL:
102109
if (l2x0_saved_regs.aux_ctrl & L310_AUX_CTRL_ASSOCIATIVITY_16)
103110
l2x0_way_mask = 0xffff;
104111

112+
switch (tf_idle_mode) {
113+
case TF_PM_MODE_LP2:
114+
enable_op = TF_CACHE_REENABLE;
115+
break;
116+
117+
default:
118+
enable_op = TF_CACHE_ENABLE;
119+
break;
120+
}
121+
105122
if (val == L2X0_CTRL_EN)
106-
tf_generic_smc(TF_CACHE_MAINT, TF_CACHE_ENABLE,
123+
tf_generic_smc(TF_CACHE_MAINT, enable_op,
107124
l2x0_saved_regs.aux_ctrl);
108125
else
109126
tf_generic_smc(TF_CACHE_MAINT, TF_CACHE_DISABLE,

include/linux/firmware/trusted_foundations.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#define TF_PM_MODE_LP1_NO_MC_CLK 2
3333
#define TF_PM_MODE_LP2 3
3434
#define TF_PM_MODE_LP2_NOFLUSH_L2 4
35+
#define TF_PM_MODE_NONE 5
3536

3637
struct trusted_foundations_platform_data {
3738
unsigned int version_major;

0 commit comments

Comments
 (0)