help
Provides low-level access to the data in a partition.
+config CMD_READ_EDID
+ bool "read_edid - Read display EDID"
+ depends on DISPLAY
+ help
+ Read and parse edid from connected display device.
+
config CMD_REMOTEPROC
bool "remoteproc"
depends on REMOTEPROC
obj-$(CONFIG_CMD_QFW) += qfw.o
obj-$(CONFIG_CMD_READ) += read.o
obj-$(CONFIG_CMD_WRITE) += read.o
+obj-$(CONFIG_CMD_READ_EDID) += read_edid.o
obj-$(CONFIG_CMD_REGINFO) += reginfo.o
obj-$(CONFIG_CMD_REMOTEPROC) += remoteproc.o
obj-$(CONFIG_CMD_RNG) += rng.o
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2025 BayLibre, SAS
+ */
+
+#include <command.h>
+#include <dm.h>
+#include <display.h>
+#include <edid.h>
+
+static int do_read_edid(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+ struct udevice *dev;
+ int ret;
+ u8 edid[EDID_EXT_SIZE];
+
+ /* Get the first display device (UCLASS_DISPLAY) */
+ ret = uclass_first_device_err(UCLASS_DISPLAY, &dev);
+ if (ret) {
+ printf("Cannot get display device: %d\n", ret);
+ return CMD_RET_FAILURE;
+ }
+
+ ret = display_read_edid(dev, edid, EDID_EXT_SIZE);
+ if (ret) {
+ printf("Cannot read edid: %d\n", ret);
+ return CMD_RET_FAILURE;
+ }
+
+ edid_print_info((struct edid1_info *)edid);
+
+ return CMD_RET_SUCCESS;
+}
+
+U_BOOT_CMD(read_edid, 1, 0, do_read_edid,
+ "Read and print EDID from display",
+ ""
+);
#include <edid.h>
#include <errno.h>
-static int display_read_edid(struct udevice *dev, u8 *buf, int buf_size)
+int display_read_edid(struct udevice *dev, u8 *buf, int buf_size)
{
struct dm_display_ops *ops = display_get_ops(dev);
bool in_use;
};
+/**
+ * display_read_edid() - Read edid from display
+ *
+ * @dev: Device to read from
+ * @buf: Buffer to read into (should be EDID_SIZE bytes)
+ * @buf_size: Buffer size (should be EDID_SIZE)
+ * Return number of bytes read, <= 0 for error
+ */
+int display_read_edid(struct udevice *dev, u8 *buf, int buf_size);
+
/**
* display_read_timing() - Read timing information
*