2014-10-09 16:41:28

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH] bcma: Add dependency on OF_ADDRESS

Commit 2101e533f41a ("bcma: register bcma as device tree driver")
introduces a hard dependency on OF_ADDRESS into the bcma driver.
OF_ADDRESS is specifically disabled for the sparc architecture.
This results in the following error when building sparc64:allmodconfig.

drivers/bcma/main.c: In function 'bcma_of_find_child_device':
drivers/bcma/main.c:150:3: error: implicit declaration of function 'of_translate_address'

Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
Cc: Hauke Mehrtens <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
---
drivers/bcma/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index 0ee48be..ca4b420 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -1,6 +1,6 @@
config BCMA_POSSIBLE
bool
- depends on HAS_IOMEM && HAS_DMA
+ depends on HAS_IOMEM && HAS_DMA && OF_ADDRESS
default y

menu "Broadcom specific AMBA"
--
1.9.1



2014-10-10 04:32:43

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

From: Julian Calaby <[email protected]>
Date: Fri, 10 Oct 2014 11:24:53 +1100

> Hi,
>
> On Fri, Oct 10, 2014 at 4:21 AM, Guenter Roeck <[email protected]> wrote:
>> On Thu, Oct 09, 2014 at 07:15:32PM +0200, Arend van Spriel wrote:
>>> On 10/09/14 18:54, Rafa?? Mi??ecki wrote:
>>> >On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
>>> >>Commit 2101e533f41a ("bcma: register bcma as device tree driver")
>>> >>introduces a hard dependency on OF_ADDRESS into the bcma driver.
>>> >>OF_ADDRESS is specifically disabled for the sparc architecture.
>>> >>This results in the following error when building sparc64:allmodconfig.
>>>
>>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF
>>> and !CONFIG_OF_ADDRESS? Does that makes sense?
>>>
>>
>> You tell me. From drivers/of/Kconfig:
>>
>> config OF_ADDRESS
>> def_bool y
>> depends on !SPARC
>> select OF_ADDRESS_PCI if PCI
>>
>> Presumably there is a reason to disable OF_ADDRESS for sparc.
>
> Why not ask the sparclinux list? (CC'd)

On sparc, at boot time we precompute all of the addresses provided in
the OF device tree.

So we need none of this OF_ADDRESS infrastructure.

Frankly, I've always believed that this is how address computation
should be done on OF platforms, and it simplifies drivers massively.
You really only need to implement 2 or 3 bus translators to make it
work. Others have disagreed with me.

2014-10-27 15:30:14

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] bcma: fix build when CONFIG_OF_ADDRESS is not set

Yes, I have it queued. Things have been delayed due to my recent
travels, etc.

