linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Add Apple M1 support to PASemi i2c driver
@ 2021-09-26  9:58 Sven Peter
  2021-09-26  9:58 ` [PATCH 01/10] dt-bindings: i2c: Add Apple I2C controller bindings Sven Peter
                   ` (10 more replies)
  0 siblings, 11 replies; 18+ messages in thread
From: Sven Peter @ 2021-09-26  9:58 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras, Olof Johansson
  Cc: Sven Peter, Arnd Bergmann, Hector Martin, Mohamed Mediouni,
	Stan Skowronek, Mark Kettenis, Alyssa Rosenzweig,
	linux-arm-kernel, linuxppc-dev, linux-i2c, linux-kernel

Hi,

This series adds support for the I2C controller found on Apple Silicon Macs
which has quite a bit of history:

Apple bought P.A. Semi in 2008 and it looks like a part of its legacy continues
to live on in the M1. This controller has actually been used since at least the
iPhone 4S and hasn't changed much since then.
Essentially, there are only a few differences that matter:

	- The controller no longer is a PCI device
	- Starting at some iPhone an additional bit in one register
          must be set in order to start transmissions.
	- The reference clock and hence the clock dividers are different

In order to add support for a platform device I first replaced PCI-specific
bits and split out the PCI driver to its own file. Then I added support
to make the clock divider configurable and converted the driver to use
managed device resources to make it a bit simpler.

The Apple and PASemi driver will never be compiled in the same kernel
since the Apple one will run on arm64 while the original PASemi driver
will only be useful on powerpc.
I've thus followed the octeon (mips)/thunderx(arm64) approach to do the
split: I created a -core.c file which contains the shared logic and just
compile that one for both the PASemi and the new Apple driver.

Now unfortunately I don't have access to any old PASemi hardware and
cannot confirm that my changes haven't broken anything for those.
I believe Hector was in contact with Olof a few months ago who
said that he might still have an old machine on which he could
test this.
I'd very much appreciate if he (or anyone else for that matter :-)) 
could give this series a quick test on the old PASemi machines.


Best,

Sven

Sven Peter (10):
  dt-bindings: i2c: Add Apple I2C controller bindings
  i2c: pasemi: Use io{read,write}32
  i2c: pasemi: Remove usage of pci_dev
  i2c: pasemi: Split off common probing code
  i2c: pasemi: Split pci driver to its own file
  i2c: pasemi: Move common reset code to own function
  i2c: pasemi: Allow to configure bus frequency
  i2c: pasemi: Refactor _probe to use devm_*
  i2c: pasemi: Add Apple platform driver
  i2c: pasemi: Set enable bit for Apple variant

 .../devicetree/bindings/i2c/apple,i2c.yaml    |  61 +++++++++
 MAINTAINERS                                   |   2 +
 drivers/i2c/busses/Kconfig                    |  11 ++
 drivers/i2c/busses/Makefile                   |   3 +
 drivers/i2c/busses/i2c-pasemi-apple.c         | 122 ++++++++++++++++++
 .../{i2c-pasemi.c => i2c-pasemi-core.c}       | 114 +++++-----------
 drivers/i2c/busses/i2c-pasemi-core.h          |  21 +++
 drivers/i2c/busses/i2c-pasemi-pci.c           |  85 ++++++++++++
 8 files changed, 334 insertions(+), 85 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/apple,i2c.yaml
 create mode 100644 drivers/i2c/busses/i2c-pasemi-apple.c
 rename drivers/i2c/busses/{i2c-pasemi.c => i2c-pasemi-core.c} (77%)
 create mode 100644 drivers/i2c/busses/i2c-pasemi-core.h
 create mode 100644 drivers/i2c/busses/i2c-pasemi-pci.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-10-04 18:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26  9:58 [PATCH 00/10] Add Apple M1 support to PASemi i2c driver Sven Peter
2021-09-26  9:58 ` [PATCH 01/10] dt-bindings: i2c: Add Apple I2C controller bindings Sven Peter
2021-10-04 18:01   ` Rob Herring
2021-09-26  9:58 ` [PATCH 02/10] i2c: pasemi: Use io{read,write}32 Sven Peter
2021-09-27  7:39   ` Arnd Bergmann
2021-09-28 15:48     ` Sven Peter
2021-09-26  9:58 ` [PATCH 03/10] i2c: pasemi: Remove usage of pci_dev Sven Peter
2021-09-26  9:58 ` [PATCH 04/10] i2c: pasemi: Split off common probing code Sven Peter
2021-09-26  9:58 ` [PATCH 05/10] i2c: pasemi: Split pci driver to its own file Sven Peter
2021-09-26  9:58 ` [PATCH 06/10] i2c: pasemi: Move common reset code to own function Sven Peter
2021-09-26  9:58 ` [PATCH 07/10] i2c: pasemi: Allow to configure bus frequency Sven Peter
2021-09-26  9:58 ` [PATCH 08/10] i2c: pasemi: Refactor _probe to use devm_* Sven Peter
2021-09-26  9:58 ` [PATCH 09/10] i2c: pasemi: Add Apple platform driver Sven Peter
2021-09-29 20:33   ` Wolfram Sang
2021-10-03 14:37     ` Sven Peter
2021-09-26  9:58 ` [PATCH 10/10] i2c: pasemi: Set enable bit for Apple variant Sven Peter
2021-09-27  7:42 ` [PATCH 00/10] Add Apple M1 support to PASemi i2c driver Arnd Bergmann
2021-09-29 20:35   ` Wolfram Sang

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 NNTP newsgroup(s).