LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Issues to access Compact Flash Card on MPC8360E
From: Anton Vorontsov @ 2010-08-02 13:48 UTC (permalink / raw)
  To: Atul Deshmukh; +Cc: linuxppc-dev
In-Reply-To: <AANLkTikGL6LKJyWjK946enVwkUzviOsHasYbzV1Wj2LR@mail.gmail.com>

On Mon, Aug 02, 2010 at 06:08:14PM +0530, Atul Deshmukh wrote:
[...]
> 2: To access CF card in True IDE mode we have to use
> "linux-kernel-source/drivers/ata/pata_platform.c" and
> "linux-kernel-source/drivers/ata/libata-sff.c".....I'm going right??

CF IDE support was already implemented for MPC8349EmITX boards
with a bit of help from UPM (User-Programmable Machine), so
you can do the same for MPC8360.

UPM is programmed in U-Boot, u-boot/include/configs/MPC8349ITX.h
(CONFIG_SYS_BR3_PRELIM stuff), and
u-boot/board/freescale/mpc8349itx/mpc8349itx.c (UPMATable).

For linux part, see arch/powerpc/boot/dts/mpc8349emitx.dts (pata
node), and drivers/ata/pata_of_platform.c.

For HW side, you can find MPC8349EmITX schematics on Freescale
site (last time I checked, no registration was required).

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: Issues to access Compact Flash Card on MPC8360E
From: Atul Deshmukh @ 2010-08-02 14:14 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20100802134857.GA8689@oksana.dev.rtsoft.ru>

