All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Kevin Hilman <khilman@kernel.org>
Cc: "Chris Zhong" <zyw@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Mike Turquette" <mturquette@linaro.org>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"Tony Xie" <xxx@rock-chips.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 4/7] ARM: rockchip: add suspend and resume for RK3288
Date: Wed, 29 Oct 2014 12:26:32 -0700	[thread overview]
Message-ID: <CAD=FV=Vabh6xJOYxkuGiG_AFr2qm26iqL87LJ_CBzK1w+dC9XA@mail.gmail.com> (raw)
In-Reply-To: <7h38a68zu9.fsf@deeprootsystems.com>

Kevin,

On Wed, Oct 29, 2014 at 12:01 PM, Kevin Hilman <khilman@kernel.org> wrote:
>> +     /* set bit 8 so that system will resume to FAST_BOOT_ADDR */
>> +     regmap_write(sgrf_regmap, RK3288_SGRF_SOC_CON0,
>> +                  BIT(SGRF_FAST_BOOT_EN) | BIT(SGRF_FAST_BOOT_EN + 16));
>
> Comment says "bit 8", but code says bit 8 and bit 24, and if bit 24 is
> needed, it should probably get its own #define in the header.

This is Rockchip's "write enable" feature hitting us again.  The upper
16-bits are "write enables" for the lower 16-bits.  So to set bit 8
you set bit 8 to whatever value you want and then 'write enable' by
setting (1 << 8 << 16).  It allows you to avoid read-modify-write.
See this in Rockchip's clk.h:

#define HIWORD_UPDATE(val, mask, shift) \
                ((val) << (shift) | (mask) << ((shift) + 16))

WARNING: multiple messages have this Message-ID (diff)
From: dianders@chromium.org (Doug Anderson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 4/7] ARM: rockchip: add suspend and resume for RK3288
Date: Wed, 29 Oct 2014 12:26:32 -0700	[thread overview]
Message-ID: <CAD=FV=Vabh6xJOYxkuGiG_AFr2qm26iqL87LJ_CBzK1w+dC9XA@mail.gmail.com> (raw)
In-Reply-To: <7h38a68zu9.fsf@deeprootsystems.com>

Kevin,

On Wed, Oct 29, 2014 at 12:01 PM, Kevin Hilman <khilman@kernel.org> wrote:
>> +     /* set bit 8 so that system will resume to FAST_BOOT_ADDR */
>> +     regmap_write(sgrf_regmap, RK3288_SGRF_SOC_CON0,
>> +                  BIT(SGRF_FAST_BOOT_EN) | BIT(SGRF_FAST_BOOT_EN + 16));
>
> Comment says "bit 8", but code says bit 8 and bit 24, and if bit 24 is
> needed, it should probably get its own #define in the header.

This is Rockchip's "write enable" feature hitting us again.  The upper
16-bits are "write enables" for the lower 16-bits.  So to set bit 8
you set bit 8 to whatever value you want and then 'write enable' by
setting (1 << 8 << 16).  It allows you to avoid read-modify-write.
See this in Rockchip's clk.h:

#define HIWORD_UPDATE(val, mask, shift) \
                ((val) << (shift) | (mask) << ((shift) + 16))

  reply	other threads:[~2014-10-29 19:26 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 11:51 [PATCH v6 0/7] This is the 1st version of suspend for RK3288 Chris Zhong
2014-10-29 11:51 ` Chris Zhong
2014-10-29 11:51 ` [PATCH v6 1/7] pinctrl: rockchip: add suspend/resume functions Chris Zhong
2014-10-29 11:51   ` Chris Zhong
2014-10-31 20:54   ` Linus Walleij
2014-10-31 20:54     ` Linus Walleij
2014-11-02 20:47   ` Heiko Stübner
2014-11-02 20:47     ` Heiko Stübner
2014-10-29 11:52 ` [PATCH v6 2/7] pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 11:52 ` [PATCH v6 3/7] clk: rockchip: RK3288: add suspend and resume Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 11:52 ` [PATCH v6 4/7] ARM: rockchip: add suspend and resume for RK3288 Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 19:01   ` Kevin Hilman
2014-10-29 19:01     ` Kevin Hilman
2014-10-29 19:26     ` Doug Anderson [this message]
2014-10-29 19:26       ` Doug Anderson
2014-10-29 20:00       ` Kevin Hilman
2014-10-29 20:00         ` Kevin Hilman
2014-11-11  7:33     ` Chris Zhong
2014-11-11  7:33       ` Chris Zhong
2014-10-29 11:52 ` [PATCH v6 5/7] ARM: rockchip: Add pmu-sram binding Chris Zhong
2014-10-29 11:52 ` [PATCH v6 6/7] ARM: dts: add RK3288 suspend support Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 11:52 ` [PATCH v6 7/7] ARM: dts: add suspend voltage setting for RK808 Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 15:40   ` Doug Anderson
2014-10-29 15:40     ` Doug Anderson
2014-10-29 15:40     ` Doug Anderson
2014-10-29 16:29     ` Javier Martinez Canillas
2014-10-29 16:29       ` Javier Martinez Canillas
2014-10-29 16:51       ` Doug Anderson
2014-10-29 16:51         ` Doug Anderson
2014-10-29 16:51         ` Doug Anderson
2014-10-30  0:32         ` Javier Martinez Canillas
2014-10-30  0:32           ` Javier Martinez Canillas
2014-10-29 20:06 ` [PATCH v6 0/7] This is the 1st version of suspend for RK3288 Kevin Hilman
2014-10-29 20:06   ` Kevin Hilman
2014-10-29 21:50   ` Heiko Stübner
2014-10-29 21:50     ` Heiko Stübner
2014-10-29 22:26     ` Doug Anderson
2014-10-29 22:26       ` Doug Anderson
2014-10-29 22:26       ` Doug Anderson

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='CAD=FV=Vabh6xJOYxkuGiG_AFr2qm26iqL87LJ_CBzK1w+dC9XA@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=khilman@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=xxx@rock-chips.com \
    --cc=zyw@rock-chips.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 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.