On Sat, Oct 25, 2014 at 01:36:53PM -0700, Guenter Roeck wrote:
> On Thu, Oct 09, 2014 at 11:39:41PM +0200, Hauke Mehrtens wrote:
> > Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> > introduces a hard dependency on OF_ADDRESS into the bcma driver.
> > OF_ADDRESS is specifically disabled for the sparc architecture.
> > This results in the following error when building sparc64:allmodconfig.
> >
> > drivers/bcma/main.c: In function 'bcma_of_find_child_device':
> > drivers/bcma/main.c:150:3: error: implicit declaration of function 'of_translate_address'
> >
> > Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
> > Reported-by: Guenter Roeck <[email protected]>
> > Signed-off-by: Hauke Mehrtens <[email protected]>
>
> The upstream kernel still does not include this patch, and the sparc64 build
> is still broken.
>
> Is this patch on its way upstream ?
>
> Guenter
>
> > ---
> > drivers/bcma/main.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> > index d1656c2..1000955 100644
> > --- a/drivers/bcma/main.c
> > +++ b/drivers/bcma/main.c
> > @@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
> > return false;
> > }
> >
> > -#ifdef CONFIG_OF
> > +#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
> > static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
> > struct bcma_device *core)
> > {
> > --
> > 1.9.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
> >
>

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2014-10-27 15:43:08

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: fix build when CONFIG_OF_ADDRESS is not set

On Mon, Oct 27, 2014 at 11:15:09AM -0400, John W. Linville wrote:
> Yes, I have it queued. Things have been delayed due to my recent
> travels, etc.
>
Thanks!

Guenter

> On Sat, Oct 25, 2014 at 01:36:53PM -0700, Guenter Roeck wrote:
> > On Thu, Oct 09, 2014 at 11:39:41PM +0200, Hauke Mehrtens wrote:
> > > Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> > > introduces a hard dependency on OF_ADDRESS into the bcma driver.
> > > OF_ADDRESS is specifically disabled for the sparc architecture.
> > > This results in the following error when building sparc64:allmodconfig.
> > >
> > > drivers/bcma/main.c: In function 'bcma_of_find_child_device':
> > > drivers/bcma/main.c:150:3: error: implicit declaration of function 'of_translate_address'
> > >
> > > Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
> > > Reported-by: Guenter Roeck <[email protected]>
> > > Signed-off-by: Hauke Mehrtens <[email protected]>
> >
> > The upstream kernel still does not include this patch, and the sparc64 build
> > is still broken.
> >
> > Is this patch on its way upstream ?
> >
> > Guenter
> >
> > > ---
> > > drivers/bcma/main.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> > > index d1656c2..1000955 100644
> > > --- a/drivers/bcma/main.c
> > > +++ b/drivers/bcma/main.c
> > > @@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
> > > return false;
> > > }
> > >
> > > -#ifdef CONFIG_OF
> > > +#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
> > > static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
> > > struct bcma_device *core)
> > > {
> > > --
> > > 1.9.1
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > > the body of a message to [email protected]
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > > Please read the FAQ at http://www.tux.org/lkml/
> > >
> > >
> >
>
> --
> John W. Linville Someday the world will need a hero, and you
> [email protected] might be all we have. Be ready.

2014-10-09 17:15:35

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On 10/09/14 18:54, Rafał Miłecki wrote:
> On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
>> OF_ADDRESS is specifically disabled for the sparc architecture.
>> This results in the following error when building sparc64:allmodconfig.

Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
!CONFIG_OF_ADDRESS? Does that makes sense?

btw. the OF_ADDRESS dependency was introduced by commit "bcma: get IRQ
numbers from dt".

Regards,
Arend

> Won't this make bcma im-POSSIBLE on MIPS? And maybe x86(_64), or at
> least add an unneeded dependency? I think we should somehow limit this
> to BCM5301X arch.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


2014-10-09 21:40:00

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH] bcma: fix build when CONFIG_OF_ADDRESS is not set

Commit 2101e533f41a ("bcma: register bcma as device tree driver")
introduces a hard dependency on OF_ADDRESS into the bcma driver.
OF_ADDRESS is specifically disabled for the sparc architecture.
This results in the following error when building sparc64:allmodconfig.

drivers/bcma/main.c: In function 'bcma_of_find_child_device':
drivers/bcma/main.c:150:3: error: implicit declaration of function 'of_translate_address'

Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
Reported-by: Guenter Roeck <[email protected]>
Signed-off-by: Hauke Mehrtens <[email protected]>
---
drivers/bcma/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index d1656c2..1000955 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
return false;
}

