Skip to contentSkip to conversation

arm64: mvebu: Add support for A8K community board

PATCH Superseded kostap at marvell.com 3 participants 15 messages Jan 8, 2017 – Feb 6, 2017

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm64: mvebu: Add support for A8K community board

From: Konstantin Porotchkin <[email protected]>

This patch series adds initil support for A8K community board MACCHIATOBin manufactured by SolidRun.
It should be applied on top of Stefan Roese patches adding support for SD/eMMC devices on Marvell A37x0/A80x0/A70x0 SoCs. The top level patch is called:
"arm64: mvebu: Enable SDHCI/MMC support for the db-88f7040/8040" The default board DTS file is based on the original work of Rabeeh Khory from SolidRun.

Changes for v2:
- Move PCIe reset GPIO support from board-specific function to mvebu PCIe driver
- Move VBUS GPIO support from board-specific function to mvebu XHCI driver
- Allow MMC support for "bubt" command with and without CONFIG_BLK

Konstantin Porotchkin (6):
arm64: mvebu: Update bubt command MMC block device access
arm64: mvebu: gpio: Add GPIO nodes to A8K family devices
arm64: mvebu: dts: Add i2c1 pin definitions to CPM
mvebu: usb: xhci: Add support for VBUS controlled by GPIO
mvebu: pcie: Add support for GPIO reset for PCIe device
arm64: mvebu: Add default configuraton for MACCHIATOBin board

Rabeeh Khoury (1):
arm64: mvebu: dts: Add DTS file for MACCHIATOBin board

 arch/arm/dts/Makefile                             |   1 +
 arch/arm/dts/armada-7040.dtsi                     |   1 +
 arch/arm/dts/armada-8040-mcbin.dts                | 253 ++++++++++++++++++++++
 arch/arm/dts/armada-8040.dtsi                     |   1 +
 arch/arm/dts/armada-ap806.dtsi                    |   8 +
 arch/arm/dts/armada-cp110-master.dtsi             |  22 ++
 arch/arm/dts/armada-cp110-slave.dtsi              |  18 ++
 cmd/mvebu/bubt.c                                  |  25 ++-
 configs/mvebu_mcbin-88f8040_defconfig             |  65 ++++++
 doc/device-tree-bindings/pci/armada8k-pcie.txt    |  49 +++++
 doc/device-tree-bindings/usb/marvell.xhci-usb.txt |  29 +++
 drivers/pci/pcie_dw_mvebu.c                       |  20 ++
 drivers/usb/host/xhci-mvebu.c                     |  14 ++
 13 files changed, 503 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/dts/armada-8040-mcbin.dts
 create mode 100644 configs/mvebu_mcbin-88f8040_defconfig
 create mode 100644 doc/device-tree-bindings/pci/armada8k-pcie.txt
 create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/7 arm64: mvebu: Update bubt command MMC block device access

From: Konstantin Porotchkin <[email protected]>

Update the MMC block device access code in bubt command implementation according to the latest MMC driver changes.

Change-Id Ie852ceefa0b040ffe1362bdb7815fcea9b2d923b
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- Allow MMC support for builds without CONFIG_BLK

 cmd/mvebu/bubt.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
cmd/mvebu/bubt.c +22 -3
index 1cbfcf0..b752927 100644
@@ -18,6 +18,9 @@
 #include <usb.h>
 #include <fs.h>
 #include <mmc.h>
+#ifdef CONFIG_BLK
+#include <blk.h>
+#endif
 #include <u-boot/sha1.h>
 #include <u-boot/sha256.h>
 
@@ -116,7 +119,9 @@ static int mmc_burn_image(size_t image_size)
 	ulong		blk_written;
 	int		err;
 	const u8	mmc_dev_num = CONFIG_SYS_MMC_ENV_DEV;
-
+#ifdef CONFIG_BLK
+	struct blk_desc *blk_desc;
+#endif
 	mmc = find_mmc_device(mmc_dev_num);
 	if (!mmc) {
 		printf("No SD/MMC/eMMC card found\n");
@@ -144,13 +149,27 @@ static int mmc_burn_image(size_t image_size)
 	 * MMC/eMMC boots from LBA-0
 	 */
 	start_lba = IS_SD(mmc) ? 1 : 0;
+#ifdef CONFIG_BLK
+	blk_count = image_size / mmc->write_bl_len;
+	if (image_size % mmc->write_bl_len)
+		blk_count += 1;
+
+	blk_desc = mmc_get_blk_desc(mmc);
+	if (!blk_desc) {
+		printf("Error - failed to obtain block descriptor\n");
+		return -ENODEV;
+	}
+	blk_written = blk_dwrite(blk_desc, start_lba, blk_count,
+				 (void *)get_load_addr());
+#else
 	blk_count = image_size / mmc->block_dev.blksz;
 	if (image_size % mmc->block_dev.blksz)
 		blk_count += 1;
 
 	blk_written = mmc->block_dev.block_write(mmc_dev_num,
-						start_lba, blk_count,
-						(void *)get_load_addr());
+						 start_lba, blk_count,
+						 (void *)get_load_addr());
+#endif /* CONFIG_BLK */
 	if (blk_written != blk_count) {
 		printf("Error - written %#lx blocks\n", blk_written);
 		return -ENOSPC;
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/7 arm64: mvebu: Update bubt command MMC block device access

Quoted 14 lines · kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Update the MMC block device access code in bubt command implementation according to the latest MMC driver changes.

Change-Id Ie852ceefa0b040ffe1362bdb7815fcea9b2d923b
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>
Quoted 3 lines

---
Changes for v2:
- Allow MMC support for builds without CONFIG_BLK

Applied to u-boot-marvell/master

Thanks,
Stefan

#3 lore raw

PATCH v2 2/7 arm64: mvebu: gpio: Add GPIO nodes to A8K family devices

In reply to kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add GPIO nodes to AP-806 and CP-110-master DTSI files.

Change-Id I05958698d460cb721b7d8683d34f74a5ea32532c
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- None, copy

 arch/arm/dts/armada-7040.dtsi         |  1 +
 arch/arm/dts/armada-8040.dtsi         |  1 +
 arch/arm/dts/armada-ap806.dtsi        |  8 ++++++++
 arch/arm/dts/armada-cp110-master.dtsi | 18 ++++++++++++++++++
 arch/arm/dts/armada-cp110-slave.dtsi  | 18 ++++++++++++++++++
 5 files changed, 46 insertions(+)
arch/arm/dts/armada-7040.dtsi +1 -0
index 78d995d..b5be0c4 100644
@@ -45,6 +45,7 @@
  * one CP110.
  */
 
+#include <dt-bindings/gpio/gpio.h>
 #include "armada-ap806-quad.dtsi"
 #include "armada-cp110-master.dtsi"
 
arch/arm/dts/armada-8040.dtsi +1 -0
index 9c1b28c..96cc112 100644
@@ -45,6 +45,7 @@
  * two CP110.
  */
 
+#include <dt-bindings/gpio/gpio.h>
 #include "armada-ap806-quad.dtsi"
 #include "armada-cp110-master.dtsi"
 #include "armada-cp110-slave.dtsi"
arch/arm/dts/armada-ap806.dtsi +8 -0
index b6d31af..d86e5dd 100644
@@ -158,6 +158,14 @@
 				};
 			};
 
