openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH u-boot v2016.07-aspeed-openbmc] board: aspeed: Enable SGPIO in SCU
@ 2021-03-31 21:31 Willy Tu
  2021-03-31 21:32 ` Willy Tu
  0 siblings, 1 reply; 5+ messages in thread
From: Willy Tu @ 2021-03-31 21:31 UTC (permalink / raw)
  To: OpenBMC Maillist; +Cc: Benjamin Fair

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

From a2d7336bb59df8f2ef622d4369fc035b2aafd74c Mon Sep 17 00:00:00 2001
From: Willy Tu <wltu@google.com>
Date: Mon, 22 Mar 2021 17:01:56 -0700
Subject: [PATCH] board: aspeed: Enable SGPIO in SCU

Add option to enable register for SGPIO in SCU

Signed-off-by: Willy Tu <wltu@google.com>
---
 board/aspeed/ast-g4/Kconfig  |  4 ++++
 board/aspeed/ast-g4/ast-g4.c | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/board/aspeed/ast-g4/Kconfig b/board/aspeed/ast-g4/Kconfig
index 2bec9a733a..e78030ae34 100644
--- a/board/aspeed/ast-g4/Kconfig
+++ b/board/aspeed/ast-g4/Kconfig
@@ -19,4 +19,8 @@ config SYS_CONFIG_NAME
  default "ast-g4-phy" if ASPEED_NET_PHY
  default "ast-g4-ncsi" if ASPEED_NET_NCSI

+config ENABLE_SGPIO
+    tristate "Enable SGPIO in SCU"
+ default n
+
 endif
diff --git a/board/aspeed/ast-g4/ast-g4.c b/board/aspeed/ast-g4/ast-g4.c
index 656495307b..e2463d4524 100644
--- a/board/aspeed/ast-g4/ast-g4.c
+++ b/board/aspeed/ast-g4/ast-g4.c
@@ -22,6 +22,19 @@ int board_init(void)
  /* address of boot parameters */
  gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
  gd->flags = 0;
+
+#ifdef CONFIG_ENABLE_SGPIO
+ /* Unlock SCU */
+ writel(SCU_PROTECT_UNLOCK, AST_SCU_BASE);
+
+ /* Enable SGPIO Master */
+ u32 reg = readl(AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
+ reg |= (SCU_FUN_PIN_SGPMI |
+ SCU_FUN_PIN_SGPMO |
+ SCU_FUN_PIN_SGPMLD |
+ SCU_FUN_PIN_SGPMCK);
+ writel(reg, AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
+#endif
  return 0;
 }

-- 
2.31.0.208.g409f899ff0-goog

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH u-boot v2016.07-aspeed-openbmc] board: aspeed: Enable SGPIO in SCU
  2021-03-31 21:31 [PATCH u-boot v2016.07-aspeed-openbmc] board: aspeed: Enable SGPIO in SCU Willy Tu
@ 2021-03-31 21:32 ` Willy Tu
  2021-03-31 22:50   ` Joel Stanley
  0 siblings, 1 reply; 5+ messages in thread
From: Willy Tu @ 2021-03-31 21:32 UTC (permalink / raw)
  To: OpenBMC Maillist; +Cc: Benjamin Fair

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

I am not exactly sure if this is the way to send the patch for u-boot. But
I am trying to update a patch for
https://github.com/openbmc/u-boot/tree/v2016.07-aspeed-openbmc.

It just gives the options to have the u-boot enable the SGPIO registers for
SCU.

Please take a look.

Best,

Willy Tu

On Wed, Mar 31, 2021 at 2:31 PM Willy Tu <wltu@google.com> wrote:

> From a2d7336bb59df8f2ef622d4369fc035b2aafd74c Mon Sep 17 00:00:00 2001
> From: Willy Tu <wltu@google.com>
> Date: Mon, 22 Mar 2021 17:01:56 -0700
> Subject: [PATCH] board: aspeed: Enable SGPIO in SCU
>
> Add option to enable register for SGPIO in SCU
>
> Signed-off-by: Willy Tu <wltu@google.com>
> ---
>  board/aspeed/ast-g4/Kconfig  |  4 ++++
>  board/aspeed/ast-g4/ast-g4.c | 13 +++++++++++++
>  2 files changed, 17 insertions(+)
>
> diff --git a/board/aspeed/ast-g4/Kconfig b/board/aspeed/ast-g4/Kconfig
> index 2bec9a733a..e78030ae34 100644
> --- a/board/aspeed/ast-g4/Kconfig
> +++ b/board/aspeed/ast-g4/Kconfig
> @@ -19,4 +19,8 @@ config SYS_CONFIG_NAME
>   default "ast-g4-phy" if ASPEED_NET_PHY
>   default "ast-g4-ncsi" if ASPEED_NET_NCSI
>
> +config ENABLE_SGPIO
> +    tristate "Enable SGPIO in SCU"
> + default n
> +
>  endif
> diff --git a/board/aspeed/ast-g4/ast-g4.c b/board/aspeed/ast-g4/ast-g4.c
> index 656495307b..e2463d4524 100644
> --- a/board/aspeed/ast-g4/ast-g4.c
> +++ b/board/aspeed/ast-g4/ast-g4.c
> @@ -22,6 +22,19 @@ int board_init(void)
>   /* address of boot parameters */
>   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
>   gd->flags = 0;
> +
> +#ifdef CONFIG_ENABLE_SGPIO
> + /* Unlock SCU */
> + writel(SCU_PROTECT_UNLOCK, AST_SCU_BASE);
> +
> + /* Enable SGPIO Master */
> + u32 reg = readl(AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
> + reg |= (SCU_FUN_PIN_SGPMI |
> + SCU_FUN_PIN_SGPMO |
> + SCU_FUN_PIN_SGPMLD |
> + SCU_FUN_PIN_SGPMCK);
> + writel(reg, AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
> +#endif
>   return 0;
>  }
>
> --
> 2.31.0.208.g409f899ff0-goog
>
>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH u-boot v2016.07-aspeed-openbmc] board: aspeed: Enable SGPIO in SCU
  2021-03-31 21:32 ` Willy Tu
