pci: Use dev_read/dev_remap APIs
Subsystems (3)
cover pci: Use dev_read/dev_remap APIs
Convert PCI drivers from legacy devfdt_* and fdtdec_* interfaces to dev_read_* and dev_remap_* APIs, enabling support for both live device tree and flat DT while removing dependency on global FDT access.
No functional changes.
---
Peng Fan (5):
pci: rcar: Use dev_read_addr_index()
pci: mpc85xx: Simplfy code with dev_remap_addr()
pci: dw_mvebu: Use dev_read_addr_x APIs
pci: imx: Use dev_read_addr_index_ptr()
pci: layerscape: ep: Use dev APIs
drivers/pci/pci-rcar-gen2.c | 7 ++++--- drivers/pci/pci-rcar-gen3.c | 5 +++-- drivers/pci/pci_mpc85xx.c | 11 ++++++----- drivers/pci/pcie_dw_mvebu.c | 5 ++--- drivers/pci/pcie_imx.c | 4 ++-- drivers/pci/pcie_layerscape.h | 3 ++- drivers/pci/pcie_layerscape_ep.c | 24 +++++++----------------- 7 files changed, 26 insertions(+), 33 deletions(-)
---
base-commit: bb354d04459f5425318aeb8a70bae995ee573f1d
change-id: 20260526-devfdt-pci-415dd0cf6e70
Best regards,
Signature · 1 line
Peng Fan <[email protected]>
PATCH 1/5 pci: rcar: Use dev_read_addr_index()
From: Peng Fan <[email protected]>
Use dev_read_addr_index() which supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.
While at here, correct the return value check.
No functional changes.
--- drivers/pci/pci-rcar-gen2.c | 7 ++++--- drivers/pci/pci-rcar-gen3.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/pci/pci-rcar-gen2.c +4 -3
@@ -10,6 +10,7 @@#include <clk.h> #include <dm.h> #include <errno.h> +#include <fdtdec.h> #include <pci.h> #include <linux/bitops.h>
@@ -235,9 +236,9 @@ static int rcar_gen2_pci_of_to_plat(struct udevice *dev) {struct rcar_gen2_pci_priv *priv =dev_get_priv (dev); - priv->cfg_base =devfdt_get_addr_index (dev,0 ); - priv->mem_base =devfdt_get_addr_index (dev,1 ); -if (!priv->cfg_base || !priv->mem_base) + priv->cfg_base =dev_read_addr_index (dev,0 ); + priv->mem_base =dev_read_addr_index (dev,1 ); +if (priv->cfg_base ==FDT_ADDR_T_NONE || priv->mem_base ==FDT_ADDR_T_NONE )return -EINVAL ;return 0 ;
drivers/pci/pci-rcar-gen3.c +3 -2
@@ -19,6 +19,7 @@#include <clk.h> #include <dm.h> #include <errno.h> +#include <fdtdec.h> #include <pci.h> #include <wait_bit.h> #include <linux/bitops.h>
@@ -391,8 +392,8 @@ static int rcar_gen3_pcie_of_to_plat(struct udevice *dev) {struct rcar_gen3_pcie_priv *priv =dev_get_plat (dev); - priv->regs =devfdt_get_addr_index (dev,0 ); -if (!priv->regs) + priv->regs =dev_read_addr_index (dev,0 ); +if (priv->regs ==FDT_ADDR_T_NONE )return -EINVAL ;return 0 ;
Signature · 1 line
2.51.0
Re: [PATCH 1/5] pci: rcar: Use dev_read_addr_index()
Quoted 54 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Use
dev_read_addr_index()which supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.While at here, correct the return value check.
No functional changes.
Signed-off-by Peng Fan <[email protected]>--- drivers/pci/pci-rcar-gen2.c | 7 ++++--- drivers/pci/pci-rcar-gen3.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-)drivers/pci/pci-rcar-gen2.c +4
-3@@ -10,6 +10,7 @@#include <clk.h> #include <dm.h> #include <errno.h> +#include <fdtdec.h> #include <pci.h> #include <linux/bitops.h> @@ -235,9 +236,9 @@ static int rcar_gen2_pci_of_to_plat(struct udevice *dev) {struct rcar_gen2_pci_priv *priv =dev_get_priv (dev); - priv->cfg_base =devfdt_get_addr_index (dev,0 ); - priv->mem_base =devfdt_get_addr_index (dev,1 ); -if (!priv->cfg_base || !priv->mem_base) + priv->cfg_base =dev_read_addr_index (dev,0 ); + priv->mem_base =dev_read_addr_index (dev,1 ); +if (priv->cfg_base ==FDT_ADDR_T_NONE || priv->mem_base ==FDT_ADDR_T_NONE )return -EINVAL ;return 0 ;drivers/pci/pci-rcar-gen3.c +1
-0@@ -19,6 +19,7 @@#include <clk.h> #include <dm.h> #include <errno.h> +#include <fdtdec.h> #include <pci.h> #include <wait_bit.h> #include <linux/bitops.h>
drivers/pci/pci-rcar-gen3.c static int rcar_gen3_pcie_of_to_plat(struct udevice *dev) · line 399
Quoted 10 lines
drivers/pci/pci-rcar-gen3.c +2
-2@@ -391,8 +392,8 @@ static int rcar_gen3_pcie_of_to_plat(struct udevice *dev) {struct rcar_gen3_pcie_priv *priv =dev_get_plat (dev); - priv->regs =devfdt_get_addr_index (dev,0 ); -if (!priv->regs) + priv->regs =dev_read_addr_index (dev,0 ); +if (priv->regs ==FDT_ADDR_T_NONE )return -EINVAL ;return 0 ;
Thanks,
Neil
PATCH 2/5 pci: mpc85xx: Simplfy code with dev_remap_addr()
In reply to Peng Fan (OSS)From: Peng Fan <[email protected]>
devfdt_get_addr_ptr() + map_physmem() could be simplifed with devfdt_remap_addr(). But to avoid direct dependency on devfdt_* helpers, use dev_remap_addr().
No functional changes.
--- drivers/pci/pci_mpc85xx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/pci/pci_mpc85xx.c +6 -5
@@ -170,13 +170,14 @@ static int mpc85xx_pci_dm_remove(struct udevice *dev)static int mpc85xx_pci_of_to_plat (struct udevice *dev) {struct mpc85xx_pci_priv *priv =dev_get_priv (dev); -fdt_addr_t addr; +void __iomem *addr; - addr =devfdt_get_addr_index (dev,0 ); -if (addr ==FDT_ADDR_T_NONE ) + addr =dev_remap_addr_index (dev,0 ); +if (!addr)return -EINVAL ; - priv->cfg_addr = (void __iomem *)map_physmem (addr,0 ,MAP_NOCACHE ); - priv->cfg_data = (void __iomem *)((ulong )priv->cfg_addr +4 ); + + priv->cfg_addr = addr; + priv->cfg_data = priv->cfg_addr +4 ;return 0 ; }
Signature · 1 line
2.51.0
Re: [PATCH 2/5] pci: mpc85xx: Simplfy code with dev_remap_addr()
Quoted 28 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
devfdt_get_addr_ptr()+map_physmem()could be simplifed withdevfdt_remap_addr(). But to avoid direct dependency on devfdt_* helpers, usedev_remap_addr().No functional changes.
Signed-off-by Peng Fan <[email protected]>--- drivers/pci/pci_mpc85xx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/pci/pci_mpc85xx.c +2
-3@@ -170,13 +170,14 @@ static int mpc85xx_pci_dm_remove(struct udevice *dev)static int mpc85xx_pci_of_to_plat (struct udevice *dev) {struct mpc85xx_pci_priv *priv =dev_get_priv (dev); -fdt_addr_t addr; +void __iomem *addr; - addr =devfdt_get_addr_index (dev,0 ); -if (addr ==FDT_ADDR_T_NONE ) + addr =dev_remap_addr_index (dev,0 );
drivers/pci/pci_mpc85xx.c static int mpc85xx_pci_dm_remove(struct udevice *dev) · line 183
Quoted 10 lines
drivers/pci/pci_mpc85xx.c +4
-2+if (!addr)return -EINVAL ; - priv->cfg_addr = (void __iomem *)map_physmem (addr,0 ,MAP_NOCACHE ); - priv->cfg_data = (void __iomem *)((ulong )priv->cfg_addr +4 ); + + priv->cfg_addr = addr; + priv->cfg_data = priv->cfg_addr +4 ;return 0 ; }
Thanks,
Neil
Re: [PATCH 2/5] pci: mpc85xx: Simplfy code with dev_remap_addr()
In reply to Peng Fan (OSS)Hello Peng,
Quoted 6 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
devfdt_get_addr_ptr()+map_physmem()could be simplifed withdevfdt_remap_addr(). But to avoid direct dependency on devfdt_* helpers, usedev_remap_addr().
Quoted 6 lines
No functional changes.
Signed-off-by Peng Fan <[email protected]>--- drivers/pci/pci_mpc85xx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
bye,
Heiko
Signature · 5 lines
Nabla Software Engineering HRB 40522 Augsburg Phone: +49 821 45592596 E-Mail: [email protected] Geschäftsführer : Stefano Babic
PATCH 3/5 pci: dw_mvebu: Use dev_read_addr_x APIs
In reply to Peng Fan (OSS)From: Peng Fan <[email protected]>
Use dev_read_addr_x APIs which support both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.
No functional changes.
--- drivers/pci/pcie_dw_mvebu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pci/pcie_dw_mvebu.c +2 -3
@@ -565,13 +565,12 @@ static int pcie_dw_mvebu_of_to_plat(struct udevice *dev)struct pcie_dw_mvebu *pcie =dev_get_priv (dev);/* Get the controller base address */ - pcie->ctrl_base =devfdt_get_addr_index_ptr (dev,0 ); + pcie->ctrl_base =dev_read_addr_index_ptr (dev,0 );if (!pcie->ctrl_base)return -EINVAL ;/* Get the config space base address and size */ - pcie->cfg_base =devfdt_get_addr_size_index_ptr (dev,1 , - &pcie->cfg_size); + pcie->cfg_base =dev_read_addr_size_index_ptr (dev,1 , &pcie->cfg_size);if (!pcie->cfg_base)return -EINVAL ;
Signature · 1 line
2.51.0
Re: [PATCH 3/5] pci: dw_mvebu: Use dev_read_addr_x APIs
Quoted 23 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Use
dev_read_addr_xAPIs which support both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes.
Signed-off-by Peng Fan <[email protected]>--- drivers/pci/pcie_dw_mvebu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/pci/pcie_dw_mvebu.c +1
-1@@ -565,13 +565,12 @@ static int pcie_dw_mvebu_of_to_plat(struct udevice *dev)struct pcie_dw_mvebu *pcie =dev_get_priv (dev);/* Get the controller base address */ - pcie->ctrl_base =devfdt_get_addr_index_ptr (dev,0 ); + pcie->ctrl_base =dev_read_addr_index_ptr (dev,0 );
drivers/pci/pcie_dw_mvebu.c static int pcie_dw_mvebu_of_to_plat(struct udevice *dev) · line 576
Quoted 10 lines
drivers/pci/pcie_dw_mvebu.c +1
-2if (!pcie->ctrl_base)return -EINVAL ;/* Get the config space base address and size */ - pcie->cfg_base =devfdt_get_addr_size_index_ptr (dev,1 , - &pcie->cfg_size); + pcie->cfg_base =dev_read_addr_size_index_ptr (dev,1 , &pcie->cfg_size);if (!pcie->cfg_base)return -EINVAL ;
Thanks,
Neil
Stefan Roese
Reviewed-byRe: [PATCH 3/5] pci: dw_mvebu: Use dev_read_addr_x APIs
Quoted 29 lines · Neil Armstrong
Quoted 28 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Use
dev_read_addr_xAPIs which support both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes.
Signed-off-by Peng Fan <[email protected]>---
drivers/pci/pcie_dw_mvebu.c| 5 ++---1 file changed, 2 insertions(+), 3 deletions(-)drivers/pci/pcie_dw_mvebu.c +2
-3@@ -565,13 +565,12 @@ static int pcie_dw_mvebu_of_to_plat(struct udevice *dev) struct pcie_dw_mvebu *pcie = dev_get_priv(dev); /* Get the controller base address */ - pcie->ctrl_base = devfdt_get_addr_index_ptr(dev, 0); + pcie->ctrl_base = dev_read_addr_index_ptr(dev, 0); if (!pcie->ctrl_base) return -EINVAL; /* Get the config space base address and size */ - pcie->cfg_base = devfdt_get_addr_size_index_ptr(dev, 1, - &pcie->cfg_size); + pcie->cfg_base = dev_read_addr_size_index_ptr(dev, 1, &pcie-
Quoted 6 lines
drivers/pci/pcie_dw_mvebu.c static int pcie_dw_mvebu_of_to_plat(struct udevice *dev) · line 576
Quoted 4 lines
drivers/pci/pcie_dw_mvebu.c +0
-0>cfg_size); if (!pcie->cfg_base) return -EINVAL;Reviewed-by Neil Armstrong <[email protected]>
Thanks,
Stefan
PATCH 4/5 pci: imx: Use dev_read_addr_index_ptr()
In reply to Peng Fan (OSS)From: Peng Fan <[email protected]>
Use dev_read_addr_index_ptr() which support both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.
No functional changes
--- drivers/pci/pcie_imx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pcie_imx.c +2 -2
@@ -774,8 +774,8 @@ static int imx_pcie_of_to_plat(struct udevice *dev) {struct imx_pcie_priv *priv =dev_get_priv (dev); - priv->dbi_base =devfdt_get_addr_index_ptr (dev,0 ); - priv->cfg_base =devfdt_get_addr_index_ptr (dev,1 ); + priv->dbi_base =dev_read_addr_index_ptr (dev,0 ); + priv->cfg_base =dev_read_addr_index_ptr (dev,1 );if (!priv->dbi_base || !priv->cfg_base)return -EINVAL ;
Signature · 1 line
2.51.0
Re: [PATCH 4/5] pci: imx: Use dev_read_addr_index_ptr()
Quoted 18 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Use
dev_read_addr_index_ptr()which support both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes
Signed-off-by Peng Fan <[email protected]>--- drivers/pci/pcie_imx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/pci/pcie_imx.c +0
-0
drivers/pci/pcie_imx.c static int imx_pcie_of_to_plat(struct udevice *dev) · line 781
Quoted 10 lines
drivers/pci/pcie_imx.c +2
-2@@ -774,8 +774,8 @@ static int imx_pcie_of_to_plat(struct udevice *dev) {struct imx_pcie_priv *priv =dev_get_priv (dev); - priv->dbi_base =devfdt_get_addr_index_ptr (dev,0 ); - priv->cfg_base =devfdt_get_addr_index_ptr (dev,1 ); + priv->dbi_base =dev_read_addr_index_ptr (dev,0 ); + priv->cfg_base =dev_read_addr_index_ptr (dev,1 );if (!priv->dbi_base || !priv->cfg_base)return -EINVAL ;
Thanks,
Neil
PATCH 5/5 pci: layerscape: ep: Use dev APIs
In reply to Peng Fan (OSS)From: Peng Fan <[email protected]>
Convert the Layerscape PCIe endpoint driver to use device and ofnode-based APIs instead of legacy FDT interfaces.
Replace devfdt_get_addr_index_ptr(), fdt_get_named_resource(), fdtdec_get_bool(), and fdtdec_get_int() with their modern counterparts such as dev_read_addr_index_ptr(), dev_read_resource_byname(), dev_read_bool(), and dev_read_s32_default().
Also remove the dependency on gd->fdt_blob and global data access.
No functional changes.
--- drivers/pci/pcie_layerscape.h | 3 ++- drivers/pci/pcie_layerscape_ep.c | 24 +++++++----------------- 2 files changed, 9 insertions(+), 18 deletions(-)
drivers/pci/pcie_layerscape.h +2 -1
@@ -10,6 +10,7 @@#include <fdtdec.h> #include <pci.h> +#include <linux/ioport.h> #include <linux/sizes.h> #include <linux/types.h> #include <asm/arch-fsl-layerscape/svr.h>
@@ -164,7 +165,7 @@ struct ls_pcie_rc { };struct ls_pcie_ep { -struct fdt_resource addr_res; +struct resource addr_res;struct ls_pcie *pcie;struct udevice *bus;void __iomem *addr;
drivers/pci/pcie_layerscape_ep.c +7 -17
@@ -7,7 +7,6 @@#include <config.h> #include <asm/arch/fsl_serdes.h> #include <dm.h> -#include <asm/global_data.h> #include <dm/devres.h> #include <errno.h> #include <pci_ep.h>
@@ -16,8 +15,6 @@#include <linux/log2.h> #include "pcie_layerscape.h" -DECLARE_GLOBAL_DATA_PTR ; -static void ls_pcie_ep_enable_cfg (struct ls_pcie_ep *pcie_ep) {struct ls_pcie *pcie = pcie_ep->pcie;
@@ -250,17 +247,15 @@ static int ls_pcie_ep_probe(struct udevice *dev) pcie_ep->pcie = pcie; - pcie->dbi =devfdt_get_addr_index_ptr (dev,0 ); + pcie->dbi =dev_read_addr_index_ptr (dev,0 );if (!pcie->dbi)return -EINVAL ; - pcie->ctrl =devfdt_get_addr_index_ptr (dev,1 ); + pcie->ctrl =dev_read_addr_index_ptr (dev,1 );if (!pcie->ctrl)return -EINVAL ; - ret =fdt_get_named_resource (gd->fdt_blob,dev_of_offset (dev), -"reg" ,"reg-names" , -"addr_space" , &pcie_ep->addr_res); + ret =dev_read_resource_byname (dev,"addr_space" , &pcie_ep->addr_res);if (ret) {printf ("%s: resource \"addr_space\" not found\n" , dev->name);return ret;
@@ -273,8 +268,7 @@ static int ls_pcie_ep_probe(struct udevice *dev)if (!is_serdes_configured (PCIE_SRDS_PRTCL (pcie->idx)))return 0 ; - pcie->big_endian =fdtdec_get_bool (gd->fdt_blob,dev_of_offset (dev), -"big-endian" ); + pcie->big_endian =dev_read_bool (dev,"big-endian" ); svr =SVR_SOC_VER (get_svr ());
@@ -294,13 +288,9 @@ static int ls_pcie_ep_probe(struct udevice *dev)if (pcie->mode !=PCI_HEADER_TYPE_NORMAL )return 0 ; - pcie_ep->max_functions =fdtdec_get_int (gd->fdt_blob, -dev_of_offset (dev), -"max-functions" ,1 ); - pcie_ep->num_ib_wins =fdtdec_get_int (gd->fdt_blob,dev_of_offset (dev), -"num-ib-windows" ,8 ); - pcie_ep->num_ob_wins =fdtdec_get_int (gd->fdt_blob,dev_of_offset (dev), -"num-ob-windows" ,8 ); + pcie_ep->max_functions =dev_read_s32_default (dev,"max-functions" ,1 ); + pcie_ep->num_ib_wins =dev_read_s32_default (dev,"num-ib-windows" ,8 ); + pcie_ep->num_ob_wins =dev_read_s32_default (dev,"num-ob-windows" ,8 );printf ("PCIe%u: %s %s" ,PCIE_SRDS_PRTCL (pcie->idx), dev->name,"Endpoint" );
Signature · 1 line
2.51.0
Re: [PATCH 5/5] pci: layerscape: ep: Use dev APIs
Quoted 101 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Convert the Layerscape PCIe endpoint driver to use device and ofnode-based APIs instead of legacy FDT interfaces.
Replace
devfdt_get_addr_index_ptr(),fdt_get_named_resource(),fdtdec_get_bool(), andfdtdec_get_int()with their modern counterparts such asdev_read_addr_index_ptr(),dev_read_resource_byname(),dev_read_bool(), anddev_read_s32_default().Also remove the dependency on
gd->fdt_bloband global data access.No functional changes.
Signed-off-by Peng Fan <[email protected]>--- drivers/pci/pcie_layerscape.h | 3 ++- drivers/pci/pcie_layerscape_ep.c | 24 +++++++----------------- 2 files changed, 9 insertions(+), 18 deletions(-)drivers/pci/pcie_layerscape.h +2
-1@@ -10,6 +10,7 @@#include <fdtdec.h> #include <pci.h> +#include <linux/ioport.h> #include <linux/sizes.h> #include <linux/types.h> #include <asm/arch-fsl-layerscape/svr.h> @@ -164,7 +165,7 @@ struct ls_pcie_rc { };struct ls_pcie_ep { -struct fdt_resource addr_res; +struct resource addr_res;struct ls_pcie *pcie;struct udevice *bus;void __iomem *addr;drivers/pci/pcie_layerscape_ep.c +4
-13@@ -7,7 +7,6 @@#include <config.h> #include <asm/arch/fsl_serdes.h> #include <dm.h> -#include <asm/global_data.h> #include <dm/devres.h> #include <errno.h> #include <pci_ep.h> @@ -16,8 +15,6 @@#include <linux/log2.h> #include "pcie_layerscape.h" -DECLARE_GLOBAL_DATA_PTR ; -static void ls_pcie_ep_enable_cfg (struct ls_pcie_ep *pcie_ep) {struct ls_pcie *pcie = pcie_ep->pcie;@@ -250,17 +247,15 @@ static int ls_pcie_ep_probe(struct udevice *dev) pcie_ep->pcie = pcie; - pcie->dbi =devfdt_get_addr_index_ptr (dev,0 ); + pcie->dbi =dev_read_addr_index_ptr (dev,0 );if (!pcie->dbi)return -EINVAL ; - pcie->ctrl =devfdt_get_addr_index_ptr (dev,1 ); + pcie->ctrl =dev_read_addr_index_ptr (dev,1 );if (!pcie->ctrl)return -EINVAL ; - ret =fdt_get_named_resource (gd->fdt_blob,dev_of_offset (dev), -"reg" ,"reg-names" , -"addr_space" , &pcie_ep->addr_res); + ret =dev_read_resource_byname (dev,"addr_space" , &pcie_ep->addr_res);if (ret) {printf ("%s: resource \"addr_space\" not found\n" , dev->name);return ret;@@ -273,8 +268,7 @@ static int ls_pcie_ep_probe(struct udevice *dev)if (!is_serdes_configured (PCIE_SRDS_PRTCL (pcie->idx)))return 0 ; - pcie->big_endian =fdtdec_get_bool (gd->fdt_blob,dev_of_offset (dev), -"big-endian" ); + pcie->big_endian =dev_read_bool (dev,"big-endian" ); svr =SVR_SOC_VER (get_svr ());@@ -294,13 +288,9 @@ static int ls_pcie_ep_probe(struct udevice *dev)if (pcie->mode !=PCI_HEADER_TYPE_NORMAL )return 0 ; - pcie_ep->max_functions =fdtdec_get_int (gd->fdt_blob, -dev_of_offset (dev), -"max-functions" ,1 );
drivers/pci/pcie_layerscape_ep.c static int ls_pcie_ep_probe(struct udevice *dev) · line 296
Quoted 10 lines
drivers/pci/pcie_layerscape_ep.c +3
-4- pcie_ep->num_ib_wins =fdtdec_get_int (gd->fdt_blob,dev_of_offset (dev), -"num-ib-windows" ,8 ); - pcie_ep->num_ob_wins =fdtdec_get_int (gd->fdt_blob,dev_of_offset (dev), -"num-ob-windows" ,8 ); + pcie_ep->max_functions =dev_read_s32_default (dev,"max-functions" ,1 ); + pcie_ep->num_ib_wins =dev_read_s32_default (dev,"num-ib-windows" ,8 ); + pcie_ep->num_ob_wins =dev_read_s32_default (dev,"num-ob-windows" ,8 );printf ("PCIe%u: %s %s" ,PCIE_SRDS_PRTCL (pcie->idx), dev->name,"Endpoint" );
Thanks,
Neil
Hi,
Quoted 8 lines · Peng Fan (OSS)
Convert PCI drivers from legacy devfdt_* and fdtdec_* interfaces to dev_read_* and dev_remap_* APIs, enabling support for both live device tree and flat DT while removing dependency on global FDT access.
No functional changes.
[...]
Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-ufs (u-boot-pci-next)
[1/5] pci: rcar: Use dev_read_addr_index()
https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/f657eab9bedb0b7ea32857345fffb8c3c68dd6b6 [2/5] pci: mpc85xx: Simplfy code with dev_remap_addr() https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/9b6f2786aafd5247dd748e127ea6a01038b09b42 [3/5] pci: dw_mvebu: Use dev_read_addr_x APIs https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/06fdccbcd8b3f5eba2788ce5cf4a5fe39e91783a [4/5] pci: imx: Use dev_read_addr_index_ptr() https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/fc1016d6838b9994083062a42a4ba530a85596cc [5/5] pci: layerscape: ep: Use dev APIs https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/57abbbcc945079404ba8e3d4a68c991e3cd92a65
Signature · 1 line
Neil