All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uartlite: Fix build on sparc.
@ 2010-03-03 10:50 David Miller
  2010-03-03 15:51 ` Grant Likely
  2010-03-03 18:55 ` Grant Likely
  0 siblings, 2 replies; 10+ messages in thread
From: David Miller @ 2010-03-03 10:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: grant.likely


We can get this driver enabled via MFD_TIMBERDALE which only
requires GPIO to be on.

But the of_address_to_resource() function is only present on
powerpc and microblaze, so we have to conditionalize the
CONFIG_OF probing bits on that.

Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index ab2ab3c..f0a6c61 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -19,7 +19,7 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <asm/io.h>
-#if defined(CONFIG_OF)
+#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
@@ -581,7 +581,7 @@ static struct platform_driver ulite_platform_driver = {
 /* ---------------------------------------------------------------------
  * OF bus bindings
  */
-#if defined(CONFIG_OF)
+#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))
 static int __devinit
 ulite_of_probe(struct of_device *op, const struct of_device_id *match)
 {
@@ -631,11 +631,11 @@ static inline void __exit ulite_of_unregister(void)
 {
 	of_unregister_platform_driver(&ulite_of_driver);
 }
-#else /* CONFIG_OF */
-/* CONFIG_OF not enabled; do nothing helpers */
+#else /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */
+/* Appropriate config not enabled; do nothing helpers */
 static inline int __init ulite_of_register(void) { return 0; }
 static inline void __exit ulite_of_unregister(void) { }
-#endif /* CONFIG_OF */
+#endif /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */
 
 /* ---------------------------------------------------------------------
  * Module setup/teardown

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 10:50 [PATCH] uartlite: Fix build on sparc David Miller
@ 2010-03-03 15:51 ` Grant Likely
  2010-03-03 16:04   ` David Miller
  2010-03-03 18:55 ` Grant Likely
  1 sibling, 1 reply; 10+ messages in thread
From: Grant Likely @ 2010-03-03 15:51 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel

On Wed, Mar 3, 2010 at 3:50 AM, David Miller <davem@davemloft.net> wrote:
>
> We can get this driver enabled via MFD_TIMBERDALE which only
> requires GPIO to be on.
>
> But the of_address_to_resource() function is only present on
> powerpc and microblaze, so we have to conditionalize the
> CONFIG_OF probing bits on that.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
> index ab2ab3c..f0a6c61 100644
> --- a/drivers/serial/uartlite.c
> +++ b/drivers/serial/uartlite.c
> @@ -19,7 +19,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/init.h>
>  #include <asm/io.h>
> -#if defined(CONFIG_OF)
> +#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))

ARM will probably end up using this driver.  How about simply
defined(CONFIG_OF) && !defined(CONFIG_SPARC)?

Or if you prefer, I could expedite my patch that moves
of_address_to_resource() into common code (it's currently in my test
branch).  I wasn't planning to merge it until 2.6.35, but it is pretty
low risk so I'd be comfortable merging it now.

g.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 15:51 ` Grant Likely
@ 2010-03-03 16:04   ` David Miller
  2010-03-03 16:40     ` Grant Likely
  0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2010-03-03 16:04 UTC (permalink / raw)
  To: grant.likely; +Cc: linux-kernel

From: Grant Likely <grant.likely@secretlab.ca>
Date: Wed, 3 Mar 2010 08:51:27 -0700

> Or if you prefer, I could expedite my patch that moves
> of_address_to_resource() into common code (it's currently in my test
> branch).  I wasn't planning to merge it until 2.6.35, but it is pretty
> low risk so I'd be comfortable merging it now.

I prefer if you deal with it this way.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 16:04   ` David Miller
@ 2010-03-03 16:40     ` Grant Likely
  2010-03-03 16:44       ` Grant Likely
  2010-03-03 16:48       ` David Miller
  0 siblings, 2 replies; 10+ messages in thread
From: Grant Likely @ 2010-03-03 16:40 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel

On Wed, Mar 3, 2010 at 9:04 AM, David Miller <davem@davemloft.net> wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> Date: Wed, 3 Mar 2010 08:51:27 -0700
>
>> Or if you prefer, I could expedite my patch that moves
>> of_address_to_resource() into common code (it's currently in my test
>> branch).  I wasn't planning to merge it until 2.6.35, but it is pretty
>> low risk so I'd be comfortable merging it now.
>
> I prefer if you deal with it this way.

Hmmm... on second look my patch depends on a bunch of other stuff that
doesn't work with sparc yet.  grumble.  Sorry, this isn't going to
work yet.  I'll have to block out the uartlite driver instead.  In the
mean time I'll change the Kconfig to omit uartlite on sparc.

g.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 16:40     ` Grant Likely
@ 2010-03-03 16:44       ` Grant Likely
  2010-03-03 16:48       ` David Miller
  1 sibling, 0 replies; 10+ messages in thread
From: Grant Likely @ 2010-03-03 16:44 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel

On Wed, Mar 3, 2010 at 9:40 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Wed, Mar 3, 2010 at 9:04 AM, David Miller <davem@davemloft.net> wrote:
>> From: Grant Likely <grant.likely@secretlab.ca>
>> Date: Wed, 3 Mar 2010 08:51:27 -0700
>>
>>> Or if you prefer, I could expedite my patch that moves
>>> of_address_to_resource() into common code (it's currently in my test
>>> branch).  I wasn't planning to merge it until 2.6.35, but it is pretty
>>> low risk so I'd be comfortable merging it now.
>>
>> I prefer if you deal with it this way.
>
> Hmmm... on second look my patch depends on a bunch of other stuff that
> doesn't work with sparc yet.  grumble.  Sorry, this isn't going to
> work yet.  I'll have to block out the uartlite driver instead.  In the
> mean time I'll change the Kconfig to omit uartlite on sparc.

/me looks at the Kconfig.

Double grumble.

Yeah, you're right.  The place to change it is in the .c file.

g.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 16:40     ` Grant Likely
  2010-03-03 16:44       ` Grant Likely
@ 2010-03-03 16:48       ` David Miller
  2010-03-03 18:52         ` Grant Likely
  1 sibling, 1 reply; 10+ messages in thread
From: David Miller @ 2010-03-03 16:48 UTC (permalink / raw)
  To: grant.likely; +Cc: linux-kernel

From: Grant Likely <grant.likely@secretlab.ca>
Date: Wed, 3 Mar 2010 09:40:14 -0700

> On Wed, Mar 3, 2010 at 9:04 AM, David Miller <davem@davemloft.net> wrote:
>> From: Grant Likely <grant.likely@secretlab.ca>
>> Date: Wed, 3 Mar 2010 08:51:27 -0700
>>
>>> Or if you prefer, I could expedite my patch that moves
>>> of_address_to_resource() into common code (it's currently in my test
>>> branch).  I wasn't planning to merge it until 2.6.35, but it is pretty
>>> low risk so I'd be comfortable merging it now.
>>
>> I prefer if you deal with it this way.
> 
> Hmmm... on second look my patch depends on a bunch of other stuff that
> doesn't work with sparc yet.  grumble.  Sorry, this isn't going to
> work yet.  I'll have to block out the uartlite driver instead.  In the
> mean time I'll change the Kconfig to omit uartlite on sparc.

BTW, while looking at this I can provide something similar to the
of_address_to_resource() interface on sparc but it would need
to provide the of_device pointer not the device_node one.

I precompute all of the IRQs and I/O addresses of OF nodes and stick
them into of_device->resource[] and of_device->irq[].

So if I have the of_device pointer I can just:

	memset(res, op->resource[n], sizeof(*res));

as my implementation.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 16:48       ` David Miller
@ 2010-03-03 18:52         ` Grant Likely
  0 siblings, 0 replies; 10+ messages in thread
From: Grant Likely @ 2010-03-03 18:52 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel

On Wed, Mar 3, 2010 at 9:48 AM, David Miller <davem@davemloft.net> wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> Date: Wed, 3 Mar 2010 09:40:14 -0700
>
>> On Wed, Mar 3, 2010 at 9:04 AM, David Miller <davem@davemloft.net> wrote:
>>> From: Grant Likely <grant.likely@secretlab.ca>
>>> Date: Wed, 3 Mar 2010 08:51:27 -0700
>>>
>>>> Or if you prefer, I could expedite my patch that moves
>>>> of_address_to_resource() into common code (it's currently in my test
>>>> branch).  I wasn't planning to merge it until 2.6.35, but it is pretty
>>>> low risk so I'd be comfortable merging it now.
>>>
>>> I prefer if you deal with it this way.
>>
>> Hmmm... on second look my patch depends on a bunch of other stuff that
>> doesn't work with sparc yet.  grumble.  Sorry, this isn't going to
>> work yet.  I'll have to block out the uartlite driver instead.  In the
>> mean time I'll change the Kconfig to omit uartlite on sparc.
>
> BTW, while looking at this I can provide something similar to the
> of_address_to_resource() interface on sparc but it would need
> to provide the of_device pointer not the device_node one.
>
> I precompute all of the IRQs and I/O addresses of OF nodes and stick
> them into of_device->resource[] and of_device->irq[].
>
> So if I have the of_device pointer I can just:
>
>        memset(res, op->resource[n], sizeof(*res));
>
> as my implementation.

Cool.

I'm actually hoping to do much the same with the other OF
architectures, so hopefully of_address_to_resource() will become only
used in arch code when talking to hardware before the devices are
registered.

I also need to look at merging the bus address translation code.  It
looks like sparc and ppc are using variations on the same codebase,
but they seem to have diverged quite a lot.

g.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 10:50 [PATCH] uartlite: Fix build on sparc David Miller
  2010-03-03 15:51 ` Grant Likely
@ 2010-03-03 18:55 ` Grant Likely
  2010-03-04  2:50   ` Greg KH
  2010-03-04  4:34   ` Greg KH
  1 sibling, 2 replies; 10+ messages in thread
From: Grant Likely @ 2010-03-03 18:55 UTC (permalink / raw)
  To: David Miller, Linus Torvalds; +Cc: linux-kernel, Greg Kroah-Hartman

On Wed, Mar 3, 2010 at 3:50 AM, David Miller <davem@davemloft.net> wrote:
>
> We can get this driver enabled via MFD_TIMBERDALE which only
> requires GPIO to be on.
>
> But the of_address_to_resource() function is only present on
> powerpc and microblaze, so we have to conditionalize the
> CONFIG_OF probing bits on that.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>

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

Linus or Greg, can you please pick this bug fix up?

Thanks,
g.

>
> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
> index ab2ab3c..f0a6c61 100644
> --- a/drivers/serial/uartlite.c
> +++ b/drivers/serial/uartlite.c
> @@ -19,7 +19,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/init.h>
>  #include <asm/io.h>
> -#if defined(CONFIG_OF)
> +#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))
>  #include <linux/of.h>
>  #include <linux/of_device.h>
>  #include <linux/of_platform.h>
> @@ -581,7 +581,7 @@ static struct platform_driver ulite_platform_driver = {
>  /* ---------------------------------------------------------------------
>  * OF bus bindings
>  */
> -#if defined(CONFIG_OF)
> +#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))
>  static int __devinit
>  ulite_of_probe(struct of_device *op, const struct of_device_id *match)
>  {
> @@ -631,11 +631,11 @@ static inline void __exit ulite_of_unregister(void)
>  {
>        of_unregister_platform_driver(&ulite_of_driver);
>  }
> -#else /* CONFIG_OF */
> -/* CONFIG_OF not enabled; do nothing helpers */
> +#else /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */
> +/* Appropriate config not enabled; do nothing helpers */
>  static inline int __init ulite_of_register(void) { return 0; }
>  static inline void __exit ulite_of_unregister(void) { }
> -#endif /* CONFIG_OF */
> +#endif /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */
>
>  /* ---------------------------------------------------------------------
>  * Module setup/teardown
>



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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 18:55 ` Grant Likely
@ 2010-03-04  2:50   ` Greg KH
  2010-03-04  4:34   ` Greg KH
  1 sibling, 0 replies; 10+ messages in thread
From: Greg KH @ 2010-03-04  2:50 UTC (permalink / raw)
  To: Grant Likely; +Cc: David Miller, Linus Torvalds, linux-kernel

On Wed, Mar 03, 2010 at 11:55:49AM -0700, Grant Likely wrote:
> On Wed, Mar 3, 2010 at 3:50 AM, David Miller <davem@davemloft.net> wrote:
> >
> > We can get this driver enabled via MFD_TIMBERDALE which only
> > requires GPIO to be on.
> >
> > But the of_address_to_resource() function is only present on
> > powerpc and microblaze, so we have to conditionalize the
> > CONFIG_OF probing bits on that.
> >
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> 
> Linus or Greg, can you please pick this bug fix up?

I can if someone sends it to me in a form I can apply it :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] uartlite: Fix build on sparc.
  2010-03-03 18:55 ` Grant Likely
  2010-03-04  2:50   ` Greg KH
@ 2010-03-04  4:34   ` Greg KH
  1 sibling, 0 replies; 10+ messages in thread
From: Greg KH @ 2010-03-04  4:34 UTC (permalink / raw)
  To: Grant Likely
  Cc: David Miller, Linus Torvalds, linux-kernel, Greg Kroah-Hartman

On Wed, Mar 03, 2010 at 11:55:49AM -0700, Grant Likely wrote:
> On Wed, Mar 3, 2010 at 3:50 AM, David Miller <davem@davemloft.net> wrote:
> >
> > We can get this driver enabled via MFD_TIMBERDALE which only
> > requires GPIO to be on.
> >
> > But the of_address_to_resource() function is only present on
> > powerpc and microblaze, so we have to conditionalize the
> > CONFIG_OF probing bits on that.
> >
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> 
> Linus or Greg, can you please pick this bug fix up?

Ok, I found it in the archives, I'll take this now.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-03-04  4:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03 10:50 [PATCH] uartlite: Fix build on sparc David Miller
2010-03-03 15:51 ` Grant Likely
2010-03-03 16:04   ` David Miller
2010-03-03 16:40     ` Grant Likely
2010-03-03 16:44       ` Grant Likely
2010-03-03 16:48       ` David Miller
2010-03-03 18:52         ` Grant Likely
2010-03-03 18:55 ` Grant Likely
2010-03-04  2:50   ` Greg KH
2010-03-04  4:34   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.