All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623
@ 2019-08-22 10:26 Frank Wunderlich
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 1/8] pci: mediatek: add PCIe controller support for MT7623 Frank Wunderlich
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

This series adds PCIe/PHY drivers which were adapted from Linux version.
The related drivers were tested on bpi-r2.

To get AHCI (SATA) working on R2 (ASM1061 PCIe2SATA-Controller) 2 addional
changes are needed (see Parts 5+6 from Oleksandr Rybalko)

changes since v3:
- fix build-warning on x86_64 in commit "Don't forget to clear upper address regs"
- move history below --- 
changes since v2:
- rename pcie-driver to "MediaTek PCIe Gen2 controller"
- replaced readl/writel with (clr/set)bits_le32
- add dt-binding documents for pcie and phy
changes since v1:
- replaced mt2701 PCIe driver with version (PHY+PCIe) from Ryder


Oleksandr Rybalko (2):
  ahci-pci: ASM1061 report wrong class, but support AHCI.
  ata: ahci: Don't forget to clear upper address regs.

Ryder Lee (6):
  pci: mediatek: add PCIe controller support for MT7623
  phy: mediatek: add MediaTek T-PHY support for PCIe
  arm: dts: add PCIe controller for MT7623 SoC
  arm: dts: split mtk-reset.h into per-chip header
  dt-bindings: pcie: add a document for MT7623 PCIe controller
  dt-bindings: phy: add a document for MediaTek tphy

 arch/arm/dts/mt7623.dtsi                      | 130 ++++++-
 arch/arm/dts/mt7623n-bananapi-bpi-r2.dts      |  29 ++
 arch/arm/dts/mt7629.dtsi                      |   2 +-
 .../pci/mediatek-pcie.txt                     | 122 ++++++
 doc/device-tree-bindings/phy/phy-mtk-tphy.txt |  86 +++++
 drivers/ata/ahci-pci.c                        |   1 +
 drivers/ata/ahci.c                            |  11 +-
 drivers/pci/Kconfig                           |   8 +
 drivers/pci/Makefile                          |   1 +
 drivers/pci/pcie_mediatek.c                   | 279 ++++++++++++++
 drivers/phy/Kconfig                           |  11 +
 drivers/phy/Makefile                          |   1 +
 drivers/phy/phy-mtk-tphy.c                    | 362 ++++++++++++++++++
 .../reset/{mtk-reset.h => mt7623-reset.h}     |   4 +-
 include/dt-bindings/reset/mt7629-reset.h      |  36 ++
 15 files changed, 1074 insertions(+), 9 deletions(-)
 create mode 100644 doc/device-tree-bindings/pci/mediatek-pcie.txt
 create mode 100644 doc/device-tree-bindings/phy/phy-mtk-tphy.txt
 create mode 100644 drivers/pci/pcie_mediatek.c
 create mode 100644 drivers/phy/phy-mtk-tphy.c
 rename include/dt-bindings/reset/{mtk-reset.h => mt7623-reset.h} (88%)
 create mode 100644 include/dt-bindings/reset/mt7629-reset.h

-- 
2.17.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 1/8] pci: mediatek: add PCIe controller support for MT7623
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
@ 2019-08-22 10:26 ` Frank Wunderlich
  2019-10-12 20:22   ` Tom Rini
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 2/8] phy: mediatek: add MediaTek T-PHY support for PCIe Frank Wunderlich
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

From: Ryder Lee <ryder.lee@mediatek.com>

This adds PCIe controller support for MT7623.
This is adapted from the Linux version.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
changes since v3: none
changes since v2:
 - rename driver to "MediaTek PCIe Gen2 controller"
 - use clrsetbits_le32 instead of readl/writel
---
 drivers/pci/Kconfig         |   8 ++
 drivers/pci/Makefile        |   1 +
 drivers/pci/pcie_mediatek.c | 279 ++++++++++++++++++++++++++++++++++++
 3 files changed, 288 insertions(+)
 create mode 100644 drivers/pci/pcie_mediatek.c

diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 3fe38f7315..88df9001ee 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -145,4 +145,12 @@ config PCI_MVEBU
 	  Say Y here if you want to enable PCIe controller support on
 	  Armada XP/38x SoCs.
 
+config PCIE_MEDIATEK
+	bool "MediaTek PCIe Gen2 controller"
+	depends on DM_PCI
+	depends on ARCH_MEDIATEK
+	help
+	  Say Y here if you want to enable Gen2 PCIe controller,
+	  which could be found on MT7623 SoC family.
+
 endif
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index b5ebd50c85..7093d63918 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -38,3 +38,4 @@ obj-$(CONFIG_PCIE_LAYERSCAPE_GEN4) += pcie_layerscape_gen4.o \
 				pcie_layerscape_gen4_fixup.o
 obj-$(CONFIG_PCI_XILINX) += pcie_xilinx.o
 obj-$(CONFIG_PCIE_INTEL_FPGA) += pcie_intel_fpga.o