@ 2021-03-31 22:50   ` Joel Stanley
  2021-03-31 23:31     ` Willy Tu
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Stanley @ 2021-03-31 22:50 UTC (permalink / raw)
  To: Willy Tu; +Cc: OpenBMC Maillist, Benjamin Fair

Hi Willy,

On Wed, 31 Mar 2021 at 21:33, Willy Tu <wltu@google.com> wrote:
>
> I am not exactly sure if this is the way to send the patch for u-boot. But I am trying to update a patch for https://github.com/openbmc/u-boot/tree/v2016.07-aspeed-openbmc.
>
> It just gives the options to have the u-boot enable the SGPIO registers for SCU.

I strongly encourage you to bring up your new systems using a newer
u-boot tree; ASPEED's v2019.04 based SDK contains support for the
2400, 2500 and 2600 chips.

If you have already done the work to bring up v2016.07, I can merge
your fix into the v2016.07 tree. However the patch you sent is
corrupt. I recommend using git-send-email to send patches, as they
preserve whitespace in a way our email clients do not.

Cheers,

Joel

>
> Please take a look.
>
> Best,
>
> Willy Tu
>
> On Wed, Mar 31, 2021 at 2:31 PM Willy Tu <wltu@google.com> wrote:
>>
>> From a2d7336bb59df8f2ef622d4369fc035b2aafd74c Mon Sep 17 00:00:00 2001
>> From: Willy Tu <wltu@google.com>
>> Date: Mon, 22 Mar 2021 17:01:56 -0700
>> Subject: [PATCH] board: aspeed: Enable SGPIO in SCU
>>
>> Add option to enable register for SGPIO in SCU
>>
>> Signed-off-by: Willy Tu <wltu@google.com>
>> ---
>>  board/aspeed/ast-g4/Kconfig  |  4 ++++
>>  board/aspeed/ast-g4/ast-g4.c | 13 +++++++++++++
>>  2 files changed, 17 insertions(+)
>>
>> diff --git a/board/aspeed/ast-g4/Kconfig b/board/aspeed/ast-g4/Kconfig
>> index 2bec9a733a..e78030ae34 100644
>> --- a/board/aspeed/ast-g4/Kconfig
>> +++ b/board/aspeed/ast-g4/Kconfig
>> @@ -19,4 +19,8 @@ config SYS_CONFIG_NAME
>>   default "ast-g4-phy" if ASPEED_NET_PHY
>>   default "ast-g4-ncsi" if ASPEED_NET_NCSI
>>
>> +config ENABLE_SGPIO
>> +    tristate "Enable SGPIO in SCU"
>> + default n
>> +
>>  endif
>> diff --git a/board/aspeed/ast-g4/ast-g4.c b/board/aspeed/ast-g4/ast-g4.c
>> index 656495307b..e2463d4524 100644
>> --- a/board/aspeed/ast-g4/ast-g4.c
>> +++ b/board/aspeed/ast-g4/ast-g4.c
>> @@ -22,6 +22,19 @@ int board_init(void)
>>   /* address of boot parameters */
>>   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
>>   gd->flags = 0;
>> +
>> +#ifdef CONFIG_ENABLE_SGPIO
>> + /* Unlock SCU */
>> + writel(SCU_PROTECT_UNLOCK, AST_SCU_BASE);
>> +
>> + /* Enable SGPIO Master */
>> + u32 reg = readl(AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
>> + reg |= (SCU_FUN_PIN_SGPMI |
>> + SCU_FUN_PIN_SGPMO |
>> + SCU_FUN_PIN_SGPMLD |
>> + SCU_FUN_PIN_SGPMCK);
>> + writel(reg, AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
>> +#endif
>>   return 0;
>>  }
>>
>> --
>> 2.31.0.208.g409f899ff0-goog
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH u-boot v2016.07-aspeed-openbmc] board: aspeed: Enable SGPIO in SCU
  2021-03-31 22:50   ` Joel Stanley
@ 2021-03-31 23:31     ` Willy Tu
  2021-04-08  6:22       ` Willy Tu
  0 siblings, 1 reply; 5+ messages in thread
From: Willy Tu @ 2021-03-31 23:31 UTC (permalink / raw)
  To: Joel Stanley; +Cc: OpenBMC Maillist, Benjamin Fair

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

Hi Joel,

Thanks for the update.

I have tested the change in v2016.07 to bring up a system for 2400 and
verified that it works fine. I'll fix the patch with git-send-email and
hopefully can get the change merged.

I'll take a look at v2019.04 to see where I can fit this in probably in
https://github.com/openbmc/u-boot/tree/v2019.04-aspeed-openbmc/board/aspeed?
I don't think we have a system to fully test the changes for 2500 and 2600
chips. I'll look through it.

Best,

Willy Tu


On Wed, Mar 31, 2021 at 3:51 PM Joel Stanley <joel@jms.id.au> wrote:

> Hi Willy,
>
> On Wed, 31 Mar 2021 at 21:33, Willy Tu <wltu@google.com> wrote:
> >
> > I am not exactly sure if this is the way to send the patch for u-boot.
> But I am trying to update a patch for
> https://github.com/openbmc/u-boot/tree/v2016.07-aspeed-openbmc.
> >
> > It just gives the options to have the u-boot enable the SGPIO registers
> for SCU.
>
> I strongly encourage you to bring up your new systems using a newer
> u-boot tree; ASPEED's v2019.04 based SDK contains support for the
> 2400, 2500 and 2600 chips.
>
> If you have already done the work to bring up v2016.07, I can merge
> your fix into the v2016.07 tree. However the patch you sent is
> corrupt. I recommend using git-send-email to send patches, as they
> preserve whitespace in a way our email clients do not.
>
> Cheers,
>
> Joel
>
> >
> > Please take a look.
> >
> > Best,
> >
> > Willy Tu
> >
> > On Wed, Mar 31, 2021 at 2:31 PM Willy Tu <wltu@google.com> wrote:
> >>
> >> From a2d7336bb59df8f2ef622d4369fc035b2aafd74c Mon Sep 17 00:00:00 2001
> >> From: Willy Tu <wltu@google.com>
> >> Date: Mon, 22 Mar 2021 17:01:56 -0700
> >> Subject: [PATCH] board: aspeed: Enable SGPIO in SCU
> >>
> >> Add option to enable register for SGPIO in SCU
> >>
> >> Signed-off-by: Willy Tu <wltu@google.com>
> >> ---
> >>  board/aspeed/ast-g4/Kconfig  |  4 ++++
> >>  board/aspeed/ast-g4/ast-g4.c | 13 +++++++++++++
> >>  2 files changed, 17 insertions(+)
> >>
> >> diff --git a/board/aspeed/ast-g4/Kconfig b/board/aspeed/ast-g4/Kconfig
> >> index 2bec9a733a..e78030ae34 100644
> >> --- a/board/aspeed/ast-g4/Kconfig
> >> +++ b/board/aspeed/ast-g4/Kconfig
> >> @@ -19,4 +19,8 @@ config SYS_CONFIG_NAME
> >>   default "ast-g4-phy" if ASPEED_NET_PHY
> >>   default "ast-g4-ncsi" if ASPEED_NET_NCSI
> >>
> >> +config ENABLE_SGPIO
> >> +    tristate "Enable SGPIO in SCU"
> >> + default n
> >> +
> >>  endif
> >> diff --git a/board/aspeed/ast-g4/ast-g4.c b/board/aspeed/ast-g4/ast-g4.c
> >> index 656495307b..e2463d4524 100644
> >> --- a/board/aspeed/ast-g4/ast-g4.c
> >> +++ b/board/aspeed/ast-g4/ast-g4.c
> >> @@ -22,6 +22,19 @@ int board_init(void)
> >>   /* address of boot parameters */
> >>   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
> >>   gd->flags = 0;
> >> +
> >> +#ifdef CONFIG_ENABLE_SGPIO
> >> + /* Unlock SCU */
> >> + writel(SCU_PROTECT_UNLOCK, AST_SCU_BASE);
> >> +
> >> + /* Enable SGPIO Master */
> >> + u32 reg = readl(AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
> >> + reg |= (SCU_FUN_PIN_SGPMI |
> >> + SCU_FUN_PIN_SGPMO |
> >> + SCU_FUN_PIN_SGPMLD |
> >> + SCU_FUN_PIN_SGPMCK);
> >> + writel(reg, AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
> >> +#endif
> >>   return 0;
> >>  }
> >>
> >> --
> >> 2.31.0.208.g409f899ff0-goog
> >>
>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH u-boot v2016.07-aspeed-openbmc] board: aspeed: Enable SGPIO in SCU
  2021-03-31 23:31     ` Willy Tu
