Skip to content

Commit 547d67a

Browse files
committed
Merge tag 'tegra-for-6.4-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers
soc/tegra: Changes for v6.4-rc1 Contains various minor cleanups and fixes as well as support for several more wake events on Tegra234. * tag 'tegra-for-6.4-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: fuse: Remove nvmem root only access soc/tegra: cbb: tegra194: Use of_address_count() helper soc/tegra: cbb: Remove MODULE_LICENSE in non-modules soc/tegra: flowctrl: Use devm_platform_get_and_ioremap_resource() soc: tegra: cbb: Drop empty platform remove function soc/tegra: pmc: Support software wake-up for SPE soc/tegra: pmc: Add wake source interrupt for MGBE soc/tegra: pmc: Add the PMIC wake event for Tegra234 soc/tegra: bpmp: Actually free memory on error path soc/tegra: cbb: remove linux/version.h Link: https://lore.kernel.org/r/20230406124804.970394-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents fceb6ba + 821d96e commit 547d67a

7 files changed

Lines changed: 30 additions & 21 deletions

File tree

drivers/soc/tegra/cbb/tegra-cbb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <linux/of_address.h>
1717
#include <linux/interrupt.h>
1818
#include <linux/ioport.h>
19-
#include <linux/version.h>
2019
#include <soc/tegra/fuse.h>
2120
#include <soc/tegra/tegra-cbb.h>
2221

drivers/soc/tegra/cbb/tegra194-cbb.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <linux/of_address.h>
2424
#include <linux/interrupt.h>
2525
#include <linux/ioport.h>
26-
#include <linux/version.h>
2726
#include <soc/tegra/fuse.h>
2827
#include <soc/tegra/tegra-cbb.h>
2928