+obj-$(CONFIG_PCIE_MEDIATEK) += pcie_mediatek.o
diff --git a/drivers/pci/pcie_mediatek.c b/drivers/pci/pcie_mediatek.c
new file mode 100644
index 0000000000..a0dcb258b0
--- /dev/null
+++ b/drivers/pci/pcie_mediatek.c
@@ -0,0 +1,279 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * MediaTek PCIe host controller driver.
+ *
+ * Copyright (c) 2017-2019 MediaTek Inc.
+ * Author: Ryder Lee <ryder.lee@mediatek.com>
+ *	   Honghui Zhang <honghui.zhang@mediatek.com>
+ */
+
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <generic-phy.h>
+#include <pci.h>
+#include <reset.h>
+#include <asm/io.h>
+#include <linux/iopoll.h>
+#include <linux/list.h>
+
+/* PCIe shared registers */
+#define PCIE_SYS_CFG		0x00
+#define PCIE_INT_ENABLE		0x0c
+#define PCIE_CFG_ADDR		0x20
+#define PCIE_CFG_DATA		0x24
+
+/* PCIe per port registers */
+#define PCIE_BAR0_SETUP		0x10
+#define PCIE_CLASS		0x34
+#define PCIE_LINK_STATUS	0x50
+
+#define PCIE_PORT_INT_EN(x)	BIT(20 + (x))
+#define PCIE_PORT_PERST(x)	BIT(1 + (x))
+#define PCIE_PORT_LINKUP	BIT(0)
+#define PCIE_BAR_MAP_MAX	GENMASK(31, 16)
+
+#define PCIE_BAR_ENABLE		BIT(0)
+#define PCIE_REVISION_ID	BIT(0)
+#define PCIE_CLASS_CODE		(0x60400 << 8)
+#define PCIE_CONF_REG(regn)	(((regn) & GENMASK(7, 2)) | \
+				((((regn) >> 8) & GENMASK(3, 0)) << 24))
+#define PCIE_CONF_ADDR(regn, bdf) \
+				(PCIE_CONF_REG(regn) | (bdf))
+
+/* MediaTek specific configuration registers */
+#define PCIE_FTS_NUM		0x70c
+#define PCIE_FTS_NUM_MASK	GENMASK(15, 8)
+#define PCIE_FTS_NUM_L0(x)	((x) & 0xff << 8)
+
+#define PCIE_FC_CREDIT		0x73c
+#define PCIE_FC_CREDIT_MASK	(GENMASK(31, 31) | GENMASK(28, 16))
+#define PCIE_FC_CREDIT_VAL(x)	((x) << 16)
+
+struct mtk_pcie_port {
+	void __iomem *base;
+	struct list_head list;
+	struct mtk_pcie *pcie;
+	struct reset_ctl reset;
+	struct clk sys_ck;
+	struct phy phy;
+	u32 slot;
+};
+
+struct mtk_pcie {
+	void __iomem *base;
+	struct clk free_ck;
+	struct list_head ports;
+};
+
+static int mtk_pcie_config_address(struct udevice *udev, pci_dev_t bdf,
+				   uint offset, void **paddress)
+{
+	struct mtk_pcie *pcie = dev_get_priv(udev);
+
+	writel(PCIE_CONF_ADDR(offset, bdf), pcie->base + PCIE_CFG_ADDR);
+	*paddress = pcie->base + PCIE_CFG_DATA + (offset & 3);
+
+	return 0;
+}
+
+static int mtk_pcie_read_config(struct udevice *bus, pci_dev_t bdf,
+				uint offset, ulong *valuep,
+				enum pci_size_t size)
+{
+	return pci_generic_mmap_read_config(bus, mtk_pcie_config_address,
+					    bdf, offset, valuep, size);
+}
+
+static int mtk_pcie_write_config(struct udevice *bus, pci_dev_t bdf,
+				 uint offset, ulong value,
+				 enum pci_size_t size)
+{
+	return pci_generic_mmap_write_config(bus, mtk_pcie_config_address,
+					     bdf, offset, value, size);
+}
+
+static const struct dm_pci_ops mtk_pcie_ops = {
+	.read_config	= mtk_pcie_read_config,
+	.write_config	= mtk_pcie_write_config,
+};
+
+static void mtk_pcie_port_free(struct mtk_pcie_port *port)
+{
+	list_del(&port->list);
+	free(port);
+}
+
+static int mtk_pcie_startup_port(struct mtk_pcie_port *port)
+{
+	struct mtk_pcie *pcie = port->pcie;
+	u32 slot = PCI_DEV(port->slot << 11);
+	u32 val;
+	int err;
+
+	/* assert port PERST_N */
+	setbits_le32(pcie->base + PCIE_SYS_CFG, PCIE_PORT_PERST(port->slot));
+	/* de-assert port PERST_N */
+	clrbits_le32(pcie->base + PCIE_SYS_CFG, PCIE_PORT_PERST(port->slot));
+
+	/* 100ms timeout value should be enough for Gen1/2 training */
+	err = readl_poll_timeout(port->base + PCIE_LINK_STATUS, val,
+				 !!(val & PCIE_PORT_LINKUP), 100000);
+	if (err)
+		return -ETIMEDOUT;
+
+	/* disable interrupt */
+	clrbits_le32(pcie->base + PCIE_INT_ENABLE,
+		     PCIE_PORT_INT_EN(port->slot));
+
+	/* map to all DDR region. We need to set it before cfg operation. */
+	writel(PCIE_BAR_MAP_MAX | PCIE_BAR_ENABLE,
+	       port->base + PCIE_BAR0_SETUP);
+
+	/* configure class code and revision ID */
+	writel(PCIE_CLASS_CODE | PCIE_REVISION_ID, port->base + PCIE_CLASS);
+
+	/* configure FC credit */
+	writel(PCIE_CONF_ADDR(PCIE_FC_CREDIT, slot),
+	       pcie->base + PCIE_CFG_ADDR);
+	clrsetbits_le32(pcie->base + PCIE_CFG_DATA, PCIE_FC_CREDIT_MASK,
+			PCIE_FC_CREDIT_VAL(0x806c));
+
+	/* configure RC FTS number to 250 when it leaves L0s */
+	writel(PCIE_CONF_ADDR(PCIE_FTS_NUM, slot), pcie->base + PCIE_CFG_ADDR);
+	clrsetbits_le32(pcie->base + PCIE_CFG_DATA, PCIE_FTS_NUM_MASK,
+			PCIE_FTS_NUM_L0(0x50));
+
+	return 0;
+}
+
+static void mtk_pcie_enable_port(struct mtk_pcie_port *port)
+{
+	int err;
+
+	err = clk_enable(&port->sys_ck);
+	if (err)
+		goto exit;
+
+	err = reset_assert(&port->reset);
+	if (err)
+		goto exit;
+
+	err = reset_deassert(&port->reset);
+	if (err)
+		goto exit;
+
+	err = generic_phy_init(&port->phy);
+	if (err)
+		goto exit;
+
+	err = generic_phy_power_on(&port->phy);
+	if (err)
+		goto exit;
+
+	if (!mtk_pcie_startup_port(port))
+		return;
+
+	pr_err("Port%d link down\n", port->slot);
+exit:
+	mtk_pcie_port_free(port);
+}
+
+static int mtk_pcie_parse_port(struct udevice *dev, u32 slot)
+{
+	struct mtk_pcie *pcie = dev_get_priv(dev);
+	struct mtk_pcie_port *port;
+	char name[10];
+	int err;
+
+	port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
+	if (!port)
+		return -ENOMEM;
+
+	snprintf(name, sizeof(name), "port%d", slot);
+	port->base = dev_remap_addr_name(dev, name);
+	if (!port->base)
+		return -ENOENT;
+
+	snprintf(name, sizeof(name), "sys_ck%d", slot);
+	err = clk_get_by_name(dev, name, &port->sys_ck);
+	if (err)
+		return err;
+
+	err = reset_get_by_index(dev, slot, &port->reset);
+	if (err)
+		return err;
+
+	err = generic_phy_get_by_index(dev, slot, &port->phy);
+	if (err)
+		return err;
+
+	port->slot = slot;
+	port->pcie = pcie;
+
+	INIT_LIST_HEAD(&port->list);
+	list_add_tail(&port->list, &pcie->ports);
+
+	return 0;
+}
+
+static int mtk_pcie_probe(struct udevice *dev)
+{
+	struct mtk_pcie *pcie = dev_get_priv(dev);
+	struct mtk_pcie_port *port, *tmp;
+	ofnode subnode;
+	int err;
+
+	INIT_LIST_HEAD(&pcie->ports);
+
+	pcie->base = dev_remap_addr_name(dev, "subsys");
+	if (!pcie->base)
+		return -ENOENT;
+
+	err = clk_get_by_name(dev, "free_ck", &pcie->free_ck);
+	if (err)
+		return err;
+
+	/* enable top level clock */
+	err = clk_enable(&pcie->free_ck);
+	if (err)
+		return err;
+
+	dev_for_each_subnode(subnode, dev) {
+		struct fdt_pci_addr addr;
+		u32 slot = 0;
+
+		if (!ofnode_is_available(subnode))
+			continue;
+
+		err = ofnode_read_pci_addr(subnode, 0, "reg", &addr);
+		if (err)
+			return err;
+
+		slot = PCI_DEV(addr.phys_hi);
+
+		err = mtk_pcie_parse_port(dev, slot);
+		if (err)
+			return err;
+	}
+
+	/* enable each port, and then check link status */
+	list_for_each_entry_safe(port, tmp, &pcie->ports, list)
+		mtk_pcie_enable_port(port);
+
+	return 0;
+}
+
+static const struct udevice_id mtk_pcie_ids[] = {
+	{ .compatible = "mediatek,mt7623-pcie", },
+	{ }
+};
+
+U_BOOT_DRIVER(pcie_mediatek) = {
+	.name	= "pcie_mediatek",
+	.id	= UCLASS_PCI,
+	.of_match = mtk_pcie_ids,
+	.ops	= &mtk_pcie_ops,
+	.probe	= mtk_pcie_probe,
+	.priv_auto_alloc_size = sizeof(struct mtk_pcie),
+};
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 2/8] phy: mediatek: add MediaTek T-PHY support for PCIe
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 1/8] pci: mediatek: add PCIe controller support for MT7623 Frank Wunderlich
@ 2019-08-22 10:26 ` Frank Wunderlich
  2019-10-12 20:22   ` Tom Rini
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 3/8] arm: dts: add PCIe controller for MT7623 SoC Frank Wunderlich
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

From: Ryder Lee <ryder.lee@mediatek.com>

The driver provides PHY for USB2, USB3.0, PCIe and SATA, and now
we just enable PCIe. As for the other functionalities will be
added gradually in upcoming days.

This is adapted from the Linux version.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
changes since v3: none
changes since v2:
 - use clrsetbits_le32 instead of readl/writel
 - change SSC-delta
---
 drivers/phy/Kconfig        |  11 ++
 drivers/phy/Makefile       |   1 +
 drivers/phy/phy-mtk-tphy.c | 362 +++++++++++++++++++++++++++++++++++++
 3 files changed, 374 insertions(+)
 create mode 100644 drivers/phy/phy-mtk-tphy.c

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 957efb3984..2099dd9547 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -190,4 +190,15 @@ config MT76X8_USB_PHY
 
 	  This PHY is found on MT76x8 devices supporting USB.
 
