pci: Add pci_get_devfn() to extract devfn from the fdt_pci_addr
Subsystems (2)
PATCH v3 1/4 pci: Add pci_get_devfn() to extract devfn from the fdt_pci_addr
This function will be used by the Marvell Armada XP/38x PCIe driver, which is moved to DM right now. So let's extract the functionality from pci_uclass_child_post_bind() to make it available.
---
v3:
- New patch, replaces "[PATCH] core: ofnode: Add ofnode_pci_get_devfn()"
drivers/pci/pci-uclass.c | 28 +++++++++++++++++++--------- include/pci.h | 10 ++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-)
drivers/pci/pci-uclass.c +19 -9
@@ -1007,10 +1007,25 @@ static int pci_uclass_post_probe(struct udevice *bus)return 0 ; } +int pci_get_devfn (struct udevice *dev) +{ +struct fdt_pci_addr addr; +int ret; + +/* Extract the devfn from fdt_pci_addr */ + ret =ofnode_read_pci_addr (dev_ofnode (dev),FDT_PCI_SPACE_CONFIG , +"reg" , &addr); +if (ret) { +if (ret != -ENOENT ) +return -EINVAL ; + } + +return addr.phys_hi &0xff00 ; +} +static int pci_uclass_child_post_bind (struct udevice *dev) {struct pci_child_platdata *pplat; -struct fdt_pci_addr addr;int ret;if (!dev_of_valid (dev))
@@ -1022,14 +1037,9 @@ static int pci_uclass_child_post_bind(struct udevice *dev)ofnode_read_pci_vendev (dev_ofnode (dev), &pplat->vendor, &pplat->device);/* Extract the devfn from fdt_pci_addr */ - ret =ofnode_read_pci_addr (dev_ofnode (dev),FDT_PCI_SPACE_CONFIG ,"reg" , - &addr); -if (ret) { -if (ret != -ENOENT ) -return -EINVAL ; - }else { - pplat->devfn = addr.phys_hi &0xff00 ; - } + pplat->devfn =pci_get_devfn (dev); +if (ret <0 ) +return ret;return 0 ; }
include/pci.h +10 -0
@@ -1560,6 +1560,16 @@ struct dm_pci_emul_ops {int sandbox_pci_get_emul (struct udevice *bus,pci_dev_t find_devfn,struct udevice **containerp,struct udevice **emulp); +/** +* pci_get_devfn() - Extract the devfn from fdt_pci_addr of the device +* +* Get devfn from fdt_pci_addr of the specifified device +* +* @dev: PCI device +* @return devfn in bits 15...8 if found, -ENODEV if not found +*/ +int pci_get_devfn (struct udevice *dev); +#endif /* CONFIG_DM_PCI */ /**
Signature · 1 line
2.20.1
PATCH v3 2/4 pci: pci_mvebu: Add DM_PCI support and move CONFIG_PCI_MVEBU to defconfig
This patch adds DM_PCI support to the MVEBU PCIe driver. This is necessary, since all PCI drivers have to be moved to DM (driver model) until the v2019.07 release.
To not break git bisect'ablility, this patch also moves CONFIG_PCI_MVEBU from config headers to the defconfig files.
---
v3:
- Add x530 defconfig / config/foo.h changes
- Remove misleading function comment
- Use PCI_DEV instead of PCI_SLOT
- Introduce mvebu_pcie_ofdata_to_platdata() to remove most functions from the loop in mvebu_pcie_bind(). This also enables to usage of a udevice pointer for the newly introduced function pci_get_devfn()
v2:
- Completely configure the controller based on DT properties. Now port and lane are read from the DT nodes and also the tgt and attr values are generated using the DT similar to how this is done in the Linux driver version. All A38x / XP specific defines can now be removed from this driver because of this.
- Please note that now the board specific dts file needs to enable the used PCIe ports, as this is also done in Linux.
configs/clearfog_defconfig | 1 + configs/controlcenterdc_defconfig | 3 + configs/db-88f6820-amc_defconfig | 1 + configs/db-88f6820-gp_defconfig | 1 + configs/db-mv784mp-gp_defconfig | 1 + configs/ds414_defconfig | 1 + configs/theadorable_debug_defconfig | 2 + configs/turris_omnia_defconfig | 3 +- configs/x530_defconfig | 3 +- drivers/pci/Kconfig | 9 + drivers/pci/pci_mvebu.c | 470 ++++++++++++++++------------ include/configs/clearfog.h | 1 - include/configs/controlcenterdc.h | 3 - include/configs/db-88f6820-amc.h | 1 - include/configs/db-88f6820-gp.h | 1 - include/configs/db-mv784mp-gp.h | 1 - include/configs/ds414.h | 1 - include/configs/theadorable.h | 7 - include/configs/turris_omnia.h | 1 - include/configs/x530.h | 1 - scripts/config_whitelist.txt | 1 - 21 files changed, 296 insertions(+), 217 deletions(-)
configs/clearfog_defconfig +1 -0
@@ -56,6 +56,7 @@ CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y CONFIG_PCI=y +CONFIG_PCI_MVEBU=y CONFIG_SCSI=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y
configs/controlcenterdc_defconfig +3 -0
@@ -58,6 +58,9 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_PCI=y +CONFIG_DM_PCI_COMPAT=y +CONFIG_PCI_MVEBU=y CONFIG_SCSI=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y
configs/db-88f6820-amc_defconfig +1 -0
@@ -60,6 +60,7 @@ CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y CONFIG_PCI=y +CONFIG_PCI_MVEBU=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y CONFIG_KIRKWOOD_SPI=y
configs/db-88f6820-gp_defconfig +1 -0
@@ -56,6 +56,7 @@ CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y CONFIG_PCI=y +CONFIG_PCI_MVEBU=y CONFIG_SCSI=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y
configs/db-mv784mp-gp_defconfig +1 -0
@@ -55,6 +55,7 @@ CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y CONFIG_PCI=y +CONFIG_PCI_MVEBU=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y CONFIG_KIRKWOOD_SPI=y
configs/ds414_defconfig +1 -0
@@ -52,6 +52,7 @@ CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y CONFIG_PCI=y +CONFIG_PCI_MVEBU=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y CONFIG_KIRKWOOD_SPI=y
configs/theadorable_debug_defconfig +2 -0
@@ -62,6 +62,8 @@ CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y CONFIG_PCI=y +CONFIG_DM_PCI_COMPAT=y +CONFIG_PCI_MVEBU=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y CONFIG_KIRKWOOD_SPI=y
configs/turris_omnia_defconfig +2 -1
@@ -37,7 +37,6 @@ CONFIG_DEFAULT_DEVICE_TREE="armada-385-turris-omnia" CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SPL_OF_TRANSLATE=y CONFIG_SCSI_AHCI=y -CONFIG_MISC=y CONFIG_ATSHA204A=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_MV=y
@@ -45,6 +44,8 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_PCI=y +CONFIG_PCI_MVEBU=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y CONFIG_KIRKWOOD_SPI=y
configs/x530_defconfig +2 -1
@@ -46,7 +46,6 @@ CONFIG_DM_I2C=y CONFIG_SYS_I2C_MVTWSI=y CONFIG_I2C_MUX=y CONFIG_I2C_MUX_PCA954x=y -CONFIG_MISC=y # CONFIG_MMC is not set CONFIG_NAND=y CONFIG_NAND_PXA3XX=y
@@ -57,6 +56,8 @@ CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_SST=y CONFIG_MTD_UBI=y CONFIG_PCI=y +CONFIG_DM_PCI_COMPAT=y +CONFIG_PCI_MVEBU=y CONFIG_DM_RTC=y CONFIG_RTC_DS1307=y CONFIG_DEBUG_UART_SHIFT=2
drivers/pci/Kconfig +9 -0
@@ -112,4 +112,13 @@ config PCIE_INTEL_FPGA Say Y here if you want to enable PCIe controller support on Intel FPGA, example Stratix 10. +config PCI_MVEBU + bool "Enable Armada XP/38x PCIe driver" + depends on ARCH_MVEBU + select DM_PCI + select MISC + help + Say Y here if you want to enable PCIe controller support on + Armada XP/38x SoCs. + endif
drivers/pci/pci_mvebu.c +273 -197
566 lines not on this page · raw message
include/configs/clearfog.h +0 -1
@@ -55,7 +55,6 @@/* PCIe support */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_MVEBU #define CONFIG_PCI_SCAN_SHOW #endif
include/configs/controlcenterdc.h +0 -3
@@ -63,9 +63,6 @@/* PCIe support */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI -#define CONFIG_PCI_MVEBU -#define CONFIG_PCI_PNP #define CONFIG_PCI_SCAN_SHOW #endif
include/configs/db-88f6820-amc.h +0 -1
@@ -34,7 +34,6 @@/* PCIe support */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_MVEBU #define CONFIG_PCI_SCAN_SHOW #endif
include/configs/db-88f6820-gp.h +0 -1
@@ -59,7 +59,6 @@/* PCIe support */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_MVEBU #define CONFIG_PCI_SCAN_SHOW #endif
include/configs/db-mv784mp-gp.h +0 -1
@@ -46,7 +46,6 @@/* PCIe support */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_MVEBU #define CONFIG_PCI_SCAN_SHOW #endif
include/configs/ds414.h +0 -1
@@ -41,7 +41,6 @@/* PCIe support */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_MVEBU #define CONFIG_PCI_SCAN_SHOW #endif
include/configs/theadorable.h +0 -7
@@ -62,13 +62,6 @@#define CONFIG_SYS_SATA_MAX_DEVICE 1#define CONFIG_LBA48 -/* PCIe support */ -#ifdef CONFIG_CMD_PCI -#ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_MVEBU -#endif -#endif -/* Enable LCD and reserve 512KB from top of memory*/ #define CONFIG_SYS_MEM_TOP_HIDE 0x80000
include/configs/turris_omnia.h +0 -1
@@ -66,7 +66,6 @@/* PCIe support */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_MVEBU #define CONFIG_PCI_SCAN_SHOW #endif
include/configs/x530.h +0 -1
@@ -75,7 +75,6 @@/* PCIe support */ #ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_MVEBU #define CONFIG_PCI_SCAN_SHOW #endif
scripts/config_whitelist.txt +0 -1
@@ -1446,7 +1446,6 @@ CONFIG_PCI_MEM_BUS CONFIG_PCI_MEM_PHYS CONFIG_PCI_MEM_SIZE CONFIG_PCI_MSC01 -CONFIG_PCI_MVEBU CONFIG_PCI_NOSCAN CONFIG_PCI_OHCI CONFIG_PCI_OHCI_DEVNO
Signature · 1 line
2.20.1
PATCH v3 2/4 pci: pci_mvebu: Add DM_PCI support and move CONFIG_PCI_MVEBU to defconfig
Hi Stefan,
Quoted 57 lines · Stefan Roese
This patch adds
DM_PCIsupport to the MVEBU PCIe driver. This is necessary, since all PCI drivers have to be moved to DM (driver model) until the v2019.07 release.To not break git bisect'ablility, this patch also moves
CONFIG_PCI_MVEBUfrom config headers to the defconfig files.Signed-off-by Stefan Roese <[email protected]>Cc Dirk Eibach <[email protected]>Cc Mario Six <[email protected]>Cc Chris Packham <[email protected]>Cc Phil Sutter <[email protected]>Cc Marek Behún <[email protected]>Cc VlaoMao <[email protected]>---
v3:
- Add x530 defconfig /config/foo.hchanges
- Remove misleading function comment
- UsePCI_DEVinstead ofPCI_SLOT
- Introducemvebu_pcie_ofdata_to_platdata()to remove most functions from the loop inmvebu_pcie_bind(). This also enables to usage of a udevice pointer for the newly introduced functionpci_get_devfn()v2:
- Completely configure the controller based on DT properties. Now port and lane are read from the DT nodes and also the tgt and attr values are generated using the DT similar to how this is done in the Linux driver version. All A38x / XP specific defines can now be removed from this driver because of this.
- Please note that now the board specific dts file needs to enable the used PCIe ports, as this is also done in Linux.configs/clearfog_defconfig | 1 + configs/controlcenterdc_defconfig | 3 + configs/db-88f6820-amc_defconfig | 1 + configs/db-88f6820-gp_defconfig | 1 + configs/db-mv784mp-gp_defconfig | 1 + configs/ds414_defconfig | 1 + configs/theadorable_debug_defconfig | 2 + configs/turris_omnia_defconfig | 3 +- configs/x530_defconfig | 3 +- drivers/pci/Kconfig | 9 + drivers/pci/pci_mvebu.c | 470 ++++++++++++++++------------ include/configs/clearfog.h | 1 - include/configs/controlcenterdc.h | 3 - include/configs/db-88f6820-amc.h | 1 - include/configs/db-88f6820-gp.h | 1 - include/configs/db-mv784mp-gp.h | 1 - include/configs/ds414.h | 1 - include/configs/theadorable.h | 7 - include/configs/turris_omnia.h | 1 - include/configs/x530.h | 1 - scripts/config_whitelist.txt | 1 - 21 files changed, 296 insertions(+), 217 deletions(-)
[snip]
Quoted 7 lines
drivers/pci/pci_mvebu.c +7
-0+static int mvebu_get_tgt_attr (ofnode node,int devfn, +unsigned long type, +unsigned int *tgt, +unsigned int *attr) +{ +const int na =3 , ns =2 ; +const __be32 *range;
drivers/pci/pci_mvebu.c static void mvebu_pcie_setup_wins(struct mvebu_pcie *pcie) · line 372
Quoted 10 lines
drivers/pci/pci_mvebu.c +10
-0+int rlen, nranges, rangesz, pna, i; + + *tgt =-1 ; + *attr =-1 ; + + range =ofnode_get_property (node,"ranges" , &rlen); +if (!range) +return -EINVAL ; + + pna =2 ;/* hardcoded for now because of lack of of_n_addr_cells() */
Why? U-Boot has of_n_addr_cells() API.
Quoted 21 lines
drivers/pci/pci_mvebu.c +20
-0+ rangesz = pna + na + ns; + nranges = rlen /sizeof (__be32) / rangesz; + +for (i =0 ; i < nranges; i++, range += rangesz) { +u32 flags =of_read_number (range,1 ); +u32 slot =of_read_number (range +1 ,1 ); +u64 cpuaddr =of_read_number (range + na, pna); +unsigned long rtype; + +if (DT_FLAGS_TO_TYPE (flags) ==DT_TYPE_IO ) + rtype =IORESOURCE_IO ; +else if (DT_FLAGS_TO_TYPE (flags) ==DT_TYPE_MEM32 ) + rtype =IORESOURCE_MEM ; +else continue ; + +/* +* The Linux code used PCI_SLOT() here, which expects devfn +* in bits 7..0. PCI_DEV() in U-Boot is similar to PCI_SLOT(), +* only expects devfn in 15..8, where its saved in this driver. +*/
drivers/pci/pci_mvebu.c static void mvebu_pcie_setup_wins(struct mvebu_pcie *pcie) · line 403
Quoted 10 lines
drivers/pci/pci_mvebu.c +9
-0+if (slot ==PCI_DEV (devfn) && type == rtype) { + *tgt =DT_CPUADDR_TO_TARGET (cpuaddr); + *attr =DT_CPUADDR_TO_ATTR (cpuaddr); +return 0 ; } + } + +return -ENOENT ; +} +
[snip]
Regards,
Bin
PATCH v3 2/4 pci: pci_mvebu: Add DM_PCI support and move CONFIG_PCI_MVEBU to defconfig
Hi Bin,
Quoted 72 lines · Bin Meng
Quoted 57 lines · Stefan Roese
This patch adds
DM_PCIsupport to the MVEBU PCIe driver. This is necessary, since all PCI drivers have to be moved to DM (driver model) until the v2019.07 release.To not break git bisect'ablility, this patch also moves
CONFIG_PCI_MVEBUfrom config headers to the defconfig files.Signed-off-by Stefan Roese <[email protected]>Cc Dirk Eibach <[email protected]>Cc Mario Six <[email protected]>Cc Chris Packham <[email protected]>Cc Phil Sutter <[email protected]>Cc Marek Behún <[email protected]>Cc VlaoMao <[email protected]>---
v3:
- Add x530 defconfig /config/foo.hchanges
- Remove misleading function comment
- UsePCI_DEVinstead ofPCI_SLOT
- Introducemvebu_pcie_ofdata_to_platdata()to remove most functions from the loop inmvebu_pcie_bind(). This also enables to usage of a udevice pointer for the newly introduced functionpci_get_devfn()v2:
- Completely configure the controller based on DT properties. Now port and lane are read from the DT nodes and also the tgt and attr values are generated using the DT similar to how this is done in the Linux driver version. All A38x / XP specific defines can now be removed from this driver because of this.
- Please note that now the board specific dts file needs to enable the used PCIe ports, as this is also done in Linux.configs/clearfog_defconfig | 1 + configs/controlcenterdc_defconfig | 3 + configs/db-88f6820-amc_defconfig | 1 + configs/db-88f6820-gp_defconfig | 1 + configs/db-mv784mp-gp_defconfig | 1 + configs/ds414_defconfig | 1 + configs/theadorable_debug_defconfig | 2 + configs/turris_omnia_defconfig | 3 +- configs/x530_defconfig | 3 +- drivers/pci/Kconfig | 9 + drivers/pci/pci_mvebu.c | 470 ++++++++++++++++------------ include/configs/clearfog.h | 1 - include/configs/controlcenterdc.h | 3 - include/configs/db-88f6820-amc.h | 1 - include/configs/db-88f6820-gp.h | 1 - include/configs/db-mv784mp-gp.h | 1 - include/configs/ds414.h | 1 - include/configs/theadorable.h | 7 - include/configs/turris_omnia.h | 1 - include/configs/x530.h | 1 - scripts/config_whitelist.txt | 1 - 21 files changed, 296 insertions(+), 217 deletions(-)[snip]
Quoted 11 lines
drivers/pci/pci_mvebu.c +11
-0+static int mvebu_get_tgt_attr (ofnode node,int devfn, +unsigned long type, +unsigned int *tgt, +unsigned int *attr) +{ +const int na =3 , ns =2 ; +const __be32 *range; +int rlen, nranges, rangesz, pna, i; + + *tgt =-1 ; + *attr =-1 ;
Quoted 8 lines
drivers/pci/pci_mvebu.c static void mvebu_pcie_setup_wins(struct mvebu_pcie *pcie) · line 372
Quoted 6 lines
drivers/pci/pci_mvebu.c +6
-0+ + range =ofnode_get_property (node,"ranges" , &rlen); +if (!range) +return -EINVAL ; + + pna =2 ;/* hardcoded for now because of lack of of_n_addr_cells() */ Why? U-Boot has
of_n_addr_cells()API.
This function is only available with CONFIG_OF_LIVE:
obj-$(CONFIG_OF_LIVE) += of_access.o of_addr.o
I didn't want to risk breaking any of the existing MVEBU targets by forcing OF_LIVE here. I could add a comment to remove the hardcoded value there, once OF_LIVE is enabled for MVEBU per default.
Thanks,
Stefan
PATCH v3 2/4 pci: pci_mvebu: Add DM_PCI support and move CONFIG_PCI_MVEBU to defconfig
In reply to Bin MengHi Stefan,
Quoted 75 lines · Bin Meng
Hi Stefan,
Quoted 57 lines · Stefan Roese
This patch adds
DM_PCIsupport to the MVEBU PCIe driver. This is necessary, since all PCI drivers have to be moved to DM (driver model) until the v2019.07 release.To not break git bisect'ablility, this patch also moves
CONFIG_PCI_MVEBUfrom config headers to the defconfig files.Signed-off-by Stefan Roese <[email protected]>Cc Dirk Eibach <[email protected]>Cc Mario Six <[email protected]>Cc Chris Packham <[email protected]>Cc Phil Sutter <[email protected]>Cc Marek Behún <[email protected]>Cc VlaoMao <[email protected]>---
v3:
- Add x530 defconfig /config/foo.hchanges
- Remove misleading function comment
- UsePCI_DEVinstead ofPCI_SLOT
- Introducemvebu_pcie_ofdata_to_platdata()to remove most functions from the loop inmvebu_pcie_bind(). This also enables to usage of a udevice pointer for the newly introduced functionpci_get_devfn()v2:
- Completely configure the controller based on DT properties. Now port and lane are read from the DT nodes and also the tgt and attr values are generated using the DT similar to how this is done in the Linux driver version. All A38x / XP specific defines can now be removed from this driver because of this.
- Please note that now the board specific dts file needs to enable the used PCIe ports, as this is also done in Linux.configs/clearfog_defconfig | 1 + configs/controlcenterdc_defconfig | 3 + configs/db-88f6820-amc_defconfig | 1 + configs/db-88f6820-gp_defconfig | 1 + configs/db-mv784mp-gp_defconfig | 1 + configs/ds414_defconfig | 1 + configs/theadorable_debug_defconfig | 2 + configs/turris_omnia_defconfig | 3 +- configs/x530_defconfig | 3 +- drivers/pci/Kconfig | 9 + drivers/pci/pci_mvebu.c | 470 ++++++++++++++++------------ include/configs/clearfog.h | 1 - include/configs/controlcenterdc.h | 3 - include/configs/db-88f6820-amc.h | 1 - include/configs/db-88f6820-gp.h | 1 - include/configs/db-mv784mp-gp.h | 1 - include/configs/ds414.h | 1 - include/configs/theadorable.h | 7 - include/configs/turris_omnia.h | 1 - include/configs/x530.h | 1 - scripts/config_whitelist.txt | 1 - 21 files changed, 296 insertions(+), 217 deletions(-)[snip]
Quoted 11 lines
drivers/pci/pci_mvebu.c +11
-0+static int mvebu_get_tgt_attr (ofnode node,int devfn, +unsigned long type, +unsigned int *tgt, +unsigned int *attr) +{ +const int na =3 , ns =2 ; +const __be32 *range; +int rlen, nranges, rangesz, pna, i; + + *tgt =-1 ; + *attr =-1 ;
Quoted 8 lines
drivers/pci/pci_mvebu.c static void mvebu_pcie_setup_wins(struct mvebu_pcie *pcie) · line 372
Quoted 6 lines
drivers/pci/pci_mvebu.c +6
-0+ + range =ofnode_get_property (node,"ranges" , &rlen); +if (!range) +return -EINVAL ; + + pna =2 ;/* hardcoded for now because of lack of of_n_addr_cells() */ Why? U-Boot has
of_n_addr_cells()API.
Is this comment addressed?
Regards,
Bin
PATCH v3 2/4 pci: pci_mvebu: Add DM_PCI support and move CONFIG_PCI_MVEBU to defconfig
Hi Bin,
Quoted 87 lines · Bin Meng
Hi Stefan,
Quoted 75 lines · Bin Meng
Hi Stefan,
Quoted 57 lines · Stefan Roese
This patch adds
DM_PCIsupport to the MVEBU PCIe driver. This is necessary, since all PCI drivers have to be moved to DM (driver model) until the v2019.07 release.To not break git bisect'ablility, this patch also moves
CONFIG_PCI_MVEBUfrom config headers to the defconfig files.Signed-off-by Stefan Roese <[email protected]>Cc Dirk Eibach <[email protected]>Cc Mario Six <[email protected]>Cc Chris Packham <[email protected]>Cc Phil Sutter <[email protected]>Cc Marek Behún <[email protected]>Cc VlaoMao <[email protected]>---
v3:
- Add x530 defconfig /config/foo.hchanges
- Remove misleading function comment
- UsePCI_DEVinstead ofPCI_SLOT
- Introducemvebu_pcie_ofdata_to_platdata()to remove most functions from the loop inmvebu_pcie_bind(). This also enables to usage of a udevice pointer for the newly introduced functionpci_get_devfn()v2:
- Completely configure the controller based on DT properties. Now port and lane are read from the DT nodes and also the tgt and attr values are generated using the DT similar to how this is done in the Linux driver version. All A38x / XP specific defines can now be removed from this driver because of this.
- Please note that now the board specific dts file needs to enable the used PCIe ports, as this is also done in Linux.configs/clearfog_defconfig | 1 + configs/controlcenterdc_defconfig | 3 + configs/db-88f6820-amc_defconfig | 1 + configs/db-88f6820-gp_defconfig | 1 + configs/db-mv784mp-gp_defconfig | 1 + configs/ds414_defconfig | 1 + configs/theadorable_debug_defconfig | 2 + configs/turris_omnia_defconfig | 3 +- configs/x530_defconfig | 3 +- drivers/pci/Kconfig | 9 + drivers/pci/pci_mvebu.c | 470 ++++++++++++++++------------ include/configs/clearfog.h | 1 - include/configs/controlcenterdc.h | 3 - include/configs/db-88f6820-amc.h | 1 - include/configs/db-88f6820-gp.h | 1 - include/configs/db-mv784mp-gp.h | 1 - include/configs/ds414.h | 1 - include/configs/theadorable.h | 7 - include/configs/turris_omnia.h | 1 - include/configs/x530.h | 1 - scripts/config_whitelist.txt | 1 - 21 files changed, 296 insertions(+), 217 deletions(-)[snip]
Quoted 11 lines
drivers/pci/pci_mvebu.c +11
-0+static int mvebu_get_tgt_attr (ofnode node,int devfn, +unsigned long type, +unsigned int *tgt, +unsigned int *attr) +{ +const int na =3 , ns =2 ; +const __be32 *range; +int rlen, nranges, rangesz, pna, i; + + *tgt =-1 ; + *attr =-1 ;Quoted 8 lines
drivers/pci/pci_mvebu.c static void mvebu_pcie_setup_wins(struct mvebu_pcie *pcie) · line 372
Quoted 6 lines
drivers/pci/pci_mvebu.c +6
-0+ + range =ofnode_get_property (node,"ranges" , &rlen); +if (!range) +return -EINVAL ; + + pna =2 ;/* hardcoded for now because of lack of of_n_addr_cells() */ Why? U-Boot has
of_n_addr_cells()API.
Quoted 1 line
Is this comment addressed?
I did send an answer ~ one week ago:
https://www.mail-archive.com/u-boot at lists.denx.de/msg314633.html
I'll send a patch to add the comment shortly.
Thanks,
Stefan
PATCH v3 2/4 pci: pci_mvebu: Add DM_PCI support and move CONFIG_PCI_MVEBU to defconfig
In reply to Stefan RoeseQuoted 7 lines · Stefan Roese
This patch adds
DM_PCIsupport to the MVEBU PCIe driver. This is necessary, since all PCI drivers have to be moved to DM (driver model) until the v2019.07 release.To not break git bisect'ablility, this patch also moves
CONFIG_PCI_MVEBUfrom config headers to the defconfig files.
Quoted 7 lines
Signed-off-by Stefan Roese <[email protected]>Cc Dirk Eibach <[email protected]>Cc Mario Six <[email protected]>Cc Chris Packham <[email protected]>Cc Phil Sutter <[email protected]>Cc Marek Behún <[email protected]>Cc VlaoMao <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
PATCH v3 3/4 arm: mvebu: armada-xp/37x.dtsi: Sync PCIe DT nodes with Linux v4.20
In reply to Stefan RoeseThis patch sync's the PCIe DT nodes with the recent Linux v4.20 version. This change makes it easier to reference specific PCIe nodes in the board dts files to e.g. enable a PCIe port as this is now necessary with the new DM PCI driver for these platforms.
---
v3:
- No change
v2:
- New file
arch/arm/dts/armada-375.dtsi | 8 +++++--- arch/arm/dts/armada-xp-mv78230.dtsi | 17 +++++++++------ arch/arm/dts/armada-xp-mv78260.dtsi | 29 +++++++++++++++++--------- arch/arm/dts/armada-xp-mv78460.dtsi | 32 +++++++++++++++++++---------- 4 files changed, 56 insertions(+), 30 deletions(-)
arch/arm/dts/armada-375.dtsi +5 -3
@@ -582,7 +582,7 @@ }; }; - pcie-controller { + pciec: pcie at 82000000 { compatible = "marvell,armada-370-pcie"; status = "disabled"; device_type = "pci";
@@ -601,7 +601,7 @@ 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 1 MEM */ 0x81000000 0x2 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 1 IO */>; - pcie at 1,0 { + pcie0: pcie at 1,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; reg = <0x0800 0 0 0 0>;
@@ -610,6 +610,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>;
@@ -618,7 +619,7 @@ status = "disabled"; }; - pcie at 2,0 { + pcie1: pcie at 2,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>;
@@ -627,6 +628,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>;
arch/arm/dts/armada-xp-mv78230.dtsi +11 -6
@@ -86,7 +86,7 @@ * configured as x4 or quad x1 lanes. One unit is * x1 only. */ - pcie-controller { + pciec: pcie at 82000000 { compatible = "marvell,armada-xp-pcie"; status = "disabled"; device_type = "pci";
@@ -114,7 +114,7 @@ 0x82000000 0x5 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */ 0x81000000 0x5 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */>; - pcie at 1,0 { + pcie1: pcie at 1,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; reg = <0x0800 0 0 0 0>;
@@ -123,6 +123,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 58>; marvell,pcie-port = <0>;
@@ -131,7 +132,7 @@ status = "disabled"; }; - pcie at 2,0 { + pcie2: pcie at 2,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>;
@@ -140,6 +141,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 59>; marvell,pcie-port = <0>;
@@ -148,7 +150,7 @@ status = "disabled"; }; - pcie at 3,0 { + pcie3: pcie at 3,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; reg = <0x1800 0 0 0 0>;
@@ -157,6 +159,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 60>; marvell,pcie-port = <0>;
@@ -165,7 +168,7 @@ status = "disabled"; }; - pcie at 4,0 { + pcie4: pcie at 4,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>; reg = <0x2000 0 0 0 0>;
@@ -174,6 +177,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 0x81000000 0 0 0x81000000 0x4 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 61>; marvell,pcie-port = <0>;
@@ -182,7 +186,7 @@ status = "disabled"; }; - pcie at 5,0 { + pcie5: pcie at 5,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; reg = <0x2800 0 0 0 0>;
@@ -191,6 +195,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 0x81000000 0 0 0x81000000 0x5 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 62>; marvell,pcie-port = <1>;
arch/arm/dts/armada-xp-mv78260.dtsi +19 -10
@@ -87,7 +87,7 @@ * configured as x4 or quad x1 lanes. One unit is * x4 only. */ - pcie-controller { + pciec: pcie at 82000000 { compatible = "marvell,armada-xp-pcie"; status = "disabled"; device_type = "pci";
@@ -129,7 +129,7 @@ 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */ 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */>; - pcie at 1,0 { + pcie1: pcie at 1,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; reg = <0x0800 0 0 0 0>;
@@ -138,6 +138,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 58>; marvell,pcie-port = <0>;
@@ -146,7 +147,7 @@ status = "disabled"; }; - pcie at 2,0 { + pcie2: pcie at 2,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>;
@@ -155,6 +156,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 59>; marvell,pcie-port = <0>;
@@ -163,7 +165,7 @@ status = "disabled"; }; - pcie at 3,0 { + pcie3: pcie at 3,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; reg = <0x1800 0 0 0 0>;
@@ -172,6 +174,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 60>; marvell,pcie-port = <0>;
@@ -180,7 +183,7 @@ status = "disabled"; }; - pcie at 4,0 { + pcie4: pcie at 4,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>; reg = <0x2000 0 0 0 0>;
@@ -189,6 +192,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 0x81000000 0 0 0x81000000 0x4 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 61>; marvell,pcie-port = <0>;
@@ -197,7 +201,7 @@ status = "disabled"; }; - pcie at 5,0 { + pcie5: pcie at 5,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; reg = <0x2800 0 0 0 0>;
@@ -206,6 +210,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 0x81000000 0 0 0x81000000 0x5 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 62>; marvell,pcie-port = <1>;
@@ -214,7 +219,7 @@ status = "disabled"; }; - pcie at 6,0 { + pcie6: pcie at 6,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x84000 0 0x2000>; reg = <0x3000 0 0 0 0>;
@@ -223,6 +228,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0 0x81000000 0 0 0x81000000 0x6 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 63>; marvell,pcie-port = <1>;
@@ -231,7 +237,7 @@ status = "disabled"; }; - pcie at 7,0 { + pcie7: pcie at 7,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x88000 0 0x2000>; reg = <0x3800 0 0 0 0>;
@@ -240,6 +246,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0 0x81000000 0 0 0x81000000 0x7 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 64>; marvell,pcie-port = <1>;
@@ -248,7 +255,7 @@ status = "disabled"; }; - pcie at 8,0 { + pcie8: pcie at 8,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x8c000 0 0x2000>; reg = <0x4000 0 0 0 0>;
@@ -257,6 +264,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0 0x81000000 0 0 0x81000000 0x8 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 65>; marvell,pcie-port = <1>;
@@ -265,7 +273,7 @@ status = "disabled"; }; - pcie at 9,0 { + pcie9: pcie at 9,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; reg = <0x4800 0 0 0 0>;
@@ -274,6 +282,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 0x81000000 0 0 0x81000000 0x9 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 99>; marvell,pcie-port = <2>;
arch/arm/dts/armada-xp-mv78460.dtsi +21 -11
@@ -104,7 +104,7 @@ * configured as x4 or quad x1 lanes. Two units are * x4/x1. */ - pcie-controller { + pciec: pcie at 82000000 { compatible = "marvell,armada-xp-pcie"; status = "disabled"; device_type = "pci";
@@ -150,7 +150,7 @@ 0x82000000 0xa 0 MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */ 0x81000000 0xa 0 MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO */>; - pcie at 1,0 { + pcie1: pcie at 1,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; reg = <0x0800 0 0 0 0>;
@@ -159,6 +159,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 58>; marvell,pcie-port = <0>;
@@ -167,7 +168,7 @@ status = "disabled"; }; - pcie at 2,0 { + pcie2: pcie at 2,0 { device_type = "pci"; assigned-addresses = <0x82001000 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>;
@@ -176,6 +177,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 59>; marvell,pcie-port = <0>;
@@ -184,7 +186,7 @@ status = "disabled"; }; - pcie at 3,0 { + pcie3: pcie at 3,0 { device_type = "pci"; assigned-addresses = <0x82001800 0 0x48000 0 0x2000>; reg = <0x1800 0 0 0 0>;
@@ -193,6 +195,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 60>; marvell,pcie-port = <0>;
@@ -201,7 +204,7 @@ status = "disabled"; }; - pcie at 4,0 { + pcie4: pcie at 4,0 { device_type = "pci"; assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>; reg = <0x2000 0 0 0 0>;
@@ -210,6 +213,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 0x81000000 0 0 0x81000000 0x4 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 61>; marvell,pcie-port = <0>;
@@ -218,7 +222,7 @@ status = "disabled"; }; - pcie at 5,0 { + pcie5: pcie at 5,0 { device_type = "pci"; assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; reg = <0x2800 0 0 0 0>;
@@ -227,6 +231,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 0x81000000 0 0 0x81000000 0x5 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 62>; marvell,pcie-port = <1>;
@@ -235,7 +240,7 @@ status = "disabled"; }; - pcie at 6,0 { + pcie6: pcie at 6,0 { device_type = "pci"; assigned-addresses = <0x82003000 0 0x84000 0 0x2000>; reg = <0x3000 0 0 0 0>;
@@ -244,6 +249,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0 0x81000000 0 0 0x81000000 0x6 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 63>; marvell,pcie-port = <1>;
@@ -252,7 +258,7 @@ status = "disabled"; }; - pcie at 7,0 { + pcie7: pcie at 7,0 { device_type = "pci"; assigned-addresses = <0x82003800 0 0x88000 0 0x2000>; reg = <0x3800 0 0 0 0>;
@@ -261,6 +267,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0 0x81000000 0 0 0x81000000 0x7 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 64>; marvell,pcie-port = <1>;
@@ -269,7 +276,7 @@ status = "disabled"; }; - pcie at 8,0 { + pcie8: pcie at 8,0 { device_type = "pci"; assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>; reg = <0x4000 0 0 0 0>;
@@ -278,6 +285,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0 0x81000000 0 0 0x81000000 0x8 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 65>; marvell,pcie-port = <1>;
@@ -286,7 +294,7 @@ status = "disabled"; }; - pcie at 9,0 { + pcie9: pcie at 9,0 { device_type = "pci"; assigned-addresses = <0x82004800 0 0x42000 0 0x2000>; reg = <0x4800 0 0 0 0>;
@@ -295,6 +303,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 0x81000000 0 0 0x81000000 0x9 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 99>; marvell,pcie-port = <2>;
@@ -303,7 +312,7 @@ status = "disabled"; }; - pcie at 10,0 { + pcie10: pcie at a,0 { device_type = "pci"; assigned-addresses = <0x82005000 0 0x82000 0 0x2000>; reg = <0x5000 0 0 0 0>;
@@ -312,6 +321,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0 0x81000000 0 0 0x81000000 0xa 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 103>; marvell,pcie-port = <3>;
Signature · 1 line
2.20.1
PATCH v3 3/4 arm: mvebu: armada-xp/37x.dtsi: Sync PCIe DT nodes with Linux v4.20
Quoted 5 lines · Stefan Roese
This patch sync's the PCIe DT nodes with the recent Linux v4.20 version. This change makes it easier to reference specific PCIe nodes in the board dts files to e.g. enable a PCIe port as this is now necessary with the new DM PCI driver for these platforms.
Quoted 8 lines
Signed-off-by Stefan Roese <[email protected]>Cc Dirk Eibach <[email protected]>Cc Mario Six <[email protected]>Cc Chris Packham <[email protected]>Cc Phil Sutter <[email protected]>Cc Marek Behún <[email protected]>Cc VlaoMao <[email protected]>Cc Tom Rini <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
PATCH v3 4/4 arm: mvebu: armada-xp-theadorable.dts: Enable PCIe DT nodes
In reply to Stefan RoeseNow that the PCIe driver supports DM and DT parsing, enable the PCIe DT nodes that are used by this board.
---
v3:
- No change
v2:
- New file
arch/arm/dts/armada-xp-theadorable.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/arm/dts/armada-xp-theadorable.dts +14 -0
@@ -162,3 +162,17 @@ }; }; }; + +&pciec { + status = "okay"; + + pcie at 1,0 { + /* Port 0, Lane 0 */ + status = "okay"; + }; + + pcie at 9,0 { + /* Port 2, Lane 0 */ + status = "okay"; + }; +};
Signature · 1 line
2.20.1
PATCH v3 4/4 arm: mvebu: armada-xp-theadorable.dts: Enable PCIe DT nodes
Quoted 10 lines · Stefan Roese
Now that the PCIe driver supports DM and DT parsing, enable the PCIe DT nodes that are used by this board.
Signed-off-by Stefan Roese <[email protected]>Cc Dirk Eibach <[email protected]>Cc Mario Six <[email protected]>Cc Chris Packham <[email protected]>Cc Phil Sutter <[email protected]>Cc Marek Behún <[email protected]>Cc VlaoMao <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
PATCH v3 1/4 pci: Add pci_get_devfn() to extract devfn from the fdt_pci_addr
In reply to Stefan RoeseQuoted 8 lines · Stefan Roese
This function will be used by the Marvell Armada XP/38x PCIe driver, which is moved to DM right now. So let's extract the functionality from
pci_uclass_child_post_bind()to make it available.Signed-off-by Stefan Roese <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>
Quoted 7 lines
---
v3:
- New patch, replaces "[PATCH] core: ofnode: Addofnode_pci_get_devfn()"drivers/pci/pci-uclass.c | 28 +++++++++++++++++++--------- include/pci.h | 10 ++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-)
PATCH v3 1/4 pci: Add pci_get_devfn() to extract devfn from the fdt_pci_addr
Quoted 13 lines · Simon Glass
Quoted 12 lines · Stefan Roese
This function will be used by the Marvell Armada XP/38x PCIe driver, which is moved to DM right now. So let's extract the functionality from
pci_uclass_child_post_bind()to make it available.Signed-off-by Stefan Roese <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>---
v3:
- New patch, replaces "[PATCH] core: ofnode: Addofnode_pci_get_devfn()"
Quoted 5 lines
Quoted 3 lines
drivers/pci/pci-uclass.c | 28 +++++++++++++++++++--------- include/pci.h | 10 ++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-)Reviewed-by Simon Glass <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
PATCH v3 1/4 pci: Add pci_get_devfn() to extract devfn from the fdt_pci_addr
In reply to Stefan RoeseQuoted 8 lines · Stefan Roese
This function will be used by the Marvell Armada XP/38x PCIe driver, which is moved to DM right now. So let's extract the functionality from
pci_uclass_child_post_bind()to make it available.Signed-off-by Stefan Roese <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>
Quoted 8 lines
---
v3:
- New patch, replaces "[PATCH] core: ofnode: Addofnode_pci_get_devfn()"drivers/pci/pci-uclass.c | 28 +++++++++++++++++++--------- include/pci.h | 10 ++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-)