All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/6] arm: dts: nsp: Add USB nodes to device tree
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Ray Jui, Scott Branden,
	Jon Mason, Florian Fainelli, Kishon Vijay Abraham I
  Cc: bcm-kernel-feedback-list, netdev, devicetree, linux-kernel,
	linux-arm-kernel, Yendapally Reddy Dhananjaya Reddy
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

Add USB nodes to the Northstar plus device tree file

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 arch/arm/boot/dts/bcm-nsp.dtsi   | 57 ++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm958625k.dts | 16 +++++++++++
 2 files changed, 73 insertions(+)

diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi
index 7c9e0fa..acdb576 100644
--- a/arch/arm/boot/dts/bcm-nsp.dtsi
+++ b/arch/arm/boot/dts/bcm-nsp.dtsi
@@ -249,6 +249,34 @@
 			status = "disabled";
 		};
 
+		xhci: usb@29000 {
+			compatible = "generic-xhci";
+			reg = <0x29000 0x1000>;
+			interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&usb3_phy>;
+			phy-names = "usb";
+			status = "disabled";
+		};
+
+		ehci0: usb@2a000 {
+			compatible = "generic-ehci";
+			reg = <0x2a000 0x100>;
+			interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		ohci0: usb@2b000 {
+			compatible = "generic-ohci";
+			reg = <0x2b000 0x100>;
+			interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		mdio: mdio@32000 {
+			compatible = "brcm,iproc-mdio";
+			reg = <0x32000 0x8>;
+		};
+
 		rng: rng@33000 {
 			compatible = "brcm,bcm-nsp-rng";
 			reg = <0x33000 0x14>;
@@ -319,6 +347,30 @@
 					     "sata2";
 		};
 
+		mdio_mux: mdio-mux@3f190 {
+			compatible = "brcm,mdio-mux-nsp";
+			reg = <0x3f190 0x4>,
+			      <0x32000 0x4>;
+			reg-names = "bus-ctrl", "mgmt-ctrl";
+			mdio-parent-bus = <&mdio>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			mdio@0 {
+				reg = <0x0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				usb3_phy: usb3-phy@10 {
+					compatible = "brcm,nsp-usb3-phy";
+					reg = <0x10>;
+					usb3-ctrl-syscon = <&usb3_ctrl>;
+					#phy-cells = <0>;
+					status = "disabled";
+				};
+			};
+		};
+
 		pinctrl: pinctrl@3f1c0 {
 			compatible = "brcm,nsp-pinmux";
 			reg = <0x3f1c0 0x04>,
@@ -367,6 +419,11 @@
 				phy-names = "sata-phy";
 			};
 		};
+
+		usb3_ctrl: syscon@104408 {
+			compatible = "brcm,nsp-usb3-ctrl", "syscon";
+			reg = <0x104408 0x3fc>;
+		};
 	};
 
 	pcie0: pcie@18012000 {
diff --git a/arch/arm/boot/dts/bcm958625k.dts b/arch/arm/boot/dts/bcm958625k.dts
index 05c5f98..c7303fa 100644
--- a/arch/arm/boot/dts/bcm958625k.dts
+++ b/arch/arm/boot/dts/bcm958625k.dts
@@ -53,6 +53,22 @@
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&usb3_phy {
+	status = "okay";
+};
+
+&xhci {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
-- 
2.1.0

^ permalink raw reply related

* [PATCH 6/6] arm: dts: nsp: Add USB nodes to device tree
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

Add USB nodes to the Northstar plus device tree file

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 arch/arm/boot/dts/bcm-nsp.dtsi   | 57 ++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm958625k.dts | 16 +++++++++++
 2 files changed, 73 insertions(+)

diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi
index 7c9e0fa..acdb576 100644
--- a/arch/arm/boot/dts/bcm-nsp.dtsi
+++ b/arch/arm/boot/dts/bcm-nsp.dtsi
@@ -249,6 +249,34 @@
 			status = "disabled";
 		};
 
+		xhci: usb at 29000 {
+			compatible = "generic-xhci";
+			reg = <0x29000 0x1000>;
+			interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&usb3_phy>;
+			phy-names = "usb";
+			status = "disabled";
+		};
+
+		ehci0: usb at 2a000 {
+			compatible = "generic-ehci";
+			reg = <0x2a000 0x100>;
+			interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		ohci0: usb at 2b000 {
+			compatible = "generic-ohci";
+			reg = <0x2b000 0x100>;
+			interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		mdio: mdio at 32000 {
+			compatible = "brcm,iproc-mdio";
+			reg = <0x32000 0x8>;
+		};
+
 		rng: rng at 33000 {
 			compatible = "brcm,bcm-nsp-rng";
 			reg = <0x33000 0x14>;
@@ -319,6 +347,30 @@
 					     "sata2";
 		};
 
+		mdio_mux: mdio-mux at 3f190 {
+			compatible = "brcm,mdio-mux-nsp";
+			reg = <0x3f190 0x4>,
+			      <0x32000 0x4>;
+			reg-names = "bus-ctrl", "mgmt-ctrl";
+			mdio-parent-bus = <&mdio>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			mdio at 0 {
+				reg = <0x0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				usb3_phy: usb3-phy at 10 {
+					compatible = "brcm,nsp-usb3-phy";
+					reg = <0x10>;
+					usb3-ctrl-syscon = <&usb3_ctrl>;
+					#phy-cells = <0>;
+					status = "disabled";
+				};
+			};
+		};
+
 		pinctrl: pinctrl at 3f1c0 {
 			compatible = "brcm,nsp-pinmux";
 			reg = <0x3f1c0 0x04>,
@@ -367,6 +419,11 @@
 				phy-names = "sata-phy";
 			};
 		};
+
+		usb3_ctrl: syscon at 104408 {
+			compatible = "brcm,nsp-usb3-ctrl", "syscon";
+			reg = <0x104408 0x3fc>;
+		};
 	};
 
 	pcie0: pcie at 18012000 {
diff --git a/arch/arm/boot/dts/bcm958625k.dts b/arch/arm/boot/dts/bcm958625k.dts
index 05c5f98..c7303fa 100644
--- a/arch/arm/boot/dts/bcm958625k.dts
+++ b/arch/arm/boot/dts/bcm958625k.dts
@@ -53,6 +53,22 @@
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&usb3_phy {
+	status = "okay";
+};
+
+&xhci {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
-- 
2.1.0

^ permalink raw reply related

* [PATCH 5/6] phy: Add USB3 PHY support for Broadcom NSP SoC
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Ray Jui, Scott Branden,
	Jon Mason, Florian Fainelli, Kishon Vijay Abraham I
  Cc: bcm-kernel-feedback-list, netdev, devicetree, linux-kernel,
	linux-arm-kernel, Yendapally Reddy Dhananjaya Reddy
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

This patch adds support for Broadcom NSP USB3 PHY

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 drivers/phy/Kconfig            |   9 +++
 drivers/phy/Makefile           |   1 +
 drivers/phy/phy-bcm-nsp-usb3.c | 176 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 186 insertions(+)
 create mode 100644 drivers/phy/phy-bcm-nsp-usb3.c

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index fe00f91..85cc556 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -489,4 +489,13 @@ config PHY_NS2_PCIE
 	help
 	  Enable this to support the Broadcom Northstar2 PCIe PHY.
 	  If unsure, say N.
+
+config PHY_NSP_USB3
+	tristate "Broadcom NorthStar plus USB3 PHY driver"
+	depends on OF && (ARCH_BCM_NSP || COMPILE_TEST)
+	select GENERIC_PHY
+	default ARCH_BCM_NSP
+	help
+	  Enable this to support the Broadcom Northstar plus USB3 PHY.
+	  If unsure, say N.
 endmenu
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index a534cf5..ba9b4c0 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -60,3 +60,4 @@ obj-$(CONFIG_PHY_PISTACHIO_USB)		+= phy-pistachio-usb.o
 obj-$(CONFIG_PHY_CYGNUS_PCIE)		+= phy-bcm-cygnus-pcie.o
 obj-$(CONFIG_ARCH_TEGRA) += tegra/
 obj-$(CONFIG_PHY_NS2_PCIE)		+= phy-bcm-ns2-pcie.o
+obj-$(CONFIG_PHY_NSP_USB3)		+= phy-bcm-nsp-usb3.o
diff --git a/drivers/phy/phy-bcm-nsp-usb3.c b/drivers/phy/phy-bcm-nsp-usb3.c
new file mode 100644
index 0000000..0033382
--- /dev/null
+++ b/drivers/phy/phy-bcm-nsp-usb3.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2016 Broadcom
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/mfd/syscon.h>
+#include <linux/mdio.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/phy/phy.h>
+#include <linux/regmap.h>
+
+#define NSP_USB3_RST_CTRL_OFFSET	0x3f8
+
+/* mdio reg access */
+#define NSP_USB3_PHY_BASE_ADDR_REG	0x1f
+
+#define NSP_USB3_PHY_PLL30_BLOCK	0x8000
+#define NSP_USB3_PLL_CONTROL		0x01
+#define NSP_USB3_PLLA_CONTROL0		0x0a
+#define NSP_USB3_PLLA_CONTROL1		0x0b
+
+#define NSP_USB3_PHY_TX_PMD_BLOCK	0x8040
+#define NSP_USB3_TX_PMD_CONTROL1	0x01
+
+#define NSP_USB3_PHY_PIPE_BLOCK		0x8060
+#define NSP_USB3_LFPS_CMP		0x02
+#define NSP_USB3_LFPS_DEGLITCH		0x03
+
+struct nsp_usb3_phy {
+	struct regmap *usb3_ctrl;
+	struct phy *phy;
+	struct mdio_device *mdiodev;
+};
+
+static int nsp_usb3_phy_init(struct phy *phy)
+{
+	struct nsp_usb3_phy *iphy = phy_get_drvdata(phy);
+	struct mii_bus *bus = iphy->mdiodev->bus;
+	int addr = iphy->mdiodev->addr;
+	u32 data;
+	int rc;
+
+	rc = regmap_read(iphy->usb3_ctrl, 0, &data);
+	if (rc)
+		return rc;
+	data |= 1;
+	rc = regmap_write(iphy->usb3_ctrl, 0, data);
+	if (rc)
+		return rc;
+
+	rc = regmap_write(iphy->usb3_ctrl, NSP_USB3_RST_CTRL_OFFSET, 1);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
+			   NSP_USB3_PHY_PLL30_BLOCK);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLL_CONTROL, 0x1000);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL0, 0x6400);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL1, 0xc000);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL1, 0x8000);
+	if (rc)
+		return rc;
+
+	rc = regmap_write(iphy->usb3_ctrl, NSP_USB3_RST_CTRL_OFFSET, 0);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLL_CONTROL, 0x9000);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
+			   NSP_USB3_PHY_PIPE_BLOCK);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_LFPS_CMP, 0xf30d);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_LFPS_DEGLITCH, 0x6302);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
+			   NSP_USB3_PHY_TX_PMD_BLOCK);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_TX_PMD_CONTROL1, 0x1003);
+
+	return rc;
+}
+
+static struct phy_ops nsp_usb3_phy_ops = {
+	.init = nsp_usb3_phy_init,
+};
+
+static int nsp_usb3_phy_probe(struct mdio_device *mdiodev)
+{
+	struct device *dev = &mdiodev->dev;
+	struct phy_provider *provider;
+	struct nsp_usb3_phy *iphy;
+
+	iphy = devm_kzalloc(dev, sizeof(*iphy), GFP_KERNEL);
+	if (!iphy)
+		return -ENOMEM;
+	iphy->mdiodev = mdiodev;
+
+	iphy->usb3_ctrl = syscon_regmap_lookup_by_phandle(dev->of_node,
+						 "usb3-ctrl-syscon");
+	if (IS_ERR(iphy->usb3_ctrl))
+		return PTR_ERR(iphy->usb3_ctrl);
+
+	iphy->phy = devm_phy_create(dev, dev->of_node, &nsp_usb3_phy_ops);
+	if (IS_ERR(iphy->phy)) {
+		dev_err(dev, "failed to create PHY\n");
+		return PTR_ERR(iphy->phy);
+	}
+
+	phy_set_drvdata(iphy->phy, iphy);
+
+	provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+	if (IS_ERR(provider)) {
+		dev_err(dev, "could not register PHY provider\n");
+		return PTR_ERR(provider);
+	}
+
+	return 0;
+}
+
+static const struct of_device_id nsp_usb3_phy_of_match[] = {
+	{.compatible = "brcm,nsp-usb3-phy",},
+	{ /* sentinel */ }
+};
+
+static struct mdio_driver nsp_usb3_phy_driver = {
+	.mdiodrv = {
+		.driver = {
+			.name = "nsp-usb3-phy",
+			.of_match_table = nsp_usb3_phy_of_match,
+		},
+	},
+	.probe = nsp_usb3_phy_probe,
+};
+
+mdio_module_driver(nsp_usb3_phy_driver);
+
+MODULE_DESCRIPTION("Broadcom NSP USB3 PHY driver");
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com");
-- 
2.1.0