+config PHY_MTK_TPHY
+	bool "MediaTek T-PHY Driver"
+	depends on PHY
+	depends on ARCH_MEDIATEK
+	help
+	  MediaTek T-PHY driver supports usb2.0, usb3.0 ports, PCIe and
+	  SATA, and meanwhile supports two version T-PHY which have
+	  different banks layout, the T-PHY with shared banks between
+	  multi-ports is first version, otherwise is second veriosn,
+	  so you can easily distinguish them by banks layout.
+
 endmenu
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index 90646ca55b..15b4d58a2d 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -21,3 +21,4 @@ obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o
 obj-$(CONFIG_OMAP_USB2_PHY) += omap-usb2-phy.o
 obj-$(CONFIG_KEYSTONE_USB_PHY) += keystone-usb-phy.o
 obj-$(CONFIG_MT76X8_USB_PHY) += mt76x8-usb-phy.o
+obj-$(CONFIG_PHY_MTK_TPHY) += phy-mtk-tphy.o
diff --git a/drivers/phy/phy-mtk-tphy.c b/drivers/phy/phy-mtk-tphy.c
new file mode 100644
index 0000000000..3701481256
--- /dev/null
+++ b/drivers/phy/phy-mtk-tphy.c
@@ -0,0 +1,362 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2015 - 2019 MediaTek Inc.
+ * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
+ *	   Ryder Lee <ryder.lee@mediatek.com>
+ */
+
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <generic-phy.h>
+#include <mapmem.h>
+#include <asm/io.h>
+
+#include <dt-bindings/phy/phy.h>
+
+/* version V1 sub-banks offset base address */
+/* banks shared by multiple phys */
+#define SSUSB_SIFSLV_V1_SPLLC		0x000	/* shared by u3 phys */
+#define SSUSB_SIFSLV_V1_CHIP		0x300	/* shared by u3 phys */
+/* u3/pcie/sata phy banks */
+#define SSUSB_SIFSLV_V1_U3PHYD		0x000
+#define SSUSB_SIFSLV_V1_U3PHYA		0x200
+
+#define U3P_U3_CHIP_GPIO_CTLD		0x0c
+#define P3C_REG_IP_SW_RST		BIT(31)
+#define P3C_MCU_BUS_CK_GATE_EN		BIT(30)
+#define P3C_FORCE_IP_SW_RST		BIT(29)
+
+#define U3P_U3_CHIP_GPIO_CTLE		0x10
+#define P3C_RG_SWRST_U3_PHYD		BIT(25)
+#define P3C_RG_SWRST_U3_PHYD_FORCE_EN	BIT(24)
+
+#define U3P_U3_PHYA_REG0		0x000
+#define P3A_RG_CLKDRV_OFF		GENMASK(3, 2)
+#define P3A_RG_CLKDRV_OFF_VAL(x)	((0x3 & (x)) << 2)
+
+#define U3P_U3_PHYA_REG1		0x004
+#define P3A_RG_CLKDRV_AMP		GENMASK(31, 29)
+#define P3A_RG_CLKDRV_AMP_VAL(x)	((0x7 & (x)) << 29)
+
+#define U3P_U3_PHYA_DA_REG0		0x100
+#define P3A_RG_XTAL_EXT_PE2H		GENMASK(17, 16)
+#define P3A_RG_XTAL_EXT_PE2H_VAL(x)	((0x3 & (x)) << 16)
+#define P3A_RG_XTAL_EXT_PE1H		GENMASK(13, 12)
+#define P3A_RG_XTAL_EXT_PE1H_VAL(x)	((0x3 & (x)) << 12)
+#define P3A_RG_XTAL_EXT_EN_U3		GENMASK(11, 10)
+#define P3A_RG_XTAL_EXT_EN_U3_VAL(x)	((0x3 & (x)) << 10)
+
+#define U3P_U3_PHYA_DA_REG4		0x108
+#define P3A_RG_PLL_DIVEN_PE2H		GENMASK(21, 19)
+#define P3A_RG_PLL_BC_PE2H		GENMASK(7, 6)
+#define P3A_RG_PLL_BC_PE2H_VAL(x)	((0x3 & (x)) << 6)
+
+#define U3P_U3_PHYA_DA_REG5		0x10c
+#define P3A_RG_PLL_BR_PE2H		GENMASK(29, 28)
+#define P3A_RG_PLL_BR_PE2H_VAL(x)	((0x3 & (x)) << 28)
+#define P3A_RG_PLL_IC_PE2H		GENMASK(15, 12)
+#define P3A_RG_PLL_IC_PE2H_VAL(x)	((0xf & (x)) << 12)
+
+#define U3P_U3_PHYA_DA_REG6		0x110
+#define P3A_RG_PLL_IR_PE2H		GENMASK(19, 16)
+#define P3A_RG_PLL_IR_PE2H_VAL(x)	((0xf & (x)) << 16)
+
+#define U3P_U3_PHYA_DA_REG7		0x114
+#define P3A_RG_PLL_BP_PE2H		GENMASK(19, 16)
+#define P3A_RG_PLL_BP_PE2H_VAL(x)	((0xf & (x)) << 16)
+
+#define U3P_U3_PHYA_DA_REG20		0x13c
+#define P3A_RG_PLL_DELTA1_PE2H		GENMASK(31, 16)
+#define P3A_RG_PLL_DELTA1_PE2H_VAL(x)	((0xffff & (x)) << 16)
+
+#define U3P_U3_PHYA_DA_REG25		0x148
+#define P3A_RG_PLL_DELTA_PE2H		GENMASK(15, 0)
+#define P3A_RG_PLL_DELTA_PE2H_VAL(x)	(0xffff & (x))
+
+#define U3P_U3_PHYD_RXDET1		0x128
+#define P3D_RG_RXDET_STB2_SET		GENMASK(17, 9)
+#define P3D_RG_RXDET_STB2_SET_VAL(x)	((0x1ff & (x)) << 9)
+
+#define U3P_U3_PHYD_RXDET2		0x12c
+#define P3D_RG_RXDET_STB2_SET_P3	GENMASK(8, 0)
+#define P3D_RG_RXDET_STB2_SET_P3_VAL(x)	(0x1ff & (x))
+
+struct u3phy_banks {
+	void __iomem *spllc;
+	void __iomem *chip;
+	void __iomem *phyd; /* include u3phyd_bank2 */
+	void __iomem *phya; /* include u3phya_da */
+};
+
+struct mtk_phy_instance {
+	void __iomem *port_base;
+	const struct device_node *np;
+
+	struct u3phy_banks u3_banks;
+
+	/* reference clock of anolog phy */
+	struct clk ref_clk;
+	u32 index;
+	u8 type;
+};
+
+struct mtk_tphy {
+	void __iomem *sif_base;
+	struct mtk_phy_instance **phys;
+	int nphys;
+};
+
+static void pcie_phy_instance_init(struct mtk_tphy *tphy,
+				   struct mtk_phy_instance *instance)
+{
+	struct u3phy_banks *u3_banks = &instance->u3_banks;
+
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG0,
+			P3A_RG_XTAL_EXT_PE1H | P3A_RG_XTAL_EXT_PE2H,
+			P3A_RG_XTAL_EXT_PE1H_VAL(0x2) |
+			P3A_RG_XTAL_EXT_PE2H_VAL(0x2));
+
+	/* ref clk drive */
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_REG1, P3A_RG_CLKDRV_AMP,
+			P3A_RG_CLKDRV_AMP_VAL(0x4));
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_REG0, P3A_RG_CLKDRV_OFF,
+			P3A_RG_CLKDRV_OFF_VAL(0x1));
+
+	/* SSC delta -5000ppm */
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG20,
+			P3A_RG_PLL_DELTA1_PE2H,
+			P3A_RG_PLL_DELTA1_PE2H_VAL(0x3c));
+
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG25,
+			P3A_RG_PLL_DELTA_PE2H,
+			P3A_RG_PLL_DELTA_PE2H_VAL(0x36));
+
+	/* change pll BW 0.6M */
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG5,
+			P3A_RG_PLL_BR_PE2H | P3A_RG_PLL_IC_PE2H,
+			P3A_RG_PLL_BR_PE2H_VAL(0x1) |
+			P3A_RG_PLL_IC_PE2H_VAL(0x1));
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG4,
+			P3A_RG_PLL_DIVEN_PE2H | P3A_RG_PLL_BC_PE2H,
+			P3A_RG_PLL_BC_PE2H_VAL(0x3));
+
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG6,
+			P3A_RG_PLL_IR_PE2H, P3A_RG_PLL_IR_PE2H_VAL(0x2));
+	clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG7,
+			P3A_RG_PLL_BP_PE2H, P3A_RG_PLL_BP_PE2H_VAL(0xa));
+
+	/* Tx Detect Rx Timing: 10us -> 5us */
+	clrsetbits_le32(u3_banks->phyd + U3P_U3_PHYD_RXDET1,
+			P3D_RG_RXDET_STB2_SET,
+			P3D_RG_RXDET_STB2_SET_VAL(0x10));
+	clrsetbits_le32(u3_banks->phyd + U3P_U3_PHYD_RXDET2,
+			P3D_RG_RXDET_STB2_SET_P3,
+			P3D_RG_RXDET_STB2_SET_P3_VAL(0x10));
+
+	/* wait for PCIe subsys register to active */
+	udelay(3000);
+}
+
+static void pcie_phy_instance_power_on(struct mtk_tphy *tphy,
+				       struct mtk_phy_instance *instance)
+{
+	struct u3phy_banks *bank = &instance->u3_banks;
+
+	clrbits_le32(bank->chip + U3P_U3_CHIP_GPIO_CTLD,
+		     P3C_FORCE_IP_SW_RST | P3C_REG_IP_SW_RST);
+	clrbits_le32(bank->chip + U3P_U3_CHIP_GPIO_CTLE,
+		     P3C_RG_SWRST_U3_PHYD_FORCE_EN | P3C_RG_SWRST_U3_PHYD);
+}
+
+static void pcie_phy_instance_power_off(struct mtk_tphy *tphy,
+					struct mtk_phy_instance *instance)
+
+{
+	struct u3phy_banks *bank = &instance->u3_banks;
+
+	setbits_le32(bank->chip + U3P_U3_CHIP_GPIO_CTLD,
+		     P3C_FORCE_IP_SW_RST | P3C_REG_IP_SW_RST);
+	setbits_le32(bank->chip + U3P_U3_CHIP_GPIO_CTLE,
+		     P3C_RG_SWRST_U3_PHYD_FORCE_EN | P3C_RG_SWRST_U3_PHYD);
+}
+
+static void phy_v1_banks_init(struct mtk_tphy *tphy,
+			      struct mtk_phy_instance *instance)
+{
+	struct u3phy_banks *u3_banks = &instance->u3_banks;
+
+	switch (instance->type) {
+	case PHY_TYPE_PCIE:
+		u3_banks->spllc = tphy->sif_base + SSUSB_SIFSLV_V1_SPLLC;
+		u3_banks->chip = tphy->sif_base + SSUSB_SIFSLV_V1_CHIP;
+		u3_banks->phyd = instance->port_base + SSUSB_SIFSLV_V1_U3PHYD;
+		u3_banks->phya = instance->port_base + SSUSB_SIFSLV_V1_U3PHYA;
+		break;
+	default:
+		return;
+	}
+}
+
+static int mtk_phy_init(struct phy *phy)
+{
+	struct mtk_tphy *tphy = dev_get_priv(phy->dev);
+	struct mtk_phy_instance *instance = tphy->phys[phy->id];
+	int ret;
+
+	/* we may use a fixed-clock here */
+	ret = clk_enable(&instance->ref_clk);
+	if (ret && ret != -ENOSYS)
+		return ret;
+
+	switch (instance->type) {
+	case PHY_TYPE_PCIE:
+		pcie_phy_instance_init(tphy, instance);
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int mtk_phy_power_on(struct phy *phy)
+{
+	struct mtk_tphy *tphy = dev_get_priv(phy->dev);
+	struct mtk_phy_instance *instance = tphy->phys[phy->id];
+
+	pcie_phy_instance_power_on(tphy, instance);
+
+	return 0;
+}
+
+static int mtk_phy_power_off(struct phy *phy)
+{
+	struct mtk_tphy *tphy = dev_get_priv(phy->dev);
+	struct mtk_phy_instance *instance = tphy->phys[phy->id];
+
+	pcie_phy_instance_power_off(tphy, instance);
+
+	return 0;
+}
+
+static int mtk_phy_exit(struct phy *phy)
+{
+	struct mtk_tphy *tphy = dev_get_priv(phy->dev);
+	struct mtk_phy_instance *instance = tphy->phys[phy->id];
+
+	clk_disable(&instance->ref_clk);
+
+	return 0;
+}
+
+static int mtk_phy_xlate(struct phy *phy,
+			 struct ofnode_phandle_args *args)
+{
+	struct mtk_tphy *tphy = dev_get_priv(phy->dev);
+	struct mtk_phy_instance *instance = NULL;
+	const struct device_node *phy_np = ofnode_to_np(args->node);
+	u32 index;
+
+	if (!phy_np) {
+		dev_err(phy->dev, "null pointer phy node\n");
+		return -EINVAL;
+	}
+
+	if (args->args_count < 1) {
+		dev_err(phy->dev, "invalid number of cells in 'phy' property\n");
+		return -EINVAL;
+	}
+
+	for (index = 0; index < tphy->nphys; index++)
+		if (phy_np == tphy->phys[index]->np) {
+			instance = tphy->phys[index];
+			break;
+		}
+
+	if (!instance) {
+		dev_err(phy->dev, "failed to find appropriate phy\n");
+		return -EINVAL;
+	}
+
+	phy->id = index;
+	instance->type = args->args[1];
+	if (!(instance->type == PHY_TYPE_USB2 ||
+	      instance->type == PHY_TYPE_USB3 ||
+	      instance->type == PHY_TYPE_PCIE ||
+	      instance->type == PHY_TYPE_SATA)) {
+		dev_err(phy->dev, "unsupported device type\n");
+		return -EINVAL;
+	}
+
+	phy_v1_banks_init(tphy, instance);
+
+	return 0;
+}
+
+static const struct phy_ops mtk_tphy_ops = {
+	.init		= mtk_phy_init,
+	.exit		= mtk_phy_exit,
+	.power_on	= mtk_phy_power_on,
+	.power_off	= mtk_phy_power_off,
+	.of_xlate	= mtk_phy_xlate,
+};
+
+static int mtk_tphy_probe(struct udevice *dev)
+{
+	struct mtk_tphy *tphy = dev_get_priv(dev);
+	ofnode subnode;
+	int index = 0;
+
+	dev_for_each_subnode(subnode, dev)
+		tphy->nphys++;
+
+	tphy->phys = devm_kcalloc(dev, tphy->nphys, sizeof(*tphy->phys),
+				  GFP_KERNEL);
+	if (!tphy->phys)
+		return -ENOMEM;
+
+	tphy->sif_base = dev_read_addr_ptr(dev);
+	if (!tphy->sif_base)
+		return -ENOENT;
+
+	dev_for_each_subnode(subnode, dev) {
+		struct mtk_phy_instance *instance;
+		fdt_addr_t addr;
+		int err;
+
+		instance = devm_kzalloc(dev, sizeof(*instance), GFP_KERNEL);
+		if (!instance)
+			return -ENOMEM;
+
+		addr = ofnode_get_addr(subnode);
+		if (addr == FDT_ADDR_T_NONE)
+			return -ENOMEM;
+
+		instance->port_base = map_sysmem(addr, 0);
+		instance->index = index;
+		instance->np = ofnode_to_np(subnode);
+		tphy->phys[index] = instance;
+		index++;
+
+		err = clk_get_by_index_nodev(subnode, 0, &instance->ref_clk);
+		if (err)
+			return err;
+	}
+
+	return 0;
+}
+
+static const struct udevice_id mtk_tphy_id_table[] = {
+	{ .compatible = "mediatek,generic-tphy-v1", },
+	{ }
+};
+
+U_BOOT_DRIVER(mtk_tphy) = {
+	.name		= "mtk-tphy",
+	.id		= UCLASS_PHY,
+	.of_match	= mtk_tphy_id_table,
+	.ops		= &mtk_tphy_ops,
+	.probe		= mtk_tphy_probe,
+	.priv_auto_alloc_size = sizeof(struct mtk_tphy),
+};
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 3/8] arm: dts: add PCIe controller for MT7623 SoC
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 1/8] pci: mediatek: add PCIe controller support for MT7623 Frank Wunderlich
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 2/8] phy: mediatek: add MediaTek T-PHY support for PCIe Frank Wunderlich
@ 2019-08-22 10:26 ` Frank Wunderlich
  2019-10-12 20:22   ` Tom Rini
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 4/8] arm: dts: split mtk-reset.h into per-chip header Frank Wunderlich
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