-#ifdef CONFIG_OF
+#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
struct bcma_device *core)
{
--
1.9.1


2014-10-09 19:25:27

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On Thu, Oct 09, 2014 at 08:28:31PM +0200, Hauke Mehrtens wrote:
> On 10/09/2014 07:29 PM, Guenter Roeck wrote:
> > On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
> >> On 10/09/14 19:15, Arend van Spriel wrote:
> >>> On 10/09/14 18:54, Rafał Miłecki wrote:
> >>>> On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
> >>>>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>>>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>>>> OF_ADDRESS is specifically disabled for the sparc architecture.
> >>>>> This results in the following error when building sparc64:allmodconfig.
> >>>
> >>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
> >>> !CONFIG_OF_ADDRESS? Does that makes sense?
> >>
> >> Is CONFIG_OF is used on sparc to access OpenBoot information?
> >>
> > I have no idea. All I know is that the driver doesn't build anymore with OF
> > enabled and OF_ADDRESS disabled.
>
> Device tree support in bcma is only needed on some SoC, when this is
> used on a PCIe card it is not needed.
>
> I would just deactivate the parts that are using device tree in bcma
> when it is not available. I will send a patch after having something to eat.
>
Devicetree dependency is already covered with #ifdef CONFIG_OF. Problem is
that it really needs #ifdef CONFIG_OF_ADDRESS. Though even that might be
better than my patch, since it would at least build the driver on sparc
as it used to do.

> Is there a better method which is compatible with SPARC than using
> of_translate_address() to get the reg address and also take the ranges
> attribute of the bus into account?
>
No idea, sorry. Can you by any chance use pcie device information
instead of depending on devicetree data ?

Guenter

2014-10-09 17:29:29

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
> On 10/09/14 19:15, Arend van Spriel wrote:
> >On 10/09/14 18:54, Rafał Miłecki wrote:
> >>On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
> >>>Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>>introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>>OF_ADDRESS is specifically disabled for the sparc architecture.
> >>>This results in the following error when building sparc64:allmodconfig.
> >
> >Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
> >!CONFIG_OF_ADDRESS? Does that makes sense?
>
> Is CONFIG_OF is used on sparc to access OpenBoot information?
>
I have no idea. All I know is that the driver doesn't build anymore with OF
enabled and OF_ADDRESS disabled.

Guenter

2014-10-09 17:28:23

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On Thu, Oct 09, 2014 at 07:15:32PM +0200, Arend van Spriel wrote:
> On 10/09/14 18:54, Rafał Miłecki wrote:
> >On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
> >>Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>OF_ADDRESS is specifically disabled for the sparc architecture.
> >>This results in the following error when building sparc64:allmodconfig.
>
> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF
> and !CONFIG_OF_ADDRESS? Does that makes sense?
>
> btw. the OF_ADDRESS dependency was introduced by commit "bcma: get
> IRQ numbers from dt".

Looking into the code again: Really ? git blame tells me otherwise.
Also, I don't see the commit you refer to in the upstream kernel.
Maybe I am missing something.

Guenter

2014-10-09 16:54:48

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On 9 October 2014 18:41, Guenter Roeck <[email protected]> wrote:
> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> OF_ADDRESS is specifically disabled for the sparc architecture.
> This results in the following error when building sparc64:allmodconfig.

Won't this make bcma im-POSSIBLE on MIPS? And maybe x86(_64), or at
least add an unneeded dependency? I think we should somehow limit this
to BCM5301X arch.

2014-10-09 17:18:34

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On 10/09/14 19:15, Arend van Spriel wrote:
> On 10/09/14 18:54, Rafał Miłecki wrote:
>> On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
>>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
>>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
>>> OF_ADDRESS is specifically disabled for the sparc architecture.
>>> This results in the following error when building sparc64:allmodconfig.
>
> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
> !CONFIG_OF_ADDRESS? Does that makes sense?

Is CONFIG_OF is used on sparc to access OpenBoot information?

Regards,
Arend

> btw. the OF_ADDRESS dependency was introduced by commit "bcma: get IRQ
> numbers from dt".
>
> Regards,
> Arend
>
>> Won't this make bcma im-POSSIBLE on MIPS? And maybe x86(_64), or at
>> least add an unneeded dependency? I think we should somehow limit this
>> to BCM5301X arch.
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-kernel" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


2014-10-09 17:15:29

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On Thu, Oct 09, 2014 at 06:54:48PM +0200, Rafał Miłecki wrote:
> On 9 October 2014 18:41, Guenter Roeck <[email protected]> wrote:
> > Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> > introduces a hard dependency on OF_ADDRESS into the bcma driver.
> > OF_ADDRESS is specifically disabled for the sparc architecture.
> > This results in the following error when building sparc64:allmodconfig.
>
> Won't this make bcma im-POSSIBLE on MIPS? And maybe x86(_64), or at
> least add an unneeded dependency? I think we should somehow limit this
> to BCM5301X arch.

sparc, not mips.

Something like "depends on !OF || OF_ADDRESS" would limit the impact to
sparc, and only if OF is configured as well. I'll update accordingly
and resubmit. Everything else would have to be done in the driver itself,
which I rather not touch myself.

Guenter

2014-10-10 09:30:34

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On 10/09/14 23:48, Hauke Mehrtens wrote:
> On 10/09/2014 09:25 PM, Guenter Roeck wrote:
>> On Thu, Oct 09, 2014 at 08:28:31PM +0200, Hauke Mehrtens wrote:
>>> On 10/09/2014 07:29 PM, Guenter Roeck wrote:
>>>> On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
>>>>> On 10/09/14 19:15, Arend van Spriel wrote:
>>>>>> On 10/09/14 18:54, Rafał Miłecki wrote:
>>>>>>> On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
>>>>>>>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
>>>>>>>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
>>>>>>>> OF_ADDRESS is specifically disabled for the sparc architecture.
>>>>>>>> This results in the following error when building sparc64:allmodconfig.
>>>>>>
>>>>>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
>>>>>> !CONFIG_OF_ADDRESS? Does that makes sense?
>>>>>
>>>>> Is CONFIG_OF is used on sparc to access OpenBoot information?
>>>>>
>>>> I have no idea. All I know is that the driver doesn't build anymore with OF
>>>> enabled and OF_ADDRESS disabled.
>>>
>>> Device tree support in bcma is only needed on some SoC, when this is
>>> used on a PCIe card it is not needed.
>>>
>>> I would just deactivate the parts that are using device tree in bcma
>>> when it is not available. I will send a patch after having something to eat.
>>>
>> Devicetree dependency is already covered with #ifdef CONFIG_OF. Problem is
>> that it really needs #ifdef CONFIG_OF_ADDRESS. Though even that might be
>> better than my patch, since it would at least build the driver on sparc
>> as it used to do.
>>
>>> Is there a better method which is compatible with SPARC than using
>>> of_translate_address() to get the reg address and also take the ranges
>>> attribute of the bus into account?
>>>
>> No idea, sorry. Can you by any chance use pcie device information
>> instead of depending on devicetree data ?
>
> Device tree is not used for PCIe devices in bcma. We only use it when
> bcma is used for the system bus on some Broadcom SoCs, currently there
> is no plan to use device tree for PCIe devices in bcma. I think bcma is
> only used on wifi cards connected via PCIe on Sparc systems.

When we mainlined I verified the brcmsmac was working on a sparc system.
However, at that time we were not using BCMA. I do not recall whether or
not we tested on sparc with BCMA support. I might give it a spin again.

Regards,
Arend

2014-10-09 21:48:10

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On 10/09/2014 09:25 PM, Guenter Roeck wrote:
> On Thu, Oct 09, 2014 at 08:28:31PM +0200, Hauke Mehrtens wrote:
>> On 10/09/2014 07:29 PM, Guenter Roeck wrote:
>>> On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
>>>> On 10/09/14 19:15, Arend van Spriel wrote:
>>>>> On 10/09/14 18:54, Rafał Miłecki wrote:
>>>>>> On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
>>>>>>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
>>>>>>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
>>>>>>> OF_ADDRESS is specifically disabled for the sparc architecture.
>>>>>>> This results in the following error when building sparc64:allmodconfig.
>>>>>
>>>>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
>>>>> !CONFIG_OF_ADDRESS? Does that makes sense?
>>>>
>>>> Is CONFIG_OF is used on sparc to access OpenBoot information?
>>>>
>>> I have no idea. All I know is that the driver doesn't build anymore with OF
>>> enabled and OF_ADDRESS disabled.
>>
>> Device tree support in bcma is only needed on some SoC, when this is
>> used on a PCIe card it is not needed.
>>
>> I would just deactivate the parts that are using device tree in bcma
>> when it is not available. I will send a patch after having something to eat.
>>
> Devicetree dependency is already covered with #ifdef CONFIG_OF. Problem is
> that it really needs #ifdef CONFIG_OF_ADDRESS. Though even that might be
> better than my patch, since it would at least build the driver on sparc
> as it used to do.
>
>> Is there a better method which is compatible with SPARC than using
>> of_translate_address() to get the reg address and also take the ranges
>> attribute of the bus into account?
>>
> No idea, sorry. Can you by any chance use pcie device information
> instead of depending on devicetree data ?

Device tree is not used for PCIe devices in bcma. We only use it when
bcma is used for the system bus on some Broadcom SoCs, currently there
is no plan to use device tree for PCIe devices in bcma. I think bcma is
only used on wifi cards connected via PCIe on Sparc systems.

Hauke

2014-10-09 18:28:35

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On 10/09/2014 07:29 PM, Guenter Roeck wrote:
> On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
>> On 10/09/14 19:15, Arend van Spriel wrote:
>>> On 10/09/14 18:54, Rafał Miłecki wrote:
>>>> On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
>>>>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
>>>>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
>>>>> OF_ADDRESS is specifically disabled for the sparc architecture.
>>>>> This results in the following error when building sparc64:allmodconfig.
>>>
>>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
>>> !CONFIG_OF_ADDRESS? Does that makes sense?
>>
>> Is CONFIG_OF is used on sparc to access OpenBoot information?
>>
> I have no idea. All I know is that the driver doesn't build anymore with OF
> enabled and OF_ADDRESS disabled.

Device tree support in bcma is only needed on some SoC, when this is
used on a PCIe card it is not needed.

I would just deactivate the parts that are using device tree in bcma
when it is not available. I will send a patch after having something to eat.

Is there a better method which is compatible with SPARC than using
of_translate_address() to get the reg address and also take the ranges
attribute of the bus into account?

Hauke

2014-10-09 21:46:51

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: fix build when CONFIG_OF_ADDRESS is not set

On Thu, Oct 09, 2014 at 11:39:41PM +0200, Hauke Mehrtens wrote:
> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> OF_ADDRESS is specifically disabled for the sparc architecture.
> This results in the following error when building sparc64:allmodconfig.
>
> drivers/bcma/main.c: In function 'bcma_of_find_child_device':
> drivers/bcma/main.c:150:3: error: implicit declaration of function 'of_translate_address'
>
> Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
> Reported-by: Guenter Roeck <[email protected]>
> Signed-off-by: Hauke Mehrtens <[email protected]>

Much better than my patch.

Reviewed-by: Guenter Roeck <[email protected]>

Also compile tested to make sure it fixes the build problem.

Guenter

> ---
> drivers/bcma/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> index d1656c2..1000955 100644
> --- a/drivers/bcma/main.c
> +++ b/drivers/bcma/main.c
> @@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
> return false;
> }
>
> -#ifdef CONFIG_OF
> +#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
> static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
> struct bcma_device *core)
> {
> --
> 1.9.1
>

2014-10-10 00:25:15

by Julian Calaby

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

Hi,

On Fri, Oct 10, 2014 at 4:21 AM, Guenter Roeck <[email protected]> wrote:
> On Thu, Oct 09, 2014 at 07:15:32PM +0200, Arend van Spriel wrote:
>> On 10/09/14 18:54, Rafał Miłecki wrote:
>> >On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
>> >>Commit 2101e533f41a ("bcma: register bcma as device tree driver")
>> >>introduces a hard dependency on OF_ADDRESS into the bcma driver.
>> >>OF_ADDRESS is specifically disabled for the sparc architecture.
>> >>This results in the following error when building sparc64:allmodconfig.
>>
>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF
>> and !CONFIG_OF_ADDRESS? Does that makes sense?
>>
>
> You tell me. From drivers/of/Kconfig:
>
> config OF_ADDRESS
> def_bool y
> depends on !SPARC
> select OF_ADDRESS_PCI if PCI
>
> Presumably there is a reason to disable OF_ADDRESS for sparc.

Why not ask the sparclinux list? (CC'd)

Thanks,

--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/

2014-10-25 20:37:10

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: fix build when CONFIG_OF_ADDRESS is not set

On Thu, Oct 09, 2014 at 11:39:41PM +0200, Hauke Mehrtens wrote:
> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> OF_ADDRESS is specifically disabled for the sparc architecture.
> This results in the following error when building sparc64:allmodconfig.
>
> drivers/bcma/main.c: In function 'bcma_of_find_child_device':
> drivers/bcma/main.c:150:3: error: implicit declaration of function 'of_translate_address'
>
> Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
> Reported-by: Guenter Roeck <[email protected]>
> Signed-off-by: Hauke Mehrtens <[email protected]>

The upstream kernel still does not include this patch, and the sparc64 build
is still broken.

Is this patch on its way upstream ?

Guenter

> ---
> drivers/bcma/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> index d1656c2..1000955 100644
> --- a/drivers/bcma/main.c
> +++ b/drivers/bcma/main.c
> @@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
> return false;
> }
>
> -#ifdef CONFIG_OF
> +#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
> static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
> struct bcma_device *core)
> {
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>

2014-10-09 17:21:26

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On Thu, Oct 09, 2014 at 07:15:32PM +0200, Arend van Spriel wrote:
> On 10/09/14 18:54, Rafał Miłecki wrote:
> >On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
> >>Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>OF_ADDRESS is specifically disabled for the sparc architecture.
> >>This results in the following error when building sparc64:allmodconfig.
>
> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF
> and !CONFIG_OF_ADDRESS? Does that makes sense?
>

You tell me. From drivers/of/Kconfig:

config OF_ADDRESS
def_bool y
depends on !SPARC
select OF_ADDRESS_PCI if PCI

Presumably there is a reason to disable OF_ADDRESS for sparc.

> btw. the OF_ADDRESS dependency was introduced by commit "bcma: get
> IRQ numbers from dt".
>
Ah, sorry. Ok, I'll send v3 after taking a break (and waiting
for additional comments).