[-- Attachment #1: Type: text/plain, Size: 3256 bytes --]

Thanks a lot Anton,
>From the dts entry given below,

localbus@e0005000 {
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L251>
         #address-cells = <2>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L252>
               #size-cells = <1>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L253>
               compatible = "fsl,mpc8349e-localbus",
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L254>
                            "fsl,pq2pro-localbus";
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L255>
               reg = <0xe0005000 0xd8>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L256>
               ranges = <0x3 0x0 0xf0000000 0x210>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L257>
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L258>
               pata@3,0 {
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L259>
                       compatible = "fsl,mpc8349emitx-pata",
"ata-generic";
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L260>
                       reg = <0x3 0x0 0x10 0x3 0x20c 0x4>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L261>
                       reg-shift = <1>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L262>
                       pio-mode = <6>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L263>
                       interrupts = <23 0x8>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L264>
                      interrupt-parent = <&ipic>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L265>
               };
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L266>
       };


we can conclude that it uses ata-generic SATA/PATA controlelr driver which
controls PCI-based IDE-controller where we can plug in our CF card...Am I
right???
But in our design we don't use any controller we directly connects CF card
to local bus where UPM controls it..
Can you please explain how the interface is implemented in MPC8349..



On Mon, Aug 2, 2010 at 7:18 PM, linuxppc-dev@lists.ozlabs.org wrote:

> On Mon, Aug 02, 2010 at 06:08:14PM +0530, Atul Deshmukh wrote:
> [...]
> > 2: To access CF card in True IDE mode we have to use
> > "linux-kernel-source/drivers/ata/pata_platform.c" and
> > "linux-kernel-source/drivers/ata/libata-sff.c".....I'm going right??
>
> CF IDE support was already implemented for MPC8349EmITX boards
> with a bit of help from UPM (User-Programmable Machine), so
> you can do the same for MPC8360.
>
> UPM is programmed in U-Boot, u-boot/include/configs/MPC8349ITX.h
> (CONFIG_SYS_BR3_PRELIM stuff), and
> u-boot/board/freescale/mpc8349itx/mpc8349itx.c (UPMATable).
>
> For linux part, see arch/powerpc/boot/dts/mpc8349emitx.dts (pata
> node), and drivers/ata/pata_of_platform.c.
>
> For HW side, you can find MPC8349EmITX schematics on Freescale
> site (last time I checked, no registration was required).
>
> --
> Anton Vorontsov
> email: cbouatmailru@gmail.com
> irc://irc.freenode.net/bd2
>



-- 
Regards,
Atul

[-- Attachment #2: Type: text/html, Size: 4886 bytes --]

^ permalink raw reply

* Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver
From: Michał Nazarewicz @ 2010-08-02 14:25 UTC (permalink / raw)
  To: linux-usb, Uwe Kleine-König
  Cc: Cliff Cai, Mark Brown, Dinh Nguyen, Takashi Iwai, Nicolas Ferre,
	linux-kernel, linuxppc-dev, Julia Lawall, Laurent Pinchart,
	Philipp Zabel, Felipe Balbi, Andrea Gelmini, Robert Jarzmik,
	Christoph Hellwig, Dan Carpenter, FUJITA Tomonori, David Brownell,
	Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
	David Brownell, Tony Lindgren, André Goddard Rosa,
	Alan Stern, Sean MacLennan, Russell King, Tobias Klauser,
	Anatolij Gustschin, Alexey Dobriyan, Eirik Aanonsen,
	Mike Frysinger, Thomas Dahlmann, linux-geode, Fabien Chouteau,
	Ben Dooks, Magnus Damm, Thomas Gleixner, Anton Vorontsov,
	Andrew Victor, linux-arm-kernel, Robert Lukassen, Eric Miao,
	Németh Márton, Jiri Kosina, Yoshihiro Shimoda,
	Greg Kroah-Hartman, Harro Haan, Kyle McMartin, H Hartley Sweeten,
	Paul Mundt, Tejun Heo, Andrew Morton, Cory Maccarrone
In-Reply-To: <1280752803-11441-1-git-send-email-u.kleine-koenig@pengutronix.de>

Some random thoughts, one bug and mostly just minor comments:

> @@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
>  }
> /* Called by gadget driver to register itself */
> -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
> +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
> +		int (*bind)(struct usb_gadget *))
>  {
>  	struct udc		*dev =3D udc;
>  	int			retval;
>  	u32 tmp;
>-	if (!driver || !driver->bind || !driver->setup
> +	if (!driver || bind || !driver->setup


** BUG: Should read "!bind".


> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_u=
dc.c
> @@ -1612,7 +1613,7 @@ int usb_gadget_register_driver (struct usb_gadge=
t_driver *driver)
>  	DBG("bound to %s\n", driver->driver.name);
>  	return 0;
>  }
> -EXPORT_SYMBOL (usb_gadget_register_driver);
> +EXPORT_SYMBOL (usb_gadget_probe_driver);

How about also correcting space before "("?

> diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/=
atmel_usba_udc.c
> @@ -1789,7 +1789,8 @@ out:
>  	return IRQ_HANDLED;
>  }
>-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
> +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
> +		int (*bind)(struct usb_gadget *))
>  {
>  	struct usba_udc *udc =3D &the_udc;
>  	unsigned long flags;

There was no checking here?  How about adding?

> diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci1=
3xxx_udc.c
> @@ -2340,12 +2340,13 @@ static const struct usb_ep_ops usb_ep_ops =3D =
{
>  static const struct usb_gadget_ops usb_gadget_ops;
> /**
> - * usb_gadget_register_driver: register a gadget driver
> + * usb_gadget_probe_driver: register a gadget driver
>   *
> - * Check usb_gadget_register_driver() at "usb_gadget.h" for details
> - * Interrupts are enabled here
> + * Check usb_gadget_probe_driver() at "usb_gadget.h" for details.
> + * Interrupts are enabled here.
>   */

usb_gadget.h is the old name.  How about correcting it as well?

> diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/fi=
le_storage.c
> @@ -3583,7 +3582,7 @@ static int __init fsg_init(void)
>  	if ((rc =3D fsg_alloc()) !=3D 0)
>  		return rc;
>  	fsg =3D the_fsg;
> -	if ((rc =3D usb_gadget_register_driver(&fsg_driver)) !=3D 0)
> +	if ((rc =3D usb_gadget_probe_driver(&fsg_driver, fsg_bind)) !=3D 0)

I'm tempted to propose:

+ rc =3D usb_gadget_probe_driver(&fsg_driver, fsg_bind);
+ if (rc !=3D 0)

which is more compatible with coding style but it probably would be inco=
nsistent
with the rest of the code.

> diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/la=
ngwell_udc.c
> @@ -1807,7 +1807,8 @@ static DEVICE_ATTR(langwell_udc, S_IRUGO, show_l=
angwell_udc, NULL);
>   * the driver might get unbound.
>   */
>-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
> +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
> +		int (*bind)(struct usb_gadget *))
>  {
>  	struct langwell_udc	*dev =3D the_controller;
>  	unsigned long		flags;

Again, function has no checking, how about adding?

> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_ga=
dget.c
> @@ -1698,7 +1698,8 @@ void musb_gadget_cleanup(struct musb *musb)
>   * @param driver the gadget driver
>   * @return <0 if error, 0 if everything is fine
>   */

I've just noticed that it misses @param bind in the comment.  Would be g=
reat to update it
and all other occurrences.

> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> @@ -798,17 +797,18 @@ struct usb_gadget_driver {
>   */
> /**
> - * usb_gadget_register_driver - register a gadget driver
> - * @driver:the driver being registered
> + * usb_gadget_probe_driver - probe a gadget driver
> + * @driver: the driver being registered

+ * @bind: the driver's bind callback.

>   * Context: can sleep
>   *
>   * Call this in your gadget driver's module initialization function,
>   * to tell the underlying usb controller driver about your driver.
> - * The driver's bind() function will be called to bind it to a
> - * gadget before this registration call returns.  It's expected that
> - * the bind() functions will be in init sections.
> + * The bind() function will be called to bind it to a gadget before t=
his
> + * registration call returns.  It's expected that the bind() function=
 will

Maybe "the @bind function" in those two places?

So for what it's worth, I haven't noticed any other obvious problems.

I think it still does not fix all the section mismatch warnings -- would=
 have to look
closer at composite gadgets -- so I think still parts of my patch is leg=
it.

-- =

Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=3D./ `o
| Computer Science,  Micha=C5=82 "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--

^ permalink raw reply

* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Guenter Roeck @ 2010-08-02 16:15 UTC (permalink / raw)
  To: Greg KH
  Cc: Nick Cheng, Jani Nikula, Linus Walleij, James Smart,
	linuxppc-dev@ozlabs.org, Eric W. Biederman, Mark Brown,
	linux-kernel@vger.kernel.org, Chris Wright, Jean Delvare,
	James E.J. Bottomley, Richard Purdie, Alex Iannicelli,
	Dmitry Torokhov, Tejun Heo, Paul Mackerras, Benjamin Thery,
	linux-scsi@vger.kernel.org, Liam Girdwood
In-Reply-To: <20100730143622.GA30105@suse.de>

On Fri, 2010-07-30 at 10:36 -0400, Greg KH wrote:
> On Fri, Jul 30, 2010 at 08:28:10PM +1000, Benjamin Herrenschmidt wrote:
> > On Fri, 2010-07-30 at 10:45 +0200, Tejun Heo wrote:
> > > On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> > > > The following comment is found in include/linux/sysfs.h:
> > > > 
> > > >    /* FIXME
> > > >     * The *owner field is no longer used.
> > > >     * x86 tree has been cleaned up. The owner
> > > >     * attribute is still left for other arches.
> > > >     */
> > > > 
> > > > As it turns out, the *owner field is (again?) initialized in several modules,
> > > > suggesting that such initialization may be creeping back into the code.
> > > > 
> > > > This patch set removes the above comment, the *owner field, and each instance
> > > > in the code where it was found to be initialized.
> > > > 
> > > > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > > > and sparc defconfig builds.
> > > 
> > > Yeah, the change is way overdue.  Maybe we should have just removed
> > > them back then.
> > 
> > I'm happy with the powerpc related patches as long as we all agree that
> > needs to go. Do you need me to put some of this in powerpc.git or are
> > you carrying them all to Linus ?
> 
> I can carry them all in my driver-core tree if you don't object.
> 
Any final verdict ? 

Not that it is my decision to make, but I think it would be better to
have it all in one tree. Otherwise the timing for the last patch would
get a bit complicated.

Thanks,
Guenter

^ permalink raw reply

* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Greg KH @ 2010-08-02 16:53 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Nick Cheng, Jani Nikula, Linus Walleij, James Smart,
	linuxppc-dev@ozlabs.org, Eric W. Biederman, Mark Brown,
	linux-kernel@vger.kernel.org, Chris Wright, Jean Delvare,
	James E.J. Bottomley, Richard Purdie, Alex Iannicelli,
	Dmitry Torokhov, Tejun Heo, Paul Mackerras, Benjamin Thery,
	linux-scsi@vger.kernel.org, Liam Girdwood
In-Reply-To: <1280765724.5745.4.camel@groeck-laptop>

On Mon, Aug 02, 2010 at 09:15:24AM -0700, Guenter Roeck wrote:
> On Fri, 2010-07-30 at 10:36 -0400, Greg KH wrote:
> > On Fri, Jul 30, 2010 at 08:28:10PM +1000, Benjamin Herrenschmidt wrote:
> > > On Fri, 2010-07-30 at 10:45 +0200, Tejun Heo wrote:
> > > > On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> > > > > The following comment is found in include/linux/sysfs.h:
> > > > > 
> > > > >    /* FIXME
> > > > >     * The *owner field is no longer used.
> > > > >     * x86 tree has been cleaned up. The owner
> > > > >     * attribute is still left for other arches.
> > > > >     */
> > > > > 
> > > > > As it turns out, the *owner field is (again?) initialized in several modules,
> > > > > suggesting that such initialization may be creeping back into the code.
> > > > > 
> > > > > This patch set removes the above comment, the *owner field, and each instance
> > > > > in the code where it was found to be initialized.
> > > > > 
> > > > > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > > > > and sparc defconfig builds.
> > > > 
> > > > Yeah, the change is way overdue.  Maybe we should have just removed
> > > > them back then.
> > > 
> > > I'm happy with the powerpc related patches as long as we all agree that
> > > needs to go. Do you need me to put some of this in powerpc.git or are
> > > you carrying them all to Linus ?
> > 
> > I can carry them all in my driver-core tree if you don't object.
> > 
> Any final verdict ? 
> 
> Not that it is my decision to make, but I think it would be better to
> have it all in one tree. Otherwise the timing for the last patch would
> get a bit complicated.

I'll take it.

thanks,

greg k-h

^ permalink raw reply

* [PATCH] powerpc: Dont require a dma_ops struct to set dma mask
From: Kumar Gala @ 2010-08-02 17:21 UTC (permalink / raw)
  To: linuxppc-dev

The only reason to require a dma_ops struct is to see if it has
implemented set_dma_mask.  If not we can fall back to setting the mask
directly.

This resolves an issue with how to sequence the setting of a DMA mask
for platform devices.  Before we had an issue in that we have no way of
setting the DMA mask before the various low level bus notifiers get
called that might check it (swiotlb).

So now we can do:

	pdev = platform_device_alloc("foobar", 0);
	dma_set_mask(&pdev->dev, DMA_BIT_MASK(37));
	platform_device_register(pdev);

And expect the right thing to happen with the bus notifiers get called
via platform_device_register.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/include/asm/dma-mapping.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index c85ef23..17d5c17 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -131,9 +131,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
 {
 	struct dma_map_ops *dma_ops = get_dma_ops(dev);
 
-	if (unlikely(dma_ops == NULL))
-		return -EIO;
-	if (dma_ops->set_dma_mask != NULL)
+	if (unlikely(dma_ops == NULL) && (dma_ops->set_dma_mask != NULL))
 		return dma_ops->set_dma_mask(dev, dma_mask);
 	if (!dev->dma_mask || !dma_supported(dev, dma_mask))
 		return -EIO;
-- 
1.6.0.6

^ permalink raw reply related

* Re: [PATCH] perf, powerpc: Convert the FSL driver to use local64_t
From: Kumar Gala @ 2010-08-02 17:21 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Peter Zijlstra
In-Reply-To: <20100802061851.GA898@brick.ozlabs.ibm.com>


On Aug 2, 2010, at 1:18 AM, Paul Mackerras wrote:

> From: Peter Zijlstra <a.p.zijlstra@chello.nl>
>=20
> For some reason the FSL driver got left out when we converted perf
> to use local64_t instead of atomic64_t.
>=20
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> This is against the perf/core branch in the tip tree at
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
> Posting here for comment.
>=20
> arch/powerpc/kernel/perf_event_fsl_emb.c |   28 =
++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)

Acked-by: Kumar Gala <galak@kernel.crashing.org>

- k=

^ permalink raw reply

* Re: Issues to access Compact Flash Card on MPC8360E
From: Anton Vorontsov @ 2010-08-02 17:59 UTC (permalink / raw)
  To: Atul Deshmukh; +Cc: linuxppc-dev
In-Reply-To: <AANLkTikRq95=4Pbhne9CikR-gEHOOp7tETdV0Lnr0Chh@mail.gmail.com>

On Mon, Aug 02, 2010 at 07:44:22PM +0530, Atul Deshmukh wrote:
> Thanks a lot Anton,
> From the dts entry given below,
> 
> localbus@e0005000 {
>          #address-cells = <2>;
>                #size-cells = <1>;
>                compatible = "fsl,mpc8349e-localbus",
>                             "fsl,pq2pro-localbus";
>                reg = <0xe0005000 0xd8>;
>                ranges = <0x3 0x0 0xf0000000 0x210>;
>                pata@3,0 {
>                        compatible = "fsl,mpc8349emitx-pata",
> "ata-generic";
>                        reg = <0x3 0x0 0x10 0x3 0x20c 0x4>;
>                        reg-shift = <1>;
>                        pio-mode = <6>;
>                        interrupts = <23 0x8>;
>                       interrupt-parent = <&ipic>;
>                };
>        };
> 
> 
> we can conclude that it uses ata-generic SATA/PATA controlelr driver which

How did you come to this conclusion? From the node above it's IMHO
pretty clear that IDE (PATA) is on the localbus.

The driver is drivers/ata/pata_of_platform.c.

> controls PCI-based IDE-controller where we can plug in our CF card...Am I
> right???

Nope, no PCI involved. CF is almost* directly connected to
the localbus.

> But in our design we don't use any controller we directly connects CF card
> to local bus where UPM controls it..

Yes, that's exactly how CF is done on MPC8349EmITX boards.

> Can you please explain how the interface is implemented in MPC8349..

Via localbus + UPM.

* 'almost' is because there are some buffers and inverters, see
  schematics:
  http://www.freescale.com/files/32bit/hardware_tools/schematics/MPC8349EMITXESCH.pdf

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Sam Ravnborg @ 2010-08-02 18:28 UTC (permalink / raw)
  To: Thomas Backlund
  Cc: Michal Marek, linuxppc-dev, Linux Kernel Mailing List, bug-make
In-Reply-To: <4C5686FF.9010803@mandriva.org>

On Mon, Aug 02, 2010 at 11:51:11AM +0300, Thomas Backlund wrote:
> Hi,
> (please cc me as I'm not subscribed)
>
> updating from make 3.81 to 3.82 gets me this:
>
> [thomas@tmb linux-2.6.35]$ cp arch/powerpc/configs/ppc64_defconfig .config
> [thomas@tmb linux-2.6.35]$ LC_ALL=C make oldconfig ARCH=powerpc
> /mnt/work/2.6.35/linux-2.6.35/arch/powerpc/Makefile:183: *** mixed  
> implicit and normal rules.  Stop.
>
> The lines are:
>
> 182:
> 183: $(BOOT_TARGETS): vmlinux
> 184:         $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst  
> %,$(boot)/%,$@)
> 185:
>
> BOOT_TARGETS are defined on line 166 as:
> BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.%  
> cuImage.% simpleImage.%
>
>
> Now it's not a regression in the kernel as the same happends with the  
> 2.6.34 tree too.
>
> (btw, the host I'm syncing the defconfig with is a x86_64 machine)
>
>
> Now, I dont know if this is "intended breakage" by the make update, or  
> if the Makefile needs to be updated....
>
> Any ideas how to fix ?

This is in the category "intended breakage".
We had a similar issue in the top-level Makefile which Paul (IIRC)
helped me to fix long time ago.

To fix popwerpc I suggest something along these lines.
[Note: I did not test it - please do so.

	Sam

[PATCH] powerpc: fix build with make 3.82

Thomas Backlund reported that the powerpc build broke with make 3.82.
It failed with the following message:

    arch/powerpc/Makefile:183: *** mixed implicit and normal rules.  Stop.

The fix is to avoid mixing non-wildcard and wildcard targets.

Reported-by: Thomas Backlund <tmb@mandriva.org>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 77cfe7a..ad88b21 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
 # Default to zImage, override when needed
 all: zImage
 
-BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
+# With make 3.82 we cannot mix normal and wildcard targets
+BOOT_TARGETS1 := zImage zImage.initrd uImaged
+BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
 
-PHONY += $(BOOT_TARGETS)
+PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
 
 boot := arch/$(ARCH)/boot
 
@@ -180,7 +182,9 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
 zImage: relocs_check
 endif
 
-$(BOOT_TARGETS): vmlinux
+$(BOOT_TARGETS1): vmlinux
+	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+$(BOOT_TARGETS2): vmlinux
 	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
 bootwrapper_install %.dtb:

^ permalink raw reply related

* Re: [PATCH v2 1/2] powerpc/85xx: kexec for SMP 85xx BookE systems
From: Kumar Gala @ 2010-08-02 19:37 UTC (permalink / raw)
  To: Matthew McClintock; +Cc: linuxppc-dev
In-Reply-To: <1279746894-29529-2-git-send-email-msm@freescale.com>


On Jul 21, 2010, at 4:14 PM, Matthew McClintock wrote:

> Adds support for kexec on 85xx machines for the BookE platform.
> Including support for SMP machines
>=20
> Based off work from Maxim Uvarov <muvarov@mvista.com>
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> arch/powerpc/Kconfig              |   10 +++---
> arch/powerpc/platforms/85xx/smp.c |   63 =
+++++++++++++++++++++++++++++++++++++
> 2 files changed, 68 insertions(+), 5 deletions(-)

applied to next

- k=

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Sam Ravnborg @ 2010-08-02 20:51 UTC (permalink / raw)
  To: Thomas Backlund
  Cc: Michal Marek, linuxppc-dev, Linux Kernel Mailing List, bug-make
In-Reply-To: <4C572EB0.7060706@mandriva.org>

> 
> Thanks, this seems to fix the first issue, but then I get the same erro on the following line 190:
> 
> 190: bootwrapper_install %.dtb:
> 191:        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
> 

Obviously - dunno how I missed that.
Updated patch below.

I will do a proper submission after you
confirm that powerpc build is working with make 3.82.

	Sam

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 77cfe7a..ace7a3e 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
 # Default to zImage, override when needed
 all: zImage
 
-BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
+# With make 3.82 we cannot mix normal and wildcard targets
+BOOT_TARGETS1 := zImage zImage.initrd uImaged
+BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
 
-PHONY += $(BOOT_TARGETS)
+PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
 
 boot := arch/$(ARCH)/boot
 
@@ -180,10 +182,16 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
 zImage: relocs_check
 endif
 
-$(BOOT_TARGETS): vmlinux
+$(BOOT_TARGETS1): vmlinux
+	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+$(BOOT_TARGETS2): vmlinux
+	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+
+
+bootwrapper_install
 	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
-bootwrapper_install %.dtb:
+%.dtb:
 	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
 define archhelp

^ permalink raw reply related

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Thomas Backlund @ 2010-08-02 20:46 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Michal Marek, linuxppc-dev, Linux Kernel Mailing List, bug-make
In-Reply-To: <20100802182848.GA16394@merkur.ravnborg.org>

02.08.2010 21:28, Sam Ravnborg skrev:
> On Mon, Aug 02, 2010 at 11:51:11AM +0300, Thomas Backlund wrote:
>> Hi,
>> (please cc me as I'm not subscribed)
>>
>> updating from make 3.81 to 3.82 gets me this:
>>
>> [thomas@tmb linux-2.6.35]$ cp arch/powerpc/configs/ppc64_defconfig .config
>> [thomas@tmb linux-2.6.35]$ LC_ALL=C make oldconfig ARCH=powerpc
>> /mnt/work/2.6.35/linux-2.6.35/arch/powerpc/Makefile:183: *** mixed  
>> implicit and normal rules.  Stop.
>>
>> The lines are:
>>
>> 182:
>> 183: $(BOOT_TARGETS): vmlinux
>> 184:         $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst  
>> %,$(boot)/%,$@)
>> 185:
>>
>> BOOT_TARGETS are defined on line 166 as:
>> BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.%  
>> cuImage.% simpleImage.%
>>
>>
>> Now it's not a regression in the kernel as the same happends with the  
>> 2.6.34 tree too.
>>
>> (btw, the host I'm syncing the defconfig with is a x86_64 machine)
>>
>>
>> Now, I dont know if this is "intended breakage" by the make update, or  
>> if the Makefile needs to be updated....
>>
>> Any ideas how to fix ?
> 
> This is in the category "intended breakage".
> We had a similar issue in the top-level Makefile which Paul (IIRC)
> helped me to fix long time ago.
> 
> To fix popwerpc I suggest something along these lines.
> [Note: I did not test it - please do so.
> 
> 	Sam
> 
> [PATCH] powerpc: fix build with make 3.82
> 
> Thomas Backlund reported that the powerpc build broke with make 3.82.
> It failed with the following message:
> 
>     arch/powerpc/Makefile:183: *** mixed implicit and normal rules.  Stop.
> 
> The fix is to avoid mixing non-wildcard and wildcard targets.
> 
> Reported-by: Thomas Backlund <tmb@mandriva.org>
> Cc: Michal Marek <mmarek@suse.cz>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 77cfe7a..ad88b21 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
>  # Default to zImage, override when needed
>  all: zImage
>  
> -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
> +# With make 3.82 we cannot mix normal and wildcard targets
> +BOOT_TARGETS1 := zImage zImage.initrd uImaged
> +BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
>  
> -PHONY += $(BOOT_TARGETS)
> +PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
>  
>  boot := arch/$(ARCH)/boot
>  
> @@ -180,7 +182,9 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
>  zImage: relocs_check
>  endif
>  
> -$(BOOT_TARGETS): vmlinux
> +$(BOOT_TARGETS1): vmlinux
> +	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
> +$(BOOT_TARGETS2): vmlinux
>  	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
>  
>  bootwrapper_install %.dtb:


Thanks, this seems to fix the first issue, but then I get the same erro on the following line 190:

190: bootwrapper_install %.dtb:
191:        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)


--
Thomas

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Andreas Schwab @ 2010-08-02 21:02 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Michal Marek, linuxppc-dev, bug-make, Linux Kernel Mailing List,
	Thomas Backlund
In-Reply-To: <20100802205121.GA16520@merkur.ravnborg.org>

Sam Ravnborg <sam@ravnborg.org> writes:

> +bootwrapper_install

Missing colon.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Thomas Backlund @ 2010-08-02 21:03 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Michal Marek, linuxppc-dev@ozlabs.org, bug-make@gnu.org,
	Linux Kernel Mailing List, Thomas Backlund
In-Reply-To: <20100802205121.GA16520@merkur.ravnborg.org>

02.08.2010 23:51, Sam Ravnborg skrev:
>>
>> Thanks, this seems to fix the first issue, but then I get the same erro on the following line 190:
>>
>> 190: bootwrapper_install %.dtb:
>> 191:        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
>>
> 
> Obviously - dunno how I missed that.
> Updated patch below.
> 
> I will do a proper submission after you
> confirm that powerpc build is working with make 3.82.
> 

Yeah, that was an obvious fix, thanks!

One small typo fix below...
(a missing ':')

Otherwise it works here, so:

Tested-by: Thomas Backlund <tmb@mandriva.org>

> 	Sam
> 
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 77cfe7a..ace7a3e 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
>  # Default to zImage, override when needed
>  all: zImage
>  
> -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
> +# With make 3.82 we cannot mix normal and wildcard targets
> +BOOT_TARGETS1 := zImage zImage.initrd uImaged
> +BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
>  
> -PHONY += $(BOOT_TARGETS)
> +PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
>  
>  boot := arch/$(ARCH)/boot
>  
> @@ -180,10 +182,16 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
>  zImage: relocs_check
>  endif
>  
> -$(BOOT_TARGETS): vmlinux
> +$(BOOT_TARGETS1): vmlinux
> +	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
> +$(BOOT_TARGETS2): vmlinux
> +	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
> +
> +
> +bootwrapper_install

bootwrapper_install:

>  	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
>  
> -bootwrapper_install %.dtb:
> +%.dtb:
>  	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
>  
>  define archhelp
> .
> 

--
Thomas

^ permalink raw reply

* Re: Please pull my perf.git urgent branch
From: Scott Wood @ 2010-08-02 22:16 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: Peter Zijlstra, Kumar Gala, linux-kernel, linuxppc-dev,
	Ingo Molnar
In-Reply-To: <20100728044731.GA2408@brick.ozlabs.ibm.com>

On Wed, 28 Jul 2010 14:47:31 +1000
Paul Mackerras <paulus@samba.org> wrote:

> On Tue, Jul 27, 2010 at 11:28:54AM -0500, Scott Wood wrote:
> 
> > Doesn't the setting of .period need to be maintained (it is in the other
> > powerpc perf_event implementation that this is derived from)?
> 
> Gah, yes it does.

Well, looks like Linus pulled anyway...  I'll send a patch to
add .period.

-Scott

^ permalink raw reply

* [PATCH] perf, powerpc: fsl_emb: Restore setting perf_sample_data.period
From: Scott Wood @ 2010-08-02 22:17 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Peter Zijlstra, linuxppc-dev, linux-kernel

Commit 6b95ed345b9faa4ab3598a82991968f2e9f851bb changed from
a struct initializer to perf_sample_data_init(), but the setting
of the .period member was left out.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/kernel/perf_event_fsl_emb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c b/arch/powerpc/kernel/perf_event_fsl_emb.c
index babccee..4339d20 100644
--- a/arch/powerpc/kernel/perf_event_fsl_emb.c
+++ b/arch/powerpc/kernel/perf_event_fsl_emb.c
@@ -569,6 +569,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
 		struct perf_sample_data data;
 
 		perf_sample_data_init(&data, 0);
+		data.period = event->hw.last_period;
 
 		if (perf_event_overflow(event, nmi, &data, regs)) {
 			/*
-- 
1.7.0.4

^ permalink raw reply related

* Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver
From: Greg KH @ 2010-08-02 22:54 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Cliff Cai, Mark Brown, Dinh Nguyen, Takashi Iwai, Nicolas Ferre,
	linux-kernel, linuxppc-dev, Julia Lawall, Laurent Pinchart,
	Philipp Zabel, Felipe Balbi, Andrea Gelmini, Robert Jarzmik,
	Fabien Chouteau, Dan Carpenter, FUJITA Tomonori, David Brownell,
	Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
	David Brownell, Tony Lindgren, André Goddard Rosa,
	Alan Stern, Sean MacLennan, Russell King, Tobias Klauser,
	Anatolij Gustschin, Alexey Dobriyan, Eirik Aanonsen,
	Mike Frysinger, Thomas Dahlmann, linux-geode, Ben Dooks,
	Magnus Damm, Thomas Gleixner, Anton Vorontsov, Andrew Victor,
	linux-arm-kernel, Robert Lukassen, Eric Miao,
	Németh Márton, Jiri Kosina, Yoshihiro Shimoda,
	linux-usb, Michał Nazarewicz, Harro Haan, Kyle McMartin,
	H Hartley Sweeten, Paul Mundt, Tejun Heo, Andrew Morton,
	Cory Maccarrone
In-Reply-To: <20100802131248.GD13900@pengutronix.de>

On Mon, Aug 02, 2010 at 03:12:48PM +0200, Uwe Kleine-König wrote:
> On Mon, Aug 02, 2010 at 02:51:36PM +0200, Julia Lawall wrote:
> > > diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
> > > index 731150d..c266c1e 100644
> > > --- a/drivers/usb/gadget/amd5536udc.c
> > > +++ b/drivers/usb/gadget/amd5536udc.c
> > > @@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
> > >  }
> > >  
> > >  /* Called by gadget driver to register itself */
> > > -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
> > > +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
> > > +		int (*bind)(struct usb_gadget *))
> > >  {
> > >  	struct udc		*dev = udc;
> > >  	int			retval;
> > >  	u32 tmp;
> > >  
> > > -	if (!driver || !driver->bind || !driver->setup
> > > +	if (!driver || bind || !driver->setup
> > 
> > I have the impression that this should be !bind rather than bind.  
> ah, now I see what you meant.  Obviously you're right.  I fixed it up
> locally here for now.  Greg, just tell me when/if you need a fixed
> patch.

Didn't you already post a "fixed" patch?

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH 2/3] USB: add of_platform glue driver for FSL USB DR controller
From: Greg KH @ 2010-08-02 23:01 UTC (permalink / raw)
  To: Greg KH
  Cc: David Brownell, Wolfgang Denk, Detlev Zundel, linux-usb,
	linuxppc-dev, Anatolij Gustschin
In-Reply-To: <20100728184647.GA7128@suse.de>

On Wed, Jul 28, 2010 at 11:46:47AM -0700, Greg KH wrote:
> On Wed, Jul 28, 2010 at 12:14:14PM -0600, Grant Likely wrote:
> > On Wed, Jul 28, 2010 at 5:58 AM, Anatolij Gustschin <agust@denx.de> wrote:
> > > Hi Grant,
> > >
> > > On Wed, 28 Jul 2010 02:16:08 -0600
> > > Grant Likely <grant.likely@secretlab.ca> wrote:
> > >
> > >> On Thu, Jul 22, 2010 at 10:25 AM, Anatolij Gustschin <agust@denx.de> wrote:
> > >> > The driver creates platform devices based on the information
> > >> > from USB nodes in the flat device tree. This is the replacement
> > >> > for old arch fsl_soc usb code removed by the previous patch.
> > >> > It uses usual of-style binding, available EHCI-HCD and UDC
> > >> > drivers can be bound to the created devices. The new of-style
> > >> > driver additionaly instantiates USB OTG platform device, as the
> > >> > appropriate USB OTG driver will be added soon.
> > >> >
> > >> > Signed-off-by: Anatolij Gustschin <agust@denx.de>
> > >> > Cc: Kumar Gala <galak@kernel.crashing.org>
> > >> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > >>
> > >> Hi Anatolij,
> > >>
> > >> Looks pretty good, but some comments below.
> > >
> > > Thanks for review and comments! Greg already merged this series and
> > > therefore I'll submit an incremental cleanup patch to address
> > > outstanding issues. My reply is below.
> > 
> > Greg maintains a patchwork tree IIRC.  I believe he drops patches from
> > his linux-next branch if they need to be reworked.  Greg, do I have
> > this right?
> 
> Yup.  I can easily drop all of these patches.
> 
> > Also, my preference would be to see some 3rd party testing before
> > committing to having this merged.
> 
> Ok, I will go drop them all now, and wait for some that pass your
> review.

All 3 now dropped.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Greg KH @ 2010-08-02 23:31 UTC (permalink / raw)
  To: Eric Biederman
  Cc: Mark Brown, Jani Nikula, Linus Walleij, James Smart, linuxppc-dev,
	Benjamin Thery, Greg Kroah-Hartman, linux-kernel, Chris Wright,
	Tejun Heo, James E.J. Bottomley, Richard Purdie, Nick Cheng,
	Dmitry Torokhov, Jean Delvare, Paul Mackerras, Liam Girdwood,
	linux-scsi, Alex Iannicelli, Guenter Roeck
In-Reply-To: <AANLkTinM+m15QbAg+J3YyHWnObsxtHYYU6p6C89p8wjp@mail.gmail.com>

On Wed, Jul 28, 2010 at 11:16:35PM -0700, Eric Biederman wrote:
> On Wed, Jul 28, 2010 at 10:09 PM, Guenter Roeck
> <guenter.roeck@ericsson.com> wrote:
> > The following comment is found in include/linux/sysfs.h:
> >
> >   /* FIXME
> >    * The *owner field is no longer used.
> >    * x86 tree has been cleaned up. The owner
> >    * attribute is still left for other arches.
> >    */
> >
> > As it turns out, the *owner field is (again?) initialized in several modules,
> > suggesting that such initialization may be creeping back into the code.
> >
> > This patch set removes the above comment, the *owner field, and each instance
> > in the code where it was found to be initialized.
> >
> > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > and sparc defconfig builds.
> 
> This seems reasonable to me.  Can we get this in linux-next?

It will show up in linux-next tomorrow.

thanks,

greg k-h

^ permalink raw reply

* Please pull my perf.git master branch
From: Paul Mackerras @ 2010-08-03  1:04 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Scott Wood, linux-kernel, linuxppc-dev

Ingo,

Please do a pull from my perf.git tree at:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perf.git master

to get two commits.  They only affect the driver for the PMU on the
Freescale embedded PowerPC processors.  One is from Peter Z. and has
been around for some time.  The other fixes a bug introduced by a
patch from Peter Z. that I sent upstream recently.

Thanks,
Paul.

Peter Zijlstra (1):
      perf, powerpc: Convert the FSL driver to use local64_t

Scott Wood (1):
      perf, powerpc: fsl_emb: Restore setting perf_sample_data.period

 arch/powerpc/kernel/perf_event_fsl_emb.c |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

^ permalink raw reply

* [PATCH 2/3 v2] dts: Add sdhci,auto-cmd12 field for p4080 device tree
From: Roy Zang @ 2010-08-03  3:11 UTC (permalink / raw)
  To: linux-mmc; +Cc: linuxppc-dev, akpm
In-Reply-To: <1280805072-26112-1-git-send-email-tie-fei.zang@freescale.com>

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
 Documentation/powerpc/dts-bindings/fsl/esdhc.txt |    2 ++
 arch/powerpc/boot/dts/p4080ds.dts                |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
index 8a00407..64bcb8b 100644
--- a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
@@ -14,6 +14,8 @@ Required properties:
     reports inverted write-protect state;
   - sdhci,1-bit-only : (optional) specifies that a controller can
     only handle 1-bit data transfers.
+  - sdhci,auto-cmd12: (optional) specifies that a controller can
+    only handle auto CMD12.
 
 Example:
 
diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
index 6b29eab..efa0091 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -280,6 +280,7 @@
 			reg = <0x114000 0x1000>;
 			interrupts = <48 2>;
 			interrupt-parent = <&mpic>;
+			sdhci,auto-cmd12;
 		};
 
 		i2c@118000 {
-- 
1.5.6.5

^ permalink raw reply related

* [PATCH 3/3 v2] dts: Add ESDHC weird voltage bits workaround
From: Roy Zang @ 2010-08-03  3:11 UTC (permalink / raw)
  To: linux-mmc; +Cc: linuxppc-dev, akpm
In-Reply-To: <1280805072-26112-2-git-send-email-tie-fei.zang@freescale.com>

P4080 ESDHC controller does not support 1.8V and 3.0V voltage. but the
host controller capabilities register wrongly set the bits.
This patch adds the workaround to correct the weird voltage setting bits.
Only 3.3V voltage is supported for P4080 ESDHC controller.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
 arch/powerpc/boot/dts/p4080ds.dts |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
index efa0091..2f0de24 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -280,6 +280,7 @@
 			reg = <0x114000 0x1000>;
 			interrupts = <48 2>;
 			interrupt-parent = <&mpic>;
+			voltage-ranges = <3300 3300>;
 			sdhci,auto-cmd12;
 		};
 
-- 
1.5.6.5

^ permalink raw reply related

* [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver
From: Roy Zang @ 2010-08-03  3:11 UTC (permalink / raw)
  To: linux-mmc; +Cc: linuxppc-dev, akpm

From: Jerry Huang <Chang-Ming.Huang@freescale.com>

Add auto CMD12 command support for eSDHC driver.
This is needed by P4080 and P1022 for block read/write.
Manual asynchronous CMD12 abort operation causes protocol violations on
these silicons.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
 drivers/mmc/host/sdhci-of-core.c |    4 ++++
 drivers/mmc/host/sdhci.c         |   14 ++++++++++++--
 drivers/mmc/host/sdhci.h         |    2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c
index a2e9820..dd1bdd1 100644
--- a/drivers/mmc/host/sdhci-of-core.c
+++ b/drivers/mmc/host/sdhci-of-core.c
@@ -154,6 +154,10 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev,
 		host->ops = &sdhci_of_data->ops;
 	}
 
+	if (of_get_property(np, "sdhci,auto-cmd12", NULL))
+		host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
+
+
 	if (of_get_property(np, "sdhci,1-bit-only", NULL))
 		host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
 
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c6d1bd8..a92566e 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -817,8 +817,12 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host,
 	WARN_ON(!host->data);
 
 	mode = SDHCI_TRNS_BLK_CNT_EN;
-	if (data->blocks > 1)
-		mode |= SDHCI_TRNS_MULTI;
+	if (data->blocks > 1) {
+		if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
+			mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
+		else
+			mode |= SDHCI_TRNS_MULTI;
+	}
 	if (data->flags & MMC_DATA_READ)
 		mode |= SDHCI_TRNS_READ;
 	if (host->flags & SDHCI_REQ_USE_DMA)
@@ -1108,6 +1112,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 #ifndef SDHCI_USE_LEDS_CLASS
 	sdhci_activate_led(host);
 #endif
+	if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) {
+		if (mrq->stop) {
+			mrq->data->stop = NULL;
+			mrq->stop = NULL;
+		}
+	}
 
 	host->mrq = mrq;
 
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index c846813..8fb088c 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -240,6 +240,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN		(1<<25)
 /* Controller cannot support End Attribute in NOP ADMA descriptor */
 #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC		(1<<26)
+/* Controller uses Auto CMD12 command to stop the transfer */
+#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12		(1<<27)
 
 	int			irq;		/* Device IRQ */
 	void __iomem *		ioaddr;		/* Mapped address */
-- 
1.5.6.5

^ permalink raw reply related

* Re: [PATCH v4 1/2] powerpc: cleanup APIs for cpu/thread/core mappings
From: Benjamin Herrenschmidt @ 2010-08-03  4:44 UTC (permalink / raw)
  To: Vaidyanathan Srinivasan
  Cc: Michael Neuling, Paul Mackerras, Anton Blanchard, linuxppc-dev
In-Reply-To: <20100722005707.12905.83615.stgit@drishya.in.ibm.com>

On Thu, 2010-07-22 at 06:27 +0530, Vaidyanathan Srinivasan wrote:
> These APIs take logical cpu number as input
> Change cpu_first_thread_in_core() to cpu_leftmost_thread_sibling()
> Change cpu_last_thread_in_core() to cpu_rightmost_thread_sibling()

I'm still not happy here.

I don't find leftmost/rightmost to be a "progress" from the previous
naming. If you really want to change to avoid in_core() at the end, then
call them first_thread_sibling() and last_thread_sibling().

Then you change:

> -static inline int cpu_thread_to_core(int cpu)
> -{
> -	return cpu >> threads_shift;
> -}

  .../... to:

> -/* Must be called when no change can occur to cpu_present_mask,
> +/* Helper routines for cpu to core mapping */
> +int cpu_core_of_thread(int cpu)
> +{
> +	return cpu >> threads_shift;
> +}
> +EXPORT_SYMBOL_GPL(cpu_core_of_thread);

Any reason you are making it out of line other than gratuituous
bloat ? :-)

> +int cpu_first_thread_of_core(int core)
> +{
> +	return core << threads_shift;
> +}
> +EXPORT_SYMBOL_GPL(cpu_first_thread_of_core);

Same.

Ben.

> +/* Must be called when no change can occur to cpu_present_map,
>   * i.e. during cpu online or offline.
>   */
>  static struct device_node *cpu_to_l2cache(int cpu)
> @@ -527,7 +540,7 @@ int __devinit start_secondary(void *unused)
>  	notify_cpu_starting(cpu);
>  	set_cpu_online(cpu, true);
>  	/* Update sibling maps */
> -	base = cpu_first_thread_in_core(cpu);
> +	base = cpu_leftmost_thread_sibling(cpu);
>  	for (i = 0; i < threads_per_core; i++) {
>  		if (cpu_is_offline(base + i))
>  			continue;
> @@ -606,7 +619,7 @@ int __cpu_disable(void)
>  		return err;
>  
>  	/* Update sibling maps */
> -	base = cpu_first_thread_in_core(cpu);
> +	base = cpu_leftmost_thread_sibling(cpu);
>  	for (i = 0; i < threads_per_core; i++) {
>  		cpumask_clear_cpu(cpu, cpu_sibling_mask(base + i));
>  		cpumask_clear_cpu(base + i, cpu_sibling_mask(cpu));
> diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
> index ddfd7ad..22f3bc5 100644
> --- a/arch/powerpc/mm/mmu_context_nohash.c
> +++ b/arch/powerpc/mm/mmu_context_nohash.c
> @@ -111,8 +111,8 @@ static unsigned int steal_context_smp(unsigned int id)
>  		 * a core map instead but this will do for now.
>  		 */
>  		for_each_cpu(cpu, mm_cpumask(mm)) {
> -			for (i = cpu_first_thread_in_core(cpu);
> -			     i <= cpu_last_thread_in_core(cpu); i++)
> +			for (i = cpu_leftmost_thread_sibling(cpu);
> +			     i <= cpu_rightmost_thread_sibling(cpu); i++)
>  				__set_bit(id, stale_map[i]);
>  			cpu = i - 1;
>  		}
> @@ -264,14 +264,14 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
>  	 */
>  	if (test_bit(id, stale_map[cpu])) {
>  		pr_hardcont(" | stale flush %d [%d..%d]",
> -			    id, cpu_first_thread_in_core(cpu),
> -			    cpu_last_thread_in_core(cpu));
> +			    id, cpu_leftmost_thread_sibling(cpu),
> +			    cpu_rightmost_thread_sibling(cpu));
>  
>  		local_flush_tlb_mm(next);
>  
>  		/* XXX This clear should ultimately be part of local_flush_tlb_mm */
> -		for (i = cpu_first_thread_in_core(cpu);
> -		     i <= cpu_last_thread_in_core(cpu); i++) {
> +		for (i = cpu_leftmost_thread_sibling(cpu);
> +		     i <= cpu_rightmost_thread_sibling(cpu); i++) {
>  			__clear_bit(id, stale_map[i]);
>  		}
>  	}

^ permalink raw reply

* [PATCH 1/3] P4080/eLBC: Make Freescale elbc interrupt common to elbc devices
From: Roy Zang @ 2010-08-03  4:45 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: B25806, B11780

From: Lan Chunhe-B25806 <b25806@freescale.com>

Move Freescale elbc interrupt from nand dirver to elbc driver.
Then all elbc devices can use the interrupt instead of ONLY nand.

Signed-off-by: Lan Chunhe-B25806 <b25806@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
 arch/powerpc/Kconfig               |    7 +-
 arch/powerpc/include/asm/fsl_lbc.h |   34 +++++-
 arch/powerpc/sysdev/fsl_lbc.c      |  254 ++++++++++++++++++++++++++++++------
 3 files changed, 253 insertions(+), 42 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 2031a28..5155b53 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -703,9 +703,12 @@ config 4xx_SOC
 	bool
 
 config FSL_LBC
-	bool
+	bool "Freescale Local Bus support"
+	depends on FSL_SOC
 	help
-	  Freescale Localbus support
+	  Enables reporting of errors from the Freescale local bus
+	  controller.  Also contains some common code used by
+	  drivers for specific local bus peripherals.
 
 config FSL_GTM
 	bool
diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h
index 1b5a210..9b95eab 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -1,9 +1,10 @@
 /* Freescale Local Bus Controller
  *
- * Copyright (c) 2006-2007 Freescale Semiconductor
+ * Copyright (c) 2006-2007, 2010 Freescale Semiconductor
  *
  * Authors: Nick Spence <nick.spence@freescale.com>,
  *          Scott Wood <scottwood@freescale.com>
+ *          Jack Lan <jack.lan@freescale.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,6 +28,9 @@
 #include <linux/types.h>
 #include <linux/io.h>
 
+#include <linux/of_platform.h>
+#include <linux/interrupt.h>
+
 struct fsl_lbc_bank {
 	__be32 br;             /**< Base Register  */
 #define BR_BA           0xFFFF8000
@@ -125,13 +129,23 @@ struct fsl_lbc_regs {
 #define LTESR_ATMW 0x00800000
 #define LTESR_ATMR 0x00400000
 #define LTESR_CS   0x00080000
+#define LTESR_UPM  0x00000002
 #define LTESR_CC   0x00000001
 #define LTESR_NAND_MASK (LTESR_FCT | LTESR_PAR | LTESR_CC)
+#define LTESR_MASK      (LTESR_BM | LTESR_FCT | LTESR_PAR | LTESR_WP \
+			 | LTESR_ATMW | LTESR_ATMR | LTESR_CS | LTESR_UPM \
+			 | LTESR_CC)
+#define LTESR_CLEAR	0xFFFFFFFF
+#define LTECCR_CLEAR	0xFFFFFFFF
+#define LTESR_STATUS	LTESR_MASK
+#define LTEIR_ENABLE	LTESR_MASK
+#define LTEDR_ENABLE	0x00000000
 	__be32 ltedr;           /**< Transfer Error Disable Register */
 	__be32 lteir;           /**< Transfer Error Interrupt Register */
 	__be32 lteatr;          /**< Transfer Error Attributes Register */
 	__be32 ltear;           /**< Transfer Error Address Register */
-	u8 res6[0xC];
+	__be32 lteccr;          /**< Transfer Error ECC Register */
+	u8 res6[0x8];
 	__be32 lbcr;            /**< Configuration Register */
 #define LBCR_LDIS  0x80000000
 #define LBCR_LDIS_SHIFT    31
@@ -265,7 +279,23 @@ static inline void fsl_upm_end_pattern(struct fsl_upm *upm)
 		cpu_relax();
 }
 
+/* overview of the fsl lbc controller */
+
+struct fsl_lbc_ctrl {
+	/* device info */
+	struct device			*dev;
+	struct fsl_lbc_regs __iomem	*regs;
+	int				irq;
+	wait_queue_head_t		irq_wait;
+	spinlock_t			lock;
+	void				*nand;
+
+	/* status read from LTESR by irq handler */
+	unsigned int			irq_status;
+};
+
 extern int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base,
 			       u32 mar);
+extern struct fsl_lbc_ctrl *fsl_lbc_ctrl_dev;
 
 #endif /* __ASM_FSL_LBC_H */
diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index dceb8d1..9c9e44f 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -5,6 +5,10 @@
  *
  * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
  *
+ * Copyright (c) 2010 Freescale Semiconductor
+ *
+ * Authors: Jack Lan <Jack.Lan@freescale.com>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -23,35 +27,8 @@
 #include <asm/fsl_lbc.h>
 
 static spinlock_t fsl_lbc_lock = __SPIN_LOCK_UNLOCKED(fsl_lbc_lock);
-static struct fsl_lbc_regs __iomem *fsl_lbc_regs;
-
-static char __initdata *compat_lbc[] = {
-	"fsl,pq2-localbus",
-	"fsl,pq2pro-localbus",
-	"fsl,pq3-localbus",
-	"fsl,elbc",
-};
-
-static int __init fsl_lbc_init(void)
-{
-	struct device_node *lbus;
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(compat_lbc); i++) {
-		lbus = of_find_compatible_node(NULL, NULL, compat_lbc[i]);
-		if (lbus)
-			goto found;
-	}
-	return -ENODEV;
-
-found:
-	fsl_lbc_regs = of_iomap(lbus, 0);
-	of_node_put(lbus);
-	if (!fsl_lbc_regs)
-		return -ENOMEM;
-	return 0;
-}
-arch_initcall(fsl_lbc_init);
+struct fsl_lbc_ctrl *fsl_lbc_ctrl_dev;
+EXPORT_SYMBOL(fsl_lbc_ctrl_dev);
 
 /**
  * fsl_lbc_find - find Localbus bank
@@ -66,12 +43,12 @@ int fsl_lbc_find(phys_addr_t addr_base)
 {
 	int i;
 
-	if (!fsl_lbc_regs)
+	if (!fsl_lbc_ctrl_dev || !fsl_lbc_ctrl_dev->regs)
 		return -ENODEV;
 
-	for (i = 0; i < ARRAY_SIZE(fsl_lbc_regs->bank); i++) {
-		__be32 br = in_be32(&fsl_lbc_regs->bank[i].br);
-		__be32 or = in_be32(&fsl_lbc_regs->bank[i].or);
+	for (i = 0; i < ARRAY_SIZE(fsl_lbc_ctrl_dev->regs->bank); i++) {
+		__be32 br = in_be32(&fsl_lbc_ctrl_dev->regs->bank[i].br);
+		__be32 or = in_be32(&fsl_lbc_ctrl_dev->regs->bank[i].or);
 
 		if (br & BR_V && (br & or & BR_BA) == addr_base)
 			return i;
@@ -99,17 +76,20 @@ int fsl_upm_find(phys_addr_t addr_base, struct fsl_upm *upm)
 	if (bank < 0)
 		return bank;
 
-	br = in_be32(&fsl_lbc_regs->bank[bank].br);
+	if (!fsl_lbc_ctrl_dev || !fsl_lbc_ctrl_dev->regs)
+		return -ENODEV;
+
+	br = in_be32(&fsl_lbc_ctrl_dev->regs->bank[bank].br);
 
 	switch (br & BR_MSEL) {
 	case BR_MS_UPMA:
-		upm->mxmr = &fsl_lbc_regs->mamr;
+		upm->mxmr = &fsl_lbc_ctrl_dev->regs->mamr;
 		break;
 	case BR_MS_UPMB:
-		upm->mxmr = &fsl_lbc_regs->mbmr;
+		upm->mxmr = &fsl_lbc_ctrl_dev->regs->mbmr;
 		break;
 	case BR_MS_UPMC:
-		upm->mxmr = &fsl_lbc_regs->mcmr;
+		upm->mxmr = &fsl_lbc_ctrl_dev->regs->mcmr;
 		break;
 	default:
 		return -EINVAL;
@@ -143,14 +123,18 @@ EXPORT_SYMBOL(fsl_upm_find);
  * thus UPM pattern actually executed. Note that mar usage depends on the
  * pre-programmed AMX bits in the UPM RAM.
  */
+
 int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, u32 mar)
 {
 	int ret = 0;
 	unsigned long flags;
 
+	if (!fsl_lbc_ctrl_dev || !fsl_lbc_ctrl_dev->regs)
+		return -ENODEV;
+
 	spin_lock_irqsave(&fsl_lbc_lock, flags);
 
-	out_be32(&fsl_lbc_regs->mar, mar);
+	out_be32(&fsl_lbc_ctrl_dev->regs->mar, mar);
 
 	switch (upm->width) {
 	case 8:
@@ -172,3 +156,197 @@ int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, u32 mar)
 	return ret;
 }
 EXPORT_SYMBOL(fsl_upm_run_pattern);
+
+static int __devinit fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl)
+{
+	struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
+
+	/* clear event registers */
+	setbits32(&lbc->ltesr, LTESR_CLEAR);
+	out_be32(&lbc->lteatr, 0);
+	out_be32(&lbc->ltear, 0);
+	out_be32(&lbc->lteccr, LTECCR_CLEAR);
+	out_be32(&lbc->ltedr, LTEDR_ENABLE);
+
+	/* Enable interrupts for any detected events */
+	out_be32(&lbc->lteir, LTEIR_ENABLE);
+
+	return 0;
+}
+
+static int __devexit fsl_lbc_ctrl_remove(struct of_device *ofdev)
+{
+	struct fsl_lbc_ctrl *ctrl = dev_get_drvdata(&ofdev->dev);
+
+	if (ctrl->irq)
+		free_irq(ctrl->irq, ctrl);
+
+	if (ctrl->regs)
+		iounmap(ctrl->regs);
+
+	dev_set_drvdata(&ofdev->dev, NULL);
+	kfree(ctrl);
+
+	return 0;
+}
+
+/* NOTE: This interrupt is used to report localbus events of various kinds,
+ * such as transaction errors on the chipselects.
+ */
+
+static irqreturn_t fsl_lbc_ctrl_irq(int irqno, void *data)
+{
+	struct fsl_lbc_ctrl *ctrl = data;
+	struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
+	u32 status;
+
+	status = in_be32(&lbc->ltesr);
+
+	if (status) {
+		out_be32(&lbc->ltesr, LTESR_CLEAR);
+		out_be32(&lbc->lteatr, 0);
+		out_be32(&lbc->ltear, 0);
+		ctrl->irq_status = status;
+
+		if (status & LTESR_BM)
+			dev_err(ctrl->dev, "Local bus monitor time-out: "
+				"LTESR 0x%08X\n", status);
+		if (status & LTESR_WP)
+			dev_err(ctrl->dev, "Write protect error: "
+				"LTESR 0x%08X\n", status);
+		if (status & LTESR_ATMW)
+			dev_err(ctrl->dev, "Atomic write error: "
+				"LTESR 0x%08X\n", status);
+		if (status & LTESR_ATMR)
+			dev_err(ctrl->dev, "Atomic read error: "
+				"LTESR 0x%08X\n", status);
+		if (status & LTESR_CS)
+			dev_err(ctrl->dev, "Chip select error: "
+				"LTESR 0x%08X\n", status);
+		if (status & LTESR_UPM)
+			;
+		if (status & LTESR_FCT) {
+			dev_err(ctrl->dev, "FCM command time-out: "
+				"LTESR 0x%08X\n", status);
+			smp_wmb();
+			wake_up(&ctrl->irq_wait);
+		}
+		if (status & LTESR_PAR) {
+			dev_err(ctrl->dev, "Parity or Uncorrectable ECC error: "
+				"LTESR 0x%08X\n", status);
+			smp_wmb();
+			wake_up(&ctrl->irq_wait);
+		}
+		if (status & LTESR_CC) {
+			smp_wmb();
+			wake_up(&ctrl->irq_wait);
+		}
+		if (status & ~LTESR_MASK)
+			dev_err(ctrl->dev, "Unknown error: "
+				"LTESR 0x%08X\n", status);
+
+		return IRQ_HANDLED;
+	}
+
+	return IRQ_NONE;
+}
+
+/* fsl_lbc_ctrl_probe
+ *
+ * called by device layer when it finds a device matching
+ * one our driver can handled. This code allocates all of
+ * the resources needed for the controller only.  The
+ * resources for the NAND banks themselves are allocated
+ * in the chip probe function.
+*/
+
+static int __devinit fsl_lbc_ctrl_probe(struct of_device *ofdev,
+					 const struct of_device_id *match)
+{
+	int ret = 0;
+
+	fsl_lbc_ctrl_dev = kzalloc(sizeof(*fsl_lbc_ctrl_dev), GFP_KERNEL);
+	if (!fsl_lbc_ctrl_dev)
+		return -ENOMEM;
+
+	dev_set_drvdata(&ofdev->dev, fsl_lbc_ctrl_dev);
+
+	spin_lock_init(&fsl_lbc_ctrl_dev->lock);
+	init_waitqueue_head(&fsl_lbc_ctrl_dev->irq_wait);
+
+	fsl_lbc_ctrl_dev->regs = of_iomap(ofdev->dev.of_node, 0);
+	if (!fsl_lbc_ctrl_dev->regs) {
+		dev_err(&ofdev->dev, "failed to get memory region\n");
+		ret = -ENODEV;
+		goto err;
+	}
+
+	fsl_lbc_ctrl_dev->irq = of_irq_to_resource(ofdev->dev.of_node, 0, NULL);
+	if (fsl_lbc_ctrl_dev->irq == NO_IRQ) {
+		dev_err(&ofdev->dev, "failed to get irq resource\n");
+		ret = -ENODEV;
+		goto err;
+	}
+
+	fsl_lbc_ctrl_dev->dev = &ofdev->dev;
+
+	ret = fsl_lbc_ctrl_init(fsl_lbc_ctrl_dev);
+	if (ret < 0)
+		goto err;
+
+	ret = request_irq(fsl_lbc_ctrl_dev->irq, fsl_lbc_ctrl_irq, 0,
+				"fsl-lbc", fsl_lbc_ctrl_dev);
+	if (ret != 0) {
+		dev_err(&ofdev->dev, "failed to install irq (%d)\n",
+			fsl_lbc_ctrl_dev->irq);
+		ret = fsl_lbc_ctrl_dev->irq;
+		goto err;
+	}
+
+	return 0;
+
+err:
+	return ret;
+}
+
+static const struct of_device_id fsl_lbc_match[] = {
+	{
+		.compatible = "fsl,elbc",
+	},
+	{
+		.compatible = "fsl,pq3-localbus",
+	},
+	{
+		.compatible = "fsl,pq2-localbus",
+	},
+	{
+		.compatible = "fsl,pq2pro-localbus",
+	},
+	{},
+};
+
+static struct of_platform_driver fsl_lbc_ctrl_driver = {
+	.driver = {
+		.name = "fsl-lbc",
+		.of_match_table = fsl_lbc_match,
+	},
+	.probe = fsl_lbc_ctrl_probe,
+	.remove = __devexit_p(fsl_lbc_ctrl_remove),
+};
+
+static int __init fsl_lbc_init(void)
+{
+	return of_register_platform_driver(&fsl_lbc_ctrl_driver);
+}
+
+static void __exit fsl_lbc_exit(void)
+{
+	of_unregister_platform_driver(&fsl_lbc_ctrl_driver);
+}
+
+module_init(fsl_lbc_init);
+module_exit(fsl_lbc_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Freescale Semiconductor");
+MODULE_DESCRIPTION("Freescale Enhanced Local Bus Controller driver");
-- 
1.5.6.5

^ permalink raw reply related


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