+			ap_gpio0: gpio at 6F5040 {
+				compatible = "marvell,orion-gpio";
+				reg = <0x6F5040 0x40>;
+				ngpios = <20>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
+
 			xor at 400000 {
 				compatible = "marvell,mv-xor-v2";
 				reg = <0x400000 0x1000>,
arch/arm/dts/armada-cp110-master.dtsi +18 -0
index d637867..a3e922d 100644
@@ -113,6 +113,24 @@
 				};
 			};
 
+			cpm_gpio0: gpio at 440100 {
+				compatible = "marvell,orion-gpio";
+				reg = <0x440100 0x40>;
+				ngpios = <32>;
+				gpiobase = <20>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
+
+			cpm_gpio1: gpio at 440140 {
+				compatible = "marvell,orion-gpio";
+				reg = <0x440140 0x40>;
+				ngpios = <31>;
+				gpiobase = <52>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
+
 			cpm_sata0: sata at 540000 {
 				compatible = "marvell,armada-8k-ahci";
 				reg = <0x540000 0x30000>;
arch/arm/dts/armada-cp110-slave.dtsi +18 -0
index 92ef55c..ff3fbed 100644
@@ -100,6 +100,24 @@
 				};
 			};
 
+			cps_gpio0: gpio at 440100 {
+				compatible = "marvell,orion-gpio";
+				reg = <0x440100 0x40>;
+				ngpios = <32>;
+				gpiobase = <20>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
+
+			cps_gpio1: gpio at 440140 {
+				compatible = "marvell,orion-gpio";
+				reg = <0x440140 0x40>;
+				ngpios = <31>;
+				gpiobase = <52>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
+
 			cps_sata0: sata at 540000 {
 				compatible = "marvell,armada-8k-ahci";
 				reg = <0x540000 0x30000>;
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 3/7 arm64: mvebu: dts: Add i2c1 pin definitions to CPM

In reply to kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add i2c-1 pin mappings to CP0(master) DTSI file

Change-Id I0c6e6de8a557393f518f7df8e6daa6dfce1788b0
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- None, copy

 arch/arm/dts/armada-cp110-master.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/armada-cp110-master.dtsi +4 -0
index a3e922d..3776e4e 100644
@@ -94,6 +94,10 @@
 					marvell,pins = < 37 38 >;
 					marvell,function = <2>;
 				};
+				cpm_i2c1_pins: cpm-i2c-pins-1 {
+					marvell,pins = < 35 36 >;
+					marvell,function = <2>;
+				};
 				cpm_ge2_rgmii_pins: cpm-ge-rgmii-pins-0 {
 					marvell,pins = < 44 45 46 47 48 49 50 51
 							 52 53 54 55 >;
Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 4/7 mvebu: usb: xhci: Add support for VBUS controlled by GPIO

In reply to kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add support for "marvell,vbus-gpio" property to mvebu XHCI host adapter driver.
This option is valid when CONFIG_DM_GPIO=y

Change-Id I930b3ebe001e50ae8d5abe1f3c774bcdb1739e64
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- Move VBUS GPIO support from board-specific function to mvebu XHCI driver
- Increase delay after VBUS GPIO activation

 doc/device-tree-bindings/usb/marvell.xhci-usb.txt | 29 +++++++++++++++++++++++
 drivers/usb/host/xhci-mvebu.c                     | 14 +++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +29 -0
new file mode 100644
index 0000000..b0a53ad
@@ -0,0 +1,29 @@
+Marvell SOC USB controllers
+
+This controller is integrated in Armada 3700/8K.
+It uses the same properties as a generic XHCI host controller
+
+Required properties :
+ - compatible: should be one or more of:
+   - "marvell,armada3700-xhci", "generic-xhci" for Armada 37xx SoCs
+   - "marvell,armada-8k-xhci", "generic-xhci" for Armada A8K SoCs
+ - reg: should contain address and length of the standard XHCI
+    register set for the device.
+ - interrupts: one XHCI interrupt should be described here.
+
+Optional properties:
+ - clocks: reference to a clock
+ - marvell,vbus-gpio : If present, specifies a gpio that needs to be
+   activated for the bus to be powered.
+
+Example:
+	cpm_usb3_0: usb3 at 500000 {
+		compatible = "marvell,armada-8k-xhci",
+			     "generic-xhci";
+		reg = <0x500000 0x4000>;
+		interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cpm_syscon0 1 22>;
+		marvell,vbus-gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>;
+		status = "disabled";
+	};
+
drivers/usb/host/xhci-mvebu.c +14 -0
index 46eb937..64801e7 100644
@@ -45,6 +45,20 @@ static int xhci_usb_probe(struct udevice *dev)
 	struct mvebu_xhci *ctx = dev_get_priv(dev);
 	struct xhci_hcor *hcor;
 	int len;
+#ifdef CONFIG_DM_GPIO
+	struct gpio_desc vbus_gpio;
+
+	gpio_request_by_name(dev, "marvell,vbus-gpio", 0, &vbus_gpio,
+			     GPIOD_IS_OUT);
+
+	if (dm_gpio_is_valid(&vbus_gpio)) {
+		dm_gpio_set_value(&vbus_gpio, 1);
+		/* Wait for the GPIO VBUS output set */
+		mdelay(500);
+	}
+#else
+	debug("USB VBUS on GPIO support is missing\n");
+#endif /* CONFIG_DM_GPIO */
 
 	ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
 	len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 4/7 mvebu: usb: xhci: Add support for VBUS controlled by GPIO

Hi Marek,

(adding Marek as USB custodian to Cc)

Quoted 76 lines · kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add support for "marvell,vbus-gpio" property to mvebu XHCI host adapter driver.
This option is valid when CONFIG_DM_GPIO=y

Change-Id I930b3ebe001e50ae8d5abe1f3c774bcdb1739e64
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- Move VBUS GPIO support from board-specific function to mvebu XHCI driver
- Increase delay after VBUS GPIO activation

 doc/device-tree-bindings/usb/marvell.xhci-usb.txt | 29 +++++++++++++++++++++++
 drivers/usb/host/xhci-mvebu.c                     | 14 +++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +29 -0
new file mode 100644
index 0000000..b0a53ad
@@ -0,0 +1,29 @@
+Marvell SOC USB controllers
+
+This controller is integrated in Armada 3700/8K.
+It uses the same properties as a generic XHCI host controller
+
+Required properties :
+ - compatible: should be one or more of:
+   - "marvell,armada3700-xhci", "generic-xhci" for Armada 37xx SoCs
+   - "marvell,armada-8k-xhci", "generic-xhci" for Armada A8K SoCs
+ - reg: should contain address and length of the standard XHCI
+    register set for the device.
+ - interrupts: one XHCI interrupt should be described here.
+
+Optional properties:
+ - clocks: reference to a clock
+ - marvell,vbus-gpio : If present, specifies a gpio that needs to be
+   activated for the bus to be powered.
+
+Example:
+	cpm_usb3_0: usb3 at 500000 {
+		compatible = "marvell,armada-8k-xhci",
+			     "generic-xhci";
+		reg = <0x500000 0x4000>;
+		interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cpm_syscon0 1 22>;
+		marvell,vbus-gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>;
+		status = "disabled";
+	};
+
drivers/usb/host/xhci-mvebu.c +7 -0
index 46eb937..64801e7 100644
@@ -45,6 +45,20 @@ static int xhci_usb_probe(struct udevice *dev)
 	struct mvebu_xhci *ctx = dev_get_priv(dev);
 	struct xhci_hcor *hcor;
 	int len;
+#ifdef CONFIG_DM_GPIO
+	struct gpio_desc vbus_gpio;
+
+	gpio_request_by_name(dev, "marvell,vbus-gpio", 0, &vbus_gpio,
+			     GPIOD_IS_OUT);
+
+	if (dm_gpio_is_valid(&vbus_gpio)) {

drivers/usb/host/xhci-mvebu.c static int xhci_usb_probe(struct udevice *dev) · line 64

Quoted 10 lines
drivers/usb/host/xhci-mvebu.c +7 -0
+		dm_gpio_set_value(&vbus_gpio, 1);
+		/* Wait for the GPIO VBUS output set */
+		mdelay(500);
+	}
+#else
+	debug("USB VBUS on GPIO support is missing\n");
+#endif /* CONFIG_DM_GPIO */
 
 	ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
 	len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));

Marek, do you have some comments on this USB related patch? If not, are you okay with me pushing it via the Marvell repository?

Thanks,
Stefan

#7 lore raw

PATCH v2 4/7 mvebu: usb: xhci: Add support for VBUS controlled by GPIO

Quoted 46 lines · Stefan Roese

Hi Marek,

(adding Marek as USB custodian to Cc)

Quoted 41 lines · kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add support for "marvell,vbus-gpio" property to mvebu XHCI host adapter driver.
This option is valid when CONFIG_DM_GPIO=y

Change-Id I930b3ebe001e50ae8d5abe1f3c774bcdb1739e64
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- Move VBUS GPIO support from board-specific function to mvebu XHCI driver
- Increase delay after VBUS GPIO activation

 doc/device-tree-bindings/usb/marvell.xhci-usb.txt | 29
+++++++++++++++++++++++
 drivers/usb/host/xhci-mvebu.c                     | 14 +++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +7 -0
new file mode 100644
index 0000000..b0a53ad
@@ -0,0 +1,29 @@
+Marvell SOC USB controllers
+
+This controller is integrated in Armada 3700/8K.
+It uses the same properties as a generic XHCI host controller
+
+Required properties :
+ - compatible: should be one or more of:
Quoted 8 lines

doc/device-tree-bindings/usb/marvell.xhci-usb.txt line 15

Quoted 8 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +8 -0
+   - "marvell,armada3700-xhci", "generic-xhci" for Armada 37xx SoCs
+   - "marvell,armada-8k-xhci", "generic-xhci" for Armada A8K SoCs
+ - reg: should contain address and length of the standard XHCI
+    register set for the device.
+ - interrupts: one XHCI interrupt should be described here.
+
+Optional properties:
+ - clocks: reference to a clock

Reference clock are optional ?

Quoted 2 lines

doc/device-tree-bindings/usb/marvell.xhci-usb.txt line 17

Quoted 2 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +2 -0
+ - marvell,vbus-gpio : If present, specifies a gpio that needs to be
+   activated for the bus to be powered.

Shouldn't this be a regulator instead ?

Quoted 22 lines
Quoted 22 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +11 -0
+Example:
+    cpm_usb3_0: usb3 at 500000 {
+        compatible = "marvell,armada-8k-xhci",
+                 "generic-xhci";
+        reg = <0x500000 0x4000>;
+        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&cpm_syscon0 1 22>;
+        marvell,vbus-gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>;
+        status = "disabled";
+    };
+
drivers/usb/host/xhci-mvebu.c +2 -0
index 46eb937..64801e7 100644
@@ -45,6 +45,20 @@ static int xhci_usb_probe(struct udevice *dev)
     struct mvebu_xhci *ctx = dev_get_priv(dev);
     struct xhci_hcor *hcor;
     int len;
+#ifdef CONFIG_DM_GPIO
+    struct gpio_desc vbus_gpio;
Quoted 8 lines

drivers/usb/host/xhci-mvebu.c static int xhci_usb_probe(struct udevice *dev) · line 57

Quoted 8 lines
drivers/usb/host/xhci-mvebu.c +8 -0
+
+    gpio_request_by_name(dev, "marvell,vbus-gpio", 0, &vbus_gpio,
+                 GPIOD_IS_OUT);
+
+    if (dm_gpio_is_valid(&vbus_gpio)) {
+        dm_gpio_set_value(&vbus_gpio, 1);
+        /* Wait for the GPIO VBUS output set */
+        mdelay(500);

I think if the GPIO was instead a regulator-fixed, the regulator could handle the delay with something like "ramp-up" delay. But I don't think we do support the ramp-up delay yet ... maybe this can be easily added?

Quoted 11 lines

drivers/usb/host/xhci-mvebu.c static int xhci_usb_probe(struct udevice *dev) · line 64

Quoted 8 lines
drivers/usb/host/xhci-mvebu.c +4 -0
+    }
+#else
+    debug("USB VBUS on GPIO support is missing\n");
+#endif /* CONFIG_DM_GPIO */
 
     ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
     len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));