From: Ryder Lee <ryder.lee@mediatek.com>

This adds PCIe and its PHY nodes for MT7623.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
changes since v3: none
changes since v2: none
---
 arch/arm/dts/mt7623.dtsi                 | 128 +++++++++++++++++++++++
 arch/arm/dts/mt7623n-bananapi-bpi-r2.dts |  29 +++++
 2 files changed, 157 insertions(+)

diff --git a/arch/arm/dts/mt7623.dtsi b/arch/arm/dts/mt7623.dtsi
index 64079c61bf..3a868ea2ee 100644
--- a/arch/arm/dts/mt7623.dtsi
+++ b/arch/arm/dts/mt7623.dtsi
@@ -9,6 +9,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/phy/phy.h>
 #include <dt-bindings/power/mt7623-power.h>
 #include <dt-bindings/reset/mtk-reset.h>
 #include "skeleton.dtsi"
@@ -255,6 +256,133 @@
 		#reset-cells = <1>;
 	};
 
+	pcie: pcie at 1a140000 {
+		compatible = "mediatek,mt7623-pcie";
+		device_type = "pci";
+		reg = <0x1a140000 0x1000>, /* PCIe shared registers */
+		      <0x1a142000 0x1000>, /* Port0 registers */
+		      <0x1a143000 0x1000>, /* Port1 registers */
+		      <0x1a144000 0x1000>; /* Port2 registers */
+		reg-names = "subsys", "port0", "port1", "port2";
+		#address-cells = <3>;
+		#size-cells = <2>;
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0xf800 0 0 0>;
+		interrupt-map = <0x0000 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>,
+				<0x0800 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>,
+				<0x1000 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
+		clocks = <&topckgen CLK_TOP_ETHIF_SEL>,
+			 <&hifsys CLK_HIFSYS_PCIE0>,
+			 <&hifsys CLK_HIFSYS_PCIE1>,
+			 <&hifsys CLK_HIFSYS_PCIE2>;
+		clock-names = "free_ck", "sys_ck0", "sys_ck1", "sys_ck2";
+		resets = <&hifsys HIFSYS_PCIE0_RST>,
+			 <&hifsys HIFSYS_PCIE1_RST>,
+			 <&hifsys HIFSYS_PCIE2_RST>;
+		reset-names = "pcie-rst0", "pcie-rst1", "pcie-rst2";
+		phys = <&pcie0_port PHY_TYPE_PCIE>,
+		       <&pcie1_port PHY_TYPE_PCIE>,
+		       <&u3port1 PHY_TYPE_PCIE>;
+		phy-names = "pcie-phy0", "pcie-phy1", "pcie-phy2";
+		power-domains = <&scpsys MT7623_POWER_DOMAIN_HIF>;
+		bus-range = <0x00 0xff>;
+		status = "disabled";
+		ranges = <0x81000000 0 0x1a160000 0x1a160000 0 0x00010000
+			  0x83000000 0 0x60000000 0x60000000 0 0x10000000>;
+
+		pcie at 0,0 {
+			reg = <0x0000 0 0 0 0>;
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0>;
+			interrupt-map = <0 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>;
+			ranges;
+			status = "disabled";
+		};
+
+		pcie at 1,0 {
+			reg = <0x0800 0 0 0 0>;
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0>;
+			interrupt-map = <0 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;
+			ranges;
+			status = "disabled";
+		};
+
+		pcie at 2,0 {
+			reg = <0x1000 0 0 0 0>;
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0>;
+			interrupt-map = <0 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
+			ranges;
+			status = "disabled";
+		};
+	};
+
+	pcie0_phy: pcie-phy at 1a149000 {
+		compatible = "mediatek,generic-tphy-v1";
+		reg = <0x1a149000 0x0700>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		status = "disabled";
+
+		pcie0_port: pcie-phy at 1a149900 {
+			reg = <0x1a149900 0x0700>;
+			clocks = <&clk26m>;
+			clock-names = "ref";
+			#phy-cells = <1>;
+			status = "okay";
+		};
+	};
+
+	pcie1_phy: pcie-phy at 1a14a000 {
+		compatible = "mediatek,generic-tphy-v1";
+		reg = <0x1a14a000 0x0700>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		status = "disabled";
+
+		pcie1_port: pcie-phy at 1a14a900 {
+			reg = <0x1a14a900 0x0700>;
+			clocks = <&clk26m>;
+			clock-names = "ref";
+			#phy-cells = <1>;
+			status = "okay";
+		};
+	};
+
+	u3phy2: usb-phy at 1a244000 {
+		compatible = "mediatek,generic-tphy-v1";
+		reg = <0x1a244000 0x0700>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		status = "disabled";
+
+		u2port1: usb-phy at 1a244800 {
+			reg = <0x1a244800 0x0100>;
+			clocks = <&topckgen CLK_TOP_USB_PHY48M>;
+			clock-names = "ref";
+			#phy-cells = <1>;
+			status = "okay";
+		};
+
+		u3port1: usb-phy at 1a244900 {
+			reg = <0x1a244900 0x0700>;
+			clocks = <&clk26m>;
+			clock-names = "ref";
+			#phy-cells = <1>;
+			status = "okay";
+		};
+	};
+
 	ethsys: syscon at 1b000000 {
 		compatible = "mediatek,mt7623-ethsys", "syscon";
 		reg = <0x1b000000 0x1000>;
diff --git a/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts b/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
index 51628bb639..b0c86219b6 100644
--- a/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
+++ b/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
@@ -172,6 +172,13 @@
 		};
 	};
 
