Merge Lean's source

This commit is contained in:
CN_SZTL 2020-04-17 22:37:21 +08:00
commit 1211ab828d
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
30 changed files with 241 additions and 454 deletions

View File

@ -7,10 +7,10 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=n2n_v2 VPN Configuration module
LUCI_DEPENDS:=+n2n_v2
LUCI_DEPENDS:=+n2n-edge +n2n-supernode
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=3
PKG_RELEASE:=4
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -1,53 +1,81 @@
#
# Copyright (C) 2007-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# Copyright (C) 2020 - ntop.org and contributors
#
include $(TOPDIR)/rules.mk
PKG_NAME:=n2n_v2
PKG_VERSION:=2.4
PKG_RELEASE:=2
PKG_REV=25563f31d9aba5f61b3e2fb42941b66dad1f531f
PKG_NAME:=n2n
PKG_SOURCE_URL:=https://github.com/ntop/n2n.git
PKG_SOURCE_VERSION:=bc0a6bf8b78c90dd902efa75891d41d2a489286e
PKG_VERSION:=2.6.0_git-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REV).tar.bz2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_URL:=https://github.com/ntop/n2n.git
PKG_MAINTAINER:=Emanuele Faranda <faranda@ntop.org>
PKG_LICENSE:=GPL3
PKG_BUILD_PARALLEL:=1
# autogen fix
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define Package/n2n_v2
define Package/n2n/Default
SECTION:=net
CATEGORY:=Network
TITLE:=N2N VPN tunneling daemon(V2)
URL:=http://www.ntop.org/n2n/
TITLE:=N2N Peer-to-peer VPN
URL:=http://www.ntop.org/n2n
SUBMENU:=VPN
DEPENDS:=+libpthread +kmod-tun +libopenssl
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
INSTALL_PROG=":"
define Package/n2n-edge
$(call Package/n2n/Default)
TITLE+= client (edge node)
DEPENDS+=+kmod-tun +resolveip +libopenssl
endef
define Package/n2n_v2/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/edge $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/supernode $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/n2n_v2.config $(1)/etc/config/n2n_v2
define Package/n2n-supernode
$(call Package/n2n/Default)
TITLE+= server (supernode)
endef
define Package/n2n-edge/description
The client node for the N2N infrastructure
endef
define Package/n2n-supernode/description
The supernode for the N2N infrastructure
endef
define Build/Configure
( cd $(PKG_BUILD_DIR); ./autogen.sh )
$(call Build/Configure/Default)
endef
define Package/n2n-edge/conffiles
/etc/config/n2n-edge.conf
endef
define Package/n2n-edge/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/edge $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/n2n_v2.init $(1)/etc/init.d/n2n_v2
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/n2n_v2.config $(1)/etc/config/n2n_v2
endef
define Package/n2n_v2/conffiles
/etc/config/n2n_v2
define Package/n2n-supernode/conffiles
/etc/config/n2n-supernode.conf
endef
$(eval $(call BuildPackage,n2n_v2))
define Package/n2n-supernode/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/supernode $(1)/usr/bin/
endef
$(eval $(call BuildPackage,n2n-edge))
$(eval $(call BuildPackage,n2n-supernode))

View File

@ -1,15 +1,15 @@
config edge
option enabled '0'
option tunname 'n2n_edge'
option mode 'static'
option ipaddr '10.0.0.100'
option netmask '255.255.255.0'
option supernode '1.2.3.4'
option port '1234'
option community 'example'
option key 'password'
option route '0'
option enabled '0'
option tunname 'n2n0'
option mode 'static'
option ipaddr '10.0.0.100'
option netmask '255.255.255.0'
option supernode '1.2.3.4'
option port '1234'
option community 'example'
option key 'password'
option route '0'
config supernode
option enabled '0'
option port '1235'
option enabled '0'
option port '1235'

View File

@ -1,64 +1,64 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2012 OpenWrt.org
# Copyright (C) 2008-2020 OpenWrt.org
START=99
start_instance() {
local cfg="$1"
local cfg="$1"
config_get type "$cfg" TYPE
config_get type "$cfg" TYPE
case "$type" in
edge)
case "$type" in
edge)
config_get_bool enabled "$cfg" 'enabled' '0'
[ "$enabled" = "0" ] && return 1
config_get tunname "$cfg" 'tunname'
config_get mode "$cfg" 'mode'
config_get ipaddr "$cfg" 'ipaddr'
config_get ipaddr "$cfg" 'ipaddr'
config_get netmask "$cfg" 'netmask'
config_get mtu "$cfg" 'mtu'
config_get supernode "$cfg" 'supernode'
config_get port "$cfg" 'port'
config_get community "$cfg" 'community'
config_get key "$cfg" 'key'
config_get_bool route "$cfg" 'route' '0'
[ "$route" = "1" ] && args='-r'
config_get supernode "$cfg" 'supernode'
config_get port "$cfg" 'port'
config_get community "$cfg" 'community'
config_get key "$cfg" 'key'
config_get_bool route "$cfg" 'route' '0'
[ "$route" = "1" ] && args='-r'
[ "$mode" = 'dhcp' ] && ipaddr='0.0.0.0'
[ "-$mtu" != "-" ] && mtu="-M $mtu"
/usr/sbin/edge -d $tunname -a ${mode}:${ipaddr} -c $community $([ -n "$key" ] && echo -k $key) -s ${netmask} -l ${supernode}:${port} $args $mtu
;;
supernode)
/usr/bin/edge -d $tunname -a ${mode}:${ipaddr} -c $community $([ -n "$key" ] && echo -k $key) -s ${netmask} -l ${supernode}:${port} $args $mtu
;;
supernode)
config_get_bool enabled "$cfg" 'enabled' '0'
[ "$enabled" = "0" ] && return 1
config_get port "$cfg" port
/usr/sbin/supernode -l $port &
;;
esac
config_get port "$cfg" port
/usr/bin/supernode -l $port &
;;
esac
}
stop_instance() {
local cfg="$1"
local cfg="$1"
config_get type "$cfg" TYPE
config_get type "$cfg" TYPE
case "$type" in
edge)
killall -9 edge
;;
supernode)
killall -9 supernode
;;
esac
case "$type" in
edge)
killall -9 edge
;;
supernode)
killall -9 supernode
;;
esac
}
start() {
config_load 'n2n_v2'
config_foreach start_instance 'edge'
config_foreach start_instance 'supernode'
config_load 'n2n_v2'
config_foreach start_instance 'edge'
config_foreach start_instance 'supernode'
}
stop() {
config_load 'n2n_v2'
config_load 'n2n_v2'
killall -9 edge
ps | grep supernode | grep -v grep 2>&1 >/dev/null && killall -9 supernode
}

