Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1581077 > unrolled thread
| Started by | Rick Altherr <raltherr@google.com> |
|---|---|
| First post | 2017-02-15 07:10 +0100 |
| Last post | 2017-02-23 15:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH linux] aspeed: pinctrl: Allow disabling Port D and Port E loopback mode Rick Altherr <raltherr@google.com> - 2017-02-15 07:10 +0100
Re: [PATCH linux] aspeed: pinctrl: Allow disabling Port D and Port E loopback mode Linus Walleij <linus.walleij@linaro.org> - 2017-02-23 15:50 +0100
| From | Rick Altherr <raltherr@google.com> |
|---|---|
| Date | 2017-02-15 07:10 +0100 |
| Subject | [PATCH linux] aspeed: pinctrl: Allow disabling Port D and Port E loopback mode |
| Message-ID | <tb0WR-4oq-1@gated-at.bofh.it> |
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> --- 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 76f62bd45f02..5b49952e5fad 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.11.0.483.g087da7b7c-goog
[toc] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-02-23 15:50 +0100 |
| Subject | Re: [PATCH linux] aspeed: pinctrl: Allow disabling Port D and Port E loopback mode |
| Message-ID | <te2Su-2AJ-9@gated-at.bofh.it> |
| In reply to | #1581077 |
On Wed, Feb 15, 2017 at 7:09 AM, Rick Altherr <raltherr@google.com> wrote: > 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> Patch applied with the ACKs for v4.12. Yours, Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web