Guenter

2014-10-09 21:57:56

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] bcma: Add dependency on OF_ADDRESS

On Thu, Oct 09, 2014 at 11:48:08PM +0200, Hauke Mehrtens wrote:
> On 10/09/2014 09:25 PM, Guenter Roeck wrote:
> > On Thu, Oct 09, 2014 at 08:28:31PM +0200, Hauke Mehrtens wrote:
> >> On 10/09/2014 07:29 PM, Guenter Roeck wrote:
> >>> On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
> >>>> On 10/09/14 19:15, Arend van Spriel wrote:
> >>>>> On 10/09/14 18:54, Rafał Miłecki wrote:
> >>>>>> On 9 October 2014 18:41, Guenter Roeck<[email protected]> wrote:
> >>>>>>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>>>>>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>>>>>> OF_ADDRESS is specifically disabled for the sparc architecture.
> >>>>>>> This results in the following error when building sparc64:allmodconfig.
> >>>>>
> >>>>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
> >>>>> !CONFIG_OF_ADDRESS? Does that makes sense?
> >>>>
> >>>> Is CONFIG_OF is used on sparc to access OpenBoot information?
> >>>>
> >>> I have no idea. All I know is that the driver doesn't build anymore with OF
> >>> enabled and OF_ADDRESS disabled.
> >>
> >> Device tree support in bcma is only needed on some SoC, when this is
> >> used on a PCIe card it is not needed.
> >>
> >> I would just deactivate the parts that are using device tree in bcma
> >> when it is not available. I will send a patch after having something to eat.
> >>
> > Devicetree dependency is already covered with #ifdef CONFIG_OF. Problem is
> > that it really needs #ifdef CONFIG_OF_ADDRESS. Though even that might be
> > better than my patch, since it would at least build the driver on sparc
> > as it used to do.
> >
> >> Is there a better method which is compatible with SPARC than using
> >> of_translate_address() to get the reg address and also take the ranges
> >> attribute of the bus into account?
> >>
> > No idea, sorry. Can you by any chance use pcie device information
> > instead of depending on devicetree data ?
>
> Device tree is not used for PCIe devices in bcma. We only use it when
> bcma is used for the system bus on some Broadcom SoCs, currently there
> is no plan to use device tree for PCIe devices in bcma. I think bcma is
> only used on wifi cards connected via PCIe on Sparc systems.
>
Ok. Well, with your patch the code is as good or as bad as it was prior to
adding devicetree support to the driver, so hopefully should work.

Guenter