From: Joel Stanley <joel@jms.id.au>
To: Ryan Chen <ryanchen.aspeed@gmail.com>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>,
Andrew Jeffery <andrew@aj.id.au>,
Ryan Chen <ryan_chen@aspeedtech.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Lei YU <mine260309@gmail.com>
Subject: Re: [PATCH linux dev-4.17 2/7] clk: Aspeed: Add sdhci reset and clock
Date: Wed, 11 Jul 2018 15:26:45 +1000 [thread overview]
Message-ID: <CACPK8Xdx+tkFWv+0AwDpV0KW9V1-jEvtaZG5qBc7CrtygWvLmw@mail.gmail.com> (raw)
In-Reply-To: <1531286230-28453-3-git-send-email-ryanchen.aspeed@gmail.com>
On 11 July 2018 at 15:17, Ryan Chen <ryanchen.aspeed@gmail.com> wrote:
> 1.Add Aspeed sdhci reset for SCU04 bit 16
> 2.Aspeed sdhci have two clock one is for controller clock,
> another is for SD card clock. so when enable sdhci need enable
> both.
>
> Signed-off-by: Ryan Chen <ryanchen.aspeed@gmail.com>
> ---
> drivers/clk/clk-aspeed.c | 8 +++++++-
> include/dt-bindings/clock/aspeed-clock.h | 2 +-
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c
> index 9e55743..cd1f3b2 100644
> --- a/drivers/clk/clk-aspeed.c
> +++ b/drivers/clk/clk-aspeed.c
> @@ -20,6 +20,7 @@
>
> #define ASPEED_RESET_CTRL 0x04
> #define ASPEED_CLK_SELECTION 0x08
> +#define ASPEED_SDIO_CLK_EN BIT(15)
> #define ASPEED_CLK_STOP_CTRL 0x0c
> #define ASPEED_MPLL_PARAM 0x20
> #define ASPEED_HPLL_PARAM 0x24
> @@ -260,6 +261,11 @@ static int aspeed_clk_enable(struct clk_hw *hw)
> enval = (gate->flags & CLK_GATE_SET_TO_DISABLE) ? 0 : clk;
> regmap_update_bits(gate->map, ASPEED_CLK_STOP_CTRL, clk, enval);
>
> + /* sd ext clk */
> + if (gate->reset_idx == 16) {
> + regmap_update_bits(gate->map, ASPEED_CLK_SELECTION, ASPEED_SDIO_CLK_EN, ASPEED_SDIO_CLK_EN);
We do not special case individual clocks. The reset should instead be
added to the aspeed_gates structure above.
In fact, it already is:
[ASPEED_CLK_GATE_SDCLKCLK] = { 27, 16, "sdclk-gate",
NULL, 0 }, /* SDIO/SD */
Although in that table it is 16, and you specify bit 15. The data
sheet I have says SD/SDIO is bit 16.
> + }
> +
> if (gate->reset_idx >= 0) {
> /* A delay of 10ms is specified by the ASPEED docs */
> mdelay(10);
> @@ -317,7 +323,7 @@ static const u8 aspeed_resets[] = {
> [ASPEED_RESET_PECI] = 10,
> [ASPEED_RESET_I2C] = 2,
> [ASPEED_RESET_AHB] = 1,
> -
> + [ASPEED_RESET_SDHCI] = 16,
> /*
> * SCUD4 resets start at an offset to separate them from
> * the SCU04 resets.
> diff --git a/include/dt-bindings/clock/aspeed-clock.h b/include/dt-bindings/clock/aspeed-clock.h
> index 4476184..088553f 100644
> --- a/include/dt-bindings/clock/aspeed-clock.h
> +++ b/include/dt-bindings/clock/aspeed-clock.h
> @@ -50,5 +50,5 @@
> #define ASPEED_RESET_I2C 7
> #define ASPEED_RESET_AHB 8
> #define ASPEED_RESET_CRT1 9
> -
> +#define ASPEED_RESET_SDHCI 10
> #endif
> --
> 2.7.4
>
next prev parent reply other threads:[~2018-07-11 5:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 5:17 [PATCH linux dev-4.17 0/7] drivers/mmc/host: Add Aspeed SDIO driver Ryan Chen
2018-07-11 5:17 ` [PATCH linux dev-4.17 1/7] clk: Aspeed: Modify clk-aspeed.c driver probe sequence Ryan Chen
2018-07-11 5:47 ` Benjamin Herrenschmidt
2018-07-17 6:04 ` Ryan Chen
2018-07-17 9:45 ` Benjamin Herrenschmidt
2018-07-18 6:37 ` Joel Stanley
2018-07-18 7:16 ` Ryan Chen
2018-07-11 5:17 ` [PATCH linux dev-4.17 2/7] clk: Aspeed: Add sdhci reset and clock Ryan Chen
2018-07-11 5:26 ` Joel Stanley [this message]
2018-07-11 5:49 ` Benjamin Herrenschmidt
2018-07-11 5:17 ` [PATCH linux dev-4.17 3/7] irqchip: Aspeed: Add Aspeed sdhci irq driver Ryan Chen
2018-07-11 5:29 ` Joel Stanley
2018-07-11 5:17 ` [PATCH linux dev-4.17 4/7] dts: Aspeed: Add Aspeed sdhci dts document Ryan Chen
2018-07-11 5:30 ` Joel Stanley
2018-07-11 5:17 ` [PATCH linux dev-4.17 5/7] mmc: Aspeed: Add driver for Aspeed sdhci Ryan Chen
2018-07-11 5:32 ` Joel Stanley
2018-07-11 5:17 ` [PATCH linux dev-4.17 6/7] dts: Aspeed: Add devicetree " Ryan Chen
2018-07-11 5:17 ` [PATCH linux dev-4.17 7/7] configs: Aspeed: enable mmc host in defconfig Ryan Chen
2018-07-17 7:26 [PATCHv2 linux dev-4.17 0/7] mmc/host: Add Aspeed SDIO driver Ryan Chen
2018-07-17 7:26 ` [PATCH linux dev-4.17 2/7] clk: Aspeed: Add sdhci reset and clock Ryan Chen
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=CACPK8Xdx+tkFWv+0AwDpV0KW9V1-jEvtaZG5qBc7CrtygWvLmw@mail.gmail.com \
--to=joel@jms.id.au \
--cc=andrew@aj.id.au \
--cc=benh@kernel.crashing.org \
--cc=mine260309@gmail.com \
--cc=openbmc@lists.ozlabs.org \
--cc=ryan_chen@aspeedtech.com \
--cc=ryanchen.aspeed@gmail.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).