From: Yu-Che Hsieh <yc_hsieh@aspeedtech.com>
To: Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"Joel Stanley" <joel@jms.id.au>,
Andrew Jeffery <andrew@codeconstruct.com.au>,
Chia-Wei Wang <chiawei_wang@aspeedtech.com>,
Corey Minyard <corey@minyard.net>
Cc: Andrew Jeffery <andrew@aj.id.au>, <devicetree@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-aspeed@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
<openipmi-developer@lists.sourceforge.net>,
<jammy_huang@aspeedtech.com>,
Yu-Che Hsieh <yc_hsieh@aspeedtech.com>
Subject: [PATCH v2 0/2] ipmi: kcs_bmc_aspeed: Support multiple LPC controller instances
Date: Thu, 13 Aug 2026 14:42:30 +0800 [thread overview]
Message-ID: <20260813-upstream_kcs_multiple_lpc-v2-0-775b1db3fe95@aspeedtech.com> (raw)
Hi,
Aspeed AST2700 SoC exposes more than one physical LPC controller
instance. Each instance provides its own KCS1-KCS4 devices, with
identical IDR/ODR/STR register offsets within that controller's register
file.
kcs_bmc_device::channel currently serves two purposes at once:
1. Selecting which HICR0/HICR2/HICRB bit-group to touch within a single
LPC controller's register file. aspeed_kcs_of_get_channel() derives
this purely from the KCS node's register offset, yielding values
1..4.
2. Naming the misc chardev (/dev/ipmi-kcsN) exposed to userspace, which
must be unique system-wide. kcs_bmc_cdev_ipmi.c uses "ipmi-kcs%u".
Both happen to be the same value only because this driver has only ever
had to support SoCs with a single LPC controller. On AST2700, KCS1 on
each LPC controller computes to the same channel number, and whichever
instance probes second fails due to the duplicate miscdevice name.
This series keeps a driver-private channel value (1..4) in struct
aspeed_kcs_bmc for register access, and computes a globally unique
kcs_bmc_device::channel as:
bank * KCS_CHANNEL_MAX + channel
where bank identifies which LPC controller instance a KCS device belongs
to.
bank is derived via of_alias_get_id() from an optional "lpcN" alias on
the LPC controller node, mirroring the existing alias-based numbering
convention used by mmc/i2c/spi/serial. For example, with aliases
assigning lpc0 and lpc1 to banks 0 and 1, their KCS channels are exposed
as /dev/ipmi-kcs1..4 and /dev/ipmi-kcs5..8 respectively. If no lpcN
alias is present, of_alias_get_id() fails and the driver uses bank 0,
preserving the existing numbering for single-LPC-controller systems.
This puts the numbering under DT-author control instead of deriving it
from probe order or DT traversal order. It also generalizes across
however many LPC-compatible instances a future SoC exposes, regardless
of tree placement, while preserving compatibility for existing
single-LPC-controller boards.
Changes in v2:
- Drop the RFC tag, per Lee Jones' feedback.
- Keep the alias-based bank-numbering approach unchanged.
Link to v1: https://lore.kernel.org/r/20260723-upstream_kcs_multiple_lpc-v1-0-d918b5270b86@aspeedtech.com
---
Yu-Che Hsieh (2):
dt-bindings: mfd: aspeed-lpc: Document lpcN alias for multi-instance SoCs
ipmi: kcs_bmc_aspeed: Support multiple LPC controller instances
.../devicetree/bindings/mfd/aspeed-lpc.yaml | 7 ++++
drivers/char/ipmi/kcs_bmc_aspeed.c | 37 ++++++++++++++++------
2 files changed, 34 insertions(+), 10 deletions(-)
---
base-commit: f0e6f20cb52b14c2c441f04e21cef0c95d498cac
change-id: 20260722-upstream_kcs_multiple_lpc-735942211508
Best regards,
--
Yu-Che Hsieh <yc_hsieh@aspeedtech.com>
next reply other threads:[~2026-08-13 6:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 6:42 Yu-Che Hsieh [this message]
2026-08-13 6:42 ` [PATCH v2 1/2] dt-bindings: mfd: aspeed-lpc: Document lpcN alias for multi-instance SoCs Yu-Che Hsieh
2026-08-17 7:16 ` Krzysztof Kozlowski
2026-08-13 6:42 ` [PATCH v2 2/2] ipmi: kcs_bmc_aspeed: Support multiple LPC controller instances Yu-Che Hsieh
2026-08-17 7:16 ` Krzysztof Kozlowski
2026-08-18 7:59 ` YC Hsieh
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=20260813-upstream_kcs_multiple_lpc-v2-0-775b1db3fe95@aspeedtech.com \
--to=yc_hsieh@aspeedtech.com \
--cc=andrew@aj.id.au \
--cc=andrew@codeconstruct.com.au \
--cc=chiawei_wang@aspeedtech.com \
--cc=conor+dt@kernel.org \
--cc=corey@minyard.net \
--cc=devicetree@vger.kernel.org \
--cc=jammy_huang@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=robh@kernel.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
all inboxes | Powered by JetHome®