1. 24 1月, 2018 6 次提交
  2. 23 1月, 2018 25 次提交
  3. 22 1月, 2018 9 次提交
    • D
      Merge branch 'mvpp2-Armada-7k-8k-PP2-ACPI-support' · d1b1110f
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      d1b1110f
    • M
      net: mvpp2: enable ACPI support in the driver · a75edc7c
      Marcin Wojtas 提交于
      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: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a75edc7c
    • M
      net: mvpp2: use device_*/fwnode_* APIs instead of of_* · 24812221
      Marcin Wojtas 提交于
      OF functions can be used only for the driver using DT.
      As a preparation for introducing ACPI support in mvpp2
      driver, use struct fwnode_handle in order to obtain
      properties from the hardware description.
      
      This patch replaces of_* function with device_*/fwnode_*
      where possible in the mvpp2.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24812221
    • M
      net: mvpp2: simplify maintaining enabled ports' list · bf147153
      Marcin Wojtas 提交于
      'port_count' field of the mvpp2 structure holds an overall amount
      of available ports, based on DT nodes status. In order to be prepared
      to support other HW description, obtain the value by incrementing it
      upon each successful port initialization. This allowed for simplifying
      port indexing in the controller's private array, whose size is now not
      dynamically allocated, but fixed to MVPP2_MAX_PORTS.
      
      This patch simplifies creating and filling list of enabled ports and
      is a part of the preparation for adding ACPI support in the mvpp2 driver.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf147153
    • M
      device property: Allow iterating over available child fwnodes · 3395de96
      Marcin Wojtas 提交于
      Implement a new helper function fwnode_get_next_available_child_node(),
      which enables obtaining next enabled child fwnode, which
      works on a similar basis to OF's of_get_next_available_child().
      
      This commit also introduces a macro, thanks to which it is
      possible to iterate over the available fwnodes, using the
      new function described above.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3395de96
    • M
      device property: Introduce fwnode_irq_get() · 7c6c57f2
      Marcin Wojtas 提交于
      Until now there were two very similar functions allowing
      to get Linux IRQ number from ACPI handle (acpi_irq_get())
      and OF node (of_irq_get()). The first one appeared to be used
      only as a subroutine of platform_irq_get(), which (in the generic
      code) limited IRQ obtaining from _CRS method only to nodes
      associated to kernel's struct platform_device.
      
      This patch introduces a new helper routine - fwnode_irq_get(),
      which allows to get the IRQ number directly from the fwnode
      to be used as common for OF/ACPI worlds. It is usable not
      only for the parents fwnodes, but also for the child nodes
      comprising their own _CRS methods with interrupts description.
      
      In order to be able o satisfy compilation with !CONFIG_ACPI
      and also simplify the new code, introduce a helper macro
      (ACPI_HANDLE_FWNODE), with which it is possible to reach
      an ACPI handle directly from its fwnode.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c6c57f2
    • M
      device property: Introduce fwnode_get_phy_mode() · b28f263b
      Marcin Wojtas 提交于
      Until now there were two almost identical functions for
      obtaining network PHY mode - of_get_phy_mode() and,
      more generic, device_get_phy_mode(). However it is not uncommon,
      that the network interface is represented as a child
      of the actual controller, hence it is not associated
      directly to any struct device, required by the latter
      routine.
      
      This commit allows for getting the PHY mode for
      children nodes in the ACPI world by introducing a new function -
      fwnode_get_phy_mode(). This commit also changes
      device_get_phy_mode() routine to be its wrapper, in order
      to prevent unnecessary duplication.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b28f263b
    • M
      device property: Introduce fwnode_get_mac_address() · babe2dbb
      Marcin Wojtas 提交于
      Until now there were two almost identical functions for
      obtaining MAC address - of_get_mac_address() and, more generic,
      device_get_mac_address(). However it is not uncommon,
      that the network interface is represented as a child
      of the actual controller, hence it is not associated
      directly to any struct device, required by the latter
      routine.
      
      This commit allows for getting the MAC address for
      children nodes in the ACPI world by introducing a new function -
      fwnode_get_mac_address(). This commit also changes
      device_get_mac_address() routine to be its wrapper, in order
      to prevent unnecessary duplication.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      babe2dbb
    • C
      net: caif: remove redundant re-assignment of pointer pfrm · e0b4ed01
      Colin Ian King 提交于
      The pointer pfrm is initialized and then later re-assigned the same
      value and hence the second assignment is redundant and can be removed.
      
      Cleans up clang warning:
      drivers/net/caif/caif_hsi.c:222:6: warning: Value stored to 'pfrm'
      during its initialization is never read
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0b4ed01