All of lore.kernel.org
 help / color / mirror / Atom feed
From: marc.ceeeee@gmail.com (Marc C)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 7/7] ARM: brcmstb: dts: add a reference DTS for Broadcom 7445
Date: Wed, 15 Jan 2014 17:03:09 -0800	[thread overview]
Message-ID: <52D72FCD.1030005@gmail.com> (raw)
In-Reply-To: <61E0E2A7-F7FC-4397-8E92-06CC409912B9@gmail.com>

Hello Arnd,

> And then you can add a regular device driver to drivers/reset that provides a
> device_reset() API to other drivers, or a system-reset function to be registered as
> arm_pm_restart. This driver would use syscon_regmap_lookup_by_phandle() to get access
> to a regmap pointer, and then use either hardcoded offsets into the regmap, or get
> those offsets from numbers in the devicetree, as provided in the example above.

I was able to port a standalone "reboot" driver using syscon + regmap. However, for the
SMP initialization case, it turns out that syscon is configured *after* SMP init. Do you
have any advice for this type of situation?

I'd hate to go around in circles, but without resorting to hard-coded offsets, perhaps I
can just add the remaining "non-regmap" register offsets in the DT?

Thanks,
Marc

On 01/15/2014 10:22 AM, Marc wrote:
> Hi Arnd,
> 
> Thank you for the suggestion - it's exactly what we were looking for!
> 
> Regards,
> Marc
> 
> Sent from my phone
> 
>> On Jan 15, 2014, at 5:10 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>>
>>> On Wednesday 15 January 2014, Marc Carino wrote:
>>> +       gen-ctrl {
>>> +               compatible = "brcm,brcmstb-gen-ctrl-v1";
>>> +               reg = <0xf0404304 0x4
>>> +                      0xf0404308 0x4
>>> +                      0xf03e2578 0x4
>>> +                      0xf03e2488 0x10
>>> +                      0xf0452000 0x20>;
>>> +       };
>>
>> Sorry I didn't get back to you on this when we discussed the previous
>> version. I'm actually less happy with this DT representation than the
>> original. What I take from your description is that you have multiple
>> register ranges that basically combine more-or-less random registers
>> that belong into different Linux subsystems.
>>
>> I think the best way to deal with this is to have the "syscon" driver
>> handle the multiplexing between the various drivers that need access
>> to the registers. It would look something like (taking the numbers
>> from your previous patch):
>>
>>    ahb {
>>        ranges = <0 0xf0000000 0x1000000>; /* 16 MB remapped registers */
>>
>>        hif-cpubuictrl: syscon at 3e2400 {
>>            compatible = "brcm,7445-cpubioctrl", "syscon";
>>            reg = <0x3e2000, 0x1000>;
>>        };
>>
>>        hif-continuation: syscon at 45200 {
>>            compatible = "brcm,7445-hif-continuation", "syscon";
>>            reg = <0x452000, 0x1000>;
>>        };
>>
>>        sun-top-ctrl: ...
>>    };
>>
>> This lets the syscon driver find and map the three register areas.
>> Drivers that need access to the registers then do 
>>
>>    reset {
>>        compatible = "brcm,7445-reset-ctrl";
>>        syscon = <&sun-top-ctrl 0x300 0x100>;
>>        #reset-cells = <1>;
>>    };
>>
>> And then you can add a regular device driver to drivers/reset that provides
>> a device_reset() API to other drivers, or a system-reset function to be
>> registered as arm_pm_restart. This driver would use
>> syscon_regmap_lookup_by_phandle() to get access to a regmap pointer,
>> and then use either hardcoded offsets into the regmap, or get those
>> offsets from numbers in the devicetree, as provided in the example
>> above.
>>
>>    Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Marc C <marc.ceeeee@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Daudt <bcm@fixthebug.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Matt Porter <matt.porter@linaro.org>,
	Russell King <linux@arm.linux.org.uk>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 7/7] ARM: brcmstb: dts: add a reference DTS for Broadcom 7445
