arm: mvebu: turris_mox: Fix and enable PCIe devices
cover arm: mvebu: turris_mox: Fix and enable PCIe devices
This patch series fix PCIe on Armada 3720 and enable PCIe devices (USB and NVMe) on Turris MOX.
Marek Beh?n (1):
arm: mvebu: turris_mox: Enable NVMe support
Pali Roh?r (3):
arm: a37xx: pci: Set Max Payload Size and Max Read Request Size to 512
bytes
arm: mvebu: turris_mox: Enable CONFIG_PCI_PNP
arm: mvebu: turris_mox: Enable CONFIG_USB_XHCI_PCI
configs/turris_mox_defconfig | 3 ++- drivers/pci/pci-aardvark.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1
PATCH 1/4 arm: a37xx: pci: Set Max Payload Size and Max Read Request Size to 512 bytes
Fix usage of VL805 XHCI PCIe controller when it is connected via PCIe to Armada 3720 SOC. Without this U-Boot crashes when trying to access enumerated USB devices connected to this XHCI PCIe controller.
This should be done according to the PCIe Link Initialization sequence, as defined in Marvell Armada 3720 Functional Specification.
Linux has this code too.
--- drivers/pci/pci-aardvark.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/pci/pci-aardvark.c +8 -0
@@ -42,6 +42,10 @@#define PCIE_CORE_DEV_CTRL_STATS_REG 0xc8#define PCIE_CORE_DEV_CTRL_STATS_RELAX_ORDER_DISABLE (0 << 4)#define PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE (0 << 11) +#define PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SIZE 0x2 +#define PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SIZE_SHIFT 5 +#define PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE 0x2 +#define PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT 12#define PCIE_CORE_LINK_CTRL_STAT_REG 0xd0#define PCIE_CORE_LINK_TRAINING BIT(5)#define PCIE_CORE_ERR_CAPCTL_REG 0x118
@@ -534,6 +538,10 @@ static int pcie_advk_setup_hw(struct pcie_advk *pcie)/* Set PCIe Device Control and Status 1 PF0 register */ reg =PCIE_CORE_DEV_CTRL_STATS_RELAX_ORDER_DISABLE | + (PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SIZE << +PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SIZE_SHIFT ) | + (PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE << +PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT ) |PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE ;advk_writel (pcie, reg,PCIE_CORE_DEV_CTRL_STATS_REG );
Signature · 1 line
2.20.1
PATCH 1/4 arm: a37xx: pci: Set Max Payload Size and Max Read Request Size to 512 bytes
PATCH 1/4 arm: a37xx: pci: Set Max Payload Size and Max Read Request Size to 512 bytes
In reply to Pali RohárQuoted 10 lines · Pali Roh?r
Fix usage of VL805 XHCI PCIe controller when it is connected via PCIe to Armada 3720 SOC. Without this U-Boot crashes when trying to access enumerated USB devices connected to this XHCI PCIe controller.
This should be done according to the PCIe Link Initialization sequence, as defined in Marvell Armada 3720 Functional Specification.
Linux has this code too.
Signed-off-by Pali Roh?r <[email protected]>
Thanks,
Stefan
Quoted 21 lines
--- drivers/pci/pci-aardvark.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/pci/pci-aardvark.c +4
-0@@ -42,6 +42,10 @@#define PCIE_CORE_DEV_CTRL_STATS_REG 0xc8#define PCIE_CORE_DEV_CTRL_STATS_RELAX_ORDER_DISABLE (0 << 4)#define PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE (0 << 11) +#define PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SIZE 0x2 +#define PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SIZE_SHIFT 5 +#define PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE 0x2 +#define PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT 12#define PCIE_CORE_LINK_CTRL_STAT_REG 0xd0#define PCIE_CORE_LINK_TRAINING BIT(5)#define PCIE_CORE_ERR_CAPCTL_REG 0x118
drivers/pci/pci-aardvark.c static int pcie_advk_setup_hw(struct pcie_advk *pcie) · line 547
Quoted 10 lines
drivers/pci/pci-aardvark.c +4
-0@@ -534,6 +538,10 @@ static int pcie_advk_setup_hw(struct pcie_advk *pcie)/* Set PCIe Device Control and Status 1 PF0 register */ reg =PCIE_CORE_DEV_CTRL_STATS_RELAX_ORDER_DISABLE | + (PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SIZE << +PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SIZE_SHIFT ) | + (PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE << +PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT ) |PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE ;advk_writel (pcie, reg,PCIE_CORE_DEV_CTRL_STATS_REG );
Viele Gr??e,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
PATCH 2/4 arm: mvebu: turris_mox: Enable CONFIG_PCI_PNP
In reply to Pali RohárPCIe devices do not work in U-Boot without proper initialization and configuration of PCI config space like the PCI_BASE_ADDRESS_0 register.
--- configs/turris_mox_defconfig | 1 - 1 file changed, 1 deletion(-)
configs/turris_mox_defconfig +0 -1
@@ -64,7 +64,6 @@ CONFIG_MVNETA=y CONFIG_PCI=y CONFIG_DM_PCI=y CONFIG_PCI_AARDVARK=y -# CONFIG_PCI_PNP is not set CONFIG_MVEBU_COMPHY_SUPPORT=y CONFIG_PINCTRL=y CONFIG_PINCTRL_ARMADA_37XX=y
Signature · 1 line
2.20.1
PATCH 2/4 arm: mvebu: turris_mox: Enable CONFIG_PCI_PNP
PATCH 2/4 arm: mvebu: turris_mox: Enable CONFIG_PCI_PNP
In reply to Pali RohárQuoted 4 lines · Pali Roh?r
PCIe devices do not work in U-Boot without proper initialization and configuration of PCI config space like the
PCI_BASE_ADDRESS_0register.Signed-off-by Pali Roh?r <[email protected]>
Thanks,
Stefan
Quoted 10 lines
--- configs/turris_mox_defconfig | 1 - 1 file changed, 1 deletion(-)configs/turris_mox_defconfig +0
-0
configs/turris_mox_defconfig CONFIG_MVNETA=y · line 69
Quoted 7 lines
configs/turris_mox_defconfig +0
-1@@ -64,7 +64,6 @@ CONFIG_MVNETA=y CONFIG_PCI=y CONFIG_DM_PCI=y CONFIG_PCI_AARDVARK=y -# CONFIG_PCI_PNP is not set CONFIG_MVEBU_COMPHY_SUPPORT=y CONFIG_PINCTRL=y CONFIG_PINCTRL_ARMADA_37XX=y
Viele Gr??e,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
PATCH 3/4 arm: mvebu: turris_mox: Enable CONFIG_USB_XHCI_PCI
In reply to Pali RohárUSB devices can be connected to Turris MOX also via MOX F extension which contains VL805 PCIe based USB 3.0 controller.
--- configs/turris_mox_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/turris_mox_defconfig +1 -0
@@ -77,6 +77,7 @@ CONFIG_MVEBU_A3700_SPI=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_PCI=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y
Signature · 1 line
2.20.1
PATCH 3/4 arm: mvebu: turris_mox: Enable CONFIG_USB_XHCI_PCI
PATCH 3/4 arm: mvebu: turris_mox: Enable CONFIG_USB_XHCI_PCI
In reply to Pali RohárQuoted 4 lines · Pali Roh?r
USB devices can be connected to Turris MOX also via MOX F extension which contains VL805 PCIe based USB 3.0 controller.
Signed-off-by Pali Roh?r <[email protected]>
Thanks,
Stefan
Quoted 10 lines
--- configs/turris_mox_defconfig | 1 + 1 file changed, 1 insertion(+)configs/turris_mox_defconfig +0
-0
configs/turris_mox_defconfig CONFIG_MVEBU_A3700_SPI=y · line 83
Quoted 7 lines
configs/turris_mox_defconfig +1
-0@@ -77,6 +77,7 @@ CONFIG_MVEBU_A3700_SPI=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_PCI=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y
Viele Gr??e,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
PATCH 4/4 arm: mvebu: turris_mox: Enable NVMe support
In reply to Pali RohárFrom: Marek Beh?n <[email protected]>
NVMe drives can be connected to Turris MOX via MOX B and MOX G extensions.
--- configs/turris_mox_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/turris_mox_defconfig +1 -0
@@ -61,6 +61,7 @@ CONFIG_SPI_FLASH_WINBOND=y CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y +CONFIG_NVME=y CONFIG_PCI=y CONFIG_DM_PCI=y CONFIG_PCI_AARDVARK=y
Signature · 1 line
2.20.1
PATCH 4/4 arm: mvebu: turris_mox: Enable NVMe support
PATCH 4/4 arm: mvebu: turris_mox: Enable NVMe support
In reply to Pali RohárQuoted 6 lines · Pali Roh?r
From: Marek Beh?n <[email protected]>
NVMe drives can be connected to Turris MOX via MOX B and MOX G extensions.
Signed-off-by Marek Beh?n <[email protected]>
Thanks,
Stefan
Quoted 10 lines
--- configs/turris_mox_defconfig | 1 + 1 file changed, 1 insertion(+)configs/turris_mox_defconfig +0
-0
configs/turris_mox_defconfig CONFIG_SPI_FLASH_WINBOND=y · line 67
Quoted 7 lines
configs/turris_mox_defconfig +1
-0@@ -61,6 +61,7 @@ CONFIG_SPI_FLASH_WINBOND=y CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y +CONFIG_NVME=y CONFIG_PCI=y CONFIG_DM_PCI=y CONFIG_PCI_AARDVARK=y
Viele Gr??e,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
cover arm: mvebu: turris_mox: Fix and enable PCIe devices
In reply to Pali RohárQuoted 12 lines · Pali Roh?r
This patch series fix PCIe on Armada 3720 and enable PCIe devices (USB and NVMe) on Turris MOX.
Marek Beh?n (1):
arm: mvebu:turris_mox: Enable NVMe supportPali Roh?r (3):
arm: a37xx: pci: Set Max Payload Size and Max Read Request Size to 512
bytes
arm: mvebu:turris_mox: EnableCONFIG_PCI_PNP
arm: mvebu:turris_mox: EnableCONFIG_USB_XHCI_PCI
Quoted 4 lines
configs/turris_mox_defconfig | 3 ++- drivers/pci/pci-aardvark.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
Applied to u-boot-marvell/master
Thanks,
Stefan