From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73CBEC47082 for ; Wed, 26 May 2021 15:50:20 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C25761028 for ; Wed, 26 May 2021 15:50:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C25761028 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FqwQ20fNkz300Q for ; Thu, 27 May 2021 01:50:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=K4fhmDmY; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=google.com (client-ip=2607:f8b0:4864:20::62e; helo=mail-pl1-x62e.google.com; envelope-from=wltu@google.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=K4fhmDmY; dkim-atps=neutral Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FqwPR6zbyz2y6B for ; Thu, 27 May 2021 01:49:47 +1000 (AEST) Received: by mail-pl1-x62e.google.com with SMTP id d20so812928pls.13 for ; Wed, 26 May 2021 08:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A+7N1LTngdO4E13SPtSsb3UIZElhxwOJThqt0owbdFE=; b=K4fhmDmYW3XCaC+nTQ2vH1V5yz8M5pgdB8fF126UxH0xWCrPht/X5/pjx/rGiyeZln evwsV/hyvWJ+Wf4TWdN+Wv0Bri+AI8KNbRrD5aT/uX4hBPWrZKgt9kHmz4/zHMEzhryg gfZPT1gRMgRQea5vn9H3LBZS0gdCOrFEa96npILCWHfTji+u6h10pXZp4omT7q9gR4hN IpnKTEi5wZSQfosLzsKnn+O6OAUH8AxnoSz1+ff5g+tag0A5Zmhg4sx7+RSulnBwxXog 89ic/+OIi9r63VI0mpHLZCE82Od1IwXa8Ar2M9CyJ3dnWUFJnvmVNmHll3l4ZNuEOC+b Y6oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A+7N1LTngdO4E13SPtSsb3UIZElhxwOJThqt0owbdFE=; b=OEEdSwUmU1mC/eZBYdfUTocbGIwkku8geSm7pntZY5S1xulvi7sG4PzXQOkhwSBdEa lC2t+mOlw3thKw9Q9UEDzWaQyNOHGHIrwQG3gQ4+YHZZdCfLfDTell8uD5kCw4UYrcsT OPoBrD8X7OCB+Gv7KC8DpwuRR83K0zbAf41Z3sKtafC1Sk8p+1IzawiooggRXvBxHCCw EgXAFWzOoJ5pO/v3RS8c4N2ok1neUMSf/N/EA3W436tmP5SUGYVCd8nt+W/5fflywn26 94t2F3GWWH4zHTmaWq64A9HRttPxCdtUesz0u5qC0dqTOdQLaWVgm7yFlfVQtOopaKQx GwPw== X-Gm-Message-State: AOAM532rtmMlE4zlJ54VxR3Ydy691cD5I1LFJA6pqWcEVg8mnnzTy9HD 0RPUV5HXB6JsO+zdJtLdGHTZHP2aX3lJU3kNbdW0Jw== X-Google-Smtp-Source: ABdhPJyexezYbAFdao7C4zTyo1DPsCqDilfO9SIh8ptU+2tzkuKB13YoOGcZXFO1ieulvidcMN4ZXBryl8wIMAHWPr4= X-Received: by 2002:a17:902:c104:b029:ef:836e:15d6 with SMTP id 4-20020a170902c104b02900ef836e15d6mr36723034pli.39.1622044184606; Wed, 26 May 2021 08:49:44 -0700 (PDT) MIME-Version: 1.0 References: <20210413161150.2815450-1-wltu@google.com> In-Reply-To: From: Willy Tu Date: Wed, 26 May 2021 08:49:33 -0700 Message-ID: Subject: Re: [PATCH] board: ast2400: Enable SGPIO in SCU To: Joel Stanley Content-Type: multipart/alternative; boundary="0000000000006f805605c33d9770" X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: OpenBMC Maillist , Benjamin Fair Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" --0000000000006f805605c33d9770 Content-Type: text/plain; charset="UTF-8" ping On Tue, Apr 13, 2021 at 5:06 PM Willy Tu wrote: > Hi Joel, > > thanks for the response. > > Sorry, I did not update the patch to include the branch name. I'll be more > careful next time. > > This change should be in `v2019.04-aspeed-openbmc` and the other patch in > https://lore.kernel.org/openbmc/20210413161238.2816187-1-wltu@google.com/ should > be in `v2016.07-aspeed-openbmc`. > > I have not tested this change, but have tested > https://lore.kernel.org/openbmc/20210413161238.2816187-1-wltu@google.com/ that > I based off of (Which I have tested with my setup). Will that be an issue? > > Best, > > Willy Tu > > On Tue, Apr 13, 2021 at 4:32 PM Joel Stanley wrote: > >> Hi Willy, >> >> On Tue, 13 Apr 2021 at 16:11, Willy Tu wrote: >> > >> > Add option to enable register for SGPIO in SCU. >> > >> > Included new function register values for ast2400 >> > SCU and enable the SGPIO function in board init. >> >> Which branch would you like this patch applied to? >> >> > >> > Signed-off-by: Willy Tu >> > --- >> > arch/arm/include/asm/arch-aspeed/scu_ast2400.h | 4 ++++ >> > arch/arm/mach-aspeed/ast2400/Kconfig | 4 ++++ >> > arch/arm/mach-aspeed/ast2400/board_common.c | 15 +++++++++++++++ >> > 3 files changed, 23 insertions(+) >> > >> > diff --git a/arch/arm/include/asm/arch-aspeed/scu_ast2400.h >> b/arch/arm/include/asm/arch-aspeed/scu_ast2400.h >> > index 9c5d96ae84..17eaaf3e9d 100644 >> > --- a/arch/arm/include/asm/arch-aspeed/scu_ast2400.h >> > +++ b/arch/arm/include/asm/arch-aspeed/scu_ast2400.h >> > @@ -75,6 +75,10 @@ >> > #define SCU_PIN_FUN_SCL2 (1 << 14) >> > #define SCU_PIN_FUN_SDA1 (1 << 13) >> > #define SCU_PIN_FUN_SDA2 (1 << 15) >> > +#define SCU_PIN_FUN_SGPMCK (0x1 << 8) >> > +#define SCU_PIN_FUN_SGPMLD (0x1 << 9) >> > +#define SCU_PIN_FUN_SGPMO (0x1 << 10) >> > +#define SCU_PIN_FUN_SGPMI (0x1 << 11) >> > >> > #define SCU_D2PLL_EXT1_OFF (1 << 0) >> > #define SCU_D2PLL_EXT1_BYPASS (1 << 1) >> > diff --git a/arch/arm/mach-aspeed/ast2400/Kconfig >> b/arch/arm/mach-aspeed/ast2400/Kconfig >> > index f76276860c..c4e88b5140 100644 >> > --- a/arch/arm/mach-aspeed/ast2400/Kconfig >> > +++ b/arch/arm/mach-aspeed/ast2400/Kconfig >> > @@ -17,6 +17,10 @@ config TARGET_EVB_AST2400 >> > 20 pin JTAG, pinouts for 14 I2Cs, 3 SPIs and eSPI, 8 PWMs. >> > endchoice >> > >> > +config ENABLE_SGPIO >> > + tristate "Enable SGPIO in SCU" >> > + default n >> > + >> > source "board/aspeed/evb_ast2400/Kconfig" >> > >> > endif >> > diff --git a/arch/arm/mach-aspeed/ast2400/board_common.c >> b/arch/arm/mach-aspeed/ast2400/board_common.c >> > index 3829b06934..eca2ef03e5 100644 >> > --- a/arch/arm/mach-aspeed/ast2400/board_common.c >> > +++ b/arch/arm/mach-aspeed/ast2400/board_common.c >> > @@ -14,6 +14,21 @@ __weak int board_init(void) >> > { >> > gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; >> > >> > +#ifdef CONFIG_ENABLE_SGPIO >> > +#define SCU_BASE 0x1e6e2000 >> > +#define SCU_FUN_PIN_CTRL2 0x84 /* Multi-function Pin Control#2*/ >> > + /* Unlock SCU */ >> > + writel(SCU_UNLOCK_VALUE, SCU_BASE); >> > + >> > + /* Enable SGPIO Master */ >> > + u32 reg = readl(SCU_BASE + SCU_FUN_PIN_CTRL2); >> > + >> > + reg |= (SCU_PIN_FUN_SGPMI | >> > + SCU_PIN_FUN_SGPMO | >> > + SCU_PIN_FUN_SGPMLD | >> > + SCU_PIN_FUN_SGPMCK); >> > + writel(reg, SCU_BASE + SCU_FUN_PIN_CTRL2); >> > +#endif >> > return 0; >> > } >> > >> > -- >> > 2.31.1.295.g9ea45b61b8-goog >> > >> > --0000000000006f805605c33d9770 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
ping

On Tue, Apr 13, 2021 at 5:06 PM Willy Tu <wltu@google.com> wrote:
Hi Joel,
thanks for the response.

Sorry, I did not u= pdate the patch to include the branch name. I'll be more careful next t= ime.

This change should be in `v2019.04-aspeed= -openbmc` and the other patch in=C2=A0https://= lore.kernel.org/openbmc/20210413161238.2816187-1-wltu@google.com/=C2=A0= should be in `v2016.07-aspeed-openbmc`.

I have not= tested this change, but have tested=C2=A0=C2=A0https://lore.kernel.org/openbmc/20210413161238.2816187-1-wltu@google.com/= =C2=A0that I based off of (Which I have tested with my setup). Will tha= t be an issue?

Best,

Will= y Tu

On Tue, Apr 13, 2021 at 4:32 PM Joel Stanley <joel@jms.id.au> wrote:
=
Hi Willy,

On Tue, 13 Apr 2021 at 16:11, Willy Tu <wltu@google.com> wrote:
>
> Add option to enable register for SGPIO in SCU.
>
> Included new function register values for ast2400
> SCU and enable the SGPIO function in board init.

Which branch would you like this patch applied to?

>
> Signed-off-by: Willy Tu <wltu@google.com>
> ---
>=C2=A0 arch/arm/include/asm/arch-aspeed/scu_ast2400.h |=C2=A0 4 ++++ >=C2=A0 arch/arm/mach-aspeed/ast2400/Kconfig=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0|=C2=A0 4 ++++
>=C2=A0 arch/arm/mach-aspeed/ast2400/board_common.c=C2=A0 =C2=A0 | 15 ++= +++++++++++++
>=C2=A0 3 files changed, 23 insertions(+)
>
> diff --git a/arch/arm/include/asm/arch-aspeed/scu_ast2400.h b/arch/arm= /include/asm/arch-aspeed/scu_ast2400.h
> index 9c5d96ae84..17eaaf3e9d 100644
> --- a/arch/arm/include/asm/arch-aspeed/scu_ast2400.h
> +++ b/arch/arm/include/asm/arch-aspeed/scu_ast2400.h
> @@ -75,6 +75,10 @@
>=C2=A0 #define SCU_PIN_FUN_SCL2=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(1 << 14)
>=C2=A0 #define SCU_PIN_FUN_SDA1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(1 << 13)
>=C2=A0 #define SCU_PIN_FUN_SDA2=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(1 << 15)
> +#define SCU_PIN_FUN_SGPMCK=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(0x1 << 8)
> +#define SCU_PIN_FUN_SGPMLD=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(0x1 << 9)
> +#define SCU_PIN_FUN_SGPMO=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (0x1 << 10)
> +#define SCU_PIN_FUN_SGPMI=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (0x1 << 11)
>
>=C2=A0 #define SCU_D2PLL_EXT1_OFF=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(1 << 0)
>=C2=A0 #define SCU_D2PLL_EXT1_BYPASS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = (1 << 1)
> diff --git a/arch/arm/mach-aspeed/ast2400/Kconfig b/arch/arm/mach-aspe= ed/ast2400/Kconfig
> index f76276860c..c4e88b5140 100644
> --- a/arch/arm/mach-aspeed/ast2400/Kconfig
> +++ b/arch/arm/mach-aspeed/ast2400/Kconfig
> @@ -17,6 +17,10 @@ config TARGET_EVB_AST2400
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A020 pin JTAG, pinouts for 14 I2= Cs, 3 SPIs and eSPI, 8 PWMs.
>=C2=A0 endchoice
>
> +config ENABLE_SGPIO
> +=C2=A0 =C2=A0 tristate "Enable SGPIO in SCU"
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0default n
> +
>=C2=A0 source "board/aspeed/evb_ast2400/Kconfig"
>
>=C2=A0 endif
> diff --git a/arch/arm/mach-aspeed/ast2400/board_common.c b/arch/arm/ma= ch-aspeed/ast2400/board_common.c
> index 3829b06934..eca2ef03e5 100644
> --- a/arch/arm/mach-aspeed/ast2400/board_common.c
> +++ b/arch/arm/mach-aspeed/ast2400/board_common.c
> @@ -14,6 +14,21 @@ __weak int board_init(void)
>=C2=A0 {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gd->bd->bi_boot_params =3D CONF= IG_SYS_SDRAM_BASE + 0x100;
>
> +#ifdef CONFIG_ENABLE_SGPIO
> +#define SCU_BASE 0x1e6e2000
> +#define SCU_FUN_PIN_CTRL2 0x84 /* Multi-function Pin Control#2*/
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Unlock SCU */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0writel(SCU_UNLOCK_VALUE, SCU_BASE);
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Enable SGPIO Master */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0u32 reg =3D readl(SCU_BASE + SCU_FUN_PIN_C= TRL2);
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0reg |=3D (SCU_PIN_FUN_SGPMI=C2=A0 |
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0SCU_PIN_FUN_SGPMO=C2=A0 |
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0SCU_PIN_FUN_SGPMLD |
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0SCU_PIN_FUN_SGPMCK);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0writel(reg, SCU_BASE + SCU_FUN_PIN_CTRL2);=
> +#endif
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
>=C2=A0 }
>
> --
> 2.31.1.295.g9ea45b61b8-goog
>
--0000000000006f805605c33d9770--