linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Kevin Hilman <khilman@baylibre.com>
Cc: linux-kernel@vger.kernel.org, p.zabel@pengutronix.de,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org
Subject: Re: [RFC PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
Date: Mon, 16 May 2016 10:49:13 +0200	[thread overview]
Message-ID: <57398989.2020207@baylibre.com> (raw)
In-Reply-To: <m2oa881xwp.fsf@baylibre.com>

On 05/14/2016 05:07 PM, Kevin Hilman wrote:
> Neil Armstrong <narmstrong@baylibre.com> writes:
>> +	writel(readl(reg_addr) | BIT(offset), reg_addr);
> 
> The spec lists these registers as 16-bit registers, so probably readw/writew
> are more appropriate here.


Looking at the datasheet, the reset controller is an APB3 module, thus 32bit would be the only data width configured.

Sure, it's strange to only have 16 used bits per registers...

> 
>> +	return 0;
>> +}
>> +
>> +static int meson_gxbb_reset_deassert(struct reset_controller_dev *rcdev,
>> +				unsigned long id)
>> +{
>> +	struct meson_gxbb_reset *data =
>> +		container_of(rcdev, struct meson_gxbb_reset, rcdev);
>> +	unsigned int bank = id / BITS_PER_REG;
>> +	unsigned int offset = id % BITS_PER_REG;
>> +	void *reg_addr = data->reg_base + (bank << 2);
>> +
>> +	if (bank >= REG_COUNT)
>> +		return -EINVAL;
>> +
>> +	writel(readl(reg_addr) & ~BIT(offset), reg_addr);
> 
> and here.
> 
>> +	return 0;
>> +}
> 
> Kevin
> 

Neil

  reply	other threads:[~2016-05-16  8:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 14:00 [RFC PATCH 0/3] Amlogic: GXBB: Add reset controller Neil Armstrong
2016-05-13 14:00 ` [RFC PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller Neil Armstrong
2016-05-14 15:07   ` Kevin Hilman
2016-05-16  8:49     ` Neil Armstrong [this message]
2016-05-14 17:45   ` Kevin Hilman
2016-05-13 14:00 ` [RFC PATCH 2/3] dt-bindings: reset: Add bindings for the " Neil Armstrong
2016-05-14 14:45   ` Kevin Hilman
2016-05-13 14:00 ` [RFC PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms Neil Armstrong
2016-05-14 15:09 ` [RFC PATCH 0/3] Amlogic: GXBB: Add reset controller Kevin Hilman
2016-05-14 15:11 ` Kevin Hilman

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=57398989.2020207@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.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;
as well as URLs for NNTP newsgroup(s).