public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v1] pci-host-ecam-generic: Convert to ofnode functions
@ 2024-02-14 20:30 Maksim Kiselev
  2024-03-04 15:28 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Maksim Kiselev @ 2024-02-14 20:30 UTC (permalink / raw)
  Cc: Maksim Kiselev, Simon Glass, u-boot

FDT functions is not working when OF_LIVE is enabled.
Convert fdt parsing functions to ofnode parsing functions

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
---
 drivers/pci/pcie_ecam_generic.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pcie_ecam_generic.c b/drivers/pci/pcie_ecam_generic.c
index 2e089b0e03..f5bc6e3d92 100644
--- a/drivers/pci/pcie_ecam_generic.c
+++ b/drivers/pci/pcie_ecam_generic.c
@@ -10,7 +10,7 @@
 #include <common.h>
 #include <dm.h>
 #include <pci.h>
-#include <asm/global_data.h>
+#include <linux/ioport.h>
 #include <linux/printk.h>
 
 #include <asm/io.h>
@@ -133,18 +133,17 @@ static int pci_generic_ecam_write_config(struct udevice *bus, pci_dev_t bdf,
 static int pci_generic_ecam_of_to_plat(struct udevice *dev)
 {
 	struct generic_ecam_pcie *pcie = dev_get_priv(dev);
-	struct fdt_resource reg_res;
-	DECLARE_GLOBAL_DATA_PTR;
+	ofnode node = dev_ofnode(dev);
+	struct resource reg_res;
 	int err;
 
-	err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
-			       0, &reg_res);
+	err = ofnode_read_resource(node, 0, &reg_res);
 	if (err < 0) {
 		pr_err("\"reg\" resource not found\n");
 		return err;
 	}
 
-	pcie->size = fdt_resource_size(&reg_res);
+	pcie->size = resource_size(&reg_res);
 	pcie->cfg_base = map_physmem(reg_res.start, pcie->size, MAP_NOCACHE);
 
 	return 0;
-- 
2.40.1


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

* Re: [PATCH v1] pci-host-ecam-generic: Convert to ofnode functions
  2024-02-14 20:30 [PATCH v1] pci-host-ecam-generic: Convert to ofnode functions Maksim Kiselev
@ 2024-03-04 15:28 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2024-03-04 15:28 UTC (permalink / raw)
  To: Maksim Kiselev; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

On Wed, Feb 14, 2024 at 11:30:01PM +0300, Maksim Kiselev wrote:

> FDT functions is not working when OF_LIVE is enabled.
> Convert fdt parsing functions to ofnode parsing functions
> 
> Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2024-03-04 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-14 20:30 [PATCH v1] pci-host-ecam-generic: Convert to ofnode functions Maksim Kiselev
2024-03-04 15:28 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox