* [PATCH] bcma: populate bus DT subnodes as platform_device-s
@ 2015-06-28 15:17 Rafał Miłecki
2015-06-30 21:45 ` Hauke Mehrtens
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Rafał Miłecki @ 2015-06-28 15:17 UTC (permalink / raw)
To: linux-arm-kernel
Our bus should allow defining children nodes as we may want to specify
devices attached to the bus. This is required e.g. to specify NAND or
ChipCommon cores and use bus's address and IRQ mappings.
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
drivers/bcma/main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 9635f10..5912847 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -12,6 +12,7 @@
#include <linux/slab.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
+#include <linux/of_platform.h>
MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
MODULE_LICENSE("GPL");
@@ -409,6 +410,13 @@ int bcma_bus_register(struct bcma_bus *bus)
bcma_core_pci_early_init(&bus->drv_pci[0]);
}
+ if (bus->host_pdev) {
+ struct device *dev = &bus->host_pdev->dev;
+
+ of_platform_populate(dev->of_node, of_default_bus_match_table,
+ NULL, dev);
+ }
+
/* Cores providing flash access go before SPROM init */
list_for_each_entry(core, &bus->cores, list) {
if (bcma_is_core_needed_early(core->id.id))
--
1.8.4.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-06-28 15:17 [PATCH] bcma: populate bus DT subnodes as platform_device-s Rafał Miłecki
@ 2015-06-30 21:45 ` Hauke Mehrtens
2015-07-01 4:45 ` Rafał Miłecki
2015-07-21 14:07 ` Kalle Valo
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Hauke Mehrtens @ 2015-06-30 21:45 UTC (permalink / raw)
To: linux-arm-kernel
On 06/28/2015 05:17 PM, Rafa? Mi?ecki wrote:
> Our bus should allow defining children nodes as we may want to specify
> devices attached to the bus. This is required e.g. to specify NAND or
> ChipCommon cores and use bus's address and IRQ mappings.
>
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
> drivers/bcma/main.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
Rafa? have you solved the IRQ problem? Is it possible to assign all the
sub devices the same IRQ number as the chipcommon core?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-06-30 21:45 ` Hauke Mehrtens
@ 2015-07-01 4:45 ` Rafał Miłecki
0 siblings, 0 replies; 10+ messages in thread
From: Rafał Miłecki @ 2015-07-01 4:45 UTC (permalink / raw)
To: linux-arm-kernel
On 30 June 2015 at 23:45, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> On 06/28/2015 05:17 PM, Rafa? Mi?ecki wrote:
>> Our bus should allow defining children nodes as we may want to specify
>> devices attached to the bus. This is required e.g. to specify NAND or
>> ChipCommon cores and use bus's address and IRQ mappings.
>>
>> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
>> ---
>> drivers/bcma/main.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>
> Rafa? have you solved the IRQ problem? Is it possible to assign all the
> sub devices the same IRQ number as the chipcommon core?
Not yet. The only working solution I have so far is:
serial0: serial at 0300 {
compatible = "ns16550";
reg = <0x0300 0x100>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <100000000>;
};
(plus adding compatible = "simple-bus" to the chipcommon).
--
Rafa?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-06-28 15:17 [PATCH] bcma: populate bus DT subnodes as platform_device-s Rafał Miłecki
2015-06-30 21:45 ` Hauke Mehrtens
@ 2015-07-21 14:07 ` Kalle Valo
2015-07-23 0:30 ` Rafał Miłecki
2015-08-02 18:03 ` Hauke Mehrtens
3 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2015-07-21 14:07 UTC (permalink / raw)
To: linux-arm-kernel
Rafa? Mi?ecki <zajec5@gmail.com> writes:
> Our bus should allow defining children nodes as we may want to specify
> devices attached to the bus. This is required e.g. to specify NAND or
> ChipCommon cores and use bus's address and IRQ mappings.
>
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
Thanks, manually applied to wireless-drivers-next.git.
--
Kalle Valo
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-06-28 15:17 [PATCH] bcma: populate bus DT subnodes as platform_device-s Rafał Miłecki
2015-06-30 21:45 ` Hauke Mehrtens
2015-07-21 14:07 ` Kalle Valo
@ 2015-07-23 0:30 ` Rafał Miłecki
2015-07-23 6:06 ` Kalle Valo
2015-08-02 18:03 ` Hauke Mehrtens
3 siblings, 1 reply; 10+ messages in thread
From: Rafał Miłecki @ 2015-07-23 0:30 UTC (permalink / raw)
To: linux-arm-kernel
On 28 June 2015 at 17:17, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
> Our bus should allow defining children nodes as we may want to specify
> devices attached to the bus. This is required e.g. to specify NAND or
> ChipCommon cores and use bus's address and IRQ mappings.
>
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
> drivers/bcma/main.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> index 9635f10..5912847 100644
> --- a/drivers/bcma/main.c
> +++ b/drivers/bcma/main.c
> @@ -12,6 +12,7 @@
> #include <linux/slab.h>
> #include <linux/of_address.h>
> #include <linux/of_irq.h>
> +#include <linux/of_platform.h>
>
> MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
> MODULE_LICENSE("GPL");
> @@ -409,6 +410,13 @@ int bcma_bus_register(struct bcma_bus *bus)
> bcma_core_pci_early_init(&bus->drv_pci[0]);
> }
>
> + if (bus->host_pdev) {
> + struct device *dev = &bus->host_pdev->dev;
> +
> + of_platform_populate(dev->of_node, of_default_bus_match_table,
> + NULL, dev);
> + }
> +
This caused a compile error when using bcma as module:
ERROR: "of_default_bus_match_table" [drivers/bcma/bcma.ko] undefined!
There are two options I guess:
1) Export of_default_bus_match_table
2) Use some better condition like
if (IS_BUILTIN(CONFIG_BCMA) && bus->host_pdev)
Unfortunately I'm on my long holidays right now.
Hauke: do you think you can find a moment to handle this?
Sorry for the problem :|
--
Rafa?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-07-23 0:30 ` Rafał Miłecki
@ 2015-07-23 6:06 ` Kalle Valo
2015-07-24 16:11 ` Joachim Eastwood
0 siblings, 1 reply; 10+ messages in thread
From: Kalle Valo @ 2015-07-23 6:06 UTC (permalink / raw)
To: linux-arm-kernel
Rafa? Mi?ecki <zajec5@gmail.com> writes:
>> + if (bus->host_pdev) {
>> + struct device *dev = &bus->host_pdev->dev;
>> +
>> + of_platform_populate(dev->of_node, of_default_bus_match_table,
>> + NULL, dev);
>> + }
>> +
>
> This caused a compile error when using bcma as module:
> ERROR: "of_default_bus_match_table" [drivers/bcma/bcma.ko] undefined!
>
> There are two options I guess:
> 1) Export of_default_bus_match_table
> 2) Use some better condition like
> if (IS_BUILTIN(CONFIG_BCMA) && bus->host_pdev)
>
> Unfortunately I'm on my long holidays right now.
>
> Hauke: do you think you can find a moment to handle this?
I can cook up a patch which uses IS_BUILTIN() so that we get the build
working again. You can fix this better once you come back.
> Sorry for the problem :|
No worries, enjoy your vacation :)
--
Kalle Valo
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-07-23 6:06 ` Kalle Valo
@ 2015-07-24 16:11 ` Joachim Eastwood
2015-07-25 18:55 ` Hauke Mehrtens
0 siblings, 1 reply; 10+ messages in thread
From: Joachim Eastwood @ 2015-07-24 16:11 UTC (permalink / raw)
To: linux-arm-kernel
On 23 July 2015 at 08:06, Kalle Valo <kvalo@codeaurora.org> wrote:
> Rafa? Mi?ecki <zajec5@gmail.com> writes:
>
>>> + if (bus->host_pdev) {
>>> + struct device *dev = &bus->host_pdev->dev;
>>> +
>>> + of_platform_populate(dev->of_node, of_default_bus_match_table,
>>> + NULL, dev);
>>> + }
>>> +
>>
>> This caused a compile error when using bcma as module:
>> ERROR: "of_default_bus_match_table" [drivers/bcma/bcma.ko] undefined!
I encountered the same problem with my modular memory controller driver.
>> There are two options I guess:
>> 1) Export of_default_bus_match_table
See link below for Rob Herring's take on that.
http://marc.info/?l=linaro-kernel&m=143766694414121&w=2
regards,
Joachim Eastwood
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-07-24 16:11 ` Joachim Eastwood
@ 2015-07-25 18:55 ` Hauke Mehrtens
2015-07-25 21:00 ` Joachim Eastwood
0 siblings, 1 reply; 10+ messages in thread
From: Hauke Mehrtens @ 2015-07-25 18:55 UTC (permalink / raw)
To: linux-arm-kernel
On 07/24/2015 06:11 PM, Joachim Eastwood wrote:
> On 23 July 2015 at 08:06, Kalle Valo <kvalo@codeaurora.org> wrote:
>> Rafa? Mi?ecki <zajec5@gmail.com> writes:
>>
>>>> + if (bus->host_pdev) {
>>>> + struct device *dev = &bus->host_pdev->dev;
>>>> +
>>>> + of_platform_populate(dev->of_node, of_default_bus_match_table,
>>>> + NULL, dev);
>>>> + }
>>>> +
>>>
>>> This caused a compile error when using bcma as module:
>>> ERROR: "of_default_bus_match_table" [drivers/bcma/bcma.ko] undefined!
>
> I encountered the same problem with my modular memory controller driver.
>
>>> There are two options I guess:
>>> 1) Export of_default_bus_match_table
>
> See link below for Rob Herring's take on that.
> http://marc.info/?l=linaro-kernel&m=143766694414121&w=2
>
>
> regards,
> Joachim Eastwood
>
Hi Joachim,
are you working on a patch which exports "of_default_bus_match_table"
or provides a wrapper function? If not then I will look into this. My
current plan for bcma is just to deactivate this when it is build as a
module as a temporary workaround
Hauke
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-07-25 18:55 ` Hauke Mehrtens
@ 2015-07-25 21:00 ` Joachim Eastwood
0 siblings, 0 replies; 10+ messages in thread
From: Joachim Eastwood @ 2015-07-25 21:00 UTC (permalink / raw)
To: linux-arm-kernel
On 25 July 2015 at 20:55, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> On 07/24/2015 06:11 PM, Joachim Eastwood wrote:
>> On 23 July 2015 at 08:06, Kalle Valo <kvalo@codeaurora.org> wrote:
>>> Rafa? Mi?ecki <zajec5@gmail.com> writes:
>>>
>>>>> + if (bus->host_pdev) {
>>>>> + struct device *dev = &bus->host_pdev->dev;
>>>>> +
>>>>> + of_platform_populate(dev->of_node, of_default_bus_match_table,
>>>>> + NULL, dev);
>>>>> + }
>>>>> +
>>>>
>>>> This caused a compile error when using bcma as module:
>>>> ERROR: "of_default_bus_match_table" [drivers/bcma/bcma.ko] undefined!
>>
>> I encountered the same problem with my modular memory controller driver.
>>
>>>> There are two options I guess:
>>>> 1) Export of_default_bus_match_table
>>
>> See link below for Rob Herring's take on that.
>> http://marc.info/?l=linaro-kernel&m=143766694414121&w=2
>>
>>
>> regards,
>> Joachim Eastwood
>>
> Hi Joachim,
>
> are you working on a patch which exports "of_default_bus_match_table"
> or provides a wrapper function? If not then I will look into this.
Not really, so if you could take it that would be great. Thanks.
regards,
Joachim Eastwood
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] bcma: populate bus DT subnodes as platform_device-s
2015-06-28 15:17 [PATCH] bcma: populate bus DT subnodes as platform_device-s Rafał Miłecki
` (2 preceding siblings ...)
2015-07-23 0:30 ` Rafał Miłecki
@ 2015-08-02 18:03 ` Hauke Mehrtens
3 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2015-08-02 18:03 UTC (permalink / raw)
To: linux-arm-kernel
On 06/28/2015 05:17 PM, Rafa? Mi?ecki wrote:
> Our bus should allow defining children nodes as we may want to specify
> devices attached to the bus. This is required e.g. to specify NAND or
> ChipCommon cores and use bus's address and IRQ mappings.
>
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
> drivers/bcma/main.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> index 9635f10..5912847 100644
> --- a/drivers/bcma/main.c
> +++ b/drivers/bcma/main.c
> @@ -12,6 +12,7 @@
> #include <linux/slab.h>
> #include <linux/of_address.h>
> #include <linux/of_irq.h>
> +#include <linux/of_platform.h>
>
> MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
> MODULE_LICENSE("GPL");
> @@ -409,6 +410,13 @@ int bcma_bus_register(struct bcma_bus *bus)
> bcma_core_pci_early_init(&bus->drv_pci[0]);
> }
>
> + if (bus->host_pdev) {
Here is an other problem. So many bugs in this line. ;-)
host_pdev is in a union so this is also true for PCIe devices, but then
the offset of the dev structure probably is wrong. You should check for
the hosttype. I will send a patch.
> + struct device *dev = &bus->host_pdev->dev;
> +
> + of_platform_populate(dev->of_node, of_default_bus_match_table,
> + NULL, dev);
> + }
> +
> /* Cores providing flash access go before SPROM init */
> list_for_each_entry(core, &bus->cores, list) {
> if (bcma_is_core_needed_early(core->id.id))
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-08-02 18:03 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-28 15:17 [PATCH] bcma: populate bus DT subnodes as platform_device-s Rafał Miłecki
2015-06-30 21:45 ` Hauke Mehrtens
2015-07-01 4:45 ` Rafał Miłecki
2015-07-21 14:07 ` Kalle Valo
2015-07-23 0:30 ` Rafał Miłecki
2015-07-23 6:06 ` Kalle Valo
2015-07-24 16:11 ` Joachim Eastwood
2015-07-25 18:55 ` Hauke Mehrtens
2015-07-25 21:00 ` Joachim Eastwood
2015-08-02 18:03 ` Hauke Mehrtens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).