From 0679cca5072d6959b51f45c00cb5bf59d75a9329 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 1 Dec 2021 09:02:40 -0700 Subject: sandbox: Allow building with GENERATE_ACPI_TABLE At present this option is missing a header file, a function prototype and the qfw driver needs a header included. Fix these problems so we can enable this option on sandbox. This will increase the build coverage. Signed-off-by: Simon Glass --- drivers/misc/qfw.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/misc/qfw.c b/drivers/misc/qfw.c index ea00be88a8d..a298e5cf727 100644 --- a/drivers/misc/qfw.c +++ b/drivers/misc/qfw.c @@ -14,6 +14,7 @@ #include #include #include +#include #ifdef CONFIG_GENERATE_ACPI_TABLE #include #endif -- cgit v1.3.1 From fb746fdec6d58eacd7d9323eda7ccbde9419a41e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 1 Dec 2021 09:02:46 -0700 Subject: acpi: Add a table start It is useful to record the start of an ACPI table so that offsets from that point can be easily calculated. Add this to the context and set it before calling the writer method. Signed-off-by: Simon Glass --- drivers/core/acpi.c | 5 ++--- include/dm/acpi.h | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c index e988a65ec51..5425e4d0402 100644 --- a/drivers/core/acpi.c +++ b/drivers/core/acpi.c @@ -266,19 +266,18 @@ int acpi_recurse_method(struct acpi_ctx *ctx, struct udevice *parent, func = acpi_get_method(parent, method); if (func) { - void *start = ctx->current; - log_debug("- method %d, %s %p\n", method, parent->name, func); ret = device_of_to_plat(parent); if (ret) return log_msg_ret("ofdata", ret); + ctx->tab_start = ctx->current; ret = func(parent, ctx); if (ret) return log_msg_ret("func", ret); /* Add the item to the internal list */ if (type != TYPE_NONE) { - ret = acpi_add_item(ctx, parent, type, start); + ret = acpi_add_item(ctx, parent, type, ctx->tab_start); if (ret) return log_msg_ret("add", ret); } diff --git a/include/dm/acpi.h b/include/dm/acpi.h index 0fa239eb3a8..a2da57fe224 100644 --- a/include/dm/acpi.h +++ b/include/dm/acpi.h @@ -43,6 +43,9 @@ enum acpi_dump_option { * * @base: Base address of ACPI tables * @current: Current address for writing + * @tab_start: Address of start of the table being written. This is set up + * before the writer or driver method is called. It must not be changed by the + * method * @rsdp: Pointer to the Root System Description Pointer, typically used when * adding a new table. The RSDP holds pointers to the RSDT and XSDT. * @rsdt: Pointer to the Root System Description Table @@ -56,6 +59,7 @@ enum acpi_dump_option { struct acpi_ctx { void *base; void *current; + void *tab_start; struct acpi_rsdp *rsdp; struct acpi_rsdt *rsdt; struct acpi_xsdt *xsdt; -- cgit v1.3.1 From 31c27eb83084e77921b82e7e631ecd6ae8b904da Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 1 Dec 2021 09:02:49 -0700 Subject: x86: Use the ACPI table writer Use the new ACPI writer to write the ACPI tables. At present this is all done in one monolithic function. Future work will split this out. Unfortunately the QFW write_acpi_tables() function conflicts with the 'writer' version, so disable that for sandbox. Signed-off-by: Simon Glass --- arch/x86/lib/acpi_table.c | 21 ++++----------------- drivers/misc/qfw.c | 2 +- lib/acpi/acpi_writer.c | 4 +++- test/dm/acpi.c | 6 +++--- 4 files changed, 11 insertions(+), 22 deletions(-) (limited to 'drivers') diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c index f57323b5c3f..321faaeb185 100644 --- a/arch/x86/lib/acpi_table.c +++ b/arch/x86/lib/acpi_table.c @@ -503,10 +503,10 @@ static int acpi_create_ssdt(struct acpi_ctx *ctx, /* * QEMU's version of write_acpi_tables is defined in drivers/misc/qfw.c */ -ulong write_acpi_tables(ulong start_addr) +static int write_acpi_tables_x86(struct acpi_ctx *ctx, + const struct acpi_writer *entry) { const int thl = sizeof(struct acpi_table_header); - struct acpi_ctx *ctx; struct acpi_facs *facs; struct acpi_table_header *dsdt; struct acpi_fadt *fadt; @@ -516,22 +516,11 @@ ulong write_acpi_tables(ulong start_addr) struct acpi_madt *madt; struct acpi_csrt *csrt; struct acpi_spcr *spcr; - void *start; int aml_len; ulong addr; int ret; int i; - ctx = malloc(sizeof(*ctx)); - if (!ctx) - return log_msg_ret("mem", -ENOMEM); - - start = map_sysmem(start_addr, 0); - - debug("ACPI: Writing ACPI tables at %lx\n", start_addr); - - acpi_reset_items(); - acpi_setup_ctx(ctx, start); acpi_setup_base_tables(ctx); debug("ACPI: * FACS\n"); @@ -674,14 +663,12 @@ ulong write_acpi_tables(ulong start_addr) acpi_write_dev_tables(ctx); - addr = map_to_sysmem(ctx->current); - debug("current = %lx\n", addr); - acpi_rsdp_addr = (unsigned long)ctx->rsdp; debug("ACPI: done\n"); - return addr; + return 0; } +ACPI_WRITER(x86, NULL, write_acpi_tables_x86, 0); ulong acpi_get_rsdp_addr(void) { diff --git a/drivers/misc/qfw.c b/drivers/misc/qfw.c index a298e5cf727..677841aac5e 100644 --- a/drivers/misc/qfw.c +++ b/drivers/misc/qfw.c @@ -19,7 +19,7 @@ #include #endif -#ifdef CONFIG_GENERATE_ACPI_TABLE +#if defined(CONFIG_GENERATE_ACPI_TABLE) && !defined(CONFIG_SANDBOX) /* * This function allocates memory for ACPI tables * diff --git a/lib/acpi/acpi_writer.c b/lib/acpi/acpi_writer.c index 7779bf38aab..53fc753aeeb 100644 --- a/lib/acpi/acpi_writer.c +++ b/lib/acpi/acpi_writer.c @@ -40,6 +40,7 @@ int acpi_write_one(struct acpi_ctx *ctx, const struct acpi_writer *entry) return 0; } +#ifndef CONFIG_QEMU static int acpi_write_all(struct acpi_ctx *ctx) { const struct acpi_writer *writer = @@ -60,7 +61,7 @@ static int acpi_write_all(struct acpi_ctx *ctx) /* * QEMU's version of write_acpi_tables is defined in drivers/misc/qfw.c */ -ulong new_write_acpi_tables(ulong start_addr) +ulong write_acpi_tables(ulong start_addr) { struct acpi_ctx *ctx; ulong addr; @@ -86,6 +87,7 @@ ulong new_write_acpi_tables(ulong start_addr) return addr; } +#endif /* QEMU */ void acpi_setup_ctx(struct acpi_ctx *ctx, ulong start) { diff --git a/test/dm/acpi.c b/test/dm/acpi.c index a1d70b58597..49b71bec3c0 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -322,8 +322,8 @@ static int dm_test_acpi_basic(struct unit_test_state *uts) } DM_TEST(dm_test_acpi_basic, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); -/* Test acpi_setup_base_tables */ -static int dm_test_acpi_setup_base_tables(struct unit_test_state *uts) +/* Test setup_ctx_and_base_tables */ +static int dm_test_setup_ctx_and_base_tables(struct unit_test_state *uts) { struct acpi_rsdp *rsdp; struct acpi_rsdt *rsdt; @@ -369,7 +369,7 @@ static int dm_test_acpi_setup_base_tables(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_setup_base_tables, +DM_TEST(dm_test_setup_ctx_and_base_tables, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); /* Test 'acpi list' command */ -- cgit v1.3.1 From 2d7c7382969ff2a412acb409e76b2959dd715cc3 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 1 Dec 2021 09:03:04 -0700 Subject: acpi: Collect tables in the acpi_item list At present this list is used to collect items within the DSDT and SSDT tables. It is useful for it to collect the whole tables as well, so there is a list of what was created and which write created each one. Refactor the code accordingly. Signed-off-by: Simon Glass --- drivers/core/acpi.c | 43 ++++++++++++++++++++++++++++++++----------- include/dm/acpi.h | 14 ++++++++++++++ lib/acpi/acpi_writer.c | 5 +++++ 3 files changed, 51 insertions(+), 11 deletions(-) (limited to 'drivers') diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c index 5425e4d0402..1e2f5d56302 100644 --- a/drivers/core/acpi.c +++ b/drivers/core/acpi.c @@ -19,11 +19,19 @@ #define MAX_ACPI_ITEMS 100 -/* Type of table that we collected */ +/** + * Type of table that we collected + * + * @TYPE_NONE: Not yet known + * @TYPE_SSDT: Items in the Secondary System Description Table + * @TYPE_DSDT: Items in the Differentiated System Description Table + * @TYPE_OTHER: Other (whole) + */ enum gen_type_t { TYPE_NONE, TYPE_SSDT, TYPE_DSDT, + TYPE_OTHER, }; /* Type of method to call */ @@ -42,11 +50,13 @@ typedef int (*acpi_method)(const struct udevice *dev, struct acpi_ctx *ctx); * * @dev: Device that generated this data * @type: Table type it refers to + * @writer: Writer that wrote this table * @buf: Buffer containing the data * @size: Size of the data in bytes */ struct acpi_item { struct udevice *dev; + const struct acpi_writer *writer; enum gen_type_t type; char *buf; int size; @@ -103,16 +113,18 @@ int acpi_get_path(const struct udevice *dev, char *out_path, int maxlen) } /** - * acpi_add_item() - Add a new item to the list of data collected + * add_item() - Add a new item to the list of data collected * * @ctx: ACPI context - * @dev: Device that generated the data + * @dev: Device that generated the data, if type != TYPE_OTHER + * @writer: Writer entry that generated the data, if type == TYPE_OTHER * @type: Table type it refers to * @start: The start of the data (the end is obtained from ctx->current) * Return: 0 if OK, -ENOSPC if too many items, -ENOMEM if out of memory */ -static int acpi_add_item(struct acpi_ctx *ctx, struct udevice *dev, - enum gen_type_t type, void *start) +static int add_item(struct acpi_ctx *ctx, struct udevice *dev, + const struct acpi_writer *writer, enum gen_type_t type, + void *start) { struct acpi_item *item; void *end = ctx->current; @@ -124,14 +136,17 @@ static int acpi_add_item(struct acpi_ctx *ctx, struct udevice *dev, item = &acpi_item[item_count]; item->dev = dev; + item->writer = writer; item->type = type; item->size = end - start; if (!item->size) return 0; - item->buf = malloc(item->size); - if (!item->buf) - return log_msg_ret("mem", -ENOMEM); - memcpy(item->buf, start, item->size); + if (type != TYPE_OTHER) { + item->buf = malloc(item->size); + if (!item->buf) + return log_msg_ret("mem", -ENOMEM); + memcpy(item->buf, start, item->size); + } item_count++; log_debug("* %s: Added type %d, %p, size %x\n", dev->name, type, start, item->size); @@ -139,6 +154,12 @@ static int acpi_add_item(struct acpi_ctx *ctx, struct udevice *dev, return 0; } +int acpi_add_other_item(struct acpi_ctx *ctx, const struct acpi_writer *writer, + void *start) +{ + return add_item(ctx, NULL, writer, TYPE_OTHER, start); +} + void acpi_dump_items(enum acpi_dump_option option) { int i; @@ -162,7 +183,7 @@ static struct acpi_item *find_acpi_item(const char *devname) for (i = 0; i < item_count; i++) { struct acpi_item *item = &acpi_item[i]; - if (!strcmp(devname, item->dev->name)) + if (item->dev && !strcmp(devname, item->dev->name)) return item; } @@ -277,7 +298,7 @@ int acpi_recurse_method(struct acpi_ctx *ctx, struct udevice *parent, /* Add the item to the internal list */ if (type != TYPE_NONE) { - ret = acpi_add_item(ctx, parent, type, ctx->tab_start); + ret = add_item(ctx, parent, NULL, type, ctx->tab_start); if (ret) return log_msg_ret("add", ret); } diff --git a/include/dm/acpi.h b/include/dm/acpi.h index 815a887ae43..3adfe217678 100644 --- a/include/dm/acpi.h +++ b/include/dm/acpi.h @@ -262,6 +262,20 @@ int acpi_inject_dsdt(struct acpi_ctx *ctx); */ int acpi_setup_nhlt(struct acpi_ctx *ctx, struct nhlt *nhlt); +/** + * acpi_add_other_item() - Add a new table to the list of ACPI tables + * + * This adds an entry of type ACPIT_TYPE_OTHER + * + * @ctx: ACPI context + * @writer: Writer entry that generated the data + * @type: Table type it refers to + * @start: The start of the data (the end is obtained from ctx->current) + * @return 0 if OK, -ENOSPC if too many items, -ENOMEM if out of memory + */ +int acpi_add_other_item(struct acpi_ctx *ctx, const struct acpi_writer *writer, + void *start); + /** * acpi_dump_items() - Dump out the collected ACPI items * diff --git a/lib/acpi/acpi_writer.c b/lib/acpi/acpi_writer.c index 9b0aa23fd78..946f90e8e7b 100644 --- a/lib/acpi/acpi_writer.c +++ b/lib/acpi/acpi_writer.c @@ -40,6 +40,11 @@ int acpi_write_one(struct acpi_ctx *ctx, const struct acpi_writer *entry) else acpi_align(ctx); + /* Add the item to the internal list */ + ret = acpi_add_other_item(ctx, entry, ctx->tab_start); + if (ret) + return log_msg_ret("add", ret); + return 0; } -- cgit v1.3.1 From a9246416326398b5f0ce72af38bba1c43f1cb1e9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 1 Dec 2021 09:03:05 -0700 Subject: acpi: Tidy up the item list At present this is really just a debugging aid, but it is a bit untidy. Add proper columns and display the type name instead of a number. Sample output for coral: => acpi items Seq Type Addr Size Device/Writer --- ----- -------- ---- ------------- 0 other 79925000 240 0base 1 other 79925240 40 1facs 2 dsdt 799252a4 58 board 3 dsdt 799252fc 10 lpc 4 other 79925280 32f0 3dsdt 5 other 79928570 1000 4gnvs 6 other 79929570 100 5fact 7 other 79929670 30 5mcfg 8 other 799296a0 50 5spcr 9 other 799296f0 50 5tpm2 a other 79929740 70 5x86 b ssdt 799297d4 fe maxim-codec c ssdt 799298d2 28 i2c2@16,0 d ssdt 799298fa 270 da-codec e ssdt 79929b6a 28 i2c2@16,1 f ssdt 79929b92 28 i2c2@16,2 10 ssdt 79929bba 83 tpm@50 11 ssdt 79929c3d 28 i2c2@16,3 12 ssdt 79929c65 282 elan-touchscreen@10 13 ssdt 79929ee7 285 raydium-touchscreen@39 14 ssdt 7992a16c 28 i2c2@17,0 15 ssdt 7992a194 d8 elan-touchpad@15 16 ssdt 7992a26c 163 synaptics-touchpad@2c 17 ssdt 7992a3cf 28 i2c2@17,1 18 ssdt 7992a3f7 111 wacom-digitizer@9 19 ssdt 7992a508 8f sdmmc@1b,0 1a ssdt 7992a597 4b wifi 1b ssdt 7992a5e2 1a0 cpu@0 1c ssdt 7992a782 1a0 cpu@1 1d ssdt 7992a922 1a0 cpu@2 1e ssdt 7992aac2 211 cpu@3 1f other 799297b0 1530 6ssdt 20 other 7992ace0 2f10 8dev Signed-off-by: Simon Glass --- drivers/core/acpi.c | 24 ++++++++++++++++++++---- test/dm/acpi.c | 20 ++++++++++++++------ 2 files changed, 34 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c index 1e2f5d56302..0df58dbc0d9 100644 --- a/drivers/core/acpi.c +++ b/drivers/core/acpi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,13 @@ enum gen_type_t { TYPE_OTHER, }; +const char *gen_type_str[] = { + "-", + "ssdt", + "dsdt", + "other", +}; + /* Type of method to call */ enum method_t { METHOD_WRITE_TABLES, @@ -51,13 +59,15 @@ typedef int (*acpi_method)(const struct udevice *dev, struct acpi_ctx *ctx); * @dev: Device that generated this data * @type: Table type it refers to * @writer: Writer that wrote this table - * @buf: Buffer containing the data + * @base: Pointer to base of table in its original location + * @buf: Buffer allocated to contain the data (NULL if not allocated) * @size: Size of the data in bytes */ struct acpi_item { struct udevice *dev; const struct acpi_writer *writer; enum gen_type_t type; + const char *base; char *buf; int size; }; @@ -139,6 +149,7 @@ static int add_item(struct acpi_ctx *ctx, struct udevice *dev, item->writer = writer; item->type = type; item->size = end - start; + item->base = start; if (!item->size) return 0; if (type != TYPE_OTHER) { @@ -164,13 +175,18 @@ void acpi_dump_items(enum acpi_dump_option option) { int i; + printf("Seq Type Base Size Device/Writer\n"); + printf("--- ----- -------- ---- -------------\n"); for (i = 0; i < item_count; i++) { struct acpi_item *item = &acpi_item[i]; - printf("dev '%s', type %d, size %x\n", item->dev->name, - item->type, item->size); + printf("%3x %-5s %8lx %5x %s\n", i, + gen_type_str[item->type], + (ulong)map_to_sysmem(item->base), item->size, + item->dev ? item->dev->name : item->writer->name); if (option == ACPI_DUMP_CONTENTS) { - print_buffer(0, item->buf, 1, item->size, 0); + print_buffer(0, item->buf ? item->buf : item->base, 1, + item->size, 0); printf("\n"); } } diff --git a/test/dm/acpi.c b/test/dm/acpi.c index da728692528..d648f3003a3 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -566,18 +566,22 @@ DM_TEST(dm_test_acpi_inject_dsdt, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); static int dm_test_acpi_cmd_items(struct unit_test_state *uts) { struct acpi_ctx ctx; + ulong addr; void *buf; buf = malloc(BUF_SIZE); ut_assertnonnull(buf); + addr = map_to_sysmem(buf); acpi_reset_items(); ctx.current = buf; ut_assertok(acpi_fill_ssdt(&ctx)); console_record_reset(); run_command("acpi items", 0); - ut_assert_nextline("dev 'acpi-test', type 1, size 2"); - ut_assert_nextline("dev 'acpi-test2', type 1, size 2"); + ut_assert_nextline("Seq Type Base Size Device/Writer"); + ut_assert_nextline("--- ----- -------- ---- -------------"); + ut_assert_nextline(" 0 ssdt %8lx 2 acpi-test", addr); + ut_assert_nextline(" 1 ssdt %8lx 2 acpi-test2", addr + 2); ut_assert_console_end(); acpi_reset_items(); @@ -585,16 +589,20 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts) ut_assertok(acpi_inject_dsdt(&ctx)); console_record_reset(); run_command("acpi items", 0); - ut_assert_nextline("dev 'acpi-test', type 2, size 2"); - ut_assert_nextline("dev 'acpi-test2', type 2, size 2"); + ut_assert_nextlinen("Seq"); + ut_assert_nextlinen("---"); + ut_assert_nextline(" 0 dsdt %8lx 2 acpi-test", addr); + ut_assert_nextline(" 1 dsdt %8lx 2 acpi-test2", addr + 2); ut_assert_console_end(); console_record_reset(); run_command("acpi items -d", 0); - ut_assert_nextline("dev 'acpi-test', type 2, size 2"); + ut_assert_nextlinen("Seq"); + ut_assert_nextlinen("---"); + ut_assert_nextline(" 0 dsdt %8lx 2 acpi-test", addr); ut_assert_nextlines_are_dump(2); ut_assert_nextline("%s", ""); - ut_assert_nextline("dev 'acpi-test2', type 2, size 2"); + ut_assert_nextline(" 1 dsdt %8lx 2 acpi-test2", addr + 2); ut_assert_nextlines_are_dump(2); ut_assert_nextline("%s", ""); ut_assert_console_end(); -- cgit v1.3.1 From 821ca608d81640f1ed10fc5540eb8df18dfa6679 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Fri, 5 Nov 2021 12:52:55 -0400 Subject: usb: Use the first available device for ehci_gadget For whatever reason, usb_setup_ehci_gadget removes and probes USB device 0. However, not all systems have a device 0. Use the first device instead. The device probed should probably have something to do with the controller (as specified by e.g. ums or fastboot ). In fact, I find it odd that we probe the USB device in the first place, because this is just to set up the gadget itself. Presumably, the controller should be probed by usb_gadget_initialize somehow. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- drivers/usb/host/usb-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index fd39c3345c3..27e2fc6fcd3 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -396,7 +396,7 @@ int usb_setup_ehci_gadget(struct ehci_ctrl **ctlrp) int ret; /* Find the old device and remove it */ - ret = uclass_find_device_by_seq(UCLASS_USB, 0, &dev); + ret = uclass_find_first_device(UCLASS_USB, &dev); if (ret) return ret; ret = device_remove(dev, DM_REMOVE_NORMAL); @@ -419,7 +419,7 @@ int usb_remove_ehci_gadget(struct ehci_ctrl **ctlrp) int ret; /* Find the old device and remove it */ - ret = uclass_find_device_by_seq(UCLASS_USB, 0, &dev); + ret = uclass_find_first_device(UCLASS_USB, &dev); if (ret) return ret; ret = device_remove(dev, DM_REMOVE_NORMAL); -- cgit v1.3.1 From ce51884f5181573eaf3d62c4f84e19b80899aba6 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 21 Jan 2022 16:07:30 +0100 Subject: sandbox: sandbox_serial_pending depends on DM_VIDEO When building sandbox_defconfig with CONFIG_DM_VIDEO=n a link time error occurs: in function `sandbox_serial_pending': drivers/serial/sandbox.c:101: undefined reference to `video_sync_all' video_sync_all() is only defined if we have CONFIG_DM_VIDEO=y. Calling this function in a serial driver looks quite hackish but at least let's add the missing build constraint. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- drivers/serial/sandbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index dbbcea5bb4d..0b1756f5c0c 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -97,7 +97,7 @@ static int sandbox_serial_pending(struct udevice *dev, bool input) return 0; os_usleep(100); - if (!IS_ENABLED(CONFIG_SPL_BUILD)) + if (IS_ENABLED(CONFIG_DM_VIDEO) && !IS_ENABLED(CONFIG_SPL_BUILD)) video_sync_all(); avail = membuff_putraw(&priv->buf, 100, false, &data); if (!avail) -- cgit v1.3.1