* Re: [PATCH 5/8] [POWERPC] qe_lib: export qe_get_brg_clk()
From: Kumar Gala @ 2008-04-14 15:11 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080311172424.GE7727@localhost.localdomain>
On Mar 11, 2008, at 12:24 PM, Anton Vorontsov wrote:
> qe_get_brg_clk() will be used by the fsl_gtm routines.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/sysdev/qe_lib/qe.c | 5 +++--
> include/asm-powerpc/qe.h | 1 +
> 2 files changed, 4 insertions(+), 2 deletions(-)
applied.
- k
^ permalink raw reply
* Re: [PATCH 8/8] [POWERPC] qe_io: fix sparse warnings
From: Kumar Gala @ 2008-04-14 15:12 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080311172450.GH7727@localhost.localdomain>
On Mar 11, 2008, at 12:24 PM, Anton Vorontsov wrote:
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/sysdev/qe_lib/qe_io.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
applied.
- k
^ permalink raw reply
* Re: [PATCH 0/8] A bit of new code and sparse cleanups along the way
From: Kumar Gala @ 2008-04-14 15:14 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080311172106.GA4766@localhost.localdomain>
On Mar 11, 2008, at 12:21 PM, Anton Vorontsov wrote:
> Hi all,
>
> Please consider these patches for the 2.6.26.
I've applied most of these patches to my powerpc-next branch. The
following two patches have NOT been applied:
[POWERPC] sysdev,qe_lib: implement FSL GTM support
[POWERPC] qe_lib: add support for QE USB
It seemed there was rework required to the sysdev,qe_lib patch.
- k
^ permalink raw reply
* Re: [PATCH] mpc8540 : Fix restart
From: Kumar Gala @ 2008-04-14 15:20 UTC (permalink / raw)
To: Philippe De Muyter; +Cc: linuxppc-dev
In-Reply-To: <20080409230626.GA2577@frolo.macqel>
>>
> What do you propose then ? The ability to reboot without power-off is
> really needed for embedded targets. And abort() from head_fsl.S
> seems
> really close to reboot.
Boards should provide system logic mechanism that should be used. The
problem is abort() only resets the core. The rest of the SoC wlll not
be properly reset.
- k
^ permalink raw reply
* Re: [PATCH] [POWERPC] mpc8315: fix USB UTMI Host setup
From: Kumar Gala @ 2008-04-14 15:22 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080409135925.GA6905@polina.dev.rtsoft.ru>
On Apr 9, 2008, at 8:59 AM, Anton Vorontsov wrote:
> Currently USB Host isn't functional on the MPC8315E boards, for two
> reasons as described below.
>
> MPC8315 Reference Manual says:
> "The USB DR unit must have the same clock ratio as the encryption core
> unit, unless one of them has its clock disabled."
>
> The encryption core also drives I2C clock, so it is enabled and is
> equal
> to 01. That means USBDRCM should be 01 here.
>
> Plus, according to MPC8315E-RDB schematics, USB unit consumes CLK_IN
> clock from the 24.00MHz oscillator, which means we must adjust REFSEL
> bits as well.
Can you add a comment in the code about the fact that part of this fix
is board specific.
- k
>
>
> p.s.
> Idially we should rework whole 83xx/usb.c code, in two steps:
> 1. Move SCCR code to the U-Boot;
> 2. Implement fsl,usb-clock property in the device tree, so usb.c could
> decide what clock exactly to use on per-board basis.
>
> Though, today we're not in a hurry since there is just one 8315e board
> out there.
>
> Cc: Kumar Gala <galak@kernel.crashing.org>
> Cc: Kim Phillips <kim.phillips@freescale.com>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>
> arch/powerpc/platforms/83xx/mpc83xx.h | 2 ++
> arch/powerpc/platforms/83xx/usb.c | 12 +++++++++---
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
>
> diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/
> platforms/83xx/mpc83xx.h
> index 68065e6..88a3b5c 100644
> --- a/arch/powerpc/platforms/83xx/mpc83xx.h
> +++ b/arch/powerpc/platforms/83xx/mpc83xx.h
> @@ -16,6 +16,7 @@
> #define MPC83XX_SCCR_USB_DRCM_10 0x00200000
> #define MPC8315_SCCR_USB_MASK 0x00c00000
> #define MPC8315_SCCR_USB_DRCM_11 0x00c00000
> +#define MPC8315_SCCR_USB_DRCM_01 0x00400000
> #define MPC837X_SCCR_USB_DRCM_11 0x00c00000
>
> /* system i/o configuration register low */
> @@ -37,6 +38,7 @@
> /* USB Control Register */
> #define FSL_USB2_CONTROL_OFFS 0x500
> #define CONTROL_UTMI_PHY_EN 0x00000200
> +#define CONTROL_REFSEL_24MHZ 0x00000040
> #define CONTROL_REFSEL_48MHZ 0x00000080
> #define CONTROL_PHY_CLK_SEL_ULPI 0x00000400
> #define CONTROL_OTG_PORT 0x00000020
> diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/
> platforms/83xx/usb.c
> index 471fdd8..64bcf0a 100644
> --- a/arch/powerpc/platforms/83xx/usb.c
> +++ b/arch/powerpc/platforms/83xx/usb.c
> @@ -129,7 +129,7 @@ int mpc831x_usb_cfg(void)
> if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-
> immr"))
> clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
> MPC8315_SCCR_USB_MASK,
> - MPC8315_SCCR_USB_DRCM_11);
> + MPC8315_SCCR_USB_DRCM_01);
> else
> clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
> MPC83XX_SCCR_USB_MASK,
> @@ -164,9 +164,15 @@ int mpc831x_usb_cfg(void)
> /* Using on-chip PHY */
> if (prop && (!strcmp(prop, "utmi_wide") ||
> !strcmp(prop, "utmi"))) {
> - /* Set UTMI_PHY_EN, REFSEL to 48MHZ */
> + u32 refsel;
> +
> + if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))
> + refsel = CONTROL_REFSEL_24MHZ;
> + else
> + refsel = CONTROL_REFSEL_48MHZ;
> + /* Set UTMI_PHY_EN and REFSEL */
> out_be32(usb_regs + FSL_USB2_CONTROL_OFFS,
> - CONTROL_UTMI_PHY_EN | CONTROL_REFSEL_48MHZ);
> + CONTROL_UTMI_PHY_EN | refsel);
> /* Using external UPLI PHY */
> } else if (prop && !strcmp(prop, "ulpi")) {
> /* Set PHY_CLK_SEL to ULPI */
^ permalink raw reply
* Re: [PATCH] CPM: Always use new binding.
From: Kumar Gala @ 2008-04-14 15:28 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20080410204502.GB20197@loki.buserror.net>
On Apr 10, 2008, at 3:45 PM, Scott Wood wrote:
> The kconfig entry can go away once arch/ppc and references to the
> config in
> drivers are removed.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> arch/powerpc/platforms/82xx/Kconfig | 3 -
> arch/powerpc/platforms/85xx/Kconfig | 8 -
> arch/powerpc/platforms/8xx/Kconfig | 4 -
> arch/powerpc/platforms/Kconfig | 8 +-
> arch/powerpc/sysdev/cpm1.c | 112 -------
> arch/powerpc/sysdev/cpm2.c | 97 -------
> arch/powerpc/sysdev/cpm_common.c | 3 -
> arch/powerpc/sysdev/fsl_soc.c | 541
> -----------------------------------
> 8 files changed, 1 insertions(+), 775 deletions(-)
applied.
- k
^ permalink raw reply
* Re: [PATCH 5/5] WDT driver
From: Sean MacLennan @ 2008-04-14 15:40 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linuxppc-dev
In-Reply-To: <200804141033.29929.laurentp@cse-semaphore.com>
On Mon, 14 Apr 2008 10:33:27 +0200
Laurent Pinchart <laurentp@cse-semaphore.com> wrote:
> What about
>
> setbits32((u32 __iomem *)(pikawdt_fpga + 0x14), 0xf80);
Nice! I didn't know about that call. Thanks.
Cheers,
Sean
^ permalink raw reply
* Re: [PATCH 1/2] Driver for Freescale 8610 and 5121 DIU
From: Jiri Slaby @ 2008-04-14 15:43 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, Andrew Morton, York Sun, linux-kernel
In-Reply-To: <48036F00.6080200@freescale.com>
On 04/14/2008 04:49 PM, Timur Tabi wrote:
> Jiri Slaby wrote:
>> On 04/14/2008 04:12 PM, Timur Tabi wrote:
>>> Unfortunately, the author of the patch, York, is out this week, so I'll have to
>>> take care of this. It'd be easier to modify rh_alloc() so that it doesn't
>>> sleep, so that's what I'm going to do.
>> Anyway, why do you need the spin lock there (and not mutex)?
>
> I don't know. A spinlock just seemed obvious. Why would I prefer a mutex?
Mainly because you can sleep inside locked mutex and because spinlock shouldn't
be used for too many lines of code (busy waiting etc.). I think ldd3 will be
more descriptive than me here :).
^ permalink raw reply
* [PATCH] Make rheap safe for spinlocks
From: Timur Tabi @ 2008-04-14 15:43 UTC (permalink / raw)
To: paulus, linuxppc-dev; +Cc: Timur Tabi
The rheap allocation function, rh_alloc, could call kmalloc with GFP_KERNEL.
This can sleep, which means you couldn't hold a spinlock while called rh_alloc.
Change all kmalloc calls to use GFP_ATOMIC so that it won't sleep. This is
safe because only small blocks are allocated.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
This patch is for 2.6.26.
arch/powerpc/lib/rheap.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index 22c3b4f..29b2941 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -54,7 +54,7 @@ static int grow(rh_info_t * info, int max_blocks)
new_blocks = max_blocks - info->max_blocks;
- block = kmalloc(sizeof(rh_block_t) * max_blocks, GFP_KERNEL);
+ block = kmalloc(sizeof(rh_block_t) * max_blocks, GFP_ATOMIC);
if (block == NULL)
return -ENOMEM;
@@ -258,7 +258,7 @@ rh_info_t *rh_create(unsigned int alignment)
if ((alignment & (alignment - 1)) != 0)
return ERR_PTR(-EINVAL);
- info = kmalloc(sizeof(*info), GFP_KERNEL);
+ info = kmalloc(sizeof(*info), GFP_ATOMIC);
if (info == NULL)
return ERR_PTR(-ENOMEM);
--
1.5.3
^ permalink raw reply related
* RE: XPS_LL_TEMAC works correctly?
From: Rick Moleres @ 2008-04-14 15:42 UTC (permalink / raw)
To: Mohammad Sadegh Sadri, Rami WEHBI, linuxppc-embedded
In-Reply-To: <BAY115-W23ED8F42C0F097D8A7864AB2E80@phx.gbl>
[-- Attachment #1: Type: text/plain, Size: 3952 bytes --]
There are a couple of bugs in the v1.00b version of xps_ll_temac (one in checksum offload, one in multicast address reception). You should try dropping back to v1.00a of the core and give that a try, or if you have EDK 10.1 you can move to v1.01a of the core.
-Rick
________________________________
From: linuxppc-embedded-bounces+moleres=xilinx.com@ozlabs.org [mailto:linuxppc-embedded-bounces+moleres=xilinx.com@ozlabs.org] On Behalf Of Mohammad Sadegh Sadri
Sent: Monday, April 14, 2008 3:10 AM
To: Rami WEHBI; linuxppc-embedded@ozlabs.org
Subject: RE: XPS_LL_TEMAC works correctly?
Rami,
Thanks for reply,
But if u study the kernel log I posted carefully, you can simply see that Kernel has mounted the root file system,
Look at this line in my prev post : VFS: Mounted root (nfs filesystem). then init has began and after that nothing more happens.
the NFS is working correctly and the folder can be mounted easily from other computers. I personally think that the problem can be with NFS or the root file system of ELDK.
I have done the same things with older versions of EDK using PLB_TEMAC and every thing has worked correctly.
________________________________
Subject: RE: XPS_LL_TEMAC works correctly?
Date: Mon, 14 Apr 2008 10:31:31 +0200
From: rwehbi@wirecom-tech.com
To: mamsadegh@hotmail.com
Hi,
I would suggest that you verify that your system file is already mounted on the host PC (where your server NFS is installed), and that the /etc/exports file (configuration file of the nfs server) permit to your board to mount the system file.
example of an /etc/exports file:
/opt/ml403/rootfs
192.168.206.223/24(rw,no_root_squash,sync,subtree_check)
where the ip addresse is that of nfs client, and the path indicates where I mounted the system file.
Good luck,
Rami
________________________________
De : linuxppc-embedded-bounces+rami.wehbi=wirecom-tech.com@ozlabs.org [mailto:linuxppc-embedded-bounces+rami.wehbi=wirecom-tech.com@ozlabs.org] De la part de Mohammad Sadegh Sadri
Envoyé : lundi 14 avril 2008 10:16
À : linuxppc-embedded@ozlabs.org
Objet : XPS_LL_TEMAC works correctly?
Hi all,
Using:
EDK 9.2.02,
Xilinx Linux 2.6.24-rc8-xlnx
XPS_LL_TEMAC version 1.00.b
I bring up the Linux kernel on ML403 -Rev04 board,
LL_TEMAC buffer size 128kbits, and set to use SG DMA
I encounter the following messages when the kernel wants to mount the root file system, as one can see the kernel has mounter the nfs root file system and init is initiated, but after that a Link carrier lost happens and it stops working.
is this behavior natural? ( the PC has attansic gigabit ethernet port with kernel 2.6.24.4 running, nfs works very well in other tests)
thanks
.............
eth0: XLlTemac: speed set to 1000Mb/s
eth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4
eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254
IP-Config: Complete:
device=eth0, addr=10.10.10.11, mask=255.255.255.0, gw=10.10.10.10,
host=10.10.10.11, domain=, nis-domain=(none),
bootserver=10.10.10.10, rootserver=10.10.10.10, rootpath=
Looking up port of RPC 100003/2 on 10.10.10.10
Looking up port of RPC 100005/1 on 10.10.10.10
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 88k init
eth0: XLlTemac: PHY Link carrier lost.
eth0: XLlTemac: speed set to 1000Mb/s
eth0: XLlTemac: PHY Link carrier restored.
( KERNEL STOPS WORKING HERE!!!!!!!!)
________________________________
Sign in today. When you sign in to Windows Live Messenger you could win $1000 a day until May 12th. Learn more at SignInAndWIN.ca <http://g.msn.ca/ca55/209>
________________________________
Sign in now! Windows Live Messenger is giving you a chance to win $1000 a day until May 12th Check out SignInAndWIN.ca today! <http://g.msn.ca/ca55/214>
[-- Attachment #2: Type: text/html, Size: 13616 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] Driver for Freescale 8610 and 5121 DIU
From: Timur Tabi @ 2008-04-14 15:46 UTC (permalink / raw)
To: Jiri Slaby, Andrew Morton; +Cc: linuxppc-dev, York Sun, linux-kernel
In-Reply-To: <48037BA4.6070201@gmail.com>
Jiri Slaby wrote:
> Mainly because you can sleep inside locked mutex and because spinlock shouldn't
> be used for too many lines of code (busy waiting etc.). I think ldd3 will be
> more descriptive than me here :).
Ok, I'll look into it.
Andrew, do you want us to respin the patch, or would you be willing to let us
make the change in a follow-up patch?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: PATCH 2/5] Platform code
From: David Woodhouse @ 2008-04-14 16:00 UTC (permalink / raw)
To: Sean MacLennan; +Cc: linuxppc-dev
In-Reply-To: <20080412140325.69e1df3b@lappy.seanm.ca>
On Sat, 2008-04-12 at 14:03 -0400, Sean MacLennan wrote:
>
> - * Sean MacLennan <smaclennan@pikatech.com>
> + * Sean MacLennan <smaclennan at pikatech.com>
Please don't do this. Anywhere. Ever.
The spambots are quite capable of undoing it, and have been for years.
The only people you inconvenience are real people trying to contact you.
--
dwmw2
^ permalink raw reply
* Re: zImage.embedded
From: Guillaume Dargaud @ 2008-04-14 16:05 UTC (permalink / raw)
To: linuxppc-dev, Buildroot Mailinglist,
In-Reply-To: <fa686aa40804110655x48120e84tde01a52d8bb39a3@mail.gmail.com>
[cross posting from one mailing list to another]
>> is the file zImage.elf my proper network image ?
>
> What bootloader is on your board? zImage.elf *might* be the proper
> image. If you're using u-boot, then you want to build a uImage
> instead.
I'm trying to compile u-boot with buildroot, but it fails with:
/usr/bin/make -j1 -C
/home/guinevere/Min_UartLite_NetLite_Ace/buildroot/project_build_powerpc/genepy/u-boot-1.3.2
\
""_config
make[1]: Entering directory
`/home/guinevere/Min_UartLite_NetLite_Ace/buildroot/project_build_powerpc/genepy/u-boot-1.3.2'
make[1]: *** No rule to make target `_config'. Stop.
make[1]: Leaving directory
`/home/guinevere/Min_UartLite_NetLite_Ace/buildroot/project_build_powerpc/genepy/u-boot-1.3.2'
make: ***
[/home/guinevere/Min_UartLite_NetLite_Ace/buildroot/project_build_powerpc/genepy/u-boot-1.3.2/.configured]
Error 2
Apparently it expects a BOARD_NAME variable, but I don't know what to put in
it (I looked at the makefile and can't find the ml405 referenced in there).
--
Guillaume Dargaud
http://www.gdargaud.net/
^ permalink raw reply
* Re: Signal backtrace function
From: Detlev Zundel @ 2008-04-14 16:09 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1207764980.5826.77.camel@gentoo-jocke.transmode.se>
Hi Jocke,
> I made my own backtrace function for printing
> a trace from within a signal handler. Maybe it
> can be useful for the kernel too? General
> comments welcome.
Probably a dumb question, but doesn't backtrace(3) from glibc work
architecture independent already? Why do you need to reimplement it?
Thanks
Detlev
--
The management question ... is not _whether_ to build a pilot system
and throw it away. You _will_ do that. The only question is whether to
plan in advance to build a throwaway, or to promise to deliver the
throwaway to customers. - Fred Brooks, "The Mythical Man Month"
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu@denx.de
^ permalink raw reply
* Manual kernel parameters are being ignored
From: Guillaume Dargaud @ 2008-04-14 16:17 UTC (permalink / raw)
To: linuxppc-dev
Anyone care to tell me why the parameters I type manually for the kernel are
being ignored ?
Linux/PPC load: console=ttyUL0,9600 root=/dev/xsa2 rw ip=off
Uncompressing Linux...done.
Now booting the kernel
[...]
[ 0.000000] Kernel command line: console=ttyUL0,9600 root=/dev/nfs rw
ip=on nfsroot=192.168.1.185:/ht
--
Guillaume Dargaud
http://www.gdargaud.net/
^ permalink raw reply
* Problems of using APU/FPU under linux
From: Shanyuan Gao @ 2008-04-14 16:18 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
Recently I was trying to make APU/FPU working under Linux on Xilinx
ML410. The standalone programs work perfectly. However under Linux,
when I try to use a floating point operation, like *fmuls*, it will
give me a *trap*.
By studying the user guide from Xilinx and dumping the object files,
I know I need to change the corresponding bits (APU enable, FP
enable, maybe APU Exception enable) in Machine State Register. I
guess I need to enable the bits whenever before the kernel uses
*mtmsr*. However, it doesn't work. I got the same trap with the same
MSR, as I had no APU/FPU before. I also tried to add the FPU.S to ppc
tree, but it doesn't work either.
The questions are
1. I guess there might be some place that changed MSR after all my
changes. But I don't know where. And can I write a kernel module to
change the MSR after booting in Linux? (well, it's hard for me though)
2. Does it have any exception/interrupt mechanism to direct FP
operation to APU/FPU? Or after enabling APU/FPU it will mask the
exception/interrupt and decode FP operation by itself?
Any ideas are appreciated. Thank you very much!
Shan
^ permalink raw reply
* Re: Signal backtrace function
From: Joakim Tjernlund @ 2008-04-14 16:20 UTC (permalink / raw)
To: Detlev Zundel; +Cc: linuxppc-dev
In-Reply-To: <m2skxoo1ur.fsf@ohwell.denx.de>
On Mon, 2008-04-14 at 18:09 +0200, Detlev Zundel wrote:
> Hi Jocke,
>
> > I made my own backtrace function for printing
> > a trace from within a signal handler. Maybe it
> > can be useful for the kernel too? General
> > comments welcome.
>
> Probably a dumb question, but doesn't backtrace(3) from glibc work
> architecture independent already? Why do you need to reimplement it?
Nope, it doesn't give you a good backtrace from within a signal handler.
On x86 you can use the normal backtrace function with a minor
workaround, but as ppc doesn't save a FP in leaf functions, that
workaround does not work well. You can read more about it
at http://www.linuxjournal.com/article/6391
Jocke
^ permalink raw reply
* Re: [PATCH] [POWERPC] mpc8315: fix USB UTMI Host setup
From: Anton Vorontsov @ 2008-04-14 16:31 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <5545B104-1D7C-4A35-B6AD-7C895CBE9A2F@kernel.crashing.org>
On Mon, Apr 14, 2008 at 10:22:46AM -0500, Kumar Gala wrote:
>
> On Apr 9, 2008, at 8:59 AM, Anton Vorontsov wrote:
>> Currently USB Host isn't functional on the MPC8315E boards, for two
>> reasons as described below.
>>
>> MPC8315 Reference Manual says:
>> "The USB DR unit must have the same clock ratio as the encryption core
>> unit, unless one of them has its clock disabled."
>>
>> The encryption core also drives I2C clock, so it is enabled and is
>> equal
>> to 01. That means USBDRCM should be 01 here.
>>
>> Plus, according to MPC8315E-RDB schematics, USB unit consumes CLK_IN
>> clock from the 24.00MHz oscillator, which means we must adjust REFSEL
>> bits as well.
>
> Can you add a comment in the code about the fact that part of this fix
> is board specific.
Heh, the whole 83xx/usb.c file is board(s) specific, not this particular
fix. :-/
So it doesn't need an explicit comment for this addition. It's just lucky
coincedence that all previous boards were using same (or similar) setup.
That is, it's perfectly possible that some custom MPC831XE board will use
USB setup different from MPC8313E-RDB or MPC8315E-RDB, and the whole thing
will break again. The same applies for MPC837X part of usb.c. There are
board-specific settings all over the place.
^ permalink raw reply
* Re: Flash on LocalBus @ MPC8343
From: Scott Wood @ 2008-04-14 16:45 UTC (permalink / raw)
To: André Schwarz; +Cc: linux-ppc list
In-Reply-To: <480079CA.5040000@matrix-vision.de>
On Sat, Apr 12, 2008 at 10:58:50AM +0200, André Schwarz wrote:
> thanks , but ... can't find "of_bus_ids[]" entry.
That means your platform likely isn't calling of_platform_bus_probe() at
all. Look at other platforms, such as mpc831x_rdb, for an example.
> I'm obviously out of sync. My last git-pull from denx is 3 days old, now
> - need to update on monday.
For Denx-specific support, please contact Denx.
This certainly isn't something that was added in the past 3 days.
-Scott
^ permalink raw reply
* Re: [PATCH v2.6.26] gianfar: Determine TBIPA value dynamically
From: Andy Fleming @ 2008-04-14 16:55 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: netdev, linuxppc-dev
In-Reply-To: <20080411154914.GA19036@windriver.com>
On Apr 11, 2008, at 10:49, Paul Gortmaker wrote:
> In message: [PATCH v2.6.26] gianfar: Determine TBIPA value dynamically
> on 10/04/2008 Andy Fleming wrote:
>
>> TBIPA needs to be set to a value (on connected MDIO buses) that
>> doesn't
>> conflict with PHYs on the bus. By hardcoding it to 0x1f, we were
>> preventing
>> boards with PHYs at 0x1f from working properly. Instead, scan the
>> bus when
>> it comes up, and find an address that doesn't have a PHY on it.
>> The TBI PHY
>> configuration code then trusts that the value in TBIPA is either
>> safe, or
>> doesn't matter (ie - it's not an active bus with other PHYs).
>>
>> Signed-off-by: Andy Fleming <afleming@freescale.com>
>> ---
>>
>> I think this should go in, but I'd like to see some testing first.
>> I don't
>> have hardware which is affected by this. I've only confirmed that
>> it doesn't
>> break current hardware.
>
> I've tested on a board with the primary PHY at 0x1f, and it seems OK.
>
> I'f I'm understanding this correctly, you are explicitly setting TBIPA
> to zero, doing a bus walk but excluding zero, and then assigning the
> found free address, which re-opens zero to be used by a real PHY.
Right. It's a somewhat lazy scan of the bus. I'm assuming, here,
that there will be at least one non-zero address that has no PHY on it.
>
>
> I've made some changes to what you'd sent out, those being:
> -changed the "if (i < 0) return -EBUSY to "i == 0"
> -remove the now unused TBIPA_VALUE define
> -remove the prototypes from gianfar.c now that you've
> added them into gianfar.h
> -factor out the code to read the PHY ID so we don't have
> it duplicated in two places.
Excellent. Print it! :)
Could you send out the two patches as two separate emails, and add my
Acked-by: Andy Fleming <afleming@freescale.com> to the first one? You
should also change the subject for the first patch so that it has
[PATCH v2.6.26].
Andy
^ permalink raw reply
* RE: Problems of using APU/FPU under linux
From: Stephen Neuendorffer @ 2008-04-14 17:35 UTC (permalink / raw)
To: Shanyuan Gao, linuxppc-embedded, git
In-Reply-To: <287479FF-A7FC-4B48-BE1E-FDDCB97D55A9@gmail.com>
I'm not sure exactly what's going on here. Generally speaking, if you
have the FPU instantiated in the design and enable the APU in the msr,
then the processor should decode FP instructions and send them directly
to the APU with no trap. I haven't done this myself, or I could
probably give you some better help...
One thing you should be aware of is that the there are gcc compiler
patches which are necessary to get the FPU working properly. However, I
don't think the failure mode that these patches workaround would cause a
trap, so my guess is that there is still something else wrong.
Steve
> -----Original Message-----
> From: linuxppc-embedded-bounces+stephen=3Dneuendorffer.name@ozlabs.org
[mailto:linuxppc-embedded-
> bounces+stephen=3Dneuendorffer.name@ozlabs.org] On Behalf Of Shanyuan
Gao
> Sent: Monday, April 14, 2008 9:18 AM
> To: linuxppc-embedded@ozlabs.org
> Subject: Problems of using APU/FPU under linux
>=20
> Hi,
>=20
> Recently I was trying to make APU/FPU working under Linux on Xilinx
> ML410. The standalone programs work perfectly. However under Linux,
> when I try to use a floating point operation, like *fmuls*, it will
> give me a *trap*.
>=20
> By studying the user guide from Xilinx and dumping the object files,
> I know I need to change the corresponding bits (APU enable, FP
> enable, maybe APU Exception enable) in Machine State Register. I
> guess I need to enable the bits whenever before the kernel uses
> *mtmsr*. However, it doesn't work. I got the same trap with the same
> MSR, as I had no APU/FPU before. I also tried to add the FPU.S to ppc
> tree, but it doesn't work either.
>=20
> The questions are
> 1. I guess there might be some place that changed MSR after all my
> changes. But I don't know where. And can I write a kernel module to
> change the MSR after booting in Linux? (well, it's hard for me though)
>=20
> 2. Does it have any exception/interrupt mechanism to direct FP
> operation to APU/FPU? Or after enabling APU/FPU it will mask the
> exception/interrupt and decode FP operation by itself?
>=20
>=20
> Any ideas are appreciated. Thank you very much!
>=20
>=20
> Shan
>=20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* Get new_emac driver running on 405EP
From: M B @ 2008-04-14 17:38 UTC (permalink / raw)
To: ppc-dev
Hi,
I'm trying to get the new_emac driver (linux 2.6.25-rc8) running on my
405EP board with a KSZ8721BT Micrel/Kendin PHY.
I've already found 2 problems/missing features:
1) 100 retries in __emac_mdio_read for the read to complete are
slightly too less. 101 seem to be enough. But we could add a bit more,
because there is no negative effect for faster chips.
2) On the 405EP only the MDIO pin of the emac0 is pinned out, so both
phys have to be accessed through this one. This affectes the mdio
read/write functions.
I've already hacked around this problems, but ethernet is still not working.
After bringing up the device dmesg is flooded with this section.
emac/plb/opb/ethernet@ef600800: link timer
emac/plb/opb/ethernet@ef600800: mdio_read(00,01)
emac/plb/opb/ethernet@ef600800: mdio_read -> 786d
emac/plb/opb/ethernet@ef600800: mdio_read(00,01)
emac/plb/opb/ethernet@ef600800: mdio_read -> 786d
Any ideas where I should start looking?
Best Regards
Markus
A ping doesn't work
==============
# ifconfig eth0 1.1.1.1
eth0: link is up, 100 FDX, pause enabled
# ping 1.1.1.1 -c1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
--- 1.1.1.1 ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss
No data gets transmitted
==================
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:C2:1E:AF:FE
inet addr:1.1.1.1 Bcast:1.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:23
And no interrupts triggered
===================
# cat /proc/interrupts
CPU0
16: 737 UIC Level serial
18: 0 UIC Level MAL TX EOB
19: 0 UIC Level MAL RX EOB
20: 0 UIC Level MAL SERR
21: 0 UIC Level MAL TX DE
22: 0 UIC Level MAL RX DE
BAD: 0
dmesg section after boot, debug level of emac driver is 3
=========================================
ef600400.serial: ttyS1 at MMIO 0xef600400 (irq = 17) is a 16550A
PPC 4xx OCP EMAC driver, version 3.54
mal/plb/mcmal: probe
mal/plb/mcmal: reset
mal/plb/mcmal: enable_irq
MAL v1 /plb/mcmal, 4 TX channels, 4 RX channels
emac/plb/opb/ethernet@ef600800: features : 0x00000000 / 0x00000000
emac/plb/opb/ethernet@ef600800: tx_fifo_size : 2048 (2048 gige)
emac/plb/opb/ethernet@ef600800: rx_fifo_size : 4096 (4096 gige)
emac/plb/opb/ethernet@ef600800: max_mtu : 1500
emac/plb/opb/ethernet@ef600800: OPB freq : 66000000
mal/plb/mcmal: reg(80000000, 80000000)
emac/plb/opb/ethernet@ef600800: tx_desc ff100000
emac/plb/opb/ethernet@ef600800: rx_desc ff100800
emac/plb/opb/ethernet@ef600800: PHY maps 00000000 00000000
emac/plb/opb/ethernet@ef600800: configure
emac/plb/opb/ethernet@ef600800: reset
emac/plb/opb/ethernet@ef600800: rx_disable
emac/plb/opb/ethernet@ef600800: tx_disable
emac/plb/opb/ethernet@ef600800: link = 1 duplex = 1, pause = 0, asym_pause = 0
emac/plb/opb/ethernet@ef600800: __emac_calc_base_mr1
emac/plb/opb/ethernet@ef600800: mdio_read(00,00)
emac/plb/opb/ethernet@ef600800: mdio_read -> 3100
emac/plb/opb/ethernet@ef600800: mdio_read(00,00)
emac/plb/opb/ethernet@ef600800: mdio_read -> 3100
emac/plb/opb/ethernet@ef600800: mdio_write(00,00,a100)
emac/plb/opb/ethernet@ef600800: mdio_read(00,00)
emac/plb/opb/ethernet@ef600800: mdio_read -> 3100
emac/plb/opb/ethernet@ef600800: mdio_read(00,02)
emac/plb/opb/ethernet@ef600800: mdio_read -> 0022
emac/plb/opb/ethernet@ef600800: mdio_read(00,03)
emac/plb/opb/ethernet@ef600800: mdio_read -> 1619
emac/plb/opb/ethernet@ef600800: mdio_read(00,01)
emac/plb/opb/ethernet@ef600800: mdio_read -> 7849
emac/plb/opb/ethernet@ef600800: mdio_read(00,00)
emac/plb/opb/ethernet@ef600800: mdio_read -> 3100
emac/plb/opb/ethernet@ef600800: mdio_write(00,00,0000)
emac/plb/opb/ethernet@ef600800: mdio_read(00,04)
emac/plb/opb/ethernet@ef600800: mdio_read -> 01e1
emac/plb/opb/ethernet@ef600800: mdio_write(00,04,0de1)
emac/plb/opb/ethernet@ef600800: mdio_read(00,00)
emac/plb/opb/ethernet@ef600800: mdio_read -> 0000
emac/plb/opb/ethernet@ef600800: mdio_write(00,00,1200)
emac/plb/opb/ethernet@ef600800: stats
eth0: EMAC-0 /plb/opb/ethernet@ef600800, MAC 00:50:c2:1e:af:fe
eth0: found Generic MII PHY (0x00)
emac/plb/opb/ethernet@ef600900: features : 0x00000000 / 0x00000000
emac/plb/opb/ethernet@ef600900: tx_fifo_size : 2048 (2048 gige)
emac/plb/opb/ethernet@ef600900: rx_fifo_size : 4096 (4096 gige)
emac/plb/opb/ethernet@ef600900: max_mtu : 1500
emac/plb/opb/ethernet@ef600900: OPB freq : 66000000
mal/plb/mcmal: reg(20000000, 40000000)
emac/plb/opb/ethernet@ef600900: tx_desc ff100400
emac/plb/opb/ethernet@ef600900: rx_desc ff100c00
emac/plb/opb/ethernet@ef600900: PHY maps 00000020 00000001
emac/plb/opb/ethernet@ef600900: configure
emac/plb/opb/ethernet@ef600900: reset
emac/plb/opb/ethernet@ef600900: rx_disable
emac/plb/opb/ethernet@ef600900: tx_disable
emac/plb/opb/ethernet@ef600900: link = 1 duplex = 1, pause = 0, asym_pause = 0
emac/plb/opb/ethernet@ef600900: __emac_calc_base_mr1
emac/plb/opb/ethernet@ef600900: mdio_read(01,00)
emac/plb/opb/ethernet@ef600900: mdio_read -> 3100
emac/plb/opb/ethernet@ef600900: mdio_read(01,00)
emac/plb/opb/ethernet@ef600900: mdio_read -> 3100
emac/plb/opb/ethernet@ef600900: mdio_write(01,00,a100)
emac/plb/opb/ethernet@ef600900: mdio_read(01,00)
emac/plb/opb/ethernet@ef600900: mdio_read -> 3100
emac/plb/opb/ethernet@ef600900: mdio_read(01,02)
emac/plb/opb/ethernet@ef600900: mdio_read -> 0022
emac/plb/opb/ethernet@ef600900: mdio_read(01,03)
emac/plb/opb/ethernet@ef600900: mdio_read -> 1619
emac/plb/opb/ethernet@ef600900: mdio_read(01,01)
emac/plb/opb/ethernet@ef600900: mdio_read -> 7849
emac/plb/opb/ethernet@ef600900: mdio_read(01,00)
emac/plb/opb/ethernet@ef600900: mdio_read -> 3100
emac/plb/opb/ethernet@ef600900: mdio_write(01,00,0000)
emac/plb/opb/ethernet@ef600900: mdio_read(01,04)
emac/plb/opb/ethernet@ef600900: mdio_read -> 01e1
emac/plb/opb/ethernet@ef600900: mdio_write(01,04,0de1)
emac/plb/opb/ethernet@ef600900: mdio_read(01,00)
emac/plb/opb/ethernet@ef600900: mdio_read -> 0000
emac/plb/opb/ethernet@ef600900: mdio_write(01,00,1200)
emac/plb/opb/ethernet@ef600900: stats
eth1: EMAC-1 /plb/opb/ethernet@ef600900, MAC 00:50:c2:1e:af:fd
eth1: found Generic MII PHY (0x01)
TCP cubic registered
Mal and emac sections of my device tree
==============================
MAL: mcmal {
compatible = "ibm,mcmal-405ep", "ibm,mcmal";
dcr-reg = <180 62>;
num-tx-chans = <4>;
num-rx-chans = <4>;
interrupt-parent = <&UIC0>;
interrupts = <
a 4 /* SERR */
b 4 /* TXEOB */
c 4 /* RXEOB */
d 4 /* TXDE */
e 4 /* RXDE */>;
};
POB0: opb {
compatible = "ibm,opb-405ep", "ibm,opb";
#address-cells = <1>;
#size-cells = <1>;
ranges = <ef600000 ef600000 a00000>;
dcr-reg = <0a0 5>;
clock-frequency = <3EF1480>;
EMAC0: ethernet@ef600800 {
linux,network-index = <0>;
device_type = "network";
compatible = "ibm,emac-405ep", "ibm,emac";
interrupt-parent = <&UIC0>;
interrupts = <
f 4 /* Ethernet */
9 4 /* Ethernet Wake Up */>;
local-mac-address = [0050c21eaffe]; /* Filled in by zImage */
reg = <ef600800 70>;
mal-device = <&MAL>;
mal-tx-channel = <0>;
mal-rx-channel = <0>;
cell-index = <0>;
max-frame-size = <5dc>;
rx-fifo-size = <1000>;
tx-fifo-size = <800>;
phy-mode = "mii";
phy-map = <00000000>;
};
EMAC1: ethernet@ef600900 {
linux,network-index = <1>;
device_type = "network";
compatible = "ibm,emac-405ep", "ibm,emac";
interrupt-parent = <&UIC0>;
interrupts = <
11 4 /* Ethernet */
9 4 /* Ethernet Wake Up */>;
local-mac-address = [0050c21eaffd]; /* Filled in by zImage */
reg = <ef600900 70>;
mal-device = <&MAL>;
mal-tx-channel = <2>;
mal-rx-channel = <1>;
cell-index = <1>;
max-frame-size = <5dc>;
rx-fifo-size = <1000>;
tx-fifo-size = <800>;
phy-mode = "mii";
phy-map = <00000020>;
};
Kconfig section of emac
=================
CONFIG_PHYLIB=y
#
# MII PHY device drivers
#
# CONFIG_MARVELL_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_QSEMI_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_SMSC_PHY is not set
# CONFIG_BROADCOM_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_REALTEK_PHY is not set
# CONFIG_FIXED_PHY is not set
# CONFIG_MDIO_BITBANG is not set
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
# CONFIG_ENC28J60 is not set
CONFIG_IBM_NEW_EMAC=y
CONFIG_IBM_NEW_EMAC_RXB=128
CONFIG_IBM_NEW_EMAC_TXB=64
CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
CONFIG_IBM_NEW_EMAC_DEBUG=y
# CONFIG_IBM_NEW_EMAC_ZMII is not set
# CONFIG_IBM_NEW_EMAC_RGMII is not set
# CONFIG_IBM_NEW_EMAC_TAH is not set
# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
^ permalink raw reply
* Re: [PATCH 0/8] A bit of new code and sparse cleanups along the way
From: Anton Vorontsov @ 2008-04-14 17:49 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <4064F5C3-0A62-4331-9116-764347AEC090@kernel.crashing.org>
On Mon, Apr 14, 2008 at 10:14:05AM -0500, Kumar Gala wrote:
>
> On Mar 11, 2008, at 12:21 PM, Anton Vorontsov wrote:
>> Hi all,
>>
>> Please consider these patches for the 2.6.26.
>
> I've applied most of these patches to my powerpc-next branch.
Thanks!
> The
> following two patches have NOT been applied:
>
> [POWERPC] sysdev,qe_lib: implement FSL GTM support
> [POWERPC] qe_lib: add support for QE USB
>
> It seemed there was rework required to the sysdev,qe_lib patch.
I can't recall any issues with "[POWERPC] qe_lib: add support for QE USB".
As for FSL GTM.. yes, I'll send updated version soon.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH rebased][POWERPC] qe_lib and ucc_geth: switch to the cpm_muram implementation
From: Anton Vorontsov @ 2008-04-14 18:18 UTC (permalink / raw)
To: Kumar Gala; +Cc: Scott Wood, linuxppc-dev, Jeff Garzik, Timur Tabi, netdev
In-Reply-To: <20080320173945.GA8446@localhost.localdomain>
This is very trivial patch. We're transitioning to the cpm_muram_*
calls. That's it.
Less trivial changes:
- BD_SC_* defines were defined in the cpm.h and qe.h, so to avoid redefines
we remove BD_SC from the qe.h and use 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>
---
Rebased on top of today's galak/powerpc.git.
arch/powerpc/sysdev/Makefile | 1 +
arch/powerpc/sysdev/cpm_common.c | 16 +++++-
arch/powerpc/sysdev/qe_lib/qe.c | 96 +--------------------------------
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/cpm.h | 1 +
include/asm-powerpc/qe.h | 29 +----------
8 files changed, 79 insertions(+), 186 deletions(-)
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 6d386d0..42b44a1 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -40,6 +40,7 @@ endif
ifeq ($(ARCH),powerpc)
obj-$(CONFIG_CPM) += cpm_common.o
obj-$(CONFIG_CPM2) += cpm2.o cpm2_pic.o
+obj-$(CONFIG_QUICC_ENGINE) += cpm_common.o
obj-$(CONFIG_PPC_DCR) += dcr.o
obj-$(CONFIG_8xx) += mpc8xx_pic.o cpm1.o
obj-$(CONFIG_UCODE_PATCH) += micropatch.o
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index cb7df2d..57d78fa 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -85,9 +85,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);
@@ -189,6 +193,12 @@ void __iomem *cpm_muram_addr(unsigned long offset)
}
EXPORT_SYMBOL(cpm_muram_addr);
+unsigned long cpm_muram_offset(void __iomem *addr)
+{
+ return addr - muram_vbase;
+}
+EXPORT_SYMBOL(cpm_muram_offset);
+
/**
* cpm_muram_dma - turn a muram virtual address into a DMA address
* @offset: virtual address from cpm_muram_addr() to convert
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index cff550e..4b48094 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!");
@@ -314,7 +313,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;
@@ -325,97 +324,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);
-
/* 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 ed84182..ba30a25 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/cpm.h b/include/asm-powerpc/cpm.h
index ede38ff..63a5533 100644
--- a/include/asm-powerpc/cpm.h
+++ b/include/asm-powerpc/cpm.h
@@ -96,6 +96,7 @@ unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
int cpm_muram_free(unsigned long offset);
unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
void __iomem *cpm_muram_addr(unsigned long offset);
+unsigned long cpm_muram_offset(void __iomem *addr);
dma_addr_t cpm_muram_dma(void __iomem *addr);
int cpm_command(u32 command, u8 opcode);
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index c3be6e2..54864dd 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
@@ -89,20 +90,6 @@ unsigned int qe_get_brg_clk(void);
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);
-
-static inline void __iomem *qe_muram_addr(unsigned long offset)
-{
- return (void __iomem *)&qe_immr->muram[offset];
-}
-
-static inline unsigned long qe_muram_offset(void __iomem *addr)
-{
- return addr - (void __iomem *)qe_immr->muram;
-}
/* Structure that defines QE firmware binary files.
*
@@ -166,20 +153,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.5
^ permalink raw reply related
* Re: Problems of using APU/FPU under linux
From: John Bonesio @ 2008-04-14 18:32 UTC (permalink / raw)
To: Stephen Neuendorffer; +Cc: Shanyuan Gao, git, linuxppc-embedded
In-Reply-To: <977C41F842E66D4CB2E41332313B615005CB0A39@XSJ-EXCHVS1.xlnx.xilinx.com>
Hi,
The Linux kernel itself doesn't issue floating point instructions other than to save and restore the fpu state when necessary.
In Linux, the way it saves and restores the fpu state is to make use of the trap. When the trap (fpu unavailable) occurs, it loads the fpu state for the current task, sets up the MSR, and returns to re-try the instruction.
So, getting the trap is normal. If the FPU is not being set up correctly, then there may be a problem with the restoring of the state.
When you guild the Linux kernel, you need to have CONFIG_PPC_FPU enabled. Otherwise the kernel does not setup the fpu exception handling.
- John
On Monday 14 April 2008 10:35, Stephen Neuendorffer wrote:
>
> I'm not sure exactly what's going on here. Generally speaking, if you
> have the FPU instantiated in the design and enable the APU in the msr,
> then the processor should decode FP instructions and send them directly
> to the APU with no trap. I haven't done this myself, or I could
> probably give you some better help...
>
> One thing you should be aware of is that the there are gcc compiler
> patches which are necessary to get the FPU working properly. However, I
> don't think the failure mode that these patches workaround would cause a
> trap, so my guess is that there is still something else wrong.
>
> Steve
>
> > -----Original Message-----
> > From: linuxppc-embedded-bounces+stephen=neuendorffer.name@ozlabs.org
> [mailto:linuxppc-embedded-
> > bounces+stephen=neuendorffer.name@ozlabs.org] On Behalf Of Shanyuan
> Gao
> > Sent: Monday, April 14, 2008 9:18 AM
> > To: linuxppc-embedded@ozlabs.org
> > Subject: Problems of using APU/FPU under linux
> >
> > Hi,
> >
> > Recently I was trying to make APU/FPU working under Linux on Xilinx
> > ML410. The standalone programs work perfectly. However under Linux,
> > when I try to use a floating point operation, like *fmuls*, it will
> > give me a *trap*.
> >
> > By studying the user guide from Xilinx and dumping the object files,
> > I know I need to change the corresponding bits (APU enable, FP
> > enable, maybe APU Exception enable) in Machine State Register. I
> > guess I need to enable the bits whenever before the kernel uses
> > *mtmsr*. However, it doesn't work. I got the same trap with the same
> > MSR, as I had no APU/FPU before. I also tried to add the FPU.S to ppc
> > tree, but it doesn't work either.
> >
> > The questions are
> > 1. I guess there might be some place that changed MSR after all my
> > changes. But I don't know where. And can I write a kernel module to
> > change the MSR after booting in Linux? (well, it's hard for me though)
> >
> > 2. Does it have any exception/interrupt mechanism to direct FP
> > operation to APU/FPU? Or after enabling APU/FPU it will mask the
> > exception/interrupt and decode FP operation by itself?
> >
> >
> > Any ideas are appreciated. Thank you very much!
> >
> >
> > Shan
> >
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
^ 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