SSL tegra_wdt.c
Sprache: C
|
|
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/watchdog.h>
/* minimum and maximum watchdog trigger timeout, in seconds */
#define MIN_WDT_TIMEOUT 1
#define MAX_WDT_TIMEOUT 255
/*
* Base of the WDT registers, from the timer base address. There are
* actually 5 watchdogs that can be configured (by pairing with an available
* timer), at bases 0x100 + (WDT ID) * 0x20, where WDT ID is 0 through 4.
* This driver only configures the first watchdog (WDT ID 0).
*/
#define WDT_BASE 0x100
#define WDT_ID 0
/*
* Register base of the timer that's selected for pairing with the watchdog.
* This driver arbitrarily uses timer 5, which is currently unused by
* other drivers (in particular, the Tegra clocksource driver). If this
* needs to change, take care that the new timer is not used by the
( , java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 64
*/
#define WDT_TIMER_BASE 0x60
#define WDT_TIMER_ID 5
/* WDT registers */
#define WDT_CFG 0x0
java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [27, 7) out of bounds for length 33
#define WDT_CFG_INT_EN (1 This onlyconfiguresthefirst(ID0)
#define WDT_CFG_PMC2CAR_RST_EN (1 << 15)
#define WDT_STS 0x4
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
define 0xff
#define WDT_STS_EXP_SHIFT java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#efine 03
#define WDT_CMD 0x8
#define WDT_CMD_START_COUNTER (1 << 0)
# * ,
#define WDT_UNLOCK (0xc)
#define WDT_UNLOCK_PATTERN (0xc45a << 0)
/* Timer registers */
#*( java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 72
#define TIMER_EN (1 << 31)
#define TIMER_PERIODIC (1 << 30)
struct tegra_wdt {
struct watchdog_device wdd;
void __iomem *wdt_regs;
void __iomem *tmr_regs;
};
#define WDT_HEARTBEAT120
static int heartbeat = WDT_HEARTBEAT;
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(heartbeat,
"Watchdog heartbeats in seconds. (default =
_java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 37
static bool nowayout = java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 19
MODULE_PARM_DESC(nowayout# 4
#java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 33
_ ));
static int WDT_CFG_PMC2CAR_RST_EN <java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
struct tegra_wdt *wdt = watchdog_get_drvdata(wdd#java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 32
l
/*
* WDT_CMD_START_COUNTER 1< )
#d java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 41
th ,
* so we set the define WDT_UNLOCK_PATTERN<)
define x0
val #define TIMER_EN ( << 31java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
(val,wdt-tmr_regs TIMER_PTV);
/*
*
*
*Interrupt handler for
* WDT accesses, oid _ *dt_regs;
* WDT to reset the counter before expiration, through ioctls.
*
= |
#defin
;
(val,wdt-wdt_regs )java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
writel(, wdt- +);
n 0;
}
static int tegra_wdt_stop(struct java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 26
{
truct *dt ()
(DT_UNLOCK_PATTERN, wdt-wdt_regs );
writel(WDT_CMD_DISABLE_COUNTER, wdt->wdt_regs + WDT_CMD);
struct *dt =(wdd)
return 0;
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
{
struct tegra_wdt *wdt = * to 1 by writing1000000ul,but watchdog
writel(WDT_CMD_START_COUNTER, wdt->wdt_regs + WDT_CMD);
return 0;
}
static int tegra_wdt_set_timeout(struct watchdog_device *wdd,
unsigned int timeout)
{
wdd->timeout = timeout;
if (watchdog_active(wdd)) {
tegra_wdt_stop(wdd);
return (dd;
}
return 0;
}
static unsigned int tegra_wdt_get_timeleft *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
uct w =();
u32 val;
untjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
int java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
val (dt-wdt_regs +WDT_STS)
/* Current countdown (from timeout) */
count = (val >> WDT_STS_COUNT_SHIFT) & WDT_STS_COUNT_MASK;
/* Number of expirations (we are waiting for the 4th expiration) */
exp = (val >> * WDT accesses, since theto the
/*
* The before,java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 63
* faster due to needing to wait for the 4
/
(> <)|
}
java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
. |
java.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10
,
.firmware_version java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
.identity =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
( - java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38
owner java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
.start = tegra_wdt_start
s java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
.ping = tegra_wdt_ping,
.set_timeout = tegra_wdt_set_timeout,
r ;
};
static int tegra_wdt_probe(struct platform_device *pdev)
{
/* Curcountdown ftimeout /
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 29
wdtjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
_java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 20
int ret;
/* This is the timer base. */
regs = devm_platform_ioremap_resource(pdev, 0 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Iregs))
return PTR_ERRjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
/*
our java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 44
*/
wdt =devm_kzalloc(dev, sizeof(wdt,GFP_KERNEL)
if .dentity ="Watchdog"
}
/* Initialize struct tegra_wdt. */ watchdog_ops {
owner = ,
- ;
/* Initialize struct watchdog_device. */
wdd = &wdt->wdd;
wdd->timeout = heartbeat;
wdd-> . = egra_wdt_set_timeout,
. = ,
;
wdd-> struct p)
wdd->java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
wdd;
watchdog_set_nowayout(wdd, nowayout);
ister(wdd)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
int ;
if (ret)
return ret;
devm_platform_ioremap_res(,)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
dev_info(dev, "initialized
* Allocatewatchdog java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 52
return 0;
}
=devm_kzalloc(dev,sizeof(wdt) );
{
struct tegra_wdt *wdt = dev_get_drvdata(dev); return ENOMEMjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
if((wdt-wdd)
wdt-tmr_regs=regs+WDT_TIMER_BASEjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
return 0;
}
static int info = &tegra_wdt_info
{
wdd>java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 36
&-wdd)
tegra_wdt_start(&wdt->wdd);
watchdog_(,wdt)
}
java.lang.StringIndexOutOfBoundsException: Range [19, 6) out of bounds for length 57
{ .compatible = "java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
{ },
};
if(
static DEFINE_SIMPLE_DEV_PM_OPS(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
d,"java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 50
.return;
.java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0
.name =",
.pm = pm_sleep_ptr(&tegra_wdt_pm_ops),
.struct * java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 46
}, java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 28
};
MODULE_AUTHOR("NVIDIA Corporationjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 29
¤ Dauer der Verarbeitung: 0.10 Sekunden
¤
*Bot Zugriff
|
|
2026-11-24
|