net: mvneta: driver for Marvell Armada 370/XP network unit

This patch contains a new network driver for the network unit of the
ARM Marvell Armada 370 and the Armada XP. Both SoCs use the PJ4B
processor, a Marvell-developed ARM core that implements the ARMv7
instruction set.

Compared to previous ARM Marvell SoCs (Kirkwood, Orion, Discovery),
the network unit in Armada 370 and Armada XP is highly different. This
is the reason why this new 'mvneta' driver is needed, while the older
ARM Marvell SoCs use the 'mv643xx_eth' driver.

Here is an overview of the most important hardware changes that
require a new, specific, driver for the network unit of Armada 370/XP:

 - The new network unit has a completely different design and layout
   for the RX and TX descriptors. They are now organized as a simple
   array (each RX and TX queue has base address and size of this
   array) rather than a linked list as in the old SoCs.

 - The new network unit has a different RXQ and TXQ management: this
   management is done using special read/write counter registers,
   while in the Old SocS, it was done using the Ownership bit in RX
   and TX descriptors.

 - The new network unit has different interrupt registers

 - The new network unit way of cleaning of interrupts is not done by
   writing to the cause register, but by updating per-queue counters

 - The new network unit has different GMAC registers (link, speed,
   duplex configuration) and different WRR registers.

 - The new network unit has lots of new units like PnC (Parser and
   Classifier), PMT, BM (Memory Buffer Management), xPON, and more.

The driver proposed in the current patch only handles the basic
features. Additional hardware features will progressively be supported
as needed.

This code has originally been written by Rami Rosen
<rosenr@marvell.com>, and then reviewed and cleaned up by Thomas
Petazzoni <thomas.petazzoni@free-electrons.com>.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
net: mvneta: update MAINTAINERS file for the mvneta maintainers

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
arm: mvebu: add Ethernet controllers using mvneta driver for Armada 370/XP

The Armada 370 SoC has two network units, while the Armada XP has four
network units. The first two network units are common to both the
Armada XP and Armada 370, so they are added to armada-370-xp.dtsi,
while the other two network units are specific to the Armada XP and
therefore added to armada-xp.dtsi.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
arm: mvebu: enable Ethernet controllers on Armada 370/XP eval boards

This patch enables the two network interfaces of the Armada 370
official Marvell evaluation platform, and the four network interfaces
of the Armada XP official Marvell evaluation platform.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
driver: add devicetree binding documentation
driver: improve Kconfig
driver: add myself as an author
driver: rename txq/rxq id fields to id
driver: use txq/rxq pointers everywhere
driver: use phy-addr instead of phy_addr
driver: remove useless parenthesis after ampersand
driver: rename tx_queue to txqs and rx_queue to rxqs
driver: remove useless check in mvneta_tx_reset() and return void

The test is useless because the function is only called when the port
is stopped.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
driver: reset the RX hardware when stopping the port

This is needed to ensure that the hardware "next RX descriptor index"
value gets reset to 0, so that when the port goes up again, the
hardware starts filling the RX descriptor array from the first
descriptor.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
driver: remove queue_ctrl intermediate structure
driver: fix indentation

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
driver: use 'queue' as counter instead of 'txq'

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
driver: fix comments in mvneta_set_ucast_addr()

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
driver: formatting, indentation issues

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
driver: rename MV_ETH_MISC_SUM_INTR_MASK to MVNETA_ETH_MISC_SUM_INTR_MASK

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>