* Re: [PATCH 0/6 v2] mpc83xx_wdt rework, support for mpc8610
From: Kumar Gala @ 2008-05-13 14:50 UTC (permalink / raw)
To: avorontsov
Cc: linuxppc-dev@ozlabs.org list, Wim Van Sebroeck, Scott Wood,
Timur Tabi
In-Reply-To: <20080513141411.GA8981@polina.dev.rtsoft.ru>
On May 13, 2008, at 9:14 AM, Anton Vorontsov wrote:
> Hi all,
>
> Thanks for the review, here is the new version.
>
> Changes since v1:
>
> - Scott Wood asked for mpc83xx_wdt on multiplatform kernels. Done via
> OF platform driver;
> - Kumar Gala asked for mpc83xx_wdt -> mpc8xxx_wdt rename. Done in two
> steps;
> - Segher Boessenkool noticed a negligence in the wdt device tree node.
> Fixed by removing mpc83xx_wdt compatible entry.
any possibility of making this work on 8xx per Jochen's comment? (see
mpc8xx_wdt.c)
- k
^ permalink raw reply
* [PATCH 6/6] [POWERPC] 86xx: mpc8610_hpcd: add watchdog node
From: Anton Vorontsov @ 2008-05-13 14:15 UTC (permalink / raw)
To: Kumar Gala, Wim Van Sebroeck; +Cc: Scott Wood, linuxppc-dev, Timur Tabi
In-Reply-To: <20080513141411.GA8981@polina.dev.rtsoft.ru>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
arch/powerpc/boot/dts/mpc8610_hpcd.dts | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index 5030533..a7f3e0e 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -195,6 +195,12 @@
fsl,has-rstcr;
};
+ wdt@e4000 {
+ device_type = "watchdog";
+ compatible = "fsl,mpc8610-wdt";
+ reg = <0xe4000 0x100>;
+ };
+
gpio@f000 {
compatible = "fsl,mpc8610-gpio";
reg = <0xf000 0x100>;
--
1.5.5.1
^ permalink raw reply related
* [PATCH 4/6] [WATCHDOG] mpc8xxx_wdt: various renames, mostly s/mpc83xx/mpc8xxx/g
From: Anton Vorontsov @ 2008-05-13 14:15 UTC (permalink / raw)
To: Kumar Gala, Wim Van Sebroeck; +Cc: Scott Wood, linuxppc-dev, Timur Tabi
In-Reply-To: <20080513141411.GA8981@polina.dev.rtsoft.ru>
mpc83xx_wdt.c renamed to mpc8xxx_wdt.c, now we can do various renames
in the file itself.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/watchdog/mpc8xxx_wdt.c | 100 ++++++++++++++++++++--------------------
1 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
index 3534ae0..b582441 100644
--- a/drivers/watchdog/mpc8xxx_wdt.c
+++ b/drivers/watchdog/mpc8xxx_wdt.c
@@ -1,5 +1,5 @@
/*
- * mpc83xx_wdt.c - MPC83xx/MPC86xx watchdog userspace interface
+ * mpc8xxx_wdt.c - MPC8xxx watchdog userspace interface
*
* Authors: Dave Updegraff <dave@cray.org>
* Kumar Gala <galak@kernel.crashing.org>
@@ -29,7 +29,7 @@
#include <asm/uaccess.h>
#include <sysdev/fsl_soc.h>
-struct mpc83xx_wdt {
+struct mpc8xxx_wdt {
__be32 res0;
__be32 swcrr; /* System watchdog control register */
#define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
@@ -42,7 +42,7 @@ struct mpc83xx_wdt {
u8 res2[0xF0];
};
-static struct mpc83xx_wdt __iomem *wd_base;
+static struct mpc8xxx_wdt __iomem *wd_base;
static u16 timeout = 0xffff;
module_param(timeout, ushort, 0);
@@ -67,7 +67,7 @@ static unsigned int timeout_sec;
static unsigned long wdt_is_open;
static DEFINE_SPINLOCK(wdt_spinlock);
-static void mpc83xx_wdt_keepalive(void)
+static void mpc8xxx_wdt_keepalive(void)
{
/* Ping the WDT */
spin_lock(&wdt_spinlock);
@@ -76,31 +76,31 @@ static void mpc83xx_wdt_keepalive(void)
spin_unlock(&wdt_spinlock);
}
-static void mpc83xx_wdt_timer_ping(unsigned long arg);
-static DEFINE_TIMER(wdt_timer, mpc83xx_wdt_timer_ping, 0, 0);
+static void mpc8xxx_wdt_timer_ping(unsigned long arg);
+static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, 0);
-static void mpc83xx_wdt_timer_ping(unsigned long arg)
+static void mpc8xxx_wdt_timer_ping(unsigned long arg)
{
- mpc83xx_wdt_keepalive();
+ mpc8xxx_wdt_keepalive();
/* We're pinging it twice faster than needed, just to be sure. */
mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
}
-static void mpc83xx_wdt_pr_warn(const char *msg)
+static void mpc8xxx_wdt_pr_warn(const char *msg)
{
- pr_crit("mpc83xx_wdt: %s, expect the %s soon!\n", msg,
+ pr_crit("mpc8xxx_wdt: %s, expect the %s soon!\n", msg,
reset ? "reset" : "machine check exception");
}
-static ssize_t mpc83xx_wdt_write(struct file *file, const char __user *buf,
+static ssize_t mpc8xxx_wdt_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
if (count)
- mpc83xx_wdt_keepalive();
+ mpc8xxx_wdt_keepalive();
return count;
}
-static int mpc83xx_wdt_open(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_open(struct inode *inode, struct file *file)
{
u32 tmp = SWCRR_SWEN;
if (test_and_set_bit(0, &wdt_is_open))
@@ -125,17 +125,17 @@ static int mpc83xx_wdt_open(struct inode *inode, struct file *file)
return nonseekable_open(inode, file);
}
-static int mpc83xx_wdt_release(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_release(struct inode *inode, struct file *file)
{
if (!nowayout)
- mpc83xx_wdt_timer_ping(0);
+ mpc8xxx_wdt_timer_ping(0);
else
- mpc83xx_wdt_pr_warn("watchdog closed");
+ mpc8xxx_wdt_pr_warn("watchdog closed");
clear_bit(0, &wdt_is_open);
return 0;
}
-static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
+static int mpc8xxx_wdt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
void __user *argp = (void __user *)arg;
@@ -143,7 +143,7 @@ static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
static struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING,
.firmware_version = 1,
- .identity = "MPC83xx",
+ .identity = "MPC8xxx",
};
switch (cmd) {
@@ -153,7 +153,7 @@ static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
case WDIOC_GETBOOTSTATUS:
return put_user(0, p);
case WDIOC_KEEPALIVE:
- mpc83xx_wdt_keepalive();
+ mpc8xxx_wdt_keepalive();
return 0;
case WDIOC_GETTIMEOUT:
return put_user(timeout_sec, p);
@@ -162,22 +162,22 @@ static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
}
}
-static const struct file_operations mpc83xx_wdt_fops = {
+static const struct file_operations mpc8xxx_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
- .write = mpc83xx_wdt_write,
- .ioctl = mpc83xx_wdt_ioctl,
- .open = mpc83xx_wdt_open,
- .release = mpc83xx_wdt_release,
+ .write = mpc8xxx_wdt_write,
+ .ioctl = mpc8xxx_wdt_ioctl,
+ .open = mpc8xxx_wdt_open,
+ .release = mpc8xxx_wdt_release,
};
-static struct miscdevice mpc83xx_wdt_miscdev = {
+static struct miscdevice mpc8xxx_wdt_miscdev = {
.minor = WATCHDOG_MINOR,
.name = "watchdog",
- .fops = &mpc83xx_wdt_fops,
+ .fops = &mpc8xxx_wdt_fops,
};
-static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,
+static int __devinit mpc8xxx_wdt_probe(struct of_device *ofdev,
const struct of_device_id *match)
{
int ret;
@@ -194,12 +194,12 @@ static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,
enabled = in_be32(&wd_base->swcrr) & SWCRR_SWEN;
if (!enabled && of_device_is_compatible(np, "fsl,mpc8610-wdt")) {
- pr_info("mpc83xx_wdt: could not be enabled in software\n");
+ pr_info("mpc8xxx_wdt: could not be enabled in software\n");
ret = -ENOSYS;
goto err_unmap;
}
- ret = misc_register(&mpc83xx_wdt_miscdev);
+ ret = misc_register(&mpc8xxx_wdt_miscdev);
if (ret) {
pr_err("cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
@@ -212,62 +212,62 @@ static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,
else
timeout_sec = timeout / freq;
- pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d "
+ pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d "
"(%d seconds)\n", reset ? "reset" : "interrupt", timeout,
timeout_sec);
/*
* If the watchdog was previously enabled or we're running on
- * MPC86xx, we should ping the wdt from the kernel until the
+ * MPC8xxx, we should ping the wdt from the kernel until the
* userspace handles it.
*/
if (enabled)
- mpc83xx_wdt_timer_ping(0);
+ mpc8xxx_wdt_timer_ping(0);
return 0;
err_unmap:
iounmap(wd_base);
return ret;
}
-static int __devexit mpc83xx_wdt_remove(struct of_device *ofdev)
+static int __devexit mpc8xxx_wdt_remove(struct of_device *ofdev)
{
- mpc83xx_wdt_pr_warn("watchdog removed");
+ mpc8xxx_wdt_pr_warn("watchdog removed");
del_timer_sync(&wdt_timer);
- misc_deregister(&mpc83xx_wdt_miscdev);
+ misc_deregister(&mpc8xxx_wdt_miscdev);
iounmap(wd_base);
return 0;
}
-static const struct of_device_id mpc83xx_wdt_match[] = {
+static const struct of_device_id mpc8xxx_wdt_match[] = {
{ .compatible = "mpc83xx_wdt", },
{ .compatible = "fsl,mpc8610-wdt", },
{},
};
-MODULE_DEVICE_TABLE(of, mpc83xx_wdt_match);
+MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match);
-static struct of_platform_driver mpc83xx_wdt_driver = {
- .name = "mpc83xx_wdt",
- .match_table = mpc83xx_wdt_match,
- .probe = mpc83xx_wdt_probe,
- .remove = __devexit_p(mpc83xx_wdt_remove),
+static struct of_platform_driver mpc8xxx_wdt_driver = {
+ .name = "mpc8xxx_wdt",
+ .match_table = mpc8xxx_wdt_match,
+ .probe = mpc8xxx_wdt_probe,
+ .remove = __devexit_p(mpc8xxx_wdt_remove),
};
-static int __init mpc83xx_wdt_init(void)
+static int __init mpc8xxx_wdt_init(void)
{
- return of_register_platform_driver(&mpc83xx_wdt_driver);
+ return of_register_platform_driver(&mpc8xxx_wdt_driver);
}
-static void __exit mpc83xx_wdt_exit(void)
+static void __exit mpc8xxx_wdt_exit(void)
{
- of_unregister_platform_driver(&mpc83xx_wdt_driver);
+ of_unregister_platform_driver(&mpc8xxx_wdt_driver);
}
-subsys_initcall(mpc83xx_wdt_init);
-module_exit(mpc83xx_wdt_exit);
+subsys_initcall(mpc8xxx_wdt_init);
+module_exit(mpc8xxx_wdt_exit);
MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
-MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx/MPC86xx uProcessor");
+MODULE_DESCRIPTION("Driver for watchdog timer in MPC8xxx uProcessor");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS("platform:mpc83xx_wdt");
+MODULE_ALIAS("platform:mpc8xxx_wdt");
--
1.5.5.1
^ permalink raw reply related
* [PATCH 5/6] [POWERPC] fsl_soc: remove mpc83xx_wdt code
From: Anton Vorontsov @ 2008-05-13 14:15 UTC (permalink / raw)
To: Kumar Gala, Wim Van Sebroeck; +Cc: Scott Wood, linuxppc-dev, Timur Tabi
In-Reply-To: <20080513141411.GA8981@polina.dev.rtsoft.ru>
mpc83xx_wdt is the OF driver now, so we don't need fsl_soc constructor.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
arch/powerpc/sysdev/fsl_soc.c | 46 -----------------------------------------
1 files changed, 0 insertions(+), 46 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index a5ceeef..32a3ac8 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -545,52 +545,6 @@ err:
arch_initcall(fsl_i2c_of_init);
#endif
-#ifdef CONFIG_PPC_83xx
-static int __init mpc83xx_wdt_init(void)
-{
- struct resource r;
- struct device_node *np;
- struct platform_device *dev;
- u32 freq = fsl_get_sys_freq();
- int ret;
-
- np = of_find_compatible_node(NULL, "watchdog", "mpc83xx_wdt");
-
- if (!np) {
- ret = -ENODEV;
- goto nodev;
- }
-
- memset(&r, 0, sizeof(r));
-
- ret = of_address_to_resource(np, 0, &r);
- if (ret)
- goto err;
-
- dev = platform_device_register_simple("mpc83xx_wdt", 0, &r, 1);
- if (IS_ERR(dev)) {
- ret = PTR_ERR(dev);
- goto err;
- }
-
- ret = platform_device_add_data(dev, &freq, sizeof(freq));
- if (ret)
- goto unreg;
-
- of_node_put(np);
- return 0;
-
-unreg:
- platform_device_unregister(dev);
-err:
- of_node_put(np);
-nodev:
- return ret;
-}
-
-arch_initcall(mpc83xx_wdt_init);
-#endif
-
static enum fsl_usb2_phy_modes determine_usb_phy(const char *phy_type)
{
if (!phy_type)
--
1.5.5.1
^ permalink raw reply related
* [PATCH 3/6] [WATCHDOG] mpc83xx_wdt: rename to mpc8xxx_wdt
From: Anton Vorontsov @ 2008-05-13 14:14 UTC (permalink / raw)
To: Kumar Gala, Wim Van Sebroeck; +Cc: Scott Wood, linuxppc-dev, Timur Tabi
In-Reply-To: <20080513141411.GA8981@polina.dev.rtsoft.ru>
Rename the driver because now we support some MPC86xx processors.
There are no changes to the mpc83xx_wdt.c file, yet. When possible, we do
file renames and changes separately (because Linus once asked so, because
it helps git to track the renamed files).
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/watchdog/Kconfig | 4 +-
drivers/watchdog/Makefile | 2 +-
drivers/watchdog/mpc83xx_wdt.c | 273 ----------------------------------------
drivers/watchdog/mpc8xxx_wdt.c | 273 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 276 insertions(+), 276 deletions(-)
delete mode 100644 drivers/watchdog/mpc83xx_wdt.c
create mode 100644 drivers/watchdog/mpc8xxx_wdt.c
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 2929055..bd9044f 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -682,8 +682,8 @@ config 8xx_WDT
tristate "MPC8xx Watchdog Timer"
depends on 8xx
-config 83xx_WDT
- tristate "MPC83xx/MPC86xx Watchdog Timer"
+config 8xxx_WDT
+ tristate "MPC8xxx Watchdog Timer"
depends on PPC_83xx || PPC_86xx
config MV64X60_WDT
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index f3fb170..d5782f9 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -102,7 +102,7 @@ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
# POWERPC Architecture
obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
-obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o
+obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o
obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o
diff --git a/drivers/watchdog/mpc83xx_wdt.c b/drivers/watchdog/mpc83xx_wdt.c
deleted file mode 100644
index 3534ae0..0000000
--- a/drivers/watchdog/mpc83xx_wdt.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * mpc83xx_wdt.c - MPC83xx/MPC86xx watchdog userspace interface
- *
- * Authors: Dave Updegraff <dave@cray.org>
- * Kumar Gala <galak@kernel.crashing.org>
- * Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org>
- * ..and from sc520_wdt
- * Copyright (c) 2008 MontaVista Software, Inc.
- * Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * Note: it appears that you can only actually ENABLE or DISABLE the thing
- * once after POR. Once enabled, you cannot disable, and vice versa.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- */
-
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/of_platform.h>
-#include <linux/module.h>
-#include <linux/watchdog.h>
-#include <linux/timer.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <sysdev/fsl_soc.h>
-
-struct mpc83xx_wdt {
- __be32 res0;
- __be32 swcrr; /* System watchdog control register */
-#define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
-#define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
-#define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit.*/
-#define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
- __be32 swcnr; /* System watchdog count register */
- u8 res1[2];
- __be16 swsrr; /* System watchdog service register */
- u8 res2[0xF0];
-};
-
-static struct mpc83xx_wdt __iomem *wd_base;
-
-static u16 timeout = 0xffff;
-module_param(timeout, ushort, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in ticks. (0<timeout<65536, default=65535");
-
-static int reset = 1;
-module_param(reset, bool, 0);
-MODULE_PARM_DESC(reset, "Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
- "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- * We always prescale, but if someone really doesn't want to they can set this
- * to 0
- */
-static int prescale = 1;
-static unsigned int timeout_sec;
-
-static unsigned long wdt_is_open;
-static DEFINE_SPINLOCK(wdt_spinlock);
-
-static void mpc83xx_wdt_keepalive(void)
-{
- /* Ping the WDT */
- spin_lock(&wdt_spinlock);
- out_be16(&wd_base->swsrr, 0x556c);
- out_be16(&wd_base->swsrr, 0xaa39);
- spin_unlock(&wdt_spinlock);
-}
-
-static void mpc83xx_wdt_timer_ping(unsigned long arg);
-static DEFINE_TIMER(wdt_timer, mpc83xx_wdt_timer_ping, 0, 0);
-
-static void mpc83xx_wdt_timer_ping(unsigned long arg)
-{
- mpc83xx_wdt_keepalive();
- /* We're pinging it twice faster than needed, just to be sure. */
- mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
-}
-
-static void mpc83xx_wdt_pr_warn(const char *msg)
-{
- pr_crit("mpc83xx_wdt: %s, expect the %s soon!\n", msg,
- reset ? "reset" : "machine check exception");
-}
-
-static ssize_t mpc83xx_wdt_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
-{
- if (count)
- mpc83xx_wdt_keepalive();
- return count;
-}
-
-static int mpc83xx_wdt_open(struct inode *inode, struct file *file)
-{
- u32 tmp = SWCRR_SWEN;
- if (test_and_set_bit(0, &wdt_is_open))
- return -EBUSY;
-
- /* Once we start the watchdog we can't stop it */
- if (nowayout)
- __module_get(THIS_MODULE);
-
- /* Good, fire up the show */
- if (prescale)
- tmp |= SWCRR_SWPR;
- if (reset)
- tmp |= SWCRR_SWRI;
-
- tmp |= timeout << 16;
-
- out_be32(&wd_base->swcrr, tmp);
-
- del_timer_sync(&wdt_timer);
-
- return nonseekable_open(inode, file);
-}
-
-static int mpc83xx_wdt_release(struct inode *inode, struct file *file)
-{
- if (!nowayout)
- mpc83xx_wdt_timer_ping(0);
- else
- mpc83xx_wdt_pr_warn("watchdog closed");
- clear_bit(0, &wdt_is_open);
- return 0;
-}
-
-static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
-{
- void __user *argp = (void __user *)arg;
- int __user *p = argp;
- static struct watchdog_info ident = {
- .options = WDIOF_KEEPALIVEPING,
- .firmware_version = 1,
- .identity = "MPC83xx",
- };
-
- switch (cmd) {
- case WDIOC_GETSUPPORT:
- return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
- case WDIOC_GETSTATUS:
- case WDIOC_GETBOOTSTATUS:
- return put_user(0, p);
- case WDIOC_KEEPALIVE:
- mpc83xx_wdt_keepalive();
- return 0;
- case WDIOC_GETTIMEOUT:
- return put_user(timeout_sec, p);
- default:
- return -ENOTTY;
- }
-}
-
-static const struct file_operations mpc83xx_wdt_fops = {
- .owner = THIS_MODULE,
- .llseek = no_llseek,
- .write = mpc83xx_wdt_write,
- .ioctl = mpc83xx_wdt_ioctl,
- .open = mpc83xx_wdt_open,
- .release = mpc83xx_wdt_release,
-};
-
-static struct miscdevice mpc83xx_wdt_miscdev = {
- .minor = WATCHDOG_MINOR,
- .name = "watchdog",
- .fops = &mpc83xx_wdt_fops,
-};
-
-static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,
- const struct of_device_id *match)
-{
- int ret;
- struct device_node *np = ofdev->node;
- u32 freq = fsl_get_sys_freq();
- bool enabled;
-
- if (!freq || freq == -1)
- return -EINVAL;
-
- wd_base = of_iomap(np, 0);
- if (!wd_base)
- return -ENOMEM;
-
- enabled = in_be32(&wd_base->swcrr) & SWCRR_SWEN;
- if (!enabled && of_device_is_compatible(np, "fsl,mpc8610-wdt")) {
- pr_info("mpc83xx_wdt: could not be enabled in software\n");
- ret = -ENOSYS;
- goto err_unmap;
- }
-
- ret = misc_register(&mpc83xx_wdt_miscdev);
- if (ret) {
- pr_err("cannot register miscdev on minor=%d (err=%d)\n",
- WATCHDOG_MINOR, ret);
- goto err_unmap;
- }
-
- /* Calculate the timeout in seconds */
- if (prescale)
- timeout_sec = (timeout * 0x10000) / freq;
- else
- timeout_sec = timeout / freq;
-
- pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d "
- "(%d seconds)\n", reset ? "reset" : "interrupt", timeout,
- timeout_sec);
-
- /*
- * If the watchdog was previously enabled or we're running on
- * MPC86xx, we should ping the wdt from the kernel until the
- * userspace handles it.
- */
- if (enabled)
- mpc83xx_wdt_timer_ping(0);
- return 0;
-err_unmap:
- iounmap(wd_base);
- return ret;
-}
-
-static int __devexit mpc83xx_wdt_remove(struct of_device *ofdev)
-{
- mpc83xx_wdt_pr_warn("watchdog removed");
- del_timer_sync(&wdt_timer);
- misc_deregister(&mpc83xx_wdt_miscdev);
- iounmap(wd_base);
-
- return 0;
-}
-
-static const struct of_device_id mpc83xx_wdt_match[] = {
- { .compatible = "mpc83xx_wdt", },
- { .compatible = "fsl,mpc8610-wdt", },
- {},
-};
-MODULE_DEVICE_TABLE(of, mpc83xx_wdt_match);
-
-static struct of_platform_driver mpc83xx_wdt_driver = {
- .name = "mpc83xx_wdt",
- .match_table = mpc83xx_wdt_match,
- .probe = mpc83xx_wdt_probe,
- .remove = __devexit_p(mpc83xx_wdt_remove),
-};
-
-static int __init mpc83xx_wdt_init(void)
-{
- return of_register_platform_driver(&mpc83xx_wdt_driver);
-}
-
-static void __exit mpc83xx_wdt_exit(void)
-{
- of_unregister_platform_driver(&mpc83xx_wdt_driver);
-}
-
-subsys_initcall(mpc83xx_wdt_init);
-module_exit(mpc83xx_wdt_exit);
-
-MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
-MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx/MPC86xx uProcessor");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS("platform:mpc83xx_wdt");
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
new file mode 100644
index 0000000..3534ae0
--- /dev/null
+++ b/drivers/watchdog/mpc8xxx_wdt.c
@@ -0,0 +1,273 @@
+/*
+ * mpc83xx_wdt.c - MPC83xx/MPC86xx watchdog userspace interface
+ *
+ * Authors: Dave Updegraff <dave@cray.org>
+ * Kumar Gala <galak@kernel.crashing.org>
+ * Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org>
+ * ..and from sc520_wdt
+ * Copyright (c) 2008 MontaVista Software, Inc.
+ * Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * Note: it appears that you can only actually ENABLE or DISABLE the thing
+ * once after POR. Once enabled, you cannot disable, and vice versa.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/of_platform.h>
+#include <linux/module.h>
+#include <linux/watchdog.h>
+#include <linux/timer.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <sysdev/fsl_soc.h>
+
+struct mpc83xx_wdt {
+ __be32 res0;
+ __be32 swcrr; /* System watchdog control register */
+#define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
+#define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
+#define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit.*/
+#define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
+ __be32 swcnr; /* System watchdog count register */
+ u8 res1[2];
+ __be16 swsrr; /* System watchdog service register */
+ u8 res2[0xF0];
+};
+
+static struct mpc83xx_wdt __iomem *wd_base;
+
+static u16 timeout = 0xffff;
+module_param(timeout, ushort, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in ticks. (0<timeout<65536, default=65535");
+
+static int reset = 1;
+module_param(reset, bool, 0);
+MODULE_PARM_DESC(reset, "Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+ "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * We always prescale, but if someone really doesn't want to they can set this
+ * to 0
+ */
+static int prescale = 1;
+static unsigned int timeout_sec;
+
+static unsigned long wdt_is_open;
+static DEFINE_SPINLOCK(wdt_spinlock);
+
+static void mpc83xx_wdt_keepalive(void)
+{
+ /* Ping the WDT */
+ spin_lock(&wdt_spinlock);
+ out_be16(&wd_base->swsrr, 0x556c);
+ out_be16(&wd_base->swsrr, 0xaa39);
+ spin_unlock(&wdt_spinlock);
+}
+
+static void mpc83xx_wdt_timer_ping(unsigned long arg);
+static DEFINE_TIMER(wdt_timer, mpc83xx_wdt_timer_ping, 0, 0);
+
+static void mpc83xx_wdt_timer_ping(unsigned long arg)
+{
+ mpc83xx_wdt_keepalive();
+ /* We're pinging it twice faster than needed, just to be sure. */
+ mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
+}
+
+static void mpc83xx_wdt_pr_warn(const char *msg)
+{
+ pr_crit("mpc83xx_wdt: %s, expect the %s soon!\n", msg,
+ reset ? "reset" : "machine check exception");
+}
+
+static ssize_t mpc83xx_wdt_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *ppos)
+{
+ if (count)
+ mpc83xx_wdt_keepalive();
+ return count;
+}
+
+static int mpc83xx_wdt_open(struct inode *inode, struct file *file)
+{
+ u32 tmp = SWCRR_SWEN;
+ if (test_and_set_bit(0, &wdt_is_open))
+ return -EBUSY;
+
+ /* Once we start the watchdog we can't stop it */
+ if (nowayout)
+ __module_get(THIS_MODULE);
+
+ /* Good, fire up the show */
+ if (prescale)
+ tmp |= SWCRR_SWPR;
+ if (reset)
+ tmp |= SWCRR_SWRI;
+
+ tmp |= timeout << 16;
+
+ out_be32(&wd_base->swcrr, tmp);
+
+ del_timer_sync(&wdt_timer);
+
+ return nonseekable_open(inode, file);
+}
+
+static int mpc83xx_wdt_release(struct inode *inode, struct file *file)
+{
+ if (!nowayout)
+ mpc83xx_wdt_timer_ping(0);
+ else
+ mpc83xx_wdt_pr_warn("watchdog closed");
+ clear_bit(0, &wdt_is_open);
+ return 0;
+}
+
+static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ void __user *argp = (void __user *)arg;
+ int __user *p = argp;
+ static struct watchdog_info ident = {
+ .options = WDIOF_KEEPALIVEPING,
+ .firmware_version = 1,
+ .identity = "MPC83xx",
+ };
+
+ switch (cmd) {
+ case WDIOC_GETSUPPORT:
+ return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
+ case WDIOC_GETSTATUS:
+ case WDIOC_GETBOOTSTATUS:
+ return put_user(0, p);
+ case WDIOC_KEEPALIVE:
+ mpc83xx_wdt_keepalive();
+ return 0;
+ case WDIOC_GETTIMEOUT:
+ return put_user(timeout_sec, p);
+ default:
+ return -ENOTTY;
+ }
+}
+
+static const struct file_operations mpc83xx_wdt_fops = {
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .write = mpc83xx_wdt_write,
+ .ioctl = mpc83xx_wdt_ioctl,
+ .open = mpc83xx_wdt_open,
+ .release = mpc83xx_wdt_release,
+};
+
+static struct miscdevice mpc83xx_wdt_miscdev = {
+ .minor = WATCHDOG_MINOR,
+ .name = "watchdog",
+ .fops = &mpc83xx_wdt_fops,
+};
+
+static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,
+ const struct of_device_id *match)
+{
+ int ret;
+ struct device_node *np = ofdev->node;
+ u32 freq = fsl_get_sys_freq();
+ bool enabled;
+
+ if (!freq || freq == -1)
+ return -EINVAL;
+
+ wd_base = of_iomap(np, 0);
+ if (!wd_base)
+ return -ENOMEM;
+
+ enabled = in_be32(&wd_base->swcrr) & SWCRR_SWEN;
+ if (!enabled && of_device_is_compatible(np, "fsl,mpc8610-wdt")) {
+ pr_info("mpc83xx_wdt: could not be enabled in software\n");
+ ret = -ENOSYS;
+ goto err_unmap;
+ }
+
+ ret = misc_register(&mpc83xx_wdt_miscdev);
+ if (ret) {
+ pr_err("cannot register miscdev on minor=%d (err=%d)\n",
+ WATCHDOG_MINOR, ret);
+ goto err_unmap;
+ }
+
+ /* Calculate the timeout in seconds */
+ if (prescale)
+ timeout_sec = (timeout * 0x10000) / freq;
+ else
+ timeout_sec = timeout / freq;
+
+ pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d "
+ "(%d seconds)\n", reset ? "reset" : "interrupt", timeout,
+ timeout_sec);
+
+ /*
+ * If the watchdog was previously enabled or we're running on
+ * MPC86xx, we should ping the wdt from the kernel until the
+ * userspace handles it.
+ */
+ if (enabled)
+ mpc83xx_wdt_timer_ping(0);
+ return 0;
+err_unmap:
+ iounmap(wd_base);
+ return ret;
+}
+
+static int __devexit mpc83xx_wdt_remove(struct of_device *ofdev)
+{
+ mpc83xx_wdt_pr_warn("watchdog removed");
+ del_timer_sync(&wdt_timer);
+ misc_deregister(&mpc83xx_wdt_miscdev);
+ iounmap(wd_base);
+
+ return 0;
+}
+
+static const struct of_device_id mpc83xx_wdt_match[] = {
+ { .compatible = "mpc83xx_wdt", },
+ { .compatible = "fsl,mpc8610-wdt", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, mpc83xx_wdt_match);
+
+static struct of_platform_driver mpc83xx_wdt_driver = {
+ .name = "mpc83xx_wdt",
+ .match_table = mpc83xx_wdt_match,
+ .probe = mpc83xx_wdt_probe,
+ .remove = __devexit_p(mpc83xx_wdt_remove),
+};
+
+static int __init mpc83xx_wdt_init(void)
+{
+ return of_register_platform_driver(&mpc83xx_wdt_driver);
+}
+
+static void __exit mpc83xx_wdt_exit(void)
+{
+ of_unregister_platform_driver(&mpc83xx_wdt_driver);
+}
+
+subsys_initcall(mpc83xx_wdt_init);
+module_exit(mpc83xx_wdt_exit);
+
+MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
+MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx/MPC86xx uProcessor");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_ALIAS("platform:mpc83xx_wdt");
--
1.5.5.1
^ permalink raw reply related
* [PATCH 2/6] [WATCHDOG] mpc83xx_wdt: add support for MPC86xx CPUs
From: Anton Vorontsov @ 2008-05-13 14:14 UTC (permalink / raw)
To: Kumar Gala, Wim Van Sebroeck; +Cc: Scott Wood, linuxppc-dev, Timur Tabi
In-Reply-To: <20080513141411.GA8981@polina.dev.rtsoft.ru>
On MPC86xx the watchdog could be enabled only at power-on-reset, and
could not be disabled afterwards. We must ping the watchdog from the
kernel until the userspace handles it.
MPC83xx CPUs are only differ in a way that watchdog could be disabled
once, but after it was enabled via software it becomes just the same
as MPC86xx.
Thus, to support MPC86xx I added the kernel timer which pings the
watchdog until the userspace opens it.
Since we implemented the timer, now we're able to implement proper
handling for the CONFIG_WATCHDOG_NOWAYOUT case, for MPC83xx and MPC86xx.
Also move the probe code into subsys_initcall, because we want start
pinging the watchdog ASAP, and misc devices are available in
subsys_initcall.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/watchdog/Kconfig | 4 +-
drivers/watchdog/mpc83xx_wdt.c | 63 +++++++++++++++++++++++++++++++++++----
2 files changed, 58 insertions(+), 9 deletions(-)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 254d115..2929055 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -683,8 +683,8 @@ config 8xx_WDT
depends on 8xx
config 83xx_WDT
- tristate "MPC83xx Watchdog Timer"
- depends on PPC_83xx
+ tristate "MPC83xx/MPC86xx Watchdog Timer"
+ depends on PPC_83xx || PPC_86xx
config MV64X60_WDT
tristate "MV64X60 (Marvell Discovery) Watchdog Timer"
diff --git a/drivers/watchdog/mpc83xx_wdt.c b/drivers/watchdog/mpc83xx_wdt.c
index 8f59225..3534ae0 100644
--- a/drivers/watchdog/mpc83xx_wdt.c
+++ b/drivers/watchdog/mpc83xx_wdt.c
@@ -1,10 +1,12 @@
/*
- * mpc83xx_wdt.c - MPC83xx watchdog userspace interface
+ * mpc83xx_wdt.c - MPC83xx/MPC86xx watchdog userspace interface
*
* Authors: Dave Updegraff <dave@cray.org>
* Kumar Gala <galak@kernel.crashing.org>
* Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org>
* ..and from sc520_wdt
+ * Copyright (c) 2008 MontaVista Software, Inc.
+ * Anton Vorontsov <avorontsov@ru.mvista.com>
*
* Note: it appears that you can only actually ENABLE or DISABLE the thing
* once after POR. Once enabled, you cannot disable, and vice versa.
@@ -22,6 +24,7 @@
#include <linux/of_platform.h>
#include <linux/module.h>
#include <linux/watchdog.h>
+#include <linux/timer.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <sysdev/fsl_soc.h>
@@ -49,6 +52,11 @@ static int reset = 1;
module_param(reset, bool, 0);
MODULE_PARM_DESC(reset, "Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset");
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+ "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
/*
* We always prescale, but if someone really doesn't want to they can set this
* to 0
@@ -68,6 +76,22 @@ static void mpc83xx_wdt_keepalive(void)
spin_unlock(&wdt_spinlock);
}
+static void mpc83xx_wdt_timer_ping(unsigned long arg);
+static DEFINE_TIMER(wdt_timer, mpc83xx_wdt_timer_ping, 0, 0);
+
+static void mpc83xx_wdt_timer_ping(unsigned long arg)
+{
+ mpc83xx_wdt_keepalive();
+ /* We're pinging it twice faster than needed, just to be sure. */
+ mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
+}
+
+static void mpc83xx_wdt_pr_warn(const char *msg)
+{
+ pr_crit("mpc83xx_wdt: %s, expect the %s soon!\n", msg,
+ reset ? "reset" : "machine check exception");
+}
+
static ssize_t mpc83xx_wdt_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
@@ -83,7 +107,8 @@ static int mpc83xx_wdt_open(struct inode *inode, struct file *file)
return -EBUSY;
/* Once we start the watchdog we can't stop it */
- __module_get(THIS_MODULE);
+ if (nowayout)
+ __module_get(THIS_MODULE);
/* Good, fire up the show */
if (prescale)
@@ -95,13 +120,17 @@ static int mpc83xx_wdt_open(struct inode *inode, struct file *file)
out_be32(&wd_base->swcrr, tmp);
+ del_timer_sync(&wdt_timer);
+
return nonseekable_open(inode, file);
}
static int mpc83xx_wdt_release(struct inode *inode, struct file *file)
{
- printk(KERN_CRIT "Unexpected close, not stopping watchdog!\n");
- mpc83xx_wdt_keepalive();
+ if (!nowayout)
+ mpc83xx_wdt_timer_ping(0);
+ else
+ mpc83xx_wdt_pr_warn("watchdog closed");
clear_bit(0, &wdt_is_open);
return 0;
}
@@ -152,15 +181,24 @@ static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,
const struct of_device_id *match)
{
int ret;
+ struct device_node *np = ofdev->node;
u32 freq = fsl_get_sys_freq();
+ bool enabled;
if (!freq || freq == -1)
return -EINVAL;
- wd_base = of_iomap(ofdev->node, 0);
+ wd_base = of_iomap(np, 0);
if (!wd_base)
return -ENOMEM;
+ enabled = in_be32(&wd_base->swcrr) & SWCRR_SWEN;
+ if (!enabled && of_device_is_compatible(np, "fsl,mpc8610-wdt")) {
+ pr_info("mpc83xx_wdt: could not be enabled in software\n");
+ ret = -ENOSYS;
+ goto err_unmap;
+ }
+
ret = misc_register(&mpc83xx_wdt_miscdev);
if (ret) {
pr_err("cannot register miscdev on minor=%d (err=%d)\n",
@@ -177,6 +215,14 @@ static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,
pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d "
"(%d seconds)\n", reset ? "reset" : "interrupt", timeout,
timeout_sec);
+
+ /*
+ * If the watchdog was previously enabled or we're running on
+ * MPC86xx, we should ping the wdt from the kernel until the
+ * userspace handles it.
+ */
+ if (enabled)
+ mpc83xx_wdt_timer_ping(0);
return 0;
err_unmap:
iounmap(wd_base);
@@ -185,6 +231,8 @@ err_unmap:
static int __devexit mpc83xx_wdt_remove(struct of_device *ofdev)
{
+ mpc83xx_wdt_pr_warn("watchdog removed");
+ del_timer_sync(&wdt_timer);
misc_deregister(&mpc83xx_wdt_miscdev);
iounmap(wd_base);
@@ -193,6 +241,7 @@ static int __devexit mpc83xx_wdt_remove(struct of_device *ofdev)
static const struct of_device_id mpc83xx_wdt_match[] = {
{ .compatible = "mpc83xx_wdt", },
+ { .compatible = "fsl,mpc8610-wdt", },
{},
};
MODULE_DEVICE_TABLE(of, mpc83xx_wdt_match);
@@ -214,11 +263,11 @@ static void __exit mpc83xx_wdt_exit(void)
of_unregister_platform_driver(&mpc83xx_wdt_driver);
}
-module_init(mpc83xx_wdt_init);
+subsys_initcall(mpc83xx_wdt_init);
module_exit(mpc83xx_wdt_exit);
MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
-MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx uProcessor");
+MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx/MPC86xx uProcessor");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
MODULE_ALIAS("platform:mpc83xx_wdt");
--
1.5.5.1
^ permalink raw reply related
* [PATCH 1/6] [WATCHDOG] mpc83xx_wdt: convert to the OF platform driver
From: Anton Vorontsov @ 2008-05-13 14:14 UTC (permalink / raw)
To: Kumar Gala, Wim Van Sebroeck; +Cc: Scott Wood, linuxppc-dev, Timur Tabi
In-Reply-To: <20080513141411.GA8981@polina.dev.rtsoft.ru>
This patch simply converts mpc83xx_wdt to the OF platform driver so we
can directly work with the device tree without passing various stuff
through platform data.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/watchdog/mpc83xx_wdt.c | 64 ++++++++++++++++++----------------------
1 files changed, 29 insertions(+), 35 deletions(-)
diff --git a/drivers/watchdog/mpc83xx_wdt.c b/drivers/watchdog/mpc83xx_wdt.c
index b16c5cd..8f59225 100644
--- a/drivers/watchdog/mpc83xx_wdt.c
+++ b/drivers/watchdog/mpc83xx_wdt.c
@@ -19,11 +19,12 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
-#include <linux/platform_device.h>
+#include <linux/of_platform.h>
#include <linux/module.h>
#include <linux/watchdog.h>
#include <asm/io.h>
#include <asm/uaccess.h>
+#include <sysdev/fsl_soc.h>
struct mpc83xx_wdt {
__be32 res0;
@@ -147,53 +148,42 @@ static struct miscdevice mpc83xx_wdt_miscdev = {
.fops = &mpc83xx_wdt_fops,
};
-static int __devinit mpc83xx_wdt_probe(struct platform_device *dev)
+static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,
+ const struct of_device_id *match)
{
- struct resource *r;
int ret;
- unsigned int *freq = dev->dev.platform_data;
+ u32 freq = fsl_get_sys_freq();
- /* get a pointer to the register memory */
- r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+ if (!freq || freq == -1)
+ return -EINVAL;
- if (!r) {
- ret = -ENODEV;
- goto err_out;
- }
-
- wd_base = ioremap(r->start, sizeof (struct mpc83xx_wdt));
-
- if (wd_base == NULL) {
- ret = -ENOMEM;
- goto err_out;
- }
+ wd_base = of_iomap(ofdev->node, 0);
+ if (!wd_base)
+ return -ENOMEM;
ret = misc_register(&mpc83xx_wdt_miscdev);
if (ret) {
- printk(KERN_ERR "cannot register miscdev on minor=%d "
- "(err=%d)\n",
- WATCHDOG_MINOR, ret);
+ pr_err("cannot register miscdev on minor=%d (err=%d)\n",
+ WATCHDOG_MINOR, ret);
goto err_unmap;
}
/* Calculate the timeout in seconds */
if (prescale)
- timeout_sec = (timeout * 0x10000) / (*freq);
+ timeout_sec = (timeout * 0x10000) / freq;
else
- timeout_sec = timeout / (*freq);
+ timeout_sec = timeout / freq;
- printk(KERN_INFO "WDT driver for MPC83xx initialized. "
- "mode:%s timeout=%d (%d seconds)\n",
- reset ? "reset":"interrupt", timeout, timeout_sec);
+ pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d "
+ "(%d seconds)\n", reset ? "reset" : "interrupt", timeout,
+ timeout_sec);
return 0;
-
err_unmap:
iounmap(wd_base);
-err_out:
return ret;
}
-static int __devexit mpc83xx_wdt_remove(struct platform_device *dev)
+static int __devexit mpc83xx_wdt_remove(struct of_device *ofdev)
{
misc_deregister(&mpc83xx_wdt_miscdev);
iounmap(wd_base);
@@ -201,23 +191,27 @@ static int __devexit mpc83xx_wdt_remove(struct platform_device *dev)
return 0;
}
-static struct platform_driver mpc83xx_wdt_driver = {
+static const struct of_device_id mpc83xx_wdt_match[] = {
+ { .compatible = "mpc83xx_wdt", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, mpc83xx_wdt_match);
+
+static struct of_platform_driver mpc83xx_wdt_driver = {
+ .name = "mpc83xx_wdt",
+ .match_table = mpc83xx_wdt_match,
.probe = mpc83xx_wdt_probe,
.remove = __devexit_p(mpc83xx_wdt_remove),
- .driver = {
- .name = "mpc83xx_wdt",
- .owner = THIS_MODULE,
- },
};
static int __init mpc83xx_wdt_init(void)
{
- return platform_driver_register(&mpc83xx_wdt_driver);
+ return of_register_platform_driver(&mpc83xx_wdt_driver);
}
static void __exit mpc83xx_wdt_exit(void)
{
- platform_driver_unregister(&mpc83xx_wdt_driver);
+ of_unregister_platform_driver(&mpc83xx_wdt_driver);
}
module_init(mpc83xx_wdt_init);
--
1.5.5.1
^ permalink raw reply related
* [PATCH 0/6 v2] mpc83xx_wdt rework, support for mpc8610
From: Anton Vorontsov @ 2008-05-13 14:14 UTC (permalink / raw)
To: Kumar Gala, Wim Van Sebroeck; +Cc: Scott Wood, linuxppc-dev, Timur Tabi
Hi all,
Thanks for the review, here is the new version.
Changes since v1:
- Scott Wood asked for mpc83xx_wdt on multiplatform kernels. Done via
OF platform driver;
- Kumar Gala asked for mpc83xx_wdt -> mpc8xxx_wdt rename. Done in two
steps;
- Segher Boessenkool noticed a negligence in the wdt device tree node.
Fixed by removing mpc83xx_wdt compatible entry.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* Please pull from 'powerpc-next' branch (for 2.6.26)
From: Kumar Gala @ 2008-05-13 13:56 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
Please pull from 'powerpc-next' branch of
master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git powerpc-next
All of these changes are pretty much isolated to the board they touch so
the possibility of breaking things is minor. Also, the driver removal is
because we have superceded fec_8xx with fs_enet.
- k
to receive the following updates:
arch/powerpc/boot/dts/mpc8377_mds.dts | 27
arch/powerpc/boot/dts/mpc8610_hpcd.dts | 60 +
arch/powerpc/boot/dts/sbc8548.dts | 94 ++
arch/powerpc/configs/mpc8610_hpcd_defconfig | 95 +-
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 121 ++
arch/powerpc/platforms/85xx/sbc8548.c | 30
arch/powerpc/platforms/86xx/mpc8610_hpcd.c | 15
drivers/net/Kconfig | 1
drivers/net/Makefile | 1
drivers/net/fec_8xx/Kconfig | 20
drivers/net/fec_8xx/Makefile | 12
drivers/net/fec_8xx/fec_8xx-netta.c | 151 ---
drivers/net/fec_8xx/fec_8xx.h | 220 ----
drivers/net/fec_8xx/fec_main.c | 1264 ----------------------------
drivers/net/fec_8xx/fec_mii.c | 418 ---------
15 files changed, 429 insertions(+), 2100 deletions(-)
Andy Fleming (2):
[POWERPC] 85xx: Add 8568 PHY workarounds to board code
[POWERPC] 85xx: Fix some sparse warnings for 85xx MDS
Anton Vorontsov (3):
[POWERPC] 86xx: mpc8610_hpcd: use ULI526X driver for on-board ethernet
[POWERPC] 86xx: mpc8610_hpcd: add support for NOR and NAND flashes
[POWERPC] 86xx: mpc8610_hpcd: fix second serial port
Becky Bruce (1):
[POWERPC] Delete unused fec_8xx net driver
Jeremy McNicoll (1):
[POWERPC] 85xx: SBC8548 - Add flash support and HW Rev reporting
Zhang Wei (1):
[POWERPC] 83xx: Enable DMA engine on the MPC8377 MDS board.
^ permalink raw reply
* Re: Linux on Ml410
From: Grant Likely @ 2008-05-13 13:54 UTC (permalink / raw)
To: mojtaba; +Cc: John Linn, linuxppc-embedded
In-Reply-To: <016601c8b4ed$a56e57a0$f04b06e0$@com>
On Tue, May 13, 2008 at 5:36 AM, mojtaba <kernelppc@gmail.com> wrote:
> Dear all,
>
> I am trying to run linux 1.6.25 on ML410 board. When the system boot I
> receive this error:
>
> loaded at: 00400000 004CD19C
> board data at: 004CB120 004CB19C
> relocated to: 00404050 004040CC
> zimage at: 00404E3C 004CA0D1
> avail ram: 004CE000 10000000
>
> Linux/PPC load: console=ttyS0,115200 root=/dev/xsa2
> Uncompressing Linux...inflate returned FFFFFFFD
> exit
Not good. If you get an error like this during decompression then you
probably have some sort of memory error. Are you using a reference
design, or have you built a new design? Have you tested your
It could also be a corrupt kernel image. How did you build it? How
large is the image?
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: how to check for "optional" ppc chip features (MSR_BE)
From: Kumar Gala @ 2008-05-13 13:47 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Roland McGrath
In-Reply-To: <18473.33194.781010.826872@cargo.ozlabs.ibm.com>
On May 13, 2008, at 6:55 AM, Paul Mackerras wrote:
> Roland McGrath writes:
>
>> Yeah, all that stuff I could figure out as needed. What I really
>> meant
>> was, where is the big official table of which chips behave which
>> ways that
>> you base all code that on? Actually, I don't really care as long
>> as you
>> all are happy to be responsible for figuring out what matters.
>> With the
>> patch I posted to use MSR_BE, I took Kumar Gala's word as gospel
>> that all
>> the chips on which we use MSR_SE also have MSR_BE. If that's not
>> right,
>> then I hope you'd like to pick a feature bit, populate the tables,
>> etc.,
>> and fix the definition of arch_has_block_step() as appropriate.
>
> It turns out that the 601 doesn't support MSR_BE. It looks like all
> the "classic" 32-bit implementations after that (603, 604, 7xx, 7xxx)
> implemented BE, as do POWER3 and RS64. I'll check the later 64-bit
> processors -- I think they all implement BE. 4xx and Book E have it
> in a different form. I'll let Kumar find out about 8xx and 82xx.
it appears 8xx does, and 82xx are just 603 cores so they do.
> So it looks like we need to define a new feature bit to mean "supports
> block-step". Is this something that userspace will expect to be told
> about via the AT_HWCAP entry in the aux vector?
- k
^ permalink raw reply
* Re: [PATCH 3/3] [POWERPC] 86xx: mpc8610_hpcd: add watchdog node
From: Anton Vorontsov @ 2008-05-13 13:46 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, Wim Van Sebroeck, Timur Tabi
In-Reply-To: <6d173c6a97eab1d96ea91b158b8e1f69@kernel.crashing.org>
On Tue, May 13, 2008 at 12:23:40AM +0200, Segher Boessenkool wrote:
>> + compatible = "mpc83xx_wdt", "fsl,mpc8610-wdt";
>
> You should put the most specific entry first.
Yeah, I've overlooked this. Thanks.
Actually, I should remove mpc83xx_wdt, since mpc8610-wdt isn't
compatible...
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* RE: Linux on Ml410
From: John Linn @ 2008-05-13 13:42 UTC (permalink / raw)
To: mojtaba, linuxppc-embedded
In-Reply-To: <016601c8b4ed$a56e57a0$f04b06e0$@com>
Hi Mojtaba,
Did you build the FPGA bit stream yourself or get it from somewhere?
Specifying ttyS0 means you should have a 16550 UART in the hardware
build, do you?
-- John
-----Original Message-----
From: linuxppc-embedded-bounces+john.linn=3Dxilinx.com@ozlabs.org
[mailto:linuxppc-embedded-bounces+john.linn=3Dxilinx.com@ozlabs.org] On
Behalf Of mojtaba
Sent: Tuesday, May 13, 2008 5:37 AM
To: linuxppc-embedded@ozlabs.org
Subject: Linux on Ml410
Dear all,
I am trying to run linux 1.6.25 on ML410 board. When the system boot I
receive this error:
loaded at: 00400000 004CD19C
board data at: 004CB120 004CB19C
relocated to: 00404050 004040CC
zimage at: 00404E3C 004CA0D1
avail ram: 004CE000 10000000
Linux/PPC load: console=3DttyS0,115200 root=3D/dev/xsa2
Uncompressing Linux...inflate returned FFFFFFFD
exit
I will appreciate it if somebody can kindly answer me?
Regards,
Mojtaba
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* Re: how to check for "optional" ppc chip features (MSR_BE)
From: Paul Mackerras @ 2008-05-13 11:55 UTC (permalink / raw)
To: Roland McGrath; +Cc: linuxppc-dev
In-Reply-To: <20080504231207.8377E26FA08@magilla.localdomain>
Roland McGrath writes:
> Yeah, all that stuff I could figure out as needed. What I really meant
> was, where is the big official table of which chips behave which ways that
> you base all code that on? Actually, I don't really care as long as you
> all are happy to be responsible for figuring out what matters. With the
> patch I posted to use MSR_BE, I took Kumar Gala's word as gospel that all
> the chips on which we use MSR_SE also have MSR_BE. If that's not right,
> then I hope you'd like to pick a feature bit, populate the tables, etc.,
> and fix the definition of arch_has_block_step() as appropriate.
It turns out that the 601 doesn't support MSR_BE. It looks like all
the "classic" 32-bit implementations after that (603, 604, 7xx, 7xxx)
implemented BE, as do POWER3 and RS64. I'll check the later 64-bit
processors -- I think they all implement BE. 4xx and Book E have it
in a different form. I'll let Kumar find out about 8xx and 82xx.
So it looks like we need to define a new feature bit to mean "supports
block-step". Is this something that userspace will expect to be told
about via the AT_HWCAP entry in the aux vector?
Paul.
^ permalink raw reply
* Re: [PATCH 2/2] Fix irq_alloc_host() reference counting and callers
From: Michael Ellerman @ 2008-05-13 11:49 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18473.29766.501740.124434@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]
On Tue, 2008-05-13 at 20:58 +1000, Paul Mackerras wrote:
> Michael Ellerman writes:
>
> > When I changed irq_alloc_host() to take an of_node
> > (52964f87c64e6c6ea671b5bf3030fb1494090a48: "Add an
> > optional device_node pointer to the irq_host"),
> > I botched the reference counting semantics.
> >
> > Stephen pointed out that it's irq_alloc_host()'s
> > business if it needs to take an additional reference
> > to the device_node, the caller shouldn't need to care.
> > To make that clean we also need a free routine, so
> > the caller doesn't have to deal with dropping the
> > reference.
> >
> > Luckily we now have an irq_free_host() where we can
> > drop the reference - so we can make the reference
> > counting internal to irq_alloc_host()/irq_free_host().
>
> Is this needed for 2.6.26?
No.
> What's the worst possible effect of this bug?
Only nodes having an incorrect reference count - in either direction.
But pseries is fine, so there should be no real bug.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Linux on Ml410
From: mojtaba @ 2008-05-13 11:36 UTC (permalink / raw)
To: linuxppc-embedded
Dear all,
I am trying to run linux 1.6.25 on ML410 board. When the system boot I
receive this error:
loaded at: 00400000 004CD19C
board data at: 004CB120 004CB19C
relocated to: 00404050 004040CC
zimage at: 00404E3C 004CA0D1
avail ram: 004CE000 10000000
Linux/PPC load: console=ttyS0,115200 root=/dev/xsa2
Uncompressing Linux...inflate returned FFFFFFFD
exit
I will appreciate it if somebody can kindly answer me?
Regards,
Mojtaba
^ permalink raw reply
* Re: [PATCH 2/2] Fix irq_alloc_host() reference counting and callers
From: Paul Mackerras @ 2008-05-13 10:58 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <dabdb53ffc73aa86b0432118bf07f2fc9ce72f6f.1210220561.git.michael@ellerman.id.au>
Michael Ellerman writes:
> When I changed irq_alloc_host() to take an of_node
> (52964f87c64e6c6ea671b5bf3030fb1494090a48: "Add an
> optional device_node pointer to the irq_host"),
> I botched the reference counting semantics.
>
> Stephen pointed out that it's irq_alloc_host()'s
> business if it needs to take an additional reference
> to the device_node, the caller shouldn't need to care.
> To make that clean we also need a free routine, so
> the caller doesn't have to deal with dropping the
> reference.
>
> Luckily we now have an irq_free_host() where we can
> drop the reference - so we can make the reference
> counting internal to irq_alloc_host()/irq_free_host().
Is this needed for 2.6.26? What's the worst possible effect of this
bug?
Paul.
^ permalink raw reply
* RE: mmap problem in device driver and application program.
From: MingLiu @ 2008-05-13 9:11 UTC (permalink / raw)
To: Dave Cogley, linuxppc-embedded
In-Reply-To: <1210366552.3755.21.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 761 bytes --]
Dear Dave,
> If you are using memory that is not under the kernel's memory management> you will need to use something other than remap_pfn_range.>
Happenly and unfortunately we are using the memory space out of the control from the kernel. We have 2GB memory on the board and only 64(or 32) MB is reserved for the kernel. The rest large space is for the data buffering or LUT use. In my question, the LUT memory is located in the rest part rather than the kernel memory area.
Any more suggestion on how to mmap this LUT area? Any idea will be valuable for a beginner like me. Thanks in advance.
BR
Ming
_________________________________________________________________
新年换新颜,快来妆扮自己的MSN给心仪的TA一个惊喜!
http://im.live.cn/emoticons/?ID=18
[-- Attachment #2: Type: text/html, Size: 942 bytes --]
^ permalink raw reply
* [PATCH] spufs: fix compile error
From: FUJITA Tomonori @ 2008-05-13 9:07 UTC (permalink / raw)
To: linuxppc-dev; +Cc: FUJITA Tomonori, paulus, jk
With CONFIG_VIRT_CPU_ACCOUNTING disabled, I got the following error:
linux-2.6/arch/powerpc/platforms/cell/spufs/file.c: In function 'spu_switch_log_notify':
linux-2.6/arch/powerpc/platforms/cell/spufs/file.c:2542: error: implicit declaration of function 'get_tb'
make[4]: *** [arch/powerpc/platforms/cell/spufs/file.o] Error 1
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
arch/powerpc/platforms/cell/spufs/file.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 80911a3..c81341f 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -32,6 +32,7 @@
#include <linux/marker.h>
#include <asm/io.h>
+#include <asm/time.h>
#include <asm/spu.h>
#include <asm/spu_info.h>
#include <asm/uaccess.h>
--
1.5.4.2
^ permalink raw reply related
* Re: [PATCH 1/3] [2.6.26] memory: Introduce exports for memory notifiers
From: Jeff Garzik @ 2008-05-13 5:16 UTC (permalink / raw)
To: Hannes Hering
Cc: tklein, themann, netdev, linux-kernel, raisch, ossrosch,
linuxppc-dev, ossthema
In-Reply-To: <200805071443.02145.hannes.hering@linux.vnet.ibm.com>
Hannes Hering wrote:
> This patch introduces two exports to allow modules to use memory notifiers.
>
> Signed-off-by: Hannes Hering <hering2@de.ibm.com>
> ---
>
> diff --git a/drivers/base/memory.c b/drivers/base/memory.c
> index 8ce6de5..937e825 100644
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -53,11 +53,13 @@ int register_memory_notifier(struct notifier_block *nb)
> {
> return blocking_notifier_chain_register(&memory_chain, nb);
> }
> +EXPORT_SYMBOL(register_memory_notifier);
>
> void unregister_memory_notifier(struct notifier_block *nb)
> {
> blocking_notifier_chain_unregister(&memory_chain, nb);
> }
> +EXPORT_SYMBOL(unregister_memory_notifier);
applied 1-3
^ permalink raw reply
* Glenn Turnock Out-Of-Office May 13 through May 26
From: gturnock @ 2008-05-13 2:01 UTC (permalink / raw)
To: linuxppc-embedded
I will be out of the office starting Mon 05/12/2008 and will not return
until Mon 05/26/2008.
For VIIC Related issues, please contact Alastair Malarky at
amalarky@ivhs.com
Thanks and Best Regards
Glenn Turnock
^ permalink raw reply
* RE: [PATCH 1/4 V2] booting-without-of for Freescale MSI
From: Jin Zhengxiong @ 2008-05-13 2:31 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40805090625m1f127898j19e3f2436ef0fbc6@mail.gmail.com>
=20
> -----Original Message-----
> From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On=20
> Behalf Of Grant Likely
> Sent: Friday, May 09, 2008 9:25 PM
> To: Jin Zhengxiong
> Cc: galak@kernel.crashing.org; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH 1/4 V2] booting-without-of for Freescale MSI
>=20
> On Fri, May 9, 2008 at 3:03 AM, Jason Jin=20
> <Jason.jin@freescale.com> wrote:
> > Binding document adding for Freescale MSI support.
> >
> > Signed-off-by: Jason Jin <Jason.jin@freescale.com>
> > ---
> > Updated to V2 version per Segher's suggestion.
> >
> > Documentation/powerpc/booting-without-of.txt | 40=20
> +++++++++++++++++++++++++-
> > 1 files changed, 39 insertions(+), 1 deletions(-)
> >
> > diff --git a/Documentation/powerpc/booting-without-of.txt=20
> > b/Documentation/powerpc/booting-without-of.txt
> > index 1d2a772..887783c 100644
> > --- a/Documentation/powerpc/booting-without-of.txt
> > +++ b/Documentation/powerpc/booting-without-of.txt
> > @@ -57,7 +57,10 @@ Table of Contents
> > n) 4xx/Axon EMAC ethernet nodes
> > o) Xilinx IP cores
> > p) Freescale Synchronous Serial Interface
> > - q) USB EHCI controllers
> > + q) USB EHCI controllers
> > + r) Freescale Display Interface Unit
> > + s) Freescale on board FPGA
> > + t) Freescael MSI interrupt controller
> >
> > VII - Marvell Discovery mv64[345]6x System Controller chips
> > 1) The /system-controller node
> > @@ -2870,6 +2873,41 @@ platforms are moved over to use the=20
> flattened-device-tree model.
> > reg =3D <0xe8000000 32>;
> > };
> >
> > + t) Freescale MSI interrupt controller
> > +
> > + Reguired properities:
> > + - compatible : set as "fsl,86xx-MSI" for 86xx cpu,=20
> "fsl,85xx-MSI" for 85xx
> > + cpu and "fsl,83xx-MSI" for 83xx cpu.
>=20
> As Segher mentioned; don't use 'generic' compatible values. =20
> Use names of *actual* devices and have newer parts claim=20
> compatibility with older ones.
The *actual* devices that can use this MSI driver, is *all* the=20
boards that use "86xx/85xx/83xx" cpu. This compatible note actually
was used to distinguish different msiir offset for the boards use=20
MPIC and IPIC.=20
If "MPIC-MSI" or "85xx-MSI" is 'generic'. Do we need to describe it=20
as "fsl,mpc8572ds-msi" and make all the boards who use MPIC compatible
to "fsl,mpc8572ds-msi", Or each of the boards have their own compatible
name=20
and each time we add a board to support MSI, add an item to the
of_device_id table?
Please suggest, Thanks=20
Jason
^ permalink raw reply
* RE: [PATCH 2/4 V4] MSI support on 83xx/85xx/86xx board
From: Jin Zhengxiong @ 2008-05-13 2:18 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev
In-Reply-To: <1210335719.11689.5.camel@localhost>
>=20
> ...
>=20
> > +static int fsl_msi_host_match(struct irq_host *h, struct=20
> device_node=20
> > +*node) {
> > + /* Exact match*/
> > + return h->of_node =3D=3D node;
> > +}
>=20
> This is the default behaviour, so technically you don't need=20
> this routine - but I'm not fussed.
You are right, I noticed there is the default match function in=20
current kernel. I can try to remove this in my driver. Thanks.
> Acked-by: Michael Ellerman <michael@ellerman.id.au>
Thanks
Jason
^ permalink raw reply
* [rfc patch] memory_hotplug: Check for walk_memory_resource() failure in online_pages()
From: Geoff Levand @ 2008-05-13 1:13 UTC (permalink / raw)
To: akpm; +Cc: Yasunori Goto, mikpe, Badari Pulavarty, linux-kernel,
linuxppc-dev
In-Reply-To: <20080512.174151.193690130.davem@davemloft.net>
Add a check to online_pages() to test for failure of
walk_memory_resource(). This fixes a condition where a failure
of walk_memory_resource() can lead to online_pages() returning
success without the requested pages being onlined.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
I'm not entirely sure this is the proper way to handle this
condition. Comments welcome.
mm/memory_hotplug.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -408,8 +408,15 @@ int online_pages(unsigned long pfn, unsi
if (!populated_zone(zone))
need_zonelists_rebuild = 1;
- walk_memory_resource(pfn, nr_pages, &onlined_pages,
+ ret = walk_memory_resource(pfn, nr_pages, &onlined_pages,
online_pages_range);
+ if (ret) {
+ printk(KERN_DEBUG "online_pages %lx at %lx failed\n",
+ nr_pages, pfn);
+ memory_notify(MEM_CANCEL_ONLINE, &arg);
+ return ret;
+ }
+
zone->present_pages += onlined_pages;
zone->zone_pgdat->node_present_pages += onlined_pages;
^ permalink raw reply
* Re: [PATCH 1/3] [WATCHDOG] mpc83xx_wdt: add support for MPC86xx CPUs
From: Kumar Gala @ 2008-05-13 1:06 UTC (permalink / raw)
To: cbouatmailru; +Cc: Scott Wood, linuxppc-dev, Wim Van Sebroeck, Timur Tabi
In-Reply-To: <20080512221243.GA1536@zarina>
On May 12, 2008, at 5:12 PM, Anton Vorontsov wrote:
> On Mon, May 12, 2008 at 04:55:16PM -0500, Timur Tabi wrote:
>> Anton Vorontsov wrote:
>>
>>> I don't know the IP block name... what is it for the 83xx/86xx
>>> watchdogs?
>>
>> My point was that we developers should just pick a name and run
>> with it.
>> That's where the name "Elo" came from. None of official Freescale
>> documentation calls the DMA controller on 85xx parts "Elo", but the
>> kernel code does.
>
> Ahh, I see. Ok, my purpose: name the driver for mpc83xx-like watchdogs
> as mpc83xx_wdt.c? :-)
>
> It's less confusion. For example DMA. I really don't know what the
> "Elo" is. Nobody does actually, except the few people who discussed
> Linux Freescale DMA drivers...
I repeat, name it mpc8xxx_wdt.c or fsl_ppc_soc_wdt.c.
- k
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).