@@ -2191,7 +2190,6 @@ MODULE_DEVICE_TABLE(of, tegra194_cbb_match);
21912190
static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node *np)
21922191
{
21932192
struct tegra_cbb *entry;
2194-
struct resource res;
21952193
unsigned long flags;
21962194
unsigned int i;
21972195
int err;
@@ -2211,8 +2209,7 @@ static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node
22112209
spin_unlock_irqrestore(&cbb_lock, flags);
22122210

22132211
if (!cbb->bridges) {
2214-
while (of_address_to_resource(np, cbb->num_bridges, &res) == 0)
2215-
cbb->num_bridges++;
2212+
cbb->num_bridges = of_address_count(np);
22162213

22172214
cbb->bridges = devm_kcalloc(cbb->base.dev, cbb->num_bridges,
22182215
sizeof(*cbb->bridges), GFP_KERNEL);
@@ -2359,4 +2356,3 @@ module_exit(tegra194_cbb_exit);
23592356

23602357
MODULE_AUTHOR("Sumit Gupta <sumitg@nvidia.com>");
23612358
MODULE_DESCRIPTION("Control Backbone error handling driver for Tegra194");
2362-
MODULE_LICENSE("GPL");

drivers/soc/tegra/cbb/tegra234-cbb.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <linux/of_address.h>
2525
#include <linux/interrupt.h>
2626
#include <linux/ioport.h>
27-
#include <linux/version.h>
2827
#include <soc/tegra/fuse.h>
2928
#include <soc/tegra/tegra-cbb.h>
3029

@@ -1174,11 +1173,6 @@ static int tegra234_cbb_probe(struct platform_device *pdev)
11741173
return tegra_cbb_register(&cbb->base);
11751174
}
11761175

1177-
static int tegra234_cbb_remove(struct platform_device *pdev)
1178-
{
1179-
return 0;
1180-
}
1181-
11821176
static int __maybe_unused tegra234_cbb_resume_noirq(struct device *dev)
11831177
{
11841178
struct tegra234_cbb *cbb = dev_get_drvdata(dev);
@@ -1196,7 +1190,6 @@ static const struct dev_pm_ops tegra234_cbb_pm = {
11961190

11971191
static struct platform_driver tegra234_cbb_driver = {
11981192
.probe = tegra234_cbb_probe,
1199-
.remove = tegra234_cbb_remove,
12001193
.driver = {
12011194
.name = "tegra234-cbb",
12021195
.of_match_table = tegra234_cbb_dt_ids,
@@ -1218,4 +1211,3 @@ static void __exit tegra234_cbb_exit(void)
12181211
module_exit(tegra234_cbb_exit);
12191212

12201213
MODULE_DESCRIPTION("Control Backbone 2.0 error handling driver for Tegra234");
1221-
MODULE_LICENSE("GPL");

drivers/soc/tegra/flowctrl.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,8 @@ void flowctrl_cpu_suspend_exit(unsigned int cpuid)
156156
static int tegra_flowctrl_probe(struct platform_device *pdev)
157157
{
158158
void __iomem *base = tegra_flowctrl_base;
159-
struct resource *res;
160159

161-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
162-
tegra_flowctrl_base = devm_ioremap_resource(&pdev->dev, res);
160+
tegra_flowctrl_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
163161
if (IS_ERR(tegra_flowctrl_base))
164162
return PTR_ERR(tegra_flowctrl_base);
165163

drivers/soc/tegra/fuse/fuse-tegra.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (c) 2013-2022, NVIDIA CORPORATION. All rights reserved.
3+
* Copyright (c) 2013-2023, NVIDIA CORPORATION. All rights reserved.
44
*/
55

66
#include <linux/clk.h>
@@ -166,7 +166,7 @@ static int tegra_fuse_probe(struct platform_device *pdev)
166166
nvmem.nkeepout = fuse->soc->num_keepouts;
167167
nvmem.type = NVMEM_TYPE_OTP;
168168
nvmem.read_only = true;
169-
nvmem.root_only = true;
169+
nvmem.root_only = false;
170170
nvmem.reg_read = tegra_fuse_read;
171171
nvmem.size = fuse->soc->info->size;
172172
nvmem.word_size = 4;

drivers/soc/tegra/pmc.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* drivers/soc/tegra/pmc.c
44
*
55
* Copyright (c) 2010 Google, Inc
6-
* Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
6+
* Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
77
*
88
* Author:
99
* Colin Cross <ccross@google.com>
@@ -177,6 +177,7 @@
177177
/* Tegra186 and later */
178178
#define WAKE_AOWAKE_CNTRL(x) (0x000 + ((x) << 2))
179179
#define WAKE_AOWAKE_CNTRL_LEVEL (1 << 3)
180+
#define WAKE_AOWAKE_CNTRL_SR_CAPTURE_EN (1 << 1)
180181
#define WAKE_AOWAKE_MASK_W(x) (0x180 + ((x) << 2))
181182
#define WAKE_AOWAKE_MASK_R(x) (0x300 + ((x) << 2))
182183
#define WAKE_AOWAKE_STATUS_W(x) (0x30c + ((x) << 2))
@@ -191,6 +192,8 @@
191192
#define WAKE_AOWAKE_CTRL 0x4f4
192193
#define WAKE_AOWAKE_CTRL_INTR_POLARITY BIT(0)
193194

195+
#define SW_WAKE_ID 83 /* wake83 */
196+
194197
/* for secure PMC */
195198
#define TEGRA_SMC_PMC 0xc2fffe00
196199
#define TEGRA_SMC_PMC_READ 0xaa
@@ -355,6 +358,7 @@ struct tegra_pmc_soc {
355358
void (*setup_irq_polarity)(struct tegra_pmc *pmc,
356359
struct device_node *np,
357360
bool invert);
361+
void (*set_wake_filters)(struct tegra_pmc *pmc);
358362
int (*irq_set_wake)(struct irq_data *data, unsigned int on);
359363
int (*irq_set_type)(struct irq_data *data, unsigned int type);
360364
int (*powergate_set)(struct tegra_pmc *pmc, unsigned int id,
@@ -2416,6 +2420,17 @@ static int tegra210_pmc_irq_set_type(struct irq_data *data, unsigned int type)
24162420
return 0;
24172421
}
24182422

2423+
static void tegra186_pmc_set_wake_filters(struct tegra_pmc *pmc)
2424+
{
2425+
u32 value;
2426+
2427+
/* SW Wake (wake83) needs SR_CAPTURE filter to be enabled */
2428+
value = readl(pmc->wake + WAKE_AOWAKE_CNTRL(SW_WAKE_ID));
2429+
value |= WAKE_AOWAKE_CNTRL_SR_CAPTURE_EN;
2430+
writel(value, pmc->wake + WAKE_AOWAKE_CNTRL(SW_WAKE_ID));
2431+
dev_dbg(pmc->dev, "WAKE_AOWAKE_CNTRL_83 = 0x%x\n", value);
2432+
}
2433+
24192434
static int tegra186_pmc_irq_set_wake(struct irq_data *data, unsigned int on)
24202435
{
24212436
struct tegra_pmc *pmc = irq_data_get_irq_chip_data(data);
@@ -3042,6 +3057,10 @@ static int tegra_pmc_probe(struct platform_device *pdev)
30423057
platform_set_drvdata(pdev, pmc);
30433058
tegra_pm_init_suspend();
30443059

3060+
/* Some wakes require specific filter configuration */
3061+
if (pmc->soc->set_wake_filters)
3062+
pmc->soc->set_wake_filters(pmc);
3063+
30453064
return 0;
30463065

30473066
cleanup_powergates:
@@ -3938,6 +3957,7 @@ static const struct tegra_pmc_soc tegra186_pmc_soc = {
39383957
.regs = &tegra186_pmc_regs,
39393958
.init = tegra186_pmc_init,
39403959
.setup_irq_polarity = tegra186_pmc_setup_irq_polarity,
3960+
.set_wake_filters = tegra186_pmc_set_wake_filters,
39413961
.irq_set_wake = tegra186_pmc_irq_set_wake,
39423962
.irq_set_type = tegra186_pmc_irq_set_type,
39433963
.reset_sources = tegra186_reset_sources,
@@ -4122,6 +4142,7 @@ static const struct tegra_pmc_soc tegra194_pmc_soc = {
41224142
.regs = &tegra194_pmc_regs,
41234143
.init = tegra186_pmc_init,
41244144
.setup_irq_polarity = tegra186_pmc_setup_irq_polarity,
4145+
.set_wake_filters = tegra186_pmc_set_wake_filters,
41254146
.irq_set_wake = tegra186_pmc_irq_set_wake,
41264147
.irq_set_type = tegra186_pmc_irq_set_type,
41274148
.reset_sources = tegra194_reset_sources,
@@ -4225,7 +4246,9 @@ static const char * const tegra234_reset_sources[] = {
42254246
};
42264247

42274248
static const struct tegra_wake_event tegra234_wake_events[] = {
4249+
TEGRA_WAKE_IRQ("pmu", 24, 209),
42284250
TEGRA_WAKE_GPIO("power", 29, 1, TEGRA234_AON_GPIO(EE, 4)),
4251+
TEGRA_WAKE_GPIO("mgbe", 56, 0, TEGRA234_MAIN_GPIO(Y, 3)),
42294252
TEGRA_WAKE_IRQ("rtc", 73, 10),
42304253
};
42314254

@@ -4247,6 +4270,7 @@ static const struct tegra_pmc_soc tegra234_pmc_soc = {
42474270
.regs = &tegra234_pmc_regs,
42484271
.init = tegra186_pmc_init,
42494272
.setup_irq_polarity = tegra186_pmc_setup_irq_polarity,
4273+
.set_wake_filters = tegra186_pmc_set_wake_filters,
42504274
.irq_set_wake = tegra186_pmc_irq_set_wake,
42514275
.irq_set_type = tegra186_pmc_irq_set_type,
42524276
.reset_sources = tegra234_reset_sources,

drivers/soc/tegra/powergate-bpmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int tegra_bpmp_add_powergates(struct tegra_bpmp *bpmp,
286286
tegra_powergate_remove(powergate);
287287
}
288288

289-
kfree(genpd->domains);
289+
kfree(domains);
290290
return err;
291291
}
292292

0 commit comments

Comments
 (0)