LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Oops with TQM5200 on TQM5200
From: Anatolij Gustschin @ 2008-03-20 15:24 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: linuxppc-dev
In-Reply-To: <47E2723D.1090101@grandegger.com>

Hello Wolfgang,

Wolfgang Grandegger wrote:

> I just tried Linux 2.6.25-rc6 on my TQM5200 module and got the attached
> oops. Are there any known patches fixing the problems?

try the patch below for tqm5200.dts, rebuild dtb and boot
again. Not sure if it works for Linux 2.6.25-rc6, but for
2.6.25-rc3 it does.

Anatolij
--
 diff --git a/arch/powerpc/boot/dts/tqm5200.dts b/arch/powerpc/boot/dts/tqm5200.dts
index c86464f..7c23bb3 100644
--- a/arch/powerpc/boot/dts/tqm5200.dts
+++ b/arch/powerpc/boot/dts/tqm5200.dts
@@ -83,6 +83,7 @@
 		};
 
 		dma-controller@1200 {
+			device_type = "dma-controller";
 			compatible = "fsl,mpc5200-bestcomm";
 			reg = <1200 80>;
 			interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
@@ -127,10 +128,25 @@
 		ethernet@3000 {
 			device_type = "network";
 			compatible = "fsl,mpc5200-fec";
-			reg = <3000 800>;
+			reg = <3000 400>;
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <2 5 0>;
 			interrupt-parent = <&mpc5200_pic>;
+			phy-handle = <&phy0>;
+		};
+
+		mdio@3000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,mpc5200b-mdio";
+			reg = <3000 400>;       // fec range, since we need to setup fec interrupts
+			interrupts = <2 5 0>;   // these are for "mii command finished", not link changes & co.
+			interrupt-parent = <&mpc5200_pic>;
+
+			phy0:ethernet-phy@0 {
+				device_type = "ethernet-phy";
+				reg = <0>;
+			};
 		};
 
 		ata@3a00 {

^ permalink raw reply related

* Re: Oops with TQM5200 on TQM5200
From: Bartlomiej Sieka @ 2008-03-20 16:17 UTC (permalink / raw)
  To: Anatolij Gustschin; +Cc: linuxppc-dev
In-Reply-To: <47E281B6.20702@denx.de>

Anatolij Gustschin wrote:
> Hello Wolfgang,
> 
> Wolfgang Grandegger wrote:
> 
>> I just tried Linux 2.6.25-rc6 on my TQM5200 module and got the attached
>> oops. Are there any known patches fixing the problems?
> 
> try the patch below for tqm5200.dts, rebuild dtb and boot
> again. Not sure if it works for Linux 2.6.25-rc6, but for
> 2.6.25-rc3 it does.

It helps 2.6.25-rc6 too - thanks Anatolij.

> 
> Anatolij
> -- 
> diff --git a/arch/powerpc/boot/dts/tqm5200.dts 
> b/arch/powerpc/boot/dts/tqm5200.dts
> index c86464f..7c23bb3 100644
> --- a/arch/powerpc/boot/dts/tqm5200.dts
> +++ b/arch/powerpc/boot/dts/tqm5200.dts
> @@ -83,6 +83,7 @@
>         };
> 
>         dma-controller@1200 {
> +            device_type = "dma-controller";

This actually fixes the Oops.

>             compatible = "fsl,mpc5200-bestcomm";
>             reg = <1200 80>;
>             interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
> @@ -127,10 +128,25 @@
>         ethernet@3000 {
>             device_type = "network";
>             compatible = "fsl,mpc5200-fec";
> -            reg = <3000 800>;
> +            reg = <3000 400>;
>             local-mac-address = [ 00 00 00 00 00 00 ];
>             interrupts = <2 5 0>;
>             interrupt-parent = <&mpc5200_pic>;
> +            phy-handle = <&phy0>;
> +        };
> +
> +        mdio@3000 {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            compatible = "fsl,mpc5200b-mdio";
> +            reg = <3000 400>;       // fec range, since we need to 
> setup fec interrupts
> +            interrupts = <2 5 0>;   // these are for "mii command 
> finished", not link changes & co.
> +            interrupt-parent = <&mpc5200_pic>;
> +
> +            phy0:ethernet-phy@0 {
> +                device_type = "ethernet-phy";
> +                reg = <0>;
> +            };

And this fixes networking issues (NFS-mounted rootfs timeouts, etc).
BTW: it's been posted a while back
(http://patchwork.ozlabs.org/linuxppc/patch?q=Balakowicz&id=16197) but
didn't get merged.

Grant -- any chances these fixes could be rushed upstream?

Regards,
Bartlomiej

^ permalink raw reply

* RE: [PATCH 3/3] [POWERPC] Xilinx: boot support for Xilinx uart 16550.
From: John Linn @ 2008-03-20 16:15 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40803200754j6972deenad63cf37a836f236@mail.gmail.com>

You're right.  Rick and I were just talking about could we not check the
versions but just make sure the device is the right type independent of
the versions.

This issue will be true for all the Xilinx drivers.

I think FPGA IP is a little different in that the hardware can change
much more often than in hard devices.

-- John

-----Original Message-----
From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of
Grant Likely
Sent: Thursday, March 20, 2008 8:55 AM
To: John Linn
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 3/3] [POWERPC] Xilinx: boot support for Xilinx uart
16550.

On Thu, Mar 20, 2008 at 8:43 AM, John Linn <john.linn@xilinx.com> wrote:
> The Xilinx 16550 uart core is not a standard 16550, because it uses
>  word-based addressing rather than byte-based addressing.  As a
result,
>  it is not compatible with the open firmware 'ns16550' compatible
>  binding.
>
>  This code adds the Xilinx uart 16550 to the serial console
>  of the boot. A new initialization function for the Xilinx 16550 uart
>  is added to the ns16550 driver. It sets up the correct register base
>  and regshift properties specific to the Xilinx 16550.
>
>  Signed-off-by: John Linn <john.linn@xilinx.com>
>  --- a/arch/powerpc/boot/ops.h
>  +++ b/arch/powerpc/boot/ops.h
>  @@ -86,6 +86,7 @@ int mpsc_console_init(void *devp, struct
serial_console_data *scdp);
>   int cpm_console_init(void *devp, struct serial_console_data *scdp);
>   int mpc5200_psc_console_init(void *devp, struct serial_console_data
*scdp);
>   int uartlite_console_init(void *devp, struct serial_console_data
*scdp);
>  +int xilinx16550_console_init(void *devp, struct serial_console_data
*scdp);
>   void *simple_alloc_init(char *base, unsigned long heap_size,
>                         unsigned long granularity, unsigned long
max_allocs);
>   extern void flush_cache(void *, unsigned long);
>  diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
>  index 7fa5078..fb5c91e 100644
>  --- a/arch/powerpc/boot/serial.c
>  +++ b/arch/powerpc/boot/serial.c
>  @@ -131,6 +131,14 @@ int serial_console_init(void)
>         else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
>                   dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
>                 rc =3D uartlite_console_init(devp, &serial_cd);
>  +       else if (dt_is_compatible(devp, "xlnx,opb-uart16550-1.00.c")
||
>  +                dt_is_compatible(devp, "xlnx,opb-uart16550-1.00.d")
||
>  +                dt_is_compatible(devp, "xlnx,opb-uart16550-1.00.e")
||
>  +                dt_is_compatible(devp, "xlnx,plb-uart16550-1.00.c")
||
>  +                dt_is_compatible(devp, "xlnx,xps-uart16550-1.00.a")
||
>  +                dt_is_compatible(devp, "xlnx,xps-uart16550-2.00.a")
||
>  +                dt_is_compatible(devp, "xlnx,xps-uart16550-2.00.b"))
>  +               rc =3D xilinx16550_console_init(devp, &serial_cd);

I'll review this whole patch set today, but I need to make this
comment now.  Adding to this ever increasing list of xilinx device
versions is not sustainable.  A common base compatible value needs to
be chosen instead.  Way back in the mists of time something line
"sparse16550" was suggested and I think it is a good one.  xilinx uart
nodes should claim compatibility with their specific version *and*
"sparse16550".  Then all this code should only match with
"sparse16550" and documentation should be added to
Documentation/powerpc/booting-without-of.txt to describe what
sparse16550 means.

Cheers,
g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: Trouble with SCC UART ports when moving from ppc to powerpc
From: Scott Wood @ 2008-03-20 16:24 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev
In-Reply-To: <200803201618.37051.laurentp@cse-semaphore.com>

On Thu, Mar 20, 2008 at 04:18:26PM +0100, Laurent Pinchart wrote:
> I don't want to kill it either. What I meant is that my first patch will not 
> care about udbg so that I can get feedback about the CPM serial driver part. 
> I'll then see how to make udbg fit into that.

OK.

> > Perhaps we should stick more initialization into the cpm udbg code, so it
> > isn't so dependent on the bootloader setup... though we'd have push the
> > CPM reset and SMC allocation earlier in such a case.
> 
> When SMC1 is used as a serial console, SMC1 is the first CPM dpram
> allocation user.

Typically yes, but I wouldn't want to depend on that...

> This means the CPM dpram allocator will allocate a buffer at the beginning
> of the dpram. As he SMC controller will already be using the 64 first
> bytes of the dpram, it will not see any difference when being
> reinitialized.

Not always.  Planetcore, for example, puts SMC parameter RAM at 0x1100
rather than zero.

> This of course depends on the boot loader allocating parameter ram at the 
> beginning of the dpram for SMC1, but we already depend on that if I'm not 
> mistaken.

We don't depend on it -- it's specified in the smc node's reg property, and
in the absence of said regions in the muram node.

-Scott

^ permalink raw reply

* Re: Oops with TQM5200 on TQM5200
From: Wolfgang Grandegger @ 2008-03-20 16:29 UTC (permalink / raw)
  To: Anatolij Gustschin; +Cc: linuxppc-dev
In-Reply-To: <47E281B6.20702@denx.de>

Hi Anatolij,

Anatolij Gustschin wrote:
> Hello Wolfgang,
> 
> Wolfgang Grandegger wrote:
> 
>> I just tried Linux 2.6.25-rc6 on my TQM5200 module and got the attached
>> oops. Are there any known patches fixing the problems?
> 
> try the patch below for tqm5200.dts, rebuild dtb and boot
> again. Not sure if it works for Linux 2.6.25-rc6, but for
> 2.6.25-rc3 it does.
> 
> Anatolij
> -- 
> diff --git a/arch/powerpc/boot/dts/tqm5200.dts
> b/arch/powerpc/boot/dts/tqm5200.dts
> index c86464f..7c23bb3 100644
> --- a/arch/powerpc/boot/dts/tqm5200.dts
> +++ b/arch/powerpc/boot/dts/tqm5200.dts
> @@ -83,6 +83,7 @@
>         };
> 
>         dma-controller@1200 {
> +            device_type = "dma-controller";

This one actually fixes the Oops. I already had the following fixes.

>             compatible = "fsl,mpc5200-bestcomm";
>             reg = <1200 80>;
>             interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
> @@ -127,10 +128,25 @@
>         ethernet@3000 {
>             device_type = "network";
>             compatible = "fsl,mpc5200-fec";
> -            reg = <3000 800>;
> +            reg = <3000 400>;

This has already been fixed a long time ago, IIRC.

>             local-mac-address = [ 00 00 00 00 00 00 ];
>             interrupts = <2 5 0>;
>             interrupt-parent = <&mpc5200_pic>;
> +            phy-handle = <&phy0>;
> +        };
> +
> +        mdio@3000 {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            compatible = "fsl,mpc5200b-mdio";
> +            reg = <3000 400>;       // fec range, since we need to
> setup fec interrupts
> +            interrupts = <2 5 0>;   // these are for "mii command
> finished", not link changes & co.
> +            interrupt-parent = <&mpc5200_pic>;
> +
> +            phy0:ethernet-phy@0 {
> +                device_type = "ethernet-phy";
> +                reg = <0>;
> +            };

Another question. Is it possible to configure Linux without explicit
PHY-handling.

Thanks,

Wolfgang.

^ permalink raw reply

* Re: interrupt handlers PowerPC via GCC
From: Scott Wood @ 2008-03-20 17:18 UTC (permalink / raw)
  To: Tehn Yit Chin; +Cc: linuxppc-embedded
In-Reply-To: <bf04f99c0803191706q7e3a43a3i50a1d479650a3f9d@mail.gmail.com>

Tehn Yit Chin wrote:
> Hi all,
> 
> Apologies for such a basic question. I am trying to write an ISR on a
> MPC551x. When I tried to use the interrupt attribute with
> powerpc-eabi-gcc such as
> 
> _attribute_((interrupt_handler)) foobarISR(void)
> {
> }

Assuming you're talking about an interrupt handler in Linux, you don't 
need to do anything like that.  The actual interrupt entry is assembly 
code.  Search existing drivers for "irqreturn_t" to find examples of 
what an interrupt handler looks like, and "request_irq" for how to hook 
the handler into the interrupt.

-Scott

^ permalink raw reply

* [RFC/PATCH] [POWERPC] qe_lib and ucc_geth: switch to the cpm_muram implementation
From: Anton Vorontsov @ 2008-03-20 17:39 UTC (permalink / raw)
  To: Scott Wood, Timur Tabi; +Cc: linuxppc-dev

This is very trivial patch, mostly bunch of renames and deletes.

Less trivial changes:
- BD_SC_* defines were also defined in the cpm.h, so to avoid redefines
  we remove BD_SC from the qe.h and use the cpm.h along with cpm_muram_*
  prototypes;
- qe_muram_dump was unused and thus removed;
- added some code to the cpm_common.c to support legacy QE bindings
  (data-only node name).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---

On Tue, Mar 18, 2008 at 12:48:17PM -0500, Scott Wood wrote:
> On Tue, Mar 11, 2008 at 08:24:13PM +0300, Anton Vorontsov wrote:
> > qe_muram_offset is the reverse of the qe_muram_addr, will be
> > used for the Freescale QE USB Host Controller driver.
> > 
> > This patch also moves qe_muram_addr into the qe.h header, plus
> > adds __iomem hints to use with sparse.
> 
> We should really switch QE over to using the muram code in cpm_common.c...

Here it is. I'm not sure about Makefile changes, any better ideas?

 arch/powerpc/sysdev/Makefile          |    1 +
 arch/powerpc/sysdev/cpm_common.c      |   12 +++-
 arch/powerpc/sysdev/qe_lib/qe.c       |  102 +--------------------------------
 arch/powerpc/sysdev/qe_lib/ucc_fast.c |    8 +-
 arch/powerpc/sysdev/qe_lib/ucc_slow.c |   18 +++---
 drivers/net/ucc_geth.c                |   96 +++++++++++++++---------------
 include/asm-powerpc/qe.h              |   20 +------
 7 files changed, 73 insertions(+), 184 deletions(-)

diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 62b6ef0..70fc54f 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -38,6 +38,7 @@ endif
 # Temporary hack until we have migrated to asm-powerpc
 ifeq ($(ARCH),powerpc)
 obj-$(CONFIG_CPM)		+= cpm_common.o
+obj-$(CONFIG_QUICC_ENGINE)	+= cpm_common.o
 obj-$(CONFIG_CPM2)		+= cpm2.o cpm2_pic.o
 obj-$(CONFIG_PPC_DCR)		+= dcr.o
 obj-$(CONFIG_8xx)		+= mpc8xx_pic.o cpm1.o
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 165981c..e3f99c4 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -58,7 +58,7 @@ void __init udbg_init_cpm(void)
 }
 #endif
 
-#ifdef CONFIG_PPC_CPM_NEW_BINDING
+#if defined(CONFIG_PPC_CPM_NEW_BINDING) || defined(CONFIG_QUICC_ENGINE)
 static spinlock_t cpm_muram_lock;
 static rh_block_t cpm_boot_muram_rh_block[16];
 static rh_info_t cpm_muram_info;
@@ -86,9 +86,13 @@ int __init cpm_muram_init(void)
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,cpm-muram-data");
 	if (!np) {
-		printk(KERN_ERR "Cannot find CPM muram data node");
-		ret = -ENODEV;
-		goto out;
+		/* try legacy bindings */
+		np = of_find_node_by_name(NULL, "data-only");
+		if (!np) {
+			printk(KERN_ERR "Cannot find CPM muram data node");
+			ret = -ENODEV;
+			goto out;
+		}
 	}
 
 	muram_pbase = of_translate_address(np, zero);
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 6efbd5e..59d6c8a 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -35,7 +35,6 @@
 #include <asm/rheap.h>
 
 static void qe_snums_init(void);
-static void qe_muram_init(void);
 static int qe_sdma_init(void);
 
 static DEFINE_SPINLOCK(qe_lock);
@@ -99,7 +98,7 @@ void qe_reset(void)
 		     QE_CR_PROTOCOL_UNSPECIFIED, 0);
 
 	/* Reclaim the MURAM memory for our use. */
-	qe_muram_init();
+	cpm_muram_init();
 
 	if (qe_sdma_init())
 		panic("sdma init failed!");
@@ -313,7 +312,7 @@ static int qe_sdma_init(void)
 
 	/* allocate 2 internal temporary buffers (512 bytes size each) for
 	 * the SDMA */
- 	sdma_buf_offset = qe_muram_alloc(512 * 2, 4096);
+	sdma_buf_offset = cpm_muram_alloc(512 * 2, 4096);
 	if (IS_ERR_VALUE(sdma_buf_offset))
 		return -ENOMEM;
 
@@ -324,103 +323,6 @@ static int qe_sdma_init(void)
 	return 0;
 }
 
