You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Cleanups on various subarchitectures Cleanup patches for various ARM platforms and some of their associated drivers, the bulk of these is for mach-91. Arnd ended up pulling in the restart branch from Russell in order to fix up some simple but annoying merge conflicts. * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (44 commits) arm/at91: fix build of stamp9g20 ARM: u300: delete memory.h MAINTAINERS: add maintainer entry for Picochip picoxcell ARM: picoxcell: move io mappings to common.c ARM: picoxcell: don't reserve irq_descs ARM: picoxcell: remove mach/memory.h ARM: at91: delete the pcontrol_g20_defconfig arm/tegra: Remove code that's ifndef CONFIG_ARM_GIC arm/tegra: remove unused defines arm/tegra: fix variable formatting in makefile ARM: davinci: vpif: move code to driver core header from platform ARM: at91/gpio: fix display of number of irq setuped ARM: at91/gpio: drop PIN_BASE ARM: at91/udc: use gpio_is_valid to check the gpio ARM: at91/ohci: use gpio_is_valid to check the gpio ARM: at91/nand: use gpio_is_valid to check the gpio ARM: at91/mmc: use gpio_is_valid to check the gpio ARM: at91/ide: use gpio_is_valid to check the gpio ARM: at91/pata: use gpio_is_valid to check the gpio ARM: at91/soc: use gpio_is_valid to check the gpio ...
This commit is contained in:
@@ -35,6 +35,11 @@
|
||||
|
||||
#define DRV_NAME "AT91SAM9 Watchdog"
|
||||
|
||||
#define wdt_read(field) \
|
||||
__raw_readl(at91wdt_private.base + field)
|
||||
#define wdt_write(field, val) \
|
||||
__raw_writel((val), at91wdt_private.base + field)
|
||||
|
||||
/* AT91SAM9 watchdog runs a 12bit counter @ 256Hz,
|
||||
* use this to convert a watchdog
|
||||
* value from/to milliseconds.
|
||||
@@ -63,6 +68,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
|
||||
static void at91_ping(unsigned long data);
|
||||
|
||||
static struct {
|
||||
void __iomem *base;
|
||||
unsigned long next_heartbeat; /* the next_heartbeat for the timer */
|
||||
unsigned long open;
|
||||
char expect_close;
|
||||
@@ -77,7 +83,7 @@ static struct {
|
||||
*/
|
||||
static inline void at91_wdt_reset(void)
|
||||
{
|
||||
at91_sys_write(AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
|
||||
wdt_write(AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -132,7 +138,7 @@ static int at91_wdt_settimeout(unsigned int timeout)
|
||||
unsigned int mr;
|
||||
|
||||
/* Check if disabled */
|
||||
mr = at91_sys_read(AT91_WDT_MR);
|
||||
mr = wdt_read(AT91_WDT_MR);
|
||||
if (mr & AT91_WDT_WDDIS) {
|
||||
printk(KERN_ERR DRV_NAME": sorry, watchdog is disabled\n");
|
||||
return -EIO;
|
||||
@@ -149,7 +155,7 @@ static int at91_wdt_settimeout(unsigned int timeout)
|
||||
| AT91_WDT_WDDBGHLT /* disabled in debug mode */
|
||||
| AT91_WDT_WDD /* restart at any time */
|
||||
| (timeout & AT91_WDT_WDV); /* timer value */
|
||||
at91_sys_write(AT91_WDT_MR, reg);
|
||||
wdt_write(AT91_WDT_MR, reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -248,12 +254,22 @@ static struct miscdevice at91wdt_miscdev = {
|
||||
|
||||
static int __init at91wdt_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *r;
|
||||
int res;
|
||||
|
||||
if (at91wdt_miscdev.parent)
|
||||
return -EBUSY;
|
||||
at91wdt_miscdev.parent = &pdev->dev;
|
||||
|
||||
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!r)
|
||||
return -ENODEV;
|
||||
at91wdt_private.base = ioremap(r->start, resource_size(r));
|
||||
if (!at91wdt_private.base) {
|
||||
dev_err(&pdev->dev, "failed to map registers, aborting.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Set watchdog */
|
||||
res = at91_wdt_settimeout(ms_to_ticks(WDT_HW_TIMEOUT * 1000));
|
||||
if (res)
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
#ifndef AT91_WDT_H
|
||||
#define AT91_WDT_H
|
||||
|
||||
#define AT91_WDT_CR (AT91_WDT + 0x00) /* Watchdog Control Register */
|
||||
#define AT91_WDT_CR 0x00 /* Watchdog Control Register */
|
||||
#define AT91_WDT_WDRSTT (1 << 0) /* Restart */
|
||||
#define AT91_WDT_KEY (0xa5 << 24) /* KEY Password */
|
||||
|
||||
#define AT91_WDT_MR (AT91_WDT + 0x04) /* Watchdog Mode Register */
|
||||
#define AT91_WDT_MR 0x04 /* Watchdog Mode Register */
|
||||
#define AT91_WDT_WDV (0xfff << 0) /* Counter Value */
|
||||
#define AT91_WDT_WDFIEN (1 << 12) /* Fault Interrupt Enable */
|
||||
#define AT91_WDT_WDRSTEN (1 << 13) /* Reset Processor */
|
||||
@@ -30,7 +30,7 @@
|
||||
#define AT91_WDT_WDDBGHLT (1 << 28) /* Debug Halt */
|
||||
#define AT91_WDT_WDIDLEHLT (1 << 29) /* Idle Halt */
|
||||
|
||||
#define AT91_WDT_SR (AT91_WDT + 0x08) /* Watchdog Status Register */
|
||||
#define AT91_WDT_SR 0x08 /* Watchdog Status Register */
|
||||
#define AT91_WDT_WDUNF (1 << 0) /* Watchdog Underflow */
|
||||
#define AT91_WDT_WDERR (1 << 1) /* Watchdog Error */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user