@ 2021-04-08  6:22       ` Willy Tu
  0 siblings, 0 replies; 5+ messages in thread
From: Willy Tu @ 2021-04-08  6:22 UTC (permalink / raw)
  To: Joel Stanley; +Cc: OpenBMC Maillist, Benjamin Fair

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

I have sent out two patches 2016 and 2019 branches. For the 2019 branch, I
only added it for ast2400 as that is what Benjamin suggested.

Please let me know if the patches have not been sent out. Maybe I'll have
to try again.

Best,

Willy Tu

On Wed, Mar 31, 2021 at 4:31 PM Willy Tu <wltu@google.com> wrote:

> Hi Joel,
>
> Thanks for the update.
>
> I have tested the change in v2016.07 to bring up a system for 2400 and
> verified that it works fine. I'll fix the patch with git-send-email and
> hopefully can get the change merged.
>
> I'll take a look at v2019.04 to see where I can fit this in probably in
> https://github.com/openbmc/u-boot/tree/v2019.04-aspeed-openbmc/board/aspeed?
> I don't think we have a system to fully test the changes for 2500 and 2600
> chips. I'll look through it.
>
> Best,
>
> Willy Tu
>
>
> On Wed, Mar 31, 2021 at 3:51 PM Joel Stanley <joel@jms.id.au> wrote:
>
>> Hi Willy,
>>
>> On Wed, 31 Mar 2021 at 21:33, Willy Tu <wltu@google.com> wrote:
>> >
>> > I am not exactly sure if this is the way to send the patch for u-boot.
>> But I am trying to update a patch for
>> https://github.com/openbmc/u-boot/tree/v2016.07-aspeed-openbmc.
>> >
>> > It just gives the options to have the u-boot enable the SGPIO registers
>> for SCU.
>>
>> I strongly encourage you to bring up your new systems using a newer
>> u-boot tree; ASPEED's v2019.04 based SDK contains support for the
>> 2400, 2500 and 2600 chips.
>>
>> If you have already done the work to bring up v2016.07, I can merge
>> your fix into the v2016.07 tree. However the patch you sent is
>> corrupt. I recommend using git-send-email to send patches, as they
>> preserve whitespace in a way our email clients do not.
>>
>> Cheers,
>>
>> Joel
>>
>> >
>> > Please take a look.
>> >
>> > Best,
>> >
>> > Willy Tu
>> >
>> > On Wed, Mar 31, 2021 at 2:31 PM Willy Tu <wltu@google.com> wrote:
>> >>
>> >> From a2d7336bb59df8f2ef622d4369fc035b2aafd74c Mon Sep 17 00:00:00 2001
>> >> From: Willy Tu <wltu@google.com>
>> >> Date: Mon, 22 Mar 2021 17:01:56 -0700
>> >> Subject: [PATCH] board: aspeed: Enable SGPIO in SCU
>> >>
>> >> Add option to enable register for SGPIO in SCU
>> >>
>> >> Signed-off-by: Willy Tu <wltu@google.com>
>> >> ---
>> >>  board/aspeed/ast-g4/Kconfig  |  4 ++++
>> >>  board/aspeed/ast-g4/ast-g4.c | 13 +++++++++++++
>> >>  2 files changed, 17 insertions(+)
>> >>
>> >> diff --git a/board/aspeed/ast-g4/Kconfig b/board/aspeed/ast-g4/Kconfig
>> >> index 2bec9a733a..e78030ae34 100644
>> >> --- a/board/aspeed/ast-g4/Kconfig
>> >> +++ b/board/aspeed/ast-g4/Kconfig
>> >> @@ -19,4 +19,8 @@ config SYS_CONFIG_NAME
>> >>   default "ast-g4-phy" if ASPEED_NET_PHY
>> >>   default "ast-g4-ncsi" if ASPEED_NET_NCSI
>> >>
>> >> +config ENABLE_SGPIO
>> >> +    tristate "Enable SGPIO in SCU"
>> >> + default n
>> >> +
>> >>  endif
>> >> diff --git a/board/aspeed/ast-g4/ast-g4.c
>> b/board/aspeed/ast-g4/ast-g4.c
>> >> index 656495307b..e2463d4524 100644
>> >> --- a/board/aspeed/ast-g4/ast-g4.c
>> >> +++ b/board/aspeed/ast-g4/ast-g4.c
>> >> @@ -22,6 +22,19 @@ int board_init(void)
>> >>   /* address of boot parameters */
>> >>   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
>> >>   gd->flags = 0;
>> >> +
>> >> +#ifdef CONFIG_ENABLE_SGPIO
>> >> + /* Unlock SCU */
>> >> + writel(SCU_PROTECT_UNLOCK, AST_SCU_BASE);
>> >> +
>> >> + /* Enable SGPIO Master */
>> >> + u32 reg = readl(AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
>> >> + reg |= (SCU_FUN_PIN_SGPMI |
>> >> + SCU_FUN_PIN_SGPMO |
>> >> + SCU_FUN_PIN_SGPMLD |
>> >> + SCU_FUN_PIN_SGPMCK);
>> >> + writel(reg, AST_SCU_BASE + AST_SCU_FUN_PIN_CTRL2);
>> >> +#endif
>> >>   return 0;
>> >>  }
>> >>
>> >> --
>> >> 2.31.0.208.g409f899ff0-goog
>> >>
>>
>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-08  6:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 21:31 [PATCH u-boot v2016.07-aspeed-openbmc] board: aspeed: Enable SGPIO in SCU Willy Tu
2021-03-31 21:32 ` Willy Tu
2021-03-31 22:50   ` Joel Stanley
2021-03-31 23:31     ` Willy Tu
2021-04-08  6:22       ` Willy Tu

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).