Skip to content
  1. Jan 24, 2018
  2. Jan 23, 2018
  3. Jan 22, 2018
    • David S. Miller's avatar
      Merge branch 'mvpp2-Armada-7k-8k-PP2-ACPI-support' · d1b1110f
      David S. Miller authored
      
      
      Marcin Wojtas says:
      
      ====================
      Armada 7k/8k PP2 ACPI support
      
      I quickly resend the series, thanks to Antoine Tenart's remark,
      who spotted !CONFIG_ACPI compilation issue after introducing
      the new fwnode_irq_get() routine. Please see the details in the changelog
      below and the 3/7 commit log.
      
      mvpp2 driver can work with the ACPI representation, as exposed
      on a public branch:
      https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/marvell-armada-wip
      It was compiled together with the most recent Tianocore EDK2 revision.
      Please refer to the firmware build instruction on MacchiatoBin board:
      http://wiki.macchiatobin.net/tiki-index.php?page=Build+from+source+-+UEFI+EDK+II
      
      ACPI representation of PP2 controllers (withouth PHY support) can
      be viewed in the github:
      * MacchiatoBin:
      https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/blob/71ae395da1661374b0f07d1602afb1eee56e9794/Platforms/Marvell/Armada/AcpiTables/Armada80x0McBin/Dsdt.asl#L201
      
      * Armada 7040 DB:
      https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/blob/71ae395da1661374b0f07d1602afb1eee56e9794/Platforms/Marvell/Armada/AcpiTables/Armada70x0/Dsdt.asl#L131
      
      I will appreciate any comments or remarks.
      
      Best regards,
      Marcin
      
      Changelog:
      v3 -> v4:
      * 3/7
          - add new macro (ACPI_HANDLE_FWNODE) and fix
            compilation with !CONFIG_ACPI
          - extend commit log and mention usability of fwnode_irq_get
            for the child nodes as well
      
      v2 -> v3:
      * 1/7, 2/7
          - Add Rafael's Acked-by's
      * 3/7, 4/7
          - New patches
      * 6/7, 7/7
          - Update driver with new helper routines usage
          - Improve commit log.
      
      v1 -> v2:
      * Remove MDIO patches
      * Use PP2 ports only with link interrupts
      * Release second region resources in mvpp2 driver (code moved from
        mvmdio), as explained in details in 5/5 commit message.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d1b1110f
    • Marcin Wojtas's avatar
      net: mvpp2: enable ACPI support in the driver · a75edc7c
      Marcin Wojtas authored
      
      
      This patch introduces an alternative way of obtaining resources - via
      ACPI tables provided by firmware. Enabling coexistence with the DT
      support, in addition to the OF_*->device_*/fwnode_* API replacement,
      required following steps to be taken:
      
      * Add mvpp2_acpi_match table
      * Omit clock configuration and obtain tclk from the property - in ACPI
        world, the firmware is responsible for clock maintenance.
      * Disable comphy and syscon handling as they are not available for ACPI.
      * Modify way of obtaining interrupts - use newly introduced
        fwnode_irq_get() routine
      * Until proper MDIO bus and PHY handling with ACPI is established in the
        kernel, use only link interrupts feature in the driver. For the RGMII
        port it results in depending on GMAC settings done during firmware
        stage.
      * When booting with ACPI MVPP2_QDIST_MULTI_MODE is picked by
        default, as there is no need to keep any kind of the backward
        compatibility.
      
      Moreover, a memory region used by mvmdio driver is usually placed in
      the middle of the address space of the PP2 network controller.
      The MDIO base address is obtained without requesting memory region
      (by devm_ioremap() call) in mvmdio.c, later overlapping resources are
      requested by the network driver, which is responsible for avoiding
      a concurrent access.
      
      In case the MDIO memory region is declared in the ACPI, it can
      already appear as 'in-use' in the OS. Because it is overlapped by second
      region of the network controller, make sure it is released, before
      requesting it again. The care is taken by mvpp2 driver to avoid
      concurrent access to this memory region.
      
      Signed-off-by: default avatarMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a75edc7c