linux/drivers/watchdog/xilinx_wwdt.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Window watchdog device driver for Xilinx Versal WWDT
 *
 * Copyright (C) 2022 - 2023, Advanced Micro Devices, Inc.
 */

#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/math64.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/watchdog.h>

/* Max timeout is calculated at 100MHz source clock */
#define XWWDT_DEFAULT_TIMEOUT
#define XWWDT_MIN_TIMEOUT

/* Register offsets for the WWDT device */
#define XWWDT_MWR_OFFSET
#define XWWDT_ESR_OFFSET
#define XWWDT_FCR_OFFSET
#define XWWDT_FWR_OFFSET
#define XWWDT_SWR_OFFSET

/* Master Write Control Register Masks */
#define XWWDT_MWR_MASK

/* Enable and Status Register Masks */
#define XWWDT_ESR_WINT_MASK
#define XWWDT_ESR_WSW_MASK
#define XWWDT_ESR_WEN_MASK

#define XWWDT_CLOSE_WINDOW_PERCENT

static int wwdt_timeout;
static int closed_window_percent;

module_param(wwdt_timeout, int, 0);
MODULE_PARM_DESC();
module_param(closed_window_percent, int, 0);
MODULE_PARM_DESC();
/**
 * struct xwwdt_device - Watchdog device structure
 * @base: base io address of WDT device
 * @spinlock: spinlock for IO register access
 * @xilinx_wwdt_wdd: watchdog device structure
 * @freq: source clock frequency of WWDT
 * @close_percent: Closed window percent
 */
struct xwwdt_device {};

static int xilinx_wwdt_start(struct watchdog_device *wdd)
{}

static int xilinx_wwdt_keepalive(struct watchdog_device *wdd)
{}

static const struct watchdog_info xilinx_wwdt_ident =;

static const struct watchdog_ops xilinx_wwdt_ops =;

static int xwwdt_probe(struct platform_device *pdev)
{}

static const struct of_device_id xwwdt_of_match[] =;
MODULE_DEVICE_TABLE(of, xwwdt_of_match);

static struct platform_driver xwwdt_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();