Skip to content
Snippets Groups Projects
Select Git revision
  • eb79e640fab1fc163e6f04e0cc007c76b6a46f28
  • openEuler-1.0-LTS default protected
  • openEuler-22.09
  • OLK-5.10
  • openEuler-22.03-LTS
  • openEuler-22.03-LTS-Ascend
  • master
  • openEuler-22.03-LTS-LoongArch-NW
  • openEuler-22.09-HCK
  • openEuler-20.03-LTS-SP3
  • openEuler-21.09
  • openEuler-21.03
  • openEuler-20.09
  • 4.19.90-2210.5.0
  • 5.10.0-123.0.0
  • 5.10.0-60.63.0
  • 5.10.0-60.62.0
  • 4.19.90-2210.4.0
  • 5.10.0-121.0.0
  • 5.10.0-60.61.0
  • 4.19.90-2210.3.0
  • 5.10.0-60.60.0
  • 5.10.0-120.0.0
  • 5.10.0-60.59.0
  • 5.10.0-119.0.0
  • 4.19.90-2210.2.0
  • 4.19.90-2210.1.0
  • 5.10.0-118.0.0
  • 5.10.0-106.19.0
  • 5.10.0-60.58.0
  • 4.19.90-2209.6.0
  • 5.10.0-106.18.0
  • 5.10.0-106.17.0
33 results

xgbe-dev.c

Blame
  • mvpp2.c 254.83 KiB
    /*
     * Driver for Marvell PPv2 network controller for Armada 375 SoC.
     *
     * Copyright (C) 2014 Marvell
     *
     * Marcin Wojtas <mw@semihalf.com>
     *
     * This file is licensed under the terms of the GNU General Public
     * License version 2. This program is licensed "as is" without any
     * warranty of any kind, whether express or implied.
     */
    
    #include <linux/acpi.h>
    #include <linux/kernel.h>
    #include <linux/netdevice.h>
    #include <linux/etherdevice.h>
    #include <linux/platform_device.h>
    #include <linux/skbuff.h>
    #include <linux/inetdevice.h>
    #include <linux/mbus.h>
    #include <linux/module.h>
    #include <linux/mfd/syscon.h>
    #include <linux/interrupt.h>
    #include <linux/cpumask.h>
    #include <linux/of.h>
    #include <linux/of_irq.h>
    #include <linux/of_mdio.h>
    #include <linux/of_net.h>
    #include <linux/of_address.h>
    #include <linux/of_device.h>
    #include <linux/phy.h>
    #include <linux/phylink.h>
    #include <linux/phy/phy.h>
    #include <linux/clk.h>
    #include <linux/hrtimer.h>
    #include <linux/ktime.h>
    #include <linux/regmap.h>
    #include <uapi/linux/ppp_defs.h>
    #include <net/ip.h>
    #include <net/ipv6.h>
    #include <net/tso.h>
    
    /* Fifo Registers */
    #define MVPP2_RX_DATA_FIFO_SIZE_REG(port)	(0x00 + 4 * (port))
    #define MVPP2_RX_ATTR_FIFO_SIZE_REG(port)	(0x20 + 4 * (port))
    #define MVPP2_RX_MIN_PKT_SIZE_REG		0x60
    #define MVPP2_RX_FIFO_INIT_REG			0x64
    #define MVPP22_TX_FIFO_THRESH_REG(port)		(0x8840 + 4 * (port))
    #define MVPP22_TX_FIFO_SIZE_REG(port)		(0x8860 + 4 * (port))
    
    /* RX DMA Top Registers */
    #define MVPP2_RX_CTRL_REG(port)			(0x140 + 4 * (port))
    #define     MVPP2_RX_LOW_LATENCY_PKT_SIZE(s)	(((s) & 0xfff) << 16)
    #define     MVPP2_RX_USE_PSEUDO_FOR_CSUM_MASK	BIT(31)
    #define MVPP2_POOL_BUF_SIZE_REG(pool)		(0x180 + 4 * (pool))
    #define     MVPP2_POOL_BUF_SIZE_OFFSET		5
    #define MVPP2_RXQ_CONFIG_REG(rxq)		(0x800 + 4 * (rxq))
    #define     MVPP2_SNOOP_PKT_SIZE_MASK		0x1ff
    #define     MVPP2_SNOOP_BUF_HDR_MASK		BIT(9)
    #define     MVPP2_RXQ_POOL_SHORT_OFFS		20
    #define     MVPP21_RXQ_POOL_SHORT_MASK		0x700000
    #define     MVPP22_RXQ_POOL_SHORT_MASK		0xf00000
    #define     MVPP2_RXQ_POOL_LONG_OFFS		24
    #define     MVPP21_RXQ_POOL_LONG_MASK		0x7000000
    #define     MVPP22_RXQ_POOL_LONG_MASK		0xf000000
    #define     MVPP2_RXQ_PACKET_OFFSET_OFFS	28
    #define     MVPP2_RXQ_PACKET_OFFSET_MASK	0x70000000
    #define     MVPP2_RXQ_DISABLE_MASK		BIT(31)
    
    /* Top Registers */