^ permalink raw reply related

* [PATCH 5/6] phy: Add USB3 PHY support for Broadcom NSP SoC
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

This patch adds support for Broadcom NSP USB3 PHY

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 drivers/phy/Kconfig            |   9 +++
 drivers/phy/Makefile           |   1 +
 drivers/phy/phy-bcm-nsp-usb3.c | 176 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 186 insertions(+)
 create mode 100644 drivers/phy/phy-bcm-nsp-usb3.c

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index fe00f91..85cc556 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -489,4 +489,13 @@ config PHY_NS2_PCIE
 	help
 	  Enable this to support the Broadcom Northstar2 PCIe PHY.
 	  If unsure, say N.
+
+config PHY_NSP_USB3
+	tristate "Broadcom NorthStar plus USB3 PHY driver"
+	depends on OF && (ARCH_BCM_NSP || COMPILE_TEST)
+	select GENERIC_PHY
+	default ARCH_BCM_NSP
+	help
+	  Enable this to support the Broadcom Northstar plus USB3 PHY.
+	  If unsure, say N.
 endmenu
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index a534cf5..ba9b4c0 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -60,3 +60,4 @@ obj-$(CONFIG_PHY_PISTACHIO_USB)		+= phy-pistachio-usb.o
 obj-$(CONFIG_PHY_CYGNUS_PCIE)		+= phy-bcm-cygnus-pcie.o
 obj-$(CONFIG_ARCH_TEGRA) += tegra/
 obj-$(CONFIG_PHY_NS2_PCIE)		+= phy-bcm-ns2-pcie.o
+obj-$(CONFIG_PHY_NSP_USB3)		+= phy-bcm-nsp-usb3.o
diff --git a/drivers/phy/phy-bcm-nsp-usb3.c b/drivers/phy/phy-bcm-nsp-usb3.c
new file mode 100644
index 0000000..0033382
--- /dev/null
+++ b/drivers/phy/phy-bcm-nsp-usb3.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2016 Broadcom
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/mfd/syscon.h>
+#include <linux/mdio.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/phy/phy.h>
+#include <linux/regmap.h>
+
+#define NSP_USB3_RST_CTRL_OFFSET	0x3f8
+
+/* mdio reg access */
+#define NSP_USB3_PHY_BASE_ADDR_REG	0x1f
+
+#define NSP_USB3_PHY_PLL30_BLOCK	0x8000
+#define NSP_USB3_PLL_CONTROL		0x01
+#define NSP_USB3_PLLA_CONTROL0		0x0a
+#define NSP_USB3_PLLA_CONTROL1		0x0b
+
+#define NSP_USB3_PHY_TX_PMD_BLOCK	0x8040
+#define NSP_USB3_TX_PMD_CONTROL1	0x01
+
+#define NSP_USB3_PHY_PIPE_BLOCK		0x8060
+#define NSP_USB3_LFPS_CMP		0x02
+#define NSP_USB3_LFPS_DEGLITCH		0x03
+
+struct nsp_usb3_phy {
+	struct regmap *usb3_ctrl;
+	struct phy *phy;
+	struct mdio_device *mdiodev;
+};
+
+static int nsp_usb3_phy_init(struct phy *phy)
+{
+	struct nsp_usb3_phy *iphy = phy_get_drvdata(phy);
+	struct mii_bus *bus = iphy->mdiodev->bus;
+	int addr = iphy->mdiodev->addr;
+	u32 data;
+	int rc;
+
+	rc = regmap_read(iphy->usb3_ctrl, 0, &data);
+	if (rc)
+		return rc;
+	data |= 1;
+	rc = regmap_write(iphy->usb3_ctrl, 0, data);
+	if (rc)
+		return rc;
+
+	rc = regmap_write(iphy->usb3_ctrl, NSP_USB3_RST_CTRL_OFFSET, 1);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
+			   NSP_USB3_PHY_PLL30_BLOCK);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLL_CONTROL, 0x1000);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL0, 0x6400);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL1, 0xc000);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL1, 0x8000);
+	if (rc)
+		return rc;
+
+	rc = regmap_write(iphy->usb3_ctrl, NSP_USB3_RST_CTRL_OFFSET, 0);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PLL_CONTROL, 0x9000);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
+			   NSP_USB3_PHY_PIPE_BLOCK);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_LFPS_CMP, 0xf30d);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_LFPS_DEGLITCH, 0x6302);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
+			   NSP_USB3_PHY_TX_PMD_BLOCK);
+	if (rc)
+		return rc;
+
+	rc = mdiobus_write(bus, addr, NSP_USB3_TX_PMD_CONTROL1, 0x1003);
+
+	return rc;
+}
+
+static struct phy_ops nsp_usb3_phy_ops = {
+	.init = nsp_usb3_phy_init,
+};
+
+static int nsp_usb3_phy_probe(struct mdio_device *mdiodev)
+{
+	struct device *dev = &mdiodev->dev;
+	struct phy_provider *provider;
+	struct nsp_usb3_phy *iphy;
+
+	iphy = devm_kzalloc(dev, sizeof(*iphy), GFP_KERNEL);
+	if (!iphy)
+		return -ENOMEM;
+	iphy->mdiodev = mdiodev;
+
+	iphy->usb3_ctrl = syscon_regmap_lookup_by_phandle(dev->of_node,
+						 "usb3-ctrl-syscon");
+	if (IS_ERR(iphy->usb3_ctrl))
+		return PTR_ERR(iphy->usb3_ctrl);
+
+	iphy->phy = devm_phy_create(dev, dev->of_node, &nsp_usb3_phy_ops);
+	if (IS_ERR(iphy->phy)) {
+		dev_err(dev, "failed to create PHY\n");
+		return PTR_ERR(iphy->phy);
+	}
+
+	phy_set_drvdata(iphy->phy, iphy);
+
+	provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+	if (IS_ERR(provider)) {
+		dev_err(dev, "could not register PHY provider\n");
+		return PTR_ERR(provider);
+	}
+
+	return 0;
+}
+
+static const struct of_device_id nsp_usb3_phy_of_match[] = {
+	{.compatible = "brcm,nsp-usb3-phy",},
+	{ /* sentinel */ }
+};
+
+static struct mdio_driver nsp_usb3_phy_driver = {
+	.mdiodrv = {
+		.driver = {
+			.name = "nsp-usb3-phy",
+			.of_match_table = nsp_usb3_phy_of_match,
+		},
+	},
+	.probe = nsp_usb3_phy_probe,
+};
+
+mdio_module_driver(nsp_usb3_phy_driver);
+
+MODULE_DESCRIPTION("Broadcom NSP USB3 PHY driver");
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com");
-- 
2.1.0

^ permalink raw reply related

* Re: [PATCH RFC 0/2] ethtool: Add actual port speed reporting
From: Saeed Mahameed @ 2016-11-09  9:32 UTC (permalink / raw)
  To: Mintz, Yuval
  Cc: Gal Pressman, netdev@vger.kernel.org, John W. Linville,
	Vidya Sagar Ravipati, Saeed Mahameed, David Decotigny,
	Ben Hutchings
In-Reply-To: <BL2PR07MB23069B0DB17B981AA43775B18DA00@BL2PR07MB2306.namprd07.prod.outlook.com>

On Wed, Nov 2, 2016 at 5:50 PM, Mintz, Yuval <Yuval.Mintz@cavium.com> wrote:
>> Sending RFC to get feedback for the following ethtool proposal:
>>
>> In some cases such as virtual machines and multi functions (SR-IOV), the actual
>> bandwidth exposed for each machine is not accurately shown in ethtool.
>> Currently ethtool shows only physical port link speed.
>> In our case we would like to show the virtual port operational link speed which
>> in some cases is less than the physical port speed.
>>
>> This will give users better visibility for the actual speed running on their device.
>>
>> $ ethtool ens6
>> ...
>> Speed: 50000Mb/s
>> Actual speed: 25000Mb/s
>
> Not saying this is a bad thing, but where exactly is it listed that ethtool has
> to show the physical port speed?

Well, looking at the ethtool fields you can clearly see those fields
refer only to physical properties of port connector module.
from this you can conclude that the speed field refers to the physical
port speed.

Settings for ens1f0:
Supported ports: [ FIBRE Backplane ]
Supported link modes:   1000baseKX/Full
                       10000baseKR/Full
                       40000baseKR4/Full
                       40000baseCR4/Full
                       40000baseSR4/Full
                       40000baseLR4/Full
                       25000baseCR/Full
                       25000baseKR/Full
                       25000baseSR/Full
                       50000baseCR2/Full
                       50000baseKR2/Full
                       100000baseKR4/Full
                       100000baseSR4/Full
                       100000baseCR4/Full
                       100000baseLR4_ER4/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Advertised link modes:  1000baseKX/Full
                       10000baseKR/Full
                       40000baseKR4/Full
                       40000baseCR4/Full
                       40000baseSR4/Full
                       40000baseLR4/Full
                       25000baseCR/Full
                       25000baseKR/Full
                       25000baseSR/Full
                       50000baseCR2/Full
                       50000baseKR2/Full
                       100000baseKR4/Full
                       100000baseSR4/Full
                       100000baseCR4/Full
                       100000baseLR4_ER4/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100000Mb/s
Duplex: Full
Port: Direct Attach Copper
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Link detected: yes

> E.g., bnx2x shows the logical speed instead, and has been doing that for years.
> [Perhaps that's a past wrongness, but that's how it goes].
>
> And besides, one can argue that in the SR-IOV scenario the VF has no business
> knowing the physical port speed.

Yes for SR-IOV VFs one field (logical) is sufficient.
But in some cases on a native system (no SR-IOV nor virtualization)
there will be a need for both physical and logical speed reporting.
logical speed can be limited for several reasons (NIC Low power mode,
pci (width,gen), Internal HCA rate limiters, etc ... ).

Such information will be more than useful for system administrators
and will not be available if we decide to show only one field.

-Saeed.

^ permalink raw reply

* [PATCH 4/6] net: phy: Initialize mdio clock at probe function
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Ray Jui, Scott Branden,
	Jon Mason, Florian Fainelli, Kishon Vijay Abraham I
  Cc: bcm-kernel-feedback-list, netdev, devicetree, linux-kernel,
	linux-arm-kernel, Yendapally Reddy Dhananjaya Reddy
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