+	pcie_default: pcie-default {
+		mux {
+			function = "pcie";
+			groups =  "pcie0_0_perst", "pcie1_0_perst";
+		};
+	};
+
 	uart0_pins_a: uart0-default {
 		mux {
 			function = "uart";
@@ -201,6 +208,28 @@
 	};
 };
 
+&pcie {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie_default>;
+	status = "okay";
+
+	pcie at 0,0 {
+		status = "okay";
+	};
+
+	pcie at 1,0 {
+		status = "okay";
+	};
+};
+
+&pcie0_phy {
+	status = "okay";
+};
+
+&pcie1_phy {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 4/8] arm: dts: split mtk-reset.h into per-chip header
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
                   ` (2 preceding siblings ...)
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 3/8] arm: dts: add PCIe controller for MT7623 SoC Frank Wunderlich
@ 2019-08-22 10:26 ` Frank Wunderlich
  2019-10-12 20:22   ` Tom Rini
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 5/8] dt-bindings: pcie: add a document for MT7623 PCIe controller Frank Wunderlich
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

From: Ryder Lee <ryder.lee@mediatek.com>

This follows the linux header rules to avoid conflict bitfields.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
changes since v3: none
changes since v2: none
---
 arch/arm/dts/mt7623.dtsi                      |  2 +-
 arch/arm/dts/mt7629.dtsi                      |  2 +-
 .../reset/{mtk-reset.h => mt7623-reset.h}     |  4 +--
 include/dt-bindings/reset/mt7629-reset.h      | 36 +++++++++++++++++++
 4 files changed, 39 insertions(+), 5 deletions(-)
 rename include/dt-bindings/reset/{mtk-reset.h => mt7623-reset.h} (88%)
 create mode 100644 include/dt-bindings/reset/mt7629-reset.h

diff --git a/arch/arm/dts/mt7623.dtsi b/arch/arm/dts/mt7623.dtsi
index 3a868ea2ee..1135b1e1ae 100644
--- a/arch/arm/dts/mt7623.dtsi
+++ b/arch/arm/dts/mt7623.dtsi
@@ -11,7 +11,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/phy/phy.h>
 #include <dt-bindings/power/mt7623-power.h>
-#include <dt-bindings/reset/mtk-reset.h>
+#include <dt-bindings/reset/mt7623-reset.h>
 #include "skeleton.dtsi"
 
 / {
diff --git a/arch/arm/dts/mt7629.dtsi b/arch/arm/dts/mt7629.dtsi
index ecbd29d7ae..3c9eab9770 100644
--- a/arch/arm/dts/mt7629.dtsi
+++ b/arch/arm/dts/mt7629.dtsi
@@ -10,7 +10,7 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/power/mt7629-power.h>
-#include <dt-bindings/reset/mtk-reset.h>
+#include <dt-bindings/reset/mt7629-reset.h>
 #include "skeleton.dtsi"
 
 / {
diff --git a/include/dt-bindings/reset/mtk-reset.h b/include/dt-bindings/reset/mt7623-reset.h
similarity index 88%
rename from include/dt-bindings/reset/mtk-reset.h
rename to include/dt-bindings/reset/mt7623-reset.h
index 78fcdab009..a859a5b26a 100644
--- a/include/dt-bindings/reset/mtk-reset.h
+++ b/include/dt-bindings/reset/mt7623-reset.h
@@ -6,11 +6,9 @@
 #ifndef _DT_BINDINGS_MTK_RESET_H_
 #define _DT_BINDINGS_MTK_RESET_H_
 
-/* ETHSYS */
+/* ETHSYS resets */
 #define ETHSYS_PPE_RST			31
-#define ETHSYS_EPHY_RST			24
 #define ETHSYS_GMAC_RST			23
-#define ETHSYS_ESW_RST			16
 #define ETHSYS_FE_RST			6
 #define ETHSYS_MCM_RST			2
 #define ETHSYS_SYS_RST			0
diff --git a/include/dt-bindings/reset/mt7629-reset.h b/include/dt-bindings/reset/mt7629-reset.h
new file mode 100644
index 0000000000..8f1634f7a6
--- /dev/null
+++ b/include/dt-bindings/reset/mt7629-reset.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 MediaTek Inc.
+ */
+
+#ifndef _DT_BINDINGS_MTK_RESET_H_
+#define _DT_BINDINGS_MTK_RESET_H_
+
+/* PCIe Subsystem resets */
+#define PCIE1_CORE_RST			19
+#define PCIE1_MMIO_RST			20
+#define PCIE1_HRST			21
+#define PCIE1_USER_RST			22
+#define PCIE1_PIPE_RST			23
+#define PCIE0_CORE_RST			27
+#define PCIE0_MMIO_RST			28
+#define PCIE0_HRST			29
+#define PCIE0_USER_RST			30
+#define PCIE0_PIPE_RST			31
+
+/* SSUSB Subsystem resets */
+#define SSUSB_PHY_PWR_RST		3
+#define SSUSB_MAC_PWR_RST		4
+
+/* ETH Subsystem resets */
+#define ETHSYS_SYS_RST			0
+#define ETHSYS_MCM_RST			2
+#define ETHSYS_HSDMA_RST		5
+#define ETHSYS_FE_RST			6
+#define ETHSYS_ESW_RST			16
+#define ETHSYS_GMAC_RST			23
+#define ETHSYS_EPHY_RST			24
+#define ETHSYS_CRYPTO_RST		29
+#define ETHSYS_PPE_RST			31
+
+#endif /* _DT_BINDINGS_MTK_RESET_H_ */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 5/8] dt-bindings: pcie: add a document for MT7623 PCIe controller
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
                   ` (3 preceding siblings ...)
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 4/8] arm: dts: split mtk-reset.h into per-chip header Frank Wunderlich
@ 2019-08-22 10:26 ` Frank Wunderlich
  2019-10-12 20:22   ` Tom Rini
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 6/8] dt-bindings: phy: add a document for MediaTek tphy Frank Wunderlich
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

