mbox series

[phy,v3,0/5] Armada 3720 comphy native implementation

Message ID 20220103143220.13070-1-kabel@kernel.org
Headers show
Series Armada 3720 comphy native implementation | expand

Message

Marek Behún Jan. 3, 2022, 2:32 p.m. UTC
Hello Vinod,

this is v3 of series converting A3720 comphy to native kernel
implementation.

Tested on Turris MOX and ESPRESSObin (tested all supported PHY modes:
ethernet, PCIe, USB3, SATA).

Changes since v2:
- removed device-tree changing patch, Gregory applied it on mvebu/dt64
- changed raw spin lock to ordinary spin lock
- fixed indentation of gbe_phy_init_fix
- use FIELD_PREP() macro

Changes since v1 (all changes in patch 2/6):
- refactored to use GENMASK()
- fixed various register names to conform to Functional Specification
- refactored various register names to have uniform naming
- refactored register access into one function, which decides whether
  the access should be direct or indirect, so as to not have all these
  checks done everywhere in the code
- moved around one register definition to have the registers sorted
  according to their offset
- added comments to some register definitions
- added support for PHY reset() method
- when changing PHY mode, the driver now resets the PHY and its
  registers to put the PHY in known state
- fixed the power_off() method
- added spinlock guard when accessing PHY Selector register, since it
  is shared between the PHYs and so the PHY mutex is insufficient
- upon driver probe changed the calls to power_off() to reset()


The original cover letter said:

The RPC calling to ARM Trusted Firmware implementation of Armada 3720
comphy driver caused quite a number of issues (explained more in patch 2).

This series fixes those issues by reimplementing the driver to native
kernel implementation.

The last 3 commits revert commits in AHCI, USB, and PCI drivers, that were
introduced there because of those issues.

Pali Rohár (5):
  phy: marvell: phy-mvebu-a3700-comphy: Remove port from driver
    configuration
  phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation
  Revert "ata: ahci: mvebu: Make SATA PHY optional for Armada 3720"
  Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada
    3720"
  Revert "PCI: aardvark: Fix initialization with old Marvell's Arm
    Trusted Firmware"

 drivers/ata/ahci.h                           |    2 -
 drivers/ata/ahci_mvebu.c                     |    2 +-
 drivers/ata/libahci_platform.c               |    2 +-
 drivers/pci/controller/pci-aardvark.c        |    4 +-
 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 1369 ++++++++++++++++--
 drivers/usb/host/xhci-mvebu.c                |   42 -
 drivers/usb/host/xhci-mvebu.h                |    6 -
 drivers/usb/host/xhci-plat.c                 |   20 +-
 drivers/usb/host/xhci-plat.h                 |    1 -
 9 files changed, 1245 insertions(+), 203 deletions(-)

Comments

Marek Behún Jan. 17, 2022, 2:58 p.m. UTC | #1
Dear Vinod,

did you find time to look at this series?

Marek

On Mon,  3 Jan 2022 15:32:15 +0100
Marek Behún <kabel@kernel.org> wrote:

> Hello Vinod,
> 
> this is v3 of series converting A3720 comphy to native kernel
> implementation.
> 
> Tested on Turris MOX and ESPRESSObin (tested all supported PHY modes:
> ethernet, PCIe, USB3, SATA).
> 
> Changes since v2:
> - removed device-tree changing patch, Gregory applied it on mvebu/dt64
> - changed raw spin lock to ordinary spin lock
> - fixed indentation of gbe_phy_init_fix
> - use FIELD_PREP() macro
> 
> Changes since v1 (all changes in patch 2/6):
> - refactored to use GENMASK()
> - fixed various register names to conform to Functional Specification
> - refactored various register names to have uniform naming
> - refactored register access into one function, which decides whether
>   the access should be direct or indirect, so as to not have all these
>   checks done everywhere in the code
> - moved around one register definition to have the registers sorted
>   according to their offset
> - added comments to some register definitions
> - added support for PHY reset() method
> - when changing PHY mode, the driver now resets the PHY and its
>   registers to put the PHY in known state
> - fixed the power_off() method
> - added spinlock guard when accessing PHY Selector register, since it
>   is shared between the PHYs and so the PHY mutex is insufficient
> - upon driver probe changed the calls to power_off() to reset()
> 
> 
> The original cover letter said:
> 
> The RPC calling to ARM Trusted Firmware implementation of Armada 3720
> comphy driver caused quite a number of issues (explained more in patch 2).
> 
> This series fixes those issues by reimplementing the driver to native
> kernel implementation.
> 
> The last 3 commits revert commits in AHCI, USB, and PCI drivers, that were
> introduced there because of those issues.
> 
> Pali Rohár (5):
>   phy: marvell: phy-mvebu-a3700-comphy: Remove port from driver
>     configuration
>   phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation
>   Revert "ata: ahci: mvebu: Make SATA PHY optional for Armada 3720"
>   Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada
>     3720"
>   Revert "PCI: aardvark: Fix initialization with old Marvell's Arm
>     Trusted Firmware"
> 
>  drivers/ata/ahci.h                           |    2 -
>  drivers/ata/ahci_mvebu.c                     |    2 +-
>  drivers/ata/libahci_platform.c               |    2 +-
>  drivers/pci/controller/pci-aardvark.c        |    4 +-
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 1369 ++++++++++++++++--
>  drivers/usb/host/xhci-mvebu.c                |   42 -
>  drivers/usb/host/xhci-mvebu.h                |    6 -
>  drivers/usb/host/xhci-plat.c                 |   20 +-
>  drivers/usb/host/xhci-plat.h                 |    1 -
>  9 files changed, 1245 insertions(+), 203 deletions(-)
>
Vinod Koul Jan. 27, 2022, 5:27 a.m. UTC | #2
On 17-01-22, 15:58, Marek Behún wrote:
> Dear Vinod,
> 
> did you find time to look at this series?

