* Re: [Fwd: [Bug 7431] New: ohci1394 Oops after a rmmod/modprobe cycle]
From: Olaf Hering @ 2006-11-07 7:08 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Gioele Barabucci, Stefan Richter
In-Reply-To: <1162851570.28571.361.camel@localhost.localdomain>
On Tue, Nov 07, Benjamin Herrenschmidt wrote:
> On Mon, 2006-11-06 at 17:58 +0100, Olaf Hering wrote:
> > On Sun, Nov 05, Stefan Richter wrote:
> >
> > > Yes, PowerBook G3 Pismo seems affected.
> > > https://bugzilla.novell.com/show_bug.cgi?id=115228
> >
> > This patch does not help. Doing an ip link set dev eth0 up makes no
> > difference.
>
> What about trying to add a delay between the pmac clock code and the
> init of the controller ? does that help ?
no. and it is the rmmod, not the insmod, that hangs the pismo.
Adding some mdelay to the remove function doesnt help either.
^ permalink raw reply
* Error in compiling the linux kernel
From: Reddy Suneel-ASR125 @ 2006-11-07 6:31 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 501 bytes --]
Hi
I applied the gcov patch for Linux 2.6 and I try to compile it. I am
getting the following error.
arch/ppc/kernel/built-in.o(.text+0x8f8): In function `_switch':
arch/ppc/kernel/entry.S: relocation truncated to fit: R_PPC_REL14
against symbol `do_syscall_trace' defined in .text section in
arch/ppc/kernel/built-in.o
make: *** [.tmp_vmlinux1] Error 1
Linux kernel is cpmpiled for MPC8548 Powerpc processor.
Can anybody knows the root cause of this problem?
suneel
[-- Attachment #2: Type: text/html, Size: 1806 bytes --]
^ permalink raw reply
* Clock Modification of MPC885 for USB Host Functionality
From: Prakash Ramaraju @ 2006-11-07 5:57 UTC (permalink / raw)
To: linuxppc-embedded
Greetings
Currently I have a MPC885 based board running at 50MHz. I want USB
host working at full speed with internal clock. Assuming I need to
change the General System Clock Frequency (GCLK2) to 48MHz, I got this
calculation with input frequency of 10MHz from an u-boot script.
pdf mfi mfn mfd s dbrmo dpref dpgdck jdbck gclk2 exact?
--- --- --- --- - ----- ----- ------ ----- ----- ------
0 9 3 4 1 0 10000000 192000000 96000000 48000000 YES
0 9 6 9 1 0 10000000 192000000 96000000 48000000 YES
0 9 9 14 1 0 10000000 192000000 96000000 48000000 YES
0 9 12 19 1 0 10000000 192000000 96000000 48000000 YES
I modified CFG_PLPRCR (to 19194000) in u-boot config file to match
this. But I'm getting only 45MHz output clock (not exactly 48MHz which
is needed for USB to work)
If anyone can shed some info making the USB work on MPC885 with
internal clock or changing the clock freq to exact 48MHz, it will be
helpful.
--
With best regards,
Prakash
^ permalink raw reply
* Re: [PATCH 2/5] [RFC] Add support for lite5200b to arch/powerpc
From: Grant Likely @ 2006-11-07 4:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1162865073.28571.390.camel@localhost.localdomain>
On 11/6/06, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > +static int __init lite5200_probe(void)
> > +{
> > + unsigned long node = of_get_flat_dt_root();
> > + const char *model = of_get_flat_dt_prop(node, "model", NULL);
> > +
> > + if (!of_flat_dt_is_compatible(node, "mpc52xx"))
> > + return 0;
> > + pr_debug("%s board w/ mpc52xx found\n", model ? model : "unknown");
> > +
> > + return 1;
> > +}
>
> Are you creating a "generic" mpc52xx machine or a "lite5200b" machine ?
>
> If you do the former, it will try to match on any board with that
> compatible propery, thus any mpc52xx based board. That is probably not
> what you want.
Heh, I got lazy. I'll fix this.
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* Re: [PATCH 1/1] PPC32 : Huge-page support for ppc440
From: Benjamin Herrenschmidt @ 2006-11-07 3:45 UTC (permalink / raw)
To: Roland Dreier; +Cc: linuxppc-dev, linuxppc-embedded, Edi Shmueli
In-Reply-To: <ada1wogj5s0.fsf@cisco.com>
On Mon, 2006-11-06 at 19:26 -0800, Roland Dreier wrote:
> > Also, while it's great to have somebody do this work, I doubt there is
> > much interest in merging it for arch/ppc...
>
> On that subject, what's the latest on moving ppc4xx to arch/powerpc?
> At the kernel summit you told me to chill out and wait, but I'll
> repeat my offer to help out....
Well, I told you that Matt Porter was about to do it :-) Now I haven't
heard from him since. Feel free to jump in, just make sure you keep in
sync with Josh and Matt.
One of the reason waiting was a good idea too is that we didn't have a
proper mecanism for stuffing device-trees in zImage wrappers, which we
have now.
Also, I've started doing some work around 4xx devices used on MMIO
platforms (like the Axon southbridge on Cell), and while doing that,
started moving EMAC to be an of_platform_device (or rather a set of them
since EMAC is made of multiple devices). (Based on initial work by
Shaun).
You can see some of that stuff in the big patch set I posted to the list
yesterday, though I already fixed various issues in some of those
patches, so I suppose I'll have to post a new one soon :)
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 1/1] PPC32 : Huge-page support for ppc440
From: Roland Dreier @ 2006-11-07 3:26 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linuxppc-embedded, Edi Shmueli
In-Reply-To: <1162866287.28571.392.camel@localhost.localdomain>
> Also, while it's great to have somebody do this work, I doubt there is
> much interest in merging it for arch/ppc...
On that subject, what's the latest on moving ppc4xx to arch/powerpc?
At the kernel summit you told me to chill out and wait, but I'll
repeat my offer to help out....
- R.
^ permalink raw reply
* Re: [PATCH 1/1] PPC32 : Huge-page support for ppc440
From: Benjamin Herrenschmidt @ 2006-11-07 2:24 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, Edi Shmueli, linuxppc-embedded
In-Reply-To: <1162864834.3809.21.camel@zod.rchland.ibm.com>
On Mon, 2006-11-06 at 20:00 -0600, Josh Boyer wrote:
> Hi Edi,
>
> On Mon, 2006-11-06 at 18:21 -0500, Edi Shmueli wrote:
> > From: Edi Shmueli edi@linux.vnet.ibm.com
> >
> > This patch enables applications to exploit the PPC440 TLB support for
> > huge-page mapping, to minimize TLB thrashing.
> > Applications with large memory footprint that exploit this support,
> > experience minimal TLB misses, and boost in performance.
> > NAS benchmarks performed with this patch indicate hundreds of percent of
> > improvement in performance for some application.
> > Known limitations: because each PMD covers 2MB of the process address
> > space, the minimal huge-page size supported by this patch is 2M.
> >
> > Signed-off-by: Edi Shmueli edi@linux.vnet.ibm.com
>
> Your patch is line wrapped and the whitespace has been corrupted. It's
> also against a bit older version of the kernel.
>
> Could you try to fixup these issues and resubmit? Paul's powerpc.git
> tree would probably be best to diff against.
Also, while it's great to have somebody do this work, I doubt there is
much interest in merging it for arch/ppc...
Ben.
^ permalink raw reply
* Re: [PATCH 2/5] [RFC] Add support for lite5200b to arch/powerpc
From: Benjamin Herrenschmidt @ 2006-11-07 2:04 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <11628596753992-git-send-email-grant.likely@secretlab.ca>
> +static int __init lite5200_probe(void)
> +{
> + unsigned long node = of_get_flat_dt_root();
> + const char *model = of_get_flat_dt_prop(node, "model", NULL);
> +
> + if (!of_flat_dt_is_compatible(node, "mpc52xx"))
> + return 0;
> + pr_debug("%s board w/ mpc52xx found\n", model ? model : "unknown");
> +
> + return 1;
> +}
Are you creating a "generic" mpc52xx machine or a "lite5200b" machine ?
If you do the former, it will try to match on any board with that
compatible propery, thus any mpc52xx based board. That is probably not
what you want.
Put something like model "lite5200b" compatible "lite5200" "lite5200b"
in your / and check for that. Call you board lite5200, not mpc52xx.
Ben.
^ permalink raw reply
* Re: [PATCH 1/1] PPC32 : Huge-page support for ppc440
From: Josh Boyer @ 2006-11-07 2:00 UTC (permalink / raw)
To: Edi Shmueli; +Cc: linuxppc-dev, linuxppc-embedded
In-Reply-To: <454FC362.9070608@linux.vnet.ibm.com>
Hi Edi,
On Mon, 2006-11-06 at 18:21 -0500, Edi Shmueli wrote:
> From: Edi Shmueli edi@linux.vnet.ibm.com
>
> This patch enables applications to exploit the PPC440 TLB support for
> huge-page mapping, to minimize TLB thrashing.
> Applications with large memory footprint that exploit this support,
> experience minimal TLB misses, and boost in performance.
> NAS benchmarks performed with this patch indicate hundreds of percent of
> improvement in performance for some application.
> Known limitations: because each PMD covers 2MB of the process address
> space, the minimal huge-page size supported by this patch is 2M.
>
> Signed-off-by: Edi Shmueli edi@linux.vnet.ibm.com
Your patch is line wrapped and the whitespace has been corrupted. It's
also against a bit older version of the kernel.
Could you try to fixup these issues and resubmit? Paul's powerpc.git
tree would probably be best to diff against.
josh
^ permalink raw reply
* [PATCH 4/5] Move mpc52xx-psc uart driver to of_device from platform_device
From: Grant Likely @ 2006-11-07 0:34 UTC (permalink / raw)
To: Sylvain Munaut, linuxppc-dev, Benjamin Herrenschmidt, nd
In-Reply-To: <11628596761680-git-send-email-grant.likely@secretlab.ca>
As part of the transition to arch/powerpc, this patch moves the mpc5200 PSC
driver over to the OF platform bus infrastructure.
This patch is not acceptable for mainline as-is because it breaks arch/ppc
support for the mpc52xx. More rework is needed to allow it to compile for
either arch (or alternately, fork the driver)
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
drivers/serial/mpc52xx_uart.c | 154 ++++++++++++++++++++++++++++------------
1 files changed, 108 insertions(+), 46 deletions(-)
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 29c9300..17d7934 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -42,7 +42,8 @@
* will be mapped to.
*/
-#include <linux/platform_device.h>
+#define DEBUG
+
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/serial.h>
@@ -51,6 +52,7 @@ #include <linux/console.h>
#include <asm/delay.h>
#include <asm/io.h>
+#include <asm/of_device.h>
#include <asm/mpc52xx.h>
#include <asm/mpc52xx_psc.h>
@@ -330,7 +332,7 @@ mpc52xx_uart_release_port(struct uart_po
port->membase = NULL;
}
- release_mem_region(port->mapbase, MPC52xx_PSC_SIZE);
+ release_mem_region(port->mapbase, sizeof(struct mpc52xx_psc));
}
static int
@@ -339,12 +341,13 @@ mpc52xx_uart_request_port(struct uart_po
int err;
if (port->flags & UPF_IOREMAP) /* Need to remap ? */
- port->membase = ioremap(port->mapbase, MPC52xx_PSC_SIZE);
+ port->membase = ioremap(port->mapbase,
+ sizeof(struct mpc52xx_psc));
if (!port->membase)
return -EINVAL;
- err = request_mem_region(port->mapbase, MPC52xx_PSC_SIZE,
+ err = request_mem_region(port->mapbase, sizeof(struct mpc52xx_psc),
"mpc52xx_psc_uart") != NULL ? 0 : -EBUSY;
if (err && (port->flags & UPF_IOREMAP)) {
@@ -371,7 +374,7 @@ mpc52xx_uart_verify_port(struct uart_por
if ( (ser->irq != port->irq) ||
(ser->io_type != SERIAL_IO_MEM) ||
- (ser->baud_base != port->uartclk) ||
+ (ser->baud_base != port->uartclk) ||
(ser->iomem_base != (void*)port->mapbase) ||
(ser->hub6 != 0 ) )
return -EINVAL;
@@ -561,13 +564,13 @@ mpc52xx_console_get_options(struct uart_
struct mpc52xx_psc __iomem *psc = PSC(port);
unsigned char mr1;
+ pr_debug("mpc52xx_console_get_options(port=%p)\n", port);
/* Read the mode registers */
out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
mr1 = in_8(&psc->mode);
/* CT{U,L}R are write-only ! */
- *baud = __res.bi_baudrate ?
- __res.bi_baudrate : CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD;
+ *baud = CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD;
/* Parse them */
switch (mr1 & MPC52xx_PSC_MODE_BITS_MASK) {
@@ -604,10 +607,10 @@ mpc52xx_console_write(struct console *co
for (i = 0; i < count; i++, s++) {
/* Line return handling */
if (*s == '\n')
- out_8(&psc->mpc52xx_psc_buffer_8, '\r');
+ out_8(&psc->buffer.buffer_8, '\r');
/* Send the char */
- out_8(&psc->mpc52xx_psc_buffer_8, *s);
+ out_8(&psc->buffer.buffer_8, *s);
/* Wait the TX buffer to be empty */
j = 20000; /* Maximum wait */
@@ -624,33 +627,74 @@ static int __init
mpc52xx_console_setup(struct console *co, char *options)
{
struct uart_port *port = &mpc52xx_uart_ports[co->index];
+ struct device_node *np = NULL;
+ struct device_node *np_idx;
+ const void *pp = NULL;
+ struct resource res;
+ int index = 0;
+ int ret;
int baud = CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD;
int bits = 8;
int parity = 'n';
int flow = 'n';
- if (co->index < 0 || co->index >= MPC52xx_PSC_MAXNUM)
+ pr_debug("mpc52xx_console_setup co=%p, options=%s, index=%i\n",
+ co, options, co->index);
+
+ while ((np = of_find_compatible_node(np, "serial", "mpc52xx-psc"))) {
+ if (index == co->index)
+ break;
+ index++;
+ }
+
+ if (!np) {
+ pr_debug("PSC%x not found in device tree\n", co->index);
+ return -EINVAL;
+ }
+
+ /* Fetch register locations */
+ if ((ret = of_address_to_resource(np, 0, &res)) != 0) {
+ pr_debug("Could not get resources for PSC%x\n", index);
+ return ret;
+ }
+
+ /* Search for bus-frequency property in this node or a parent */
+ np_idx = np;
+ while (np_idx) {
+ if ((pp = get_property(np_idx, "bus-frequency", NULL)) != NULL)
+ break;
+ np_idx = of_get_parent(np_idx);
+ }
+ if (!pp) {
+ pr_debug("Could not find bus-frequency property!\n");
return -EINVAL;
+ }
/* Basic port init. Needed since we use some uart_??? func before
* real init for early access */
spin_lock_init(&port->lock);
- port->uartclk = __res.bi_ipbfreq / 2; /* Look at CTLR doc */
+ port->uartclk = *(const u32*)pp / 2;
port->ops = &mpc52xx_uart_ops;
- port->mapbase = MPC52xx_PA(MPC52xx_PSCx_OFFSET(co->index+1));
+ port->mapbase = res.start;
+ port->membase = ioremap(res.start, sizeof(struct mpc52xx_psc));
+ port->irq = irq_of_parse_and_map(np, 0);
- /* We ioremap ourself */
- port->membase = ioremap(port->mapbase, MPC52xx_PSC_SIZE);
if (port->membase == NULL)
return -EINVAL;
+ pr_debug("mpc52xx_psc at %lx mapped to %p; irq=%x freq=%i\n",
+ port->mapbase, port->membase, port->irq, port->uartclk);
+
/* Setup the port parameters accoding to options */
if (options)
uart_parse_options(options, &baud, &parity, &bits, &flow);
else
mpc52xx_console_get_options(port, &baud, &parity, &bits, &flow);
+ pr_debug("Setting console parameters: %i %i%c1 flow=%c\n",
+ baud, bits, parity, flow);
+
return uart_set_options(port, co, baud, parity, bits, flow);
}
@@ -703,28 +747,23 @@ static struct uart_driver mpc52xx_uart_d
/* ======================================================================== */
static int __devinit
-mpc52xx_uart_probe(struct platform_device *dev)
+mpc52xx_uart_probe(struct of_device *op, const struct of_device_id *match)
{
- struct resource *res = dev->resource;
-
+ static int idx = 0;
struct uart_port *port = NULL;
- int i, idx, ret;
+ struct resource res;
+ int ret;
+
+ dev_dbg(&op->dev, "mpc52xx_uart_probe(op=%p, match=%p)\n", op, match);
/* Check validity & presence */
- idx = dev->id;
- if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
+ if (idx >= MPC52xx_PSC_MAXNUM)
return -EINVAL;
- if (!mpc52xx_match_psc_function(idx,"uart"))
- return -ENODEV;
-
/* Init the port structure */
port = &mpc52xx_uart_ports[idx];
- memset(port, 0x00, sizeof(struct uart_port));
-
spin_lock_init(&port->lock);
- port->uartclk = __res.bi_ipbfreq / 2; /* Look at CTLR doc */
port->fifosize = 512;
port->iotype = UPIO_MEM;
port->flags = UPF_BOOT_AUTOCONF |
@@ -733,29 +772,36 @@ mpc52xx_uart_probe(struct platform_devic
port->ops = &mpc52xx_uart_ops;
/* Search for IRQ and mapbase */
- for (i=0 ; i<dev->num_resources ; i++, res++) {
- if (res->flags & IORESOURCE_MEM)
- port->mapbase = res->start;
- else if (res->flags & IORESOURCE_IRQ)
- port->irq = res->start;
- }
- if (!port->irq || !port->mapbase)
+ if ((ret = of_address_to_resource(op->node, 0, &res)) != 0)
+ return ret;
+
+ port->mapbase = res.start;
+ port->membase = ioremap(res.start, sizeof(struct mpc52xx_psc));
+ port->irq = irq_of_parse_and_map(op->node, 0);
+
+ dev_dbg(&op->dev, "mpc52xx-psc UART at %lx. mapped to %p, irq %x\n",
+ port->mapbase, port->membase, port->irq);
+
+ //if (!port->irq || !port->mapbase) {
+ if (!port->mapbase) {
+ printk(KERN_ERR "Could not allocate resources for PSC\n");
return -EINVAL;
+ }
/* Add the port to the uart sub-system */
ret = uart_add_one_port(&mpc52xx_uart_driver, port);
if (!ret)
- platform_set_drvdata(dev, (void*)port);
+ dev_set_drvdata(&op->dev, (void*)port);
+ idx++;
return ret;
}
static int
-mpc52xx_uart_remove(struct platform_device *dev)
+mpc52xx_uart_remove(struct of_device *op)
{
- struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev);
-
- platform_set_drvdata(dev, NULL);
+ struct uart_port *port = dev_get_drvdata(&op->dev);
+ dev_set_drvdata(&op->dev, NULL);
if (port)
uart_remove_one_port(&mpc52xx_uart_driver, port);
@@ -787,7 +833,19 @@ mpc52xx_uart_resume(struct platform_devi
}
#endif
-static struct platform_driver mpc52xx_uart_platform_driver = {
+static struct of_device_id mpc52xx_uart_match[] = {
+ {
+ .name = "serial",
+ .compatible = "mpc52xx-psc",
+ },
+ {},
+};
+MODULE_DEVICE_TABLE(of, mpc52xx_uart_match);
+
+static struct of_platform_driver mpc52xx_uart_of_driver = {
+ .owner = THIS_MODULE,
+ .name = "mpc52xx-uart",
+ .match_table = mpc52xx_uart_match,
.probe = mpc52xx_uart_probe,
.remove = mpc52xx_uart_remove,
#ifdef CONFIG_PM
@@ -811,20 +869,24 @@ mpc52xx_uart_init(void)
printk(KERN_INFO "Serial: MPC52xx PSC driver\n");
- ret = uart_register_driver(&mpc52xx_uart_driver);
- if (ret == 0) {
- ret = platform_driver_register(&mpc52xx_uart_platform_driver);
- if (ret)
- uart_unregister_driver(&mpc52xx_uart_driver);
+ if ((ret = uart_register_driver(&mpc52xx_uart_driver)) != 0) {
+ printk(KERN_ERR "Could not register mpc52xx uart driver\n");
+ return ret;
+ }
+
+ if ((ret = of_register_driver(&mpc52xx_uart_of_driver)) != 0) {
+ printk(KERN_ERR "Could not register mpc52xx of driver\n");
+ uart_unregister_driver(&mpc52xx_uart_driver);
+ return ret;
}
- return ret;
+ return 0;
}
static void __exit
mpc52xx_uart_exit(void)
{
- platform_driver_unregister(&mpc52xx_uart_platform_driver);
+ of_unregister_driver(&mpc52xx_uart_of_driver);
uart_unregister_driver(&mpc52xx_uart_driver);
}
--
1.4.3.rc2.g0503
^ permalink raw reply related
* [PATCH 5/5] mpc52xx_init_irq() needs to panic() on failure
From: Grant Likely @ 2006-11-07 0:34 UTC (permalink / raw)
To: Sylvain Munaut, linuxppc-dev, Benjamin Herrenschmidt, nd
In-Reply-To: <11628596761676-git-send-email-grant.likely@secretlab.ca>
Patch also includes string changes to keep source lines under 80 chars
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/sysdev/mpc52xx_pic.c | 81 ++++++++++++++++--------------------
1 files changed, 36 insertions(+), 45 deletions(-)
diff --git a/arch/powerpc/sysdev/mpc52xx_pic.c b/arch/powerpc/sysdev/mpc52xx_pic.c
index aa4b420..42ae990 100644
--- a/arch/powerpc/sysdev/mpc52xx_pic.c
+++ b/arch/powerpc/sysdev/mpc52xx_pic.c
@@ -6,7 +6,7 @@
*
* Based on (well, mostly copied from) the code from the 2.4 kernel by
* Dale Farnsworth <dfarnsworth@mvista.com> and Kent Borg.
- *
+ *
* Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
* Copyright (C) 2003 Montavista Software, Inc
*
@@ -391,54 +391,47 @@ void __init mpc52xx_init_irq(void)
u32 intr_ctrl;
- picnode = of_find_compatible_node(NULL, "interrupt-controller", "mpc5200-pic");
- if (picnode == NULL) {
- printk(KERN_ERR "MPC52xx PIC: Unable to find the interrupt controller in the OpenFirmware device tree\n");
- goto end;
- }
+ picnode = of_find_compatible_node(NULL, "interrupt-controller",
+ "mpc5200-pic");
+ if (!picnode)
+ panic(__FILE__ ": no interrupt controller in device tree\n");
- sdmanode = of_find_compatible_node(NULL, "dma-controller", "mpc5200-bestcomm");
- if (sdmanode == NULL) {
- printk(KERN_ERR "MPC52xx PIC: Unable to find the Bestcomm DMA controller device in the OpenFirmware device tree\n");
- goto end;
- }
+ sdmanode = of_find_compatible_node(NULL, "dma-controller",
+ "mpc5200-bestcomm");
+ if (!sdmanode)
+ panic(__FILE__ ": no bestcomm DMA controller in device tree\n");
/* Retrieve PIC ressources */
picnode_regoffset = (u32) of_get_address(picnode, 0, &size64, &flags);
- if (picnode_regoffset == 0) {
- printk(KERN_ERR "MPC52xx PIC: Unable to get the interrupt controller address\n");
- goto end;
- }
+ if (!picnode_regoffset)
+ panic(__FILE__ ": cannot get interrupt controller address\n");
- picnode_regoffset = of_translate_address(picnode, (u32 *) picnode_regoffset);
- picnode_regsize = (int) size64;
+ picnode_regoffset = of_translate_address(picnode,
+ (u32*) picnode_regoffset);
+ picnode_regsize = (int) size64;
/* Retrieve SDMA ressources */
sdmanode_regoffset = (u32) of_get_address(sdmanode, 0, &size64, &flags);
- if (sdmanode_regoffset == 0) {
- printk(KERN_ERR "MPC52xx PIC: Unable to get the Bestcomm DMA controller address\n");
- goto end;
- }
+ if (!sdmanode_regoffset)
+ panic(__FILE__ ": Cannot get Bestcomm controller address\n");
- sdmanode_regoffset = of_translate_address(sdmanode, (u32 *) sdmanode_regoffset);
+ sdmanode_regoffset = of_translate_address(sdmanode,
+ (u32*)sdmanode_regoffset);
sdmanode_regsize = (int) size64;
/* Remap the necessary zones */
intr = ioremap(picnode_regoffset, picnode_regsize);
- if (intr == NULL) {
- printk(KERN_ERR "MPC52xx PIC: Unable to ioremap interrupt controller registers!");
- goto end;
- }
+ if (!intr)
+ panic(__FILE__ ": cannot ioremap pic registers!");
sdma = ioremap(sdmanode_regoffset, sdmanode_regsize);
- if (sdma == NULL) {
- iounmap(intr);
- printk(KERN_ERR "MPC52xx PIC: Unable to ioremap Bestcomm DMA controller registers!");
- goto end;
- }
+ if (!sdma)
+ panic(__FILE__ ": cannot ioremap Bestcomm registers!");
- printk(KERN_INFO "MPC52xx PIC: MPC52xx PIC Remapped at 0x%8.8x\n", picnode_regoffset);
- printk(KERN_INFO "MPC52xx PIC: MPC52xx SDMA Remapped at 0x%8.8x\n", sdmanode_regoffset);
+ printk(KERN_INFO "MPC52xx PIC: MPC52xx PIC Remapped at 0x%8.8x\n",
+ picnode_regoffset);
+ printk(KERN_INFO "MPC52xx PIC: MPC52xx SDMA Remapped at 0x%8.8x\n",
+ sdmanode_regoffset);
/* Disable all interrupt sources. */
out_be32(&sdma->IntPend, 0xffffffff); /* 1 means clear pending */
@@ -465,18 +458,16 @@ void __init mpc52xx_init_irq(void)
* hw irq information provided by the ofw to linux virq
*/
- mpc52xx_irqhost =
- irq_alloc_host(IRQ_HOST_MAP_LINEAR, MPC52xx_IRQ_HIGHTESTHWIRQ,
- &mpc52xx_irqhost_ops, -1);
+ mpc52xx_irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR,
+ MPC52xx_IRQ_HIGHTESTHWIRQ,
+ &mpc52xx_irqhost_ops, -1);
- if (mpc52xx_irqhost) {
- mpc52xx_irqhost->host_data = picnode;
- printk(KERN_INFO "MPC52xx PIC is up and running!\n");
- } else {
- printk(KERN_ERR "MPC52xx PIC: Unable to allocate the IRQ host\n");
- }
+ if (!mpc52xx_irqhost)
+ panic(__FILE__ ": Cannot allocate the IRQ host\n");
+
+ mpc52xx_irqhost->host_data = picnode;
+ printk(KERN_INFO "MPC52xx PIC is up and running!\n");
-end:
of_node_put(picnode);
of_node_put(sdmanode);
}
@@ -513,11 +504,11 @@ unsigned int mpc52xx_get_irq(void)
irq |=
(MPC52xx_IRQ_L1_SDMA << MPC52xx_IRQ_L1_OFFSET) &
MPC52xx_IRQ_L1_MASK;
- } else
+ } else {
irq |=
(MPC52xx_IRQ_L1_PERP << MPC52xx_IRQ_L1_OFFSET) &
MPC52xx_IRQ_L1_MASK;
-
+ }
}
pr_debug("%s: irq=%x. virq=%d\n", __func__, irq,
--
1.4.3.rc2.g0503
^ permalink raw reply related
* [PATCH 3/5] MPC52xx serial driver whitespace cleanup
From: Grant Likely @ 2006-11-07 0:34 UTC (permalink / raw)
To: Sylvain Munaut, linuxppc-dev, Benjamin Herrenschmidt, nd
In-Reply-To: <11628596753992-git-send-email-grant.likely@secretlab.ca>
Performed here to make the next patch (of_platform support) cleaner...
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
drivers/serial/mpc52xx_uart.c | 114 ++++++++++++++++++++---------------------
1 files changed, 56 insertions(+), 58 deletions(-)
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 4f80c5b..29c9300 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -1,6 +1,4 @@
/*
- * drivers/serial/mpc52xx_uart.c
- *
* Driver for the PSC of the Freescale MPC52xx PSCs configured as UARTs.
*
* FIXME According to the usermanual the status bits in the status register
@@ -14,18 +12,18 @@
*
*
* Maintainer : Sylvain Munaut <tnt@246tNt.com>
- *
+ *
* Some of the code has been inspired/copied from the 2.4 code written
* by Dale Farnsworth <dfarnsworth@mvista.com>.
- *
+ *
* Copyright (C) 2004-2005 Sylvain Munaut <tnt@246tNt.com>
* Copyright (C) 2003 MontaVista, Software, Inc.
- *
+ *
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied.
*/
-
+
/* Platform device Usage :
*
* Since PSCs can have multiple function, the correct driver for each one
@@ -101,27 +99,27 @@ #endif
/* UART operations */
/* ======================================================================== */
-static unsigned int
+static unsigned int
mpc52xx_uart_tx_empty(struct uart_port *port)
{
int status = in_be16(&PSC(port)->mpc52xx_psc_status);
return (status & MPC52xx_PSC_SR_TXEMP) ? TIOCSER_TEMT : 0;
}
-static void
+static void
mpc52xx_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
/* Not implemented */
}
-static unsigned int
+static unsigned int
mpc52xx_uart_get_mctrl(struct uart_port *port)
{
/* Not implemented */
return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
}
-static void
+static void
mpc52xx_uart_stop_tx(struct uart_port *port)
{
/* port->lock taken by caller */
@@ -129,7 +127,7 @@ mpc52xx_uart_stop_tx(struct uart_port *p
out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
}
-static void
+static void
mpc52xx_uart_start_tx(struct uart_port *port)
{
/* port->lock taken by caller */
@@ -137,12 +135,12 @@ mpc52xx_uart_start_tx(struct uart_port *
out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
}
-static void
+static void
mpc52xx_uart_send_xchar(struct uart_port *port, char ch)
{
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
-
+
port->x_char = ch;
if (ch) {
/* Make sure tx interrupts are on */
@@ -150,7 +148,7 @@ mpc52xx_uart_send_xchar(struct uart_port
port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
}
-
+
spin_unlock_irqrestore(&port->lock, flags);
}
@@ -178,7 +176,7 @@ mpc52xx_uart_break_ctl(struct uart_port
out_8(&PSC(port)->command,MPC52xx_PSC_START_BRK);
else
out_8(&PSC(port)->command,MPC52xx_PSC_STOP_BRK);
-
+
spin_unlock_irqrestore(&port->lock, flags);
}
@@ -197,11 +195,11 @@ mpc52xx_uart_startup(struct uart_port *p
/* Reset/activate the port, clear and enable interrupts */
out_8(&psc->command,MPC52xx_PSC_RST_RX);
out_8(&psc->command,MPC52xx_PSC_RST_TX);
-
+
out_be32(&psc->sicr,0); /* UART mode DCD ignored */
out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00); /* /16 prescaler on */
-
+
out_8(&psc->rfcntl, 0x00);
out_be16(&psc->rfalarm, 0x1ff);
out_8(&psc->tfcntl, 0x07);
@@ -209,10 +207,10 @@ mpc52xx_uart_startup(struct uart_port *p
port->read_status_mask |= MPC52xx_PSC_IMR_RXRDY | MPC52xx_PSC_IMR_TXRDY;
out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
-
+
out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
-
+
return 0;
}
@@ -220,19 +218,19 @@ static void
mpc52xx_uart_shutdown(struct uart_port *port)
{
struct mpc52xx_psc __iomem *psc = PSC(port);
-
+
/* Shut down the port, interrupt and all */
out_8(&psc->command,MPC52xx_PSC_RST_RX);
out_8(&psc->command,MPC52xx_PSC_RST_TX);
-
- port->read_status_mask = 0;
+
+ port->read_status_mask = 0;
out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
/* Release interrupt */
free_irq(port->irq, port);
}
-static void
+static void
mpc52xx_uart_set_termios(struct uart_port *port, struct termios *new,
struct termios *old)
{
@@ -241,10 +239,10 @@ mpc52xx_uart_set_termios(struct uart_por
unsigned char mr1, mr2;
unsigned short ctr;
unsigned int j, baud, quot;
-
+
/* Prepare what we're gonna write */
mr1 = 0;
-
+
switch (new->c_cflag & CSIZE) {
case CS5: mr1 |= MPC52xx_PSC_MODE_5_BITS;
break;
@@ -261,8 +259,8 @@ mpc52xx_uart_set_termios(struct uart_por
MPC52xx_PSC_MODE_PARODD : MPC52xx_PSC_MODE_PAREVEN;
} else
mr1 |= MPC52xx_PSC_MODE_PARNONE;
-
-
+
+
mr2 = 0;
if (new->c_cflag & CSTOPB)
@@ -276,7 +274,7 @@ mpc52xx_uart_set_termios(struct uart_por
baud = uart_get_baud_rate(port, new, old, 0, port->uartclk/16);
quot = uart_get_divisor(port, baud);
ctr = quot & 0xffff;
-
+
/* Get the lock */
spin_lock_irqsave(&port->lock, flags);
@@ -290,14 +288,14 @@ mpc52xx_uart_set_termios(struct uart_por
* boot for the console, all stuff is not yet ready to receive at that
* time and that just makes the kernel oops */
/* while (j-- && mpc52xx_uart_int_rx_chars(port)); */
- while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXEMP) &&
+ while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXEMP) &&
--j)
udelay(1);
if (!j)
printk( KERN_ERR "mpc52xx_uart.c: "
"Unable to flush RX & TX fifos in-time in set_termios."
- "Some chars may have been lost.\n" );
+ "Some chars may have been lost.\n" );
/* Reset the TX & RX */
out_8(&psc->command,MPC52xx_PSC_RST_RX);
@@ -309,7 +307,7 @@ mpc52xx_uart_set_termios(struct uart_por
out_8(&psc->mode,mr2);
out_8(&psc->ctur,ctr >> 8);
out_8(&psc->ctlr,ctr & 0xff);
-
+
/* Reenable TX & RX */
out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
@@ -373,7 +371,7 @@ mpc52xx_uart_verify_port(struct uart_por
if ( (ser->irq != port->irq) ||
(ser->io_type != SERIAL_IO_MEM) ||
- (ser->baud_base != port->uartclk) ||
+ (ser->baud_base != port->uartclk) ||
(ser->iomem_base != (void*)port->mapbase) ||
(ser->hub6 != 0 ) )
return -EINVAL;
@@ -404,11 +402,11 @@ static struct uart_ops mpc52xx_uart_ops
.verify_port = mpc52xx_uart_verify_port
};
-
+
/* ======================================================================== */
/* Interrupt handling */
/* ======================================================================== */
-
+
static inline int
mpc52xx_uart_int_rx_chars(struct uart_port *port)
{
@@ -435,11 +433,11 @@ #endif
flag = TTY_NORMAL;
port->icount.rx++;
-
+
if ( status & (MPC52xx_PSC_SR_PE |
MPC52xx_PSC_SR_FE |
MPC52xx_PSC_SR_RB) ) {
-
+
if (status & MPC52xx_PSC_SR_RB) {
flag = TTY_BREAK;
uart_handle_break(port);
@@ -464,7 +462,7 @@ #endif
}
tty_flip_buffer_push(tty);
-
+
return in_be16(&PSC(port)->mpc52xx_psc_status) & MPC52xx_PSC_SR_RXRDY;
}
@@ -509,25 +507,25 @@ mpc52xx_uart_int_tx_chars(struct uart_po
return 1;
}
-static irqreturn_t
+static irqreturn_t
mpc52xx_uart_int(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
unsigned long pass = ISR_PASS_LIMIT;
unsigned int keepgoing;
unsigned short status;
-
+
spin_lock(&port->lock);
-
+
/* While we have stuff to do, we continue */
do {
/* If we don't find anything to do, we stop */
- keepgoing = 0;
-
+ keepgoing = 0;
+
/* Read status */
status = in_be16(&PSC(port)->mpc52xx_psc_isr);
status &= port->read_status_mask;
-
+
/* Do we need to receive chars ? */
/* For this RX interrupts must be on and some chars waiting */
if ( status & MPC52xx_PSC_IMR_RXRDY )
@@ -537,15 +535,15 @@ mpc52xx_uart_int(int irq, void *dev_id)
/* For this, TX must be ready and TX interrupt enabled */
if ( status & MPC52xx_PSC_IMR_TXRDY )
keepgoing |= mpc52xx_uart_int_tx_chars(port);
-
+
/* Limit number of iteration */
if ( !(--pass) )
keepgoing = 0;
} while (keepgoing);
-
+
spin_unlock(&port->lock);
-
+
return IRQ_HANDLED;
}
@@ -566,7 +564,7 @@ mpc52xx_console_get_options(struct uart_
/* Read the mode registers */
out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
mr1 = in_8(&psc->mode);
-
+
/* CT{U,L}R are write-only ! */
*baud = __res.bi_baudrate ?
__res.bi_baudrate : CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD;
@@ -579,26 +577,26 @@ mpc52xx_console_get_options(struct uart_
case MPC52xx_PSC_MODE_8_BITS:
default: *bits = 8;
}
-
+
if (mr1 & MPC52xx_PSC_MODE_PARNONE)
*parity = 'n';
else
*parity = mr1 & MPC52xx_PSC_MODE_PARODD ? 'o' : 'e';
}
-static void
+static void
mpc52xx_console_write(struct console *co, const char *s, unsigned int count)
{
struct uart_port *port = &mpc52xx_uart_ports[co->index];
struct mpc52xx_psc __iomem *psc = PSC(port);
unsigned int i, j;
-
+
/* Disable interrupts */
out_be16(&psc->mpc52xx_psc_imr, 0);
/* Wait the TX buffer to be empty */
- j = 5000000; /* Maximum wait */
- while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXEMP) &&
+ j = 5000000; /* Maximum wait */
+ while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXEMP) &&
--j)
udelay(1);
@@ -607,13 +605,13 @@ mpc52xx_console_write(struct console *co
/* Line return handling */
if (*s == '\n')
out_8(&psc->mpc52xx_psc_buffer_8, '\r');
-
+
/* Send the char */
out_8(&psc->mpc52xx_psc_buffer_8, *s);
/* Wait the TX buffer to be empty */
- j = 20000; /* Maximum wait */
- while (!(in_be16(&psc->mpc52xx_psc_status) &
+ j = 20000; /* Maximum wait */
+ while (!(in_be16(&psc->mpc52xx_psc_status) &
MPC52xx_PSC_SR_TXEMP) && --j)
udelay(1);
}
@@ -634,7 +632,7 @@ mpc52xx_console_setup(struct console *co
if (co->index < 0 || co->index >= MPC52xx_PSC_MAXNUM)
return -EINVAL;
-
+
/* Basic port init. Needed since we use some uart_??? func before
* real init for early access */
spin_lock_init(&port->lock);
@@ -669,8 +667,8 @@ static struct console mpc52xx_console =
.data = &mpc52xx_uart_driver,
};
-
-static int __init
+
+static int __init
mpc52xx_console_init(void)
{
register_console(&mpc52xx_console);
--
1.4.3.rc2.g0503
^ permalink raw reply related
* [PATCH 2/5] [RFC] Add support for lite5200b to arch/powerpc
From: Grant Likely @ 2006-11-07 0:34 UTC (permalink / raw)
To: Sylvain Munaut, linuxppc-dev, Benjamin Herrenschmidt, nd
In-Reply-To: <11628596751096-git-send-email-grant.likely@secretlab.ca>
Here is an inital attempt at porting the lite5200b to arch/powerpc.
Can boot to login prompt with this patch. However, it probably breaks
stuff and there are things missing (like PCI support)
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/embedded6xx/Makefile | 1 +
arch/powerpc/platforms/embedded6xx/lite5200.c | 163 +++++++++++++++++++++++++
include/asm-ppc/io.h | 2 -
3 files changed, 164 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile
index fa499fe..a33f34d 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -2,3 +2,4 @@ #
# Makefile for the 6xx/7xx/7xxxx linux kernel.
#
obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o
+obj-$(CONFIG_LITE5200) += lite5200.o
diff --git a/arch/powerpc/platforms/embedded6xx/lite5200.c b/arch/powerpc/platforms/embedded6xx/lite5200.c
new file mode 100644
index 0000000..2c7d60f
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/lite5200.c
@@ -0,0 +1,163 @@
+/*
+ * Freescale Lite5200 board support
+ *
+ * Written by: Grant Likely <grant.likely@secretlab.ca>
+ *
+ * Copyright (C) Secret Lab Technologies Ltd. 2006. All rights reserved.
+ * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved.
+ *
+ * Description:
+ * 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.
+ */
+
+#undef DEBUG
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/reboot.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/seq_file.h>
+#include <linux/root_dev.h>
+#include <linux/initrd.h>
+
+#include <asm/system.h>
+#include <asm/atomic.h>
+#include <asm/time.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/ipic.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <sysdev/fsl_soc.h>
+#include <asm/qe.h>
+#include <asm/qe_ic.h>
+#include <asm/of_device.h>
+
+#include <asm/mpc52xx.h>
+
+#ifndef CONFIG_PCI
+unsigned long isa_io_base = 0;
+unsigned long isa_mem_base = 0;
+#endif
+
+/* ************************************************************************
+ *
+ * Setup the architecture
+ *
+ */
+
+static int __init mpc52xx_declare_of_platform_devices(void)
+{
+ struct device_node *np;
+ struct device_node *cnp = NULL;
+ const u32 *base;
+ char *name;
+
+ /* Find every child of the SOC node and add it to of_platform */
+ np = of_find_node_by_name(NULL, "soc5200");
+ if (np) {
+ while ((cnp = of_get_next_child(np, cnp))) {
+ name = kmalloc(BUS_ID_SIZE, GFP_KERNEL);
+ strcpy(name, cnp->name);
+
+ base = get_property(cnp, "reg", NULL);
+ if (base)
+ sprintf(name+strlen(name), "@%x", *base);
+
+ of_platform_device_create(cnp, name, NULL);
+ }
+ }
+
+ return 0;
+}
+
+device_initcall(mpc52xx_declare_of_platform_devices);
+
+static void __init lite5200_setup_arch(void)
+{
+ struct device_node *np;
+
+ if (ppc_md.progress)
+ ppc_md.progress("lite5200_setup_arch()", 0);
+
+ np = of_find_node_by_type(NULL, "cpu");
+ if (np) {
+ unsigned int *fp =
+ (int *)get_property(np, "clock-frequency", NULL);
+ if (fp != 0)
+ loops_per_jiffy = *fp / HZ;
+ else
+ loops_per_jiffy = 50000000 / HZ;
+ of_node_put(np);
+ }
+
+#if 0 // was #ifdef CONFIG_PCI
+ for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
+ add_bridge(np);
+
+ ppc_md.pci_swizzle = common_swizzle;
+ ppc_md.pci_exclude_device = mpc52xx_exclude_device;
+#endif
+
+#ifdef CONFIG_BLK_DEV_INITRD
+ if (initrd_start)
+ ROOT_DEV = Root_RAM0;
+ else
+#endif
+#ifdef CONFIG_ROOT_NFS
+ ROOT_DEV = Root_NFS;
+#else
+ ROOT_DEV = Root_HDA1;
+#endif
+
+}
+
+void lite5200_show_cpuinfo(struct seq_file *m)
+{
+ struct device_node* np = of_find_all_nodes(NULL);
+ const char *model = NULL;
+
+ if (np)
+ model = get_property(np, "model", NULL);
+
+ seq_printf(m, "vendor\t\t: Freescale Semiconductor\n");
+ seq_printf(m, "machine\t\t: %s\n", model ? model : "unknown");
+
+ of_node_put(np);
+}
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init lite5200_probe(void)
+{
+ unsigned long node = of_get_flat_dt_root();
+ const char *model = of_get_flat_dt_prop(node, "model", NULL);
+
+ if (!of_flat_dt_is_compatible(node, "mpc52xx"))
+ return 0;
+ pr_debug("%s board w/ mpc52xx found\n", model ? model : "unknown");
+
+ return 1;
+}
+
+define_machine(mpc52xx) {
+ .name = "mpc52xx",
+ .probe = lite5200_probe,
+ .setup_arch = lite5200_setup_arch,
+ .init_IRQ = mpc52xx_init_irq,
+ .get_irq = mpc52xx_get_irq,
+ .show_cpuinfo = lite5200_show_cpuinfo,
+ .calibrate_decr = generic_calibrate_decr,
+};
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index a4c411b..66b93de 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -26,8 +26,6 @@ #define PREP_PCI_DRAM_OFFSET 0x80000000
#if defined(CONFIG_4xx)
#include <asm/ibm4xx.h>
-#elif defined(CONFIG_PPC_MPC52xx)
-#include <asm/mpc52xx.h>
#elif defined(CONFIG_8xx)
#include <asm/mpc8xx.h>
#elif defined(CONFIG_8260)
--
1.4.3.rc2.g0503
^ permalink raw reply related
* [RFC] Lite5200(b) arch/powerpc patchset
From: Grant Likely @ 2006-11-07 0:34 UTC (permalink / raw)
To: Sylvain Munaut, linuxppc-dev, Benjamin Herrenschmidt, nd
Here is a patch set adding support for the Lite5200 eval board in
arch/powerpc. There are definately things missing/broken in here,
but I can boot to promplt with this patchset. Plus, I'm fishing for
feedback. :)
These patches depend on Nicolas' mpc52xx-pic patches
^ permalink raw reply
* [PATCH 1/5] Add Lite5200B device tree
From: Grant Likely @ 2006-11-07 0:34 UTC (permalink / raw)
To: Sylvain Munaut, linuxppc-dev, Benjamin Herrenschmidt, nd
In-Reply-To: <11628596653052-git-send-email-grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/boot/dts/lite5200b.dts | 275 +++++++++++++++++++++++++++++++++++
1 files changed, 275 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts
new file mode 100644
index 0000000..eff10b7
--- /dev/null
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -0,0 +1,275 @@
+/*
+ * Lite5200b board Device Tree Source
+ *
+ * Copyright 2006 Secret Lab Technologies Ltd.
+ * Grant Likely <grant.likely@secretlab.ca>
+ *
+ * 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.
+ */
+
+/ {
+ model = "Lite5200b";
+ compatible = "mpc5200b\0mpc52xx";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ cpus {
+ #cpus = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ PowerPC,5200@0 {
+ device_type = "cpu";
+ reg = <0>;
+ d-cache-line-size = <20>;
+ i-cache-line-size = <20>;
+ d-cache-size = <4000>; // L1, 16K
+ i-cache-size = <4000>; // L1, 16K
+ timebase-frequency = <0>; // from bootloader
+ bus-frequency = <0>; // from bootloader
+ clock-frequency = <0>; // from bootloader
+ 32-bit;
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <00000000 10000000>; // 256MB
+ };
+
+ soc5200@f0000000 {
+ #interrupt-cells = <3>;
+ device_type = "soc";
+ ranges = <0 f0000000 f0010000>;
+ reg = <f0000000 00010000>;
+ bus-frequency = <0>; // from bootloader
+
+ pic@500 {
+ // 5200 interrupts are encoded into two levels;
+ // Level 1 is 2 bits; [CRIT=0,MAIN=1,PERF=2,SDMA=3]
+ // Level 2 is 6 bits
+ // The levels are encoded into the lower byte of
+ // a single cell; // in binary: 1122 2222
+ linux,phandle = <500>;
+ interrupt-controller;
+ #interrupt-cells = <3>;
+ device_type = "interrupt-controller";
+ compatible = "mpc5200b-pic\0mpc5200-pic\0mpc52xx-pic";
+ reg = <500 80>;
+ built-in;
+ };
+
+ gpt@600 { // General Purpose Timer
+ compatible = "mpc5200b-gpt\0mpc52xx-gpt";
+ device_type = "gpt";
+ reg = <600 10>;
+ interrupts = <1 9 2>;
+ interrupt-parent = <500>;
+ };
+
+ gpt@610 { // General Purpose Timer
+ compatible = "mpc5200b-gpt\0mpc52xx-gpt";
+ device_type = "gpt";
+ reg = <610 10>;
+ interrupts = <1 a 2>;
+ interrupt-parent = <500>;
+ };
+
+ gpt@620 { // General Purpose Timer
+ compatible = "mpc5200b-gpt\0mpc52xx-gpt";
+ device_type = "gpt";
+ reg = <620 10>;
+ interrupts = <1 b 2>;
+ interrupt-parent = <500>;
+ };
+
+ gpt@630 { // General Purpose Timer
+ compatible = "mpc5200b-gpt\0mpc52xx-gpt";
+ device_type = "gpt";
+ reg = <630 10>;
+ interrupts = <1 c 2>;
+ interrupt-parent = <500>;
+ };
+
+ gpt@640 { // General Purpose Timer
+ compatible = "mpc5200b-gpt\0mpc52xx-gpt";
+ device_type = "gpt";
+ reg = <640 10>;
+ interrupts = <1 d 2>;
+ interrupt-parent = <500>;
+ };
+
+ gpt@650 { // General Purpose Timer
+ compatible = "mpc5200b-gpt\0mpc52xx-gpt";
+ device_type = "gpt";
+ reg = <650 10>;
+ interrupts = <1 e 2>;
+ interrupt-parent = <500>;
+ };
+
+ gpt@660 { // General Purpose Timer
+ compatible = "mpc5200b-gpt\0mpc52xx-gpt";
+ device_type = "gpt";
+ reg = <660 10>;
+ interrupts = <1 f 2>;
+ interrupt-parent = <500>;
+ };
+
+ gpt@670 { // General Purpose Timer
+ compatible = "mpc5200b-gpt\0mpc52xx-gpt";
+ device_type = "gpt";
+ reg = <670 10>;
+ interrupts = <1 10 2>;
+ interrupt-parent = <500>;
+ };
+
+ rtc@800 { // Real time clock
+ compatible = "mpc5200b-rtc\0mpc52xx-rtc";
+ device_type = "rtc";
+ reg = <800 100>;
+ interrupts = <1 5 2 1 6 2>;
+ interrupt-parent = <500>;
+ };
+
+ mscan@900 {
+ device_type = "mscan";
+ compatible = "mpc5200b-mscan\0mpc52xx-mscan";
+ interrupts = <2 11 2>;
+ interrupt-parent = <500>;
+ reg = <900 80>;
+ };
+
+ mscan@980 {
+ device_type = "mscan";
+ compatible = "mpc5200b-mscan\0mpc52xx-mscan";
+ interrupts = <1 12 2>;
+ interrupt-parent = <500>;
+ reg = <980 80>;
+ };
+
+ pci@0d00 {
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ device_type = "pci";
+ compatible = "mpc5200b-pci\0mpc52xx-pci";
+ // I actually know very little about setting up PCI,
+ // so anything here would just be pulled out of my
+ // butt. Instead I'll leave these placeholders until
+ // I figure out what it should be
+ //
+ // interrupt-map-mask = <>;
+ // interrupt-map = <>;
+ // bus-range = <>;
+ // ranges = <>;
+ //
+ clock-frequency = <3f940aa>;
+ interrupts = <2 8 2 2 9 2 2 a 2>;
+ interrupt-parent = <500>;
+ };
+
+ spi@f00 {
+ device_type = "spi";
+ compatible = "mpc5200b-spi\0mpc52xx-spi";
+ reg = <f00 20>;
+ interrupts = <2 d 2 2 e 2>;
+ interrupt-parent = <500>;
+ };
+
+ bestcomm@1200 {
+ device_type = "dma-controller";
+ compatible = "mpc5200b-bestcomm\0mpc5200-bestcomm\0mpc52xx-bestcomm";
+ reg = <1200 80>;
+ };
+
+ serial@2000 { // PSC1
+ device_type = "serial";
+ compatible = "mpc5200b-psc-serial\0mpc52xx-psc-serial";
+ port-number = <0>; // Logical port assignment
+ reg = <2000 100>;
+ interrupts = <2 1 2>;
+ interrupt-parent = <500>;
+ };
+
+ // PSC2 in spi mode example
+ spi@2200 { // PSC2
+ device_type = "spi";
+ compatible = "mpc5200b-psc-spi\0mpc52xx-psc-spi";
+ reg = <2200 100>;
+ interrupts = <2 2 2>;
+ interrupt-parent = <500>;
+ };
+
+ // PSC3 in CODEC mode example
+ i2s@2400 { // PSC3
+ device_type = "i2s";
+ compatible = "mpc5200b-psc-i2s\0mpc52xx-psc-i2s";
+ reg = <2400 100>;
+ interrupts = <2 3 2>;
+ interrupt-parent = <500>;
+ };
+
+ // PSC4 unconfigured
+ //serial@2600 { // PSC4
+ // device_type = "serial";
+ // compatible = "mpc5200b-psc-serial\0mpc52xx-psc-serial";
+ // reg = <2600 100>;
+ // interrupts = <2 b 2>;
+ // interrupt-parent = <500>;
+ //};
+
+ // PSC5 unconfigured
+ //serial@2800 { // PSC5
+ // device_type = "serial";
+ // compatible = "mpc5200b-psc-serial\0mpc52xx-psc-serial";
+ // reg = <2800 100>;
+ // interrupts = <2 c 2>;
+ // interrupt-parent = <500>;
+ //};
+
+ // PSC6 in AC97 mode example
+ ac97@2c00 { // PSC6
+ device_type = "ac97";
+ compatible = "mpc5200b-psc-ac97\0mpc52xx-psc-ac97";
+ reg = <2c00 100>;
+ interrupts = <2 4 2>;
+ interrupt-parent = <500>;
+ };
+
+ ethernet@3000 {
+ device_type = "network";
+ compatible = "mpc5200b-fec\0mpc52xx-fec";
+ reg = <3000 800>;
+ mac-address = [ 02 03 04 05 06 07 ]; // Bad!
+ interrupts = <2 5 2>;
+ interrupt-parent = <500>;
+ };
+
+ ata@3a00 {
+ device_type = "ata";
+ compatible = "mpc5200b-ata\0mpc52xx-ata";
+ reg = <3a00 100>;
+ interrupts = <2 7 2>;
+ interrupt-parent = <500>;
+ };
+
+ i2c@3d00 {
+ device_type = "i2c";
+ compatible = "mpc5200b-i2c\0mpc52xx-i2c";
+ reg = <3d00 40>;
+ interrupts = <2 f 2>;
+ interrupt-parent = <500>;
+ };
+
+ i2c@3d40 {
+ device_type = "i2c";
+ compatible = "mpc5200b-i2c\0mpc52xx-i2c";
+ reg = <3d40 40>;
+ interrupts = <2 10 2>;
+ interrupt-parent = <500>;
+ };
+ };
+};
--
1.4.3.rc2.g0503
^ permalink raw reply related
* 2 problems with the i2c-mpc.c driver
From: Joakim Tjernlund @ 2006-11-07 0:20 UTC (permalink / raw)
To: linuxppc-dev
1) Master I2C address
Can't find how/where the controllers master I2C address is set.
Seems like it is inherited from whatever the boot(u-boot in this case)
was using. Seems a bit fragile to me.
2) Disturbance disables the I2C controller.
Noticed that a disturbance on the I2C bus sometimes disables the
the controller, will only recover after a reboot.
Adding the following seems to cure the problem:
static void mpc_i2c_start(struct mpc_i2c *i2c)
{
/* Clear arbitration */
writeb(0, i2c->base + MPC_I2C_SR);
+ writeccr(i2c, 0);
+ udelay(5);
/* Start with MEN */
writeccr(i2c, CCR_MEN);
}
I don't this this is the right fix, since it introduces an delay of 5 us.
Any ideas?
Jocke
^ permalink raw reply
* ethernet interface problem with kernel 2.6.14 on MPC8343E
From: Luong Ngo @ 2006-11-07 0:14 UTC (permalink / raw)
To: linuxppc-dev list
In-Reply-To: <1b2aacd80611061551t78cc4f1aoef66377e82c2daed@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 805 bytes --]
Hello,
I am having a problem with the interfaces eth0 and eth1 when running
2.6.14kernel on a board with MPC8343E. The problem I encounters is
only one of the
eth interface is really working. Only the one that is configured first,
using "ifconfig eth[0/1] 192.168.1.1 netmask 255.255.255.0" can ping and be
pinged from another host. I wonder if there is setup difference between the
TSEC1 and TSEC2 or this is not related to hardware but rather something in
the kernel. When I ping from other host, from within the Gianfar driver, I
can see the packet is received on both interfaces but only one responds.
When pinging from the system itself, only the working interface sending out
packet, the other interface does not send anything. Please advise me what I
am doing wrong or missing.
Thank you,
L. Ngo
[-- Attachment #2: Type: text/html, Size: 1082 bytes --]
^ permalink raw reply
* mpc83xx_spi driver for mpc832x?
From: Joakim Tjernlund @ 2006-11-07 0:09 UTC (permalink / raw)
To: linuxppc-dev
[Resending as it seems like my first mail got lost]
Anyone working on extending the mpc83xx_spi driver to support
mpc832x? I don't think the current one supports either "cpu" mode
or "quicc" mode.
Jocke
^ permalink raw reply
* Re: [PATCH] of_irq_to_resource now returns the virq
From: Benjamin Herrenschmidt @ 2006-11-07 0:04 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.61.0611061711510.10818@ld0175-tx32.am.freescale.net>
On Mon, 2006-11-06 at 17:13 -0600, Andy Fleming wrote:
> Mostly this is to allow for error checking (check the return for NO_IRQ)
>
> Signed-off-by: Andrew Fleming <afleming@freescale.com>
> ---
> For 2.6.20
>
> include/asm-powerpc/prom.h | 13 ++++++++++---
> 1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
> index 933ba27..e9226e3 100644
> --- a/include/asm-powerpc/prom.h
> +++ b/include/asm-powerpc/prom.h
> @@ -334,10 +334,17 @@ extern int of_irq_map_one(struct device_
> struct pci_dev;
> extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
>
> -static inline void of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
> +static inline int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
> {
> - r->start = r->end = irq_of_parse_and_map(dev, index);
> - r->flags = IORESOURCE_IRQ;
> + int irq = irq_of_parse_and_map(dev, index);
> +
> + /* Only dereference the resource if the irq is valid. */
> + if (irq != NO_IRQ) {
What about if (irq != NO_IRQ && r) ?
> + r->start = r->end = irq;
> + r->flags = IORESOURCE_IRQ;
> + }
> +
> + return irq;
> }
That way, if somebody doesn't care about the resource, just pass NULL,
though I suppose we should then also change the name of the function to
something like of_map_one_irq() ..
Ben.
^ permalink raw reply
* Re: [PATCH 2.6.19 1/4] ehca: assure 4k alignment for firmware control block in 64k page mode
From: Hoang-Nam Ngyuen @ 2006-11-06 23:56 UTC (permalink / raw)
To: Arnd Bergmann, rolandd; +Cc: linuxppc-dev, raisch, linux-kernel, openib-general
In-Reply-To: <200611062235.28667.arnd@arndb.de>
> The point Heiko made in his comment is that with ehca_alloc_fw_ctrlblock
> returning a void*, you can (and _should_) remove the casts to other
> pointer types.
Hm, my bad. Should not happen that I totally ignored the whole sentence
from Heiko.
Roland, please throw the previous away. Here is eventually/hopefully
the proper one.
Thanks
Nam
This is a patch of ehca that assures 4k alignment for firmware control block
in 64k page mode, because kzalloc()'s result address might not be 4k aligned
if kernel's 64k page is enabled. Thus, we introduced wrappers called
ehca_alloc/free_fw_ctrlblock(), which use a slab cache for objects with
4k length and 4k alignment in order to alloc/free firmware control blocks
in 64k page mode. In 4k page mode those wrappers just are defines of
get_zeroed_page() and free_page().
Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
---
ehca_hca.c | 17 +++++++++--------
ehca_irq.c | 17 ++++++++---------
ehca_iverbs.h | 8 ++++++++
ehca_main.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++---------
ehca_mrmw.c | 8 ++++----
ehca_qp.c | 10 +++++-----
6 files changed, 81 insertions(+), 35 deletions(-)
diff -Nurp roland_git_orig/drivers/infiniband/hw/ehca/ehca_hca.c roland_git_work/drivers/infiniband/hw/ehca/ehca_hca.c
--- roland_git_orig/drivers/infiniband/hw/ehca/ehca_hca.c 2006-11-02 10:47:04.000000000 +0100
+++ roland_git_work/drivers/infiniband/hw/ehca/ehca_hca.c 2006-11-07 00:03:03.000000000 +0100
@@ -40,6 +40,7 @@
*/
#include "ehca_tools.h"
+#include "ehca_iverbs.h"
#include "hcp_if.h"
int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
@@ -49,7 +50,7 @@ int ehca_query_device(struct ib_device *
ib_device);
struct hipz_query_hca *rblock;
- rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ rblock = ehca_alloc_fw_ctrlblock();
if (!rblock) {
ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
return -ENOMEM;
@@ -96,7 +97,7 @@ int ehca_query_device(struct ib_device *
= min_t(int, rblock->max_total_mcast_qp_attach, INT_MAX);
query_device1:
- kfree(rblock);
+ ehca_free_fw_ctrlblock(rblock);
return ret;
}
@@ -109,7 +110,7 @@ int ehca_query_port(struct ib_device *ib
ib_device);
struct hipz_query_port *rblock;
- rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ rblock = ehca_alloc_fw_ctrlblock();
if (!rblock) {
ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
return -ENOMEM;
@@ -162,7 +163,7 @@ int ehca_query_port(struct ib_device *ib
props->active_speed = 0x1;
query_port1:
- kfree(rblock);
+ ehca_free_fw_ctrlblock(rblock);
return ret;
}
@@ -178,7 +179,7 @@ int ehca_query_pkey(struct ib_device *ib
return -EINVAL;
}
- rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ rblock = ehca_alloc_fw_ctrlblock();
if (!rblock) {
ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
return -ENOMEM;
@@ -193,7 +194,7 @@ int ehca_query_pkey(struct ib_device *ib
memcpy(pkey, &rblock->pkey_entries + index, sizeof(u16));
query_pkey1:
- kfree(rblock);
+ ehca_free_fw_ctrlblock(rblock);
return ret;
}
@@ -211,7 +212,7 @@ int ehca_query_gid(struct ib_device *ibd
return -EINVAL;
}
- rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ rblock = ehca_alloc_fw_ctrlblock();
if (!rblock) {
ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
return -ENOMEM;
@@ -227,7 +228,7 @@ int ehca_query_gid(struct ib_device *ibd
memcpy(&gid->raw[8], &rblock->guid_entries[index], sizeof(u64));
query_gid1:
- kfree(rblock);
+ ehca_free_fw_ctrlblock(rblock);
return ret;
}
diff -Nurp roland_git_orig/drivers/infiniband/hw/ehca/ehca_irq.c roland_git_work/drivers/infiniband/hw/ehca/ehca_irq.c
--- roland_git_orig/drivers/infiniband/hw/ehca/ehca_irq.c 2006-11-02 10:47:04.000000000 +0100
+++ roland_git_work/drivers/infiniband/hw/ehca/ehca_irq.c 2006-11-07 00:03:03.000000000 +0100
@@ -45,6 +45,7 @@
#include "ehca_tools.h"
#include "hcp_if.h"
#include "hipz_fns.h"
+#include "ipz_pt_fn.h"
#define EQE_COMPLETION_EVENT EHCA_BMASK_IBM(1,1)
#define EQE_CQ_QP_NUMBER EHCA_BMASK_IBM(8,31)
@@ -137,38 +138,36 @@ int ehca_error_data(struct ehca_shca *sh
u64 *rblock;
unsigned long block_count;
- rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ rblock = ehca_alloc_fw_ctrlblock();
if (!rblock) {
ehca_err(&shca->ib_device, "Cannot allocate rblock memory.");
ret = -ENOMEM;
goto error_data1;
}
+ /* rblock must be 4K aligned and should be 4K large */
ret = hipz_h_error_data(shca->ipz_hca_handle,
resource,
rblock,
&block_count);
- if (ret == H_R_STATE) {
+ if (ret == H_R_STATE)
ehca_err(&shca->ib_device,
"No error data is available: %lx.", resource);
- }
else if (ret == H_SUCCESS) {
int length;
length = EHCA_BMASK_GET(ERROR_DATA_LENGTH, rblock[0]);
- if (length > PAGE_SIZE)
- length = PAGE_SIZE;
+ if (length > EHCA_PAGESIZE)
+ length = EHCA_PAGESIZE;
print_error_data(shca, data, rblock, length);
- }
- else {
+ } else
ehca_err(&shca->ib_device,
"Error data could not be fetched: %lx", resource);
- }
- kfree(rblock);
+ ehca_free_fw_ctrlblock(rblock);
error_data1:
return ret;
diff -Nurp roland_git_orig/drivers/infiniband/hw/ehca/ehca_iverbs.h roland_git_work/drivers/infiniband/hw/ehca/ehca_iverbs.h
--- roland_git_orig/drivers/infiniband/hw/ehca/ehca_iverbs.h 2006-11-02 10:47:04.000000000 +0100
+++ roland_git_work/drivers/infiniband/hw/ehca/ehca_iverbs.h 2006-11-07 00:03:03.000000000 +0100
@@ -179,4 +179,12 @@ int ehca_mmap_register(u64 physical,void
int ehca_munmap(unsigned long addr, size_t len);
+#ifdef CONFIG_PPC_64K_PAGES
+void *ehca_alloc_fw_ctrlblock(void);
+void ehca_free_fw_ctrlblock(void *ptr);
+#else
+#define ehca_alloc_fw_ctrlblock() ((void*)get_zeroed_page(GFP_KERNEL))
+#define ehca_free_fw_ctrlblock(ptr) free_page((unsigned long)(ptr))
+#endif
+
#endif
diff -Nurp roland_git_orig/drivers/infiniband/hw/ehca/ehca_main.c roland_git_work/drivers/infiniband/hw/ehca/ehca_main.c
--- roland_git_orig/drivers/infiniband/hw/ehca/ehca_main.c 2006-11-02 10:47:04.000000000 +0100
+++ roland_git_work/drivers/infiniband/hw/ehca/ehca_main.c 2006-11-07 00:03:03.000000000 +0100
@@ -40,6 +40,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef CONFIG_PPC_64K_PAGES
+#include <linux/slab.h>
+#endif
#include "ehca_classes.h"
#include "ehca_iverbs.h"
#include "ehca_mrmw.h"
@@ -49,7 +52,7 @@
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>");
MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver");
-MODULE_VERSION("SVNEHCA_0017");
+MODULE_VERSION("SVNEHCA_0018");
int ehca_open_aqp1 = 0;
int ehca_debug_level = 0;
@@ -94,11 +97,31 @@ spinlock_t ehca_cq_idr_lock;
DEFINE_IDR(ehca_qp_idr);
DEFINE_IDR(ehca_cq_idr);
+
static struct list_head shca_list; /* list of all registered ehcas */
static spinlock_t shca_list_lock;
static struct timer_list poll_eqs_timer;
+#ifdef CONFIG_PPC_64K_PAGES
+static struct kmem_cache *ctblk_cache = NULL;
+
+void *ehca_alloc_fw_ctrlblock(void)
+{
+ void *ret = kmem_cache_zalloc(ctblk_cache, SLAB_KERNEL);
+ if (!ret)
+ ehca_gen_err("Out of memory for ctblk");
+ return ret;
+}
+
+void ehca_free_fw_ctrlblock(void *ptr)
+{
+ if (ptr)
+ kmem_cache_free(ctblk_cache, ptr);
+
+}
+#endif
+
static int ehca_create_slab_caches(void)
{
int ret;
@@ -133,6 +156,17 @@ static int ehca_create_slab_caches(void)
goto create_slab_caches5;
}
+#ifdef CONFIG_PPC_64K_PAGES
+ ctblk_cache = kmem_cache_create("ehca_cache_ctblk",
+ EHCA_PAGESIZE, H_CB_ALIGNMENT,
+ SLAB_HWCACHE_ALIGN,
+ NULL, NULL);
+ if (!ctblk_cache) {
+ ehca_gen_err("Cannot create ctblk SLAB cache.");
+ ehca_cleanup_mrmw_cache();
+ goto create_slab_caches5;
+ }
+#endif
return 0;
create_slab_caches5:
@@ -157,6 +191,10 @@ static void ehca_destroy_slab_caches(voi
ehca_cleanup_qp_cache();
ehca_cleanup_cq_cache();
ehca_cleanup_pd_cache();
+#ifdef CONFIG_PPC_64K_PAGES
+ if (ctblk_cache)
+ kmem_cache_destroy(ctblk_cache);
+#endif
}
#define EHCA_HCAAVER EHCA_BMASK_IBM(32,39)
@@ -168,7 +206,7 @@ int ehca_sense_attributes(struct ehca_sh
u64 h_ret;
struct hipz_query_hca *rblock;
- rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ rblock = ehca_alloc_fw_ctrlblock();
if (!rblock) {
ehca_gen_err("Cannot allocate rblock memory.");
return -ENOMEM;
@@ -211,7 +249,7 @@ int ehca_sense_attributes(struct ehca_sh
shca->sport[1].rate = IB_RATE_30_GBPS;
num_ports1:
- kfree(rblock);
+ ehca_free_fw_ctrlblock(rblock);
return ret;
}
@@ -220,7 +258,7 @@ static int init_node_guid(struct ehca_sh
int ret = 0;
struct hipz_query_hca *rblock;
- rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ rblock = ehca_alloc_fw_ctrlblock();
if (!rblock) {
ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
return -ENOMEM;
@@ -235,7 +273,7 @@ static int init_node_guid(struct ehca_sh
memcpy(&shca->ib_device.node_guid, &rblock->node_guid, sizeof(u64));
init_node_guid1:
- kfree(rblock);
+ ehca_free_fw_ctrlblock(rblock);
return ret;
}
@@ -431,7 +469,7 @@ static ssize_t ehca_show_##name(struct
\
shca = dev->driver_data; \
\
- rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); \
+ rblock = ehca_alloc_fw_ctrlblock(); \
if (!rblock) { \
dev_err(dev, "Can't allocate rblock memory."); \
return 0; \
@@ -439,12 +477,12 @@ static ssize_t ehca_show_##name(struct
\
if (hipz_h_query_hca(shca->ipz_hca_handle, rblock) != H_SUCCESS) { \
dev_err(dev, "Can't query device properties"); \
- kfree(rblock); \
+ ehca_free_fw_ctrlblock(rblock); \
return 0; \
} \
\
data = rblock->name; \
- kfree(rblock); \
+ ehca_free_fw_ctrlblock(rblock); \
\
if ((strcmp(#name, "num_ports") == 0) && (ehca_nr_ports == 1)) \
return snprintf(buf, 256, "1\n"); \
@@ -752,7 +790,7 @@ int __init ehca_module_init(void)
int ret;
printk(KERN_INFO "eHCA Infiniband Device Driver "
- "(Rel.: SVNEHCA_0017)\n");
+ "(Rel.: SVNEHCA_0018)\n");
idr_init(&ehca_qp_idr);
idr_init(&ehca_cq_idr);
spin_lock_init(&ehca_qp_idr_lock);
diff -Nurp roland_git_orig/drivers/infiniband/hw/ehca/ehca_mrmw.c roland_git_work/drivers/infiniband/hw/ehca/ehca_mrmw.c
--- roland_git_orig/drivers/infiniband/hw/ehca/ehca_mrmw.c 2006-11-02 10:47:04.000000000 +0100
+++ roland_git_work/drivers/infiniband/hw/ehca/ehca_mrmw.c 2006-11-07 00:03:03.000000000 +0100
@@ -1013,7 +1013,7 @@ int ehca_reg_mr_rpages(struct ehca_shca
u32 i;
u64 *kpage;
- kpage = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ kpage = ehca_alloc_fw_ctrlblock();
if (!kpage) {
ehca_err(&shca->ib_device, "kpage alloc failed");
ret = -ENOMEM;
@@ -1092,7 +1092,7 @@ int ehca_reg_mr_rpages(struct ehca_shca
ehca_reg_mr_rpages_exit1:
- kfree(kpage);
+ ehca_free_fw_ctrlblock(kpage);
ehca_reg_mr_rpages_exit0:
if (ret)
ehca_err(&shca->ib_device, "ret=%x shca=%p e_mr=%p pginfo=%p "
@@ -1124,7 +1124,7 @@ inline int ehca_rereg_mr_rereg1(struct e
ehca_mrmw_map_acl(acl, &hipz_acl);
ehca_mrmw_set_pgsize_hipz_acl(&hipz_acl);
- kpage = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+ kpage = ehca_alloc_fw_ctrlblock();
if (!kpage) {
ehca_err(&shca->ib_device, "kpage alloc failed");
ret = -ENOMEM;
@@ -1181,7 +1181,7 @@ inline int ehca_rereg_mr_rereg1(struct e
}
ehca_rereg_mr_rereg1_exit1:
- kfree(kpage);
+ ehca_free_fw_ctrlblock(kpage);
ehca_rereg_mr_rereg1_exit0:
if ( ret && (ret != -EAGAIN) )
ehca_err(&shca->ib_device, "ret=%x lkey=%x rkey=%x "
diff -Nurp roland_git_orig/drivers/infiniband/hw/ehca/ehca_qp.c roland_git_work/drivers/infiniband/hw/ehca/ehca_qp.c
--- roland_git_orig/drivers/infiniband/hw/ehca/ehca_qp.c 2006-11-02 10:47:04.000000000 +0100
+++ roland_git_work/drivers/infiniband/hw/ehca/ehca_qp.c 2006-11-07 00:03:03.000000000 +0100
@@ -811,8 +811,8 @@ static int internal_modify_qp(struct ib_
unsigned long spl_flags = 0;
/* do query_qp to obtain current attr values */
- mqpcb = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
- if (mqpcb == NULL) {
+ mqpcb = ehca_alloc_fw_ctrlblock();
+ if (!mqpcb) {
ehca_err(ibqp->device, "Could not get zeroed page for mqpcb "
"ehca_qp=%p qp_num=%x ", my_qp, ibqp->qp_num);
return -ENOMEM;
@@ -1225,7 +1225,7 @@ modify_qp_exit2:
}
modify_qp_exit1:
- kfree(mqpcb);
+ ehca_free_fw_ctrlblock(mqpcb);
return ret;
}
@@ -1277,7 +1277,7 @@ int ehca_query_qp(struct ib_qp *qp,
return -EINVAL;
}
- qpcb = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL );
+ qpcb = ehca_alloc_fw_ctrlblock();
if (!qpcb) {
ehca_err(qp->device,"Out of memory for qpcb "
"ehca_qp=%p qp_num=%x", my_qp, qp->qp_num);
@@ -1401,7 +1401,7 @@ int ehca_query_qp(struct ib_qp *qp,
ehca_dmp(qpcb, 4*70, "qp_num=%x", qp->qp_num);
query_qp_exit1:
- kfree(qpcb);
+ ehca_free_fw_ctrlblock(qpcb);
return ret;
}
^ permalink raw reply
* ethernet interface problem with kernel 2.6.14 on MPC8343E
From: Luong Ngo @ 2006-11-06 23:51 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 805 bytes --]
Hello,
I am having a problem with the interfaces eth0 and eth1 when running
2.6.14kernel on a board with MPC8343E. The problem I encounters is
only one of the
eth interface is really working. Only the one that is configured first,
using "ifconfig eth[0/1] 192.168.1.1 netmask 255.255.255.0" can ping and be
pinged from another host. I wonder if there is setup difference between the
TSEC1 and TSEC2 or this is not related to hardware but rather something in
the kernel. When I ping from other host, from within the Gianfar driver, I
can see the packet is received on both interfaces but only one responds.
When pinging from the system itself, only the working interface sending out
packet, the other interface does not send anything. Please advise me what I
am doing wrong or missing.
Thank you,
L. Ngo
[-- Attachment #2: Type: text/html, Size: 905 bytes --]
^ permalink raw reply
* Re: Ramdisk of ELDK 3.1.1 not run
From: Wolfgang Denk @ 2006-11-06 23:43 UTC (permalink / raw)
To: tran vanle; +Cc: linuxppc-embedded
In-Reply-To: <20061106142604.14632.qmail@web33012.mail.mud.yahoo.com>
In message <20061106142604.14632.qmail@web33012.mail.mud.yahoo.com> you wrote:
>
> I had used kernel of ELDK 3.1.1 and Ramdisk of ELDK 4.0 on board MPC8xxL .It run ok but I see it will meet trouble :D
Yes, this is to be expected. The ELDK 4.0 ramdisk built with a 2.6
kernel in mind.
> When I use kernel and Ramdisk of ELDK 3.1.1 for MPC8xxL (I only rebuild Kernel use oldconfig and use uRamdisk in source (not rebuild )) but I receive error
...
> Kernel command line:
You don't pass any boot arguments here.
> What I miss?May i correct it
You obviously missed to read the documentation. Please see
http://www.denx.de/wiki/view/DULG/LinuxKernelArgs
> I also build kernel Linux 2.6.11.7 use tosati patch and config ,but when I want this kernel support virtual terminal it hang.May I correct it?
You probably missed to define correct boot arguments, especially a
correct console device; note that 2.6 uses ttyCPM0 instead of ttyS0,
etc.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
I don't know if it's what you want, but it's what you get. :-)
- Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>
^ permalink raw reply
* Re: Kernel 2.6.18 and JFFS2 Filesystem problem
From: Wolfgang Denk @ 2006-11-06 23:38 UTC (permalink / raw)
To: mvw; +Cc: linuxppc-embedded
In-Reply-To: <20061106133041.94740@gmx.net>
In message <20061106133041.94740@gmx.net> you wrote:
>
> i dont know what my mistake.
We don';t know either - not from such a vague message.
> What files do i need for a filesystem?
See for example
http://www.denx.de/wiki/view/DULG/RootFileSystemDesignAndBuilding
> Is it correct to build the filesystem with these parameters?
> --> mkfs.jffs2 -r dir -o jffs2 -e 0x40000 -p
This might be OK, but we don't know your hardware.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"How is this place run - is it an anarchy?"
"No, I wouldn't say so; it is not that well organised..."
^ permalink raw reply
* Re: [PATCH/RFC] powerpc: Add MPC5200 Interrupt Controller support.
From: Sylvain Munaut @ 2006-11-06 23:35 UTC (permalink / raw)
To: Nicolas DET; +Cc: linuxppc-dev, linuxppc-embedded
In-Reply-To: <200611061103.kA6B3ADJ023943@post.webmailer.de>
> +
> + /*
> + * Most of ours IRQs will be level low
> + * Only external IRQs on some platform may be others
> + */
> + type = IRQ_TYPE_LEVEL_LOW;
>
I've been wondering : Why LEVEL_LOW ?
Aren't they LEVEL_HIGH ?
(not that it changes much here ...)
> +
> +end:
> + of_node_put(picnode);
> + of_node_put(sdmanode);
>
Is of_node_put specified as resilient to NULL argument ? (in the error
path, that could happen)
Also, I think "PANIC" would be appropriate in the error path. If we
can't init
the PIC properly we may as well give up ... It's not like we're going to
do much
without it ...
> +/* HW IRQ mapping */
> +#define MPC52xx_IRQ_L1_CRIT (0)
> +#define MPC52xx_IRQ_L1_MAIN (1)
> +#define MPC52xx_IRQ_L1_PERP (2)
> +#define MPC52xx_IRQ_L1_SDMA (3)
> +
> +#define MPC52xx_IRQ_L1_OFFSET (6)
> +#define MPC52xx_IRQ_L1_MASK (0xc0)
> +
> +#define MPC52xx_IRQ_L2_OFFSET (0)
> +#define MPC52xx_IRQ_L2_MASK (0x3f)
> +
> +#define MPC52xx_IRQ_HIGHTESTHWIRQ (0xd0)
> +
> +/* Interrupt controller Register set */
> +struct mpc52xx_intr {
> + u32 per_mask; /* INTR + 0x00 */
> + u32 per_pri1; /* INTR + 0x04 */
> + u32 per_pri2; /* INTR + 0x08 */
> + u32 per_pri3; /* INTR + 0x0c */
> + u32 ctrl; /* INTR + 0x10 */
> + u32 main_mask; /* INTR + 0x14 */
> + u32 main_pri1; /* INTR + 0x18 */
> + u32 main_pri2; /* INTR + 0x1c */
> + u32 reserved1; /* INTR + 0x20 */
> + u32 enc_status; /* INTR + 0x24 */
> + u32 crit_status; /* INTR + 0x28 */
> + u32 main_status; /* INTR + 0x2c */
> + u32 per_status; /* INTR + 0x30 */
> + u32 reserved2; /* INTR + 0x34 */
> + u32 per_error; /* INTR + 0x38 */
> +};
>
When I said on IRC you could remerge them, I meant a little more
smartly than just 'join' them. i.e., put the mpc52xx_intr with all the
other register set at the very least ...
Sylvain
^ permalink raw reply
* Re: Linux Kernel 2.6 on Artesyn Katana Board (3750) with IBM 750F X PP C
From: Wolfgang Denk @ 2006-11-06 23:34 UTC (permalink / raw)
To: Goel, Mudit (Mudit); +Cc: 'linuxppc-embedded@ozlabs.org'
In-Reply-To: <3BE48DD0EC7D3948BC183931D9150C210BBB0CA1@ii0015exch001u.iprc.lucent.com>
In message <3BE48DD0EC7D3948BC183931D9150C210BBB0CA1@ii0015exch001u.iprc.lucent.com> you wrote:
> After making an uIamge and using bootm here is the o/p. I have tried using
> DHCP/ RARP options also
> but I dont see any requests coming onto the host machine where the server
> is runnig. Is there something
> incorrect in the configuration that I have.
Probably a bug or configuration problem in your Linux kernel and/or
your toolchain.
> Linux version 2.6.10_mvlcge401-katana (root@hdrlin03) (gcc version 3.4.3
> (MontaVista 3.4.3-25.0.41.0501420 2005-09-07)) #32 Mon Nov 6 16:03:17 IST 2006
Since this is a MVL source tree and tools, you probably want to ask
MV support...
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Never call a man a fool. Borrow from him.
^ 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