Initialize mdio clock divisor in probe function. The ext bus
bit available in the same register will be used by mdio mux
to enable external mdio.

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 drivers/net/phy/mdio-bcm-iproc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/mdio-bcm-iproc.c b/drivers/net/phy/mdio-bcm-iproc.c
index c0b4e65..46fe1ae 100644
--- a/drivers/net/phy/mdio-bcm-iproc.c
+++ b/drivers/net/phy/mdio-bcm-iproc.c
@@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bus *bus, int phy_id, int reg)
 	if (rc)
 		return rc;
 
-	iproc_mdio_config_clk(priv->base);
-
 	/* Prepare the read operation */
 	cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
 		(reg << MII_DATA_RA_SHIFT) |
@@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_bus *bus, int phy_id,
 	if (rc)
 		return rc;
 
-	iproc_mdio_config_clk(priv->base);
-
 	/* Prepare the write operation */
 	cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
 		(reg << MII_DATA_RA_SHIFT) |
@@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platform_device *pdev)
 	bus->read = iproc_mdio_read;
 	bus->write = iproc_mdio_write;
 
+	iproc_mdio_config_clk(priv->base);
+
 	rc = of_mdiobus_register(bus, pdev->dev.of_node);
 	if (rc) {
 		dev_err(&pdev->dev, "MDIO bus registration failed\n");
-- 
2.1.0

^ permalink raw reply related

* [PATCH 4/6] net: phy: Initialize mdio clock at probe function
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

Initialize mdio clock divisor in probe function. The ext bus
bit available in the same register will be used by mdio mux
to enable external mdio.

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 drivers/net/phy/mdio-bcm-iproc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/mdio-bcm-iproc.c b/drivers/net/phy/mdio-bcm-iproc.c
index c0b4e65..46fe1ae 100644
--- a/drivers/net/phy/mdio-bcm-iproc.c
+++ b/drivers/net/phy/mdio-bcm-iproc.c
@@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bus *bus, int phy_id, int reg)
 	if (rc)
 		return rc;
 
-	iproc_mdio_config_clk(priv->base);
-
 	/* Prepare the read operation */
 	cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
 		(reg << MII_DATA_RA_SHIFT) |
@@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_bus *bus, int phy_id,
 	if (rc)
 		return rc;
 
-	iproc_mdio_config_clk(priv->base);
-
 	/* Prepare the write operation */
 	cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
 		(reg << MII_DATA_RA_SHIFT) |
@@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platform_device *pdev)
 	bus->read = iproc_mdio_read;
 	bus->write = iproc_mdio_write;
 
+	iproc_mdio_config_clk(priv->base);
+
 	rc = of_mdiobus_register(bus, pdev->dev.of_node);
 	if (rc) {
 		dev_err(&pdev->dev, "MDIO bus registration failed\n");
-- 
2.1.0

^ permalink raw reply related

* [PATCH 3/6] net: mdio-mux: Add MDIO mux driver for NSP SoC
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Ray Jui, Scott Branden,
	Jon Mason, Florian Fainelli, Kishon Vijay Abraham I
  Cc: bcm-kernel-feedback-list, netdev, devicetree, linux-kernel,
	linux-arm-kernel, Yendapally Reddy Dhananjaya Reddy
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

NSP SoC supports the mdio multiplexer which has the bus
selection  logic.

This multiplexer has child buses for PCIe, USB. The bus
could be internal or external to SOC where PHYs are attached.

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 drivers/net/phy/Kconfig            |   9 +++
 drivers/net/phy/Makefile           |   1 +
 drivers/net/phy/mdio-mux-bcm-nsp.c | 121 +++++++++++++++++++++++++++++++++++++
 3 files changed, 131 insertions(+)
 create mode 100644 drivers/net/phy/mdio-mux-bcm-nsp.c

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 2651c8d..41cc583 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -63,6 +63,15 @@ config MDIO_BUS_MUX_BCM_IPROC
 	  child MDIO bus to a parent bus. Buses could be internal as well as
 	  external and selection logic lies inside the same multiplexer.
 
+config MDIO_BUS_MUX_BCM_NSP
+	tristate "Broadcom NSP MDIO bus controller"
+	depends on ARCH_BCM_NSP || COMPILE_TEST
+	depends on HAS_IOMEM && OF_MDIO
+	default ARCH_BCM_NSP
+	help
+	  This module provides a driver MDIO multiplexing the busses available
+	  in the Broadcom NSP SoC.
+
 config MDIO_BUS_MUX_GPIO
 	tristate "GPIO controlled MDIO bus multiplexers"
 	depends on OF_GPIO && OF_MDIO
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index e58667d..d5969b2 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_MDIO_BUS_MUX)	+= mdio-mux.o
 obj-$(CONFIG_MDIO_BUS_MUX_BCM_IPROC)	+= mdio-mux-bcm-iproc.o
 obj-$(CONFIG_MDIO_BUS_MUX_GPIO)	+= mdio-mux-gpio.o
 obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) += mdio-mux-mmioreg.o
+obj-$(CONFIG_MDIO_BUS_MUX_BCM_NSP)	+= mdio-mux-bcm-nsp.o
 obj-$(CONFIG_MDIO_CAVIUM)	+= mdio-cavium.o
 obj-$(CONFIG_MDIO_GPIO)		+= mdio-gpio.o
 obj-$(CONFIG_MDIO_HISI_FEMAC)	+= mdio-hisi-femac.o
diff --git a/drivers/net/phy/mdio-mux-bcm-nsp.c b/drivers/net/phy/mdio-mux-bcm-nsp.c
new file mode 100644
index 0000000..75dcb04
--- /dev/null
+++ b/drivers/net/phy/mdio-mux-bcm-nsp.c
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2016 Broadcom
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation (the "GPL").
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 (GPLv2) for more details.
+ */
+
+#include <linux/device.h>
+#include <linux/mdio-mux.h>
+#include <linux/module.h>
+#include <linux/of_address.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
+
+#define NSP_MDIO_EXT_BUS_START_ADDR		16
+#define NSP_MDIO_EXT_SELECT_BIT			BIT(9)
+
+struct nsp_mdiomux_desc {
+	void __iomem *bus_ctrl;
+	void __iomem *mgmt_ctrl;
+	void *mux_handle;
+};
+
+static int mdio_mux_nsp_switch_fn(int current_child, int desired_child,
+				  void *priv)
+{
+	struct nsp_mdiomux_desc *md = priv;
+	u32 data, bus_id;
+
+	/* select internal or external bus */
+	data = readl(md->mgmt_ctrl);
+	if (desired_child == NSP_MDIO_EXT_BUS_START_ADDR)
+		data |= NSP_MDIO_EXT_SELECT_BIT;
+	else
+		data &= ~NSP_MDIO_EXT_SELECT_BIT;
+	writel(data, md->mgmt_ctrl);
+
+	/* select bus number */
+	if (md->bus_ctrl) {
+		bus_id = desired_child & (NSP_MDIO_EXT_BUS_START_ADDR - 1);
+		writel(bus_id, md->bus_ctrl);
+	}
+
+	return 0;
+}
+
+static int mdio_mux_nsp_probe(struct platform_device *pdev)
+{
+	struct nsp_mdiomux_desc *md;
+	struct resource *res;
+	int ret;
+
+	md = devm_kzalloc(&pdev->dev, sizeof(*md), GFP_KERNEL);
+	if (!md)
+		return -ENOMEM;
+
+	/* Bus control is not available in some SoC's */
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "bus-ctrl");
+	if (res) {
+		md->bus_ctrl = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(md->bus_ctrl)) {
+			dev_err(&pdev->dev, "failed to ioremap register\n");
+			return PTR_ERR(md->bus_ctrl);
+		}
+	}
+
+	/* Get management control */
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mgmt-ctrl");
+	if (!res)
+		return -EINVAL;
+
+	md->mgmt_ctrl = ioremap(res->start, resource_size(res));
+	if (!md->mgmt_ctrl)
+		return -ENOMEM;
+
+	ret = mdio_mux_init(&pdev->dev, mdio_mux_nsp_switch_fn,
+			    &md->mux_handle, md, NULL);
+	if (ret != 0) {
+		iounmap(md->mgmt_ctrl);
+		return ret;
+	}
+
+	pdev->dev.platform_data = md;
+	return 0;
+}
+
+static int mdio_mux_nsp_remove(struct platform_device *pdev)
+{
+	struct nsp_mdiomux_desc *md = dev_get_platdata(&pdev->dev);
+
+	iounmap(md->mgmt_ctrl);
+	mdio_mux_uninit(md->mux_handle);
+	return 0;
+}
+
+static const struct of_device_id mdio_mux_nsp_match[] = {
+	{ .compatible = "brcm,mdio-mux-nsp" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mdio_mux_nsp_match);
+
+static struct platform_driver mdio_mux_nsp_driver = {
+	.driver = {
+		.name = "mdio-mux-nsp",
+		.of_match_table = mdio_mux_nsp_match,
+	},
+	.probe = mdio_mux_nsp_probe,
+	.remove = mdio_mux_nsp_remove,
+};
+
+module_platform_driver(mdio_mux_nsp_driver);
+
+MODULE_DESCRIPTION("NSP MDIO Mux Bus Driver");
+MODULE_AUTHOR("Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com");
+MODULE_LICENSE("GPL v2");
-- 
2.1.0

^ permalink raw reply related

* [PATCH 3/6] net: mdio-mux: Add MDIO mux driver for NSP SoC
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

NSP SoC supports the mdio multiplexer which has the bus
selection  logic.

This multiplexer has child buses for PCIe, USB. The bus
could be internal or external to SOC where PHYs are attached.

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 drivers/net/phy/Kconfig            |   9 +++
 drivers/net/phy/Makefile           |   1 +
 drivers/net/phy/mdio-mux-bcm-nsp.c | 121 +++++++++++++++++++++++++++++++++++++
 3 files changed, 131 insertions(+)
 create mode 100644 drivers/net/phy/mdio-mux-bcm-nsp.c

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 2651c8d..41cc583 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -63,6 +63,15 @@ config MDIO_BUS_MUX_BCM_IPROC
 	  child MDIO bus to a parent bus. Buses could be internal as well as
 	  external and selection logic lies inside the same multiplexer.
 
+config MDIO_BUS_MUX_BCM_NSP
+	tristate "Broadcom NSP MDIO bus controller"
+	depends on ARCH_BCM_NSP || COMPILE_TEST
+	depends on HAS_IOMEM && OF_MDIO
+	default ARCH_BCM_NSP
+	help
+	  This module provides a driver MDIO multiplexing the busses available
+	  in the Broadcom NSP SoC.
+
 config MDIO_BUS_MUX_GPIO
 	tristate "GPIO controlled MDIO bus multiplexers"
 	depends on OF_GPIO && OF_MDIO
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index e58667d..d5969b2 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_MDIO_BUS_MUX)	+= mdio-mux.o
 obj-$(CONFIG_MDIO_BUS_MUX_BCM_IPROC)	+= mdio-mux-bcm-iproc.o
 obj-$(CONFIG_MDIO_BUS_MUX_GPIO)	+= mdio-mux-gpio.o
 obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) += mdio-mux-mmioreg.o
+obj-$(CONFIG_MDIO_BUS_MUX_BCM_NSP)	+= mdio-mux-bcm-nsp.o
 obj-$(CONFIG_MDIO_CAVIUM)	+= mdio-cavium.o
 obj-$(CONFIG_MDIO_GPIO)		+= mdio-gpio.o
 obj-$(CONFIG_MDIO_HISI_FEMAC)	+= mdio-hisi-femac.o
