* Re: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver
From: Dmitry Torokhov @ 2008-07-09 18:13 UTC (permalink / raw)
To: John Linn; +Cc: linuxppc-dev, Sadanand Mutyala, linux-input
In-Reply-To: <20080709161408.55E0F4A006C@mail60-va3.bigfish.com>
On Wed, Jul 9, 2008 at 12:14 PM, John Linn <John.Linn@xilinx.com> wrote:
> These look like good comments from Peter.
>
> Dmitry, how would you like to do this, would you prefer us to do an
> incremental patch from the existing patch (V3)? Or a new V4 for the
> patch?
>
Incremental please. I already committed V3 to the 'next' branch and I
don't want to rebuild it unless the patch is completely broken so
incremental cleanup is the way to go.
Thanks.
--
Dmitry
^ permalink raw reply
* [PATCH] PowerPC 44x: Adjust warp-nand resource end address
From: Valentine Barshak @ 2008-07-09 18:02 UTC (permalink / raw)
To: linuxppc-dev; +Cc: sr, smaclennan
Adjust the NDFC resource end value (resource size = end - start + 1).
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
---
arch/powerpc/platforms/44x/warp-nand.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/platforms/44x/warp-nand.c 2008-07-01 20:39:07.000000000 +0400
+++ b/arch/powerpc/platforms/44x/warp-nand.c 2008-07-09 20:22:31.000000000 +0400
@@ -24,7 +24,7 @@
static struct resource warp_ndfc = {
.start = WARP_NAND_FLASH_REG_ADDR,
- .end = WARP_NAND_FLASH_REG_ADDR + WARP_NAND_FLASH_REG_SIZE,
+ .end = WARP_NAND_FLASH_REG_ADDR + WARP_NAND_FLASH_REG_SIZE - 1,
.flags = IORESOURCE_MEM,
};
^ permalink raw reply
* Re: Updates to powerpc.git
From: Grant Likely @ 2008-07-09 17:30 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev list, Andrew Morton
In-Reply-To: <20080710032346.62545256.sfr@canb.auug.org.au>
On Thu, Jul 10, 2008 at 03:23:46AM +1000, Stephen Rothwell wrote:
> Hi Grant,
>
> On Wed, 9 Jul 2008 10:20:08 -0600 Grant Likely <grant.likely@secretlab.ca> wrote:
> >
> > I was under the impression that there was some consensus that -next
> > branches should be used for unstable experiments. Am I mistaken?
>
> Completely. Anything that will end up in linux-next must be posted,
> reviewed, unit tested and intended for the next merge window. i.e. you
> must have basically finished with it (except for inter-subsystem merge
> problems and bugs, or course).
Okay, thanks for the correction.
Cheers,
g.
^ permalink raw reply
* Re: Updates to powerpc.git
From: Stephen Rothwell @ 2008-07-09 17:25 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev list, Andrew Morton
In-Reply-To: <4BD688FB-13AF-4076-BF9A-1F7BEA7E7D65@kernel.crashing.org>
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
Hi Kumar,
On Wed, 9 Jul 2008 11:47:45 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> Did, GregKH start up a tree for code not quite ready ( -staging).
Greg's staging tree is for whole drivers etc not in the kernel yet that
need work to get there.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: Updates to powerpc.git
From: Josh Boyer @ 2008-07-09 17:21 UTC (permalink / raw)
To: Kumar Gala; +Cc: Stephen Rothwell, Andrew Morton, linuxppc-dev list
In-Reply-To: <4BD688FB-13AF-4076-BF9A-1F7BEA7E7D65@kernel.crashing.org>
On Wed, 9 Jul 2008 11:47:45 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Jul 9, 2008, at 11:31 AM, Josh Boyer wrote:
>
> > On Wed, 2008-07-09 at 10:20 -0600, Grant Likely wrote:
> >> On Thu, Jul 10, 2008 at 02:08:32AM +1000, Stephen Rothwell wrote:
> >>> Kumar,
> >>>
> >>> On Wed, 9 Jul 2008 07:58:38 -0500 Kumar Gala <galak@kernel.crashing.org
> >>> > wrote:
> >>>>
> >>>> What is your intent with the 'master' branch? I hope you do NOT
> >>>> plan
> >>>> on ever rebasing it. I assume if a patch gets into master and we
> >>>> drop
> >>>> it you'll do a git-revert of it?
> >>>
> >>> "Ever" is such a strong word. Even Paul on occasion rebased his
> >>> master
> >>> branch. I see no reason why Ben could not run his master (or maybe
> >>> better named "test") branch as a place that patches come and go
> >>> and his
> >>> "next" branch as something that never (or very rarely) gets
> >>> rebased with
> >>> commits progressing from master (test) to next when he is
> >>> satisfied with
> >>> them. People should then base further work in the "next" branch.
> >>
> >> I was under the impression that there was some consensus that -next
> >> branches should be used for unstable experiments. Am I mistaken?
> >
> > Yes, you are. It's slightly confusing. -next branches are for
> > things
> > decidedly going into the "next" release of the kernel. If they are
> > unstable, they aren't really proven to be ready then.
>
> Did, GregKH start up a tree for code not quite ready ( -staging).
Yes. The proliferation of "trees" is getting to be a bit ridiculous.
We have Linus, -next, -mm, -staging, plus all the subsystem variants of
those.
The answer to "What tree do I develop against" _should_ be -next, but
sometimes that isn't the case and finding the answer isn't getting
easier.
josh
^ permalink raw reply
* Re: Updates to powerpc.git
From: Stephen Rothwell @ 2008-07-09 17:23 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev list, Andrew Morton
In-Reply-To: <20080709162008.GC28130@secretlab.ca>
[-- Attachment #1: Type: text/plain, Size: 597 bytes --]
Hi Grant,
On Wed, 9 Jul 2008 10:20:08 -0600 Grant Likely <grant.likely@secretlab.ca> wrote:
>
> I was under the impression that there was some consensus that -next
> branches should be used for unstable experiments. Am I mistaken?
Completely. Anything that will end up in linux-next must be posted,
reviewed, unit tested and intended for the next merge window. i.e. you
must have basically finished with it (except for inter-subsystem merge
problems and bugs, or course).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] Convert i2c-mpc from a platform driver into a of_platform driver, V4
From: Grant Likely @ 2008-07-09 17:22 UTC (permalink / raw)
To: Jon Smirl, Timur Tabi; +Cc: Linuxppc-dev, i2c
In-Reply-To: <20080630230126.12482.87927.stgit@terra>
On Mon, Jun 30, 2008 at 5:01 PM, Jon Smirl <jonsmirl@gmail.com> wrote:
> Convert i2c-mpc to an of_platform driver. Utilize the code in drivers/of-i2c.c to make i2c modules dynamically loadable by the device tree.
Timur, can you please test this one on an 83xx platform? It works on
5200, but I want to make sure 83xx doesn't break before I pick it up.
Thanks,
g.
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---
>
> arch/powerpc/sysdev/fsl_soc.c | 122 -----------------------------------------
> drivers/i2c/busses/i2c-mpc.c | 104 ++++++++++++++++++++---------------
> 2 files changed, 60 insertions(+), 166 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
> index 3a7054e..ebcec73 100644
> --- a/arch/powerpc/sysdev/fsl_soc.c
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -414,128 +414,6 @@ err:
>
> arch_initcall(gfar_of_init);
>
> -#ifdef CONFIG_I2C_BOARDINFO
> -#include <linux/i2c.h>
> -struct i2c_driver_device {
> - char *of_device;
> - char *i2c_type;
> -};
> -
> -static struct i2c_driver_device i2c_devices[] __initdata = {
> - {"ricoh,rs5c372a", "rs5c372a"},
> - {"ricoh,rs5c372b", "rs5c372b"},
> - {"ricoh,rv5c386", "rv5c386"},
> - {"ricoh,rv5c387a", "rv5c387a"},
> - {"dallas,ds1307", "ds1307"},
> - {"dallas,ds1337", "ds1337"},
> - {"dallas,ds1338", "ds1338"},
> - {"dallas,ds1339", "ds1339"},
> - {"dallas,ds1340", "ds1340"},
> - {"stm,m41t00", "m41t00"},
> - {"dallas,ds1374", "rtc-ds1374"},
> -};
> -
> -static int __init of_find_i2c_driver(struct device_node *node,
> - struct i2c_board_info *info)
> -{
> - int i;
> -
> - for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
> - if (!of_device_is_compatible(node, i2c_devices[i].of_device))
> - continue;
> - if (strlcpy(info->type, i2c_devices[i].i2c_type,
> - I2C_NAME_SIZE) >= I2C_NAME_SIZE)
> - return -ENOMEM;
> - return 0;
> - }
> - return -ENODEV;
> -}
> -
> -static void __init of_register_i2c_devices(struct device_node *adap_node,
> - int bus_num)
> -{
> - struct device_node *node = NULL;
> -
> - while ((node = of_get_next_child(adap_node, node))) {
> - struct i2c_board_info info = {};
> - const u32 *addr;
> - int len;
> -
> - addr = of_get_property(node, "reg", &len);
> - if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
> - printk(KERN_WARNING "fsl_soc.c: invalid i2c device entry\n");
> - continue;
> - }
> -
> - info.irq = irq_of_parse_and_map(node, 0);
> - if (info.irq == NO_IRQ)
> - info.irq = -1;
> -
> - if (of_find_i2c_driver(node, &info) < 0)
> - continue;
> -
> - info.addr = *addr;
> -
> - i2c_register_board_info(bus_num, &info, 1);
> - }
> -}
> -
> -static int __init fsl_i2c_of_init(void)
> -{
> - struct device_node *np;
> - unsigned int i = 0;
> - struct platform_device *i2c_dev;
> - int ret;
> -
> - for_each_compatible_node(np, NULL, "fsl-i2c") {
> - struct resource r[2];
> - struct fsl_i2c_platform_data i2c_data;
> - const unsigned char *flags = NULL;
> -
> - memset(&r, 0, sizeof(r));
> - memset(&i2c_data, 0, sizeof(i2c_data));
> -
> - ret = of_address_to_resource(np, 0, &r[0]);
> - if (ret)
> - goto err;
> -
> - of_irq_to_resource(np, 0, &r[1]);
> -
> - i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2);
> - if (IS_ERR(i2c_dev)) {
> - ret = PTR_ERR(i2c_dev);
> - goto err;
> - }
> -
> - i2c_data.device_flags = 0;
> - flags = of_get_property(np, "dfsrr", NULL);
> - if (flags)
> - i2c_data.device_flags |= FSL_I2C_DEV_SEPARATE_DFSRR;
> -
> - flags = of_get_property(np, "fsl5200-clocking", NULL);
> - if (flags)
> - i2c_data.device_flags |= FSL_I2C_DEV_CLOCK_5200;
> -
> - ret =
> - platform_device_add_data(i2c_dev, &i2c_data,
> - sizeof(struct
> - fsl_i2c_platform_data));
> - if (ret)
> - goto unreg;
> -
> - of_register_i2c_devices(np, i++);
> - }
> -
> - return 0;
> -
> -unreg:
> - platform_device_unregister(i2c_dev);
> -err:
> - return ret;
> -}
> -
> -arch_initcall(fsl_i2c_of_init);
> -#endif
>
> #ifdef CONFIG_PPC_83xx
> static int __init mpc83xx_wdt_init(void)
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index a076129..4fdfb62 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -17,7 +17,8 @@
> #include <linux/module.h>
> #include <linux/sched.h>
> #include <linux/init.h>
> -#include <linux/platform_device.h>
> +#include <linux/of_platform.h>
> +#include <linux/of_i2c.h>
>
> #include <asm/io.h>
> #include <linux/fsl_devices.h>
> @@ -25,13 +26,13 @@
> #include <linux/interrupt.h>
> #include <linux/delay.h>
>
> -#define MPC_I2C_ADDR 0x00
> +#define DRV_NAME "mpc-i2c"
> +
> #define MPC_I2C_FDR 0x04
> #define MPC_I2C_CR 0x08
> #define MPC_I2C_SR 0x0c
> #define MPC_I2C_DR 0x10
> #define MPC_I2C_DFSRR 0x14
> -#define MPC_I2C_REGION 0x20
>
> #define CCR_MEN 0x80
> #define CCR_MIEN 0x40
> @@ -315,102 +316,117 @@ static struct i2c_adapter mpc_ops = {
> .timeout = 1,
> };
>
> -static int fsl_i2c_probe(struct platform_device *pdev)
> +static int __devinit fsl_i2c_probe(struct of_device *op, const struct of_device_id *match)
> {
> int result = 0;
> struct mpc_i2c *i2c;
> - struct fsl_i2c_platform_data *pdata;
> - struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> - pdata = (struct fsl_i2c_platform_data *) pdev->dev.platform_data;
>
> i2c = kzalloc(sizeof(*i2c), GFP_KERNEL);
> if (!i2c)
> return -ENOMEM;
>
> - i2c->irq = platform_get_irq(pdev, 0);
> - if (i2c->irq < 0)
> - i2c->irq = NO_IRQ; /* Use polling */
> + if (of_get_property(op->node, "dfsrr", NULL))
> + i2c->flags |= FSL_I2C_DEV_SEPARATE_DFSRR;
>
> - i2c->flags = pdata->device_flags;
> - init_waitqueue_head(&i2c->queue);
> + if (of_device_is_compatible(op->node, "fsl,mpc5200-i2c") ||
> + of_device_is_compatible(op->node, "mpc5200-i2c"))
> + i2c->flags |= FSL_I2C_DEV_CLOCK_5200;
>
> - i2c->base = ioremap((phys_addr_t)r->start, MPC_I2C_REGION);
> + init_waitqueue_head(&i2c->queue);
>
> + i2c->base = of_iomap(op->node, 0);
> if (!i2c->base) {
> printk(KERN_ERR "i2c-mpc - failed to map controller\n");
> result = -ENOMEM;
> goto fail_map;
> }
>
> - if (i2c->irq != NO_IRQ)
> - if ((result = request_irq(i2c->irq, mpc_i2c_isr,
> - IRQF_SHARED, "i2c-mpc", i2c)) < 0) {
> - printk(KERN_ERR
> - "i2c-mpc - failed to attach interrupt\n");
> - goto fail_irq;
> + i2c->irq = irq_of_parse_and_map(op->node, 0);
> + if (i2c->irq != NO_IRQ) { /* i2c->irq = NO_IRQ implies polling */
> + result = request_irq(i2c->irq, mpc_i2c_isr,
> + IRQF_SHARED, "i2c-mpc", i2c);
> + if (result < 0) {
> + printk(KERN_ERR "i2c-mpc - failed to attach interrupt\n");
> + goto fail_request;
> }
> -
> + }
> +
> mpc_i2c_setclock(i2c);
> - platform_set_drvdata(pdev, i2c);
> +
> + dev_set_drvdata(&op->dev, i2c);
>
> i2c->adap = mpc_ops;
> - i2c->adap.nr = pdev->id;
> i2c_set_adapdata(&i2c->adap, i2c);
> - i2c->adap.dev.parent = &pdev->dev;
> - if ((result = i2c_add_numbered_adapter(&i2c->adap)) < 0) {
> + i2c->adap.dev.parent = &op->dev;
> +
> + result = i2c_add_adapter(&i2c->adap);
> + if (result < 0) {
> printk(KERN_ERR "i2c-mpc - failed to add adapter\n");
> goto fail_add;
> }
> + of_register_i2c_devices(&i2c->adap, op->node);
>
> return result;
>
> - fail_add:
> - if (i2c->irq != NO_IRQ)
> - free_irq(i2c->irq, i2c);
> - fail_irq:
> - iounmap(i2c->base);
> - fail_map:
> + fail_add:
> + dev_set_drvdata(&op->dev, NULL);
> + free_irq(i2c->irq, i2c);
> + fail_request:
> + irq_dispose_mapping(i2c->irq);
> + iounmap(i2c->base);
> + fail_map:
> kfree(i2c);
> return result;
> };
>
> -static int fsl_i2c_remove(struct platform_device *pdev)
> +static int __devexit fsl_i2c_remove(struct of_device *op)
> {
> - struct mpc_i2c *i2c = platform_get_drvdata(pdev);
> + struct mpc_i2c *i2c = dev_get_drvdata(&op->dev);
>
> i2c_del_adapter(&i2c->adap);
> - platform_set_drvdata(pdev, NULL);
> + dev_set_drvdata(&op->dev, NULL);
>
> if (i2c->irq != NO_IRQ)
> free_irq(i2c->irq, i2c);
>
> + irq_dispose_mapping(i2c->irq);
> iounmap(i2c->base);
> kfree(i2c);
> return 0;
> };
>
> -/* work with hotplug and coldplug */
> -MODULE_ALIAS("platform:fsl-i2c");
> +static const struct of_device_id mpc_i2c_of_match[] = {
> + {.compatible = "fsl-i2c",},
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
> +
>
> /* Structure for a device driver */
> -static struct platform_driver fsl_i2c_driver = {
> - .probe = fsl_i2c_probe,
> - .remove = fsl_i2c_remove,
> - .driver = {
> - .owner = THIS_MODULE,
> - .name = "fsl-i2c",
> +static struct of_platform_driver mpc_i2c_driver = {
> + .match_table = mpc_i2c_of_match,
> + .probe = fsl_i2c_probe,
> + .remove = __devexit_p(fsl_i2c_remove),
> + .driver = {
> + .owner = THIS_MODULE,
> + .name = DRV_NAME,
> },
> };
>
> static int __init fsl_i2c_init(void)
> {
> - return platform_driver_register(&fsl_i2c_driver);
> + int rv;
> +
> + rv = of_register_platform_driver(&mpc_i2c_driver);
> + if (rv)
> + printk(KERN_ERR DRV_NAME
> + " of_register_platform_driver failed (%i)\n", rv);
> + return rv;
> }
>
> static void __exit fsl_i2c_exit(void)
> {
> - platform_driver_unregister(&fsl_i2c_driver);
> + of_unregister_platform_driver(&mpc_i2c_driver);
> }
>
> module_init(fsl_i2c_init);
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: merge from arch/ppc to arch/powerpc on lite5200
From: Grant Likely @ 2008-07-09 17:17 UTC (permalink / raw)
To: mejjad lahcen; +Cc: linuxppc-embedded
In-Reply-To: <9b4863980807090742n3c7f7f0bl91ebe85b8d1fe00c@mail.gmail.com>
On Wed, Jul 09, 2008 at 10:42:09AM -0400, mejjad lahcen wrote:
> Hi all of you,
> I am working to port linux2.6.26 on board based on lite5200, but the kernel
> hangs here ( see output)
This is not a ramdisk problem. It looks like the kernel is starting but
the console is not setup correctly. To help, I need more information:
- What command in u-boot are you using to boot the board
- How are you building your kernel image?
- Can you post the .dts file for your board?
> Memory <- <0x0 0x4000000> (64MB)
> CPU clock-frequency <- 0x1687d280 (378MHz)
> CPU timebase-frequency <- 0x1406f40 (21MHz)
> CPU bus-frequency <- 0x501bd00 (84MHz)
These look odd. What frequencies does U-Boot report when it comes out
of reset?
Cheers,
g.
^ permalink raw reply
* Re: Please pull from 'powerpc-next' branch
From: Stephen Rothwell @ 2008-07-09 17:13 UTC (permalink / raw)
To: Kumar Gala; +Cc: Paul Mackerras, linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0807090812110.6382@blarg.am.freescale.net>
[-- Attachment #1: Type: text/plain, Size: 879 bytes --]
Hi Kumar,
On Wed, 9 Jul 2008 08:13:03 -0500 (CDT) Kumar Gala <galak@kernel.crashing.org> wrote:
>
> Please pull from 'powerpc-next' branch of
>
> master.kernel.org:/pub/scm/linux/kernel/git/galak/dts.git powerpc-next
$ git ls-remote ssh://master.kernel.org/pub/scm/linux/kernel/git/galak/dts.git
fatal: '/pub/scm/linux/kernel/git/galak/dts.git': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
Did you mean ".../powerpc.git"?
Also, the master branch of that tree has the same problem I came up
against in linux-next today: include/asm-powerpc/pgtable-ppc64.h
mismerges between Linus' tree and the Paul's tree so you end up with two
copies of huge_ptep_set_wrprotect. So you should amend the merge to
remove one.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: Updates to powerpc.git
From: Kumar Gala @ 2008-07-09 16:47 UTC (permalink / raw)
To: jwboyer; +Cc: Stephen Rothwell, Andrew Morton, linuxppc-dev list
In-Reply-To: <1215621093.32502.1.camel@weaponx>
On Jul 9, 2008, at 11:31 AM, Josh Boyer wrote:
> On Wed, 2008-07-09 at 10:20 -0600, Grant Likely wrote:
>> On Thu, Jul 10, 2008 at 02:08:32AM +1000, Stephen Rothwell wrote:
>>> Kumar,
>>>
>>> On Wed, 9 Jul 2008 07:58:38 -0500 Kumar Gala <galak@kernel.crashing.org
>>> > wrote:
>>>>
>>>> What is your intent with the 'master' branch? I hope you do NOT
>>>> plan
>>>> on ever rebasing it. I assume if a patch gets into master and we
>>>> drop
>>>> it you'll do a git-revert of it?
>>>
>>> "Ever" is such a strong word. Even Paul on occasion rebased his
>>> master
>>> branch. I see no reason why Ben could not run his master (or maybe
>>> better named "test") branch as a place that patches come and go
>>> and his
>>> "next" branch as something that never (or very rarely) gets
>>> rebased with
>>> commits progressing from master (test) to next when he is
>>> satisfied with
>>> them. People should then base further work in the "next" branch.
>>
>> I was under the impression that there was some consensus that -next
>> branches should be used for unstable experiments. Am I mistaken?
>
> Yes, you are. It's slightly confusing. -next branches are for
> things
> decidedly going into the "next" release of the kernel. If they are
> unstable, they aren't really proven to be ready then.
Did, GregKH start up a tree for code not quite ready ( -staging).
I think master and -next should not be rebased (if it can be
avoided). and -staging can be.
- k
^ permalink raw reply
* Re: Please pull linux-2.6-virtex.git
From: Grant Likely @ 2008-07-09 16:49 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40807090857x2d2a3086xe2c1bd81fb23bb@mail.gmail.com>
Oops, missed a fix for the virtex440-ml507.dts file. Here's a new pull request
The following changes since commit f3e909c2750eb20536bacacc867dc9047b70546a:
Michael Neuling (1):
powerpc: Update for VSX core file and ptrace
are available in the git repository at:
git://git.secretlab.ca/git/linux-2.6-virtex virtex-for-2.6.27
Grant Likely (5):
powerpc/bootwrapper: Add documentation of boot wrapper targets
powerpc/bootwrapper: add missing bit of simpleImage target
powerpc/bootwrapper: Allow user to specify additional default targets
powerpc/440: Convert Virtex ML507 device tree to dts-v1
powerpc/440: frequency property should be a cell, not a string
John Linn (5):
powerpc/virtex: add dts file for ML507 reference design
powerpc/virtex: Fix booting of Xilinx FPGAs with 16550 for 405 and 440
powerpc/virtex: add Xilinx Virtex 5 ppc440 platform support
powerpc/virtex: add Xilinx 440 cpu to the cputable
powerpc/virtex: add defconfig for virtex 5 platforms
Documentation/powerpc/bootwrapper.txt | 141 ++++
arch/powerpc/Kconfig | 13 +
arch/powerpc/Makefile | 15 +-
arch/powerpc/boot/Makefile | 5 +-
arch/powerpc/boot/dts/virtex440-ml507.dts | 296 ++++++++
arch/powerpc/boot/simpleboot.c | 6 +
arch/powerpc/boot/virtex.c | 100 +++
arch/powerpc/boot/wrapper | 10 +-
arch/powerpc/configs/44x/virtex5_defconfig | 1107 ++++++++++++++++++++++++++++
arch/powerpc/kernel/cputable.c | 10 +
arch/powerpc/platforms/44x/Kconfig | 26 +
arch/powerpc/platforms/44x/Makefile | 1 +
arch/powerpc/platforms/44x/virtex.c | 60 ++
13 files changed, 1787 insertions(+), 3 deletions(-)
create mode 100644 Documentation/powerpc/bootwrapper.txt
create mode 100644 arch/powerpc/boot/dts/virtex440-ml507.dts
create mode 100644 arch/powerpc/boot/virtex.c
create mode 100644 arch/powerpc/configs/44x/virtex5_defconfig
create mode 100644 arch/powerpc/platforms/44x/virtex.c
On Wed, Jul 9, 2008 at 9:57 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> Hey Josh, here is the new pull request:
>
> The following changes since commit f3e909c2750eb20536bacacc867dc9047b70546a:
> Michael Neuling (1):
> powerpc: Update for VSX core file and ptrace
>
> are available in the git repository at:
>
> git://git.secretlab.ca/git/linux-2.6-virtex virtex-for-2.6.27
>
> Grant Likely (4):
> powerpc/bootwrapper: Add documentation of boot wrapper targets
> powerpc/bootwrapper: add missing bit of simpleImage target
> powerpc/bootwrapper: Allow user to specify additional default targets
> powerpc/440: Convert Virtex ML507 device tree to dts-v1
>
> John Linn (5):
> powerpc/virtex: add dts file for ML507 reference design
> powerpc/virtex: Fix booting of Xilinx FPGAs with 16550 for 405 and 440
> powerpc/virtex: add Xilinx Virtex 5 ppc440 platform support
> powerpc/virtex: add Xilinx 440 cpu to the cputable
> powerpc/virtex: add defconfig for virtex 5 platforms
>
> Documentation/powerpc/bootwrapper.txt | 141 ++++
> arch/powerpc/Kconfig | 13 +
> arch/powerpc/Makefile | 15 +-
> arch/powerpc/boot/Makefile | 5 +-
> arch/powerpc/boot/dts/virtex440-ml507.dts | 296 ++++++++
> arch/powerpc/boot/simpleboot.c | 6 +
> arch/powerpc/boot/virtex.c | 100 +++
> arch/powerpc/boot/wrapper | 10 +-
> arch/powerpc/configs/44x/virtex5_defconfig | 1107 ++++++++++++++++++++++++++++
> arch/powerpc/kernel/cputable.c | 10 +
> arch/powerpc/platforms/44x/Kconfig | 26 +
> arch/powerpc/platforms/44x/Makefile | 1 +
> arch/powerpc/platforms/44x/virtex.c | 60 ++
> 13 files changed, 1787 insertions(+), 3 deletions(-)
> create mode 100644 Documentation/powerpc/bootwrapper.txt
> create mode 100644 arch/powerpc/boot/dts/virtex440-ml507.dts
> create mode 100644 arch/powerpc/boot/virtex.c
> create mode 100644 arch/powerpc/configs/44x/virtex5_defconfig
> create mode 100644 arch/powerpc/platforms/44x/virtex.c
>
>
> On Wed, Jul 9, 2008 at 8:15 AM, Josh Boyer <jwboyer@gmail.com> wrote:
>> On Fri, 2008-07-04 at 11:22 -0600, Grant Likely wrote:
>>> Hi Josh,
>>>
>>> Here are the bulk of the Xilinx 440 support patches. Please pull
>>> into your next branch.
>>>
>>> Thanks,
>>> g.
>>>
>>> The following changes since commit f3e909c2750eb20536bacacc867dc9047b70546a:
>>> Michael Neuling (1):
>>> powerpc: Update for VSX core file and ptrace
>>>
>>> are available in the git repository at:
>>>
>>> git://git.secretlab.ca/git/linux-2.6-virtex virtex-for-2.6.27
>>
>> Any chance to get that updated with the latest fixes before I pull it
>> in? Namely the DTS file for virtex5, but there might have been others.
>>
>> josh
>>
>>
>
>
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH] powerpc: rework 4xx PTE access and TLB miss
From: Josh Boyer @ 2008-07-09 16:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20080709102308.4735d48a@zod.rchland.ibm.com>
On Wed, 9 Jul 2008 10:23:08 -0400
Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:
> On Tue, 08 Jul 2008 15:54:40 +1000
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > This is some preliminary work to improve TLB management on SW loaded
> > TLB powerpc platforms. This introduce support for non-atomic PTE
> > operations in pgtable-ppc32.h and removes write back to the PTE from
> > the TLB miss handlers. In addition, the DSI interrupt code no longer
> > tries to fixup write permission, this is left to generic code, and
> > _PAGE_HWWRITE is gone.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> Boots for me now. So far it's surviving a dbench run, and I'll try
> hackbench/kernbench shortly.
For those interested, here are the results of my stupidly simple
hackbench runs:
Setup:
- AMCC PowerPC Sequoia 440EPx board, 128MiB of DRAM, 533 MHz CPU
clock
- NFS rootfs over 100MBit ethernet
- soft-float userspace
Times were gathered by booting to a prompt, running five 'hackbench 50'
tests, and averaging the results.
sequoia_defconfig: Avg time - 48.1118 seconds
sequoia_defconfig+patch: Avg time - 47.8996 seconds
I consider that difference to be in the noise range, but the important
thing is that it doesn't show a regression in performance.
Feel free to flame away at my lame testing. I didn't have the setup or
time to do much else at the moment.
josh
^ permalink raw reply
* RE: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver
From: John Linn @ 2008-07-09 16:14 UTC (permalink / raw)
To: Peter Korsgaard
Cc: Sadanand Mutyala, dmitry.torokhov, linuxppc-dev, linux-input
In-Reply-To: <878wwcsqcm.fsf@macbook.be.48ers.dk>
These look like good comments from Peter.
Dmitry, how would you like to do this, would you prefer us to do an
incremental patch from the existing patch (V3)? Or a new V4 for the
patch?
Peter, with regard to the data sheet, I would prefer not to put a
specific URL in as things always seem to get moved around so anything
beyond xilinx.com would likely be wrong sometime in the future.
Thanks,
John
> -----Original Message-----
> From: Peter Korsgaard [mailto:jacmet@gmail.com] On Behalf Of Peter
Korsgaard
> Sent: Tuesday, July 08, 2008 3:00 AM
> To: John Linn
> Cc: linuxppc-dev@ozlabs.org; linux-input@vger.kernel.org;
grant.likely@secretlab.ca;
> jwboyer@linux.vnet.ibm.com; dmitry.torokhov@gmail.com; Sadanand
Mutyala
> Subject: Re: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2
driver
> =
> >>>>> "John" =3D=3D John Linn <john.linn@xilinx.com> writes:
> =
> Hi,
> =
> > Added a new driver for Xilinx XPS PS2 IP. This driver is
> > a flat driver to better match the Linux driver pattern.
> =
> > Signed-off-by: Sadanand <sadanan@xilinx.com>
> > Signed-off-by: John Linn <john.linn@xilinx.com>
> > ---
> > V2
> > Updated the driver based on feedback from Dmitry, Peter, and
Grant.
> > We believe Montavista copyright is still valid.
> > V3
> > Incorporated Dmitry and Grant's 2nd set of comments which were
some
> > minor cleanup and removal of the mutex which was not needed.
> =
> > drivers/input/serio/Kconfig | 5 +
> > drivers/input/serio/Makefile | 1 +
> > drivers/input/serio/xilinx_ps2.c | 384
++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 390 insertions(+), 0 deletions(-)
> > create mode 100644 drivers/input/serio/xilinx_ps2.c
> =
> > diff --git a/drivers/input/serio/Kconfig
b/drivers/input/serio/Kconfig
> > index ec4b661..0e62b39 100644
> > --- a/drivers/input/serio/Kconfig
> > +++ b/drivers/input/serio/Kconfig
> > @@ -190,4 +190,9 @@ config SERIO_RAW
> > To compile this driver as a module, choose M here: the
> > module will be called serio_raw.
> =
> > +config SERIO_XILINX_XPS_PS2
> > + tristate "Xilinx XPS PS/2 Controller Support"
> > + help
> > + This driver supports XPS PS/2 IP from Xilinx EDK.
> > +
> > endif
> > diff --git a/drivers/input/serio/Makefile
b/drivers/input/serio/Makefile
> > index 38b8868..9b6c813 100644
> > --- a/drivers/input/serio/Makefile
> > +++ b/drivers/input/serio/Makefile
> > @@ -21,3 +21,4 @@ obj-$(CONFIG_SERIO_PCIPS2) +=3D pcips2.o
> > obj-$(CONFIG_SERIO_MACEPS2) +=3D maceps2.o
> > obj-$(CONFIG_SERIO_LIBPS2) +=3D libps2.o
> > obj-$(CONFIG_SERIO_RAW) +=3D serio_raw.o
> > +obj-$(CONFIG_SERIO_XILINX_XPS_PS2) +=3D xilinx_ps2.o
> > diff --git a/drivers/input/serio/xilinx_ps2.c
b/drivers/input/serio/xilinx_ps2.c
> > new file mode 100644
> > index 0000000..e86f11b
> > --- /dev/null
> > +++ b/drivers/input/serio/xilinx_ps2.c
> > @@ -0,0 +1,384 @@
> > +/*
> > + * Xilinx XPS PS/2 device driver
> > + *
> > + * (c) 2005 MontaVista Software, Inc.
> > + * (c) 2008 Xilinx, Inc.
> > + *
> > + * 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.
> > + *
> > + * You should have received a copy of the GNU General Public
License along
> > + * with this program; if not, write to the Free Software
Foundation, Inc.,
> > + * 675 Mass Ave, Cambridge, MA 02139, USA.
> > + */
> > +
> > +
> > +#include <linux/module.h>
> > +#include <linux/serio.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/errno.h>
> > +#include <linux/init.h>
> > +#include <linux/list.h>
> > +#include <linux/io.h>
> > +
> > +#include <linux/of_device.h>
> > +#include <linux/of_platform.h>
> > +
> > +#define DRIVER_NAME "xilinx_ps2"
> > +
> =
> Is there an online datasheet available somewhere on xilinx.com? (I
> couldn't find any right away) - If so, please add a link here.
> =
> > +/* Register offsets for the xps2 device */
> > +#define XPS2_SRST_OFFSET 0x00000000 /* Software Reset register */
> > +#define XPS2_STATUS_OFFSET 0x00000004 /* Status register */
> > +#define XPS2_RX_DATA_OFFSET 0x00000008 /* Receive Data
register */
> > +#define XPS2_TX_DATA_OFFSET 0x0000000C /* Transmit Data
register */
> > +#define XPS2_GIER_OFFSET 0x0000002C /* Global Interrupt Enable
reg */
> > +#define XPS2_IPISR_OFFSET 0x00000030 /* Interrupt Status register
*/
> > +#define XPS2_IPIER_OFFSET 0x00000038 /* Interrupt Enable register
*/
> > +
> > +/* Reset Register Bit Definitions */
> > +#define XPS2_SRST_RESET 0x0000000A /* Software Reset */
> > +
> > +/* Status Register Bit Positions */
> > +#define XPS2_STATUS_RX_FULL 0x00000001 /* Receive Full */
> > +#define XPS2_STATUS_TX_FULL 0x00000002 /* Transmit Full */
> > +
> > +/* Bit definitions for ISR/IER registers. Both the registers have
the same bit
> > + * definitions and are only defined once. */
> > +#define XPS2_IPIXR_WDT_TOUT 0x00000001 /* Watchdog Timeout
Interrupt */
> > +#define XPS2_IPIXR_TX_NOACK 0x00000002 /* Transmit No ACK
Interrupt */
> > +#define XPS2_IPIXR_TX_ACK 0x00000004 /* Transmit ACK (Data)
Interrupt */
> > +#define XPS2_IPIXR_RX_OVF 0x00000008 /* Receive Overflow Interrupt
*/
> > +#define XPS2_IPIXR_RX_ERR 0x00000010 /* Receive Error Interrupt */
> > +#define XPS2_IPIXR_RX_FULL 0x00000020 /* Receive Data
Interrupt */
> > +
> > +/* Mask for all the Transmit Interrupts */
> > +#define XPS2_IPIXR_TX_ALL (XPS2_IPIXR_TX_NOACK |
XPS2_IPIXR_TX_ACK)
> > +
> > +/* Mask for all the Receive Interrupts */
> > +#define XPS2_IPIXR_RX_ALL (XPS2_IPIXR_RX_OVF | XPS2_IPIXR_RX_ERR |
\
> > + XPS2_IPIXR_RX_FULL)
> > +
> > +/* Mask for all the Interrupts */
> > +#define XPS2_IPIXR_ALL (XPS2_IPIXR_TX_ALL |
XPS2_IPIXR_RX_ALL | \
> > + XPS2_IPIXR_WDT_TOUT)
> > +
> > +/* Global Interrupt Enable mask */
> > +#define XPS2_GIER_GIE_MASK 0x80000000
> > +
> > +struct xps2data {
> > + int irq;
> > + u32 phys_addr;
> > + u32 remap_size;
> =
> Do you need to keep track of these? Couldn't you just do an
> of_address_to_resource in the remove to get them? I guess they should
> be resource_size_t instead of u32s as well.
> =
> =
> > + spinlock_t lock;
> > + u8 rxb; /* Rx buffer */
> =
> Why do you need this? It seems like you don't need to keep this value
> between interrupts.
> =
> > + void __iomem *base_address; /* virt. address of control
registers */
> > + unsigned int dfl;
> =
> flags is maybe a better name. Do you need to keep track of it between
> interrupts?
> =
> > + struct serio serio; /* serio */
> > +};
> > +
> > +/************************************/
> > +/* XPS PS/2 data transmission calls */
> > +/************************************/
> > +
> > +/*
> > + * xps2_recv() will attempt to receive a byte of data from the
PS/2 port.
> > + */
> > +static int xps2_recv(struct xps2data *drvdata, u8 *byte)
> > +{
> > + u32 sr;
> > + int status =3D -1;
> > +
> > + /* If there is data available in the PS/2 receiver, read it */
> > + sr =3D in_be32(drvdata->base_address + XPS2_STATUS_OFFSET);
> > + if (sr & XPS2_STATUS_RX_FULL) {
> > + *byte =3D in_be32(drvdata->base_address +
XPS2_RX_DATA_OFFSET);
> > + status =3D 0;
> > + }
> > +
> > + return status;
> > +}
> > +
> > +/*********************/
> > +/* Interrupt handler */
> > +/*********************/
> > +static irqreturn_t xps2_interrupt(int irq, void *dev_id)
> > +{
> > + struct xps2data *drvdata =3D (struct xps2data *)dev_id;
> =
> The cast isn't needed.
> =
> > + u32 intr_sr;
> > + u8 c;
> > + int status;
> > +
> > + /* Get the PS/2 interrupts and clear them */
> > + intr_sr =3D in_be32(drvdata->base_address + XPS2_IPISR_OFFSET);
> > + out_be32(drvdata->base_address + XPS2_IPISR_OFFSET, intr_sr);
> > +
> > + /* Check which interrupt is active */
> > + if (intr_sr & XPS2_IPIXR_RX_OVF) {
> > + printk(KERN_ERR "%s: receive overrun error\n",
> > + drvdata->serio.name);
> > + }
> > +
> > + if (intr_sr & XPS2_IPIXR_RX_ERR)
> > + drvdata->dfl |=3D SERIO_PARITY;
> > +
> > + if (intr_sr & (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_WDT_TOUT))
> > + drvdata->dfl |=3D SERIO_TIMEOUT;
> > +
> > + if (intr_sr & XPS2_IPIXR_RX_FULL) {
> > + status =3D xps2_recv(drvdata, &drvdata->rxb);
> > +
> > + /* Error, if a byte is not received */
> > + if (status) {
> > + printk(KERN_ERR
> > + "%s: wrong rcvd byte count (%d)\n",
> > + drvdata->serio.name, status);
> > + } else {
> > + c =3D drvdata->rxb;
> > + serio_interrupt(&drvdata->serio, c,
drvdata->dfl);
> > + drvdata->dfl =3D 0;
> > + }
> > + }
> > +
> > + if (intr_sr & XPS2_IPIXR_TX_ACK)
> > + drvdata->dfl =3D 0;
> > +
> > + return IRQ_HANDLED;
> > +}
> > +
> > +/*******************/
> > +/* serio callbacks */
> > +/*******************/
> > +
> > +/*
> > + * sxps2_write() sends a byte out through the PS/2 interface.
> > + */
> > +static int sxps2_write(struct serio *pserio, unsigned char c)
> > +{
> > + struct xps2data *drvdata =3D pserio->port_data;
> > + unsigned long flags;
> > + u32 sr;
> > + int status =3D -1;
> > +
> > + spin_lock_irqsave(&drvdata->lock, flags);
> > + /* If the PS/2 transmitter is empty send a byte of data */
> > + sr =3D in_be32(drvdata->base_address + XPS2_STATUS_OFFSET);
> > + if ((sr & XPS2_STATUS_TX_FULL) =3D=3D 0) {
> > + out_be32(drvdata->base_address + XPS2_TX_DATA_OFFSET,
c);
> > + status =3D 0;
> > + }
> > + spin_unlock_irqrestore(&drvdata->lock, flags);
> > +
> > + return status;
> > +}
> > +
> > +/*
> > + * sxps2_open() is called when a port is open by the higher layer.
> =
> s/open/opened/
> =
> > + */
> > +static int sxps2_open(struct serio *pserio)
> > +{
> > + struct xps2data *drvdata =3D pserio->port_data;
> > + int retval;
> > +
> > + retval =3D request_irq(drvdata->irq, &xps2_interrupt, 0,
> > + DRIVER_NAME, drvdata);
> > + if (retval) {
> > + printk(KERN_ERR
> > + "%s: Couldn't allocate interrupt %d\n",
> > + drvdata->serio.name, drvdata->irq);
> =
> please use dev_err here and elsewhere.
> =
> > + return retval;
> > + }
> > +
> > + /* start reception by enabling the interrupts */
> > + out_be32(drvdata->base_address + XPS2_GIER_OFFSET,
XPS2_GIER_GIE_MASK);
> > + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET,
XPS2_IPIXR_RX_ALL);
> > + (void)xps2_recv(drvdata, &drvdata->rxb);
> > +
> > + return 0; /* success */
> > +}
> > +
> > +/*
> > + * sxps2_close() frees the interrupt.
> > + */
> > +static void sxps2_close(struct serio *pserio)
> > +{
> > + struct xps2data *drvdata =3D pserio->port_data;
> > +
> > + /* Disable the PS2 interrupts */
> > + out_be32(drvdata->base_address + XPS2_GIER_OFFSET, 0x00);
> > + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0x00);
> > + free_irq(drvdata->irq, drvdata);
> > +}
> > +
> > +/*********************/
> > +/* Device setup code */
> > +/*********************/
> > +
> > +static int xps2_setup(struct device *dev, struct resource
*regs_res,
> > + struct resource *irq_res)
> > +{
> =
> Why not just merge this with the of_ code now that you only have a
> single user of it?
> =
> > + struct xps2data *drvdata;
> > + struct serio *serio;
> > + unsigned long remap_size;
> > + int retval;
> > +
> > + if (!dev)
> > + return -EINVAL;
> > +
> > + drvdata =3D kzalloc(sizeof(struct xps2data), GFP_KERNEL);
> > + if (!drvdata) {
> > + dev_err(dev, "Couldn't allocate device private
record\n");
> > + return -ENOMEM;
> > + }
> > + spin_lock_init(&drvdata->lock);
> > + dev_set_drvdata(dev, drvdata);
> > +
> > + if (!regs_res || !irq_res) {
> > + dev_err(dev, "IO resource(s) not found\n");
> > + retval =3D -EFAULT;
> > + goto failed1;
> > + }
> > +
> > + drvdata->irq =3D irq_res->start;
> > + remap_size =3D regs_res->end - regs_res->start + 1;
> > + if (!request_mem_region(regs_res->start, remap_size,
DRIVER_NAME)) {
> > +
> > + dev_err(dev, "Couldn't lock memory region at 0x%08X\n",
> > + (unsigned int)regs_res->start);
> > + retval =3D -EBUSY;
> > + goto failed1;
> > + }
> > +
> > + /* Fill in configuration data and add them to the list */
> > + drvdata->phys_addr =3D regs_res->start;
> > + drvdata->remap_size =3D remap_size;
> > + drvdata->base_address =3D ioremap(regs_res->start, remap_size);
> > + if (drvdata->base_address =3D=3D NULL) {
> > +
> > + dev_err(dev, "Couldn't ioremap memory at 0x%08X\n",
> > + (unsigned int)regs_res->start);
> > + retval =3D -EFAULT;
> > + goto failed2;
> > + }
> > +
> > + /* Disable all the interrupts, just in case */
> > + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0);
> > +
> > + /* Reset the PS2 device and abort any current transaction, to
make sure
> > + * we have the PS2 in a good state */
> > + out_be32(drvdata->base_address + XPS2_SRST_OFFSET,
XPS2_SRST_RESET);
> > +
> > + dev_info(dev, "Xilinx PS2 at 0x%08X mapped to 0x%08X, irq=3D%d\n",
> > + drvdata->phys_addr, (u32)drvdata->base_address,
drvdata->irq);
> > +
> > + serio =3D &drvdata->serio;
> > + serio->id.type =3D SERIO_8042;
> > + serio->write =3D sxps2_write;
> > + serio->open =3D sxps2_open;
> > + serio->close =3D sxps2_close;
> > + serio->port_data =3D drvdata;
> > + serio->dev.parent =3D dev;
> > + snprintf(drvdata->serio.name, sizeof(serio->name),
> > + "Xilinx XPS PS/2 at %08X", drvdata->phys_addr);
> > + snprintf(drvdata->serio.phys, sizeof(serio->phys),
> > + "xilinxps2/serio at %08X", drvdata->phys_addr);
> > + serio_register_port(serio);
> > +
> > + return 0; /* success */
> > +
> > +failed2:
> > + release_mem_region(regs_res->start, remap_size);
> > +
> > +failed1:
> > + kfree(drvdata);
> > + dev_set_drvdata(dev, NULL);
> > +
> > + return retval;
> > +}
> > +
> > +/***************************/
> > +/* OF Platform Bus Support */
> > +/***************************/
> > +
> > +static int __devinit xps2_of_probe(struct of_device *ofdev, const
struct
> > + of_device_id * match)
> > +{
> > + struct resource r_irq; /* Interrupt resources */
> > + struct resource r_mem; /* IO mem resources */
> > + int rc =3D 0;
> > +
> > + printk(KERN_INFO "Device Tree Probing \'%s\'\n",
> > + ofdev->node->name);
> > +
> > + /* Get iospace for the device */
> > + rc =3D of_address_to_resource(ofdev->node, 0, &r_mem);
> > + if (rc) {
> > + dev_err(&ofdev->dev, "invalid address\n");
> > + return rc;
> > + }
> > +
> > + /* Get IRQ for the device */
> > + rc =3D of_irq_to_resource(ofdev->node, 0, &r_irq);
> > + if (rc =3D=3D NO_IRQ) {
> > + dev_err(&ofdev->dev, "no IRQ found\n");
> > + return rc;
> > + }
> > +
> > + return xps2_setup(&ofdev->dev, &r_mem, &r_irq);
> > +}
> > +
> > +static int __devexit xps2_of_remove(struct of_device *of_dev)
> > +{
> > + struct xps2data *drvdata;
> > + struct device *dev;
> > +
> > + dev =3D &of_dev->dev;
> > + if (!dev)
> > + return -EINVAL;
> > +
> > + drvdata =3D (struct xps2data *)dev_get_drvdata(dev);
> > +
> > + serio_unregister_port(&drvdata->serio);
> > +
> > + iounmap(drvdata->base_address);
> > +
> > + release_mem_region(drvdata->phys_addr, drvdata->remap_size);
> > +
> > + kfree(drvdata);
> > + dev_set_drvdata(dev, NULL);
> > +
> > + return 0; /* success */
> > +}
> > +
> > +/* Match table for of_platform binding */
> > +static struct of_device_id xps2_of_match[] __devinitdata =3D {
> > + { .compatible =3D "xlnx,xps-ps2-1.00.a", },
> > + { /* end of list */ },
> > +};
> > +MODULE_DEVICE_TABLE(of, xps2_of_match);
> > +
> > +static struct of_platform_driver xps2_of_driver =3D {
> > + .name =3D DRIVER_NAME,
> > + .match_table =3D xps2_of_match,
> > + .probe =3D xps2_of_probe,
> > + .remove =3D __devexit_p(xps2_of_remove),
> > +};
> > +
> > +static int __init xps2_init(void)
> > +{
> > + return of_register_platform_driver(&xps2_of_driver);
> > +}
> > +
> > +static void __exit xps2_cleanup(void)
> > +{
> > + of_unregister_platform_driver(&xps2_of_driver);
> > +}
> > +
> > +module_init(xps2_init);
> > +module_exit(xps2_cleanup);
> > +
> > +MODULE_AUTHOR("Xilinx, Inc.");
> > +MODULE_DESCRIPTION("Xilinx XPS PS/2 driver");
> > +MODULE_LICENSE("GPL");
> > +
> > --
> > 1.5.2.1
> =
> --
> Bye, Peter Korsgaard
This email and any attachments are intended for the sole use of the named r=
ecipient(s) and contain(s) confidential information that may be proprietary=
, privileged or copyrighted under applicable law. If you are not the intend=
ed recipient, do not read, copy, or forward this email message or any attac=
hments. Delete this email message and any attachments immediately.
^ permalink raw reply
* Re: Updates to powerpc.git
From: Josh Boyer @ 2008-07-09 16:31 UTC (permalink / raw)
To: Grant Likely; +Cc: Stephen Rothwell, Andrew Morton, linuxppc-dev list
In-Reply-To: <20080709162008.GC28130@secretlab.ca>
On Wed, 2008-07-09 at 10:20 -0600, Grant Likely wrote:
> On Thu, Jul 10, 2008 at 02:08:32AM +1000, Stephen Rothwell wrote:
> > Kumar,
> >
> > On Wed, 9 Jul 2008 07:58:38 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
> > >
> > > What is your intent with the 'master' branch? I hope you do NOT plan
> > > on ever rebasing it. I assume if a patch gets into master and we drop
> > > it you'll do a git-revert of it?
> >
> > "Ever" is such a strong word. Even Paul on occasion rebased his master
> > branch. I see no reason why Ben could not run his master (or maybe
> > better named "test") branch as a place that patches come and go and his
> > "next" branch as something that never (or very rarely) gets rebased with
> > commits progressing from master (test) to next when he is satisfied with
> > them. People should then base further work in the "next" branch.
>
> I was under the impression that there was some consensus that -next
> branches should be used for unstable experiments. Am I mistaken?
Yes, you are. It's slightly confusing. -next branches are for things
decidedly going into the "next" release of the kernel. If they are
unstable, they aren't really proven to be ready then.
josh
^ permalink raw reply
* RE: Booting ML405 (Kernel panic - not syncing: No init found)
From: John Linn @ 2008-07-09 16:06 UTC (permalink / raw)
To: Grant Likely, neeraj garg; +Cc: linuxppc-embedded
In-Reply-To: <20080709143318.GB26524@secretlab.ca>
The only difference I see is the tools, we are using ELDK 4.1 for now.
I have tested this on the ML405 in the past, not for a bit as our
automated testing uses an NFS root.
Since this is arch/ppc (it appears, no boot line), we have stopped work
on this architecture and are now encouraging (maybe a stronger word is
needed) you to move to arch/powerpc.
The arch/ppc was last stable at git tag last-arch-ppc and I know it
started getting more unstable after I started pulling in 2.6.26-rcx. We
won't be doing any more changes to arch/ppc.
-- 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 Grant Likely
> Sent: Wednesday, July 09, 2008 8:33 AM
> To: neeraj garg
> Cc: linuxppc-embedded@ozlabs.org
> Subject: Re: Booting ML405 (Kernel panic - not syncing: No init found)
> =
> On Wed, Jul 09, 2008 at 10:24:13AM +0530, neeraj garg wrote:
> > Hi,
> >
> > I am trying to boot ML405 with Linux source code downloaded from
> > http://www.git.xilinx.com . My cross compiler tool chain version is
> > gcc-3.4.1, glibc-2.3.2 and binutils-2.15. I have also downloaded
RAMDISK
> > from same url (http://www.git.xilinx.com). When I download
> > zImage.initrd.elf using XMD everything goes fine, untill RAMDISK is
> > uncompressed, I get following messages :
> >
> <snip>
> > [ 3.736691] Failed to
> > execute /sbin/init. Attempting defaults...
> > [ 3.748073] Kernel panic - not syncing: No init found. Try
passing
> > init=3D option to kernel.
> > [ 3.772040] Rebooting in 180 seconds..[ 183.487314] Signal: 8
> >
> =
> Try changing the kernel parameters line to specify init=3D/bin/sh and
see
> what happens.
> =
> g.
> =
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
This email and any attachments are intended for the sole use of the named r=
ecipient(s) and contain(s) confidential information that may be proprietary=
, privileged or copyrighted under applicable law. If you are not the intend=
ed recipient, do not read, copy, or forward this email message or any attac=
hments. Delete this email message and any attachments immediately.
^ permalink raw reply
* Re: [PATCH v2] powerpc: Fix problems with 32bit PPC's running with >= 4GB of RAM
From: Josh Boyer @ 2008-07-09 16:22 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
In-Reply-To: <1215616163-20803-1-git-send-email-sr@denx.de>
On Wed, 9 Jul 2008 17:09:23 +0200
Stefan Roese <sr@denx.de> wrote:
> This patch enables 32bit PPC's (with 36bit physical address space, e.g.
> IBM/AMCC PPC44x) to run with >= 4GB of RAM. Mostly its just replacing types
> (unsigned long -> phys_addr_t).
>
> Tested on an AMCC Katmai with 4GB of DDR2.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
Thanks :). FWIW, I was just going to fixup the commit log manually,
but a new patch works too.
josh
^ permalink raw reply
* Re: Updates to powerpc.git
From: Grant Likely @ 2008-07-09 16:20 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev list, Andrew Morton
In-Reply-To: <20080710020832.3e654bc9.sfr@canb.auug.org.au>
On Thu, Jul 10, 2008 at 02:08:32AM +1000, Stephen Rothwell wrote:
> Kumar,
>
> On Wed, 9 Jul 2008 07:58:38 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
> >
> > What is your intent with the 'master' branch? I hope you do NOT plan
> > on ever rebasing it. I assume if a patch gets into master and we drop
> > it you'll do a git-revert of it?
>
> "Ever" is such a strong word. Even Paul on occasion rebased his master
> branch. I see no reason why Ben could not run his master (or maybe
> better named "test") branch as a place that patches come and go and his
> "next" branch as something that never (or very rarely) gets rebased with
> commits progressing from master (test) to next when he is satisfied with
> them. People should then base further work in the "next" branch.
I was under the impression that there was some consensus that -next
branches should be used for unstable experiments. Am I mistaken?
g.
^ permalink raw reply
* Re: Updates to powerpc.git
From: Stephen Rothwell @ 2008-07-09 16:08 UTC (permalink / raw)
To: Kumar Gala; +Cc: Andrew Morton, linuxppc-dev list
In-Reply-To: <7CAAEE49-56F0-4565-8F1B-374C5E2F9E42@kernel.crashing.org>
[-- Attachment #1: Type: text/plain, Size: 821 bytes --]
Kumar,
On Wed, 9 Jul 2008 07:58:38 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> What is your intent with the 'master' branch? I hope you do NOT plan
> on ever rebasing it. I assume if a patch gets into master and we drop
> it you'll do a git-revert of it?
"Ever" is such a strong word. Even Paul on occasion rebased his master
branch. I see no reason why Ben could not run his master (or maybe
better named "test") branch as a place that patches come and go and his
"next" branch as something that never (or very rarely) gets rebased with
commits progressing from master (test) to next when he is satisfied with
them. People should then base further work in the "next" branch.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* [PATCH][RT][PPC64] Fix preempt unsafe paths accessing per_cpu variables
From: Chirag Jog @ 2008-07-09 16:05 UTC (permalink / raw)
To: linux.kernel, linux-rt-users, linuxppc-dev
Cc: Josh Triplett, Steven Rostedt, Nivedita Singhvi,
Timothy R. Chavez, paulmck
Hi,
This patch fixes various paths in the -rt kernel on powerpc64 where per_cpu
variables are accessed in a preempt unsafe way.
When a power box with -rt kernel is booted, multiple BUG messages are
generated "BUG: init:1 task might have lost a preemption check!".
After booting a kernel with these patches applied, these messages
don't appear.
Also I ran the realtime tests from ltp to ensure the stability.
Signed-Off-By: Chirag <chirag@linux.vnet.ibm.com>
arch/powerpc/mm/tlb_64.c | 31 ++++++++++++++++---------------
arch/powerpc/platforms/pseries/iommu.c | 14 ++++++++++----
include/asm-powerpc/tlb.h | 5 ++---
3 files changed, 28 insertions(+), 22 deletions(-)
Index: linux-2.6.25.8-rt7/arch/powerpc/mm/tlb_64.c
===================================================================
--- linux-2.6.25.8-rt7.orig/arch/powerpc/mm/tlb_64.c 2008-07-09 21:29:21.000000000 +0530
+++ linux-2.6.25.8-rt7/arch/powerpc/mm/tlb_64.c 2008-07-09 21:30:37.000000000 +0530
@@ -38,7 +38,6 @@
* include/asm-powerpc/tlb.h file -- tgall
*/
DEFINE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers);
-DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
unsigned long pte_freelist_forced_free;
struct pte_freelist_batch
@@ -48,7 +47,7 @@
pgtable_free_t tables[0];
};
-DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
+DEFINE_PER_CPU_LOCKED(struct pte_freelist_batch *, pte_freelist_cur);
unsigned long pte_freelist_forced_free;
#define PTE_FREELIST_SIZE \
@@ -92,24 +91,21 @@
void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
{
- /*
- * This is safe since tlb_gather_mmu has disabled preemption.
- * tlb->cpu is set by tlb_gather_mmu as well.
- */
+ int cpu;
cpumask_t local_cpumask = cpumask_of_cpu(tlb->cpu);
- struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
+ struct pte_freelist_batch **batchp = &get_cpu_var_locked(pte_freelist_cur, &cpu);
if (atomic_read(&tlb->mm->mm_users) < 2 ||
cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) {
pgtable_free(pgf);
- return;
+ goto cleanup;
}
if (*batchp == NULL) {
*batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC);
if (*batchp == NULL) {
pgtable_free_now(pgf);
- return;
+ goto cleanup;
}
(*batchp)->index = 0;
}
@@ -118,6 +114,9 @@
pte_free_submit(*batchp);
*batchp = NULL;
}
+
+ cleanup:
+ put_cpu_var_locked(pte_freelist_cur, cpu);
}
/*
@@ -253,13 +252,15 @@
void pte_free_finish(void)
{
- /* This is safe since tlb_gather_mmu has disabled preemption */
- struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
+ int cpu;
+ struct pte_freelist_batch **batchp = &get_cpu_var_locked(pte_freelist_cur, &cpu);
- if (*batchp == NULL)
- return;
- pte_free_submit(*batchp);
- *batchp = NULL;
+ if (*batchp) {
+ pte_free_submit(*batchp);
+ *batchp = NULL;
+ }
+
+ put_cpu_var_locked(pte_freelist_cur, cpu);
}
/**
Index: linux-2.6.25.8-rt7/include/asm-powerpc/tlb.h
===================================================================
--- linux-2.6.25.8-rt7.orig/include/asm-powerpc/tlb.h 2008-07-09 21:29:21.000000000 +0530
+++ linux-2.6.25.8-rt7/include/asm-powerpc/tlb.h 2008-07-09 21:29:41.000000000 +0530
@@ -40,18 +40,17 @@
static inline void tlb_flush(struct mmu_gather *tlb)
{
- struct ppc64_tlb_batch *tlbbatch = &__get_cpu_var(ppc64_tlb_batch);
+ struct ppc64_tlb_batch *tlbbatch = &get_cpu_var(ppc64_tlb_batch);
/* If there's a TLB batch pending, then we must flush it because the
* pages are going to be freed and we really don't want to have a CPU
* access a freed page because it has a stale TLB
*/
if (tlbbatch->index) {
- preempt_disable();
__flush_tlb_pending(tlbbatch);
- preempt_enable();
}
+ put_cpu_var(ppc64_tlb_batch);
pte_free_finish();
}
Index: linux-2.6.25.8-rt7/arch/powerpc/platforms/pseries/iommu.c
===================================================================
--- linux-2.6.25.8-rt7.orig/arch/powerpc/platforms/pseries/iommu.c 2008-07-09 21:29:21.000000000 +0530
+++ linux-2.6.25.8-rt7/arch/powerpc/platforms/pseries/iommu.c 2008-07-09 21:29:41.000000000 +0530
@@ -124,7 +124,7 @@
}
}
-static DEFINE_PER_CPU(u64 *, tce_page) = NULL;
+static DEFINE_PER_CPU_LOCKED(u64 *, tce_page) = NULL;
static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
long npages, unsigned long uaddr,
@@ -135,12 +135,13 @@
u64 *tcep;
u64 rpn;
long l, limit;
+ int cpu;
if (npages == 1)
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
direction);
- tcep = __get_cpu_var(tce_page);
+ tcep = get_cpu_var_locked(tce_page, &cpu);
/* This is safe to do since interrupts are off when we're called
* from iommu_alloc{,_sg}()
@@ -148,10 +149,13 @@
if (!tcep) {
tcep = (u64 *)__get_free_page(GFP_ATOMIC);
/* If allocation fails, fall back to the loop implementation */
- if (!tcep)
+ if (!tcep) {
+ put_cpu_var_locked(tce_page, cpu);
return tce_build_pSeriesLP(tbl, tcenum, npages,
uaddr, direction);
- __get_cpu_var(tce_page) = tcep;
+ }
+
+ per_cpu_var_locked(tce_page, cpu) = tcep;
}
rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
@@ -188,6 +192,8 @@
printk("\ttce[0] val = 0x%lx\n", tcep[0]);
show_stack(current, (unsigned long *)__get_SP());
}
+
+ put_cpu_var_locked(tce_page, cpu);
}
static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages)
^ permalink raw reply
* Re: [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver
From: Grant Likely @ 2008-07-09 16:04 UTC (permalink / raw)
To: John Linn; +Cc: Sadanand, dmitry.torokhov, linuxppc-dev, linux-input
In-Reply-To: <20080707153850.4C83B128005C@mail53-wa4.bigfish.com>
On Mon, Jul 07, 2008 at 08:38:45AM -0700, John Linn wrote:
> Added a new driver for Xilinx XPS PS2 IP. This driver is
> a flat driver to better match the Linux driver pattern.
>
> Signed-off-by: Sadanand <sadanan@xilinx.com>
> Signed-off-by: John Linn <john.linn@xilinx.com>
I know there are a couple of minor comments floating around; but as far
as I'm concerned....
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> V2
> Updated the driver based on feedback from Dmitry, Peter, and Grant.
> We believe Montavista copyright is still valid.
> V3
> Incorporated Dmitry and Grant's 2nd set of comments which were some
> minor cleanup and removal of the mutex which was not needed.
>
> drivers/input/serio/Kconfig | 5 +
> drivers/input/serio/Makefile | 1 +
> drivers/input/serio/xilinx_ps2.c | 384 ++++++++++++++++++++++++++++++++++++++
> 3 files changed, 390 insertions(+), 0 deletions(-)
> create mode 100644 drivers/input/serio/xilinx_ps2.c
>
> diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
> index ec4b661..0e62b39 100644
> --- a/drivers/input/serio/Kconfig
> +++ b/drivers/input/serio/Kconfig
> @@ -190,4 +190,9 @@ config SERIO_RAW
> To compile this driver as a module, choose M here: the
> module will be called serio_raw.
>
> +config SERIO_XILINX_XPS_PS2
> + tristate "Xilinx XPS PS/2 Controller Support"
> + help
> + This driver supports XPS PS/2 IP from Xilinx EDK.
> +
> endif
> diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile
> index 38b8868..9b6c813 100644
> --- a/drivers/input/serio/Makefile
> +++ b/drivers/input/serio/Makefile
> @@ -21,3 +21,4 @@ obj-$(CONFIG_SERIO_PCIPS2) += pcips2.o
> obj-$(CONFIG_SERIO_MACEPS2) += maceps2.o
> obj-$(CONFIG_SERIO_LIBPS2) += libps2.o
> obj-$(CONFIG_SERIO_RAW) += serio_raw.o
> +obj-$(CONFIG_SERIO_XILINX_XPS_PS2) += xilinx_ps2.o
> diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
> new file mode 100644
> index 0000000..e86f11b
> --- /dev/null
> +++ b/drivers/input/serio/xilinx_ps2.c
> @@ -0,0 +1,384 @@
> +/*
> + * Xilinx XPS PS/2 device driver
> + *
> + * (c) 2005 MontaVista Software, Inc.
> + * (c) 2008 Xilinx, Inc.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, write to the Free Software Foundation, Inc.,
> + * 675 Mass Ave, Cambridge, MA 02139, USA.
> + */
> +
> +
> +#include <linux/module.h>
> +#include <linux/serio.h>
> +#include <linux/interrupt.h>
> +#include <linux/errno.h>
> +#include <linux/init.h>
> +#include <linux/list.h>
> +#include <linux/io.h>
> +
> +#include <linux/of_device.h>
> +#include <linux/of_platform.h>
> +
> +#define DRIVER_NAME "xilinx_ps2"
> +
> +/* Register offsets for the xps2 device */
> +#define XPS2_SRST_OFFSET 0x00000000 /* Software Reset register */
> +#define XPS2_STATUS_OFFSET 0x00000004 /* Status register */
> +#define XPS2_RX_DATA_OFFSET 0x00000008 /* Receive Data register */
> +#define XPS2_TX_DATA_OFFSET 0x0000000C /* Transmit Data register */
> +#define XPS2_GIER_OFFSET 0x0000002C /* Global Interrupt Enable reg */
> +#define XPS2_IPISR_OFFSET 0x00000030 /* Interrupt Status register */
> +#define XPS2_IPIER_OFFSET 0x00000038 /* Interrupt Enable register */
> +
> +/* Reset Register Bit Definitions */
> +#define XPS2_SRST_RESET 0x0000000A /* Software Reset */
> +
> +/* Status Register Bit Positions */
> +#define XPS2_STATUS_RX_FULL 0x00000001 /* Receive Full */
> +#define XPS2_STATUS_TX_FULL 0x00000002 /* Transmit Full */
> +
> +/* Bit definitions for ISR/IER registers. Both the registers have the same bit
> + * definitions and are only defined once. */
> +#define XPS2_IPIXR_WDT_TOUT 0x00000001 /* Watchdog Timeout Interrupt */
> +#define XPS2_IPIXR_TX_NOACK 0x00000002 /* Transmit No ACK Interrupt */
> +#define XPS2_IPIXR_TX_ACK 0x00000004 /* Transmit ACK (Data) Interrupt */
> +#define XPS2_IPIXR_RX_OVF 0x00000008 /* Receive Overflow Interrupt */
> +#define XPS2_IPIXR_RX_ERR 0x00000010 /* Receive Error Interrupt */
> +#define XPS2_IPIXR_RX_FULL 0x00000020 /* Receive Data Interrupt */
> +
> +/* Mask for all the Transmit Interrupts */
> +#define XPS2_IPIXR_TX_ALL (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_TX_ACK)
> +
> +/* Mask for all the Receive Interrupts */
> +#define XPS2_IPIXR_RX_ALL (XPS2_IPIXR_RX_OVF | XPS2_IPIXR_RX_ERR | \
> + XPS2_IPIXR_RX_FULL)
> +
> +/* Mask for all the Interrupts */
> +#define XPS2_IPIXR_ALL (XPS2_IPIXR_TX_ALL | XPS2_IPIXR_RX_ALL | \
> + XPS2_IPIXR_WDT_TOUT)
> +
> +/* Global Interrupt Enable mask */
> +#define XPS2_GIER_GIE_MASK 0x80000000
> +
> +struct xps2data {
> + int irq;
> + u32 phys_addr;
> + u32 remap_size;
> + spinlock_t lock;
> + u8 rxb; /* Rx buffer */
> + void __iomem *base_address; /* virt. address of control registers */
> + unsigned int dfl;
> + struct serio serio; /* serio */
> +};
> +
> +/************************************/
> +/* XPS PS/2 data transmission calls */
> +/************************************/
> +
> +/*
> + * xps2_recv() will attempt to receive a byte of data from the PS/2 port.
> + */
> +static int xps2_recv(struct xps2data *drvdata, u8 *byte)
> +{
> + u32 sr;
> + int status = -1;
> +
> + /* If there is data available in the PS/2 receiver, read it */
> + sr = in_be32(drvdata->base_address + XPS2_STATUS_OFFSET);
> + if (sr & XPS2_STATUS_RX_FULL) {
> + *byte = in_be32(drvdata->base_address + XPS2_RX_DATA_OFFSET);
> + status = 0;
> + }
> +
> + return status;
> +}
> +
> +/*********************/
> +/* Interrupt handler */
> +/*********************/
> +static irqreturn_t xps2_interrupt(int irq, void *dev_id)
> +{
> + struct xps2data *drvdata = (struct xps2data *)dev_id;
> + u32 intr_sr;
> + u8 c;
> + int status;
> +
> + /* Get the PS/2 interrupts and clear them */
> + intr_sr = in_be32(drvdata->base_address + XPS2_IPISR_OFFSET);
> + out_be32(drvdata->base_address + XPS2_IPISR_OFFSET, intr_sr);
> +
> + /* Check which interrupt is active */
> + if (intr_sr & XPS2_IPIXR_RX_OVF) {
> + printk(KERN_ERR "%s: receive overrun error\n",
> + drvdata->serio.name);
> + }
> +
> + if (intr_sr & XPS2_IPIXR_RX_ERR)
> + drvdata->dfl |= SERIO_PARITY;
> +
> + if (intr_sr & (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_WDT_TOUT))
> + drvdata->dfl |= SERIO_TIMEOUT;
> +
> + if (intr_sr & XPS2_IPIXR_RX_FULL) {
> + status = xps2_recv(drvdata, &drvdata->rxb);
> +
> + /* Error, if a byte is not received */
> + if (status) {
> + printk(KERN_ERR
> + "%s: wrong rcvd byte count (%d)\n",
> + drvdata->serio.name, status);
> + } else {
> + c = drvdata->rxb;
> + serio_interrupt(&drvdata->serio, c, drvdata->dfl);
> + drvdata->dfl = 0;
> + }
> + }
> +
> + if (intr_sr & XPS2_IPIXR_TX_ACK)
> + drvdata->dfl = 0;
> +
> + return IRQ_HANDLED;
> +}
> +
> +/*******************/
> +/* serio callbacks */
> +/*******************/
> +
> +/*
> + * sxps2_write() sends a byte out through the PS/2 interface.
> + */
> +static int sxps2_write(struct serio *pserio, unsigned char c)
> +{
> + struct xps2data *drvdata = pserio->port_data;
> + unsigned long flags;
> + u32 sr;
> + int status = -1;
> +
> + spin_lock_irqsave(&drvdata->lock, flags);
> + /* If the PS/2 transmitter is empty send a byte of data */
> + sr = in_be32(drvdata->base_address + XPS2_STATUS_OFFSET);
> + if ((sr & XPS2_STATUS_TX_FULL) == 0) {
> + out_be32(drvdata->base_address + XPS2_TX_DATA_OFFSET, c);
> + status = 0;
> + }
> + spin_unlock_irqrestore(&drvdata->lock, flags);
> +
> + return status;
> +}
> +
> +/*
> + * sxps2_open() is called when a port is open by the higher layer.
> + */
> +static int sxps2_open(struct serio *pserio)
> +{
> + struct xps2data *drvdata = pserio->port_data;
> + int retval;
> +
> + retval = request_irq(drvdata->irq, &xps2_interrupt, 0,
> + DRIVER_NAME, drvdata);
> + if (retval) {
> + printk(KERN_ERR
> + "%s: Couldn't allocate interrupt %d\n",
> + drvdata->serio.name, drvdata->irq);
> + return retval;
> + }
> +
> + /* start reception by enabling the interrupts */
> + out_be32(drvdata->base_address + XPS2_GIER_OFFSET, XPS2_GIER_GIE_MASK);
> + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, XPS2_IPIXR_RX_ALL);
> + (void)xps2_recv(drvdata, &drvdata->rxb);
> +
> + return 0; /* success */
> +}
> +
> +/*
> + * sxps2_close() frees the interrupt.
> + */
> +static void sxps2_close(struct serio *pserio)
> +{
> + struct xps2data *drvdata = pserio->port_data;
> +
> + /* Disable the PS2 interrupts */
> + out_be32(drvdata->base_address + XPS2_GIER_OFFSET, 0x00);
> + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0x00);
> + free_irq(drvdata->irq, drvdata);
> +}
> +
> +/*********************/
> +/* Device setup code */
> +/*********************/
> +
> +static int xps2_setup(struct device *dev, struct resource *regs_res,
> + struct resource *irq_res)
> +{
> + struct xps2data *drvdata;
> + struct serio *serio;
> + unsigned long remap_size;
> + int retval;
> +
> + if (!dev)
> + return -EINVAL;
> +
> + drvdata = kzalloc(sizeof(struct xps2data), GFP_KERNEL);
> + if (!drvdata) {
> + dev_err(dev, "Couldn't allocate device private record\n");
> + return -ENOMEM;
> + }
> + spin_lock_init(&drvdata->lock);
> + dev_set_drvdata(dev, drvdata);
> +
> + if (!regs_res || !irq_res) {
> + dev_err(dev, "IO resource(s) not found\n");
> + retval = -EFAULT;
> + goto failed1;
> + }
> +
> + drvdata->irq = irq_res->start;
> + remap_size = regs_res->end - regs_res->start + 1;
> + if (!request_mem_region(regs_res->start, remap_size, DRIVER_NAME)) {
> +
> + dev_err(dev, "Couldn't lock memory region at 0x%08X\n",
> + (unsigned int)regs_res->start);
> + retval = -EBUSY;
> + goto failed1;
> + }
> +
> + /* Fill in configuration data and add them to the list */
> + drvdata->phys_addr = regs_res->start;
> + drvdata->remap_size = remap_size;
> + drvdata->base_address = ioremap(regs_res->start, remap_size);
> + if (drvdata->base_address == NULL) {
> +
> + dev_err(dev, "Couldn't ioremap memory at 0x%08X\n",
> + (unsigned int)regs_res->start);
> + retval = -EFAULT;
> + goto failed2;
> + }
> +
> + /* Disable all the interrupts, just in case */
> + out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0);
> +
> + /* Reset the PS2 device and abort any current transaction, to make sure
> + * we have the PS2 in a good state */
> + out_be32(drvdata->base_address + XPS2_SRST_OFFSET, XPS2_SRST_RESET);
> +
> + dev_info(dev, "Xilinx PS2 at 0x%08X mapped to 0x%08X, irq=%d\n",
> + drvdata->phys_addr, (u32)drvdata->base_address, drvdata->irq);
> +
> + serio = &drvdata->serio;
> + serio->id.type = SERIO_8042;
> + serio->write = sxps2_write;
> + serio->open = sxps2_open;
> + serio->close = sxps2_close;
> + serio->port_data = drvdata;
> + serio->dev.parent = dev;
> + snprintf(drvdata->serio.name, sizeof(serio->name),
> + "Xilinx XPS PS/2 at %08X", drvdata->phys_addr);
> + snprintf(drvdata->serio.phys, sizeof(serio->phys),
> + "xilinxps2/serio at %08X", drvdata->phys_addr);
> + serio_register_port(serio);
> +
> + return 0; /* success */
> +
> +failed2:
> + release_mem_region(regs_res->start, remap_size);
> +
> +failed1:
> + kfree(drvdata);
> + dev_set_drvdata(dev, NULL);
> +
> + return retval;
> +}
> +
> +/***************************/
> +/* OF Platform Bus Support */
> +/***************************/
> +
> +static int __devinit xps2_of_probe(struct of_device *ofdev, const struct
> + of_device_id * match)
> +{
> + struct resource r_irq; /* Interrupt resources */
> + struct resource r_mem; /* IO mem resources */
> + int rc = 0;
> +
> + printk(KERN_INFO "Device Tree Probing \'%s\'\n",
> + ofdev->node->name);
> +
> + /* Get iospace for the device */
> + rc = of_address_to_resource(ofdev->node, 0, &r_mem);
> + if (rc) {
> + dev_err(&ofdev->dev, "invalid address\n");
> + return rc;
> + }
> +
> + /* Get IRQ for the device */
> + rc = of_irq_to_resource(ofdev->node, 0, &r_irq);
> + if (rc == NO_IRQ) {
> + dev_err(&ofdev->dev, "no IRQ found\n");
> + return rc;
> + }
> +
> + return xps2_setup(&ofdev->dev, &r_mem, &r_irq);
> +}
> +
> +static int __devexit xps2_of_remove(struct of_device *of_dev)
> +{
> + struct xps2data *drvdata;
> + struct device *dev;
> +
> + dev = &of_dev->dev;
> + if (!dev)
> + return -EINVAL;
> +
> + drvdata = (struct xps2data *)dev_get_drvdata(dev);
> +
> + serio_unregister_port(&drvdata->serio);
> +
> + iounmap(drvdata->base_address);
> +
> + release_mem_region(drvdata->phys_addr, drvdata->remap_size);
> +
> + kfree(drvdata);
> + dev_set_drvdata(dev, NULL);
> +
> + return 0; /* success */
> +}
> +
> +/* Match table for of_platform binding */
> +static struct of_device_id xps2_of_match[] __devinitdata = {
> + { .compatible = "xlnx,xps-ps2-1.00.a", },
> + { /* end of list */ },
> +};
> +MODULE_DEVICE_TABLE(of, xps2_of_match);
> +
> +static struct of_platform_driver xps2_of_driver = {
> + .name = DRIVER_NAME,
> + .match_table = xps2_of_match,
> + .probe = xps2_of_probe,
> + .remove = __devexit_p(xps2_of_remove),
> +};
> +
> +static int __init xps2_init(void)
> +{
> + return of_register_platform_driver(&xps2_of_driver);
> +}
> +
> +static void __exit xps2_cleanup(void)
> +{
> + of_unregister_platform_driver(&xps2_of_driver);
> +}
> +
> +module_init(xps2_init);
> +module_exit(xps2_cleanup);
> +
> +MODULE_AUTHOR("Xilinx, Inc.");
> +MODULE_DESCRIPTION("Xilinx XPS PS/2 driver");
> +MODULE_LICENSE("GPL");
> +
> --
> 1.5.2.1
>
>
>
> This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
>
>
^ permalink raw reply
* Re: Please pull linux-2.6-virtex.git
From: Grant Likely @ 2008-07-09 15:57 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <1215612904.13186.4.camel@weaponx>
Hey Josh, here is the new pull request:
The following changes since commit f3e909c2750eb20536bacacc867dc9047b70546a:
Michael Neuling (1):
powerpc: Update for VSX core file and ptrace
are available in the git repository at:
git://git.secretlab.ca/git/linux-2.6-virtex virtex-for-2.6.27
Grant Likely (4):
powerpc/bootwrapper: Add documentation of boot wrapper targets
powerpc/bootwrapper: add missing bit of simpleImage target
powerpc/bootwrapper: Allow user to specify additional default targets
powerpc/440: Convert Virtex ML507 device tree to dts-v1
John Linn (5):
powerpc/virtex: add dts file for ML507 reference design
powerpc/virtex: Fix booting of Xilinx FPGAs with 16550 for 405 and 440
powerpc/virtex: add Xilinx Virtex 5 ppc440 platform support
powerpc/virtex: add Xilinx 440 cpu to the cputable
powerpc/virtex: add defconfig for virtex 5 platforms
Documentation/powerpc/bootwrapper.txt | 141 ++++
arch/powerpc/Kconfig | 13 +
arch/powerpc/Makefile | 15 +-
arch/powerpc/boot/Makefile | 5 +-
arch/powerpc/boot/dts/virtex440-ml507.dts | 296 ++++++++
arch/powerpc/boot/simpleboot.c | 6 +
arch/powerpc/boot/virtex.c | 100 +++
arch/powerpc/boot/wrapper | 10 +-
arch/powerpc/configs/44x/virtex5_defconfig | 1107 ++++++++++++++++++++++++++++
arch/powerpc/kernel/cputable.c | 10 +
arch/powerpc/platforms/44x/Kconfig | 26 +
arch/powerpc/platforms/44x/Makefile | 1 +
arch/powerpc/platforms/44x/virtex.c | 60 ++
13 files changed, 1787 insertions(+), 3 deletions(-)
create mode 100644 Documentation/powerpc/bootwrapper.txt
create mode 100644 arch/powerpc/boot/dts/virtex440-ml507.dts
create mode 100644 arch/powerpc/boot/virtex.c
create mode 100644 arch/powerpc/configs/44x/virtex5_defconfig
create mode 100644 arch/powerpc/platforms/44x/virtex.c
On Wed, Jul 9, 2008 at 8:15 AM, Josh Boyer <jwboyer@gmail.com> wrote:
> On Fri, 2008-07-04 at 11:22 -0600, Grant Likely wrote:
>> Hi Josh,
>>
>> Here are the bulk of the Xilinx 440 support patches. Please pull
>> into your next branch.
>>
>> Thanks,
>> g.
>>
>> The following changes since commit f3e909c2750eb20536bacacc867dc9047b70546a:
>> Michael Neuling (1):
>> powerpc: Update for VSX core file and ptrace
>>
>> are available in the git repository at:
>>
>> git://git.secretlab.ca/git/linux-2.6-virtex virtex-for-2.6.27
>
> Any chance to get that updated with the latest fixes before I pull it
> in? Namely the DTS file for virtex5, but there might have been others.
>
> josh
>
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* [PATCH][RT][PPC64] Fix preempt unsafe paths accessing per_cpu variables
From: Chirag Jog @ 2008-07-09 15:33 UTC (permalink / raw)
To: linux.kernel, linux-rt-users, linuxppc-dev
Cc: Timothy R. Chavez, Nivedita Singhvi, paulmck
Hi,
This patch fixes various paths in the -rt kernel on powerpc64 where per_cpu
variables are accessed in a preempt unsafe way.
When a power box with -rt kernel is booted, multiple BUG messages are
generated "BUG: init:1 task might have lost a preemption check!".
After booting a kernel with these patches applied, these messages
don't appear.
Also I ran the realtime tests from ltp to ensure the stability.
Signed-Off-By: Chirag <chirag@linux.vnet.ibm.com>
arch/powerpc/mm/tlb_64.c | 29 ++++++++++++++++-------------
arch/powerpc/platforms/pseries/iommu.c | 14 ++++++++++----
include/asm-powerpc/tlb.h | 5 ++---
3 files changed, 28 insertions(+), 20 deletions(-)
Index: linux-2.6.25.8-rt7/arch/powerpc/mm/tlb_64.c
===================================================================
--- linux-2.6.25.8-rt7.orig/arch/powerpc/mm/tlb_64.c 2008-07-07 13:13:59.000000000 +0530
+++ linux-2.6.25.8-rt7/arch/powerpc/mm/tlb_64.c 2008-07-09 20:57:01.000000000 +0530
@@ -38,7 +38,6 @@
* include/asm-powerpc/tlb.h file -- tgall
*/
DEFINE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers);
-DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
unsigned long pte_freelist_forced_free;
struct pte_freelist_batch
@@ -48,7 +47,7 @@
pgtable_free_t tables[0];
};
-DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
+DEFINE_PER_CPU_LOCKED(struct pte_freelist_batch *, pte_freelist_cur);
unsigned long pte_freelist_forced_free;
#define PTE_FREELIST_SIZE \
@@ -92,16 +91,14 @@
void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
{
- /*
- * This is safe since tlb_gather_mmu has disabled preemption.
- * tlb->cpu is set by tlb_gather_mmu as well.
- */
+ int cpu;
cpumask_t local_cpumask = cpumask_of_cpu(tlb->cpu);
- struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
+ struct pte_freelist_batch **batchp = &get_cpu_var_locked(pte_freelist_cur, &cpu);
if (atomic_read(&tlb->mm->mm_users) < 2 ||
cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) {
pgtable_free(pgf);
+ goto cleanup;
return;
}
@@ -109,6 +106,7 @@
*batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC);
if (*batchp == NULL) {
pgtable_free_now(pgf);
+ goto cleanup;
return;
}
(*batchp)->index = 0;
@@ -118,6 +116,9 @@
pte_free_submit(*batchp);
*batchp = NULL;
}
+
+ cleanup:
+ put_cpu_var_locked(pte_freelist_cur, cpu);
}
/*
@@ -253,13 +254,15 @@
void pte_free_finish(void)
{
- /* This is safe since tlb_gather_mmu has disabled preemption */
- struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
+ int cpu;
+ struct pte_freelist_batch **batchp = &get_cpu_var_locked(pte_freelist_cur, &cpu);
- if (*batchp == NULL)
- return;
- pte_free_submit(*batchp);
- *batchp = NULL;
+ if (*batchp) {
+ pte_free_submit(*batchp);
+ *batchp = NULL;
+ }
+
+ put_cpu_var_locked(pte_freelist_cur, cpu);
}
/**
Index: linux-2.6.25.8-rt7/include/asm-powerpc/tlb.h
===================================================================
--- linux-2.6.25.8-rt7.orig/include/asm-powerpc/tlb.h 2008-07-07 22:58:37.000000000 +0530
+++ linux-2.6.25.8-rt7/include/asm-powerpc/tlb.h 2008-07-09 10:22:51.000000000 +0530
@@ -40,18 +40,17 @@
static inline void tlb_flush(struct mmu_gather *tlb)
{
- struct ppc64_tlb_batch *tlbbatch = &__get_cpu_var(ppc64_tlb_batch);
+ struct ppc64_tlb_batch *tlbbatch = &get_cpu_var(ppc64_tlb_batch);
/* If there's a TLB batch pending, then we must flush it because the
* pages are going to be freed and we really don't want to have a CPU
* access a freed page because it has a stale TLB
*/
if (tlbbatch->index) {
- preempt_disable();
__flush_tlb_pending(tlbbatch);
- preempt_enable();
}
+ put_cpu_var(ppc64_tlb_batch);
pte_free_finish();
}
Index: linux-2.6.25.8-rt7/arch/powerpc/platforms/pseries/iommu.c
===================================================================
--- linux-2.6.25.8-rt7.orig/arch/powerpc/platforms/pseries/iommu.c 2008-07-07 23:16:29.000000000 +0530
+++ linux-2.6.25.8-rt7/arch/powerpc/platforms/pseries/iommu.c 2008-07-09 10:49:21.000000000 +0530
@@ -124,7 +124,7 @@
}
}
-static DEFINE_PER_CPU(u64 *, tce_page) = NULL;
+static DEFINE_PER_CPU_LOCKED(u64 *, tce_page) = NULL;
static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
long npages, unsigned long uaddr,
@@ -135,12 +135,13 @@
u64 *tcep;
u64 rpn;
long l, limit;
+ int cpu;
if (npages == 1)
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
direction);
- tcep = __get_cpu_var(tce_page);
+ tcep = get_cpu_var_locked(tce_page, &cpu);
/* This is safe to do since interrupts are off when we're called
* from iommu_alloc{,_sg}()
@@ -148,10 +149,13 @@
if (!tcep) {
tcep = (u64 *)__get_free_page(GFP_ATOMIC);
/* If allocation fails, fall back to the loop implementation */
- if (!tcep)
+ if (!tcep) {
+ put_cpu_var_locked(tce_page, cpu);
return tce_build_pSeriesLP(tbl, tcenum, npages,
uaddr, direction);
- __get_cpu_var(tce_page) = tcep;
+ }
+
+ per_cpu_var_locked(tce_page, cpu) = tcep;
}
rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
@@ -188,6 +192,8 @@
printk("\ttce[0] val = 0x%lx\n", tcep[0]);
show_stack(current, (unsigned long *)__get_SP());
}
+
+ put_cpu_var_locked(tce_page, cpu);
}
static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages)
^ permalink raw reply
* Re: [PATCH] powerpc: rework 4xx PTE access and TLB miss
From: Kumar Gala @ 2008-07-09 15:31 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20080708055449.EDFDADDEF5@ozlabs.org>
On Jul 8, 2008, at 12:54 AM, Benjamin Herrenschmidt wrote:
> This is some preliminary work to improve TLB management on SW loaded
> TLB powerpc platforms. This introduce support for non-atomic PTE
> operations in pgtable-ppc32.h and removes write back to the PTE from
> the TLB miss handlers. In addition, the DSI interrupt code no longer
> tries to fixup write permission, this is left to generic code, and
> _PAGE_HWWRITE is gone.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> This is a first step, plan is to do the same for FSL BookE, 405 and
> possibly 8xx too. From there, I want to rework a bit the execute
> permission handling to avoid multiple faults, add support for
> _PAGE_EXEC (no executable mappings), for prefaulting (especially
> for kmap) and proper SMP support for future SMP capable BookE
> platforms.
>
> v2. This version fixes a couple of typos, add a few comments and
> change use of flush_instruction_cache() to flush_icache_range()
> which will be more appropriate if there is ever an SMP variant.
>
> v3. Relying on the generic code to fixup _PAGE_ACCESSED doesn't
> work for exec faults because our cache coherency code in
> do_page_fault() will never go all the way to the generic code
> for these. We fix it up by always setting _PAGE_ACCESSED when
> setting _PAGE_HWEXEC in there.
> This version of the patch is rebased on top of -next
shouldn't you remove _PAGE_HWWRITE from 40x? (I'm still seeing it in
pgtable-ppc32.h and head_40x.S)
- k
^ permalink raw reply
* Re: [patch 5/5] powerpc: Dont clear _PAGE_COHERENT when _PAGE_SAO is set
From: Dave Kleikamp @ 2008-07-09 15:28 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
In-Reply-To: <1215575177.8970.311.camel@pasglop>
On Wed, 2008-07-09 at 13:46 +1000, Benjamin Herrenschmidt wrote:
> The old code looks bogus.. why clear M when G is set ? Only
> I should have mattered.
I can't find anywhere where G gets set without also setting I, so the
test seems redundant as well.
> I'll apply anyway as you aren't changing the existing behaviour here but
> maybe you can shoot me a fixup patch that removes the _PAGE_GUARDED
> condition completely here ?
No problem. There is code in cell/beat_htab.c doing the same thing.
I've gone ahead and fixed it there too.
> It's legal to have G=1 M=1 pages and can even be useful under some
> circumstances.
It doesn't look like anyone is trying to take advantage of that
currently.
Here's your patch:
powerpc: Remove unnecessary condition when sanity-checking WIMG bits
It is okay for both _PAGE_GUARDED and _PAGE_COHERENT (G and M) to be set
in the same pte. In fact, even if that were not the case, there doesn't
seem to be any place where G is set without also setting I (_PAGE_NO_CACHE),
so the test for I is sufficient.
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
diff --git a/arch/powerpc/platforms/cell/beat_htab.c b/arch/powerpc/platforms/cell/beat_htab.c
index 81467ff..2e67bd8 100644
--- a/arch/powerpc/platforms/cell/beat_htab.c
+++ b/arch/powerpc/platforms/cell/beat_htab.c
@@ -112,7 +112,7 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
if (!(vflags & HPTE_V_BOLTED))
DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
- if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
+ if (rflags & _PAGE_NO_CACHE)
hpte_r &= ~_PAGE_COHERENT;
spin_lock(&beat_htab_lock);
@@ -334,7 +334,7 @@ static long beat_lpar_hpte_insert_v3(unsigned long hpte_group,
if (!(vflags & HPTE_V_BOLTED))
DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
- if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
+ if (rflags & _PAGE_NO_CACHE)
hpte_r &= ~_PAGE_COHERENT;
/* insert into not-volted entry */
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 38b5927..52a80e5 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -305,8 +305,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
flags = 0;
/* Make pHyp happy */
- if ((rflags & _PAGE_GUARDED) ||
- ((rflags & _PAGE_NO_CACHE) & !(rflags & _PAGE_WRITETHRU)))
+ if ((rflags & _PAGE_NO_CACHE) & !(rflags & _PAGE_WRITETHRU))
hpte_r &= ~_PAGE_COHERENT;
lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot);
--
David Kleikamp
IBM Linux Technology Center
^ permalink raw reply related
* [PATCH v3] Add PPC_FEATURE_PSERIES_PERFMON_COMPAT
From: Nathan Lynch @ 2008-07-09 15:06 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Olof Johansson, Paul Mackerras
In-Reply-To: <20080703232001.GB9594@localdomain>
Background from Maynard Johnson:
As of POWER6, a set of 32 common events is defined that must be
supported on all future POWER processors. The main impetus for this
compat set is the need to support partition migration, especially from
processor P(n) to processor P(n+1), where performance software that's
running in the new partition may not be knowledgeable about processor
P(n+1). If a performance tool determines it does not support the
physical processor, but is told (via the
PPC_FEATURE_PSERIES_PERFMON_COMPAT bit) that the processor supports
the notion of the PMU compat set, then the performance tool can
surface just those events to the user of the tool.
PPC_FEATURE_PSERIES_PERFMON_COMPAT indicates that the PMU supports at
least this basic subset of events which is compatible across POWER
processor lines.
Signed-off-by: Nathan Lynch <ntl@pobox.com>
---
Changes since v2:
- Further disambiguated name of feature bit (PMU -> PERFMON)
Changes since v1:
- make name of feature bit less generic
- provide more complete changelog
arch/powerpc/kernel/cputable.c | 6 ++++--
include/asm-powerpc/cputable.h | 3 +++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 817cea1..02088b0 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -70,10 +70,12 @@ extern void __restore_cpu_power7(void);
PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
#define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
- PPC_FEATURE_TRUE_LE)
+ PPC_FEATURE_TRUE_LE | \
+ PPC_FEATURE_PSERIES_PERFMON_COMPAT)
#define COMMON_USER_POWER7 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\
PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
- PPC_FEATURE_TRUE_LE)
+ PPC_FEATURE_TRUE_LE | \
+ PPC_FEATURE_PSERIES_PERFMON_COMPAT)
#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
PPC_FEATURE_TRUE_LE | \
PPC_FEATURE_HAS_ALTIVEC_COMP)
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 3171ac9..58d4281 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -27,6 +27,9 @@
#define PPC_FEATURE_ARCH_2_06 0x00000100
#define PPC_FEATURE_HAS_VSX 0x00000080
+#define PPC_FEATURE_PSERIES_PERFMON_COMPAT \
+ 0x00000040
+
#define PPC_FEATURE_TRUE_LE 0x00000002
#define PPC_FEATURE_PPC_LE 0x00000001
--
1.5.6.2
^ permalink raw reply related
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