-/*
- * muram_alloc / muram_free bits.
- */
-static DEFINE_SPINLOCK(qe_muram_lock);
-
-/* 16 blocks should be enough to satisfy all requests
- * until the memory subsystem goes up... */
-static rh_block_t qe_boot_muram_rh_block[16];
-static rh_info_t qe_muram_info;
-
-static void qe_muram_init(void)
-{
-	struct device_node *np;
-	const u32 *address;
-	u64 size;
-	unsigned int flags;
-
-	/* initialize the info header */
-	rh_init(&qe_muram_info, 1,
-		sizeof(qe_boot_muram_rh_block) /
-		sizeof(qe_boot_muram_rh_block[0]), qe_boot_muram_rh_block);
-
-	/* Attach the usable muram area */
-	/* XXX: This is a subset of the available muram. It
-	 * varies with the processor and the microcode patches activated.
-	 */
-	np = of_find_compatible_node(NULL, NULL, "fsl,qe-muram-data");
-	if (!np) {
-		np = of_find_node_by_name(NULL, "data-only");
-		if (!np) {
-			WARN_ON(1);
-			return;
-		}
-	}
-
-	address = of_get_address(np, 0, &size, &flags);
-	WARN_ON(!address);
-
-	of_node_put(np);
-	if (address)
-		rh_attach_region(&qe_muram_info, *address, (int)size);
-}
-
-/* This function returns an index into the MURAM area.
- */
-unsigned long qe_muram_alloc(int size, int align)
-{
-	unsigned long start;
-	unsigned long flags;
-
-	spin_lock_irqsave(&qe_muram_lock, flags);
-	start = rh_alloc_align(&qe_muram_info, size, align, "QE");
-	spin_unlock_irqrestore(&qe_muram_lock, flags);
-
-	return start;
-}
-EXPORT_SYMBOL(qe_muram_alloc);
-
-int qe_muram_free(unsigned long offset)
-{
-	int ret;
-	unsigned long flags;
-
-	spin_lock_irqsave(&qe_muram_lock, flags);
-	ret = rh_free(&qe_muram_info, offset);
-	spin_unlock_irqrestore(&qe_muram_lock, flags);
-
-	return ret;
-}
-EXPORT_SYMBOL(qe_muram_free);
-
-/* not sure if this is ever needed */
-unsigned long qe_muram_alloc_fixed(unsigned long offset, int size)
-{
-	unsigned long start;
-	unsigned long flags;
-
-	spin_lock_irqsave(&qe_muram_lock, flags);
-	start = rh_alloc_fixed(&qe_muram_info, offset, size, "commproc");
-	spin_unlock_irqrestore(&qe_muram_lock, flags);
-
-	return start;
-}
-EXPORT_SYMBOL(qe_muram_alloc_fixed);
-
-void qe_muram_dump(void)
-{
-	rh_dump(&qe_muram_info);
-}
-EXPORT_SYMBOL(qe_muram_dump);
-
-void *qe_muram_addr(unsigned long offset)
-{
-	return (void *)&qe_immr->muram[offset];
-}
-EXPORT_SYMBOL(qe_muram_addr);
-
 /* The maximum number of RISCs we support */
 #define MAX_QE_RISC     2
 
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
index bcf88e6..559678d 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -267,7 +267,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
 	/* Allocate memory for Tx Virtual Fifo */
 	uccf->ucc_fast_tx_virtual_fifo_base_offset =
-	    qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
+	    cpm_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
 	if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO\n",
 			__func__);
@@ -278,7 +278,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
 	/* Allocate memory for Rx Virtual Fifo */
 	uccf->ucc_fast_rx_virtual_fifo_base_offset =