From: Ryder Lee <ryder.lee@mediatek.com>

This adds a document for MT7623 PCIe controller.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
changes since v3: none
changes since v2: dt-bindings added with v3
---
 .../pci/mediatek-pcie.txt                     | 122 ++++++++++++++++++
 1 file changed, 122 insertions(+)
 create mode 100644 doc/device-tree-bindings/pci/mediatek-pcie.txt

diff --git a/doc/device-tree-bindings/pci/mediatek-pcie.txt b/doc/device-tree-bindings/pci/mediatek-pcie.txt
new file mode 100644
index 0000000000..2f9f549b7a
--- /dev/null
+++ b/doc/device-tree-bindings/pci/mediatek-pcie.txt
@@ -0,0 +1,122 @@
+MediaTek Gen2 PCIe controller
+
+Required properties:
+- compatible: Should contain one of the following strings:
+	"mediatek,mt7623-pcie"
+- device_type: Must be "pci"
+- reg: Base addresses and lengths of the PCIe subsys and root ports.
+- reg-names: Names of the above areas to use during resource lookup.
+- #address-cells: Address representation for root ports (must be 3)
+- #size-cells: Size representation for root ports (must be 2)
+- clocks: Must contain an entry for each entry in clock-names.
+- clock-names:
+  Mandatory entries:
+   - sys_ckN :transaction layer and data link layer clock
+  Required entries for MT7623:
+   - free_ck :for reference clock of PCIe subsys
+  where N starting from 0 to one less than the number of root ports.
+- phys: List of PHY specifiers (used by generic PHY framework).
+- phy-names : Must be "pcie-phy0", "pcie-phy1", "pcie-phyN".. based on the
+  number of PHYs as specified in *phys* property.
+- power-domains: A phandle and power domain specifier pair to the power domain
+  which is responsible for collapsing and restoring power to the peripheral.
+- bus-range: Range of bus numbers associated with this controller.
+- ranges: Ranges for the PCI memory and I/O regions.
+
+Required properties for MT7623:
+- #interrupt-cells: Size representation for interrupts (must be 1)
+- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties
+  Please refer to the standard PCI bus binding document for a more detailed
+  explanation.
+- resets: Must contain an entry for each entry in reset-names.
+- reset-names: Must be "pcie-rst0", "pcie-rst1", "pcie-rstN".. based on the
+  number of root ports.
+
+In addition, the device tree node must have sub-nodes describing each
+PCIe port interface, having the following mandatory properties:
+
+Required properties:
+- device_type: Must be "pci"
+- reg: Only the first four bytes are used to refer to the correct bus number
+  and device number.
+- #address-cells: Must be 3
+- #size-cells: Must be 2
+- #interrupt-cells: Must be 1
+- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties
+  Please refer to the standard PCI bus binding document for a more detailed
+  explanation.
+- ranges: Sub-ranges distributed from the PCIe controller node. An empty
+  property is sufficient.
+
+Examples for MT7623:
+
+	hifsys: syscon at 1a000000 {
+		compatible = "mediatek,mt7623-hifsys",
+			     "syscon";
+		reg = <0x1a000000 0x1000>;
+		#clock-cells = <1>;
+		#reset-cells = <1>;
+	};
+
+	pcie: pcie at 1a140000 {
+		compatible = "mediatek,mt7623-pcie";
+		device_type = "pci";
+		reg = <0x1a140000 0x1000>, /* PCIe shared registers */
+		      <0x1a142000 0x1000>, /* Port0 registers */
+		      <0x1a143000 0x1000>, /* Port1 registers */
+		      <0x1a144000 0x1000>; /* Port2 registers */
+		reg-names = "subsys", "port0", "port1", "port2";
+		#address-cells = <3>;
+		#size-cells = <2>;
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0xf800 0 0 0>;
+		interrupt-map = <0x0000 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>,
+				<0x0800 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>,
+				<0x1000 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
+		clocks = <&topckgen CLK_TOP_ETHIF_SEL>,
+			 <&hifsys CLK_HIFSYS_PCIE0>,
+			 <&hifsys CLK_HIFSYS_PCIE1>,
+			 <&hifsys CLK_HIFSYS_PCIE2>;
+		clock-names = "free_ck", "sys_ck0", "sys_ck1", "sys_ck2";
+		resets = <&hifsys HIFSYS_PCIE0_RST>,
+			 <&hifsys HIFSYS_PCIE1_RST>,
+			 <&hifsys HIFSYS_PCIE2_RST>;
+		reset-names = "pcie-rst0", "pcie-rst1", "pcie-rst2";
+		phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>,
+		       <&pcie2_phy PHY_TYPE_PCIE>;
+		phy-names = "pcie-phy0", "pcie-phy1", "pcie-phy2";
+		power-domains = <&scpsys MT7623_POWER_DOMAIN_HIF>;
+		bus-range = <0x00 0xff>;
+		ranges = <0x81000000 0 0x1a160000 0x1a160000 0 0x00010000	/* I/O space */
+			  0x83000000 0 0x60000000 0x60000000 0 0x10000000>;	/* memory space */
+
+		pcie at 0,0 {
+			reg = <0x0000 0 0 0 0>;
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0>;
+			interrupt-map = <0 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>;
+			ranges;
+		};
+
+		pcie at 1,0 {
+			reg = <0x0800 0 0 0 0>;
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0>;
+			interrupt-map = <0 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;
+			ranges;
+		};
+
+		pcie at 2,0 {
+			reg = <0x1000 0 0 0 0>;
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0>;
+			interrupt-map = <0 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
+			ranges;
+		};
+	};
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 6/8] dt-bindings: phy: add a document for MediaTek tphy
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
                   ` (4 preceding siblings ...)
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 5/8] dt-bindings: pcie: add a document for MT7623 PCIe controller Frank Wunderlich
@ 2019-08-22 10:26 ` Frank Wunderlich
  2019-10-12 20:22   ` Tom Rini
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 7/8] ahci-pci: ASM1061 report wrong class, but support AHCI Frank Wunderlich
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

From: Ryder Lee <ryder.lee@mediatek.com>

This adds a document for tphy which supports physical layer
functionality for a number of controllers on MediaTek SoCs,
such as, USB2.0, USB3.0, PCIe, and SATA.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
changes since v3: none
changes since v2: dt-bindings added with v3
---
 doc/device-tree-bindings/phy/phy-mtk-tphy.txt | 86 +++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 doc/device-tree-bindings/phy/phy-mtk-tphy.txt

diff --git a/doc/device-tree-bindings/phy/phy-mtk-tphy.txt b/doc/device-tree-bindings/phy/phy-mtk-tphy.txt
new file mode 100644
index 0000000000..037c5a4be5
--- /dev/null
+++ b/doc/device-tree-bindings/phy/phy-mtk-tphy.txt
@@ -0,0 +1,86 @@
+MediaTek T-PHY binding
+--------------------------
+
+T-phy controller supports physical layer functionality for a number of
+controllers on MediaTek SoCs, such as, USB2.0, USB3.0, PCIe, and SATA.
+
+Required properties (controller (parent) node):
+ - compatible	: should be one of
+		  "mediatek,generic-tphy-v1"
+ - clocks	: (deprecated, use port's clocks instead) a list of phandle +
+		  clock-specifier pairs, one for each entry in clock-names
+ - clock-names	: (deprecated, use port's one instead) must contain
+		  "u3phya_ref": for reference clock of usb3.0 analog phy.
+
+Required nodes	: a sub-node is required for each port the controller
+		  provides. Address range information including the usual
+		  'reg' property is used inside these nodes to describe
+		  the controller's topology.
+
+Optional properties (controller (parent) node):
+ - reg		: offset and length of register shared by multiple ports,
+		  exclude port's private register.
+ - mediatek,src-ref-clk-mhz	: frequency of reference clock for slew rate
+		  calibrate
+ - mediatek,src-coef	: coefficient for slew rate calibrate, depends on
+		  SoC process
+
+Required properties (port (child) node):
+- reg		: address and length of the register set for the port.
+- clocks	: a list of phandle + clock-specifier pairs, one for each
+		  entry in clock-names
+- clock-names	: must contain
+		  "ref": 48M reference clock for HighSpeed analog phy; and 26M
+			reference clock for SuperSpeed analog phy, sometimes is
+			24M, 25M or 27M, depended on platform.
+- #phy-cells	: should be 1 (See second example)
+		  cell after port phandle is phy type from:
+			- PHY_TYPE_USB2
+			- PHY_TYPE_USB3
+			- PHY_TYPE_PCIE
+			- PHY_TYPE_SATA
+
+Example:
+
+	u3phy2: usb-phy at 1a244000 {
+		compatible = "mediatek,generic-tphy-v1";
+		reg = <0x1a244000 0x0700>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		status = "disabled";
+
+		u2port1: usb-phy at 1a244800 {
+			reg = <0x1a244800 0x0100>;
+			clocks = <&topckgen CLK_TOP_USB_PHY48M>;
+			clock-names = "ref";
+			#phy-cells = <1>;
+			status = "okay";
+		};
+
+		u3port1: usb-phy at 1a244900 {
+			reg = <0x1a244900 0x0700>;
+			clocks = <&clk26m>;
+			clock-names = "ref";
+			#phy-cells = <1>;
+			status = "okay";
+		};
+	};
+
+Specifying phy control of devices
+---------------------------------
+
+Device nodes should specify the configuration required in their "phys"
+property, containing a phandle to the phy port node and a device type;
+phy-names for each port are optional.
+
+Example:
+
+#include <dt-bindings/phy/phy.h>
+
+usb30: usb at 11270000 {
+	...
+	phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>;
+	phy-names = "usb2-0", "usb3-0";
+	...
+};
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 7/8] ahci-pci: ASM1061 report wrong class, but support AHCI.
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
                   ` (5 preceding siblings ...)
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 6/8] dt-bindings: phy: add a document for MediaTek tphy Frank Wunderlich
@ 2019-08-22 10:26 ` Frank Wunderlich
  2019-10-12 20:22   ` Tom Rini
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 8/8] ata: ahci: Don't forget to clear upper address regs Frank Wunderlich
  2019-08-28  9:17 ` [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
  8 siblings, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

From: Oleksandr Rybalko <ray@ddteam.net>

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Oleksandr Rybalko <ray@ddteam.net>
---
changes since v3: none
changes since v2: none
---
 drivers/ata/ahci-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ata/ahci-pci.c b/drivers/ata/ahci-pci.c
index 1ca439d3fa..11ec98b56f 100644
--- a/drivers/ata/ahci-pci.c
+++ b/drivers/ata/ahci-pci.c
@@ -35,6 +35,7 @@ U_BOOT_DRIVER(ahci_pci) = {
 
 static struct pci_device_id ahci_pci_supported[] = {
 	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, ~0) },
+	{ PCI_DEVICE(0x1b21, 0x0611) },
 	{},
 };
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 8/8] ata: ahci: Don't forget to clear upper address regs.
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
                   ` (6 preceding siblings ...)
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 7/8] ahci-pci: ASM1061 report wrong class, but support AHCI Frank Wunderlich
@ 2019-08-22 10:26 ` Frank Wunderlich
  2019-10-12 20:22   ` Tom Rini
  2019-08-28  9:17 ` [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
  8 siblings, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-22 10:26 UTC (permalink / raw)
  To: u-boot

From: Oleksandr Rybalko <ray@ddteam.net>

In 32bits mode upper bits need to be set to 0, otherwise controller will
try to DMA into not existing memory and stops with error.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Oleksandr Rybalko <ray@ddteam.net>
---
changes since v3: fix build warning on x86_64
changes since v2: none
---
 drivers/ata/ahci.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index e3135bb75f..3d782b0944 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -548,6 +548,7 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port)
 {
 	struct ahci_ioports *pp = &(uc_priv->port[port]);
 	void __iomem *port_mmio = pp->port_mmio;
+	u64 dma_addr;
 	u32 port_status;
 	void __iomem *mem;
 
@@ -593,10 +594,12 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port)
 	pp->cmd_tbl_sg =
 			(struct ahci_sg *)(uintptr_t)virt_to_phys((void *)mem);
 
-	writel_with_flush((unsigned long)pp->cmd_slot,
-			  port_mmio + PORT_LST_ADDR);
-
-	writel_with_flush(pp->rx_fis, port_mmio + PORT_FIS_ADDR);
+	dma_addr = (ulong)pp->cmd_slot;
+	writel_with_flush(dma_addr, port_mmio + PORT_LST_ADDR);
+	writel_with_flush(dma_addr >> 32, port_mmio + PORT_LST_ADDR_HI);
+	dma_addr = (ulong)pp->rx_fis;
+	writel_with_flush(dma_addr, port_mmio + PORT_FIS_ADDR);
+	writel_with_flush(dma_addr >> 32, port_mmio + PORT_FIS_ADDR_HI);
 
 #ifdef CONFIG_SUNXI_AHCI
 	sunxi_dma_init(port_mmio);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623
  2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
                   ` (7 preceding siblings ...)
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 8/8] ata: ahci: Don't forget to clear upper address regs Frank Wunderlich
@ 2019-08-28  9:17 ` Frank Wunderlich
  2019-09-01 12:27   ` Aleksandr Rybalko
  2019-10-02  5:24   ` Frank Wunderlich
  8 siblings, 2 replies; 21+ messages in thread
From: Frank Wunderlich @ 2019-08-28  9:17 UTC (permalink / raw)
  To: u-boot

Any comments on this series?

just a friendly reminder :)

regards Frank

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623
  2019-08-28  9:17 ` [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
@ 2019-09-01 12:27   ` Aleksandr Rybalko
  2019-10-02  5:24   ` Frank Wunderlich
  1 sibling, 0 replies; 21+ messages in thread
From: Aleksandr Rybalko @ 2019-09-01 12:27 UTC (permalink / raw)
  To: u-boot

Hello fellow hackers!

anybody interesting in continue to improve Mediatek MT7623 support?
If so, please review comment and/or commit that change-set.

Thank you!


ср, 28 серп. 2019 о 12:17 Frank Wunderlich <frank-w@public-files.de> пише:

> Any comments on this series?
>
> just a friendly reminder :)
>
> regards Frank
>