Date: Wed, 15 Jan 2014 17:03:09 -0800	[thread overview]
Message-ID: <52D72FCD.1030005@gmail.com> (raw)
In-Reply-To: <61E0E2A7-F7FC-4397-8E92-06CC409912B9@gmail.com>

Hello Arnd,

> And then you can add a regular device driver to drivers/reset that provides a
> device_reset() API to other drivers, or a system-reset function to be registered as
> arm_pm_restart. This driver would use syscon_regmap_lookup_by_phandle() to get access
> to a regmap pointer, and then use either hardcoded offsets into the regmap, or get
> those offsets from numbers in the devicetree, as provided in the example above.

I was able to port a standalone "reboot" driver using syscon + regmap. However, for the
SMP initialization case, it turns out that syscon is configured *after* SMP init. Do you
have any advice for this type of situation?

I'd hate to go around in circles, but without resorting to hard-coded offsets, perhaps I
can just add the remaining "non-regmap" register offsets in the DT?

Thanks,
Marc

On 01/15/2014 10:22 AM, Marc wrote:
> Hi Arnd,
> 
> Thank you for the suggestion - it's exactly what we were looking for!
> 
> Regards,
> Marc
> 
> Sent from my phone
> 
>> On Jan 15, 2014, at 5:10 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>>
>>> On Wednesday 15 January 2014, Marc Carino wrote:
>>> +       gen-ctrl {
>>> +               compatible = "brcm,brcmstb-gen-ctrl-v1";
>>> +               reg = <0xf0404304 0x4
>>> +                      0xf0404308 0x4
>>> +                      0xf03e2578 0x4
>>> +                      0xf03e2488 0x10
>>> +                      0xf0452000 0x20>;
>>> +       };
>>
>> Sorry I didn't get back to you on this when we discussed the previous
>> version. I'm actually less happy with this DT representation than the
>> original. What I take from your description is that you have multiple
>> register ranges that basically combine more-or-less random registers
>> that belong into different Linux subsystems.
>>
>> I think the best way to deal with this is to have the "syscon" driver
>> handle the multiplexing between the various drivers that need access
>> to the registers. It would look something like (taking the numbers
>> from your previous patch):
>>
>>    ahb {
>>        ranges = <0 0xf0000000 0x1000000>; /* 16 MB remapped registers */
>>
>>        hif-cpubuictrl: syscon@3e2400 {
>>            compatible = "brcm,7445-cpubioctrl", "syscon";
>>            reg = <0x3e2000, 0x1000>;
>>        };
>>
>>        hif-continuation: syscon@45200 {
>>            compatible = "brcm,7445-hif-continuation", "syscon";
>>            reg = <0x452000, 0x1000>;
>>        };
>>
>>        sun-top-ctrl: ...
>>    };
>>
>> This lets the syscon driver find and map the three register areas.
>> Drivers that need access to the registers then do 
>>
>>    reset {
>>        compatible = "brcm,7445-reset-ctrl";
>>        syscon = <&sun-top-ctrl 0x300 0x100>;
>>        #reset-cells = <1>;
>>    };
>>
>> And then you can add a regular device driver to drivers/reset that provides
>> a device_reset() API to other drivers, or a system-reset function to be
>> registered as arm_pm_restart. This driver would use
>> syscon_regmap_lookup_by_phandle() to get access to a regmap pointer,
>> and then use either hardcoded offsets into the regmap, or get those
>> offsets from numbers in the devicetree, as provided in the example
>> above.
>>
>>    Arnd

  reply	other threads:[~2014-01-16  1:03 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 23:48 [PATCH v3 0/7] ARM: brcmstb: Add Broadcom STB SoC support Marc Carino
2014-01-14 23:48 ` Marc Carino
2014-01-14 23:48 ` Marc Carino
2014-01-14 23:48 ` [PATCH v3 1/7] ARM: brcmstb: add infrastructure for ARM-based Broadcom STB SoCs Marc Carino
2014-01-14 23:48   ` Marc Carino
2014-01-14 23:48   ` Marc Carino
2014-01-14 23:48 ` [PATCH v3 2/7] ARM: brcmstb: add debug UART for earlyprintk support Marc Carino
2014-01-14 23:48   ` Marc Carino
2014-01-14 23:48   ` Marc Carino
2014-01-14 23:48 ` [PATCH v3 3/7] ARM: do CPU-specific init for Broadcom Brahma15 cores Marc Carino
2014-01-14 23:48   ` Marc Carino
2014-01-15 17:19   ` Will Deacon
2014-01-15 17:19     ` Will Deacon
2014-01-14 23:48 ` [PATCH v3 4/7] ARM: brcmstb: add CPU binding for Broadcom Brahma15 Marc Carino
2014-01-14 23:48   ` Marc Carino
2014-01-15 16:58   ` Mark Rutland
2014-01-15 16:58     ` Mark Rutland
2014-01-15 16:58     ` Mark Rutland
2014-01-14 23:48 ` [PATCH v3 5/7] ARM: brcmstb: add misc. DT bindings for brcm, brcmstb-* Marc Carino
2014-01-14 23:48   ` [PATCH v3 5/7] ARM: brcmstb: add misc. DT bindings for brcm,brcmstb-* Marc Carino
2014-01-15 17:11   ` Mark Rutland
2014-01-15 17:11     ` Mark Rutland
2014-01-15 17:11     ` Mark Rutland
2014-01-15 17:15     ` [PATCH v3 5/7] ARM: brcmstb: add misc. DT bindings for brcm, brcmstb-* Arnd Bergmann
2014-01-15 17:15       ` [PATCH v3 5/7] ARM: brcmstb: add misc. DT bindings for brcm,brcmstb-* Arnd Bergmann
2014-01-15 17:15       ` Arnd Bergmann
2014-01-15 17:55     ` [PATCH v3 5/7] ARM: brcmstb: add misc. DT bindings for brcm, brcmstb-* Florian Fainelli
2014-01-15 17:55       ` [PATCH v3 5/7] ARM: brcmstb: add misc. DT bindings for brcm,brcmstb-* Florian Fainelli
2014-01-14 23:48 ` [PATCH v3 6/7] ARM: brcmstb: gic: add compatible string for Broadcom Brahma15 Marc Carino
2014-01-14 23:48   ` Marc Carino
2014-01-15 17:20   ` Mark Rutland
2014-01-15 17:20     ` Mark Rutland
2014-01-15 17:20     ` Mark Rutland
2014-01-14 23:48 ` [PATCH v3 7/7] ARM: brcmstb: dts: add a reference DTS for Broadcom 7445 Marc Carino
2014-01-14 23:48   ` Marc Carino
2014-01-15 13:10   ` Arnd Bergmann
2014-01-15 13:10     ` Arnd Bergmann
2014-01-15 13:10     ` Arnd Bergmann
2014-01-15 18:22     ` Marc
2014-01-15 18:22       ` Marc
2014-01-15 18:22       ` Marc
2014-01-16  1:03       ` Marc C [this message]
2014-01-16  1:03         ` Marc C
2014-01-16 11:19         ` Arnd Bergmann
2014-01-16 11:19           ` Arnd Bergmann
2014-01-16 11:19           ` Arnd Bergmann
2014-01-16 13:37           ` Michal Simek
2014-01-16 13:37             ` Michal Simek
2014-01-16 13:37             ` Michal Simek
2014-01-16 13:47           ` Mark Brown
2014-01-16 13:47             ` Mark Brown
2014-01-17 17:04             ` Arnd Bergmann
2014-01-17 17:04               ` Arnd Bergmann
2014-01-23  8:58               ` Michal Simek
2014-01-23  8:58                 ` Michal Simek
2014-01-23 12:25                 ` Mark Brown
2014-01-23 12:25                   ` Mark Brown
2014-01-23 12:25                   ` Mark Brown
2014-01-15 17:40   ` Mark Rutland
2014-01-15 17:40     ` Mark Rutland
2014-01-15 17:40     ` Mark Rutland

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=52D72FCD.1030005@gmail.com \
    --to=marc.ceeeee@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.