openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Willy Tu <wltu@google.com>
To: Joel Stanley <joel@jms.id.au>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>,
	Benjamin Fair <benjaminfair@google.com>
Subject: Re: [PATCH] board: ast2400: Enable SGPIO in SCU
Date: Wed, 26 May 2021 20:14:30 -0700	[thread overview]
Message-ID: <CAHwn2Xm7gRa2-YF=OazW3DcKr0RLk6CuTe8b=Bs2HTwhr60Vtw@mail.gmail.com> (raw)
In-Reply-To: <CACPK8XcfnYz9LH2eScKhiEAi1w76YPpJNUk+kjqYN1sEcGMjSw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6431 bytes --]

On Wed, May 26, 2021 at 6:57 PM Joel Stanley <joel@jms.id.au> wrote:

> On Wed, 14 Apr 2021 at 00:06, Willy Tu <wltu@google.com> 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`.
>
> Okay.
>
> > 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?
>
> What branch are you using for your system?
>
> I strongly encourage you to use the 2019.04 branch if at all possible.
>
> Some review below.
>

The system that I was using was based on v2016.07-aspeed-openbmc . It is an
old system and we don't plan on migrating the u-boot version for it. We
don't have any system that is using aspeed other than this one.


>
> > 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>
> >> > ---
> >> >  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
>
> Note that this is the default default in kconfig, you only need to
> specify a default if you want some other behaviour.
>
> >> > @@ -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
>
> Here's what I saw when attempting to compile test your patch:
>
> In file included from ../arch/arm/mach-aspeed/ast2400/board_common.c:6:
> ../arch/arm/mach-aspeed/ast2400/board_common.c: In function ‘board_init’:
> ../arch/arm/mach-aspeed/ast2400/board_common.c:21:16: error:
> ‘SCU_UNLOCK_VALUE’ undeclared (first use in this function)
>    21 |         writel(SCU_UNLOCK_VALUE, SCU_BASE);
>       |                ^~~~~~~~~~~~~~~~
> ../arch/arm/include/asm/io.h:117:38: note: in definition of macro ‘writel’
>   117 | #define writel(v,c)     ({ u32 __v = v; __iowmb();
> __arch_putl(__v,c); __v; })
>       |                                      ^
> ../arch/arm/mach-aspeed/ast2400/board_common.c:21:16: note: each
> undeclared identifier is reported only once for each function it
> appears in
>    21 |         writel(SCU_UNLOCK_VALUE, SCU_BASE);
>       |                ^~~~~~~~~~~~~~~~
> ../arch/arm/include/asm/io.h:117:38: note: in definition of macro ‘writel’
>   117 | #define writel(v,c)     ({ u32 __v = v; __iowmb();
> __arch_putl(__v,c); __v; })
>       |                                      ^
> ../arch/arm/mach-aspeed/ast2400/board_common.c:26:17: error:
> ‘SCU_PIN_FUN_SGPMI’ undeclared (first use in this function)
>    26 |         reg |= (SCU_PIN_FUN_SGPMI  |
>       |                 ^~~~~~~~~~~~~~~~~
> ../arch/arm/mach-aspeed/ast2400/board_common.c:27:25: error:
> ‘SCU_PIN_FUN_SGPMO’ undeclared (first use in this function)
>    27 |                         SCU_PIN_FUN_SGPMO  |
>       |                         ^~~~~~~~~~~~~~~~~
> ../arch/arm/mach-aspeed/ast2400/board_common.c:28:25: error:
> ‘SCU_PIN_FUN_SGPMLD’ undeclared (first use in this function)
>    28 |                         SCU_PIN_FUN_SGPMLD |
>       |                         ^~~~~~~~~~~~~~~~~~
> ../arch/arm/mach-aspeed/ast2400/board_common.c:29:25: error:
> ‘SCU_PIN_FUN_SGPMCK’ undeclared (first use in this function)
>    29 |                         SCU_PIN_FUN_SGPMCK);
>       |                         ^~~~~~~~~~~~~~~~~~
>
>
> >> >         return 0;
> >> >  }
> >> >
> >> > --
> >> > 2.31.1.295.g9ea45b61b8-goog
> >> >
>

Thanks for the feedback. I'll address the issue and apply a new patch.

Willy Tu

[-- Attachment #2: Type: text/html, Size: 8727 bytes --]

      reply	other threads:[~2021-05-27  3:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 16:11 [PATCH] board: ast2400: Enable SGPIO in SCU Willy Tu
2021-04-13 23:32 ` Joel Stanley
2021-04-14  0:06   ` Willy Tu
2021-05-26 15:49     ` Willy Tu
2021-05-27  1:57     ` Joel Stanley
2021-05-27  3:14       ` Willy Tu [this message]

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='CAHwn2Xm7gRa2-YF=OazW3DcKr0RLk6CuTe8b=Bs2HTwhr60Vtw@mail.gmail.com' \
    --to=wltu@google.com \
    --cc=benjaminfair@google.com \
    --cc=joel@jms.id.au \
    --cc=openbmc@lists.ozlabs.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).