Skip to content

Commit bc889e8

Browse files
committed
Merge tag 'tegra-for-6.5-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers
soc/tegra: Changes for v6.5-rc1 This adds initial support for identifying the Tegra264 SoC family and fixes potential issues when reading from the FUSE block. A new software wake event for the AON cluster is added on Tegra234 and the debugfs initialization is drastically simplified. * tag 'tegra-for-6.5-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Use devm_clk_notifier_register() soc/tegra: pmc: Simplify debugfs initialization soc/tegra: fuse: Fix Tegra234 fuse size soc/tegra: pmc: Add AON SW Wake support for Tegra234 soc/tegra: fuse: Add support for Tegra264 Link: https://lore.kernel.org/r/20230609193620.2275240-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents b79dec9 + c954cd7 commit bc889e8

4 files changed

Lines changed: 12 additions & 27 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ static const struct nvmem_keepout tegra234_fuse_keepouts[] = {
663663

664664
static const struct tegra_fuse_info tegra234_fuse_info = {
665665
.read = tegra30_fuse_read,
666-
.size = 0x98c,
666+
.size = 0xf90,
667667
.spare = 0x280,
668668
};
669669

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

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

66
#include <linux/export.h>
@@ -62,6 +62,7 @@ bool tegra_is_silicon(void)
6262
switch (tegra_get_chip_id()) {
6363
case TEGRA194:
6464
case TEGRA234:
65+
case TEGRA264:
6566
if (tegra_get_platform() == 0)
6667
return true;
6768

drivers/soc/tegra/pmc.c

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ struct tegra_pmc_soc {
396396
* @clk: pointer to pclk clock
397397
* @soc: pointer to SoC data structure
398398
* @tz_only: flag specifying if the PMC can only be accessed via TrustZone
399-
* @debugfs: pointer to debugfs entry
400399
* @rate: currently configured rate of pclk
401400
* @suspend_mode: lowest suspend mode available
402401
* @cpu_good_time: CPU power good time (in microseconds)
@@ -431,7 +430,6 @@ struct tegra_pmc {
431430
void __iomem *aotag;
432431
void __iomem *scratch;
433432
struct clk *clk;
434-
struct dentry *debugfs;
435433

436434
const struct tegra_pmc_soc *soc;
437435
bool tz_only;
@@ -1190,16 +1188,6 @@ static int powergate_show(struct seq_file *s, void *data)
11901188

11911189
DEFINE_SHOW_ATTRIBUTE(powergate);
11921190

1193-
static int tegra_powergate_debugfs_init(void)
1194-
{
1195-
pmc->debugfs = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
1196-
&powergate_fops);
1197-
if (!pmc->debugfs)
1198-
return -ENOMEM;
1199-
1200-
return 0;
1201-
}
1202-
12031191
static int tegra_powergate_of_get_clks(struct tegra_powergate *pg,
12041192
struct device_node *np)
12051193
{
@@ -3004,7 +2992,8 @@ static int tegra_pmc_probe(struct platform_device *pdev)
30042992
*/
30052993
if (pmc->clk) {
30062994
pmc->clk_nb.notifier_call = tegra_pmc_clk_notify_cb;
3007-
err = clk_notifier_register(pmc->clk, &pmc->clk_nb);
2995+
err = devm_clk_notifier_register(&pdev->dev, pmc->clk,
2996+
&pmc->clk_nb);
30082997
if (err) {
30092998
dev_err(&pdev->dev,
30102999
"failed to register clk notifier\n");
@@ -3026,19 +3015,13 @@ static int tegra_pmc_probe(struct platform_device *pdev)
30263015

30273016
tegra_pmc_reset_sysfs_init(pmc);
30283017

3029-
if (IS_ENABLED(CONFIG_DEBUG_FS)) {
3030-
err = tegra_powergate_debugfs_init();
3031-
if (err < 0)
3032-
goto cleanup_sysfs;
3033-
}
3034-
30353018
err = tegra_pmc_pinctrl_init(pmc);
30363019
if (err)
3037-
goto cleanup_debugfs;
3020+
goto cleanup_sysfs;
30383021

30393022
err = tegra_pmc_regmap_init(pmc);
30403023
if (err < 0)
3041-
goto cleanup_debugfs;
3024+
goto cleanup_sysfs;
30423025

30433026
err = tegra_powergate_init(pmc, pdev->dev.of_node);
30443027
if (err < 0)
@@ -3061,16 +3044,15 @@ static int tegra_pmc_probe(struct platform_device *pdev)
30613044
if (pmc->soc->set_wake_filters)
30623045
pmc->soc->set_wake_filters(pmc);
30633046

3047+
debugfs_create_file("powergate", 0444, NULL, NULL, &powergate_fops);
3048+
30643049
return 0;
30653050

30663051
cleanup_powergates:
30673052
tegra_powergate_remove_all(pdev->dev.of_node);
3068-
cleanup_debugfs:
3069-
debugfs_remove(pmc->debugfs);
30703053
cleanup_sysfs:
30713054
device_remove_file(&pdev->dev, &dev_attr_reset_reason);
30723055
device_remove_file(&pdev->dev, &dev_attr_reset_level);
3073-
clk_notifier_unregister(pmc->clk, &pmc->clk_nb);
30743056

30753057
return err;
30763058
}
@@ -4250,6 +4232,7 @@ static const struct tegra_wake_event tegra234_wake_events[] = {
42504232
TEGRA_WAKE_GPIO("power", 29, 1, TEGRA234_AON_GPIO(EE, 4)),
42514233
TEGRA_WAKE_GPIO("mgbe", 56, 0, TEGRA234_MAIN_GPIO(Y, 3)),
42524234
TEGRA_WAKE_IRQ("rtc", 73, 10),
4235+
TEGRA_WAKE_IRQ("sw-wake", SW_WAKE_ID, 179),
42534236
};
42544237

42554238
static const struct tegra_pmc_soc tegra234_pmc_soc = {

include/soc/tegra/fuse.h

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

66
#ifndef __SOC_TEGRA_FUSE_H__
@@ -17,6 +17,7 @@
1717
#define TEGRA186 0x18
1818
#define TEGRA194 0x19
1919
#define TEGRA234 0x23
20+
#define TEGRA264 0x26
2021

2122
#define TEGRA_FUSE_SKU_CALIB_0 0xf0
2223
#define TEGRA30_FUSE_SATA_CALIB 0x124

0 commit comments

Comments
 (0)