Marek, do you have some comments on this USB related patch? If not, are you okay with me pushing it via the Marvell repository?

I have one .

Signature · 2 lines
Best regards,
Marek Vasut
#8 lore raw

[U-Boot] [EXT] Re: [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

Hi, Marek,
________________________________________
From: Marek Vasut <[email protected]>
Sent: Tuesday, January 24, 2017 16:11
To: Stefan Roese; Kostya Porotchkin; u-boot at lists.denx.de
Cc: Haim Boot; Hanna Hawa; Omri Itach; Nadav Haklai; Neta Zur Hershkovits; Igal Liberman
Subject: [EXT] Re: [U-Boot] [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

----------------------------------------------------------------------

Quoted 48 lines · Stefan Roese

Hi Marek,

(adding Marek as USB custodian to Cc)

Quoted 43 lines · kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add support for "marvell,vbus-gpio" property to mvebu XHCI host adapter driver.
This option is valid when CONFIG_DM_GPIO=y

Change-Id I930b3ebe001e50ae8d5abe1f3c774bcdb1739e64
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- Move VBUS GPIO support from board-specific function to mvebu XHCI driver
- Increase delay after VBUS GPIO activation

 doc/device-tree-bindings/usb/marvell.xhci-usb.txt | 29
+++++++++++++++++++++++
 drivers/usb/host/xhci-mvebu.c                     | 14 +++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +9 -0
new file mode 100644
index 0000000..b0a53ad
@@ -0,0 +1,29 @@
+Marvell SOC USB controllers
+
+This controller is integrated in Armada 3700/8K.
+It uses the same properties as a generic XHCI host controller
+
+Required properties :
+ - compatible: should be one or more of:
+   - "marvell,armada3700-xhci", "generic-xhci" for Armada 37xx SoCs
+   - "marvell,armada-8k-xhci", "generic-xhci" for Armada A8K SoCs
Quoted 8 lines

doc/device-tree-bindings/usb/marvell.xhci-usb.txt line 15

Quoted 6 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +6 -0
+ - reg: should contain address and length of the standard XHCI
+    register set for the device.
+ - interrupts: one XHCI interrupt should be described here.
+
+Optional properties:
+ - clocks: reference to a clock

Reference clock are optional ?

Actually the basis for this file was taken from kernel documentation and clocks are listed as "optional" here.

Quoted 4 lines

doc/device-tree-bindings/usb/marvell.xhci-usb.txt line 17

Quoted 2 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +2 -0
+ - marvell,vbus-gpio : If present, specifies a gpio that needs to be
+   activated for the bus to be powered.

Shouldn't this be a regulator instead ?

If it is required, I can implement the regulator method.
However as you mentioned the regulator core has to be extended for the ramp-up time support. This is kind of a shortcut, that enables immediate community board support. The same GPIO VBUS implementation exists in Marvell SDK.

Quoted 26 lines
Quoted 26 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +11 -0
+Example:
+    cpm_usb3_0: usb3 at 500000 {
+        compatible = "marvell,armada-8k-xhci",
+                 "generic-xhci";
+        reg = <0x500000 0x4000>;
+        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&cpm_syscon0 1 22>;
+        marvell,vbus-gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>;
+        status = "disabled";
+    };
+
drivers/usb/host/xhci-mvebu.c +6 -0
index 46eb937..64801e7 100644
@@ -45,6 +45,20 @@ static int xhci_usb_probe(struct udevice *dev)
     struct mvebu_xhci *ctx = dev_get_priv(dev);
     struct xhci_hcor *hcor;
     int len;
+#ifdef CONFIG_DM_GPIO
+    struct gpio_desc vbus_gpio;
+
+    gpio_request_by_name(dev, "marvell,vbus-gpio", 0, &vbus_gpio,
+                 GPIOD_IS_OUT);
+
Quoted 8 lines

drivers/usb/host/xhci-mvebu.c static int xhci_usb_probe(struct udevice *dev) · line 57

Quoted 4 lines
drivers/usb/host/xhci-mvebu.c +4 -0
+    if (dm_gpio_is_valid(&vbus_gpio)) {
+        dm_gpio_set_value(&vbus_gpio, 1);
+        /* Wait for the GPIO VBUS output set */
+        mdelay(500);

I think if the GPIO was instead a regulator-fixed, the regulator could handle the delay with something like "ramp-up" delay. But I don't think we do support the ramp-up delay yet ... maybe this can be easily added?

So I assume you suggest to drop this one and implement the VBUS through regulator GPIO?

Quoted 5 lines
Quoted 5 lines
drivers/usb/host/xhci-mvebu.c +4 -0
+    }
+#else
+    debug("USB VBUS on GPIO support is missing\n");
+#endif /* CONFIG_DM_GPIO */
 
Quoted 8 lines

drivers/usb/host/xhci-mvebu.c static int xhci_usb_probe(struct udevice *dev) · line 64

Quoted 3 lines
drivers/usb/host/xhci-mvebu.c +0 -0
     ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
     len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));