View File

@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
#include "xhci.h"
#include "xhci-trace.h"
@@ -264,6 +266,458 @@ static void xhci_pme_acpi_rtd3_enable(st
@@ -265,6 +267,458 @@ static void xhci_pme_acpi_rtd3_enable(st
static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
#endif /* CONFIG_ACPI */
@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
/* called during probe() after chip reset completes */
static int xhci_pci_setup(struct usb_hcd *hcd)
{
@@ -305,6 +759,22 @@ static int xhci_pci_probe(struct pci_dev
@@ -306,6 +760,22 @@ static int xhci_pci_probe(struct pci_dev
struct hc_driver *driver;
struct usb_hcd *hcd;
@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
driver = (struct hc_driver *)id->driver_data;
/* Prevent runtime suspending between USB-2 and USB-3 initialization */
@@ -363,6 +833,16 @@ static void xhci_pci_remove(struct pci_d
@@ -364,6 +834,16 @@ static void xhci_pci_remove(struct pci_d
{
struct xhci_hcd *xhci;

View File

@ -13,7 +13,7 @@ produce a noisy warning.
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -217,6 +217,7 @@ static void xhci_pci_quirks(struct devic
@@ -218,6 +218,7 @@ static void xhci_pci_quirks(struct devic
pdev->device == 0x0015) {
xhci->quirks |= XHCI_RESET_ON_RESUME;
xhci->quirks |= XHCI_ZERO_64B_REGS;

View File

@ -223,7 +223,7 @@
#include <linux/uaccess.h>
#include <linux/ipv6.h>
#include <linux/icmpv6.h>
@@ -820,10 +821,10 @@ static void tcp_v6_send_response(const s
@@ -819,10 +820,10 @@ static void tcp_v6_send_response(const s
topt = (__be32 *)(t1 + 1);
if (tsecr) {

View File

@ -0,0 +1,68 @@
From 8d8cdb4a6ccee5b62cc0dc64651c3946364514dc Mon Sep 17 00:00:00 2001
From: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Date: Mon, 10 Feb 2020 16:11:27 -0300
Subject: [PATCH] spi: ath79: Implement the spi_mem interface
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
---
drivers/spi/spi-ath79.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
--- a/drivers/spi/spi-ath79.c
+++ b/drivers/spi/spi-ath79.c
@@ -19,6 +19,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/spi/spi.h>
+#include <linux/spi/spi-mem.h>
#include <linux/spi/spi_bitbang.h>
#include <linux/bitops.h>
#include <linux/gpio.h>
@@ -203,6 +204,39 @@ static u32 ath79_spi_txrx_mode0(struct s
return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS);
}
+static int ath79_exec_mem_op(struct spi_mem *mem,
+ const struct spi_mem_op *op)
+{
+ struct ath79_spi *sp = ath79_spidev_to_sp(mem->spi);
+
+ /* Ensures that reading is performed on device connected
+ to hardware cs0 */
+ if (mem->spi->chip_select || gpio_is_valid(mem->spi->cs_gpio))
+ return -ENOTSUPP;
+
+ /* Only use for fast-read op. */
+ if (op->cmd.opcode != 0x0b || op->data.dir != SPI_MEM_DATA_IN ||
+ op->addr.nbytes != 3 || op->dummy.nbytes != 1)
+ return -ENOTSUPP;
+
+ /* disable GPIO mode */
+ ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0);
+
+ memcpy_fromio(op->data.buf.in, sp->base + op->addr.val, op->data.nbytes);
+
+ /* enable GPIO mode */
+ ath79_spi_wr(sp, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO);
+
+ /* restore IOC register */
+ ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, sp->ioc_base);
+
+ return 0;
+}
+
+static const struct spi_controller_mem_ops ath79_mem_ops = {
+ .exec_op = ath79_exec_mem_op,
+};
+
static int ath79_spi_probe(struct platform_device *pdev)
{
struct spi_master *master;
@@ -237,6 +271,7 @@ static int ath79_spi_probe(struct platfo
ret = PTR_ERR(sp->base);
goto err_put_master;
}
+ master->mem_ops = &ath79_mem_ops;
sp->clk = devm_clk_get(&pdev->dev, "ahb");
if (IS_ERR(sp->clk)) {

View File

@ -214,7 +214,7 @@
#include <linux/uaccess.h>
#include <linux/ipv6.h>
#include <linux/icmpv6.h>
@@ -837,10 +838,10 @@ static void tcp_v6_send_response(const s
@@ -836,10 +837,10 @@ static void tcp_v6_send_response(const s
topt = (__be32 *)(t1 + 1);
if (tsecr) {

View File

@ -170,7 +170,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
goto out;
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2230,7 +2230,8 @@ EXPORT_SYMBOL(mmc_erase);
@@ -2233,7 +2233,8 @@ EXPORT_SYMBOL(mmc_erase);
int mmc_can_erase(struct mmc_card *card)
{
if ((card->host->caps & MMC_CAP_ERASE) &&

View File

@ -96,7 +96,7 @@ Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+whwave,sd3078 I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -625,6 +625,15 @@ config RTC_DRV_EM3027
@@ -626,6 +626,15 @@ config RTC_DRV_EM3027
This driver can also be built as a module. If so, the module
will be called rtc-em3027.

View File

@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -224,6 +224,10 @@ static void xhci_pci_quirks(struct devic
@@ -225,6 +225,10 @@ static void xhci_pci_quirks(struct devic
pdev->device == 0x3432)
xhci->quirks |= XHCI_BROKEN_STREAMS;

View File

@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -225,8 +225,10 @@ static void xhci_pci_quirks(struct devic
@@ -226,8 +226,10 @@ static void xhci_pci_quirks(struct devic
xhci->quirks |= XHCI_BROKEN_STREAMS;
if (pdev->vendor == PCI_VENDOR_ID_VIA &&

View File

@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
#define USB_VENDOR_ID_BELKIN 0x050d
#define USB_DEVICE_ID_FLIP_KVM 0x3201
@@ -1196,6 +1199,9 @@
@@ -1197,6 +1200,9 @@
#define USB_VENDOR_ID_XAT 0x2505
#define USB_DEVICE_ID_XAT_CSR 0x0220

View File

@ -124,7 +124,7 @@ Acked-by: Eric Anholt <eric@anholt.net>
pinctrl-0 = <&uart0_gpio14>;
--- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
@@ -129,6 +129,13 @@
@@ -130,6 +130,13 @@
};
};

View File

@ -18,9 +18,9 @@ Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
--- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
@@ -119,6 +119,7 @@
#address-cells = <1>;
@@ -120,6 +120,7 @@
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
+ bus-width = <4>;
mmc-pwrseq = <&wifi_pwrseq>;

View File

@ -1,4 +1,3 @@
CONFIG_AHCI_IPQ=y
CONFIG_ALIGNMENT_TRAP=y
# CONFIG_APQ_GCC_8084 is not set
# CONFIG_APQ_MMCC_8084 is not set

View File

@ -1,308 +0,0 @@
From c5ea64dcf7b5d45e402e78b9f291d521669b7b80 Mon Sep 17 00:00:00 2001
From: Kumar Gala <galak@codeaurora.org>
Date: Fri, 30 May 2014 15:35:40 -0500
Subject: [PATCH] ata: Add Qualcomm ARM SoC AHCI SATA host controller driver
Add support for the Qualcomm AHCI SATA controller that exists on several
SoC and specifically the IPQ806x family of chips. The IPQ806x SATA support
requires the associated IPQ806x SATA PHY Driver to be enabled as well.
Signed-off-by: Kumar Gala <galak@codeaurora.org>
Signed-off-by: Gokul Sriram Palanisamy <gpalan@codeaurora.org>
---
drivers/ata/ahci.h | 2 +-
drivers/ata/ahci_ipq.c | 248 ++++++++++++++++++++++++++++++++++++++
drivers/ata/Kconfig | 8 ++++++++
drivers/ata/Makefile | 1 +
4 files changed, 258 insertions(+), 1 deletions(-)
create mode 100644 drivers/ata/ahci_ipq.c
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -54,7 +54,7 @@
enum {
AHCI_MAX_PORTS = 32,
- AHCI_MAX_CLKS = 5,
+ AHCI_MAX_CLKS = 6,
AHCI_MAX_SG = 168, /* hardware max is 64K */
AHCI_DMA_BOUNDARY = 0xffffffff,
AHCI_MAX_CMDS = 32,
--- a/dev/null
+++ b/drivers/ata/ahci_ipq.c
@@ -0,0 +1,248 @@
+/* Copyright (c) 2015 - 2017, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pm.h>
+#include <linux/device.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/libata.h>
+#include <linux/ahci_platform.h>
+#include <linux/acpi.h>
+#include <linux/pci_ids.h>
+#include "libata.h"
+#include "ahci.h"
+
+#define IPQ_DRV_NAME "ahci-ipq"
+
+struct ipq_ahci_priv {
+ struct platform_device *ahci_pdev;
+ struct ahci_host_priv *hpriv;
+ void *preg_reset;
+ int pstate;
+};
+
+struct ipq_ahci_priv *ipqpriv;
+
+static const struct ata_port_info ipq_ahci_port_info = {
+ .flags = AHCI_FLAG_COMMON,
+ .pio_mask = ATA_PIO4,
+ .udma_mask = ATA_UDMA6,
+ .port_ops = &ahci_platform_ops,
+};
+
+static struct scsi_host_template ahci_platform_sht = {
+ AHCI_SHT(IPQ_DRV_NAME),
+};
+
+#define SATA_PWR_STATE_DOWN 0x1
+#define SATA_PWR_STATE_UP 0x2
+#define SATA_RESET 0x00902c1c
+
+static void ipq_ahci_hard_reset(struct device *dev)
+{
+ u32 reg;
+
+ reg = readl_relaxed(ipqpriv->preg_reset);
+ writel_relaxed(reg | BIT(0), ipqpriv->preg_reset);
+ /* To make sure the write is complete before we move on */
+ mb();
+
+ reg = readl_relaxed(ipqpriv->preg_reset);
+ writel_relaxed(reg & (~BIT(0)), ipqpriv->preg_reset);
+ /* To make sure the write is complete before we move on */
+ mb();
+}
+
+static int ipq_ahci_suspend(struct device *dev)
+{
+ struct ata_host *host = dev_get_drvdata(dev);
+ struct device_type *apt = &ata_port_type;
+ const struct dev_pm_ops *pm = apt->pm;
+ struct ata_port *ap;
+ int ret = 0, i;
+
+ if (ipqpriv->pstate == SATA_PWR_STATE_UP) {
+ for (i = 0; i < host->n_ports; i++) {
+ ap = host->ports[i];
+ /* Issue Port PM Suspend */
+ ret = pm->runtime_suspend(&ap->tdev);
+ if (ret) {
+ dev_err(dev, "SATA controller port suspend failed\n");
+ return ret;
+ }
+ }
+
+ /* Issue Contoller PM Suspend */
+ ret = ahci_platform_suspend_host(dev);
+ if (ret) {
+ dev_err(dev, "SATA controller host suspend failed\n");
+ return ret;
+ }
+
+ for (i = 0; i < ipqpriv->hpriv->nports; i++) {
+ if (!ipqpriv->hpriv->phys[i])
+ continue;
+
+ phy_power_off(ipqpriv->hpriv->phys[i]);
+ phy_exit(ipqpriv->hpriv->phys[i]);
+ }
+
+ ahci_platform_disable_clks(ipqpriv->hpriv);
+ ipqpriv->pstate = SATA_PWR_STATE_DOWN;
+ } else {
+ dev_warn(dev, "SATA device already in suspended state");
+ }
+
+ return ret;
+}
+
+static int ipq_ahci_resume(struct device *dev)
+{
+ struct ata_host *host = dev_get_drvdata(dev);
+ struct device_type *apt = &ata_port_type;
+ const struct dev_pm_ops *pm = apt->pm;
+ struct ata_port *ap;
+ int ret = 0, i;
+
+ if (ipqpriv->pstate == SATA_PWR_STATE_DOWN) {
+
+ ahci_platform_enable_clks(ipqpriv->hpriv);
+
+ /* Issue SATA clock hard reset */
+ ipq_ahci_hard_reset(dev);
+
+ for (i = 0; i < ipqpriv->hpriv->nports; i++) {
+ if (!ipqpriv->hpriv->phys[i])
+ continue;
+
+ phy_init(ipqpriv->hpriv->phys[i]);
+ phy_power_on(ipqpriv->hpriv->phys[i]);
+ }
+
+ /* Issue Contoller PM Resume */
+ ret = ahci_platform_resume_host(dev);
+ if (ret) {
+ dev_err(dev, "SATA controller resume failed\n");
+ return ret;
+ }
+
+ for (i = 0; i < host->n_ports; i++) {
+ /* Issue Port PM Resume */
+ ap = host->ports[i];
+ ret = pm->runtime_resume(&ap->tdev);
+ if (ret) {
+ dev_err(dev, "SATA controller port resume failed\n");
+ return ret;
+ }
+ }
+ ipqpriv->pstate = SATA_PWR_STATE_UP;
+ } else {
+ dev_warn(dev, "SATA device already in resume state");
+ }
+
+ return ret;
+}
+
+static int ipq_ahci_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct ahci_host_priv *hpriv;
+ int rc;
+
+ hpriv = ahci_platform_get_resources(pdev);
+ if (IS_ERR(hpriv))
+ return PTR_ERR(hpriv);
+
+ rc = ahci_platform_enable_resources(hpriv);
+ if (rc)
+ return rc;
+
+ of_property_read_u32(dev->of_node,
+ "ports-implemented", &hpriv->force_port_map);
+
+ rc = ahci_platform_init_host(pdev, hpriv, &ipq_ahci_port_info,
+ &ahci_platform_sht);
+
+ if (rc)
+ goto disable_resources;
+
+ ipqpriv = devm_kzalloc(dev, sizeof(*ipqpriv), GFP_KERNEL);
+ if (!ipqpriv) {
+ dev_err(dev, "can't alloc ahci_host_priv\n");
+ rc = -ENOMEM;
+ goto disable_resources;
+ }
+
+ ipqpriv->ahci_pdev = pdev;
+ ipqpriv->hpriv = hpriv;
+ ipqpriv->pstate = SATA_PWR_STATE_UP;
+
+ ipqpriv->preg_reset = devm_ioremap(dev, SATA_RESET,
+ sizeof(*(ipqpriv->preg_reset)));
+
+ if (IS_ERR(ipqpriv->preg_reset)) {
+ dev_err(dev, "can't ioremap for preg_reset\n");
+ rc = -ENOMEM;
+ goto disable_resources;
+ }
+
+ return 0;
+
+ disable_resources:
+ ahci_platform_disable_resources(hpriv);
+ return rc;
+}
+
+int ipq_ahci_remove(struct platform_device *pdev)
+{
+ ata_platform_remove_one(pdev);
+ return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(ipq_ahci_pm_ops, ahci_platform_suspend,
+ ahci_platform_resume);
+
+static const struct of_device_id ipq_ahci_of_match[] = {
+ { .compatible = "qcom,ipq806x-ahci", },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, ipq_ahci_of_match);
+
+static const struct acpi_device_id ahci_acpi_match[] = {
+ { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
+ {},
+};
+
+MODULE_DEVICE_TABLE(acpi, ahci_acpi_match);
+
+static struct platform_driver ipq_ahci_driver = {
+ .probe = ipq_ahci_probe,
+ .remove = ipq_ahci_remove,
+ .driver = {
+ .name = IPQ_DRV_NAME,
+ .of_match_table = ipq_ahci_of_match,
+ .acpi_match_table = ahci_acpi_match,
+ .pm = &ipq_ahci_pm_ops,
+ },
+};
+
+module_platform_driver(ipq_ahci_driver);
+
+MODULE_DESCRIPTION("IPQ806x AHCI SATA platform driver");
+MODULE_ALIAS("platform:ahci-ipq");
+MODULE_LICENSE("Dual BSD/GPL");
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -162,6 +162,14 @@ config AHCI_IMX
If unsure, say N.
+config AHCI_IPQ
+ tristate "Qualcomm Atheros IPQ806X AHCI SATA support"
+ help
+ This option enables support for the IPQ806X SoC's
+ onboard AHCI SATA.
+
+ If unsure, say N.
+
config AHCI_CEVA
tristate "CEVA AHCI SATA support"
depends on OF
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -18,6 +18,7 @@
obj-$(CONFIG_AHCI_DA850) += ahci_da850.o libahci.o libahci_platform.o
obj-$(CONFIG_AHCI_DM816) += ahci_dm816.o libahci.o libahci_platform.o
obj-$(CONFIG_AHCI_IMX) += ahci_imx.o libahci.o libahci_platform.o
+obj-$(CONFIG_AHCI_IPQ) += ahci_ipq.o libahci.o libahci_platform.o
obj-$(CONFIG_AHCI_MTK) += ahci_mtk.o libahci.o libahci_platform.o
obj-$(CONFIG_AHCI_MVEBU) += ahci_mvebu.o libahci.o libahci_platform.o
obj-$(CONFIG_AHCI_OCTEON) += ahci_octeon.o

View File

@ -1,6 +1,6 @@
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -833,6 +833,7 @@ static int serial8250_probe(struct platf
@@ -832,6 +832,7 @@ static int serial8250_probe(struct platf
uart.port.get_mctrl = p->get_mctrl;
uart.port.pm = p->pm;
uart.port.dev = &dev->dev;
@ -8,7 +8,7 @@
uart.port.irqflags |= irqflag;
ret = serial8250_register_8250_port(&uart);
if (ret < 0) {
@@ -989,6 +990,7 @@ int serial8250_register_8250_port(struct
@@ -988,6 +989,7 @@ int serial8250_register_8250_port(struct
uart->bugs = up->bugs;
uart->port.mapbase = up->port.mapbase;
uart->port.mapsize = up->port.mapsize;
@ -105,7 +105,7 @@
case UPIO_AU:
p->serial_out(p, offset, value);
p->serial_in(p, UART_LCR); /* safe, no side-effects */
@@ -2759,6 +2779,7 @@ static int serial8250_request_std_resour
@@ -2763,6 +2783,7 @@ static int serial8250_request_std_resour
case UPIO_MEM32BE:
case UPIO_MEM16:
case UPIO_MEM:
@ -113,7 +113,7 @@
if (!port->mapbase)
break;
@@ -2797,6 +2818,7 @@ static void serial8250_release_std_resou
@@ -2801,6 +2822,7 @@ static void serial8250_release_std_resou
case UPIO_MEM32BE:
case UPIO_MEM16:
case UPIO_MEM:

View File

@ -1304,7 +1304,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
}
static const struct net_device_ops dpaa_ops = {
@@ -2654,7 +2936,6 @@ static inline u16 dpaa_get_headroom(stru
@@ -2652,7 +2934,6 @@ static inline u16 dpaa_get_headroom(stru
static int dpaa_eth_probe(struct platform_device *pdev)
{
struct dpaa_bp *dpaa_bps[DPAA_BPS_NUM] = {NULL};
@ -1312,7 +1312,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
struct net_device *net_dev = NULL;
struct dpaa_fq *dpaa_fq, *tmp;
struct dpaa_priv *priv = NULL;
@@ -2663,7 +2944,51 @@ static int dpaa_eth_probe(struct platfor
@@ -2661,7 +2942,51 @@ static int dpaa_eth_probe(struct platfor
int err = 0, i, channel;
struct device *dev;
@ -1365,7 +1365,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
/* Allocate this early, so we can store relevant information in
* the private area
@@ -2671,7 +2996,7 @@ static int dpaa_eth_probe(struct platfor
@@ -2669,7 +2994,7 @@ static int dpaa_eth_probe(struct platfor
net_dev = alloc_etherdev_mq(sizeof(*priv), DPAA_ETH_TXQ_NUM);
if (!net_dev) {
dev_err(dev, "alloc_etherdev_mq() failed\n");
@ -1374,7 +1374,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
}
/* Do this here, so we can be verbose early */
@@ -2683,13 +3008,6 @@ static int dpaa_eth_probe(struct platfor
@@ -2681,13 +3006,6 @@ static int dpaa_eth_probe(struct platfor
priv->msg_enable = netif_msg_init(debug, DPAA_MSG_DEFAULT);
@ -1388,7 +1388,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
/* If fsl_fm_max_frm is set to a higher value than the all-common 1500,
* we choose conservatively and let the user explicitly set a higher
* MTU via ifconfig. Otherwise, the user may end up with different MTUs
@@ -2705,21 +3023,13 @@ static int dpaa_eth_probe(struct platfor
@@ -2703,21 +3021,13 @@ static int dpaa_eth_probe(struct platfor
priv->buf_layout[RX].priv_data_size = DPAA_RX_PRIV_DATA_SIZE; /* Rx */
priv->buf_layout[TX].priv_data_size = DPAA_TX_PRIV_DATA_SIZE; /* Tx */
@ -1414,7 +1414,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
/* the raw size of the buffers used for reception */
dpaa_bps[i]->raw_size = bpool_buffer_raw_size(i, DPAA_BPS_NUM);
/* avoid runtime computations by keeping the usable size here */
@@ -2727,11 +3037,8 @@ static int dpaa_eth_probe(struct platfor
@@ -2725,11 +3035,8 @@ static int dpaa_eth_probe(struct platfor
dpaa_bps[i]->dev = dev;
err = dpaa_bp_alloc_pool(dpaa_bps[i]);
@ -1428,7 +1428,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
priv->dpaa_bps[i] = dpaa_bps[i];
}
@@ -2742,7 +3049,7 @@ static int dpaa_eth_probe(struct platfor
@@ -2740,7 +3047,7 @@ static int dpaa_eth_probe(struct platfor
err = dpaa_alloc_all_fqs(dev, &priv->dpaa_fq_list, &port_fqs);
if (err < 0) {
dev_err(dev, "dpaa_alloc_all_fqs() failed\n");
@ -1437,7 +1437,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
}
priv->mac_dev = mac_dev;
@@ -2751,12 +3058,12 @@ static int dpaa_eth_probe(struct platfor
@@ -2749,12 +3056,12 @@ static int dpaa_eth_probe(struct platfor
if (channel < 0) {
dev_err(dev, "dpaa_get_channel() failed\n");
err = channel;
@ -1452,7 +1452,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
* and add this pool channel to each's dequeue mask.
*/
dpaa_eth_add_channel(priv->channel);
@@ -2771,20 +3078,20 @@ static int dpaa_eth_probe(struct platfor
@@ -2769,20 +3076,20 @@ static int dpaa_eth_probe(struct platfor
err = dpaa_eth_cgr_init(priv);
if (err < 0) {
dev_err(dev, "Error initializing CGR\n");
@ -1476,7 +1476,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
}
priv->tx_headroom = dpaa_get_headroom(&priv->buf_layout[TX]);
@@ -2794,7 +3101,7 @@ static int dpaa_eth_probe(struct platfor
@@ -2792,7 +3099,7 @@ static int dpaa_eth_probe(struct platfor
err = dpaa_eth_init_ports(mac_dev, dpaa_bps, DPAA_BPS_NUM, &port_fqs,
&priv->buf_layout[0], dev);
if (err)
@ -1485,7 +1485,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
/* Rx traffic distribution based on keygen hashing defaults to on */
priv->keygen_in_use = true;
@@ -2803,11 +3110,7 @@ static int dpaa_eth_probe(struct platfor
@@ -2801,11 +3108,7 @@ static int dpaa_eth_probe(struct platfor
if (!priv->percpu_priv) {
dev_err(dev, "devm_alloc_percpu() failed\n");
err = -ENOMEM;
@ -1498,7 +1498,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
}
priv->num_tc = 1;
@@ -2816,11 +3119,11 @@ static int dpaa_eth_probe(struct platfor
@@ -2814,11 +3117,11 @@ static int dpaa_eth_probe(struct platfor
/* Initialize NAPI */
err = dpaa_napi_add(net_dev);
if (err < 0)
@ -1512,7 +1512,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
dpaa_eth_sysfs_init(&net_dev->dev);
@@ -2829,32 +3132,21 @@ static int dpaa_eth_probe(struct platfor
@@ -2827,32 +3130,21 @@ static int dpaa_eth_probe(struct platfor
return 0;
@ -1551,7 +1551,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
return err;
}
@@ -2891,6 +3183,23 @@ static int dpaa_remove(struct platform_d
@@ -2889,6 +3181,23 @@ static int dpaa_remove(struct platform_d
return err;
}
@ -1575,7 +1575,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
static const struct platform_device_id dpaa_devtype[] = {
{
.name = "dpaa-ethernet",
@@ -2915,6 +3224,10 @@ static int __init dpaa_load(void)
@@ -2913,6 +3222,10 @@ static int __init dpaa_load(void)
pr_debug("FSL DPAA Ethernet driver\n");
@ -1698,7 +1698,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
+fsl_dpaa_mac-objs:= mac.o fman_dtsec.o fman_memac.o fman_tgec.o
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -629,6 +629,7 @@ static void set_port_order_restoration(s
@@ -634,6 +634,7 @@ static void set_port_order_restoration(s
iowrite32be(tmp, &fpm_rg->fmfp_prc);
}
@ -1706,7 +1706,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
static void set_port_liodn(struct fman *fman, u8 port_id,
u32 liodn_base, u32 liodn_ofst)
{
@@ -646,6 +647,27 @@ static void set_port_liodn(struct fman *
@@ -651,6 +652,27 @@ static void set_port_liodn(struct fman *
iowrite32be(tmp, &fman->dma_regs->fmdmplr[port_id / 2]);
iowrite32be(liodn_ofst, &fman->bmi_regs->fmbm_spliodn[port_id - 1]);
}
@ -1734,7 +1734,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
static void enable_rams_ecc(struct fman_fpm_regs __iomem *fpm_rg)
{
@@ -1914,7 +1936,10 @@ _return:
@@ -1919,7 +1941,10 @@ _return:
static int fman_init(struct fman *fman)
{
struct fman_cfg *cfg = NULL;
@ -1746,7 +1746,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
if (is_init_done(fman->cfg))
return -EINVAL;
@@ -1934,6 +1959,7 @@ static int fman_init(struct fman *fman)
@@ -1939,6 +1964,7 @@ static int fman_init(struct fman *fman)
memset_io((void __iomem *)(fman->base_addr + CGP_OFFSET), 0,
fman->state->fm_port_num_of_cg);
@ -1754,7 +1754,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
/* Save LIODN info before FMan reset
* Skipping non-existent port 0 (i = 1)
*/
@@ -1953,6 +1979,9 @@ static int fman_init(struct fman *fman)
@@ -1958,6 +1984,9 @@ static int fman_init(struct fman *fman)
}
fman->liodn_base[i] = liodn_base;
}
@ -1764,7 +1764,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
err = fman_reset(fman);
if (err)
@@ -2181,8 +2210,12 @@ int fman_set_port_params(struct fman *fm
@@ -2186,8 +2215,12 @@ int fman_set_port_params(struct fman *fm
if (err)
goto return_err;
@ -1777,7 +1777,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
if (fman->state->rev_info.major < 6)
set_port_order_restoration(fman->fpm_regs, port_id);
@@ -2800,7 +2833,8 @@ static struct fman *read_dts_node(struct
@@ -2813,7 +2846,8 @@ static struct fman *read_dts_node(struct
of_node_put(muram_node);
@ -1789,7 +1789,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
__func__, irq, err);
--- a/drivers/net/ethernet/freescale/fman/fman.h
+++ b/drivers/net/ethernet/freescale/fman/fman.h
@@ -41,6 +41,7 @@
@@ -42,6 +42,7 @@
/* Frame queue Context Override */
#define FM_FD_CMD_FCO 0x80000000
#define FM_FD_CMD_RPD 0x40000000 /* Read Prepended Data */
@ -1797,7 +1797,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
#define FM_FD_CMD_DTC 0x10000000 /* Do L4 Checksum */
/* TX-Port: Unsupported Format */
@@ -345,8 +346,12 @@ struct fman {
@@ -346,8 +347,12 @@ struct fman {
unsigned long fifo_offset;
size_t fifo_size;

View File

@ -65,7 +65,7 @@ Signed-off-by: Biwen Li <biwen.li@nxp.com>
+};
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -433,6 +433,14 @@ config RTC_DRV_PCF85063
@@ -434,6 +434,14 @@ config RTC_DRV_PCF85063
This driver can also be built as a module. If so, the module
will be called rtc-pcf85063.

View File

@ -536,7 +536,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
irq = dwc3_gadget_get_irq(dwc);
if (irq < 0) {
@@ -3299,6 +3300,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
@@ -3298,6 +3299,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed);

View File

@ -610,7 +610,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
int err;
- int irq = 0;
int id;
char name[20];
char name[24];
enum pci_barno bar;
@@ -486,12 +665,15 @@ static int pci_endpoint_test_probe(struc
test->alignment = 0;

View File

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4272,6 +4272,15 @@ static int mvneta_ethtool_set_eee(struct
@@ -4271,6 +4271,15 @@ static int mvneta_ethtool_set_eee(struct
return phylink_ethtool_set_eee(pp->phylink, eee);
}
@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
@@ -4282,6 +4291,7 @@ static const struct net_device_ops mvnet
@@ -4281,6 +4290,7 @@ static const struct net_device_ops mvnet
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64,
.ndo_do_ioctl = mvneta_ioctl,

View File

@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define MVNETA_MIB_COUNTERS_BASE 0x3000
#define MVNETA_MIB_LATE_COLLISION 0x7c
#define MVNETA_DA_FILT_SPEC_MCAST 0x3400
@@ -3359,6 +3361,7 @@ static void mvneta_validate(struct net_d
@@ -3358,6 +3360,7 @@ static void mvneta_validate(struct net_d
if (state->interface != PHY_INTERFACE_MODE_NA &&
state->interface != PHY_INTERFACE_MODE_QSGMII &&
state->interface != PHY_INTERFACE_MODE_SGMII &&
@ -40,7 +40,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
!phy_interface_mode_is_8023z(state->interface) &&
!phy_interface_mode_is_rgmii(state->interface)) {
bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
@@ -3371,9 +3374,15 @@ static void mvneta_validate(struct net_d
@@ -3370,9 +3373,15 @@ static void mvneta_validate(struct net_d
/* Asymmetric pause is unsupported */
phylink_set(mask, Pause);
@ -59,7 +59,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!phy_interface_mode_is_8023z(state->interface)) {
/* 10M and 100M are only supported in non-802.3z mode */
@@ -3434,12 +3443,14 @@ static void mvneta_mac_config(struct net
@@ -3433,12 +3442,14 @@ static void mvneta_mac_config(struct net
struct mvneta_port *pp = netdev_priv(ndev);
u32 new_ctrl0, gmac_ctrl0 = mvreg_read(pp, MVNETA_GMAC_CTRL_0);
u32 new_ctrl2, gmac_ctrl2 = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
@ -74,7 +74,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
new_clk = gmac_clk & ~MVNETA_GMAC_1MS_CLOCK_ENABLE;
new_an = gmac_an & ~(MVNETA_GMAC_INBAND_AN_ENABLE |
MVNETA_GMAC_INBAND_RESTART_AN |
@@ -3472,7 +3483,7 @@ static void mvneta_mac_config(struct net
@@ -3471,7 +3482,7 @@ static void mvneta_mac_config(struct net
if (state->duplex)
new_an |= MVNETA_GMAC_CONFIG_FULL_DUPLEX;
@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
new_an |= MVNETA_GMAC_CONFIG_GMII_SPEED;
else if (state->speed == SPEED_100)
new_an |= MVNETA_GMAC_CONFIG_MII_SPEED;
@@ -3511,10 +3522,18 @@ static void mvneta_mac_config(struct net
@@ -3510,10 +3521,18 @@ static void mvneta_mac_config(struct net
MVNETA_GMAC_FORCE_LINK_DOWN);
}

View File

@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3361,7 +3361,6 @@ static void mvneta_validate(struct net_d
@@ -3360,7 +3360,6 @@ static void mvneta_validate(struct net_d
if (state->interface != PHY_INTERFACE_MODE_NA &&
state->interface != PHY_INTERFACE_MODE_QSGMII &&
state->interface != PHY_INTERFACE_MODE_SGMII &&
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
!phy_interface_mode_is_8023z(state->interface) &&
!phy_interface_mode_is_rgmii(state->interface)) {
bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
@@ -3375,14 +3374,9 @@ static void mvneta_validate(struct net_d
@@ -3374,14 +3373,9 @@ static void mvneta_validate(struct net_d
/* Asymmetric pause is unsupported */
phylink_set(mask, Pause);

View File

@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4268,8 +4268,7 @@ static int mvneta_ethtool_set_eee(struct
@@ -4267,8 +4267,7 @@ static int mvneta_ethtool_set_eee(struct
/* The Armada 37x documents do not give limits for this other than
* it being an 8-bit register. */

View File

@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct mvneta_bm *bm_priv;
struct mvneta_bm_pool *pool_long;
@@ -3168,6 +3170,8 @@ static void mvneta_start_dev(struct mvne
@@ -3167,6 +3169,8 @@ static void mvneta_start_dev(struct mvne
{
int cpu;
@ -40,7 +40,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mvneta_max_rx_size_set(pp, pp->pkt_size);
mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
@@ -3230,6 +3234,8 @@ static void mvneta_stop_dev(struct mvnet
@@ -3229,6 +3233,8 @@ static void mvneta_stop_dev(struct mvnet
mvneta_tx_reset(pp);
mvneta_rx_reset(pp);
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void mvneta_percpu_enable(void *arg)
@@ -3355,6 +3361,7 @@ static int mvneta_set_mac_addr(struct ne
@@ -3354,6 +3360,7 @@ static int mvneta_set_mac_addr(struct ne
static void mvneta_validate(struct net_device *ndev, unsigned long *supported,
struct phylink_link_state *state)
{
@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
/* We only support QSGMII, SGMII, 802.3z and RGMII modes */
@@ -3375,8 +3382,13 @@ static void mvneta_validate(struct net_d
@@ -3374,8 +3381,13 @@ static void mvneta_validate(struct net_d
phylink_set(mask, Pause);
/* Half-duplex at speeds higher than 100Mbit is unsupported */
@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!phy_interface_mode_is_8023z(state->interface)) {
/* 10M and 100M are only supported in non-802.3z mode */
@@ -3390,6 +3402,11 @@ static void mvneta_validate(struct net_d
@@ -3389,6 +3401,11 @@ static void mvneta_validate(struct net_d
__ETHTOOL_LINK_MODE_MASK_NBITS);
bitmap_and(state->advertising, state->advertising, mask,
__ETHTOOL_LINK_MODE_MASK_NBITS);
@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static int mvneta_mac_link_state(struct net_device *ndev,
@@ -3401,7 +3418,9 @@ static int mvneta_mac_link_state(struct
@@ -3400,7 +3417,9 @@ static int mvneta_mac_link_state(struct
gmac_stat = mvreg_read(pp, MVNETA_GMAC_STATUS);
if (gmac_stat & MVNETA_GMAC_SPEED_1000)
@ -96,7 +96,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
else if (gmac_stat & MVNETA_GMAC_SPEED_100)
state->speed = SPEED_100;
else
@@ -3516,12 +3535,20 @@ static void mvneta_mac_config(struct net
@@ -3515,12 +3534,20 @@ static void mvneta_mac_config(struct net
MVNETA_GMAC_FORCE_LINK_DOWN);
}
@ -117,7 +117,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (new_ctrl0 != gmac_ctrl0)
mvreg_write(pp, MVNETA_GMAC_CTRL_0, new_ctrl0);
if (new_ctrl2 != gmac_ctrl2)
@@ -4434,7 +4461,7 @@ static int mvneta_port_power_up(struct m
@@ -4433,7 +4460,7 @@ static int mvneta_port_power_up(struct m
if (phy_mode == PHY_INTERFACE_MODE_QSGMII)
mvreg_write(pp, MVNETA_SERDES_CFG, MVNETA_QSGMII_SERDES_PROTO);
else if (phy_mode == PHY_INTERFACE_MODE_SGMII ||
@ -126,7 +126,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mvreg_write(pp, MVNETA_SERDES_CFG, MVNETA_SGMII_SERDES_PROTO);
else if (!phy_interface_mode_is_rgmii(phy_mode))
return -EINVAL;
@@ -4451,6 +4478,7 @@ static int mvneta_probe(struct platform_
@@ -4450,6 +4477,7 @@ static int mvneta_probe(struct platform_
struct mvneta_port *pp;
struct net_device *dev;
struct phylink *phylink;
@ -134,7 +134,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
const char *dt_mac_addr;
char hw_mac_addr[ETH_ALEN];
const char *mac_from;
@@ -4476,6 +4504,14 @@ static int mvneta_probe(struct platform_
@@ -4475,6 +4503,14 @@ static int mvneta_probe(struct platform_
goto err_free_irq;
}
@ -149,7 +149,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
phylink = phylink_create(dev, pdev->dev.fwnode, phy_mode,
&mvneta_phylink_ops);
if (IS_ERR(phylink)) {
@@ -4492,6 +4528,7 @@ static int mvneta_probe(struct platform_
@@ -4491,6 +4527,7 @@ static int mvneta_probe(struct platform_
pp = netdev_priv(dev);
spin_lock_init(&pp->lock);
pp->phylink = phylink;

View File

@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3166,11 +3166,26 @@ static int mvneta_setup_txqs(struct mvne
@@ -3165,11 +3165,26 @@ static int mvneta_setup_txqs(struct mvne
return 0;
}
@ -56,7 +56,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mvneta_max_rx_size_set(pp, pp->pkt_size);
mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
@@ -3542,12 +3557,15 @@ static void mvneta_mac_config(struct net
@@ -3541,12 +3556,15 @@ static void mvneta_mac_config(struct net
if (state->speed == SPEED_2500)
new_ctrl4 |= MVNETA_GMAC4_SHORT_PREAMBLE_ENABLE;

View File

@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3402,6 +3402,7 @@ static void mvneta_validate(struct net_d
@@ -3401,6 +3401,7 @@ static void mvneta_validate(struct net_d
phylink_set(mask, 1000baseX_Full);
}
if (pp->comphy || state->interface == PHY_INTERFACE_MODE_2500BASEX) {