Pls do not top post!

This came in just before merge window, I dont pick patches during that
time. rc1 came this monday, so this is in queue...

> 
> Marek
> 
> On Mon,  3 Jan 2022 15:32:15 +0100
> Marek Behún <kabel@kernel.org> wrote:
> 
> > Hello Vinod,
> > 
> > this is v3 of series converting A3720 comphy to native kernel
> > implementation.
> > 
> > Tested on Turris MOX and ESPRESSObin (tested all supported PHY modes:
> > ethernet, PCIe, USB3, SATA).
> > 
> > Changes since v2:
> > - removed device-tree changing patch, Gregory applied it on mvebu/dt64
> > - changed raw spin lock to ordinary spin lock
> > - fixed indentation of gbe_phy_init_fix
> > - use FIELD_PREP() macro
> > 
> > Changes since v1 (all changes in patch 2/6):
> > - refactored to use GENMASK()
> > - fixed various register names to conform to Functional Specification
> > - refactored various register names to have uniform naming
> > - refactored register access into one function, which decides whether
> >   the access should be direct or indirect, so as to not have all these
> >   checks done everywhere in the code
> > - moved around one register definition to have the registers sorted
> >   according to their offset
> > - added comments to some register definitions
> > - added support for PHY reset() method
> > - when changing PHY mode, the driver now resets the PHY and its
> >   registers to put the PHY in known state
> > - fixed the power_off() method
> > - added spinlock guard when accessing PHY Selector register, since it
> >   is shared between the PHYs and so the PHY mutex is insufficient
> > - upon driver probe changed the calls to power_off() to reset()
> > 
> > 
> > The original cover letter said:
> > 
> > The RPC calling to ARM Trusted Firmware implementation of Armada 3720
> > comphy driver caused quite a number of issues (explained more in patch 2).
> > 
> > This series fixes those issues by reimplementing the driver to native
> > kernel implementation.
> > 
> > The last 3 commits revert commits in AHCI, USB, and PCI drivers, that were
> > introduced there because of those issues.
> > 
> > Pali Rohár (5):
> >   phy: marvell: phy-mvebu-a3700-comphy: Remove port from driver
> >     configuration
> >   phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation
> >   Revert "ata: ahci: mvebu: Make SATA PHY optional for Armada 3720"
> >   Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada
> >     3720"
> >   Revert "PCI: aardvark: Fix initialization with old Marvell's Arm
> >     Trusted Firmware"
> > 
> >  drivers/ata/ahci.h                           |    2 -
> >  drivers/ata/ahci_mvebu.c                     |    2 +-
> >  drivers/ata/libahci_platform.c               |    2 +-
> >  drivers/pci/controller/pci-aardvark.c        |    4 +-
> >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 1369 ++++++++++++++++--
> >  drivers/usb/host/xhci-mvebu.c                |   42 -
> >  drivers/usb/host/xhci-mvebu.h                |    6 -
> >  drivers/usb/host/xhci-plat.c                 |   20 +-
> >  drivers/usb/host/xhci-plat.h                 |    1 -
> >  9 files changed, 1245 insertions(+), 203 deletions(-)
> >