2022-10-14 22:45:34

by Eddie James

[permalink] [raw]
Subject: [PATCH 0/5] fsi: Add regmap and refactor sbefifo

The SBEFIFO hardware can now be attached over a new I2C endpoint
interface called the I2C Responder (I2CR). In order to use the
existing SBEFIFO driver, add regmap drivers for both FSI busses
and the I2CR. Then, refactor the SBEFIFO and OCC drivers to clean
up and use the new regmap drivers.

Eddie James (5):
regmap: Add FSI bus support
regmap: Add IBM I2CR support
drivers: fsi: Rename sbefifo and occ sources
drivers: fsi: separate char device code for occ and sbefifo
drivers: fsi: occ and sbefifo refactor

drivers/base/regmap/Kconfig | 10 +-
drivers/base/regmap/Makefile | 2 +
drivers/base/regmap/regmap-fsi.c | 231 +++++
drivers/base/regmap/regmap-ibm-i2cr.c | 159 ++++
drivers/fsi/Kconfig | 23 +-
drivers/fsi/Makefile | 8 +-
drivers/fsi/fsi-occ.c | 766 -----------------
drivers/fsi/fsi-sbefifo.c | 1144 -------------------------
drivers/fsi/occ-cdev.c | 157 ++++
drivers/fsi/occ.c | 534 ++++++++++++
drivers/fsi/occ.h | 75 ++
drivers/fsi/sbefifo-cdev.c | 218 +++++
drivers/fsi/sbefifo-fsi.c | 68 ++
drivers/fsi/sbefifo-i2c.c | 72 ++
drivers/fsi/sbefifo.c | 797 +++++++++++++++++
drivers/fsi/sbefifo.h | 50 ++
include/linux/regmap.h | 72 ++
17 files changed, 2468 insertions(+), 1918 deletions(-)
create mode 100644 drivers/base/regmap/regmap-fsi.c
create mode 100644 drivers/base/regmap/regmap-ibm-i2cr.c
delete mode 100644 drivers/fsi/fsi-occ.c
delete mode 100644 drivers/fsi/fsi-sbefifo.c
create mode 100644 drivers/fsi/occ-cdev.c
create mode 100644 drivers/fsi/occ.c
create mode 100644 drivers/fsi/occ.h
create mode 100644 drivers/fsi/sbefifo-cdev.c
create mode 100644 drivers/fsi/sbefifo-fsi.c
create mode 100644 drivers/fsi/sbefifo-i2c.c
create mode 100644 drivers/fsi/sbefifo.c
create mode 100644 drivers/fsi/sbefifo.h

--
2.31.1


2022-10-17 18:35:08

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/5] fsi: Add regmap and refactor sbefifo

On Fri, Oct 14, 2022 at 05:05:35PM -0500, Eddie James wrote:
> The SBEFIFO hardware can now be attached over a new I2C endpoint
> interface called the I2C Responder (I2CR). In order to use the
> existing SBEFIFO driver, add regmap drivers for both FSI busses
> and the I2CR. Then, refactor the SBEFIFO and OCC drivers to clean
> up and use the new regmap drivers.

Is there any great reason to provide support in the regmap core for this
rather than just implementing in drivers/fsi? AFAICT this is just
ending up as an implementation detail of shared code in drivers/fsi and
won't have any external users?


Attachments:
(No filename) (619.00 B)
signature.asc (499.00 B)
Download all attachments

2022-10-18 14:16:36

by Eddie James

[permalink] [raw]
Subject: Re: [PATCH 0/5] fsi: Add regmap and refactor sbefifo


On 10/17/22 12:37, Mark Brown wrote:
> On Fri, Oct 14, 2022 at 05:05:35PM -0500, Eddie James wrote:
>> The SBEFIFO hardware can now be attached over a new I2C endpoint
>> interface called the I2C Responder (I2CR). In order to use the
>> existing SBEFIFO driver, add regmap drivers for both FSI busses
>> and the I2CR. Then, refactor the SBEFIFO and OCC drivers to clean
>> up and use the new regmap drivers.
> Is there any great reason to provide support in the regmap core for this
> rather than just implementing in drivers/fsi? AFAICT this is just
> ending up as an implementation detail of shared code in drivers/fsi and
> won't have any external users?


