All of lore.kernel.org
 help / color / mirror / Atom feed
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 v7 5/8] i3c: target: add svc target controller support
Date: Wed, 6 Mar 2024 18:10:30 +0000	[thread overview]
Message-ID: <SH0PR01MB0841C4D6B76DE99A789312BEF921A@SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn> (raw)
In-Reply-To: <ZeirpIpcsPuBAiIR@lizhi-Precision-Tower-5810>


> -----Original Message-----
> From: Frank Li <Frank.li@nxp.com>
> Sent: Thursday, March 7, 2024 1:45 AM
> To: Joshua Yeong <joshua.yeong@starfivetech.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: Re: [PATCH v7 5/8] i3c: target: add svc target controller support
> 
> On Wed, Mar 06, 2024 at 04:01:17PM +0000, Joshua Yeong wrote:
> > Hi Frank,
> >
> > > -----Original Message-----
> > > From: linux-i3c <linux-i3c-bounces@lists.infradead.org> On Behalf Of
> > > Frank Li
> > > Sent: Tuesday, February 6, 2024 7:33 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 v7 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:
> > >     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.
> 
> I think name 'master' is not good here. Previously only support 'master'
> mode, it should be fine. Now many controller are dual mode.
> 
> And I3C spec use 'controller/target' instead of 'master/slave'. I think
> 'controller' as master are quite confused. It can be master controller and slave
> controller.
> 
> Anyway, slave/master may share some code and resource, even only one file.
> 
> So far, I think it is fine put under master now. we can rename 'master'
> later when more dual mode controller added.
> 
> Frank

I am currently working on secondary-controller mode. I would like to explore if 
we can have a different way to implement various modes.

I am guessing that the current inspiration is coming from the existing i2c 
framework. 

However, I am thinking of having a more generic function to replace the way how 
we register the i3c driver. (existing 'i3c_master_register' or 
'devm_i3c_target_ctrl_create' from yours) Maybe along the line where we can have
all the modes set in a struct and return to the i3c framework. So we only need 1
API to register all the different modes instead of having one each.

> 
> >
> > ...
> >
> > > +
> > > +#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)
> > > +
> >
> > There is couple of space formatting here that requires to be fixed.
> >
> > Cheers,
> > Joshua

WARNING: multiple messages have this Message-ID (diff)
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 v7 5/8] i3c: target: add svc target controller support
Date: Wed, 6 Mar 2024 18:10:30 +0000	[thread overview]
Message-ID: <SH0PR01MB0841C4D6B76DE99A789312BEF921A@SH0PR01MB0841.CHNPR01.prod.partner.outlook.cn> (raw)
In-Reply-To: <ZeirpIpcsPuBAiIR@lizhi-Precision-Tower-5810>


> -----Original Message-----
> From: Frank Li <Frank.li@nxp.com>
> Sent: Thursday, March 7, 2024 1:45 AM
> To: Joshua Yeong <joshua.yeong@starfivetech.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: Re: [PATCH v7 5/8] i3c: target: add svc target controller support
> 
> On Wed, Mar 06, 2024 at 04:01:17PM +0000, Joshua Yeong wrote:
> > Hi Frank,
> >
> > > -----Original Message-----
> > > From: linux-i3c <linux-i3c-bounces@lists.infradead.org> On Behalf Of
> > > Frank Li
> > > Sent: Tuesday, February 6, 2024 7:33 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 v7 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:
> > >     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.
> 
> I think name 'master' is not good here. Previously only support 'master'
> mode, it should be fine. Now many controller are dual mode.
> 
> And I3C spec use 'controller/target' instead of 'master/slave'. I think
> 'controller' as master are quite confused. It can be master controller and slave
> controller.
> 
> Anyway, slave/master may share some code and resource, even only one file.
> 
> So far, I think it is fine put under master now. we can rename 'master'
> later when more dual mode controller added.
> 
> Frank

I am currently working on secondary-controller mode. I would like to explore if 
we can have a different way to implement various modes.

I am guessing that the current inspiration is coming from the existing i2c 
framework. 

However, I am thinking of having a more generic function to replace the way how 
we register the i3c driver. (existing 'i3c_master_register' or 
'devm_i3c_target_ctrl_create' from yours) Maybe along the line where we can have
all the modes set in a struct and return to the i3c framework. So we only need 1
API to register all the different modes instead of having one each.

> 
> >
> > ...
> >
> > > +
> > > +#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)
> > > +
> >
> > 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

  reply	other threads:[~2024-03-06 19:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 23:33 [PATCH v7 0/8] I3C target mode support Frank Li
2024-02-05 23:33 ` Frank Li
2024-02-05 23:33 ` [PATCH v7 1/8] i3c: add " Frank Li
2024-02-05 23:33   ` Frank Li
2024-02-05 23:33 ` [PATCH v7 2/8] dt-bindings: i3c: svc: add proptery mode Frank Li
2024-02-05 23:33   ` Frank Li
2024-02-05 23:33 ` [PATCH v7 3/8] Documentation: i3c: Add I3C target mode controller and function Frank Li
2024-02-05 23:33   ` Frank Li
2024-02-05 23:33 ` [PATCH v7 4/8] i3c: svc: Add svc-i3c-main.c and svc-i3c.h Frank Li
2024-02-05 23:33   ` Frank Li
2024-02-05 23:33 ` [PATCH v7 5/8] i3c: target: add svc target controller support Frank Li
2024-02-05 23:33   ` Frank Li
2024-03-06 16:01   ` Joshua Yeong
2024-03-06 16:01     ` Joshua Yeong
2024-03-06 17:45     ` Frank Li
2024-03-06 17:45       ` Frank Li
2024-03-06 18:10       ` Joshua Yeong [this message]
2024-03-06 18:10         ` Joshua Yeong
2024-03-06 19:11         ` Frank Li
2024-03-06 19:11           ` Frank Li
2024-02-05 23:33 ` [PATCH v7 6/8] i3c: target: func: add tty driver Frank Li
2024-02-05 23:33   ` Frank Li
2024-02-06 11:54   ` Ilpo Järvinen
2024-02-06 11:54     ` Ilpo Järvinen
2024-02-06 15:22     ` Frank Li
2024-02-06 15:22       ` Frank Li
2024-02-05 23:33 ` [PATCH v7 7/8] i3c: add API i3c_dev_gettstatus_format1() to get target device status Frank Li
2024-02-05 23:33   ` Frank Li
2024-02-05 23:33 ` [PATCH v7 8/8] tty: i3c: add TTY over I3C master support Frank Li
2024-02-05 23:33   ` 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=SH0PR01MB0841C4D6B76DE99A789312BEF921A@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 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.