-- 
WBW
-------
Rybalko Aleksandr <ray@ddteam.net>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623
  2019-08-28  9:17 ` [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
  2019-09-01 12:27   ` Aleksandr Rybalko
@ 2019-10-02  5:24   ` Frank Wunderlich
  2019-10-12 14:48     ` Frank Wunderlich
  1 sibling, 1 reply; 21+ messages in thread
From: Frank Wunderlich @ 2019-10-02  5:24 UTC (permalink / raw)
  To: u-boot

hi
just a gentle ping...

you waiting for next merge window?

Regards Frank

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623
  2019-10-02  5:24   ` Frank Wunderlich
@ 2019-10-12 14:48     ` Frank Wunderlich
  0 siblings, 0 replies; 21+ messages in thread
From: Frank Wunderlich @ 2019-10-12 14:48 UTC (permalink / raw)
  To: u-boot

Hi,
2019-10 is now released so i want to remember on this series. Just to be inside merge window...

Regards Frank

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 1/8] pci: mediatek: add PCIe controller support for MT7623
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 1/8] pci: mediatek: add PCIe controller support for MT7623 Frank Wunderlich
@ 2019-10-12 20:22   ` Tom Rini
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2019-10-12 20:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 22, 2019 at 12:26:49PM +0200, Frank Wunderlich wrote:

> From: Ryder Lee <ryder.lee@mediatek.com>
> 
> This adds PCIe controller support for MT7623.
> This is adapted from the Linux version.
> 
> Tested-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/b011a308/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 2/8] phy: mediatek: add MediaTek T-PHY support for PCIe
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 2/8] phy: mediatek: add MediaTek T-PHY support for PCIe Frank Wunderlich
@ 2019-10-12 20:22   ` Tom Rini
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2019-10-12 20:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 22, 2019 at 12:26:50PM +0200, Frank Wunderlich wrote:

