Skip to content

Commit fff4a87

Browse files
committed
Merge tag 'tegra-for-5.8-firmware-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers
firmware: tegra: Changes for v5.8-rc1 This contains a change that makes the BPMP driver a regular driver, which fixes some weird suspend/resume ordering issues. Another fix is also included to implement another way of enabling the L2 cache after LP2 suspend. * tag 'tegra-for-5.8-firmware-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: Defer BPMP probe if shared memory not available firmware: tf: Different way of L2 cache enabling after LP2 suspend firmware: tegra: Make BPMP a regular driver Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 8222d4c + 10b2006 commit fff4a87

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

drivers/firmware/tegra/bpmp-tegra186.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static int tegra186_bpmp_init(struct tegra_bpmp *bpmp)
176176
priv->tx.pool = of_gen_pool_get(bpmp->dev->of_node, "shmem", 0);
177177
if (!priv->tx.pool) {
178178
dev_err(bpmp->dev, "TX shmem pool not found\n");
179-
return -ENOMEM;
179+
return -EPROBE_DEFER;
180180
}
181181

182182
priv->tx.virt = gen_pool_dma_alloc(priv->tx.pool, 4096, &priv->tx.phys);
@@ -188,7 +188,7 @@ static int tegra186_bpmp_init(struct tegra_bpmp *bpmp)
188188
priv->rx.pool = of_gen_pool_get(bpmp->dev->of_node, "shmem", 1);
189189
if (!priv->rx.pool) {
190190
dev_err(bpmp->dev, "RX shmem pool not found\n");
191-
err = -ENOMEM;
191+
err = -EPROBE_DEFER;
192192
goto free_tx;
193193
}
194194

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)