From 6a8ebc278e45703c75dbd25e080924a56db585b9 Mon Sep 17 00:00:00 2001 From: Ioannis Karachalios Date: Tue, 30 Jan 2024 16:50:31 +0200 Subject: [PATCH] tests: drivers: display: Add support for Smartbond Pro DevKit. Add Kconfig option to enable allocating test buffer(s) to external SRAM. Note that the linker section name is retrieved from the sram-ext alias which should be compatible to zephyr,memory-region. Signed-off-by: Ioannis Karachalios --- tests/drivers/display/display_read_write/Kconfig | 10 ++++++++++ tests/drivers/display/display_read_write/src/main.c | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/display/display_read_write/Kconfig diff --git a/tests/drivers/display/display_read_write/Kconfig b/tests/drivers/display/display_read_write/Kconfig new file mode 100644 index 000000000000000..8a19da841e521be --- /dev/null +++ b/tests/drivers/display/display_read_write/Kconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2023 Renesas Electronics Corporation +# SPDX-License-Identifier: Apache-2.0 + +mainmenu "Display Read/Write Test" + +source "Kconfig.zephyr" + +config DISPLAY_READ_WRITE_BUF_SRAM_EXT + bool "Buffer allocation is done from sram-ext alias" + default n diff --git a/tests/drivers/display/display_read_write/src/main.c b/tests/drivers/display/display_read_write/src/main.c index 2ae246e4fb9a696..27d2932540b0587 100644 --- a/tests/drivers/display/display_read_write/src/main.c +++ b/tests/drivers/display/display_read_write/src/main.c @@ -8,14 +8,22 @@ #include #include #include +#include LOG_MODULE_DECLARE(display_api, CONFIG_DISPLAY_LOG_LEVEL); +#if CONFIG_DISPLAY_READ_WRITE_BUF_SRAM_EXT +#define DISP_BUFFER_LINKER_SECTION \ + Z_GENERIC_SECTION(LINKER_DT_NODE_REGION_NAME(DT_ALIAS(sram_ext))) +#else +#define DISP_BUFFER_LINKER_SECTION +#endif + static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); static uint8_t disp_buffer[DT_PROP(DT_CHOSEN(zephyr_display), width) * - DT_PROP(DT_CHOSEN(zephyr_display), height) * 4]; + DT_PROP(DT_CHOSEN(zephyr_display), height) * 4] DISP_BUFFER_LINKER_SECTION; static struct display_capabilities cfg; static uint8_t bpp; static bool is_tiled;