From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Sanket.Goswami@amd.com, linux-i3c@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v3 2/5] i3c: master: Add ACPI support to i3c subsystem
Date: Wed, 13 Nov 2024 11:42:33 +0200 [thread overview]
Message-ID: <1ad5f698-725a-4779-ad5d-936ae8cbab14@linux.intel.com> (raw)
In-Reply-To: <20241108073323.523805-3-Shyam-sundar.S-k@amd.com>
Hi
On 11/8/24 9:33 AM, Shyam Sundar S K wrote:
> As of now, the I3C subsystem only has ARM-specific initialization, and
> there is no corresponding ACPI plumbing present. To address this, ACPI
> support needs to be added to both the I3C core and DW driver.
>
> Add support to get the ACPI handle from the _HID probed and parse the apci
> object to retrieve the slave information from BIOS.
>
> Based on the acpi object information propogated via BIOS, build the i3c
> board information so that the same information can be used across the
> driver to handle the slave requests.
>
> Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com>
> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
> Cc: linux-acpi@vger.kernel.org
>
> drivers/i3c/internals.h | 3 ++
> drivers/i3c/master.c | 84 ++++++++++++++++++++++++++++++
> drivers/i3c/master/dw-i3c-master.c | 7 +++
> include/linux/i3c/master.h | 1 +
> 4 files changed, 95 insertions(+)
>
> diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h
> index 433f6088b7ce..178bc0ebe6b6 100644
> --- a/drivers/i3c/internals.h
> +++ b/drivers/i3c/internals.h
> @@ -10,6 +10,9 @@
>
> #include <linux/i3c/master.h>
>
> +#define I3C_GET_PID 0x08
> +#define I3C_GET_ADDR 0x7F
> +
> void i3c_bus_normaluse_lock(struct i3c_bus *bus);
> void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 6f3eb710a75d..0ceef2aa9161 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -2251,6 +2251,84 @@ static int of_i3c_master_add_dev(struct i3c_master_controller *master,
> return ret;
> }
>
> +#if IS_ENABLED(CONFIG_ACPI)
> +static int i3c_acpi_configure_master(struct i3c_master_controller *master)
> +{
> + struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL};
> + enum i3c_addr_slot_status addrstatus;
> + struct i3c_dev_boardinfo *boardinfo;
> + struct device *dev = &master->dev;
> + struct fwnode_handle *fwnode;
> + struct acpi_device *adev;
> + u32 slv_addr, num_dev;
> + acpi_status status;
> + u64 val;
> +
> + status = acpi_evaluate_object_typed(master->ahandle, "_DSD", NULL, &buf, ACPI_TYPE_PACKAGE);
> + if (ACPI_FAILURE(status)) {
> + dev_err(&master->dev, "Error reading _DSD:%s\n", acpi_format_exception(status));
> + return -ENODEV;
> + }
> +
> + num_dev = device_get_child_node_count(dev);
> + if (!num_dev) {
> + dev_err(&master->dev, "Error: no child node present\n");
> + return -EINVAL;
> + }
> +
I didn't notice earlier these cause host controller registration to fail
and thus regression on platforms where DSDT doesn't have these optional
information for the host controller.
next prev parent reply other threads:[~2024-11-13 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241108073323.523805-1-Shyam-sundar.S-k@amd.com>
2024-11-08 7:33 ` [PATCH v3 2/5] i3c: master: Add ACPI support to i3c subsystem Shyam Sundar S K
2024-11-12 15:17 ` Jarkko Nikula
2024-11-13 9:42 ` Jarkko Nikula [this message]
2024-11-13 14:21 ` Heikki Krogerus
2024-11-14 4:33 ` Shyam Sundar S K
2024-11-14 7:56 ` Alexandre Belloni
2024-11-14 11:04 ` Shyam Sundar S K
2024-11-14 8:00 ` Jarkko Nikula
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=1ad5f698-725a-4779-ad5d-936ae8cbab14@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=Sanket.Goswami@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.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