Marek, do you have some comments on this USB related patch? If not, are you okay with me pushing it via the Marvell repository?

I have one .

Thank you for your review!

Best Regards
Konstantin Porotchkin

--
Best regards,
Marek Vasut

#9 lore raw

[U-Boot] [EXT] Re: [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

Quoted 1 line · Kostya Porotchkin

Hi, Marek,

Hi!

[...]

Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +4 -0
+Required properties :
+ - compatible: should be one or more of:
+   - "marvell,armada3700-xhci", "generic-xhci" for Armada 37xx SoCs
+   - "marvell,armada-8k-xhci", "generic-xhci" for Armada A8K SoCs
Quoted 8 lines

doc/device-tree-bindings/usb/marvell.xhci-usb.txt line 15

Quoted 6 lines

+ - reg: should contain address and length of the standard XHCI

doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +5 -0
+    register set for the device.
+ - interrupts: one XHCI interrupt should be described here.
+
+Optional properties:
+ - clocks: reference to a clock

Reference clock are optional ?

Quoted 1 line

Actually the basis for this file was taken from kernel documentation and clocks are listed as "optional" here.

Oh ok, interesting.

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

+ - marvell,vbus-gpio : If present, specifies a gpio that needs to be
+ activated for the bus to be powered.

Shouldn't this be a regulator instead ?

If it is required, I can implement the regulator method.
However as you mentioned the regulator core has to be extended for the ramp-up time support. This is kind of a shortcut, that enables immediate community board support. The same GPIO VBUS implementation exists in Marvell SDK.

Switching to regulator should be pretty painless and much better than new ad-hoc property, yes.

[...]

Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
drivers/usb/host/xhci-mvebu.c +6 -0
+#ifdef CONFIG_DM_GPIO
+    struct gpio_desc vbus_gpio;
+
+    gpio_request_by_name(dev, "marvell,vbus-gpio", 0, &vbus_gpio,
+                 GPIOD_IS_OUT);
+
Quoted 8 lines

drivers/usb/host/xhci-mvebu.c static int xhci_usb_probe(struct udevice *dev) · line 57

Quoted 4 lines
drivers/usb/host/xhci-mvebu.c +4 -0
+    if (dm_gpio_is_valid(&vbus_gpio)) {
+        dm_gpio_set_value(&vbus_gpio, 1);
+        /* Wait for the GPIO VBUS output set */
+        mdelay(500);

I think if the GPIO was instead a regulator-fixed, the regulator could handle the delay with something like "ramp-up" delay. But I don't think we do support the ramp-up delay yet ... maybe this can be easily added?

Quoted 1 line

So I assume you suggest to drop this one and implement the VBUS through regulator GPIO?

Yeah, that'd be neat and if you retain the mdelay() here, it should also be very straightforward without the need for additional patches.

If you want to extend the regulator-fixed driver to support the ramp-up delay the same way Linux does, that'd be awesome and you'd be able to drop even the mdelay() here, which'd be much more systematic solution.

Quoted 24 lines
Quoted 5 lines
Quoted 5 lines
drivers/usb/host/xhci-mvebu.c +4 -0
+    }
+#else
+    debug("USB VBUS on GPIO support is missing\n");
+#endif /* CONFIG_DM_GPIO */
Quoted 8 lines
Quoted 3 lines
     ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
     len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));