> From: Ryder Lee <ryder.lee@mediatek.com>
> 
> The driver provides PHY for USB2, USB3.0, PCIe and SATA, and now
> we just enable PCIe. As for the other functionalities will be
> added gradually in upcoming days.
> 
> This is adapted from the Linux version.
> 
> Tested-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/2914e08f/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 3/8] arm: dts: add PCIe controller for MT7623 SoC
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 3/8] arm: dts: add PCIe controller for MT7623 SoC Frank Wunderlich
@ 2019-10-12 20:22   ` Tom Rini
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2019-10-12 20:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 22, 2019 at 12:26:51PM +0200, Frank Wunderlich wrote:

> From: Ryder Lee <ryder.lee@mediatek.com>
> 
> This adds PCIe and its PHY nodes for MT7623.
> 
> Tested-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/08d9a8c3/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 4/8] arm: dts: split mtk-reset.h into per-chip header
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 4/8] arm: dts: split mtk-reset.h into per-chip header Frank Wunderlich
@ 2019-10-12 20:22   ` Tom Rini
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2019-10-12 20:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 22, 2019 at 12:26:52PM +0200, Frank Wunderlich wrote:

> From: Ryder Lee <ryder.lee@mediatek.com>
> 
> This follows the linux header rules to avoid conflict bitfields.
> 
> Tested-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/8e0e94c3/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 5/8] dt-bindings: pcie: add a document for MT7623 PCIe controller
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 5/8] dt-bindings: pcie: add a document for MT7623 PCIe controller Frank Wunderlich
@ 2019-10-12 20:22   ` Tom Rini
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2019-10-12 20:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 22, 2019 at 12:26:53PM +0200, Frank Wunderlich wrote:

> From: Ryder Lee <ryder.lee@mediatek.com>
> 
> This adds a document for MT7623 PCIe controller.
> 
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/d6f38f02/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 6/8] dt-bindings: phy: add a document for MediaTek tphy
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 6/8] dt-bindings: phy: add a document for MediaTek tphy Frank Wunderlich
@ 2019-10-12 20:22   ` Tom Rini
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2019-10-12 20:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 22, 2019 at 12:26:54PM +0200, Frank Wunderlich wrote:

> From: Ryder Lee <ryder.lee@mediatek.com>
> 
> This adds a document for tphy which supports physical layer
> functionality for a number of controllers on MediaTek SoCs,
> such as, USB2.0, USB3.0, PCIe, and SATA.
> 
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/298b02fb/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 7/8] ahci-pci: ASM1061 report wrong class, but support AHCI.
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 7/8] ahci-pci: ASM1061 report wrong class, but support AHCI Frank Wunderlich
@ 2019-10-12 20:22   ` Tom Rini
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2019-10-12 20:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 22, 2019 at 12:26:55PM +0200, Frank Wunderlich wrote:

> From: Oleksandr Rybalko <ray@ddteam.net>
> 
> Tested-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Oleksandr Rybalko <ray@ddteam.net>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/d1ed0309/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH v4 8/8] ata: ahci: Don't forget to clear upper address regs.
  2019-08-22 10:26 ` [U-Boot] [PATCH v4 8/8] ata: ahci: Don't forget to clear upper address regs Frank Wunderlich
@ 2019-10-12 20:22   ` Tom Rini
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2019-10-12 20:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 22, 2019 at 12:26:56PM +0200, Frank Wunderlich wrote:

> From: Oleksandr Rybalko <ray@ddteam.net>
> 
> In 32bits mode upper bits need to be set to 0, otherwise controller will
> try to DMA into not existing memory and stops with error.
> 
> Tested-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Oleksandr Rybalko <ray@ddteam.net>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191012/395cf7ba/attachment.sig>

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-10-12 20:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22 10:26 [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
2019-08-22 10:26 ` [U-Boot] [PATCH v4 1/8] pci: mediatek: add PCIe controller support for MT7623 Frank Wunderlich
2019-10-12 20:22   ` Tom Rini
2019-08-22 10:26 ` [U-Boot] [PATCH v4 2/8] phy: mediatek: add MediaTek T-PHY support for PCIe Frank Wunderlich
2019-10-12 20:22   ` Tom Rini
2019-08-22 10:26 ` [U-Boot] [PATCH v4 3/8] arm: dts: add PCIe controller for MT7623 SoC Frank Wunderlich
2019-10-12 20:22   ` Tom Rini
2019-08-22 10:26 ` [U-Boot] [PATCH v4 4/8] arm: dts: split mtk-reset.h into per-chip header Frank Wunderlich
2019-10-12 20:22   ` Tom Rini
2019-08-22 10:26 ` [U-Boot] [PATCH v4 5/8] dt-bindings: pcie: add a document for MT7623 PCIe controller Frank Wunderlich
2019-10-12 20:22   ` Tom Rini
2019-08-22 10:26 ` [U-Boot] [PATCH v4 6/8] dt-bindings: phy: add a document for MediaTek tphy Frank Wunderlich
2019-10-12 20:22   ` Tom Rini
2019-08-22 10:26 ` [U-Boot] [PATCH v4 7/8] ahci-pci: ASM1061 report wrong class, but support AHCI Frank Wunderlich
2019-10-12 20:22   ` Tom Rini
2019-08-22 10:26 ` [U-Boot] [PATCH v4 8/8] ata: ahci: Don't forget to clear upper address regs Frank Wunderlich
2019-10-12 20:22   ` Tom Rini
2019-08-28  9:17 ` [U-Boot] [PATCH v4 0/8] add PCIe, its PHY and AHCI support for mt7623 Frank Wunderlich
2019-09-01 12:27   ` Aleksandr Rybalko
2019-10-02  5:24   ` Frank Wunderlich
2019-10-12 14:48     ` Frank Wunderlich

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.