diff --git a/drivers/net/phy/mdio-mux-bcm-nsp.c b/drivers/net/phy/mdio-mux-bcm-nsp.c
new file mode 100644
index 0000000..75dcb04
--- /dev/null
+++ b/drivers/net/phy/mdio-mux-bcm-nsp.c
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2016 Broadcom
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation (the "GPL").
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 (GPLv2) for more details.
+ */
+
+#include <linux/device.h>
+#include <linux/mdio-mux.h>
+#include <linux/module.h>
+#include <linux/of_address.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
+
+#define NSP_MDIO_EXT_BUS_START_ADDR		16
+#define NSP_MDIO_EXT_SELECT_BIT			BIT(9)
+
+struct nsp_mdiomux_desc {
+	void __iomem *bus_ctrl;
+	void __iomem *mgmt_ctrl;
+	void *mux_handle;
+};
+
+static int mdio_mux_nsp_switch_fn(int current_child, int desired_child,
+				  void *priv)
+{
+	struct nsp_mdiomux_desc *md = priv;
+	u32 data, bus_id;
+
+	/* select internal or external bus */
+	data = readl(md->mgmt_ctrl);
+	if (desired_child == NSP_MDIO_EXT_BUS_START_ADDR)
+		data |= NSP_MDIO_EXT_SELECT_BIT;
+	else
+		data &= ~NSP_MDIO_EXT_SELECT_BIT;
+	writel(data, md->mgmt_ctrl);
+
+	/* select bus number */
+	if (md->bus_ctrl) {
+		bus_id = desired_child & (NSP_MDIO_EXT_BUS_START_ADDR - 1);
+		writel(bus_id, md->bus_ctrl);
+	}
+
+	return 0;
+}
+
+static int mdio_mux_nsp_probe(struct platform_device *pdev)
+{
+	struct nsp_mdiomux_desc *md;
+	struct resource *res;
+	int ret;
+
+	md = devm_kzalloc(&pdev->dev, sizeof(*md), GFP_KERNEL);
+	if (!md)
+		return -ENOMEM;
+
+	/* Bus control is not available in some SoC's */
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "bus-ctrl");
+	if (res) {
+		md->bus_ctrl = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(md->bus_ctrl)) {
+			dev_err(&pdev->dev, "failed to ioremap register\n");
+			return PTR_ERR(md->bus_ctrl);
+		}
+	}
+
+	/* Get management control */
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mgmt-ctrl");
+	if (!res)
+		return -EINVAL;
+
+	md->mgmt_ctrl = ioremap(res->start, resource_size(res));
+	if (!md->mgmt_ctrl)
+		return -ENOMEM;
+
+	ret = mdio_mux_init(&pdev->dev, mdio_mux_nsp_switch_fn,
+			    &md->mux_handle, md, NULL);
+	if (ret != 0) {
+		iounmap(md->mgmt_ctrl);
+		return ret;
+	}
+
+	pdev->dev.platform_data = md;
+	return 0;
+}
+
+static int mdio_mux_nsp_remove(struct platform_device *pdev)
+{
+	struct nsp_mdiomux_desc *md = dev_get_platdata(&pdev->dev);
+
+	iounmap(md->mgmt_ctrl);
+	mdio_mux_uninit(md->mux_handle);
+	return 0;
+}
+
+static const struct of_device_id mdio_mux_nsp_match[] = {
+	{ .compatible = "brcm,mdio-mux-nsp" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mdio_mux_nsp_match);
+
+static struct platform_driver mdio_mux_nsp_driver = {
+	.driver = {
+		.name = "mdio-mux-nsp",
+		.of_match_table = mdio_mux_nsp_match,
+	},
+	.probe = mdio_mux_nsp_probe,
+	.remove = mdio_mux_nsp_remove,
+};
+
+module_platform_driver(mdio_mux_nsp_driver);
+
+MODULE_DESCRIPTION("NSP MDIO Mux Bus Driver");
+MODULE_AUTHOR("Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com");
+MODULE_LICENSE("GPL v2");
-- 
2.1.0

^ permalink raw reply related

* [PATCH 2/6] dt-bindings: phy: Add documentation for NSP USB3 PHY
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Ray Jui, Scott Branden,
	Jon Mason, Florian Fainelli, Kishon Vijay Abraham I
  Cc: devicetree, netdev, linux-kernel,
	Yendapally Reddy Dhananjaya Reddy, bcm-kernel-feedback-list,
	linux-arm-kernel
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

Add documentation for USB3 PHY available in Northstar plus SoC

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 .../devicetree/bindings/phy/brcm,nsp-usb3-phy.txt  | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt

diff --git a/Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt b/Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt
new file mode 100644
index 0000000..30cf4b9
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt
@@ -0,0 +1,39 @@
+Broadcom USB3 phy binding northstar plus SoC
+This is a child bus node of "brcm,mdio-mux-nsp" node.
+
+Required mdio bus properties:
+- reg: MDIO Bus number for the MDIO interface
+- #address-cells: must be 1
+- #size-cells: must be 0
+
+Required PHY properties:
+- compatible: should be "brcm,nsp-usb3-phy"
+- reg: Phy address in the MDIO interface
+- usb3-ctrl-syscon: handler of syscon node defining physical address
+  of usb3 control register.
+- #phy-cells: must be 0
+
+Required usb3 control properties:
+- compatible: should be "brcm,nsp-usb3-ctrl"
+- reg: offset and length of the control registers
+
+Example:
+
+	mdio@0 {
+		reg = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usb3_phy: usb3-phy@10 {
+			compatible = "brcm,nsp-usb3-phy";
+			reg = <0x10>;
+			usb3-ctrl-syscon = <&usb3_ctrl>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+	}
+
+	usb3_ctrl: syscon@104408 {
+		compatible = "brcm,nsp-usb3-ctrl", "syscon";
+		reg = <0x104408 0x3fc>;
+	};
-- 
2.1.0

^ permalink raw reply related

* [PATCH 2/6] dt-bindings: phy: Add documentation for NSP USB3 PHY
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

Add documentation for USB3 PHY available in Northstar plus SoC

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 .../devicetree/bindings/phy/brcm,nsp-usb3-phy.txt  | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt

diff --git a/Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt b/Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt
new file mode 100644
index 0000000..30cf4b9
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt
@@ -0,0 +1,39 @@
+Broadcom USB3 phy binding northstar plus SoC
+This is a child bus node of "brcm,mdio-mux-nsp" node.
+
+Required mdio bus properties:
+- reg: MDIO Bus number for the MDIO interface
+- #address-cells: must be 1
+- #size-cells: must be 0
+
+Required PHY properties:
+- compatible: should be "brcm,nsp-usb3-phy"
+- reg: Phy address in the MDIO interface
+- usb3-ctrl-syscon: handler of syscon node defining physical address
+  of usb3 control register.
+- #phy-cells: must be 0
+
+Required usb3 control properties:
+- compatible: should be "brcm,nsp-usb3-ctrl"
+- reg: offset and length of the control registers
+
+Example:
+
+	mdio at 0 {
+		reg = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usb3_phy: usb3-phy at 10 {
+			compatible = "brcm,nsp-usb3-phy";
+			reg = <0x10>;
+			usb3-ctrl-syscon = <&usb3_ctrl>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+	}
+
+	usb3_ctrl: syscon at 104408 {
+		compatible = "brcm,nsp-usb3-ctrl", "syscon";
+		reg = <0x104408 0x3fc>;
+	};
-- 
2.1.0

^ permalink raw reply related

* [PATCH 1/6] dt-bindings: mdio-mux: Add documentation for mdio mux for NSP SoC
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Ray Jui, Scott Branden,
	Jon Mason, Florian Fainelli, Kishon Vijay Abraham I
  Cc: bcm-kernel-feedback-list, netdev, devicetree, linux-kernel,
	linux-arm-kernel, Yendapally Reddy Dhananjaya Reddy
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

Add documentation for mdio mux available in Broadcom NSP SoC

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 .../devicetree/bindings/net/brcm,mdio-mux-nsp.txt  | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt

diff --git a/Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt b/Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt
new file mode 100644
index 0000000..b749a2b
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt
@@ -0,0 +1,57 @@
+Properties for an MDIO bus multiplexer available in Broadcom NSP SoC.
+
+This MDIO bus multiplexer defines buses that could access the internal
+phys as well as external to SoCs. When child bus is selected, one needs
+to select the below properties to generate desired MDIO transaction on
+appropriate bus.
+
+Required properties in addition to the generic multiplexer properties:
+
+MDIO multiplexer node:
+- compatible: brcm,mdio-mux-iproc.
+- reg: Should contain registers location and length.
+- reg-names: Should contain the resource reg names.
+	- bus-ctrl: mdio bus control register address space required to
+	  select the bus master. This property is not required for SoC's
+	  that doesn't provide master selection.
+	- mgmt-ctrl: mdio management control register address space
+
+Sub-nodes:
+   Each bus master should be represented as a sub-node.
+
+Sub-nodes required properties:
+- reg: Bus master number. Should be 0x10 to access the external mdio devices.
+- address-cells: should be 1
+- size-cells: should be 0
+
+Every non-ethernet PHY requires a compatible property so that it could be
+probed based on this compatible string.
+
+Additional information regarding generic multiplexer properties can be found
+at- Documentation/devicetree/bindings/net/mdio-mux.txt
+
+example:
+
+	mdio_mux: mdio-mux@3f190 {
+		compatible = "brcm,mdio-mux-nsp";
+		reg = <0x3f190 0x4>,
+		      <0x32000 0x4>;
+		reg-names = "bus-ctrl", "mgmt-ctrl";
+		mdio-parent-bus = <&mdio>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		mdio@0 {
+			reg = <0x0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			usb3_phy: usb3-phy@10 {
+				compatible = "brcm,nsp-usb3-phy";
+				reg = <0x10>;
+				usb3-ctrl-syscon = <&usb3_ctrl>;
+				#phy-cells = <0>;
+				status = "disabled";
+			};
+		};
+	};
-- 
2.1.0

^ permalink raw reply related

* [PATCH 1/6] dt-bindings: mdio-mux: Add documentation for mdio mux for NSP SoC
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1478683994-12008-1-git-send-email-yendapally.reddy@broadcom.com>

Add documentation for mdio mux available in Broadcom NSP SoC

Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
---
 .../devicetree/bindings/net/brcm,mdio-mux-nsp.txt  | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt

diff --git a/Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt b/Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt
new file mode 100644
index 0000000..b749a2b
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt
@@ -0,0 +1,57 @@
+Properties for an MDIO bus multiplexer available in Broadcom NSP SoC.
+
+This MDIO bus multiplexer defines buses that could access the internal
+phys as well as external to SoCs. When child bus is selected, one needs
+to select the below properties to generate desired MDIO transaction on
+appropriate bus.
+
+Required properties in addition to the generic multiplexer properties:
+
+MDIO multiplexer node:
+- compatible: brcm,mdio-mux-iproc.
+- reg: Should contain registers location and length.
+- reg-names: Should contain the resource reg names.
+	- bus-ctrl: mdio bus control register address space required to
+	  select the bus master. This property is not required for SoC's
+	  that doesn't provide master selection.
+	- mgmt-ctrl: mdio management control register address space
+
+Sub-nodes:
+   Each bus master should be represented as a sub-node.
+
+Sub-nodes required properties:
+- reg: Bus master number. Should be 0x10 to access the external mdio devices.
+- address-cells: should be 1
+- size-cells: should be 0
+
+Every non-ethernet PHY requires a compatible property so that it could be
+probed based on this compatible string.
+
+Additional information regarding generic multiplexer properties can be found
+at- Documentation/devicetree/bindings/net/mdio-mux.txt
+
+example:
+
+	mdio_mux: mdio-mux at 3f190 {
+		compatible = "brcm,mdio-mux-nsp";
+		reg = <0x3f190 0x4>,
+		      <0x32000 0x4>;
+		reg-names = "bus-ctrl", "mgmt-ctrl";
+		mdio-parent-bus = <&mdio>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		mdio at 0 {
+			reg = <0x0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			usb3_phy: usb3-phy at 10 {
+				compatible = "brcm,nsp-usb3-phy";
+				reg = <0x10>;
+				usb3-ctrl-syscon = <&usb3_ctrl>;
+				#phy-cells = <0>;
+				status = "disabled";
+			};
+		};
+	};
-- 
2.1.0

^ permalink raw reply related

* [PATCH 0/6] USB support for Broadcom NSP SoC
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Russell King, Ray Jui, Scott Branden,
	Jon Mason, Florian Fainelli, Kishon Vijay Abraham I
  Cc: bcm-kernel-feedback-list, netdev, devicetree, linux-kernel,
	linux-arm-kernel, Yendapally Reddy Dhananjaya Reddy

This patch set contains the usb support for Broadcom NSP SoC.
The usb phy is connected through mdio interface. The mdio interface
can be used to access either internal phys or external phys using a
multiplexer.

The first patch provides the documentation details for mdio-mux and
second patch provides the documentation details for usb3 phy. The third
patch contains the mdio-mux support and fourth patch contains the
changes to the mdio bus driver.

The fifth patch provides the phy driver and sixth patch provides the
enable method for usb.

This patch series has been tested on NSP bcm958625HR board.
This patch series is based on v4.9.0-rc1 and is available from github-
repo: https://github.com/Broadcom/cygnus-linux.git
branch:nsp-usb-v1


Yendapally Reddy Dhananjaya Reddy (6):
  dt-bindings: mdio-mux: Add documentation for mdio mux for NSP SoC
  dt-bindings: phy: Add documentation for NSP USB3 PHY
  net: mdio-mux: Add MDIO mux driver for NSP SoC
  net: phy: Initialize mdio clock at probe function
  phy: Add USB3 PHY support for Broadcom NSP SoC
  arm: dts: nsp: Add USB nodes to device tree

 .../devicetree/bindings/net/brcm,mdio-mux-nsp.txt  |  57 +++++++
 .../devicetree/bindings/phy/brcm,nsp-usb3-phy.txt  |  39 +++++
 arch/arm/boot/dts/bcm-nsp.dtsi                     |  57 +++++++
 arch/arm/boot/dts/bcm958625k.dts                   |  16 ++
 drivers/net/phy/Kconfig                            |   9 ++
 drivers/net/phy/Makefile                           |   1 +
 drivers/net/phy/mdio-bcm-iproc.c                   |   6 +-
 drivers/net/phy/mdio-mux-bcm-nsp.c                 | 121 ++++++++++++++
 drivers/phy/Kconfig                                |   9 ++
 drivers/phy/Makefile                               |   1 +
 drivers/phy/phy-bcm-nsp-usb3.c                     | 176 +++++++++++++++++++++
 11 files changed, 488 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt
 create mode 100644 Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt
 create mode 100644 drivers/net/phy/mdio-mux-bcm-nsp.c
 create mode 100644 drivers/phy/phy-bcm-nsp-usb3.c

-- 
2.1.0

^ permalink raw reply

* [PATCH 0/6] USB support for Broadcom NSP SoC
From: Yendapally Reddy Dhananjaya Reddy @ 2016-11-09  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

This patch set contains the usb support for Broadcom NSP SoC.
The usb phy is connected through mdio interface. The mdio interface
can be used to access either internal phys or external phys using a
multiplexer.

The first patch provides the documentation details for mdio-mux and
second patch provides the documentation details for usb3 phy. The third
patch contains the mdio-mux support and fourth patch contains the
changes to the mdio bus driver.

The fifth patch provides the phy driver and sixth patch provides the
enable method for usb.

This patch series has been tested on NSP bcm958625HR board.
This patch series is based on v4.9.0-rc1 and is available from github-
repo: https://github.com/Broadcom/cygnus-linux.git
branch:nsp-usb-v1


Yendapally Reddy Dhananjaya Reddy (6):
  dt-bindings: mdio-mux: Add documentation for mdio mux for NSP SoC
  dt-bindings: phy: Add documentation for NSP USB3 PHY
  net: mdio-mux: Add MDIO mux driver for NSP SoC
  net: phy: Initialize mdio clock at probe function
  phy: Add USB3 PHY support for Broadcom NSP SoC
  arm: dts: nsp: Add USB nodes to device tree

 .../devicetree/bindings/net/brcm,mdio-mux-nsp.txt  |  57 +++++++
 .../devicetree/bindings/phy/brcm,nsp-usb3-phy.txt  |  39 +++++
 arch/arm/boot/dts/bcm-nsp.dtsi                     |  57 +++++++
 arch/arm/boot/dts/bcm958625k.dts                   |  16 ++
 drivers/net/phy/Kconfig                            |   9 ++
 drivers/net/phy/Makefile                           |   1 +
 drivers/net/phy/mdio-bcm-iproc.c                   |   6 +-
 drivers/net/phy/mdio-mux-bcm-nsp.c                 | 121 ++++++++++++++
 drivers/phy/Kconfig                                |   9 ++
 drivers/phy/Makefile                               |   1 +
 drivers/phy/phy-bcm-nsp-usb3.c                     | 176 +++++++++++++++++++++
 11 files changed, 488 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/brcm,mdio-mux-nsp.txt
 create mode 100644 Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt
 create mode 100644 drivers/net/phy/mdio-mux-bcm-nsp.c
 create mode 100644 drivers/phy/phy-bcm-nsp-usb3.c

-- 
2.1.0

^ permalink raw reply

* [PATCH] mm/hugetlb.c: mark alloc_gigantic_page stub inline
From: Arnd Bergmann @ 2016-11-09  9:24 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Huang Shijie, Steve Capper, Arnd Bergmann, Naoya Horiguchi,
	Michal Hocko, Mike Kravetz, linux-mm, linux-kernel

A cleanup patch introduced a new stub helper function but
accidentally did not mark that 'inline' as all the other
stubs are here, and this causes a warning when it is
not used:

mm/hugetlb.c:1166:21: error: 'alloc_gigantic_page' defined but not used [-Werror=unused-function]

Fixes: akpm-current ("mm/hugetlb.c: rename some allocation functions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 67faaca8c097..cb9e995affce 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1163,7 +1163,7 @@ static inline void destroy_compound_gigantic_page(struct page *page,
 						unsigned int order) { }
 static inline int alloc_fresh_gigantic_page(struct hstate *h,
 					nodemask_t *nodes_allowed) { return 0; }
-static struct page *alloc_gigantic_page(int nid, unsigned int order)
+static inline struct page *alloc_gigantic_page(int nid, unsigned int order)
 {
 	return NULL;
 }
-- 
2.9.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related

* Re: what is infernalis' EOL date?
From: Loic Dachary @ 2016-11-09  9:30 UTC (permalink / raw)
  To: Samuel Just, Ken Dreyer; +Cc: ceph-devel
In-Reply-To: <CAN=+7FVhwt9AfRgjLKZ1w_Z2WtNVa4kMzjndm8AfvuDjZ1GhrA@mail.gmail.com>



On 08/11/2016 21:17, Samuel Just wrote:
> I think the EOL would have been the date of the Jewel release, right?

Right.

> -Sam
> 
> On Tue, Nov 8, 2016 at 8:50 AM, Ken Dreyer <kdreyer@redhat.com> wrote:
>> Hi folks,
>>
>> http://docs.ceph.com/docs/master/releases/ does not list an EOL date
>> for Infernalis.
>>
>> Can we say "Feb 2016" there? That was the date of the last point
>> release, v9.2.1.
>>
>> - Ken
>> --
>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Loïc Dachary, Artisan Logiciel Libre

^ permalink raw reply

* Re: master branch merges must pass unit tests
From: Loic Dachary @ 2016-11-09  9:29 UTC (permalink / raw)
  To: Sage Weil, ceph-devel
In-Reply-To: <alpine.DEB.2.11.1611082331480.29278@piezo.us.to>



On 09/11/2016 00:34, Sage Weil wrote:
> On Tue, 8 Nov 2016, Sage Weil wrote:
>> I enabled the github check that the unit tests pass in order to merge to 
>> master.  These tests still aren't completely reliable, but they're close, 
>> and we'll make better progress if we start enforcing it now.
> 
> I went a bit further and also checked the box requiring a review and 
> preventing pushes directly to master branch.  These are already uneforced 
> requirements so this shouldn't slow people down *except* that we need to 
> start using the new github 'review' feature that lets you explicitly 
> approve changes.
> 
> Again, the core developers can override these restrictions if necessary.
> 
> I haven't done anything to the stable branches, but we might want to do 
> the same thing there...

Good move :-) I will do the same for the stable branches.

Cheers

-- 
Loïc Dachary, Artisan Logiciel Libre

^ permalink raw reply

* Re: [PATCH v1 1/2] config.mak.in: set NO_OPENSSL and APPLE_COMMON_CRYPTO for macOS >10.11
From: Lars Schneider @ 2016-11-09  9:29 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Jeff King, git, gitster
In-Reply-To: <11cc8bbd-2e67-f53a-c8f4-2244409fd6af@web.de>


> On 09 Nov 2016, at 09:18, Torsten Bögershausen <tboegi@web.de> wrote:
> 
> On 07.11.16 18:26, Jeff King wrote:
>> On Sun, Nov 06, 2016 at 08:35:04PM +0100, Lars Schneider wrote:
>> 
>>> Good point. I think I found an even easier way to achieve the same.
>>> What do you think about the patch below?
>>> 
>>> [...]
>>> 
>>> diff --git a/Makefile b/Makefile
>>> index 9d6c245..f53fcc9 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -1047,6 +1047,7 @@ ifeq ($(uname_S),Darwin)
>>> 		endif
>>> 	endif
>>> 	ifndef NO_APPLE_COMMON_CRYPTO
>>> +		NO_OPENSSL = YesPlease
>>> 		APPLE_COMMON_CRYPTO = YesPlease
>>> 		COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
>>> 	endif
>> 
>> That is much simpler.
> []
> I don't know if that is a correct solution.
> 
> If I have Mac OS 10.12 and Mac Ports installed, I may want to use
> OPENSSL from Mac Ports.

Can't you define `NO_APPLE_COMMON_CRYPTO` in that case? 
I think if you use OpenSSL then you don't need the Apple crypto lib, right?

- Lars


> How about this:
> 
> 
> diff --git a/Makefile b/Makefile
> index ee89c06..e93511f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1038,17 +1038,22 @@ ifeq ($(uname_S),Darwin)
>                ifeq ($(shell test -d /sw/lib && echo y),y)
>                        BASIC_CFLAGS += -I/sw/include
>                        BASIC_LDFLAGS += -L/sw/lib
> +                       HAS_OPENSSL = Yes
>                endif
>        endif
>        ifndef NO_DARWIN_PORTS
>                ifeq ($(shell test -d /opt/local/lib && echo y),y)
>                        BASIC_CFLAGS += -I/opt/local/include
>                        BASIC_LDFLAGS += -L/opt/local/lib
> +                       HAS_OPENSSL = Yes
>                endif
>        endif
>        ifndef NO_APPLE_COMMON_CRYPTO
>                APPLE_COMMON_CRYPTO = YesPlease
>                COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
> +               ifndef HAS_OPENSSL
> +                       NO_OPENSSL = YesPlease
> +               endif
>        endif
>        NO_REGEX = YesPlease
>        PTHREAD_LIBS =
> 


^ permalink raw reply

* [GIT PULL] two bug fixes for 4.9-rc5
From: Martin Schwidefsky @ 2016-11-09  9:29 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux-s390, Heiko Carstens

Hi Linus,

please pull from the 'for-linus' branch of

	git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git for-linus

to receive the following updates:

Two bug fixes
 * A memory alignment fix in the s390 only hypfs code
 * A fix for the generic percpu code that caused ftrace to break on s390.
   This is not relevant for x86 but for all architectures that use the
   generic percpu code.

Heiko Carstens (1):
      percpu: use notrace variant of preempt_disable/preempt_enable

Michael Holzheu (1):
      s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment

 arch/s390/hypfs/hypfs_diag.c | 6 +++---
 include/asm-generic/percpu.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index 28f03ca..794bebb 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -363,11 +363,11 @@ static void *diag204_store(void)
 static int diag224_get_name_table(void)
 {
 	/* memory must be below 2GB */
-	diag224_cpu_names = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
+	diag224_cpu_names = (char *) __get_free_page(GFP_KERNEL | GFP_DMA);
 	if (!diag224_cpu_names)
 		return -ENOMEM;
 	if (diag224(diag224_cpu_names)) {
-		kfree(diag224_cpu_names);
+		free_page((unsigned long) diag224_cpu_names);
 		return -EOPNOTSUPP;
 	}
 	EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16);
@@ -376,7 +376,7 @@ static int diag224_get_name_table(void)
 
 static void diag224_delete_name_table(void)
 {
-	kfree(diag224_cpu_names);
+	free_page((unsigned long) diag224_cpu_names);
 }
 
 static int diag224_idx2name(int index, char *name)
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 40e8870..0504ef8 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -118,9 +118,9 @@
 #define this_cpu_generic_read(pcp)					\
 ({									\
 	typeof(pcp) __ret;						\
-	preempt_disable();						\
+	preempt_disable_notrace();					\
 	__ret = raw_cpu_generic_read(pcp);				\
-	preempt_enable();						\
+	preempt_enable_notrace();					\
 	__ret;								\
 })
 

^ permalink raw reply related

* Re: [PATCH] examples/l3fwd: force CRC stripping for i40evf
From: Thomas Monjalon @ 2016-11-09  9:28 UTC (permalink / raw)
  To: Björn Töpel; +Cc: dev, qian.q.xu, lei.a.yao, jingjing.wu
In-Reply-To: <20161109082341.19825-1-bjorn.topel@intel.com>

2016-11-09 09:23, Björn Töpel:
> Commit 1bbcc5d21129 ("i40evf: report error for unsupported CRC
> stripping config") broke l3fwd, since it was forcing that CRC was
> kept. Now, if i40evf is running, CRC stripping will be enabled.
[...]
> +		rte_eth_dev_info_get(portid, &dev_info);
> +		if (dev_info.driver_name &&
> +		    strcmp(dev_info.driver_name, "net_i40e_vf") == 0) {
> +			/* i40evf require that CRC stripping is enabled. */
> +			port_conf.rxmode.hw_strip_crc = 1;
> +		} else {
> +			port_conf.rxmode.hw_strip_crc = 0;
> +		}

Thanks for raising the issue.
It is completely defeating the generic ethdev API.
We must not have different behaviours depending of the driver.
Why it cannot be fixed in the driver?

^ permalink raw reply

* [PATCH] staging: sm750fb: prefix global identifiers
From: Arnd Bergmann @ 2016-11-09  9:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arnd Bergmann, Sudip Mukherjee, Teddy Wang, Mike Rapoport,
	Elise Lennion, linux-fbdev, devel, linux-kernel

Renaming some symbols inside this driver caused a conflict with
an existing function, which in turn results in a link error:

drivers/staging/sm750fb/sm750fb.o: In function `enable_dma':
ddk750_hwi2c.c:(.text.enable_dma+0x0): multiple definition of `enable_dma'

This adds a sm750_ prefix to each global symbol in the sm750fb
driver that does not already have one. I manually looked for the
symbols and then converted the driver using

for i in calc_pll_value format_pll_reg set_power_mode set_current_gate    \
	enable_2d_engine enable_dma enable_gpio enable_i2c hw_set2dformat \
	hw_de_init hw_fillrect hw_copyarea hw_imageblit hw_cursor_enable  \
	hw_cursor_disable hw_cursor_setSize hw_cursor_setPos		  \
	hw_cursor_setColor hw_cursor_setData hw_cursor_setData2 ;
do
		sed -i "s:\<$i\>:sm750_$i:" drivers/staging/sm750fb/*.[ch]
done

Fixes: 03140dabf584 ("staging: sm750fb: Replace functions CamelCase naming with underscores.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/sm750fb/ddk750_chip.c  | 24 ++++++++++++------------
 drivers/staging/sm750fb/ddk750_chip.h  |  4 ++--
 drivers/staging/sm750fb/ddk750_hwi2c.c |  4 ++--
 drivers/staging/sm750fb/ddk750_mode.c  |  6 +++---
 drivers/staging/sm750fb/ddk750_power.c | 20 ++++++++++----------
 drivers/staging/sm750fb/ddk750_power.h | 12 ++++++------
 drivers/staging/sm750fb/ddk750_swi2c.c |  2 +-
 drivers/staging/sm750fb/sm750.c        | 22 +++++++++++-----------
 drivers/staging/sm750fb/sm750_accel.c  | 10 +++++-----
 drivers/staging/sm750fb/sm750_accel.h  | 10 +++++-----
 drivers/staging/sm750fb/sm750_cursor.c | 14 +++++++-------
 drivers/staging/sm750fb/sm750_cursor.h | 14 +++++++-------
 drivers/staging/sm750fb/sm750_hw.c     |  4 ++--
 13 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 14b5112dfb03..94f59f446322 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -68,16 +68,16 @@ static void set_chip_clock(unsigned int frequency)
 		pll.clockType = MXCLK_PLL;
 
 		/*
-		 * Call calc_pll_value() to fill the other fields of the PLL
+		 * Call sm750_calc_pll_value() to fill the other fields of the PLL
 		 * structure. Sometimes, the chip cannot set up the exact
 		 * clock required by the User.
-		 * Return value of calc_pll_value gives the actual possible
+		 * Return value of sm750_calc_pll_value gives the actual possible
 		 * clock.
 		 */
-		ulActualMxClk = calc_pll_value(frequency, &pll);
+		ulActualMxClk = sm750_calc_pll_value(frequency, &pll);
 
 		/* Master Clock Control: MXCLK_PLL */
-		POKE32(MXCLK_PLL_CTRL, format_pll_reg(&pll));
+		POKE32(MXCLK_PLL_CTRL, sm750_format_pll_reg(&pll));
 	}
 }
 
@@ -121,7 +121,7 @@ static void set_memory_clock(unsigned int frequency)
 			break;
 		}
 