Marek, do you have some comments on this USB related patch? If not, are you okay with me pushing it via the Marvell repository?

I have one .

Thank you for your review!

Best Regards
Konstantin Porotchkin

--
Best regards,
Marek Vasut

Signature · 2 lines
Best regards,
Marek Vasut
#10 lore raw

[U-Boot] [EXT] Re: [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

In reply to Kostya Porotchkin

Hi, Marek,

I added a regulator to the board DTS and connected it to the USB port:

/{
	model = "MACCHIATOBin-8040";
	compatible = "marvell,armada8040-mcbin",
		     "marvell,armada8040";
...
...
	regulators {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <0>;

		reg_usb3h0_vbus: usb3-vbus0 {
			compatible = "regulator-fixed";
			pinctrl-names = "default";
			pinctrl-0 = <&cpm_xhci_vbus_pins>;
			regulator-name = "reg-usb3h0-vbus";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			startup-delay-us = <500000>;
			enable-active-high;
			regulator-always-on;
			gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>; /* GPIO[47] */
		};
	};
};
&cps_usb3_0 {
	vcc-supply = <&reg_usb3h0_vbus>;
	status = "okay";
};

However the regulator is not activated when I issue "usb reset" command.
I can either call to " uclass_first_device(UCLASS_REGULATOR, &dev)" during arch early init stage, or select the regulator with "regulator dev" command.

Only then the VBUS GPIO enables the USB power.

Is it the expected behavior or I am missing something in my configuration?

Thank you for your help
Kosta

Quoted 157 lines

-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Kostya Porotchkin
Sent: Tuesday, January 24, 2017 16:58
To: Marek Vasut; Stefan Roese; u-boot at lists.denx.de
Cc: Haim Boot; Hanna Hawa; Omri Itach; Nadav Haklai; Neta Zur Hershkovits; Igal Liberman
Subject: Re: [U-Boot] [EXT] Re: [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

Hi, Marek,
________________________________________
From: Marek Vasut <[email protected]>
Sent: Tuesday, January 24, 2017 16:11
To: Stefan Roese; Kostya Porotchkin; u-boot at lists.denx.de
Cc: Haim Boot; Hanna Hawa; Omri Itach; Nadav Haklai; Neta Zur Hershkovits; Igal Liberman
Subject: [EXT] Re: [U-Boot] [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

----------------------------------------------------------------------

Quoted 48 lines · Stefan Roese

Hi Marek,

(adding Marek as USB custodian to Cc)

Quoted 43 lines · kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add support for "marvell,vbus-gpio" property to mvebu XHCI host adapter driver.
This option is valid when CONFIG_DM_GPIO=y

Change-Id I930b3ebe001e50ae8d5abe1f3c774bcdb1739e64
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- Move VBUS GPIO support from board-specific function to mvebu XHCI driver
- Increase delay after VBUS GPIO activation

 doc/device-tree-bindings/usb/marvell.xhci-usb.txt | 29
+++++++++++++++++++++++
 drivers/usb/host/xhci-mvebu.c                     | 14 +++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +9 -0
new file mode 100644
index 0000000..b0a53ad
@@ -0,0 +1,29 @@
+Marvell SOC USB controllers
+
+This controller is integrated in Armada 3700/8K.
+It uses the same properties as a generic XHCI host controller
+
+Required properties :
+ - compatible: should be one or more of:
+   - "marvell,armada3700-xhci", "generic-xhci" for Armada 37xx SoCs
+   - "marvell,armada-8k-xhci", "generic-xhci" for Armada A8K SoCs
Quoted 8 lines

doc/device-tree-bindings/usb/marvell.xhci-usb.txt line 15

Quoted 6 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +6 -0
+ - reg: should contain address and length of the standard XHCI
+    register set for the device.
+ - interrupts: one XHCI interrupt should be described here.
+
+Optional properties:
+ - clocks: reference to a clock

Reference clock are optional ?

Actually the basis for this file was taken from kernel documentation and clocks are listed as "optional" here.

Quoted 4 lines

doc/device-tree-bindings/usb/marvell.xhci-usb.txt line 17

Quoted 2 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +2 -0
+ - marvell,vbus-gpio : If present, specifies a gpio that needs to be
+   activated for the bus to be powered.

Shouldn't this be a regulator instead ?

If it is required, I can implement the regulator method. However as you mentioned the regulator core has to be extended for the ramp-up time support.
This is kind of a shortcut, that enables immediate community board support.
The same GPIO VBUS implementation exists in Marvell SDK.

Quoted 25 lines
Quoted 25 lines
doc/device-tree-bindings/usb/marvell.xhci-usb.txt new file +11 -0
+Example:
+    cpm_usb3_0: usb3 at 500000 {
+        compatible = "marvell,armada-8k-xhci",
+                 "generic-xhci";
+        reg = <0x500000 0x4000>;
+        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&cpm_syscon0 1 22>;
+        marvell,vbus-gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>;
+        status = "disabled";
+    };
+
(quoted diff) +0 -0

b/drivers/usb/host/xhci-mvebu.c index 46eb937..64801e7 100644

drivers/usb/host/xhci-mvebu.c +6 -0
@@ -45,6 +45,20 @@ static int xhci_usb_probe(struct udevice *dev)
     struct mvebu_xhci *ctx = dev_get_priv(dev);
     struct xhci_hcor *hcor;
     int len;
+#ifdef CONFIG_DM_GPIO
+    struct gpio_desc vbus_gpio;
+
+    gpio_request_by_name(dev, "marvell,vbus-gpio", 0, &vbus_gpio,
+                 GPIOD_IS_OUT);
+
Quoted 8 lines

drivers/usb/host/xhci-mvebu.c static int xhci_usb_probe(struct udevice *dev) · line 57

Quoted 4 lines
drivers/usb/host/xhci-mvebu.c +4 -0
+    if (dm_gpio_is_valid(&vbus_gpio)) {
+        dm_gpio_set_value(&vbus_gpio, 1);
+        /* Wait for the GPIO VBUS output set */
+        mdelay(500);

I think if the GPIO was instead a regulator-fixed, the regulator could handle the delay with something like "ramp-up" delay. But I don't think we do support the ramp-up delay yet ... maybe this can be easily added?

So I assume you suggest to drop this one and implement the VBUS through regulator GPIO?

Quoted 5 lines
Quoted 5 lines
drivers/usb/host/xhci-mvebu.c +4 -0
+    }
+#else
+    debug("USB VBUS on GPIO support is missing\n"); #endif /*
+CONFIG_DM_GPIO */
 
Quoted 8 lines

drivers/usb/host/xhci-mvebu.c static int xhci_usb_probe(struct udevice *dev) · line 64

Quoted 3 lines
drivers/usb/host/xhci-mvebu.c +0 -0
     ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
     len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));

Marek, do you have some comments on this USB related patch? If not, are you okay with me pushing it via the Marvell repository?

I have one .

Thank you for your review!

Best Regards
Konstantin Porotchkin

--
Best regards,
Marek Vasut
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#11 lore raw

[U-Boot] [EXT] Re: [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

Quoted 1 line · Kostya Porotchkin

Hi, Marek,

Hi,

(please stop top-posting)

Quoted 33 lines

I added a regulator to the board DTS and connected it to the USB port:

/{
	model = "MACCHIATOBin-8040";
	compatible = "marvell,armada8040-mcbin",
		     "marvell,armada8040";
...
...
	regulators {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <0>;

		reg_usb3h0_vbus: usb3-vbus0 {
			compatible = "regulator-fixed";
			pinctrl-names = "default";
			pinctrl-0 = <&cpm_xhci_vbus_pins>;
			regulator-name = "reg-usb3h0-vbus";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			startup-delay-us = <500000>;
			enable-active-high;
			regulator-always-on;
			gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>; /* GPIO[47] */
		};
	};
};
&cps_usb3_0 {
	vcc-supply = <&reg_usb3h0_vbus>;
	status = "okay";
};
Quoted 7 lines

However the regulator is not activated when I issue "usb reset" command.
I can either call to " uclass_first_device(UCLASS_REGULATOR, &dev)" during arch early init stage, or select the regulator with "regulator dev" command.

Only then the VBUS GPIO enables the USB power.

Is it the expected behavior or I am missing something in my configuration?

You should request and enable the regulator in your driver , ie using regulator_set_enable()

Signature · 2 lines
Best regards,
Marek Vasut
#12 lore raw

PATCH v2 5/7 mvebu: pcie: Add support for GPIO reset for PCIe device

In reply to kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add support for "marvell,reset-gpio" property to mvebu DW PCIe driver.
This option is valid when CONFIG_DM_GPIO=y

Change-Id Ic17c500449050c2fbb700731f1a9ca8b83298986
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- Move PCIe reset GPIO support from board-specific function to mvebu PCIe driver
- Increase delay after releasing the PCIe reset GPIO

 doc/device-tree-bindings/pci/armada8k-pcie.txt | 49 ++++++++++++++++++++++++++
 drivers/pci/pcie_dw_mvebu.c                    | 20 +++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 doc/device-tree-bindings/pci/armada8k-pcie.txt
doc/device-tree-bindings/pci/armada8k-pcie.txt new file +49 -0
new file mode 100644
index 0000000..7230f10
@@ -0,0 +1,49 @@
+Armada-8K PCIe DT details:
+==========================
+
+Armada-8k uses synopsis designware PCIe controller.
+
+Required properties:
+- compatible : should be "marvell,armada8k-pcie", "snps,dw-pcie".
+- reg: base addresses and lengths of the pcie control and global control registers.
+ "ctrl" registers points to the global control registers, while the "config" space
+ points to the pcie configuration registers as mentioned in dw-pcie dt bindings in the link below.
+- interrupt-map-mask and interrupt-map, standard PCI properties to
+  define the mapping of the PCIe interface to interrupt numbers.
+- All other definitions as per generic PCI bindings
+See Linux kernel documentation:
+"Documentation/devicetree/bindings/pci/designware-pcie.txt"
+
+Optional properties:
+PHY support is still not supported for armada-8k, once it will, the following parameters can be used:
+- phys		    : phandle to phy node associated with pcie controller.
+- phy-names	    : must be "pcie-phy"
+- marvell,reset-gpio :  specifies a gpio that needs to be activated for plug-in
+			card reset signal release.
+Example:
+
+cpm_pcie0: pcie at f2600000 {
+	compatible = "marvell,armada8k-pcie", "snps,dw-pcie";
+	reg = <0 0xf2600000 0 0x10000>,
+	      <0 0xf6f00000 0 0x80000>;
+	reg-names = "ctrl", "config";
+	#address-cells = <3>;
+	#size-cells = <2>;
+	#interrupt-cells = <1>;
+	device_type = "pci";
+	dma-coherent;
+
+	bus-range = <0 0xff>;
+	ranges =
+		/* downstream I/O */
+		<0x81000000 0 0xf9000000 0  0xf9000000 0 0x10000
+		/* non-prefetchable memory */
+		0x82000000 0 0xf6000000 0  0xf6000000 0 0xf00000>;
+	interrupt-map-mask = <0 0 0 0>;
+	interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+	interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+	num-lanes = <1>;
+	clocks = <&cpm_syscon0 1 13>;
+	marvell,reset-gpio = <&cpm_gpio1 20 GPIO_ACTIVE_HIGH>;
+	status = "disabled";
+};
drivers/pci/pcie_dw_mvebu.c +20 -0
index 17fa024..d4776a9 100644
@@ -15,6 +15,7 @@
 #include <dm.h>
 #include <pci.h>
 #include <asm/io.h>
+#include <asm-generic/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -461,6 +462,25 @@ static int pcie_dw_mvebu_probe(struct udevice *dev)
 	struct pcie_dw_mvebu *pcie = dev_get_priv(dev);
 	struct udevice *ctlr = pci_get_controller(dev);
 	struct pci_controller *hose = dev_get_uclass_priv(ctlr);
+#ifdef CONFIG_DM_GPIO
+	struct gpio_desc reset_gpio;
+
+	gpio_request_by_name(dev, "marvell,reset-gpio", 0, &reset_gpio,
+			     GPIOD_IS_OUT);
+	/*
+	 * Issue reset to add-in card trough the dedicated GPIO.
+	 * Some boards are connecting the card reset pin to common system
+	 * reset wire and others are using separate GPIO port.
+	 * In the last case we have to release a reset of the addon card
+	 * using this GPIO.
+	 */
+	if (dm_gpio_is_valid(&reset_gpio)) {
+		dm_gpio_set_value(&reset_gpio, 1);
+		mdelay(200);
+	}
+#else
+	debug("PCIE Reset on GPIO support is missing\n");
+#endif /* CONFIG_DM_GPIO */
 
 	pcie->first_busno = dev->seq;
 
Signature · 1 line
2.7.4
#13 lore raw

PATCH v2 6/7 arm64: mvebu: dts: Add DTS file for MACCHIATOBin board

In reply to kostap at marvell.com

From: Rabeeh Khoury <[email protected]>

Added A8040 dts file for community board MACCHIATIBin. The patch includes the following features:
AP - eMMC, Serial console (connected to onboard FTDI usb to serial) CP0 - PCIe x4, SATA, I2C and 10G KR
(connected to Marvell 3310 10G copper / SFP+ phy)
CP1 - Boot SPI, USB3 host, 2xSATA, 10G KR
(connected to Marvell 3310 10G copper / SFP+ phy), SGMII connected to onboard 1512 1Gbps copper phy, and additional SGMII connected to SFP
(default 1Gbps can be configured to 2.5Gbps).

Network interface naming -
egiga0 - CP0 KR
egiga1 - CP1 KR
egiga2 - CP1 RJ45 1Gbps connector (recommended for TFTP boot) egiga3 - CP1 SFP default 1Gbps and can be modified to 2.5Gbps

Change-Id Icb844eff9a8f07cd76ca8f86ffb01fe297bde836
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- None, copy

 arch/arm/dts/Makefile              |   1 +
 arch/arm/dts/armada-8040-mcbin.dts | 253 +++++++++++++++++++++++++++++++++++++
 2 files changed, 254 insertions(+)
 create mode 100644 arch/arm/dts/armada-8040-mcbin.dts
arch/arm/dts/Makefile +1 -0
index ff78385..10e0536 100644
@@ -76,6 +76,7 @@ dtb-$(CONFIG_ARCH_MVEBU) +=			\
 	armada-385-amc.dtb			\
 	armada-7040-db.dtb			\
 	armada-8040-db.dtb			\
+	armada-8040-mcbin.dtb			\
 	armada-xp-gp.dtb			\
 	armada-xp-maxbcm.dtb			\
 	armada-xp-synology-ds414.dtb		\
arch/arm/dts/armada-8040-mcbin.dts new file +253 -0

253 lines not on this page · raw message

Signature · 1 line
2.7.4
#14 lore raw

PATCH v2 7/7 arm64: mvebu: Add default configuraton for MACCHIATOBin board

In reply to kostap at marvell.com

From: Konstantin Porotchkin <[email protected]>

Add default configuration for MACHHIATOBin community board based on Aramda-8040 SoC.

Change-Id I60efcca5b31060340ad0a948561f082646f6556c
Cc Stefan Roese <[email protected]>
Cc Nadav Haklai <[email protected]>
Cc Neta Zur Hershkovits <[email protected]>
Cc Omri Itach <[email protected]>
Cc Igal Liberman <[email protected]>
Cc Haim Boot <[email protected]>
Cc Hanna Hawa <[email protected]>

---
Changes for v2:
- None, copy

 configs/mvebu_mcbin-88f8040_defconfig | 65 +++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 configs/mvebu_mcbin-88f8040_defconfig
configs/mvebu_mcbin-88f8040_defconfig new file +65 -0
new file mode 100644
index 0000000..ed6e9db
@@ -0,0 +1,65 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MVEBU=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_TARGET_MVEBU_ARMADA_8K=y
+CONFIG_DEFAULT_DEVICE_TREE="armada-8040-mcbin"
+CONFIG_SMBIOS_PRODUCT_NAME=""
+CONFIG_AHCI=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_FPGA is not set
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_TFTPPUT=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_MVEBU_BUBT=y
+CONFIG_BLOCK_CACHE=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_MVTWSI=y
+CONFIG_DM_GPIO=y
+CONFIG_MVEBU_GPIO=y
+CONFIG_MISC=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_PHYLIB=y
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_PCIE_DW_MVEBU=y
+CONFIG_MVEBU_COMPHY_SUPPORT=y
+# CONFIG_SPL_SERIAL_PRESENT is not set
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_BASE=0xf0512000
+CONFIG_DEBUG_UART_CLOCK=200000000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_SYS_NS16550=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_DM_MMC=y
+CONFIG_XENON_SDHCI=y
+CONFIG_SMBIOS_MANUFACTURER=""
+CONFIG_PINCTRL=y
+CONFIG_HUSH_PARSER=y
Signature · 1 line
2.7.4