One reason is to have a common interface with the new FSI regmap. That
way abstracting out the bus transfer is trivial in the new SBEFIFO
driver, assuming the SBEFIFO driver should switch to use the FSI regmap.

But you are correct, I doubt anyone else will use this. I suppose
SBEFIFO may as well not use the regmap and just use some callbacks for
whichever bus transfer...


Thanks,

Eddie


2022-10-18 18:24:03

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/5] fsi: Add regmap and refactor sbefifo

On Tue, Oct 18, 2022 at 09:02:33AM -0500, Eddie James wrote:
> On 10/17/22 12:37, Mark Brown wrote:

> > Is there any great reason to provide support in the regmap core for this
> > rather than just implementing in drivers/fsi? AFAICT this is just
> > ending up as an implementation detail of shared code in drivers/fsi and
> > won't have any external users?

> One reason is to have a common interface with the new FSI regmap. That way
> abstracting out the bus transfer is trivial in the new SBEFIFO driver,
> assuming the SBEFIFO driver should switch to use the FSI regmap.

> But you are correct, I doubt anyone else will use this. I suppose SBEFIFO
> may as well not use the regmap and just use some callbacks for whichever bus
> transfer...

I'm not saying don't use regmap, I'm saying why not just do this in the
driver - you can just as easily set the reg_read() and reg_write()
callbacks in an individual driver without needing to create a new regmap
bus type for just that one driver to use.


Attachments:
(No filename) (1.00 kB)
signature.asc (499.00 B)
Download all attachments

2022-10-18 23:01:26

by Andrew Jeffery

[permalink] [raw]
Subject: Re: [PATCH 0/5] fsi: Add regmap and refactor sbefifo



On Wed, 19 Oct 2022, at 04:30, Mark Brown wrote:
> On Tue, Oct 18, 2022 at 09:02:33AM -0500, Eddie James wrote:
>> On 10/17/22 12:37, Mark Brown wrote:
>
>> > Is there any great reason to provide support in the regmap core for this
>> > rather than just implementing in drivers/fsi? AFAICT this is just
>> > ending up as an implementation detail of shared code in drivers/fsi and
>> > won't have any external users?
>
>> One reason is to have a common interface with the new FSI regmap. That way
>> abstracting out the bus transfer is trivial in the new SBEFIFO driver,
>> assuming the SBEFIFO driver should switch to use the FSI regmap.
>
>> But you are correct, I doubt anyone else will use this. I suppose SBEFIFO
>> may as well not use the regmap and just use some callbacks for whichever bus
>> transfer...
>
> I'm not saying don't use regmap, I'm saying why not just do this in the
> driver - you can just as easily set the reg_read() and reg_write()
> callbacks in an individual driver without needing to create a new regmap
> bus type for just that one driver to use.

+1

2022-10-19 19:52:16

by Eddie James

[permalink] [raw]
Subject: Re: [PATCH 0/5] fsi: Add regmap and refactor sbefifo


On 10/18/22 13:00, Mark Brown wrote:
> On Tue, Oct 18, 2022 at 09:02:33AM -0500, Eddie James wrote:
>> On 10/17/22 12:37, Mark Brown wrote:
>>> Is there any great reason to provide support in the regmap core for this
>>> rather than just implementing in drivers/fsi? AFAICT this is just
>>> ending up as an implementation detail of shared code in drivers/fsi and
>>> won't have any external users?
>> One reason is to have a common interface with the new FSI regmap. That way
>> abstracting out the bus transfer is trivial in the new SBEFIFO driver,
>> assuming the SBEFIFO driver should switch to use the FSI regmap.
>> But you are correct, I doubt anyone else will use this. I suppose SBEFIFO
>> may as well not use the regmap and just use some callbacks for whichever bus
>> transfer...
> I'm not saying don't use regmap, I'm saying why not just do this in the
> driver - you can just as easily set the reg_read() and reg_write()
> callbacks in an individual driver without needing to create a new regmap
> bus type for just that one driver to use.


I understand. That sounds like a good approach then, I'll work on that
for v2.

Thanks,

Eddie