devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: "Stephen Boyd" <sboyd@kernel.org>,
	devicetree@vger.kernel.org, jonas.gorski@gmail.com,
	krzysztof.kozlowski+dt@linaro.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, mturquette@baylibre.com,
	p.zabel@pengutronix.de, robh+dt@kernel.org,
	william.zhang@broadcom.com,
	"Álvaro Fernández Rojas" <noltari@gmail.com>
Subject: Re: [PATCH v3 4/4] clk: bcm: Add BCM63268 timer clock and reset driver
Date: Tue, 21 Mar 2023 16:09:54 -0700	[thread overview]
Message-ID: <302bb0c4-a31e-7025-26d6-21c8d473f370@gmail.com> (raw)
In-Reply-To: <d06781c905adb23089a85a8d54b94461.sboyd@kernel.org>

On 3/21/23 16:06, Stephen Boyd wrote:
> Quoting Florian Fainelli (2023-03-21 16:00:29)
>> On 3/21/23 15:57, Stephen Boyd wrote:
>>> Quoting Álvaro Fernández Rojas (2023-03-21 13:10:22)
>>>> diff --git a/drivers/clk/bcm/clk-bcm63268-timer.c b/drivers/clk/bcm/clk-bcm63268-timer.c
>>>> new file mode 100644
>>>> index 000000000000..6a1fdd193cb5
>>>> --- /dev/null
>>>> +++ b/drivers/clk/bcm/clk-bcm63268-timer.c
>>>> @@ -0,0 +1,232 @@
>>>> +// SPDX-License-Identifier: GPL-2.0
>>>> +/*
>>>> + * BCM63268 Timer Clock and Reset Controller Driver
>>> [...]
>>>> +
>>>> +static inline struct bcm63268_tclkrst_hw *
>>>> +to_bcm63268_timer_reset(struct reset_controller_dev *rcdev)
>>>> +{
>>>> +       return container_of(rcdev, struct bcm63268_tclkrst_hw, rcdev);
>>>> +}
>>>> +
>>>> +static int bcm63268_timer_reset_update(struct reset_controller_dev *rcdev,
>>>> +                               unsigned long id, bool assert)
>>>> +{
>>>> +       struct bcm63268_tclkrst_hw *reset = to_bcm63268_timer_reset(rcdev);
>>>> +       unsigned long flags;
>>>> +       uint32_t val;
>>>> +
>>>> +       spin_lock_irqsave(&reset->lock, flags);
>>>> +       val = __raw_readl(reset->regs);
>>>
>>> Use regular ol readl() here, unless you have some need for no barrires
>>> or byte swapping.
>>
>> These SoCs are big-endian, require native endian register access and
>> have no posted writes within their bus logic (UBUS) and require no
>> barriers, hence the use of __raw_readl() and __raw_writel() is adequate.
>>
> 
> Use ioread32be() then?

BCM63xx drivers tend to use __raw_{read,write}l for consistency and to 
make it clear that no barriers, no endian swapping is necessary, I would 
prefer to remain consistent with that convention.
-- 
Florian


  reply	other threads:[~2023-03-21 23:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 12:26 [PATCH v2 0/4] clk: add BCM63268 timer clock and reset Álvaro Fernández Rojas
2021-03-15 12:26 ` [PATCH v2 1/4] dt-bindings: clk: add BCM63268 timer clock definitions Álvaro Fernández Rojas
2021-03-15 12:26 ` [PATCH v2 2/4] dt-bindings: reset: add BCM63268 timer reset definitions Álvaro Fernández Rojas
2021-03-15 12:26 ` [PATCH v2 3/4] dt-bindings: clock: Add BCM63268 timer binding Álvaro Fernández Rojas
2021-03-15 12:26 ` [PATCH v2 4/4] clk: bcm: Add BCM63268 timer clock and reset driver Álvaro Fernández Rojas
2023-03-21 20:10 ` [PATCH v3 0/4] clk: add BCM63268 timer clock and reset Álvaro Fernández Rojas
2023-03-21 20:10   ` [PATCH v3 1/4] dt-bindings: clk: add BCM63268 timer clock definitions Álvaro Fernández Rojas
2023-03-21 20:10   ` [PATCH v3 2/4] dt-bindings: reset: add BCM63268 timer reset definitions Álvaro Fernández Rojas
2023-03-21 20:10   ` [PATCH v3 3/4] dt-bindings: clock: Add BCM63268 timer binding Álvaro Fernández Rojas
2023-03-21 20:10   ` [PATCH v3 4/4] clk: bcm: Add BCM63268 timer clock and reset driver Álvaro Fernández Rojas
2023-03-21 22:57     ` Stephen Boyd
2023-03-21 23:00       ` Florian Fainelli
2023-03-21 23:06         ` Stephen Boyd
2023-03-21 23:09           ` Florian Fainelli [this message]
2023-03-21 23:23             ` Stephen Boyd
2023-03-22 17:17               ` Álvaro Fernández Rojas
2023-03-22 17:18               ` Florian Fainelli
2023-03-21 22:54   ` [PATCH v3 0/4] clk: add BCM63268 timer clock and reset Stephen Boyd
2023-03-22 17:18     ` Álvaro Fernández Rojas

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=302bb0c4-a31e-7025-26d6-21c8d473f370@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jonas.gorski@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=noltari@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=william.zhang@broadcom.com \
    /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).