mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "qinjian[覃健]" <qinjian@cqplus1.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Rob Herring <robh+dt@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <maz@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"Russell King - ARM Linux" <linux@armlinux.org.uk>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	DTML <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>
Subject: RE: [PATCH v12 2/9] dt-bindings: reset: Add bindings for SP7021 reset driver
Date: Fri, 1 Apr 2022 08:24:45 +0000	[thread overview]
Message-ID: <7a344146331847ce88d26716fc3b6380@cqplus1.com> (raw)
In-Reply-To: <CAK8P3a1APzs74YTcZ=m43G3zrmwJZKcYSTvV5eDDQX-37UY7Tw@mail.gmail.com>

> 
> On Thu, Mar 31, 2022 at 10:29 AM Qin Jian <qinjian@cqplus1.com> wrote:
> 
> > +/* mo_reset0 ~ mo_reset9 */
> > +#define RST_SYSTEM             0x00
> > +#define RST_RTC                        0x02
> > +#define RST_IOCTL              0x03
> > +#define RST_IOP                        0x04
> > +#define RST_OTPRX              0x05
> > +#define RST_NOC                        0x06
> > +#define RST_BR                 0x07
> > +#define RST_RBUS_L00           0x08
> > +#define RST_SPIFL              0x09
> > +#define RST_SDCTRL0            0x0a
> > +#define RST_PERI0              0x0b
> > +#define RST_A926               0x0d
> > +#define RST_UMCTL2             0x0e
> > +#define RST_PERI1              0x0f
> > +
> > +#define RST_DDR_PHY0           0x10
> > +#define RST_ACHIP              0x12
> > +#define RST_STC0               0x14
> > +#define RST_STC_AV0            0x15
> > +#define RST_STC_AV1            0x16
> > +#define RST_STC_AV2            0x17
> 
> The list looks like these definitions just match the hardware, which means you
> don't have to define them as a binding at all, just use the hardware numbers
> directly in the dt, as you do for interrupts or gpio numbers.
> 
> If the hardware does not have a sane way of mapping reset lines to a particular
> hardware number, then you may have to define a binding, but in that case just
> use consecutive integer numbers, not hexadecimal numbers.
> 
>        Arnd

You are right, these definitions does match the hardware, In reset-sunplus.c:
static int sp_reset_status(struct reset_controller_dev *rcdev,
                           unsigned long id)
{
        struct sp_reset *reset = to_sp_reset(rcdev);
        int index = id / BITS_PER_HWM_REG;
        int shift = id % BITS_PER_HWM_REG;
        u32 reg;

        reg = readl(reset->base + (index * 4));

        return !!(reg & BIT(shift));
}
the 'id'  is these value passed from dt.

I'll remove this file & update dt, thanks for your comments.


  reply	other threads:[~2022-04-01  8:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31  8:29 [PATCH v12 0/9] Add Sunplus SP7021 SoC Support Qin Jian
2022-03-31  8:29 ` [PATCH v12 1/9] dt-bindings: arm: sunplus: Add bindings for Sunplus SP7021 SoC boards Qin Jian
2022-03-31  8:29 ` [PATCH v12 2/9] dt-bindings: reset: Add bindings for SP7021 reset driver Qin Jian
2022-03-31  8:58   ` Arnd Bergmann
2022-04-01  8:24     ` qinjian[覃健] [this message]
2022-03-31  8:29 ` [PATCH v12 3/9] reset: Add Sunplus " Qin Jian
2022-03-31  8:59   ` Arnd Bergmann
2022-03-31  8:29 ` [PATCH v12 4/9] dt-bindings: clock: Add bindings for SP7021 clock driver Qin Jian
2022-03-31 20:21   ` Krzysztof Kozlowski
2022-04-01  9:19     ` qinjian[覃健]
2022-04-01  9:32       ` Krzysztof Kozlowski
2022-03-31  8:29 ` [PATCH v12 5/9] clk: Add Sunplus " Qin Jian
2022-03-31  9:22   ` Arnd Bergmann
2022-04-01  9:47     ` qinjian[覃健]
2022-04-01 10:09       ` Arnd Bergmann
2022-04-02  3:37         ` qinjian[覃健]
2022-03-31  8:29 ` [PATCH v12 6/9] dt-bindings: interrupt-controller: Add bindings for SP7021 interrupt controller Qin Jian
2022-03-31 20:44   ` Rob Herring
2022-04-01  2:29     ` qinjian[覃健]
2022-04-01 17:53       ` Rob Herring
2022-04-02  2:43         ` qinjian[覃健]
2022-03-31  8:29 ` [PATCH v12 7/9] irqchip: Add Sunplus SP7021 interrupt controller driver Qin Jian
2022-03-31  9:17   ` Arnd Bergmann
2022-04-01  7:17     ` qinjian[覃健]
2022-03-31  8:29 ` [PATCH v12 8/9] ARM: sunplus: Add initial support for Sunplus SP7021 SoC Qin Jian
2022-03-31  9:03   ` Arnd Bergmann
2022-03-31  8:29 ` [PATCH v12 9/9] ARM: sp7021_defconfig: Add Sunplus SP7021 defconfig Qin Jian
2022-03-31  9:09   ` Arnd Bergmann
2022-04-01  7:08     ` qinjian[覃健]

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=7a344146331847ce88d26716fc3b6380@cqplus1.com \
    --to=qinjian@cqplus1.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maz@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®