* [PATCH linux dev-4.10 0/1] pinctrl: aspeed: Allow disabling Port D and Port E loopback mode
@ 2017-12-04 8:30 Yong Li
2017-12-04 8:30 ` [PATCH linux dev-4.10 1/1] " Yong Li
2017-12-05 0:42 ` [PATCH linux dev-4.10 0/1] " Joel Stanley
0 siblings, 2 replies; 4+ messages in thread
From: Yong Li @ 2017-12-04 8:30 UTC (permalink / raw)
To: andrew, openbmc; +Cc: yong.b.li
Backport pinctrl patch from kernel 4.12
This patch is used to control the pass-through functions for GPIOE/GPIOD
It is included in kernel V4.12:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c825676b0823fd43a4d08bf865f81bb188b51db1
Rick Altherr (1):
pinctrl: aspeed: Allow disabling Port D and Port E loopback mode
drivers/pinctrl/aspeed/pinctrl-aspeed.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH linux dev-4.10 1/1] pinctrl: aspeed: Allow disabling Port D and Port E loopback mode
2017-12-04 8:30 [PATCH linux dev-4.10 0/1] pinctrl: aspeed: Allow disabling Port D and Port E loopback mode Yong Li
@ 2017-12-04 8:30 ` Yong Li
2017-12-05 0:42 ` [PATCH linux dev-4.10 0/1] " Joel Stanley
1 sibling, 0 replies; 4+ messages in thread
From: Yong Li @ 2017-12-04 8:30 UTC (permalink / raw)
To: andrew, openbmc; +Cc: yong.b.li, Rick Altherr
From: Rick Altherr <raltherr@google.com>
Port D and port E GPIO loopback modes are commonly enabled via hardware
straps for use with front-panel buttons. When the BMC is powered
off or fails to boot, the front-panel buttons are directly connected to
the host chipset via the loopback to allow direct power-on and reset
control. Once the BMC has booted, the loopback mode must be disabled for
the BMC to take over control of host power-on and reset.
Disabling these loopback modes requires writing to the hardware strap
register which violates the current design of assuming the system
designer chose the strap settings for a specific reason and they should
be treated as read-only. Only the two bits of the strap register related
to these loopback modes are allowed to be written and comments have been
added to explain why.
Signed-off-by: Rick Altherr <raltherr@google.com>
Acked-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/aspeed/pinctrl-aspeed.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
index 3dcf825..a86a4d6 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
@@ -198,9 +198,19 @@ static int aspeed_sig_expr_set(const struct aspeed_sig_expr *expr,
* them. This may mean that certain functions cannot be
* deconfigured and is the reason we re-evaluate after writing
* all descriptor bits.
+ *
+ * Port D and port E GPIO loopback modes are the only exception
+ * as those are commonly used with front-panel buttons to allow
+ * normal operation of the host when the BMC is powered off or
+ * fails to boot. Once the BMC has booted, the loopback mode
+ * must be disabled for the BMC to control host power-on and
+ * reset.
*/
- if ((desc->reg == HW_STRAP1 || desc->reg == HW_STRAP2) &&
- desc->ip == ASPEED_IP_SCU)
+ if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP1 &&
+ !(desc->mask & (BIT(21) | BIT(22))))
+ continue;
+
+ if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP2)
continue;
ret = regmap_update_bits(maps[desc->ip], desc->reg,
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH linux dev-4.10 0/1] pinctrl: aspeed: Allow disabling Port D and Port E loopback mode
2017-12-04 8:30 [PATCH linux dev-4.10 0/1] pinctrl: aspeed: Allow disabling Port D and Port E loopback mode Yong Li
2017-12-04 8:30 ` [PATCH linux dev-4.10 1/1] " Yong Li
@ 2017-12-05 0:42 ` Joel Stanley
2017-12-05 0:56 ` Yong Li
1 sibling, 1 reply; 4+ messages in thread
From: Joel Stanley @ 2017-12-05 0:42 UTC (permalink / raw)
To: Yong Li; +Cc: Andrew Jeffery, OpenBMC Maillist
On Mon, Dec 4, 2017 at 7:00 PM, Yong Li <yong.b.li@linux.intel.com> wrote:
> Backport pinctrl patch from kernel 4.12
>
> This patch is used to control the pass-through functions for GPIOE/GPIOD
>
> It is included in kernel V4.12:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c825676b0823fd43a4d08bf865f81bb188b51db1
Thanks. I've backported this to 4.10, as well as the "pinctrl: aspeed:
Fix ast2500 strap register write logic" that you submitted (and
Andrew's fix "pinctrl: aspeed: Allow disabling Port D and Port E
loopback mode").
Cheers,
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH linux dev-4.10 0/1] pinctrl: aspeed: Allow disabling Port D and Port E loopback mode
2017-12-05 0:42 ` [PATCH linux dev-4.10 0/1] " Joel Stanley
@ 2017-12-05 0:56 ` Yong Li
0 siblings, 0 replies; 4+ messages in thread
From: Yong Li @ 2017-12-05 0:56 UTC (permalink / raw)
To: 'Joel Stanley'
Cc: 'Andrew Jeffery', 'OpenBMC Maillist'
Thanks Joel!
-----Original Message-----
From: joel.stan@gmail.com [mailto:joel.stan@gmail.com] On Behalf Of Joel Stanley
Sent: Tuesday, December 5, 2017 8:43 AM
To: Yong Li <yong.b.li@linux.intel.com>
Cc: Andrew Jeffery <andrew@aj.id.au>; OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH linux dev-4.10 0/1] pinctrl: aspeed: Allow disabling Port D and Port E loopback mode
On Mon, Dec 4, 2017 at 7:00 PM, Yong Li <yong.b.li@linux.intel.com> wrote:
> Backport pinctrl patch from kernel 4.12
>
> This patch is used to control the pass-through functions for
> GPIOE/GPIOD
>
> It is included in kernel V4.12:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/com
> mit/?id=c825676b0823fd43a4d08bf865f81bb188b51db1
Thanks. I've backported this to 4.10, as well as the "pinctrl: aspeed:
Fix ast2500 strap register write logic" that you submitted (and Andrew's fix "pinctrl: aspeed: Allow disabling Port D and Port E loopback mode").
Cheers,
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-05 0:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04 8:30 [PATCH linux dev-4.10 0/1] pinctrl: aspeed: Allow disabling Port D and Port E loopback mode Yong Li
2017-12-04 8:30 ` [PATCH linux dev-4.10 1/1] " Yong Li
2017-12-05 0:42 ` [PATCH linux dev-4.10 0/1] " Joel Stanley
2017-12-05 0:56 ` Yong Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.