Skip to content
Permalink
Browse files

basic usage of_node :)

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
  • Loading branch information...
frank-w committed Jul 31, 2019
1 parent 1e3e0a1 commit 9da9d07ade2e36f58665ade0d3f71aa5f24b1573
Showing with 10 additions and 0 deletions.
  1. +10 −0 drivers/pci/pcie-mediatek.c
@@ -19,6 +19,8 @@
#include <linux/libfdt.h>
#include <dm/lists.h>

#include <dm/read.h> //also includes ofnode.h

#define RT_HIFSYS_BASE 0x1a000000
#define RT_PCIE_BASE 0x1a140000
#define RT_PCIE_IOWIN_BASE 0x1a160000
@@ -463,6 +465,13 @@ mt_pcie_probe(struct udevice *dev)
return 0;
}

static int pci_mtk_ofdata_to_platdata(struct udevice *dev)
{
const char *compatible=ofnode_read_string(dev->node,"compatible");
if (compatible) printf("pci-mtk-compatible:%s\n",compatible);
return 0;
}

static const struct dm_pci_ops mt_pcie_ops = {
.read_config = mt_pcie_read_config,
.write_config = mt_pcie_write_config,
@@ -477,6 +486,7 @@ U_BOOT_DRIVER(pcie_mt2701) = {
.name = "pci_mediatek",
.id = UCLASS_PCI,
.of_match = mt_pcie_ids,
.ofdata_to_platdata = pci_mtk_ofdata_to_platdata,
.ops = &mt_pcie_ops,
.probe = mt_pcie_probe,
.priv_auto_alloc_size = sizeof(struct mt_pcie),

0 comments on commit 9da9d07

Please sign in to comment.
You can’t perform that action at this time.