From: Ryan Chen <ryan_chen@aspeedtech.com>
To: Joel Stanley <joel@jms.id.au>
Cc: BMC-SW <BMC-SW@aspeedtech.com>,
Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>,
linux-aspeed <linux-aspeed@lists.ozlabs.org>,
Andrew Jeffery <andrew@aj.id.au>,
Michael Turquette <mturquette@baylibre.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH 1/1] clk: aspeed: modify some default clks are critical
Date: Thu, 8 Oct 2020 02:33:50 +0000 [thread overview]
Message-ID: <HK0PR06MB3380E2AD2DAE6FBF1B6E1153F20B0@HK0PR06MB3380.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <CACPK8XdBmkhZ8mcSFmDAFV8k7Qj7ajBL8TVKfK8c+5aneUMHZw@mail.gmail.com>
> -----Original Message-----
> From: Joel Stanley <joel@jms.id.au>
> Sent: Wednesday, October 7, 2020 7:34 PM
> To: Ryan Chen <ryan_chen@aspeedtech.com>
> Cc: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>; Andrew Jeffery
> <andrew@aj.id.au>; Michael Turquette <mturquette@baylibre.com>; Stephen
> Boyd <sboyd@kernel.org>; linux-clk@vger.kernel.org; Linux ARM
> <linux-arm-kernel@lists.infradead.org>; linux-aspeed
> <linux-aspeed@lists.ozlabs.org>; Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org>; BMC-SW <BMC-SW@aspeedtech.com>
> Subject: Re: [PATCH 1/1] clk: aspeed: modify some default clks are critical
>
> On Tue, 29 Sep 2020 at 08:40, Ryan Chen <ryan_chen@aspeedtech.com>
> wrote:
> >
> > > From: Joel Stanley <joel@jms.id.au>
> > > Sent: Tuesday, September 29, 2020 4:04 PM
> > > To: Ryan Chen <ryan_chen@aspeedtech.com>; Jae Hyun Yoo
> > > <jae.hyun.yoo@linux.intel.com>; Andrew Jeffery <andrew@aj.id.au>
> > > Cc: Michael Turquette <mturquette@baylibre.com>; Stephen Boyd
> > > <sboyd@kernel.org>; linux-clk@vger.kernel.org; Linux ARM
> > > <linux-arm-kernel@lists.infradead.org>; linux-aspeed
> > > <linux-aspeed@lists.ozlabs.org>; Linux Kernel Mailing List
> > > <linux-kernel@vger.kernel.org>; BMC-SW <BMC-SW@aspeedtech.com>
> > > Subject: Re: [PATCH 1/1] clk: aspeed: modify some default clks are
> > > critical
> > >
> > > On Mon, 28 Sep 2020 at 07:01, Ryan Chen <ryan_chen@aspeedtech.com>
> > > wrote:
> > > >
> > > > In ASPEED SoC LCLK is LPC clock for all SuperIO device,
> > > > UART1/UART2 are default for Host SuperIO UART device, eSPI clk for
> > > > Host eSPI bus access eSPI slave channel, those clks can't be
> > > > disable should keep default, otherwise will affect Host side access
> SuperIO and SPI slave device.
> > > >
> > > > Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
> > > > ---
> > > > drivers/clk/clk-aspeed.c | 8 ++++---- drivers/clk/clk-ast2600.c
> > > > | 8
> > > > ++++----
> > > > 2 files changed, 8 insertions(+), 8 deletions(-)
> > > >
> > > > diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c
> > > > index 411ff5fb2c07..d348c4fd3f9f 100644
> > > > --- a/drivers/clk/clk-aspeed.c
> > > > +++ b/drivers/clk/clk-aspeed.c
> > > > @@ -54,15 +54,15 @@ static const struct aspeed_gate_data
> > > > aspeed_gates[]
> > > = {
> > > > [ASPEED_CLK_GATE_DCLK] = { 5, -1, "dclk-gate",
> > > NULL, CLK_IS_CRITICAL }, /* DAC */
> > > > [ASPEED_CLK_GATE_REFCLK] = { 6, -1, "refclk-gate",
> > > "clkin", CLK_IS_CRITICAL },
> > > > [ASPEED_CLK_GATE_USBPORT2CLK] = { 7, 3,
> > > > "usb-port2-gate",
> > > NULL, 0 }, /* USB2.0 Host port 2 */
> > > > - [ASPEED_CLK_GATE_LCLK] = { 8, 5, "lclk-gate",
> > > NULL, 0 }, /* LPC */
> > > > + [ASPEED_CLK_GATE_LCLK] = { 8, 5, "lclk-gate",
> > > NULL, CLK_IS_CRITICAL }, /* LPC */
> > > > [ASPEED_CLK_GATE_USBUHCICLK] = { 9, 15,
> "usb-uhci-gate",
> > > NULL, 0 }, /* USB1.1 (requires port 2 enabled) */
> > > > [ASPEED_CLK_GATE_D1CLK] = { 10, 13, "d1clk-gate",
> > > NULL, 0 }, /* GFX CRT */
> > > > [ASPEED_CLK_GATE_YCLK] = { 13, 4, "yclk-gate",
> > > NULL, 0 }, /* HAC */
> > > > [ASPEED_CLK_GATE_USBPORT1CLK] = { 14, 14,
> > > > "usb-port1-gate",
> > > NULL, 0 }, /* USB2 hub/USB2 host port 1/USB1.1 dev */
> > > > - [ASPEED_CLK_GATE_UART1CLK] = { 15, -1, "uart1clk-gate",
> > > "uart", 0 }, /* UART1 */
> > > > - [ASPEED_CLK_GATE_UART2CLK] = { 16, -1, "uart2clk-gate",
> > > "uart", 0 }, /* UART2 */
> > > > + [ASPEED_CLK_GATE_UART1CLK] = { 15, -1, "uart1clk-gate",
> > > "uart", CLK_IS_CRITICAL }, /* UART1 */
> > > > + [ASPEED_CLK_GATE_UART2CLK] = { 16, -1, "uart2clk-gate",
> > > "uart", CLK_IS_CRITICAL }, /* UART2 */
> > > > [ASPEED_CLK_GATE_UART5CLK] = { 17, -1,
> "uart5clk-gate",
> > > "uart", 0 }, /* UART5 */
> > > > - [ASPEED_CLK_GATE_ESPICLK] = { 19, -1, "espiclk-gate",
> > > NULL, 0 }, /* eSPI */
> > > > + [ASPEED_CLK_GATE_ESPICLK] = { 19, -1, "espiclk-gate",
> > > NULL, CLK_IS_CRITICAL }, /* eSPI */
> > >
> > > This is fine for systems that have eSPI. For systems that do not use
> > > eSPI, the clocks are not "required".
> > >
> > > I was sent a similar patch by Jae some time ago:
> > >
> > >
> > > https://lore.kernel.org/openbmc/697a184b-ef99-a46e-bf98-4d339b3aafd8
> > > @lin
> > > ux.intel.com/
> > >
> > > Better is to associate drivers with these clocks, and those drivers
> > > will ensure they are left enabled.
> > >
> > > Alternatively, we will need to come up with a device tree binding to
> > > describe the hardware requirement that these clocks are left on.
> > >
> > ASPEED BMC SoC have SuperIO device that default enable, even without
> BMC fw boot.
> > Host can use SUART1/SUART2/GPIO....
> > That the reason even Linux kernel boot should not change the SoC default clk,
> that is the impact.
>
> Ok, that makes sense. Linux will not enable these clocks if a driver is loaded
> for them though, so we should load a driver for them.
>
> ESPI: We do not have an upstream driver for eSPI, but once you submit one this
> will solve the eSPI issue.
>
> LPC: The existing LPC driver will enable the clock, so by loading that this clock
> will be left enabled.
>
> UART1/UART2: This is harder, as the SUART mode means the BMC does not
> load a driver for these devices. We could add a property to the device tree to
> describe the clocks that must be left on?
That following the example,
BMC is stop in u-boot stage, the eSPI and LPC UART1/2 can still work fine.
But after boot into Linux, the eSPI and SUART1/2 can't work anymore,
it is disappear. That is not consistence between U-boot and kernel.
The reason is the same with AST SoC also have VGA device capability.
And another point of view, clk framework provide CLK_IS_CRITICAL flag
to support this, instead add more driver for this.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-10-08 4:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 7:01 [PATCH 0/1] Modify ASPEED SoC some default clks are critical Ryan Chen
2020-09-28 7:01 ` [PATCH 1/1] clk: aspeed: modify " Ryan Chen
2020-09-29 8:04 ` Joel Stanley
2020-09-29 8:37 ` Ryan Chen
2020-10-07 11:34 ` Joel Stanley
2020-10-08 2:33 ` Ryan Chen [this message]
2020-10-14 2:50 ` Stephen Boyd
2020-10-14 5:28 ` Joel Stanley
2020-10-14 5:39 ` Ryan Chen
2020-10-14 17:16 ` Stephen Boyd
2020-10-28 4:38 ` Joel Stanley
2020-10-29 2:25 ` Samuel Holland
2021-01-22 8:15 ` Ryan Chen
2021-01-25 0:47 ` Andrew Jeffery
2021-02-01 7:16 ` 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=HK0PR06MB3380E2AD2DAE6FBF1B6E1153F20B0@HK0PR06MB3380.apcprd06.prod.outlook.com \
--to=ryan_chen@aspeedtech.com \
--cc=BMC-SW@aspeedtech.com \
--cc=andrew@aj.id.au \
--cc=jae.hyun.yoo@linux.intel.com \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/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).