summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-03-12 07:55:47 -0600
committerTom Rini <[email protected]>2025-03-12 07:55:47 -0600
commitcf1c0f396393c5c641018060bbe86a9dd698fd71 (patch)
tree7015c9d706d9c2cea97a500826f9e5c2114f1f49 /include
parent8540eba3e030fb1bcd4c6cd2d9b19f4f8ac1fb94 (diff)
parentda1eb50ca14b648984fa89c69d5e88649cec474b (diff)
Merge branch 'graph' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next
Diffstat (limited to 'include')
-rw-r--r--include/configs/sandbox.h2
-rw-r--r--include/dm/ofnode_graph.h90
-rw-r--r--include/video_bridge.h54
3 files changed, 145 insertions, 1 deletions
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 2372485c84e..db2ac7f83bb 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -6,7 +6,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-#define CFG_MALLOC_F_ADDR 0x0010000
+#define CFG_MALLOC_F_ADDR 0x000f4000
/* Size of our emulated memory */
#define SB_CONCAT(x, y) x ## y
diff --git a/include/dm/ofnode_graph.h b/include/dm/ofnode_graph.h
new file mode 100644
index 00000000000..908c990a3f3
--- /dev/null
+++ b/include/dm/ofnode_graph.h
@@ -0,0 +1,90 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2025 Svyatoslav Ryhel <[email protected]>
+ */
+
+#ifndef _DM_OFNODE_GRAPH_H
+#define _DM_OFNODE_GRAPH_H
+
+#include <dm/of.h>
+
+/**
+ * ofnode_graph_get_endpoint_count() - get the number of endpoints in a device ofnode
+ * @parent: ofnode to the device containing ports and endpoints
+ *
+ * Return: count of endpoint of this device ofnode
+ */
+unsigned int ofnode_graph_get_endpoint_count(ofnode parent);
+
+/**
+ * ofnode_graph_get_port_count() - get the number of port in a device or ports ofnode
+ * @parent: ofnode to the device or ports node
+ *
+ * Return: count of port of this device or ports node
+ */
+unsigned int ofnode_graph_get_port_count(ofnode parent);
+
+/**
+ * ofnode_graph_get_port_by_id() - get the port matching a given id
+ * @parent: parent ofnode
+ * @id: id of the port
+ *
+ * Return: ofnode in given port.
+ */
+ofnode ofnode_graph_get_port_by_id(ofnode parent, u32 id);
+
+/**
+ * ofnode_graph_get_endpoint_by_regs() - get the endpoint matching a given id
+ * @parent: parent ofnode
+ * @reg_id: id of the port
+ * @id: id for the endpoint
+ *
+ * Return: ofnode in given endpoint or NULL if not found.
+ * reg and port_reg are ignored when they are -1.
+ */
+ofnode ofnode_graph_get_endpoint_by_regs(ofnode parent, u32 reg_id, u32 id);
+
+/**
+ * ofnode_graph_get_remote_endpoint() - get remote endpoint node
+ * @endoint: ofnode of a local endpoint
+ *
+ * Return: Remote endpoint ofnode linked with local endpoint.
+ */
+ofnode ofnode_graph_get_remote_endpoint(ofnode endpoint);
+
+/**
+ * ofnode_graph_get_port_parent() - get port's parent node
+ * @endpoint: ofnode of a local endpoint
+ *
+ * Return: device ofnode associated with endpoint
+ */
+ofnode ofnode_graph_get_port_parent(ofnode endpoint);
+
+/**
+ * ofnode_graph_get_remote_port_parent() - get remote port's parent ofnode
+ * @endoint: ofnode of a local endpoint
+ *
+ * Return: device ofnode associated with endpoint linked to local endpoint.
+ */
+ofnode ofnode_graph_get_remote_port_parent(ofnode endpoint);
+
+/**
+ * ofnode_graph_get_remote_port() - get remote port ofnode
+ * @endoint: ofnode of a local endpoint
+ *
+ * Return: port ofnode associated with remote endpoint node linked
+ * to local endpoint.
+ */
+ofnode ofnode_graph_get_remote_port(ofnode endpoint);
+
+/**
+ * ofnode_graph_get_remote_node() - get remote parent ofnode for given port/endpoint
+ * @parent: parent ofnode containing graph port/endpoint
+ * @port: identifier (value of reg property) of the parent port ofnode
+ * @endpoint: identifier (value of reg property) of the endpoint ofnode
+ *
+ * Return: device ofnode associated with endpoint linked to local endpoint.
+ */
+ofnode ofnode_graph_get_remote_node(ofnode parent, u32 port, u32 endpoint);
+
+#endif
diff --git a/include/video_bridge.h b/include/video_bridge.h
index 3b429eac578..00e9804565c 100644
--- a/include/video_bridge.h
+++ b/include/video_bridge.h
@@ -54,6 +54,19 @@ struct video_bridge_ops {
int (*set_backlight)(struct udevice *dev, int percent);
/**
+ * get_display_timing() - Get display timings from bridge.
+ *
+ * @dev: Bridge device containing the linked display timings
+ * @tim: Place to put timings
+ * @return 0 if OK, -ve on error
+ *
+ * This call it totally optional and useful mainly for integrated
+ * bridges with fixed output device.
+ */
+ int (*get_display_timing)(struct udevice *dev,
+ struct display_timing *timing);
+
+ /**
* read_edid() - Read information from EDID
*
* @dev: Device to read from
@@ -67,6 +80,7 @@ struct video_bridge_ops {
#define video_bridge_get_ops(dev) \
((struct video_bridge_ops *)(dev)->driver->ops)
+#if CONFIG_IS_ENABLED(VIDEO_BRIDGE)
/**
* video_bridge_attach() - attach a video bridge
*
@@ -99,6 +113,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
int video_bridge_check_attached(struct udevice *dev);
/**
+ * video_bridge_get_display_timing() - Get display timings from bridge.
+ *
+ * @dev: Bridge device containing the linked display timings
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_get_display_timing(struct udevice *dev,
+ struct display_timing *timing);
+/**
* video_bridge_read_edid() - Read information from EDID
*
* @dev: Device to read from
@@ -107,5 +129,37 @@ int video_bridge_check_attached(struct udevice *dev);
* Return: number of bytes read, <=0 for error
*/
int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size);
+#else
+static inline int video_bridge_attach(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_set_backlight(struct udevice *dev, int percent)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_set_active(struct udevice *dev, bool active)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_check_attached(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_get_display_timing(struct udevice *dev,
+ struct display_timing *timing)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size)
+{
+ return -ENOSYS;
+}
+#endif /* CONFIG_VIDEO_BRIDGE */
#endif