From: Joshua Yeong <joshua.yeong@starfivetech.com>
To: Frank Li <Frank.Li@nxp.com>
Cc: "alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
"conor.culhane@silvaco.com" <conor.culhane@silvaco.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>,
"imx@lists.linux.dev" <imx@lists.linux.dev>,
"jirislaby@kernel.org" <jirislaby@kernel.org>,
"joe@perches.com" <joe@perches.com>,
"krzysztof.kozlowski+dt@linaro.org"
<krzysztof.kozlowski+dt@linaro.org>,
"krzysztof.kozlowski@linaro.org" <krzysztof.kozlowski@linaro.org>,
"linux-i3c@lists.infradead.org" <linux-i3c@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"miquel.raynal@bootlin.com" <miquel.raynal@bootlin.com>,
"robh@kernel.org" <robh@kernel.org>,
"zbigniew.lukwinski@linux.intel.com"
<zbigniew.lukwinski@linux.intel.com>
Subject: RE: [PATCH v8 5/8] i3c: target: add svc target controller support
Date: Wed, 6 Mar 2024 16:06:11 +0000 [thread overview]
Message-ID: <SH0PR01MB08411D27D7A3CD39CDDE618FF921A@SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn> (raw)
In-Reply-To: <20240208170117.798357-6-Frank.Li@nxp.com>
Hi Frank,
Apologize I replied to the older patch series version. I copy the text from there to here instead.
> -----Original Message-----
> From: linux-i3c <linux-i3c-bounces@lists.infradead.org> On Behalf Of Frank Li
> Sent: Friday, February 9, 2024 1:01 AM
> To: frank.li@nxp.com
> Cc: alexandre.belloni@bootlin.com; conor.culhane@silvaco.com;
> devicetree@vger.kernel.org; gregkh@linuxfoundation.org;
> ilpo.jarvinen@linux.intel.com; imx@lists.linux.dev; jirislaby@kernel.org;
> joe@perches.com; krzysztof.kozlowski+dt@linaro.org;
> krzysztof.kozlowski@linaro.org; linux-i3c@lists.infradead.org; linux-
> kernel@vger.kernel.org; linux-serial@vger.kernel.org;
> miquel.raynal@bootlin.com; robh@kernel.org;
> zbigniew.lukwinski@linux.intel.com
> Subject: [PATCH v8 5/8] i3c: target: add svc target controller support
>
> Add Silvaco I3C target controller support
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>
> Notes:
> Chagne from v7 to v8
> -reorder header files
> - add missed header files
>
> Change from v3 to v7
> - none
> Change from v2 to v3
> - fix build warning
>
> drivers/i3c/master/Makefile | 2 +-
> drivers/i3c/master/svc-i3c-main.c | 35 +-
> drivers/i3c/master/svc-i3c-target.c | 776
I think putting target mode files under "master" might not make sense.
We might have to consider that we may have a "secondary master" mode.
Some other ways of splitting or handling of target mode is needed here.
>
> static const struct dev_pm_ops svc_i3c_pm_ops = { diff --git
> a/drivers/i3c/master/svc-i3c-target.c b/drivers/i3c/master/svc-i3c-target.c
> new file mode 100644
> index 0000000000000..06210ed0c3219
> --- /dev/null
> +++ b/drivers/i3c/master/svc-i3c-target.c
> @@ -0,0 +1,776 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright 2023 NXP.
> + *
> + * Author: Frank Li <Frank.Li@nxp.com>
> + */
> +
> +#include <linux/bits.h>
> +#include <linux/bitfield.h>
> +#include <linux/clk.h>
> +#include <linux/completion.h>
> +#include <linux/errno.h>
> +#include <linux/i3c/device.h>
> +#include <linux/i3c/target.h>
> +#include <linux/interrupt.h>
> +#include <linux/iopoll.h>
> +#include <linux/kernel.h>
> +#include <linux/list.h>
> +#include <linux/module.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/of.h>
> +#include <linux/pinctrl/consumer.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/spinlock.h>
> +#include <linux/workqueue.h>
> +
> +#include "svc-i3c.h"
> +
> +enum i3c_clks {
> + PCLK,
> + FCLK,
> + SCLK,
> + MAXCLK,
> +};
> +
> +struct svc_i3c_target {
> + struct device *dev;
> + void __iomem *regs;
> + int irq;
> + struct clk_bulk_data clks[MAXCLK];
> +
> + struct list_head txq;
> + spinlock_t txq_lock; /* protect tx queue */
> + struct list_head rxq;
> + spinlock_t rxq_lock; /* protect rx queue */
> + struct list_head cq;
> + spinlock_t cq_lock; /* protect complete queue */
> +
> + struct work_struct work;
> + struct workqueue_struct *workqueue;
> +
> + struct completion dacomplete;
> + struct i3c_target_ctrl_features features;
> +
> + spinlock_t ctrl_lock; /* protext access SCTRL register */ };
> +
> +#define I3C_SCONFIG 0x4
> +#define I3C_SCONFIG_SLVENA_MASK BIT(0)
> +#define I3C_SCONFIG_OFFLINE_MASK BIT(9)
> +#define I3C_SCONFIG_SADDR_MASK GENMASK(31, 25)
> +
> +#define I3C_SSTATUS 0x8
> +#define I3C_SSTATUS_STNOTSTOP_MASK BIT(0)
> +#define I3C_SSTATUS_STOP_MASK BIT(10)
> +#define I3C_SSTATUS_RX_PEND_MASK BIT(11)
> +#define I3C_SSTATUS_TXNOTFULL_MASK BIT(12)
> +#define I3C_SSTATUS_DACHG_MASK BIT(13)
> +#define I3C_SSTATUS_EVDET_MASK GENMASK(21, 20)
> +#define I3C_SSTATUS_EVDET_ACKED 0x3
> +#define I3C_SSTATUS_IBIDIS_MASK BIT(24)
> +#define I3C_SSTATUS_HJDIS_MASK BIT(27)
> +
> +#define I3C_SCTRL 0xc
> +#define I3C_SCTRL_EVENT_MASK GENMASK(1, 0)
> +#define I3C_SCTRL_EVENT_IBI 0x1
> +#define I3C_SCTRL_EVENT_HOTJOIN 0x3
> +#define I3C_SCTRL_EXTDATA_MASK BIT(3)
> +#define I3C_SCTRL_IBIDATA_MASK GENMASK(15, 8)
> +
> +#define I3C_SINTSET 0x10
> +#define I3C_SINTCLR 0x14
> +#define I3C_SINT_START BIT(8)
> +#define I3C_SINT_MATCHED BIT(9)
> +#define I3C_SINT_STOP BIT(10)
> +#define I3C_SINT_RXPEND BIT(11)
> +#define I3C_SINT_TXSEND BIT(12)
> +#define I3C_SINT_DACHG BIT(13)
> +#define I3C_SINT_CCC BIT(14)
> +#define I3C_SINT_ERRWARN BIT(15)
> +#define I3C_SINT_DDRMAATCHED BIT(16)
> +#define I3C_SINT_CHANDLED BIT(17)
> +#define I3C_SINT_EVENT BIT(18)
> +#define I3C_SINT_SLVRST BIT(19)
> +
> +#define I3C_SDATACTRL 0x2c
> +#define I3C_SDATACTRL_RXEMPTY_MASK BIT(31)
> +#define I3C_SDATACTRL_TXFULL_MASK BIT(30)
> +#define I3C_SDATACTRL_RXCOUNT_MASK GENMASK(28, 24)
> +#define I3C_SDATACTRL_TXCOUNT_MASK GENMASK(20, 16)
> +#define I3C_SDATACTRL_FLUSHFB_MASK BIT(1)
> +#define I3C_SDATACTRL_FLUSHTB_MASK BIT(0)
> +
> +#define I3C_SWDATAB 0x30
> +#define I3C_SWDATAB_END_ALSO_MASK BIT(16)
> +#define I3C_SWDATAB_END_MASK BIT(8)
> +
> +#define I3C_SWDATAE 0x34
> +#define I3C_SRDATAB 0x40
> +
> +#define I3C_SCAPABILITIES 0x60
> +#define I3C_SCAPABILITIES_FIFOTX_MASK GENMASK(27, 26)
> +#define I3C_SCAPABILITIES_FIFORX_MASK GENMASK(29, 28)
> +
> +#define I3C_SMAXLIMITS 0x68
> +#define I3C_SMAXLIMITS_MAXRD_MASK GENMASK(11, 0)
> +#define I3C_SMAXLIMITS_MAXWR_MASK GENMASK(27, 16)
> +
> +#define I3C_SIDPARTNO 0x6c
> +
> +#define I3C_SIDEXT 0x70
> +#define I3C_SIDEXT_BCR_MASK GENMASK(23, 16)
> +#define I3C_SIDEXT_DCR_MASK GENMASK(15, 8)
> +#define I3C_SVENDORID 0x74
> +
> +#define I3C_SMAPCTRL0 0x11c
> +#define I3C_SMAPCTRL0_ENA_MASK BIT(0)
> +#define I3C_SMAPCTRL0_DA_MASK GENMASK(7, 1)
> +
> +#define I3C_IBIEXT1 0x140
> +#define I3C_IBIEXT1_CNT_MASK GEN_MASK(2, 0)
> +#define I3C_IBIEXT1_MAX_MASK GEN_MASK(4, 6)
> +#define I3C_IBIEXT1_EXT1_SHIFT 8
> +#define I3C_IBIEXT1_EXT2_SHIFT 16
> +#define I3C_IBIEXT1_EXT3_SHIFT 24
> +
> +#define I3C_IBIEXT2 0x144
> +#define I3C_IBIEXT2_EXT4_SHIFT 0
> +#define I3C_IBIEXT2_EXT5_SHIFT 8
> +#define I3C_IBIEXT2_EXT6_SHIFT 16
> +#define I3C_IBIEXT2_EXT7_SHIFT 24
> +
There is couple of space formatting here that requires to be fixed.
Cheers,
Joshua
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2024-03-06 16:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 17:01 [PATCH v8 0/8] I3C target mode support Frank Li
2024-02-08 17:01 ` [PATCH v8 1/8] i3c: add " Frank Li
2024-02-08 17:01 ` [PATCH v8 2/8] dt-bindings: i3c: svc: add proptery mode Frank Li
2024-02-08 17:01 ` [PATCH v8 3/8] Documentation: i3c: Add I3C target mode controller and function Frank Li
2024-02-08 17:01 ` [PATCH v8 4/8] i3c: svc: Add svc-i3c-main.c and svc-i3c.h Frank Li
2024-02-08 17:01 ` [PATCH v8 5/8] i3c: target: add svc target controller support Frank Li
2024-03-06 16:06 ` Joshua Yeong [this message]
2024-02-08 17:01 ` [PATCH v8 6/8] i3c: target: func: add tty driver Frank Li
2024-02-08 17:01 ` [PATCH v8 7/8] i3c: add API i3c_dev_gettstatus_format1() to get target device status Frank Li
2024-02-08 17:01 ` [PATCH v8 8/8] tty: i3c: add TTY over I3C master support Frank Li
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=SH0PR01MB08411D27D7A3CD39CDDE618FF921A@SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn \
--to=joshua.yeong@starfivetech.com \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=conor.culhane@silvaco.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=imx@lists.linux.dev \
--cc=jirislaby@kernel.org \
--cc=joe@perches.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=robh@kernel.org \
--cc=zbigniew.lukwinski@linux.intel.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).