-		set_current_gate(reg);
+		sm750_set_current_gate(reg);
 	}
 }
 
@@ -173,7 +173,7 @@ static void set_master_clock(unsigned int frequency)
 			break;
 		}
 
-		set_current_gate(reg);
+		sm750_set_current_gate(reg);
 		}
 }
 
@@ -215,12 +215,12 @@ int ddk750_init_hw(struct initchip_param *pInitParam)
 
 	if (pInitParam->powerMode != 0)
 		pInitParam->powerMode = 0;
-	set_power_mode(pInitParam->powerMode);
+	sm750_set_power_mode(pInitParam->powerMode);
 
 	/* Enable display power gate & LOCALMEM power gate*/
 	reg = PEEK32(CURRENT_GATE);
 	reg |= (CURRENT_GATE_DISPLAY | CURRENT_GATE_LOCALMEM);
-	set_current_gate(reg);
+	sm750_set_current_gate(reg);
 
 	if (sm750_get_chip_type() != SM750LE) {
 		/*	set panel pll and graphic mode via mmio_88 */
@@ -261,7 +261,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)
 	}
 
 	if (pInitParam->setAllEngOff == 1) {
-		enable_2d_engine(0);
+		sm750_enable_2d_engine(0);
 
 		/* Disable Overlay, if a former application left it on */
 		reg = PEEK32(VIDEO_DISPLAY_CTRL);
@@ -284,7 +284,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)
 		POKE32(DMA_ABORT_INTERRUPT, reg);
 
 		/* Disable DMA Power, if a former application left it on */