-		qe_muram_alloc(uf_info->urfs +
+		cpm_muram_alloc(uf_info->urfs +
 			   UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR,
 			   UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
 	if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
@@ -350,10 +350,10 @@ void ucc_fast_free(struct ucc_fast_private * uccf)
 		return;
 
 	if (uccf->ucc_fast_tx_virtual_fifo_base_offset)
-		qe_muram_free(uccf->ucc_fast_tx_virtual_fifo_base_offset);
+		cpm_muram_free(uccf->ucc_fast_tx_virtual_fifo_base_offset);
 
 	if (uccf->ucc_fast_rx_virtual_fifo_base_offset)
-		qe_muram_free(uccf->ucc_fast_rx_virtual_fifo_base_offset);
+		cpm_muram_free(uccf->ucc_fast_rx_virtual_fifo_base_offset);
 
 	kfree(uccf);
 }
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
index a578bc7..49e6949 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -187,7 +187,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 
 	/* Get PRAM base */
 	uccs->us_pram_offset =
-		qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
+		cpm_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
 	if (IS_ERR_VALUE(uccs->us_pram_offset)) {
 		printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __func__);
 		ucc_slow_free(uccs);
@@ -197,7 +197,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 	qe_issue_cmd(QE_ASSIGN_PAGE_TO_DEVICE, id, us_info->protocol,
 		     uccs->us_pram_offset);
 
-	uccs->us_pram = qe_muram_addr(uccs->us_pram_offset);
+	uccs->us_pram = cpm_muram_addr(uccs->us_pram_offset);
 
 	/* Set UCC to slow type */
 	ret = ucc_set_type(us_info->ucc_num, UCC_SPEED_TYPE_SLOW);
@@ -213,7 +213,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 
 	/* Allocate BDs. */
 	uccs->rx_base_offset =
-		qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
+		cpm_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
 				QE_ALIGNMENT_OF_BD);
 	if (IS_ERR_VALUE(uccs->rx_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate %u RX BDs\n", __func__,
@@ -224,7 +224,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 	}
 
 	uccs->tx_base_offset =
-		qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
+		cpm_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
 			QE_ALIGNMENT_OF_BD);
 	if (IS_ERR_VALUE(uccs->tx_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate TX BDs", __func__);
@@ -234,7 +234,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 	}
 
 	/* Init Tx bds */
-	bd = uccs->confBd = uccs->tx_bd = qe_muram_addr(uccs->tx_base_offset);
+	bd = uccs->confBd = uccs->tx_bd = cpm_muram_addr(uccs->tx_base_offset);
 	for (i = 0; i < us_info->tx_bd_ring_len - 1; i++) {
 		/* clear bd buffer */
 		out_be32(&bd->buf, 0);
@@ -247,7 +247,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 	out_be32((u32 *) bd, cpu_to_be32(T_W));
 
 	/* Init Rx bds */
-	bd = uccs->rx_bd = qe_muram_addr(uccs->rx_base_offset);
+	bd = uccs->rx_bd = cpm_muram_addr(uccs->rx_base_offset);
 	for (i = 0; i < us_info->rx_bd_ring_len - 1; i++) {
 		/* set bd status and length */
 		out_be32((u32*)bd, 0);
@@ -362,13 +362,13 @@ void ucc_slow_free(struct ucc_slow_private * uccs)
 		return;
 
 	if (uccs->rx_base_offset)
-		qe_muram_free(uccs->rx_base_offset);
+		cpm_muram_free(uccs->rx_base_offset);
 
 	if (uccs->tx_base_offset)
-		qe_muram_free(uccs->tx_base_offset);
+		cpm_muram_free(uccs->tx_base_offset);
 
 	if (uccs->us_pram) {
-		qe_muram_free(uccs->us_pram_offset);
+		cpm_muram_free(uccs->us_pram_offset);
 		uccs->us_pram = NULL;
 	}
 
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index aa6566e..474340f 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -299,7 +299,7 @@ static int fill_init_enet_entries(struct ucc_geth_private *ugeth,
 			init_enet_offset = 0;
 		else {
 			init_enet_offset =
-			    qe_muram_alloc(thread_size, thread_alignment);
+			    cpm_muram_alloc(thread_size, thread_alignment);
 			if (IS_ERR_VALUE(init_enet_offset)) {
 				if (netif_msg_ifup(ugeth))
 					ugeth_err("fill_init_enet_entries: Can not allocate DPRAM memory.");
@@ -338,7 +338,7 @@ static int return_init_enet_entries(struct ucc_geth_private *ugeth,
 				init_enet_offset =
 				    (in_be32(p_start) &
 				     ENET_INIT_PARAM_PTR_MASK);
-				qe_muram_free(init_enet_offset);
+				cpm_muram_free(init_enet_offset);
 			}
 			*(p_start++) = 0;	/* Just for cosmetics */
 		}
@@ -375,8 +375,8 @@ static int dump_init_enet_entries(struct ucc_geth_private *ugeth,
 				ugeth_info("Init enet entry %d:", i);
 				ugeth_info("Base address: 0x%08x",
 					   (u32)
-					   qe_muram_addr(init_enet_offset));
-				mem_disp(qe_muram_addr(init_enet_offset),
+					   cpm_muram_addr(init_enet_offset));
+				mem_disp(cpm_muram_addr(init_enet_offset),
 					 thread_size);
 			}
 			p_start++;
@@ -1085,11 +1085,11 @@ static void dump_regs(struct ucc_geth_private *ugeth)
 			ugeth_info("ucode RX Prefetched BDs:");
 			ugeth_info("Base address: 0x%08x",
 				   (u32)
-				   qe_muram_addr(in_be32
+				   cpm_muram_addr(in_be32
 						 (&ugeth->p_rx_bd_qs_tbl[i].
 						  bdbaseptr)));
 			mem_disp((u8 *)
-				 qe_muram_addr(in_be32
+				 cpm_muram_addr(in_be32
 					       (&ugeth->p_rx_bd_qs_tbl[i].
 						bdbaseptr)),
 				 sizeof(struct ucc_geth_rx_prefetched_bds));
@@ -2090,47 +2090,47 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
 	}
 
 	if (ugeth->p_thread_data_tx) {
-		qe_muram_free(ugeth->thread_dat_tx_offset);
+		cpm_muram_free(ugeth->thread_dat_tx_offset);
 		ugeth->p_thread_data_tx = NULL;
 	}
 	if (ugeth->p_thread_data_rx) {
-		qe_muram_free(ugeth->thread_dat_rx_offset);
+		cpm_muram_free(ugeth->thread_dat_rx_offset);
 		ugeth->p_thread_data_rx = NULL;
 	}
 	if (ugeth->p_exf_glbl_param) {
-		qe_muram_free(ugeth->exf_glbl_param_offset);
+		cpm_muram_free(ugeth->exf_glbl_param_offset);
 		ugeth->p_exf_glbl_param = NULL;
 	}
 	if (ugeth->p_rx_glbl_pram) {
-		qe_muram_free(ugeth->rx_glbl_pram_offset);
+		cpm_muram_free(ugeth->rx_glbl_pram_offset);
 		ugeth->p_rx_glbl_pram = NULL;
 	}
 	if (ugeth->p_tx_glbl_pram) {
-		qe_muram_free(ugeth->tx_glbl_pram_offset);
+		cpm_muram_free(ugeth->tx_glbl_pram_offset);
 		ugeth->p_tx_glbl_pram = NULL;
 	}
 	if (ugeth->p_send_q_mem_reg) {
-		qe_muram_free(ugeth->send_q_mem_reg_offset);
+		cpm_muram_free(ugeth->send_q_mem_reg_offset);
 		ugeth->p_send_q_mem_reg = NULL;
 	}
 	if (ugeth->p_scheduler) {
-		qe_muram_free(ugeth->scheduler_offset);
+		cpm_muram_free(ugeth->scheduler_offset);
 		ugeth->p_scheduler = NULL;
 	}
 	if (ugeth->p_tx_fw_statistics_pram) {
-		qe_muram_free(ugeth->tx_fw_statistics_pram_offset);
+		cpm_muram_free(ugeth->tx_fw_statistics_pram_offset);
 		ugeth->p_tx_fw_statistics_pram = NULL;
 	}
 	if (ugeth->p_rx_fw_statistics_pram) {
-		qe_muram_free(ugeth->rx_fw_statistics_pram_offset);
+		cpm_muram_free(ugeth->rx_fw_statistics_pram_offset);
 		ugeth->p_rx_fw_statistics_pram = NULL;
 	}
 	if (ugeth->p_rx_irq_coalescing_tbl) {
-		qe_muram_free(ugeth->rx_irq_coalescing_tbl_offset);
+		cpm_muram_free(ugeth->rx_irq_coalescing_tbl_offset);
 		ugeth->p_rx_irq_coalescing_tbl = NULL;
 	}
 	if (ugeth->p_rx_bd_qs_tbl) {
-		qe_muram_free(ugeth->rx_bd_qs_tbl_offset);
+		cpm_muram_free(ugeth->rx_bd_qs_tbl_offset);
 		ugeth->p_rx_bd_qs_tbl = NULL;
 	}
 	if (ugeth->p_init_enet_param_shadow) {
@@ -2171,7 +2171,7 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
 				kfree((void *)ugeth->tx_bd_ring_offset[i]);
 			else if (ugeth->ug_info->uf_info.bd_mem_part ==
 				 MEM_PART_MURAM)
-				qe_muram_free(ugeth->tx_bd_ring_offset[i]);
+				cpm_muram_free(ugeth->tx_bd_ring_offset[i]);
 			ugeth->p_tx_bd_ring[i] = NULL;
 		}
 	}
@@ -2201,7 +2201,7 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
 				kfree((void *)ugeth->rx_bd_ring_offset[i]);
 			else if (ugeth->ug_info->uf_info.bd_mem_part ==
 				 MEM_PART_MURAM)
-				qe_muram_free(ugeth->rx_bd_ring_offset[i]);
+				cpm_muram_free(ugeth->rx_bd_ring_offset[i]);
 			ugeth->p_rx_bd_ring[i] = NULL;
 		}
 	}
@@ -2610,11 +2610,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 					align) & ~(align - 1));
 		} else if (uf_info->bd_mem_part == MEM_PART_MURAM) {
 			ugeth->tx_bd_ring_offset[j] =
-			    qe_muram_alloc(length,
+			    cpm_muram_alloc(length,
 					   UCC_GETH_TX_BD_RING_ALIGNMENT);
 			if (!IS_ERR_VALUE(ugeth->tx_bd_ring_offset[j]))
 				ugeth->p_tx_bd_ring[j] =
-				    (u8 *) qe_muram_addr(ugeth->
+				    (u8 *) cpm_muram_addr(ugeth->
 							 tx_bd_ring_offset[j]);
 		}
 		if (!ugeth->p_tx_bd_ring[j]) {
@@ -2646,11 +2646,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 					align) & ~(align - 1));
 		} else if (uf_info->bd_mem_part == MEM_PART_MURAM) {
 			ugeth->rx_bd_ring_offset[j] =
-			    qe_muram_alloc(length,
+			    cpm_muram_alloc(length,
 					   UCC_GETH_RX_BD_RING_ALIGNMENT);
 			if (!IS_ERR_VALUE(ugeth->rx_bd_ring_offset[j]))
 				ugeth->p_rx_bd_ring[j] =
-				    (u8 *) qe_muram_addr(ugeth->
+				    (u8 *) cpm_muram_addr(ugeth->
 							 rx_bd_ring_offset[j]);
 		}
 		if (!ugeth->p_rx_bd_ring[j]) {
@@ -2733,7 +2733,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	/* Tx global PRAM */
 	/* Allocate global tx parameter RAM page */
 	ugeth->tx_glbl_pram_offset =
-	    qe_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
+	    cpm_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
 			   UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT);
 	if (IS_ERR_VALUE(ugeth->tx_glbl_pram_offset)) {
 		if (netif_msg_ifup(ugeth))
@@ -2744,7 +2744,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		return -ENOMEM;
 	}
 	ugeth->p_tx_glbl_pram =
-	    (struct ucc_geth_tx_global_pram *) qe_muram_addr(ugeth->
+	    (struct ucc_geth_tx_global_pram *) cpm_muram_addr(ugeth->
 							tx_glbl_pram_offset);
 	/* Zero out p_tx_glbl_pram */
 	memset(ugeth->p_tx_glbl_pram, 0, sizeof(struct ucc_geth_tx_global_pram));
@@ -2754,7 +2754,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	/* TQPTR */
 	/* Size varies with number of Tx threads */
 	ugeth->thread_dat_tx_offset =
-	    qe_muram_alloc(numThreadsTxNumerical *
+	    cpm_muram_alloc(numThreadsTxNumerical *
 			   sizeof(struct ucc_geth_thread_data_tx) +
 			   32 * (numThreadsTxNumerical == 1),
 			   UCC_GETH_THREAD_DATA_ALIGNMENT);
@@ -2768,7 +2768,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	}
 
 	ugeth->p_thread_data_tx =
-	    (struct ucc_geth_thread_data_tx *) qe_muram_addr(ugeth->
+	    (struct ucc_geth_thread_data_tx *) cpm_muram_addr(ugeth->
 							thread_dat_tx_offset);
 	out_be32(&ugeth->p_tx_glbl_pram->tqptr, ugeth->thread_dat_tx_offset);
 
@@ -2784,7 +2784,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	/* SQPTR */
 	/* Size varies with number of Tx queues */
 	ugeth->send_q_mem_reg_offset =
-	    qe_muram_alloc(ug_info->numQueuesTx *
+	    cpm_muram_alloc(ug_info->numQueuesTx *
 			   sizeof(struct ucc_geth_send_queue_qd),
 			   UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT);
 	if (IS_ERR_VALUE(ugeth->send_q_mem_reg_offset)) {
@@ -2797,7 +2797,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	}
 
 	ugeth->p_send_q_mem_reg =
-	    (struct ucc_geth_send_queue_mem_region *) qe_muram_addr(ugeth->
+	    (struct ucc_geth_send_queue_mem_region *) cpm_muram_addr(ugeth->
 			send_q_mem_reg_offset);
 	out_be32(&ugeth->p_tx_glbl_pram->sqptr, ugeth->send_q_mem_reg_offset);
 
@@ -2829,7 +2829,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	if (ug_info->numQueuesTx > 1) {
 	/* scheduler exists only if more than 1 tx queue */
 		ugeth->scheduler_offset =
-		    qe_muram_alloc(sizeof(struct ucc_geth_scheduler),
+		    cpm_muram_alloc(sizeof(struct ucc_geth_scheduler),
 				   UCC_GETH_SCHEDULER_ALIGNMENT);
 		if (IS_ERR_VALUE(ugeth->scheduler_offset)) {
 			if (netif_msg_ifup(ugeth))
@@ -2841,7 +2841,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		}
 
 		ugeth->p_scheduler =
-		    (struct ucc_geth_scheduler *) qe_muram_addr(ugeth->
+		    (struct ucc_geth_scheduler *) cpm_muram_addr(ugeth->
 							   scheduler_offset);
 		out_be32(&ugeth->p_tx_glbl_pram->schedulerbasepointer,
 			 ugeth->scheduler_offset);
@@ -2877,7 +2877,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	if (ug_info->
 	    statisticsMode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX) {
 		ugeth->tx_fw_statistics_pram_offset =
-		    qe_muram_alloc(sizeof
+		    cpm_muram_alloc(sizeof
 				   (struct ucc_geth_tx_firmware_statistics_pram),
 				   UCC_GETH_TX_STATISTICS_ALIGNMENT);
 		if (IS_ERR_VALUE(ugeth->tx_fw_statistics_pram_offset)) {
@@ -2891,7 +2891,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		}
 		ugeth->p_tx_fw_statistics_pram =
 		    (struct ucc_geth_tx_firmware_statistics_pram *)
-		    qe_muram_addr(ugeth->tx_fw_statistics_pram_offset);
+		    cpm_muram_addr(ugeth->tx_fw_statistics_pram_offset);
 		/* Zero out p_tx_fw_statistics_pram */
 		memset(ugeth->p_tx_fw_statistics_pram,
 		       0, sizeof(struct ucc_geth_tx_firmware_statistics_pram));
@@ -2919,7 +2919,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	/* Rx global PRAM */
 	/* Allocate global rx parameter RAM page */
 	ugeth->rx_glbl_pram_offset =
-	    qe_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
+	    cpm_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
 			   UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT);
 	if (IS_ERR_VALUE(ugeth->rx_glbl_pram_offset)) {
 		if (netif_msg_ifup(ugeth))
@@ -2930,7 +2930,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		return -ENOMEM;
 	}
 	ugeth->p_rx_glbl_pram =
-	    (struct ucc_geth_rx_global_pram *) qe_muram_addr(ugeth->
+	    (struct ucc_geth_rx_global_pram *) cpm_muram_addr(ugeth->
 							rx_glbl_pram_offset);
 	/* Zero out p_rx_glbl_pram */
 	memset(ugeth->p_rx_glbl_pram, 0, sizeof(struct ucc_geth_rx_global_pram));
@@ -2940,7 +2940,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	/* RQPTR */
 	/* Size varies with number of Rx threads */
 	ugeth->thread_dat_rx_offset =
-	    qe_muram_alloc(numThreadsRxNumerical *
+	    cpm_muram_alloc(numThreadsRxNumerical *
 			   sizeof(struct ucc_geth_thread_data_rx),
 			   UCC_GETH_THREAD_DATA_ALIGNMENT);
 	if (IS_ERR_VALUE(ugeth->thread_dat_rx_offset)) {
@@ -2953,7 +2953,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	}
 
 	ugeth->p_thread_data_rx =
-	    (struct ucc_geth_thread_data_rx *) qe_muram_addr(ugeth->
+	    (struct ucc_geth_thread_data_rx *) cpm_muram_addr(ugeth->
 							thread_dat_rx_offset);
 	out_be32(&ugeth->p_rx_glbl_pram->rqptr, ugeth->thread_dat_rx_offset);
 
@@ -2964,7 +2964,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	if (ug_info->
 	    statisticsMode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX) {
 		ugeth->rx_fw_statistics_pram_offset =
-		    qe_muram_alloc(sizeof
+		    cpm_muram_alloc(sizeof
 				   (struct ucc_geth_rx_firmware_statistics_pram),
 				   UCC_GETH_RX_STATISTICS_ALIGNMENT);
 		if (IS_ERR_VALUE(ugeth->rx_fw_statistics_pram_offset)) {
@@ -2977,7 +2977,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		}
 		ugeth->p_rx_fw_statistics_pram =
 		    (struct ucc_geth_rx_firmware_statistics_pram *)
-		    qe_muram_addr(ugeth->rx_fw_statistics_pram_offset);
+		    cpm_muram_addr(ugeth->rx_fw_statistics_pram_offset);
 		/* Zero out p_rx_fw_statistics_pram */
 		memset(ugeth->p_rx_fw_statistics_pram, 0,
 		       sizeof(struct ucc_geth_rx_firmware_statistics_pram));
@@ -2987,7 +2987,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 
 	/* Size varies with number of Rx queues */
 	ugeth->rx_irq_coalescing_tbl_offset =
-	    qe_muram_alloc(ug_info->numQueuesRx *
+	    cpm_muram_alloc(ug_info->numQueuesRx *
 			   sizeof(struct ucc_geth_rx_interrupt_coalescing_entry)
 			   + 4, UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT);
 	if (IS_ERR_VALUE(ugeth->rx_irq_coalescing_tbl_offset)) {
@@ -3001,7 +3001,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 
 	ugeth->p_rx_irq_coalescing_tbl =
 	    (struct ucc_geth_rx_interrupt_coalescing_table *)
-	    qe_muram_addr(ugeth->rx_irq_coalescing_tbl_offset);
+	    cpm_muram_addr(ugeth->rx_irq_coalescing_tbl_offset);
 	out_be32(&ugeth->p_rx_glbl_pram->intcoalescingptr,
 		 ugeth->rx_irq_coalescing_tbl_offset);
 
@@ -3055,7 +3055,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	/* RBDQPTR */
 	/* Size varies with number of Rx queues */
 	ugeth->rx_bd_qs_tbl_offset =
-	    qe_muram_alloc(ug_info->numQueuesRx *
+	    cpm_muram_alloc(ug_info->numQueuesRx *
 			   (sizeof(struct ucc_geth_rx_bd_queues_entry) +
 			    sizeof(struct ucc_geth_rx_prefetched_bds)),
 			   UCC_GETH_RX_BD_QUEUES_ALIGNMENT);
@@ -3069,7 +3069,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	}
 
 	ugeth->p_rx_bd_qs_tbl =
-	    (struct ucc_geth_rx_bd_queues_entry *) qe_muram_addr(ugeth->
+	    (struct ucc_geth_rx_bd_queues_entry *) cpm_muram_addr(ugeth->
 				    rx_bd_qs_tbl_offset);
 	out_be32(&ugeth->p_rx_glbl_pram->rbdqptr, ugeth->rx_bd_qs_tbl_offset);
 	/* Zero out p_rx_bd_qs_tbl */
@@ -3148,7 +3148,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		/* Allocate memory for extended filtering Mode Global
 		Parameters */
 		ugeth->exf_glbl_param_offset =
-		    qe_muram_alloc(sizeof(struct ucc_geth_exf_global_pram),
+		    cpm_muram_alloc(sizeof(struct ucc_geth_exf_global_pram),
 		UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT);
 		if (IS_ERR_VALUE(ugeth->exf_glbl_param_offset)) {
 			if (netif_msg_ifup(ugeth))
@@ -3160,7 +3160,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		}
 
 		ugeth->p_exf_glbl_param =
-		    (struct ucc_geth_exf_global_pram *) qe_muram_addr(ugeth->
+		    (struct ucc_geth_exf_global_pram *) cpm_muram_addr(ugeth->
 				 exf_glbl_param_offset);
 		out_be32(&ugeth->p_rx_glbl_pram->exfGlobalParam,
 			 ugeth->exf_glbl_param_offset);
@@ -3297,7 +3297,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	}
 
 	/* Allocate InitEnet command parameter structure */
-	init_enet_pram_offset = qe_muram_alloc(sizeof(struct ucc_geth_init_pram), 4);
+	init_enet_pram_offset = cpm_muram_alloc(sizeof(struct ucc_geth_init_pram), 4);
 	if (IS_ERR_VALUE(init_enet_pram_offset)) {
 		if (netif_msg_ifup(ugeth))
 			ugeth_err
@@ -3307,7 +3307,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		return -ENOMEM;
 	}
 	p_init_enet_pram =
-	    (struct ucc_geth_init_pram *) qe_muram_addr(init_enet_pram_offset);
+	    (struct ucc_geth_init_pram *) cpm_muram_addr(init_enet_pram_offset);
 
 	/* Copy shadow InitEnet command parameter structure into PRAM */
 	p_init_enet_pram->resinit1 = ugeth->p_init_enet_param_shadow->resinit1;
@@ -3336,7 +3336,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		     init_enet_pram_offset);
 
 	/* Free InitEnet command parameter */
-	qe_muram_free(init_enet_pram_offset);
+	cpm_muram_free(init_enet_pram_offset);
 
 	return 0;
 }
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index 430dc77..6bef6a8 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -16,6 +16,7 @@
 #define _ASM_POWERPC_QE_H
 #ifdef __KERNEL__
 
+#include <asm/cpm.h>
 #include <asm/immap_qe.h>
 
 #define QE_NUM_OF_SNUM	28
@@ -88,11 +89,6 @@ enum qe_clock qe_clock_source(const char *source);
 int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
 int qe_get_snum(void);
 void qe_put_snum(u8 snum);
-unsigned long qe_muram_alloc(int size, int align);
-int qe_muram_free(unsigned long offset);
-unsigned long qe_muram_alloc_fixed(unsigned long offset, int size);
-void qe_muram_dump(void);
-void *qe_muram_addr(unsigned long offset);
 
 /* Structure that defines QE firmware binary files.
  *
@@ -156,20 +152,6 @@ struct qe_bd {
 #define BD_STATUS_MASK	0xffff0000
 #define BD_LENGTH_MASK	0x0000ffff
 
-#define BD_SC_EMPTY	0x8000	/* Receive is empty */
-#define BD_SC_READY	0x8000	/* Transmit is ready */
-#define BD_SC_WRAP	0x2000	/* Last buffer descriptor */
-#define BD_SC_INTRPT	0x1000	/* Interrupt on change */
-#define BD_SC_LAST	0x0800	/* Last buffer in frame */
-#define BD_SC_CM	0x0200	/* Continous mode */
-#define BD_SC_ID	0x0100	/* Rec'd too many idles */
-#define BD_SC_P		0x0100	/* xmt preamble */
-#define BD_SC_BR	0x0020	/* Break received */
-#define BD_SC_FR	0x0010	/* Framing error */
-#define BD_SC_PR	0x0008	/* Parity error */
-#define BD_SC_OV	0x0002	/* Overrun */
-#define BD_SC_CD	0x0001	/* ?? */
-
 /* Alignment */
 #define QE_INTR_TABLE_ALIGN	16	/* ??? */
 #define QE_ALIGNMENT_OF_BD	8
-- 
1.5.2.2

^ permalink raw reply related

* Re: muram in device tree for mpc8250 in arch/powerpc
From: James Black @ 2008-03-20 18:02 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: Scott Wood
In-Reply-To: <b77025b40803191107x2f9a7884n9b7f062fcf45370@mail.gmail.com>

Scott,

>  > That's strange... how in particular was it killing it?  Which allocato=
r?
>  >
>  > Do you know which particular line of code is crashing?
>  >

I made the changes you suggested to the device tree and recompiled and
still get the same problem. The line that code execution stops is in


arch/powerpc/mm/mem.c: paging_init(),line 256, calls
                                    : free_area_init_nodes(), line 284, cal=
ls
                                    : free_area_init_node(), line 3902, cal=
ls
                                    : alloc_node_mem_map(), line 3460
<-- never returns

This is the device tree command line. If I don't pad the device tree
to 0x1000, then
I get this complaint from u-boot.

   Loading Device Tree to 007ff000, end 007ff909 ... OK
fdt_chosen: FDT_ERR_NOSPACE
ERROR: /chosen node create failed - must RESET the bo

I've also compiled without the -b option.
dtc -I dts -O dtb -S 0x1000 -b 0
../../linux-2.6.24/arch/powerpc/boot/dts/cta5000s.dts -o cta5000s.dtb


The following is the early kernel debugging output with debug turned
on in prom.c.


U-Boot 1.3.2 (Mar 14 2008 - 10:36:25)

MPC8250 Reset Status: External Soft, External Hard

MPC8250 Clock Configuration
 - Bus-to-Core Mult 2x, VCO Div 2, 60x Bus Freq  50-150, Core Freq 100-300
 - dfbrg 1, corecnf 0x04, busdf 3, cpmdf 1, plldf 0, pllmf 1, pcidf 3
 - vco_out  264000000, scc_clk   66000000, brg_clk   16500000
 - cpu_clk  132000000, cpm_clk  132000000, bus_clk   66000000

CPU:   MPC8250 (HiP4 Rev 14, Mask C.0 5K25A) at 132 MHz
Manuf: Aztek Networks, Inc.
Board: CTA5000S
       Watchdog enabled
DRAM:  64 MB
FLASH:  2 MB
In:    serial
Out:   serial
Err:   serial
Net:   FCC1 ETHERNET
IDE:   Bus 0: not available
Hit any key to stop autoboot:  0
Using FCC1 ETHERNET device
TFTP from server 192.168.1.20; our IP address is 192.168.1.10
Filename 'uImage'.
Load address: 0x2000000
Loading: #################################################################
         ######
done
Bytes transferred =3D 1035332 (fcc44 hex)
Using FCC1 ETHERNET device
TFTP from server 192.168.1.20; our IP address is 192.168.1.10
Filename 'uRamdisk'.
Load address: 0x2200000
Loading: #################################################################
         #####################################################
done
Bytes transferred =3D 1731966 (1a6d7e hex)
Using FCC1 ETHERNET device
TFTP from server 192.168.1.20; our IP address is 192.168.1.10
Filename 'cta5000s.dtb'.
Load address: 0x2400000
Loading: #
done
Bytes transferred =3D 4096 (1000 hex)
## Booting image at 02000000 ...
   Image Name:   Linux-2.6.24.2
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1035268 Bytes =3D 1011 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at 02200000 ...
   Image Name:   Simple Embedded Linux Framework
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    1731902 Bytes =3D  1.7 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Booting using the fdt at 0x2400000
   Loading Ramdisk to 039d9000, end 03b7fd3e ... OK
   Loading Device Tree to 007fe000, end 007fefff ... OK
Xid mach(): done
MMU:enter
MMU:hw init
MMU:mapin
MMU:setio
MMU:exit
 -> early_init_devtree(c07fe000)
search "chosen", depth: 0, uname:
search "chosen", depth: 1, uname: cpus
search "chosen", depth: 2, uname: PowerPC,8250@0
search "chosen", depth: 1, uname: memory
search "chosen", depth: 1, uname: localbus@f0010100
search "chosen", depth: 2, uname: flash@fe000000,0
search "chosen", depth: 1, uname: soc@f0000000
search "chosen", depth: 2, uname: cpm@119c0
search "chosen", depth: 3, uname: muram@0
search "chosen", depth: 4, uname: data@0
search "chosen", depth: 3, uname: brg@119f0
search "chosen", depth: 3, uname: serial@11a00
search "chosen", depth: 3, uname: serial@11a40
search "chosen", depth: 3, uname: ethernet@11300
search "chosen", depth: 2, uname: interrupt-controller@10c00
search "chosen", depth: 1, uname: chosen
Looking for initrd properties... <3>initrd_start=3D0xc39d9000  initrd_end=
=3D0xc3b7fe
Command line is:
dt_root_size_cells =3D 1
dt_root_addr_cells =3D 1
memory scan node memory, reg size 8, data: 0 4000000 2 1,
 - 0 ,  4000000
reserving: 39d9000 -> 1a6d3f
Phys. mem: 4000000
-> move_device_tree
<- move_device_tree
Scanning CPUs ...
boot cpu: logical 0 physical 0
 <- early_init_devtree()
Using Aztek Networks cta5000s machine description
Linux version 2.6.24.2 (jblack@jblack.azteknetworks.net) (gcc version 4.2.2=
) #38
 -> unflatten_device_tree()
  size is bd4, allocating...
  unflattening c3fff428...
fixed up name for  ->
fixed up name for cpus -> cpus
fixed up name for PowerPC,8250@0 -> PowerPC,8250
fixed up name for memory -> memory
fixed up name for localbus@f0010100 -> localbus
fixed up name for flash@fe000000,0 -> flash
fixed up name for soc@f0000000 -> soc
fixed up name for cpm@119c0 -> cpm
fixed up name for muram@0 -> muram
fixed up name for data@0 -> data
fixed up name for brg@119f0 -> brg
fixed up name for serial@11a00 -> serial
fixed up name for serial@11a40 -> serial
fixed up name for ethernet@11300 -> ethernet
fixed up name for interrupt-controller@10c00 -> interrupt-controller
fixed up name for chosen -> chosen
 <- unflatten_device_tree()
Found initrd at 0xc39d9000:0xc3b7fd3e
console [udbg0] enabled
setup_arch: bootmem
cta5000s_setup_arch(): entry
cpm_muran_init(): entry
cpm_muran_init(): exit
init_ioports(): empty
cta5000s_setup_arch(): exit
setup_arch: exit
Zone PFN ranges:
  DMA             0 ->    16384
  Normal      16384 ->    16384
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0:        0 ->    16384
Unable to handle kernel paging request for data at address 0xe001a000
Faulting instruction address: 0xc00e1a6c
Oops: Kernel access of bad area, sig: 11 [#1]
Unable to handle kernel paging request for data at address 0x401c1ae0
Faulting instruction address: 0xc00e6254
Oops: Kernel access of bad area, sig: 11 [#2]
Unable to handle kernel paging request for data at address 0x401c1ae0
Faulting instruction address: 0xc00e6254
Recursive die() failure, output suppressed
---[ end trace 8640abe69a316dee ]---
Kernel panic - not syncing: Attempted to kill the idle task!

>  > > I tried to fully describe the segments in muram node and it seems to
>  > > mess things up even worse.
>  >
>  > What do you mean?  What changes did you make, and what was the result?

I changed the muram node description to describe all the segments in
the dual port ram of the immr for the 8250. The thinking was that I
needed to describe the non-contiguous portions in the immr. The user
manual (page 3-1) shows the immr to be defined as:

0x00000=960x03FFF Dual-port RAM (DPRAM1) R/W 16 Kbytes
0x04000=960x05FFF Dual-port RAM (microcode only) (DPRAM)1 R/W 8 Kbytes
0x06000=960x07FFF Reserved =97 8 Kbytes
0x08000=960x08FFF Dual-port RAM (DPRAM2) R/W 4 Kbytes
0x09000=960x0AFFF Reserved =97 8 Kbytes
0x0B000=960x0BFFF Dual-port RAM (DPRAM3) R/W 4 Kbytes
0x0C000=960x0FFFF Reserved =97 16 Kbytes

muram@0 {
   #address-cells =3D <1>;
   #size-cells =3D <1>;
   ranges =3D <0 0 10000>;

   data@0 {
      compatible =3D "fsl,cpm-muram-data";
      reg =3D <0 4000 8000 1000 B000 1000>;
   };
};

Sometimes I get a stack trace, sometimes I don't.

Unable to handle kernel paging request for data at address 0xde7ebbe7
Faulting instruction address: 0xc00114fc
Oops: Kernel access of bad area, sig: 11 [#1]

[c023ff20] [c001a498] printk+0x50/0x60 (unreliable)
[c023ff40] [c01110a0] of_get_property+0x10/0x34
[c023ff50] [c01110e8] of_device_is_compatible+0x24/0xa0
[c023ff80] [c01111dc] of_find_compatible_node+0x78/0xc4
[c023ffa0] [c0211020] cta5000s_pic_init+0x24/0x6c
[c023ffb0] [c020c880] init_IRQ+0x24/0x34
[c023ffc0] [c0206948] start_kernel+0x17c/0x2b8
[c023fff0] [00003438] 0x3438

^ permalink raw reply

* Re: muram in device tree for mpc8250 in arch/powerpc
From: Scott Wood @ 2008-03-20 18:20 UTC (permalink / raw)
  To: James Black; +Cc: linuxppc-embedded
In-Reply-To: <b77025b40803201102w200dde6fuc4235d9a3cb8b0dd@mail.gmail.com>

James Black wrote:
> Zone PFN ranges:
>   DMA             0 ->    16384
>   Normal      16384 ->    16384
> Movable zone start PFN for each node
> early_node_map[1] active PFN ranges
>     0:        0 ->    16384
> Unable to handle kernel paging request for data at address 0xe001a000
> Faulting instruction address: 0xc00e1a6c

What function is 0xc00e1a6c in?

Is it possible that you have an SMC device initialized by your firmware 
that is corrupting parameter RAM?

> muram@0 {
>    #address-cells = <1>;
>    #size-cells = <1>;
>    ranges = <0 0 10000>;
> 
>    data@0 {
>       compatible = "fsl,cpm-muram-data";
>       reg = <0 4000 8000 1000 B000 1000>;

You can't use all of 0x8000-0x8fff; there is device parameter RAM in 
there.  If you can figure out the portions that aren't in use, you can 
use those, but I wouldn't bother unless you really need the extra muram.

-Scott

^ permalink raw reply

* Re: [BUG]2.6.25-rc6:Unable to handle kernel paging request
From: Sudhir Kumar @ 2008-03-20 18:42 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Poornima Nayak, linuxppc-dev, akpm, skumar, linux-kernel
In-Reply-To: <18400.36670.5918.566965@cargo.ozlabs.ibm.com>

On Wed, Mar 19, 2008 at 02:57:50PM +1100, Paul Mackerras wrote:
> Sudhir Kumar writes:
> 
> > Unable to handle kernel paging request for data at address
> > 0xd00008000000002e
> 
> Looks like some driver tried to access I/O port 0x2e without checking
> whether there was possibly anything there first.
> 
> > Faulting instruction address: 0xc00000000074ded8
> > cpu 0x0: Vector: 300 (Data Access) at [c00000003e073aa0]
> >     pc: c00000000074ded8: .f71805f_find+0x44/0x32c
> >     lr: c00000000074e1f8: .f71805f_init+0x38/0x194
> >     sp: c00000003e073d20
> >    msr: 8000000000009032
> >    dar: d00008000000002e
> >  dsisr: 42000000
> >   current = 0xc0000000220851c0
> >   paca    = 0xc0000000007c2700
> >     pid   = 1, comm = swapper
> > enter ? for help
> > [c00000003e073dc0] c00000000074e1f8 .f71805f_init+0x38/0x194
> 
> Looks like it might be the f71805f driver, whatever that is...
> Hmmm, drivers/hwmon/f71805f.c looks like it, and indeed it does go
> poking around in PCI I/O space with no checks whatever.
> 
> I suggest you turn off CONFIG_SENSORS_F71805F.
It was a new feature so I turned it on while compiling.
I have tried by turning off CONFIG_SENSORS_F71805F but the bug
is still present.
> 
> It doesn't help, of course, that CONFIG_HWMON defaults to y. :(
> 
> Paul.
Thanks
Sudhir Kumar
ISTL IBM

^ permalink raw reply

* Re: [PATCH 3/3] [POWERPC] Xilinx: boot support for Xilinx uart 16550.
From: Grant Likely @ 2008-03-20 21:07 UTC (permalink / raw)
  To: John Linn, linuxppc-dev
In-Reply-To: <20080320175601.5D86217C8055@mail127-sin.bigfish.com>

On Thu, Mar 20, 2008 at 11:55 AM, John Linn <John.Linn@xilinx.com> wrote:
> Hi Grant,
>
>  We could create a xilinx name, "xlnx,uart16550", and only use that
>  without the versions.
>

I'm okay with this as long as you don't drop the versioned property
also.  ie. Each compatible node should contain 2 strings.  The exact
version and the generic string.

My preference is something even more generic like "sparse16550" simply
because there is precedence for such a thing before Xilinx came along
(specifically, an 16550 device with reg shift and offset values).
Since it is a common variant and If you document exactly what it
means, then it should be okay to create a compatible property without
the 'xlnx,' prefix.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 3/3] [POWERPC] Xilinx: boot support for Xilinx uart 16550.
From: Grant Likely @ 2008-03-20 21:18 UTC (permalink / raw)
  To: John Linn; +Cc: linuxppc-dev
In-Reply-To: <20080320161834.A873BDE0072@mail96-dub.bigfish.com>

On Thu, Mar 20, 2008 at 10:15 AM, John Linn <John.Linn@xilinx.com> wrote:
> You're right.  Rick and I were just talking about could we not check the
>  versions but just make sure the device is the right type independent of
>  the versions.
>
>  This issue will be true for all the Xilinx drivers.
>
>  I think FPGA IP is a little different in that the hardware can change
>  much more often than in hard devices.

Exactly, so all your compatible properties should look something like
one of the following:

compatible = "xlnx,xps-uart16550-2.00.b", "spares16550";
 - or -
compatible = "xlnx,xps-uart16550-2.00.b", "xlnx,opb-uart16550-1.00c",
"sparse16550";
 - or -
compatible = "xlnx,xps-uart16550-2.00.b", "xlnx,opb-uart16550-1.00c";

Notice that the exact version is *always* there.  Followed by versions
that it is exactly backwards compatible with.  As I said, I personally
like the string "sparse16550", but if other people complain about it
then pick the earliest version of the part that it is backwards
compatible with and use that version string (like in my third example
above).

The reason "xlnx,uart16550" isn't a good idea is because it isn't a
real part thing.  It is a made up idea of what the thing is, but it
isn't grounded in a particular implementation.  (Note that even
ns16550 is a real part).  The problem with 'virtual' compatible
properties is that because they aren't grounded; the temptation is to
shift their definition over time as newer parts come out that behave
differently.  It is really hard to shift the definition of something
that is exactly specified.

Side note; While I do like sparse16550, it may also not be a good idea
for the same reason that "xlnx,uart16550" is not a good idea.
However, the risk is much lower because there is already a fair amount
of precedence of 'sparse' 16550 devices in the wild and their behavior
is well known.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: Oops with TQM5200 on TQM5200
From: Grant Likely @ 2008-03-20 21:27 UTC (permalink / raw)
  To: Bartlomiej Sieka; +Cc: linuxppc-dev, Anatolij Gustschin
In-Reply-To: <47E28E15.2070809@semihalf.com>

On Thu, Mar 20, 2008 at 10:17 AM, Bartlomiej Sieka <tur@semihalf.com> wrote:
> Anatolij Gustschin wrote:
>  > Hello Wolfgang,
>  >
>  > Wolfgang Grandegger wrote:
>  >
>  >> I just tried Linux 2.6.25-rc6 on my TQM5200 module and got the attached
>  >> oops. Are there any known patches fixing the problems?
>  >
>  > try the patch below for tqm5200.dts, rebuild dtb and boot
>  > again. Not sure if it works for Linux 2.6.25-rc6, but for
>  > 2.6.25-rc3 it does.
>
>  It helps 2.6.25-rc6 too - thanks Anatolij.
>
>
>  >
>  > Anatolij
>  > --
>  > diff --git a/arch/powerpc/boot/dts/tqm5200.dts
>  > b/arch/powerpc/boot/dts/tqm5200.dts
>  > index c86464f..7c23bb3 100644
>  > --- a/arch/powerpc/boot/dts/tqm5200.dts
>  > +++ b/arch/powerpc/boot/dts/tqm5200.dts
>  > @@ -83,6 +83,7 @@
>  >         };
>  >
>  >         dma-controller@1200 {
>  > +            device_type = "dma-controller";
>
>  This actually fixes the Oops.

Hmm, this sounds like a band-aid; the kernel shouldn't oops if this is
missing from the device tree.  Fail, perhaps, but oops is worrisome.
Would someone like to investigate?

In fact, device_type should not be necessary at all, but that's beside
the point.

>  > @@ -127,10 +128,25 @@
>  >         ethernet@3000 {
>  >             device_type = "network";
>  >             compatible = "fsl,mpc5200-fec";
>  > -            reg = <3000 800>;
>  > +            reg = <3000 400>;
>  >             local-mac-address = [ 00 00 00 00 00 00 ];
>  >             interrupts = <2 5 0>;
>  >             interrupt-parent = <&mpc5200_pic>;
>  > +            phy-handle = <&phy0>;
>  > +        };
>  > +
>  > +        mdio@3000 {
>  > +            #address-cells = <1>;
>  > +            #size-cells = <0>;
>  > +            compatible = "fsl,mpc5200b-mdio";
>  > +            reg = <3000 400>;       // fec range, since we need to
>  > setup fec interrupts
>  > +            interrupts = <2 5 0>;   // these are for "mii command
>  > finished", not link changes & co.
>  > +            interrupt-parent = <&mpc5200_pic>;
>  > +
>  > +            phy0:ethernet-phy@0 {
>  > +                device_type = "ethernet-phy";
>  > +                reg = <0>;
>  > +            };
>
>  And this fixes networking issues (NFS-mounted rootfs timeouts, etc).
>  BTW: it's been posted a while back
>  (http://patchwork.ozlabs.org/linuxppc/patch?q=Balakowicz&id=16197) but
>  didn't get merged.
>
>  Grant -- any chances these fixes could be rushed upstream?

Nuts, I dropped it on the floor.  I'll pick this up.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* DTS question
From: Sean MacLennan @ 2008-03-20 21:33 UTC (permalink / raw)
  To: linuxppc-dev

The warp has an AD7414 chip hanging off the I2C bus. This chip can
raise an interrupt when it crosses a critical threshold.

This interrupt is tied to IRQ2 from the processor. What is the best
way to describe this interrupt in the DTS?

The warp.dts is available on request, but the one in the for-2.6.25
tree is relatively up to date.

Cheers,
   Sean

^ permalink raw reply

* Re: DTS question
From: Segher Boessenkool @ 2008-03-20 21:47 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <20080320173302.7075a1d9@lappy.seanm.ca>

> The warp has an AD7414 chip hanging off the I2C bus. This chip can
> raise an interrupt when it crosses a critical threshold.
>
> This interrupt is tied to IRQ2 from the processor.

No it's not.  PowerPC has only one interrupt [*].  You probably
mean it is tied to IRQ2 on your "main" interrupt controller?

> What is the best
> way to describe this interrupt in the DTS?

You set the "interrupts" property to contain a description for
this interrupt: likely simply <2 sense>.  The exact format (and
the values for "sense") depend on the exact kind of interrupt
controller.

If there is weird interrupt routing, you might need to set an
"interrupt-parent" property as well, pointing to this interrupt
controller.


Segher

^ permalink raw reply

* Re: DTS question
From: Scott Wood @ 2008-03-20 21:48 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <20080320173302.7075a1d9@lappy.seanm.ca>

Sean MacLennan wrote:
> The warp has an AD7414 chip hanging off the I2C bus. This chip can
> raise an interrupt when it crosses a critical threshold.
> 
> This interrupt is tied to IRQ2 from the processor. What is the best
> way to describe this interrupt in the DTS?
> 
> The warp.dts is available on request, but the one in the for-2.6.25
> tree is relatively up to date.

Add a node for the ad7414 under the i2c bus, and put the interrupt 
specifier there.  For best results, convert the ad7414 driver into a 
new-style i2c driver.

-Scott

^ permalink raw reply

* Re: [PATCH] ehea: Fix IPv6 support
From: Andrew Morton @ 2008-03-20 21:54 UTC (permalink / raw)
  To: Thomas Klein
  Cc: jeff, themann, netdev, hering2, linux-kernel, linuxppc-dev,
	raisch, stefan.roscher, stable
In-Reply-To: <200803191355.44266.osstklei@de.ibm.com>

On Wed, 19 Mar 2008 13:55:43 +0100
Thomas Klein <osstklei@de.ibm.com> wrote:

> Indicate that HEA calculates IPv4 checksums only
> 
> Signed-off-by: Thomas Klein <tklein@de.ibm.com>
> 
> ---
> diff -Nurp -X dontdiff linux-2.6.25-rc6/drivers/net/ehea/ehea.h patched_kernel/drivers/net/ehea/ehea.h
> --- linux-2.6.25-rc6/drivers/net/ehea/ehea.h	2008-03-17 00:32:14.000000000 +0100
> +++ patched_kernel/drivers/net/ehea/ehea.h	2008-03-19 08:58:07.000000000 +0100
> @@ -40,7 +40,7 @@
>  #include <asm/io.h>
>  
>  #define DRV_NAME	"ehea"
> -#define DRV_VERSION	"EHEA_0087"
> +#define DRV_VERSION	"EHEA_0089"
>  
>  /* eHEA capability flags */
>  #define DLPAR_PORT_ADD_REM 1
> diff -Nurp -X dontdiff linux-2.6.25-rc6/drivers/net/ehea/ehea_main.c patched_kernel/drivers/net/ehea/ehea_main.c
> --- linux-2.6.25-rc6/drivers/net/ehea/ehea_main.c	2008-03-17 00:32:14.000000000 +0100
> +++ patched_kernel/drivers/net/ehea/ehea_main.c	2008-03-19 08:58:07.000000000 +0100
> @@ -3108,7 +3108,7 @@ struct ehea_port *ehea_setup_single_port
>  	dev->vlan_rx_add_vid = ehea_vlan_rx_add_vid;
>  	dev->vlan_rx_kill_vid = ehea_vlan_rx_kill_vid;
>  	dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
> -		      | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_HW_VLAN_TX
> +		      | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
>  		      | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
>  		      | NETIF_F_LLTX;
>  	dev->tx_timeout = &ehea_tx_watchdog;

That looks like a pretty significant fix to me?  Should it be backported to
2.6.24.x?

^ permalink raw reply

* Re: [PATCH 3/3] [POWERPC] Xilinx: boot support for Xilinx uart 16550.
From: Grant Likely @ 2008-03-20 22:04 UTC (permalink / raw)
  To: John Linn; +Cc: linuxppc-dev
In-Reply-To: <20080320144402.695C1518064@mail63-sin.bigfish.com>

On Thu, Mar 20, 2008 at 8:43 AM, John Linn <john.linn@xilinx.com> wrote:
> The Xilinx 16550 uart core is not a standard 16550, because it uses
>  word-based addressing rather than byte-based addressing.  As a result,
>  it is not compatible with the open firmware 'ns16550' compatible
>  binding.
>
>  This code adds the Xilinx uart 16550 to the serial console
>  of the boot. A new initialization function for the Xilinx 16550 uart
>  is added to the ns16550 driver. It sets up the correct register base
>  and regshift properties specific to the Xilinx 16550.
>
>  Signed-off-by: John Linn <john.linn@xilinx.com>
>  ---
>   arch/powerpc/boot/ns16550.c |   24 ++++++++++++++++++++++++
>   arch/powerpc/boot/ops.h     |    1 +
>   arch/powerpc/boot/serial.c  |    8 ++++++++
>   3 files changed, 33 insertions(+), 0 deletions(-)
>
>  diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c
>  index f8f1b2f..5385255 100644
>  --- a/arch/powerpc/boot/ns16550.c
>  +++ b/arch/powerpc/boot/ns16550.c
>  @@ -77,3 +77,27 @@ int ns16550_console_init(void *devp, struct serial_console_data *scdp)
>
>         return 0;
>   }
>  +
>  +int xilinx16550_console_init(void *devp, struct serial_console_data *scdp)
>  +{
>  +       int n;
>  +       unsigned long reg_phys;
>  +
>  +       n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base));
>  +       if (n != sizeof(reg_base)) {
>  +               if (!dt_xlate_reg(devp, 0, &reg_phys, NULL))
>  +                       return -1;
>  +
>  +               reg_base = (void *)reg_phys + 3;
>  +       }
>  +
>  +       reg_shift = 2;
>  +
>  +       scdp->open = ns16550_open;
>  +       scdp->putc = ns16550_putc;
>  +       scdp->getc = ns16550_getc;
>  +       scdp->tstc = ns16550_tstc;
>  +       scdp->close = NULL;
>  +
>  +       return 0;

This is mostly duplicated code.  xilinx16550_console_init should
simply call ns16550_console_init and then modify reg_base/reg_shift
after it returns.

However, if something like sparse16550 is used, then the need for this
function disappears.  In fact, ns16550_console_init already supports
the reg-shift property.  It just doesn't know about the 3 byte offset.

Cheers,
g.



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: DTS question
From: Sean MacLennan @ 2008-03-20 22:19 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20080320173302.7075a1d9@lappy.seanm.ca>

Ok, here is what I did....

IIC0: i2c@ef600700 {
	compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic"; 
	reg = <ef600700 14>; 
	interrupt-parent = <&UIC0>;
	interrupts = <2 4>;
	index = <0>;

	ad7414 {
		compatible = "ad7414";
		interrupts = <19 8>;
		interrupt-parent = <&UIC0>;
	};
};

Comments?

Cheers,
   Sean

^ permalink raw reply

* Re: DTS question
From: Scott Wood @ 2008-03-20 22:26 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev
In-Reply-To: <20080320181926.2ff7e297@lappy.seanm.ca>

Sean MacLennan wrote:
> Ok, here is what I did....
> 
> IIC0: i2c@ef600700 {
> 	compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic"; 
> 	reg = <ef600700 14>; 
> 	interrupt-parent = <&UIC0>;
> 	interrupts = <2 4>;
> 	index = <0>;
> 
> 	ad7414 {
> 		compatible = "ad7414";

This should proabably have a manufacturer prefix.

> 		interrupts = <19 8>;
> 		interrupt-parent = <&UIC0>;
> 	};

Should have a reg property indicating the i2c address, and 
#address-cells = <1>/#size-cells = <0> in the i2c controller node.

-Scott

^ permalink raw reply

* Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU
From: Andrew Morton @ 2008-03-20 22:27 UTC (permalink / raw)
  To: York Sun
  Cc: linux-fbdev-devel, Peter Zijlstra, linux-kernel, yorksun,
	linuxppc-dev, timur
In-Reply-To: <12059526274026-git-send-email-yorksun@freescale.com>

On Wed, 19 Mar 2008 13:50:26 -0500
York Sun <yorksun@freescale.com> wrote:

> The following features are supported:
> plane 0 works as a regular frame buffer, can be accessed by /dev/fb0
> plane 1 has two AOIs (area of interest), can be accessed by /dev/fb1 and /dev/fb2
> plane 2 has two AOIs, can be accessed by /dev/fb3 and /dev/fb4
> Special ioctls support AOIs
> 
> All /dev/fb* can be used as regular frame buffer devices, except hardware change can
> only be made through /dev/fb0. Changing pixel clock has no effect on other fbs.
> 
> Limitation of usage of AOIs:
> AOIs on the same plane can not be horizonally overlapped
> AOIs have horizonal order, i.e. AOI0 should be always on top of AOI1
> AOIs can not beyond phisical display area. Application should check AOI geometry
> before changing physical resolution on /dev/fb0
> 
> required command line parameters to preallocate memory for frame buffer
> diufb=15M
> 
> optional command line parameters to set modes and monitor
> video=fslfb:[resolution][,bpp][,monitor]
> Syntax:
> 
> Resolution
> xres x yres-bpp@refresh_rate, the -bpp and @refresh_rate are optional
> eg, 1024x768, 1280x1024, 1280x1024-32, 1280x1024@60, 1280x1024-32@60, 1280x480-32@60
> 
> Bpp
> bpp=32, bpp=24, or bpp=16
> 
> Monitor
> monitor=0, monitor=1, monitor=2
> 0 is DVI
> 1 is Single link LVDS
> 2 is Double link LVDS
> 
> Note: switching monitor is a board feather, not DIU feather. MPC8610HPCD has three
> monitor ports to swtich to. MPC5121ADS doesn't have additional monitor port. So switching
> monirot port for MPC5121ADS has no effect.
> 
> If compiled as a module, it takes pamameters mode, bpp, monitor with the same syntax above.
> 
> ...
>
> +static struct diu_hw dr = {
> +	.mode = MFB_MODE1,
> +	.reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
> +};

I'm not clear on what's supposed to happen with __SPIN_LOCK_UNLOCKED().  I
do know that its documentation is crap.

I guess you should have used SPIN_LOCK_UNLOCKED there rather than
open-coding its equivalent.  And SPIN_LOCK_UNLOCKED _is_ documented.  It
says "don't use this".

Now, s/documentation/guesswork-and-grep/ says that you're supposed to pick
a tree-wide-unique string here as your lockdep key.

So I did this:

--- a/drivers/video/fsl-diu-fb.c~fbdev-driver-for-freescale-8610-and-5121-diu-fix
+++ a/drivers/video/fsl-diu-fb.c
@@ -274,7 +274,7 @@ static struct mfb_info mfb_template[] = 
 
 static struct diu_hw dr = {
 	.mode = MFB_MODE1,
-	.reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
+	.reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
 };
 
 static struct diu_pool pool;

> +static struct diu_pool pool;
> +
> +/*	To allocate memory for framebuffer. First try __get_free_pages(). If it
> + *	fails, try rh_alloc. The reason is __get_free_pages() cannot allocate
> + *	very large memory (more than 4MB). We don't want to allocate all memory
> + *	in rheap since small memory allocation/deallocation will fragment the
> + *	rheap and make the furture large allocation fail.
> + */
> +
> +void *fsl_diu_alloc(unsigned long size, phys_addr_t *phys)
> +{
> +	void *virt;
> +
> +	pr_debug("size=%lu\n", size);
> +
> +	virt = (void *)__get_free_pages(GFP_DMA | GFP_ATOMIC, get_order(size));

GFP_DMA implies GFP_ATOMIC, but it's appropriate for documentation purposes.

> +	if (virt) {
> +		*phys = virt_to_phys(virt);
> +		pr_debug("virt %p, phys=%llx\n", virt, (uint64_t) *phys);
> +		memset(virt, 0, size);

Could have used __GFP_ZERO, I guess.

> +		return virt;
> +	}
> +	if (!diu_ops.diu_mem) {
> +		printk(KERN_INFO "%s: no diu_mem."
> +			" To reserve more memory, put 'diufb=15M' "
> +			"in the command line\n", __func__);
> +		return NULL;
> +	}
> +
> +	virt = (void *) rh_alloc(&diu_ops.diu_rh_info, size, "DIU");

hm, I'd have expected checkpatch to whine about the space after the cast
there.  Whatever.

checkpatch does turn up some significant problems:

WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
#205: FILE: drivers/video/fsl-diu-fb.c:32:
+#include <asm/uaccess.h>

WARNING: consider using strict_strtoul in preference to simple_strtoul
#1599: FILE: drivers/video/fsl-diu-fb.c:1426:
+       val = simple_strtoul(buf, last, 0);

WARNING: consider using strict_strtoul in preference to simple_strtoul
#1821: FILE: drivers/video/fsl-diu-fb.c:1648:
+                       val = simple_strtoul(opt + 8, NULL, 0);

WARNING: consider using strict_strtoul in preference to simple_strtoul
#1825: FILE: drivers/video/fsl-diu-fb.c:1652:
+                       default_bpp = simple_strtoul(opt + 4, NULL, 0);


please take a look, and please use checkpatch on all future patches.

> +	if (virt) {
> +		*phys = virt_to_bus(virt);
> +		memset(virt, 0, size);
> +	}
> +
> +	pr_debug("rh virt=%p phys=%lx\n", virt, *phys);
> +
> +	return virt;
> +}
> +
> +void fsl_diu_free(void *p, unsigned long size)
> +{
> +	pr_debug("p=%p size=%lu\n", p, size);
> +
> +	if (!p)
> +		return;
> +
> +	if ((p >= diu_ops.diu_mem) &&
> +	    (p < (diu_ops.diu_mem + diu_ops.diu_size))) {
> +		pr_debug("rh\n");
> +		rh_free(&diu_ops.diu_rh_info, (unsigned long) p);
> +	} else {
> +		pr_debug("dma\n");
> +		free_pages((unsigned long)p, get_order(size));
> +	}
> +}
> +
> +
> +/*
> + * Checks to see if the hardware supports the state requested by var passed
> + * in. This function does not alter the hardware state! If the var passed in
> + * is slightly off by what the hardware can support then we alter the var
> + * PASSED in to what we can do. If the hardware doesn't support mode change
> + * a -EINVAL will be returned by the upper layers.
> + */
> +static int fsl_diu_check_var
> +	(struct fb_var_screeninfo *var, struct fb_info *info)

Like this:

static int fsl_diu_check_var(struct fb_var_screeninfo *var,
				struct fb_info *info)

please.

> +{
> +	unsigned long htotal, vtotal;
> +	struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
> +	struct fsl_diu_data *machine_data = mfbi->parent;
> +	int index = mfbi->index;
> +
>
> ..
>
> +static void update_lcdc(struct fb_info *info)
> +{
> +	struct fb_var_screeninfo *var = &info->var;
> +	struct mfb_info *mfbi = info->par;
> +	struct fsl_diu_data *machine_data = mfbi->parent;
> +	struct diu *hw;
> +	int i, j;
> +	char __iomem *cursor_base, *gamma_table_base;
> +
> +	u32 temp;
> +
> +	spin_lock_init(&dr.reg_lock);

we already did that at compile-time?

> +	hw = dr.diu_reg;
> +
> +	if (mfbi->type == MFB_TYPE_OFF) {
> +		fsl_diu_disable_panel(info);
> +		return;
> +	}
>
> ...
>
> +static void request_irq_local(int irq)
> +{
> +	unsigned long status, ints;
> +	struct diu *hw;
> +
> +	hw = dr.diu_reg;
> +
> +	/* Read to clear the status */
> +	status = in_be32(&(hw->int_status));
> +
> +	if (request_irq(irq, fsl_diu_isr, 0, "diu", 0))
> +		pr_info("Request diu IRQ failed.\n");
> +	else {
> +		ints = INT_PARERR | INT_LS_BF_VS;
> +#if !defined(CONFIG_NOT_COHERENT_CACHE)
> +		ints |=	INT_VSYNC;
> +#endif
> +		if (dr.mode == MFB_MODE2 || dr.mode == MFB_MODE3)
> +			ints |= INT_VSYNC_WB;
> +
> +		/* Read to clear the status */
> +		status = in_be32(&(hw->int_status));
> +		out_be32(&(hw->int_mask), ints);
> +	}
> +}

The request_irq() return value gets dropped on the floor.

> +static void free_irq_local(int irq)
> +{
> +	struct diu *hw = dr.diu_reg;
> +
> +	/* Disable all LCDC interrupt */
> +	out_be32(&(hw->int_mask), 0x1f);
> +
> +	free_irq(irq, 0);
> +}

and the free_irq() will go splat?

> +#ifdef CONFIG_PM
> +/*
> + * Power management hooks. Note that we won't be called from IRQ context,
> + * unlike the blank functions above, so we may sleep.
> + */
> +static int fsl_diu_suspend(struct of_device *dev, pm_message_t state)
> +{
> +	struct fsl_diu_data *machine_data;
> +
> +	machine_data = dev_get_drvdata(&ofdev->dev);
> +	disable_lcdc(machine_data->fsl_diu_info[0]);
> +
> +	return 0;
> +}
> +
> +static int fsl_diu_resume(struct of_device *dev)
> +{
> +	struct fsl_diu_data *machine_data;
> +
> +	machine_data = dev_get_drvdata(&ofdev->dev);
> +	enable_lcdc(machine_data->fsl_diu_info[0]);
> +
> +	return 0;
> +}

Conventionally we'll do

#else
#define fsl_diu_suspend NULL
#define fsl_diu_resume NULL

here, then remove the ifdefs from fsl_diu_driver.

> +#endif				/* CONFIG_PM */
> +
> +/* Align to 64-bit(8-byte), 32-byte, etc. */
> +static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align)
> +{
> +	u32 offset, ssize;
> +	u32 mask;
> +	dma_addr_t paddr = 0;
> +
> +	ssize = size + bytes_align;
> +	buf->vaddr = dma_alloc_coherent(0, ssize, &paddr, GFP_DMA | GFP_KERNEL);
> +	if (!buf->vaddr)
> +		return -ENOMEM;
> +
> +	buf->paddr = (__u32) paddr;
> +	memset(buf->vaddr, 0, ssize);

__GFP_ZERO?

> +	mask = bytes_align - 1;
> +	offset = (u32)buf->paddr & mask;
> +	if (offset) {
> +		buf->offset = bytes_align - offset;
> +		buf->paddr = (u32)buf->paddr + offset;
> +	} else
> +		buf->offset = 0;
> +	return 0;
> +}
> +
> +static int fsl_diu_probe(struct of_device *ofdev,
> +	const struct of_device_id *match)
> +{
> +	struct device_node *np = ofdev->node;
> +	struct mfb_info *mfbi;
> +	phys_addr_t dummy_ad_addr;
> +	int ret, i, error = 0;
> +	struct resource res;
> +	struct fsl_diu_data *machine_data;
> +
> +	machine_data = kzalloc(sizeof(struct fsl_diu_data), GFP_KERNEL);
> +	if (!machine_data)
> +		return -ENOMEM;
> +
> +	for (i = 0; i < sizeof(machine_data->fsl_diu_info) /
> +			sizeof(struct fb_info *); i++) {

Please use ARRAY_SIZE() here, and in all the other places which open-code
it.

> +		machine_data->fsl_diu_info[i] =
> +			framebuffer_alloc(sizeof(struct mfb_info), &ofdev->dev);
> +		if (!machine_data->fsl_diu_info[i]) {
> +			dev_err(&ofdev->dev, "cannot allocate memory\n");
> +			ret = -ENOMEM;
> +			goto error2;
> +		}

^ permalink raw reply

* Re: [PATCH 2/2 v2] Add DIU platform code for MPC8610HPCD
From: Andrew Morton @ 2008-03-20 22:33 UTC (permalink / raw)
  To: York Sun; +Cc: linux-fbdev-devel, linux-kernel, linuxppc-dev, yorksun
In-Reply-To: <12059526271964-git-send-email-yorksun@freescale.com>

On Wed, 19 Mar 2008 13:50:27 -0500
York Sun <yorksun@freescale.com> wrote:

> Add platform code to support Freescale DIU. The platform code includes
> framebuffer memory allocation, pixel format, monitor port, etc.
>
> ...
>
> +unsigned int mpc8610hpcd_get_pixel_format
> +	(unsigned int bits_per_pixel, int monitor_port)

Again, please do

unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel,
					int monitor_port)

(and anywhere else where this was done)

> +int __init preallocate_diu_videomemory(void);

Nope, please don't put extern declarations in .c files.  Find a suitable
header for it - one which is included by the defining file and by all users
of the symbol.

Andy, checkpatch missed this.

>  }
>  #endif
> +

^ permalink raw reply

* Re: muram in device tree for mpc8250 in arch/powerpc
From: James Black @ 2008-03-20 23:02 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-embedded
In-Reply-To: <47E2AADD.6090101@freescale.com>

On Thu, Mar 20, 2008 at 12:20 PM, Scott Wood <scottwood@freescale.com> wrote:
> James Black wrote:
>  > Zone PFN ranges:
>  >   DMA             0 ->    16384
>  >   Normal      16384 ->    16384
>  > Movable zone start PFN for each node
>  > early_node_map[1] active PFN ranges
>  >     0:        0 ->    16384
>  > Unable to handle kernel paging request for data at address 0xe001a000
>  > Faulting instruction address: 0xc00e1a6c
>
>  What function is 0xc00e1a6c in?
Drilled down into the source and find that mm/bootmem.c:line 232

           : find_next_zero_bit()
may be the culprit. When I put printks in, the line moves around a bit.

JB

>  Is it possible that you have an SMC device initialized by your firmware
>  that is corrupting parameter RAM?
No other devices have been configured except FCC1, SCC1, SCC3. The
unused gpio pins have been set as outputs.

>  > muram@0 {
>  >    #address-cells = <1>;
>  >    #size-cells = <1>;
>  >    ranges = <0 0 10000>;
>  >
>  >    data@0 {
>  >       compatible = "fsl,cpm-muram-data";
>  >       reg = <0 4000 8000 1000 B000 1000>;
>
>  You can't use all of 0x8000-0x8fff; there is device parameter RAM in
>  there.  If you can figure out the portions that aren't in use, you can
>  use those, but I wouldn't bother unless you really need the extra muram.

So, are you are saying that the muram node is giving the ram to the
kernel and is no longer available for devices to use as buffer
descriptors? I imagined the opposite. I thought I was telling the
kernel where the parameter ram and buffer descriptors live. I am going
to turn on the MCC2 device eventually and will need all of the dpram
for buffer descriptors.

The memory map in my mind right now is
0x0000 - 0x3FFF --> buffer descriptors for SCCx and MCC2.
0x8000 - 0x8FFF --> paramter ram for SCCx and MCC2, et al. (reserved)
0xB000 - 0xB8FF --> FCCx specific (reserved)

In my case, I shouldn't define any of the dual port ram for the kernel?


Jim Black


>
>  -Scott
>

^ permalink raw reply

* Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU
From: Peter Zijlstra @ 2008-03-20 23:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-fbdev-devel, linux-kernel, York Sun, linuxppc-dev,
	Ingo Molnar, timur
In-Reply-To: <20080320152708.23c6c734.akpm@linux-foundation.org>

On Thu, 2008-03-20 at 15:27 -0700, Andrew Morton wrote:

> >
> > +static struct diu_hw dr = {
> > +	.mode = MFB_MODE1,
> > +	.reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
> > +};
> 
> I'm not clear on what's supposed to happen with __SPIN_LOCK_UNLOCKED().  I
> do know that its documentation is crap.
> 
> I guess you should have used SPIN_LOCK_UNLOCKED there rather than
> open-coding its equivalent.  And SPIN_LOCK_UNLOCKED _is_ documented.  It
> says "don't use this".
> 
> Now, s/documentation/guesswork-and-grep/ says that you're supposed to pick
> a tree-wide-unique string here as your lockdep key.
> 
> So I did this:
> 
> --- a/drivers/video/fsl-diu-fb.c~fbdev-driver-for-freescale-8610-and-5121-diu-fix
> +++ a/drivers/video/fsl-diu-fb.c
> @@ -274,7 +274,7 @@ static struct mfb_info mfb_template[] = 
>  
>  static struct diu_hw dr = {
>  	.mode = MFB_MODE1,
> -	.reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
> +	.reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
>  };

#define __SPIN_LOCK_UNLOCKED(lockname)

seems pretty suggestive to me, also DEFINE_SPINLOCK(x) shows the proper
usage; the right thing would have been:

static struct diu_hw dr = {
 	.mode = MFB_MODE1,
-	.reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
+	.reg_lock = __SPIN_LOCK_UNLOCKED(dr.reg_lock),
};

Where 'dr.reg_lock' is the expression to locate the actual object.

Does something like this make sense to you:

---
Subject: lockdep: document __SPIN_LOCK_UNLOCKED() usage

Small comment clarifying the intended usage of __SPIN_LOCK_UNLOCKED()

[ for the observant readers; yes this prescribes a usage that is more
  than strictly needed, it does however enable interesting future uses ]

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h
index 68d88f7..4278558 100644
--- a/include/linux/spinlock_types.h
+++ b/include/linux/spinlock_types.h
@@ -63,6 +63,10 @@ typedef struct {
 # define RW_DEP_MAP_INIT(lockname)
 #endif
 
+/*
+ * __*_LOCK_UNLOCKED(lockname), where 'lockname' is a valid C expression
+ * that evaluates to the actual object being initialized.
+ */
 #ifdef CONFIG_DEBUG_SPINLOCK
 # define __SPIN_LOCK_UNLOCKED(lockname)					\
 	(spinlock_t)	{	.raw_lock = __RAW_SPIN_LOCK_UNLOCKED,	\
---

Perhaps I should make the macros do something like:

  typecheck(spinlock_t, lockname)

And sweep the tree to make it compile again.

>  static struct diu_pool pool;
> 
> > +static struct diu_pool pool;
> > +
> > +/*	To allocate memory for framebuffer. First try __get_free_pages(). If it
> > + *	fails, try rh_alloc. The reason is __get_free_pages() cannot allocate
> > + *	very large memory (more than 4MB). We don't want to allocate all memory
> > + *	in rheap since small memory allocation/deallocation will fragment the
> > + *	rheap and make the furture large allocation fail.
> > + */
> > +
> > +void *fsl_diu_alloc(unsigned long size, phys_addr_t *phys)
> > +{
> > +	void *virt;
> > +
> > +	pr_debug("size=%lu\n", size);
> > +
> > +	virt = (void *)__get_free_pages(GFP_DMA | GFP_ATOMIC, get_order(size));
> 
> GFP_DMA implies GFP_ATOMIC, but it's appropriate for documentation purposes.

FWIW, I prefer the form: GFP_type | __GFP_modifiers

For instance: 'GFP_KERNEL | __GFP_DMA | __GFP_ZERO'

^ permalink raw reply related

* Re: Oops with TQM5200 on TQM5200
From: Grant Likely @ 2008-03-20 23:50 UTC (permalink / raw)
  To: Anatolij Gustschin, Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <47E281B6.20702@denx.de>

Paul, my git server is down at the moment.  Can you please pick this
one up for .25?  It is needed to boot the tqm5200 board.

Acked-by: Grant Likely <grant.likely@secretlab.ca>

Cheers,
g.

On Thu, Mar 20, 2008 at 9:24 AM, Anatolij Gustschin <agust@denx.de> wrote:
> Hello Wolfgang,
>
>
>  Wolfgang Grandegger wrote:
>
>  > I just tried Linux 2.6.25-rc6 on my TQM5200 module and got the attached
>  > oops. Are there any known patches fixing the problems?
>
>  try the patch below for tqm5200.dts, rebuild dtb and boot
>  again. Not sure if it works for Linux 2.6.25-rc6, but for
>  2.6.25-rc3 it does.
>
>  Anatolij
>  --
>   diff --git a/arch/powerpc/boot/dts/tqm5200.dts b/arch/powerpc/boot/dts/tqm5200.dts
>  index c86464f..7c23bb3 100644
>  --- a/arch/powerpc/boot/dts/tqm5200.dts
>  +++ b/arch/powerpc/boot/dts/tqm5200.dts
>  @@ -83,6 +83,7 @@
>                 };
>
>                 dma-controller@1200 {
>  +                       device_type = "dma-controller";
>                         compatible = "fsl,mpc5200-bestcomm";
>                         reg = <1200 80>;
>                         interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
>  @@ -127,10 +128,25 @@
>                 ethernet@3000 {
>                         device_type = "network";
>                         compatible = "fsl,mpc5200-fec";
>  -                       reg = <3000 800>;
>  +                       reg = <3000 400>;
>                         local-mac-address = [ 00 00 00 00 00 00 ];
>                         interrupts = <2 5 0>;
>                         interrupt-parent = <&mpc5200_pic>;
>  +                       phy-handle = <&phy0>;
>  +               };
>  +
>  +               mdio@3000 {
>  +                       #address-cells = <1>;
>  +                       #size-cells = <0>;
>  +                       compatible = "fsl,mpc5200b-mdio";
>  +                       reg = <3000 400>;       // fec range, since we need to setup fec interrupts
>  +                       interrupts = <2 5 0>;   // these are for "mii command finished", not link changes & co.
>  +                       interrupt-parent = <&mpc5200_pic>;
>  +
>  +                       phy0:ethernet-phy@0 {
>  +                               device_type = "ethernet-phy";
>  +                               reg = <0>;
>  +                       };
>                 };
>
>                 ata@3a00 {
>  _______________________________________________
>  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


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox