devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
	zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [RFC 4/7] bcma: register bcma as device tree driver
Date: Tue, 26 Aug 2014 23:25:36 +0200	[thread overview]
Message-ID: <53FCFB50.80800@hauke-m.de> (raw)
In-Reply-To: <2462012.kILSFadzpm@wuerfel>

On 08/25/2014 09:57 AM, Arnd Bergmann wrote:
> On Sunday 24 August 2014 23:24:42 Hauke Mehrtens wrote:
>> This driver is used by the bcm53xx ARM SoC code. Now it is possible to
>> give the address of the chipcommon core in device tree and bcma will
>> search for all the other cores.
>>
>> Signed-off-by: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
> 
> Looks good to me overall. Two small comments:
> 
>>  Documentation/devicetree/bindings/bus/bcma.txt | 46 +++++++++++++++++
>>  drivers/bcma/host_soc.c                        | 70 ++++++++++++++++++++++++++
>>  include/linux/bcma/bcma.h                      |  2 +
>>  3 files changed, 118 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/bus/bcma.txt
>>
>> diff --git a/Documentation/devicetree/bindings/bus/bcma.txt b/Documentation/devicetree/bindings/bus/bcma.txt
>> new file mode 100644
>> index 0000000..52fb929
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/bus/bcma.txt
>> @@ -0,0 +1,46 @@
>> +Broadcom AIX bcma bus driver
>> +
>> +
>> +Required properties:
>> +
>> +- compatible : brcm,bus-aix
>> +
>> +- reg : iomem address range of chipcommon core
>> +
>> +Optional properties:
>> +
>> +- sprom: reference to a sprom driver. This is needed for sprom less devices.
>> +        Use bcm47xx_sprom for example.
>> +
>> +
>> +The cores on the AIX bus are auto detected by bcma. Detection of the
>> +IRQ number is not supported on BCM47xx/BCM53xx ARM SoCs, so it is
>> +possible to provide the IRQ number over device tree. The IRQ number and
>> +the device tree child entry will be added to the core with the matching
>> +reg address.
> 
> What is the problem with the interrupt numbers? Is that information
> missing completely from the data available to the brcm bus, or is it
> in an inconvenient format?

I do not have access to the datasheet, only to the vendor source code.
The irq numbers are hard coded in the vendor code, see:
https://github.com/RMerl/asuswrt-merlin/blob/master/release/src-rt-6.x.4708/linux/linux-2.6.36/arch/arm/plat-brcm/bcm5301x_pcie.c#L286

On the mips SoCs it was possible to read them from some register in the
mips core on the aix bus.

> 
>> +Example:
>> +
>> +       aix@18000000 {
>> +               compatible = "brcm,bus-aix";
>> +               reg = <0x18000000 0x1000>;
>> +               ranges = <0x00000000 0x18000000 0x00100000>;
>> +               #address-cells = <1>;
>> +               #size-cells = <1>;
>> +               sprom = <&sprom0>;
>> +
>> +               gmac@0 {
>> +                       reg = <0x18024000 0x1000>;
>> +                       interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
>> +               };
> 
> The @0 part seems wrong here: the address should generally match
> the first entry in the reg property, which would be gmac@18024000.
> 
> Also, you probably mean ethernet@ not gmac@.

Will change that.

>> +               gmac@1 {
>> +                       reg = <0x18025000 0x1000>;
>> +                       interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
>> +               };
>> +
>> +               pcie@0 {
>> +                       reg = <0x18012000 0x1000>;
>> +                       interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
>> +               };
>> +       };
> 
> We may require additional properties for the pcie node, depending on whether
> we want to use the DT probing interfaces for it, or whether it should just
> hardcode the settings used on brcm based on the ID.

I wrote a driver for the PCIe host controller and it also automatically
detects all needed memory addresses, it just had to provide the IRQ
number through device tree.

> 
> 	Arnd
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-08-26 21:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-24 21:24 [RFC 0/7] bcma: add device tree support Hauke Mehrtens
     [not found] ` <1408915485-8078-1-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2014-08-24 21:24   ` Hauke Mehrtens
2014-08-24 21:24   ` [RFC 1/7] MIPS: BCM47XX: move the nvram header file into common space Hauke Mehrtens
2014-08-24 21:24   ` [RFC 2/7] bcm47xx-nvram: add new broadcom nvram driver with dt support Hauke Mehrtens
     [not found]     ` <1408915485-8078-4-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2014-08-24 21:45       ` Rafał Miłecki
2014-08-27  5:54       ` Rafał Miłecki
2014-08-27 18:20         ` Florian Fainelli
     [not found]           ` <53FE217B.7000401-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-27 18:43             ` Rafał Miłecki
2014-08-24 21:24   ` [RFC 3/7] bcm47xx-sprom: add Broadcom sprom parser driver Hauke Mehrtens
     [not found]     ` <1408915485-8078-5-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2014-08-25  7:52       ` Arnd Bergmann
2014-08-25 15:01         ` Jonas Gorski
2014-08-26 21:32         ` Hauke Mehrtens
     [not found]           ` <53FCFCF0.2010704-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2014-09-01  9:24             ` Rafał Miłecki
2014-08-24 21:24   ` [RFC 4/7] bcma: register bcma as device tree driver Hauke Mehrtens
     [not found]     ` <1408915485-8078-6-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2014-08-25  7:57       ` Arnd Bergmann
2014-08-26 21:25         ` Hauke Mehrtens [this message]
2014-08-24 21:24   ` [RFC 5/7] bcma: get IRQ numbers from dt Hauke Mehrtens
     [not found]     ` <1408915485-8078-7-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2014-08-25  8:00       ` Arnd Bergmann
2014-08-24 21:24   ` [RFC 6/7] bcma: get sprom from devicetree Hauke Mehrtens
     [not found]     ` <1408915485-8078-8-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2014-08-25  8:04       ` Arnd Bergmann
2014-08-24 21:24   ` [RFC 7/7] ARM: BCM5301X: register bcma bus Hauke Mehrtens
     [not found]     ` <1408915485-8078-9-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2014-08-27 18:22       ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53FCFB50.80800@hauke-m.de \
    --to=hauke-5/s+jyg5szeelga04laivw@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).