-		enable_dma(0);
+		sm750_enable_dma(0);
 	}
 
 	/* We can add more initialization as needed. */
@@ -309,7 +309,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)
  * M = {1,...,255}
  * N = {2,...,15}
  */
-unsigned int calc_pll_value(unsigned int request_orig, struct pll_value *pll)
+unsigned int sm750_calc_pll_value(unsigned int request_orig, struct pll_value *pll)
 {
 	/*
 	 * as sm750 register definition,
@@ -381,7 +381,7 @@ unsigned int calc_pll_value(unsigned int request_orig, struct pll_value *pll)
 	return ret;
 }
 
-unsigned int format_pll_reg(struct pll_value *pPLL)
+unsigned int sm750_format_pll_reg(struct pll_value *pPLL)
 {
 #ifndef VALIDATION_CHIP
 	unsigned int POD = pPLL->POD;
diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index 5eee29dfc4b3..e97e8592d973 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -88,8 +88,8 @@ struct initchip_param {
 
 logical_chip_type_t sm750_get_chip_type(void);
 void sm750_set_chip_type(unsigned short devId, char revId);
-unsigned int calc_pll_value(unsigned int request, struct  pll_value *pll);
-unsigned int format_pll_reg(struct pll_value *pPLL);
+unsigned int sm750_calc_pll_value(unsigned int request, struct  pll_value *pll);
+unsigned int sm750_format_pll_reg(struct pll_value *pPLL);
 unsigned int ddk750_get_vm_size(void);
 int ddk750_init_hw(struct initchip_param *);
 
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 10439e061ae8..05d4a73aa1d4 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -24,7 +24,7 @@ unsigned char bus_speed_mode
 	 * Enable Hardware I2C power.
 	 * TODO: Check if we need to enable GPIO power?
 	 */
-	enable_i2c(1);
+	sm750_enable_i2c(1);
 
 	/* Enable the I2C Controller and set the bus speed mode */
 	value = PEEK32(I2C_CTRL) & ~(I2C_CTRL_MODE | I2C_CTRL_EN);
@@ -45,7 +45,7 @@ void sm750_hw_i2c_close(void)
 	POKE32(I2C_CTRL, value);
 
 	/* Disable I2C Power */
-	enable_i2c(0);
+	sm750_enable_i2c(0);
 
 	/* Set GPIO 30 & 31 back as GPIO pins */
 	value = PEEK32(GPIO_MUX);
diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
index 47d224e542c3..4a4b1de97a87 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -83,7 +83,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam,
 
 	if (pll->clockType == SECONDARY_PLL) {
 		/* programe secondary pixel clock */
-		POKE32(CRT_PLL_CTRL, format_pll_reg(pll));
+		POKE32(CRT_PLL_CTRL, sm750_format_pll_reg(pll));
 		POKE32(CRT_HORIZONTAL_TOTAL,
 			(((pModeParam->horizontal_total - 1) <<
 				CRT_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
@@ -133,7 +133,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam,
 	} else if (pll->clockType == PRIMARY_PLL) {
 		unsigned int reserved;
 
-		POKE32(PANEL_PLL_CTRL, format_pll_reg(pll));
+		POKE32(PANEL_PLL_CTRL, sm750_format_pll_reg(pll));
 
 		reg = ((pModeParam->horizontal_total - 1) <<
 			PANEL_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
@@ -210,7 +210,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock)
 	pll.inputFreq = DEFAULT_INPUT_CLOCK;
 	pll.clockType = clock;
 
-	uiActualPixelClk = calc_pll_value(parm->pixel_clock, &pll);
+	uiActualPixelClk = sm750_calc_pll_value(parm->pixel_clock, &pll);
 	if (sm750_get_chip_type() == SM750LE) {
 		/* set graphic mode via IO method */
 		outb_p(0x88, 0x3d4);
diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c
index 6f4374057405..6167e30e8e01 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -29,7 +29,7 @@ static unsigned int get_power_mode(void)
  * SM50x can operate in one of three modes: 0, 1 or Sleep.
  * On hardware reset, power mode 0 is default.
  */
-void set_power_mode(unsigned int mode)
+void sm750_set_power_mode(unsigned int mode)
 {
 	unsigned int ctrl = 0;
 
@@ -72,7 +72,7 @@ void set_power_mode(unsigned int mode)
 	POKE32(POWER_MODE_CTRL, ctrl);
 }
 
-void set_current_gate(unsigned int gate)
+void sm750_set_current_gate(unsigned int gate)
 {
 	if (get_power_mode() == POWER_MODE_CTRL_MODE_MODE1)
 		POKE32(MODE1_GATE, gate);
@@ -85,7 +85,7 @@ void set_current_gate(unsigned int gate)
 /*
  * This function enable/disable the 2D engine.
  */
-void enable_2d_engine(unsigned int enable)
+void sm750_enable_2d_engine(unsigned int enable)
 {
 	u32 gate;
 
@@ -95,10 +95,10 @@ void enable_2d_engine(unsigned int enable)
 	else
 		gate &= ~(CURRENT_GATE_DE | CURRENT_GATE_CSC);
 
-	set_current_gate(gate);
+	sm750_set_current_gate(gate);
 }
 
-void enable_dma(unsigned int enable)
+void sm750_enable_dma(unsigned int enable)
 {
 	u32 gate;
 
@@ -109,13 +109,13 @@ void enable_dma(unsigned int enable)
 	else
 		gate &= ~CURRENT_GATE_DMA;
 
-	set_current_gate(gate);
+	sm750_set_current_gate(gate);
 }
 
 /*
  * This function enable/disable the GPIO Engine
  */
-void enable_gpio(unsigned int enable)
+void sm750_enable_gpio(unsigned int enable)
 {
 	u32 gate;
 
@@ -126,13 +126,13 @@ void enable_gpio(unsigned int enable)
 	else
 		gate &= ~CURRENT_GATE_GPIO;
 
-	set_current_gate(gate);
+	sm750_set_current_gate(gate);
 }
 
 /*
  * This function enable/disable the I2C Engine
  */
-void enable_i2c(unsigned int enable)
+void sm750_enable_i2c(unsigned int enable)
 {
 	u32 gate;
 
@@ -143,7 +143,7 @@ void enable_i2c(unsigned int enable)
 	else
 		gate &= ~CURRENT_GATE_I2C;
 
-	set_current_gate(gate);
+	sm750_set_current_gate(gate);
 }
 
 
diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
index ea56026d41b2..eb088b0d805f 100644
--- a/drivers/staging/sm750fb/ddk750_power.h
+++ b/drivers/staging/sm750fb/ddk750_power.h
@@ -15,28 +15,28 @@ DPMS_t;
 }
 
 void ddk750_set_dpms(DPMS_t);
-void set_power_mode(unsigned int powerMode);
-void set_current_gate(unsigned int gate);
+void sm750_set_power_mode(unsigned int powerMode);
+void sm750_set_current_gate(unsigned int gate);
 
 /*
  * This function enable/disable the 2D engine.
  */
-void enable_2d_engine(unsigned int enable);
+void sm750_enable_2d_engine(unsigned int enable);
 
 /*
  * This function enable/disable the DMA Engine
  */
-void enable_dma(unsigned int enable);
+void sm750_enable_dma(unsigned int enable);
 
 /*
  * This function enable/disable the GPIO Engine
  */
-void enable_gpio(unsigned int enable);
+void sm750_enable_gpio(unsigned int enable);
 
 /*
  * This function enable/disable the I2C Engine
  */
-void enable_i2c(unsigned int enable);
+void sm750_enable_i2c(unsigned int enable);
 
 
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index e2e3ca64d483..b8a4e44359af 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -428,7 +428,7 @@ long sm750_sw_i2c_init(
 	       PEEK32(sw_i2c_data_gpio_mux_reg) & ~(1 << sw_i2c_data_gpio));
 
 	/* Enable GPIO power */
-	enable_gpio(1);
+	sm750_enable_gpio(1);
 
 	/* Clear the i2c lines. */
 	for (i = 0; i < 9; i++)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 5c153d68212a..2d22c51cb33b 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -118,14 +118,14 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
 		return -ENXIO;
 	}
 
-	hw_cursor_disable(cursor);
+	sm750_hw_cursor_disable(cursor);
 	if (fbcursor->set & FB_CUR_SETSIZE)
-		hw_cursor_setSize(cursor,
+		sm750_hw_cursor_setSize(cursor,
 				  fbcursor->image.width,
 				  fbcursor->image.height);
 
 	if (fbcursor->set & FB_CUR_SETPOS)
-		hw_cursor_setPos(cursor,
+		sm750_hw_cursor_setPos(cursor,
 				 fbcursor->image.dx - info->var.xoffset,
 				 fbcursor->image.dy - info->var.yoffset);
 
@@ -141,18 +141,18 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
 		      ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5) |
 		      ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
 
-		hw_cursor_setColor(cursor, fg, bg);
+		sm750_hw_cursor_setColor(cursor, fg, bg);
 	}
 
 	if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) {
-		hw_cursor_setData(cursor,
+		sm750_hw_cursor_setData(cursor,
 				  fbcursor->rop,
 				  fbcursor->image.data,
 				  fbcursor->mask);
 	}
 
 	if (fbcursor->enable)
-		hw_cursor_enable(cursor);
+		sm750_hw_cursor_enable(cursor);
 
 	return 0;
 }
@@ -788,7 +788,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 	memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
 	if (!g_hwcursor) {
 		lynxfb_ops.fb_cursor = NULL;
-		hw_cursor_disable(&crtc->cursor);
+		sm750_hw_cursor_disable(&crtc->cursor);
 	}
 
 	/* set info->fbops, must be set before fb_find_mode */
@@ -1083,10 +1083,10 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 		 * if some chip need specific function,
 		 * please hook it in smXXX_set_drv routine
 		 */
-		sm750_dev->accel.de_init = hw_de_init;
-		sm750_dev->accel.de_fillrect = hw_fillrect;
-		sm750_dev->accel.de_copyarea = hw_copyarea;
-		sm750_dev->accel.de_imageblit = hw_imageblit;
+		sm750_dev->accel.de_init = sm750_hw_de_init;
+		sm750_dev->accel.de_fillrect = sm750_hw_fillrect;
+		sm750_dev->accel.de_copyarea = sm750_hw_copyarea;
+		sm750_dev->accel.de_imageblit = sm750_hw_imageblit;
 	}
 
 	/* call chip specific setup routine  */
diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c
index 2e9c94142274..6fd18d24f5b2 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -32,7 +32,7 @@ static inline void write_dpPort(struct lynx_accel *accel, u32 data)
 	writel(data, accel->dpPortBase);
 }
 
-void hw_de_init(struct lynx_accel *accel)
+void sm750_hw_de_init(struct lynx_accel *accel)
 {
 	/* setup 2d engine registers */
 	u32 reg, clr;
@@ -71,7 +71,7 @@ void hw_de_init(struct lynx_accel *accel)
  * every time you use 2d function
  */
 
-void hw_set2dformat(struct lynx_accel *accel, int fmt)
+void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt)
 {
 	u32 reg;
 
@@ -83,7 +83,7 @@ void hw_set2dformat(struct lynx_accel *accel, int fmt)
 	write_dpr(accel, DE_STRETCH_FORMAT, reg);
 }
 
-int hw_fillrect(struct lynx_accel *accel,
+int sm750_hw_fillrect(struct lynx_accel *accel,
 				u32 base, u32 pitch, u32 Bpp,
 				u32 x, u32 y, u32 width, u32 height,
 				u32 color, u32 rop)
@@ -128,7 +128,7 @@ int hw_fillrect(struct lynx_accel *accel,
 	return 0;
 }
 
-int hw_copyarea(
+int sm750_hw_copyarea(
 struct lynx_accel *accel,
 unsigned int sBase,  /* Address of source: offset in frame buffer */
 unsigned int sPitch, /* Pitch value of source surface in BYTE */
@@ -293,7 +293,7 @@ static unsigned int deGetTransparency(struct lynx_accel *accel)
 	return de_ctrl;
 }
 
-int hw_imageblit(struct lynx_accel *accel,
+int sm750_hw_imageblit(struct lynx_accel *accel,
 		 const char *pSrcbuf, /* pointer to start of source buffer in system memory */
 		 u32 srcDelta,          /* Pitch value (in bytes) of the source buffer, +ive means top down and -ive mean button up */
 		 u32 startBit, /* Mono data can start at any bit in a byte, this value should be 0 to 7 */
diff --git a/drivers/staging/sm750fb/sm750_accel.h b/drivers/staging/sm750fb/sm750_accel.h
index d59d005e0add..4b0ff8feb9a0 100644
--- a/drivers/staging/sm750fb/sm750_accel.h
+++ b/drivers/staging/sm750fb/sm750_accel.h
@@ -184,16 +184,16 @@
 #define BOTTOM_TO_TOP 1
 #define RIGHT_TO_LEFT 1
 
-void hw_set2dformat(struct lynx_accel *accel, int fmt);
+void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt);
 
-void hw_de_init(struct lynx_accel *accel);
+void sm750_hw_de_init(struct lynx_accel *accel);
 
-int hw_fillrect(struct lynx_accel *accel,
+int sm750_hw_fillrect(struct lynx_accel *accel,
 				u32 base, u32 pitch, u32 Bpp,
 				u32 x, u32 y, u32 width, u32 height,
 				u32 color, u32 rop);
 
-int hw_copyarea(
+int sm750_hw_copyarea(
 struct lynx_accel *accel,
 unsigned int sBase,  /* Address of source: offset in frame buffer */
 unsigned int sPitch, /* Pitch value of source surface in BYTE */
@@ -208,7 +208,7 @@ unsigned int width,
 unsigned int height, /* width and height of rectangle in pixel value */
 unsigned int rop2);
 
-int hw_imageblit(struct lynx_accel *accel,
+int sm750_hw_imageblit(struct lynx_accel *accel,
 		 const char *pSrcbuf, /* pointer to start of source buffer in system memory */
 		 u32 srcDelta,          /* Pitch value (in bytes) of the source buffer, +ive means top down and -ive mean button up */
 		 u32 startBit, /* Mono data can start at any bit in a byte, this value should be 0 to 7 */
diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
index d622d65b6cee..2a13353fc492 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -47,25 +47,25 @@ writel((data), cursor->mmio + (addr))
 
 
 /* hw_cursor_xxx works for voyager,718 and 750 */
-void hw_cursor_enable(struct lynx_cursor *cursor)
+void sm750_hw_cursor_enable(struct lynx_cursor *cursor)
 {
 	u32 reg;
 
 	reg = (cursor->offset & HWC_ADDRESS_ADDRESS_MASK) | HWC_ADDRESS_ENABLE;
 	POKE32(HWC_ADDRESS, reg);
 }
-void hw_cursor_disable(struct lynx_cursor *cursor)
+void sm750_hw_cursor_disable(struct lynx_cursor *cursor)
 {
 	POKE32(HWC_ADDRESS, 0);
 }
 
-void hw_cursor_setSize(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setSize(struct lynx_cursor *cursor,
 						int w, int h)
 {
 	cursor->w = w;
 	cursor->h = h;
 }
-void hw_cursor_setPos(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,
 						int x, int y)
 {
 	u32 reg;
@@ -74,7 +74,7 @@ void hw_cursor_setPos(struct lynx_cursor *cursor,
 		(x & HWC_LOCATION_X_MASK));
 	POKE32(HWC_LOCATION, reg);
 }
-void hw_cursor_setColor(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setColor(struct lynx_cursor *cursor,
 						u32 fg, u32 bg)
 {
 	u32 reg = (fg << HWC_COLOR_12_2_RGB565_SHIFT) &
@@ -84,7 +84,7 @@ void hw_cursor_setColor(struct lynx_cursor *cursor,
 	POKE32(HWC_COLOR_3, 0xffe0);
 }
 
-void hw_cursor_setData(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setData(struct lynx_cursor *cursor,
 			u16 rop, const u8 *pcol, const u8 *pmsk)
 {
 	int i, j, count, pitch, offset;
@@ -138,7 +138,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor,
 }
 
 
-void hw_cursor_setData2(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setData2(struct lynx_cursor *cursor,
 			u16 rop, const u8 *pcol, const u8 *pmsk)
 {
 	int i, j, count, pitch, offset;
diff --git a/drivers/staging/sm750fb/sm750_cursor.h b/drivers/staging/sm750fb/sm750_cursor.h
index 6c4fc9b73489..c7b86ae235b4 100644
--- a/drivers/staging/sm750fb/sm750_cursor.h
+++ b/drivers/staging/sm750fb/sm750_cursor.h
@@ -2,16 +2,16 @@
 #define LYNX_CURSOR_H__
 
 /* hw_cursor_xxx works for voyager,718 and 750 */
-void hw_cursor_enable(struct lynx_cursor *cursor);
-void hw_cursor_disable(struct lynx_cursor *cursor);
-void hw_cursor_setSize(struct lynx_cursor *cursor,
+void sm750_hw_cursor_enable(struct lynx_cursor *cursor);
+void sm750_hw_cursor_disable(struct lynx_cursor *cursor);
+void sm750_hw_cursor_setSize(struct lynx_cursor *cursor,
 						int w, int h);
-void hw_cursor_setPos(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,
 						int x, int y);
-void hw_cursor_setColor(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setColor(struct lynx_cursor *cursor,
 						u32 fg, u32 bg);
-void hw_cursor_setData(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setData(struct lynx_cursor *cursor,
 			u16 rop, const u8 *data, const u8 *mask);
-void hw_cursor_setData2(struct lynx_cursor *cursor,
+void sm750_hw_cursor_setData2(struct lynx_cursor *cursor,
 			u16 rop, const u8 *data, const u8 *mask);
 #endif
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 23b6b1cda529..b6af3b53076b 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -275,7 +275,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
 			fmt = 2;
 			break;
 		}
-		hw_set2dformat(&sm750_dev->accel, fmt);
+		sm750_hw_set2dformat(&sm750_dev->accel, fmt);
 	}
 
 	/* set timing */
@@ -479,7 +479,7 @@ void hw_sm750_initAccel(struct sm750_dev *sm750_dev)
 {
 	u32 reg;
 
-	enable_2d_engine(1);
+	sm750_enable_2d_engine(1);
 
 	if (sm750_get_chip_type() == SM750LE) {
 		reg = PEEK32(DE_STATE1);
-- 
2.9.0

^ permalink raw reply related

* Re: [Qemu-devel] [PATCH] Fix legacy ncurses detection.
From: Samuel Thibault @ 2016-11-09  9:28 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: Peter Maydell, Michal Suchanek, QEMU Developers
In-Reply-To: <20161109101236.0c660095.cornelia.huck@de.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1538 bytes --]

Hello,

Cornelia Huck, on Wed 09 Nov 2016 10:12:36 +0100, wrote:
> On Wed, 9 Nov 2016 10:04:02 +0100
> Samuel Thibault <samuel.thibault@gnu.org> wrote:
> > Please post config.log so we can have a clue about what is going
> > wrong.  All these error messages are meant to be reported verbatim, not
> > reinterpreted :)
> 
> Well, no error here - just curses=no.

The errors are in config.log, that's what one is supposed to look at
when there are configure issues.

> config.log attached. The difference seems to be that the statement you
> added in the sample program causes a real error instead of a warning.

Yes, that was on purpose, to avoid the -Werror issue. It's expected to
happen because /usr/include/curses.h doesn't seem to have the wide
support. But -I/usr/include/ncursesw/curses.h is supposed to have. But:

> cc -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all -I/usr/include/libpng16 -I/usr/include/ncursesw -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64 -g :-lncursesw:-lcursesw
> cc: error: :-lncursesw:-lcursesw: No such file or directory

That's what the real issue is in your case.  I now see why, could you
try the attached patch instead?

Samuel

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1727 bytes --]

commit ea32127ca780b0945827776bf27f99383529621c
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Tue Nov 8 20:57:27 2016 +0100

    Fix cursesw detection
    
    On systems which do not provide ncursesw.pc and whose /usr/include/curses.h
    does not include wide support, we should not only try with no -I, i.e.
    /usr/include, but also with -I/usr/include/ncursesw.
    
    To properly detect for wide support with and without -Werror, we need to
    check for the presence of e.g. the WACS_DEGREE macro.
    
    We also want to stop at the first curses_inc_list configuration which works,
    and make sure to set IFS to : at each new loop.
    
    Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff --git a/configure b/configure
index fd6f898..bac7bcc 100755
--- a/configure
+++ b/configure
@@ -2926,7 +2926,7 @@ if test "$curses" != "no" ; then
     curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):"
     curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses"
   else
-    curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):"
+    curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/usr/include/ncursesw:"
     curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw"
   fi
   curses_found=no
@@ -2941,6 +2941,7 @@ int main(void) {
   resize_term(0, 0);
   addwstr(L"wide chars\n");
   addnwstr(&wch, 1);
+  add_wch(WACS_DEGREE);
   return s != 0;
 }
 EOF
@@ -2954,7 +2955,11 @@ EOF
         libs_softmmu="$curses_lib $libs_softmmu"
         break
       fi
+      IFS=:
     done
+    if test "$curses_found" = yes ; then
+      break
+    fi
   done
   unset IFS
   if test "$curses_found" = "yes" ; then

^ permalink raw reply related

* Re: [PATCH] [RFC] drivers: dma-coherent: use MEMREMAP_WB instead of MEMREMAP_WC
From: Brian Starkey @ 2016-11-09  9:27 UTC (permalink / raw)
  To: Jaewon Kim; +Cc: linux-mm, linux-kernel
In-Reply-To: <1478682609-26477-1-git-send-email-jaewon31.kim@samsung.com>

Hi Jaewon,

On Wed, Nov 09, 2016 at 06:10:09PM +0900, Jaewon Kim wrote:
>Commit 6b03ae0d42bf (drivers: dma-coherent: use MEMREMAP_WC for DMA_MEMORY_MA)
>added MEMREMAP_WC for DMA_MEMORY_MAP. If, however, CPU cache can be used on
>DMA_MEMORY_MAP, I think MEMREMAP_WC can be changed to MEMREMAP_WB. On my local
>ARM device, memset in dma_alloc_from_coherent sometimes takes much longer with
>MEMREMAP_WC compared to MEMREMAP_WB.
>
>Test results on AArch64 by allocating 4MB with putting trace_printk right
>before and after memset.
>	MEMREMAP_WC : 11.0ms, 5.7ms, 4.2ms, 4.9ms, 5.4ms, 4.3ms, 3.5ms
>	MEMREMAP_WB : 0.7ms, 0.6ms, 0.6ms, 0.6ms, 0.6ms, 0.5ms, 0.4 ms
>

This doesn't look like a good idea to me. The point of coherent memory
is to have it non-cached, however WB will make writes hit the cache.

Writing to the cache is of course faster than writing to RAM, but
that's not what we want to do here.

-Brian

>Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
>---
> drivers/base/dma-coherent.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/base/dma-coherent.c b/drivers/base/dma-coherent.c
>index 640a7e6..0512a1d 100644
>--- a/drivers/base/dma-coherent.c
>+++ b/drivers/base/dma-coherent.c
>@@ -33,7 +33,7 @@ static bool dma_init_coherent_memory(
> 		goto out;
>
> 	if (flags & DMA_MEMORY_MAP)
>-		mem_base = memremap(phys_addr, size, MEMREMAP_WC);
>+		mem_base = memremap(phys_addr, size, MEMREMAP_WB);
> 	else
> 		mem_base = ioremap(phys_addr, size);
> 	if (!mem_base)
>-- 
>1.9.1
>

^ permalink raw reply

* Re: [PATCH] drm/i915: remove duplicated memsets in skl_allocate_pipe_ddb()
From: Jani Nikula @ 2016-11-09  9:27 UTC (permalink / raw)
  To: Matt Roper, Paulo Zanoni; +Cc: Vetter, Daniel, intel-gfx
In-Reply-To: <20161109011315.GF6536@intel.com>

On Wed, 09 Nov 2016, Matt Roper <matthew.d.roper@intel.com> wrote:
> On Tue, Nov 08, 2016 at 03:21:22PM -0200, Paulo Zanoni wrote:
>> One of the memsets was added by 5a920b85f2c6 ("drm/i915/gen9: fix DDB
>> partitioning for multi-screen cases"), and the other was added by
>> 01c72d6c17 ("drm/i915/gen9: fix DDB partitioning for multi-screen
>> cases"). I'm confused and I'll let the maintainers find out what went
>> wrong here.
>> 
>> Cc: Jani Nikula <jani.nikula@intel.com>
>> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> I think this is just an artifact of having the patch in both -next and
> -fixes.  The context probably changed later in -next causing a conflict
> when the two were merged, and then the merge resolution accidentally
> duplicated this hunk.  The merge commit ac4139ed7 is where we wound up
> with the two copies:

I don't have that merge commit. Is that a nightly rebuild?

I don't think we even have this issue in anywhere other than
nightly. There isn't a branch we could apply this fix to.

BR,
Jani.


>
>         diff --cc drivers/gpu/drm/i915/intel_pm.c
>         index db24f89,cc9e0c0..88e28c9
>         --- a/drivers/gpu/drm/i915/intel_pm.c
>         +++ b/drivers/gpu/drm/i915/intel_pm.c
>         @@@ -3361,11 -3404,13 +3404,17 @@@ skl_allocate_pipe_ddb(struct intel_crtc
>                 unsigned int total_data_rate;
>                 int num_active;
>                 int id, i;
>         +       unsigned plane_data_rate[I915_MAX_PLANES] = {};
>         +       unsigned plane_y_data_rate[I915_MAX_PLANES] = {};
>         + 
>         +       /* Clear the partitioning for disabled planes. */
>         +       memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe]));
>         +       memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe]));
>           
>          +      /* Clear the partitioning for disabled planes. */
>          +      memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe]));
>          +      memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe]));
>          +
>                 if (WARN_ON(!state))
>                         return 0;
>           
> Dropping one looks good to me.
>
> Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
>
>> ---
>>  drivers/gpu/drm/i915/intel_pm.c | 4 ----
>>  1 file changed, 4 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
>> index 88e28c9..cc9e0c0 100644
>> --- a/drivers/gpu/drm/i915/intel_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_pm.c
>> @@ -3411,10 +3411,6 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate,
>>  	memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe]));
>>  	memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe]));
>>  
>> -	/* Clear the partitioning for disabled planes. */
>> -	memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe]));
>> -	memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe]));
>> -
>>  	if (WARN_ON(!state))
>>  		return 0;
>>  
>> -- 
>> 2.7.4
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.