summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-03-16 12:52:02 -0400
committerTom Rini <trini@konsulko.com>2022-03-16 12:52:02 -0400
commit297e6eb8dcf9d90aaf9b0d146cdd502403003d04 (patch)
treea08774cdaa4a72af892d4c7a57b3e1307734ad89 /drivers/core
parentc24b4e4fb8810b496e5f303ffd2641293f4c4b50 (diff)
parent0ac03fbab51c72fa978569a831c001c4ddad8e2a (diff)
downloadu-boot-297e6eb8dcf9d90aaf9b0d146cdd502403003d04.tar.gz
u-boot-297e6eb8dcf9d90aaf9b0d146cdd502403003d04.tar.bz2
u-boot-297e6eb8dcf9d90aaf9b0d146cdd502403003d04.zip
Merge tag 'xilinx-for-v2022.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next
Xilinx changes for v2022.07-rc1 microblaze: - Add support for reserved memory xilinx: - Update FRU code with MAC reading zynqmp: - Remove double AMS setting - DT updates (mostly for SOMs) - Add support for zcu106 rev 1.0 zynq: - Update nand binding nand: - Aligned zynq_nand to upstream DT binding net: - Add support for ethernet-phy-id mmc: - Workaround CD in zynq_sdhci driver also for ZynqMP - Add support for dynamic/run-time SD config for SOMs gpio: - Add driver for slg7xl45106 firmware: - Add support for dynamic SD config power-domain: - Update zynqmp driver with the latest firmware video: - Add skeleton driver for DP and DPDMA i2c: - Fix i2c to work with QEMU pinctrl: - Add driver for zynqmp pinctrl driver
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/ofnode.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 709bea272a..8042847f3c 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -898,6 +898,42 @@ int ofnode_read_pci_vendev(ofnode node, u16 *vendor, u16 *device)
return -ENOENT;
}
+int ofnode_read_eth_phy_id(ofnode node, u16 *vendor, u16 *device)
+{
+ const char *list, *end;
+ int len;
+
+ list = ofnode_get_property(node, "compatible", &len);
+
+ if (!list)
+ return -ENOENT;
+
+ end = list + len;
+ while (list < end) {
+ len = strlen(list);
+
+ if (len >= strlen("ethernet-phy-idVVVV,DDDD")) {
+ char *s = strstr(list, "ethernet-phy-id");
+
+ /*
+ * check if the string is something like
+ * ethernet-phy-idVVVV,DDDD
+ */
+ if (s && s[19] == '.') {
+ s += strlen("ethernet-phy-id");
+ *vendor = simple_strtol(s, NULL, 16);
+ s += 5;
+ *device = simple_strtol(s, NULL, 16);
+
+ return 0;
+ }
+ }
+ list += (len + 1);
+ }
+
+ return -ENOENT;
+}
+
int ofnode_read_addr_cells(ofnode node)
{
if (ofnode_is_np(node)) {