logging: Make ring buffer backend more general
Ring buffer in memory backend does not depends on xtensa adsp board, so make it general: remove to log_backend_rb and remove dependency on up_squared_adsp. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
73ae0d8410
commit
f4357837af
4 changed files with 16 additions and 17 deletions
|
@ -42,13 +42,13 @@ if LOG
|
||||||
config LOG_PRINTK
|
config LOG_PRINTK
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config LOG_BACKEND_ADSP
|
config LOG_BACKEND_RB
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config LOG_BACKEND_ADSP_RINGBUF_BASE
|
config LOG_BACKEND_RB_MEM_BASE
|
||||||
default "0xBE008000"
|
default "0xBE008000"
|
||||||
|
|
||||||
config LOG_BACKEND_ADSP_RINGBUF_SIZE
|
config LOG_BACKEND_RB_MEM_SIZE
|
||||||
default "0x2000"
|
default "0x2000"
|
||||||
|
|
||||||
endif # LOG
|
endif # LOG
|
||||||
|
|
|
@ -50,8 +50,8 @@ if(NOT CONFIG_LOG_MINIMAL)
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_sources_ifdef(
|
zephyr_sources_ifdef(
|
||||||
CONFIG_LOG_BACKEND_ADSP
|
CONFIG_LOG_BACKEND_RB
|
||||||
log_backend_adsp.c
|
log_backend_rb.c
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
zephyr_sources(log_minimal.c)
|
zephyr_sources(log_minimal.c)
|
||||||
|
|
|
@ -497,26 +497,25 @@ config LOG_BACKEND_NET_SYST_ENABLE
|
||||||
|
|
||||||
endif # LOG_BACKEND_NET
|
endif # LOG_BACKEND_NET
|
||||||
|
|
||||||
config LOG_BACKEND_ADSP
|
config LOG_BACKEND_RB
|
||||||
bool "Enable Intel ADSP backend"
|
bool "Enable memory ring buffer backend"
|
||||||
depends on SOC_INTEL_APL_ADSP
|
|
||||||
select RING_BUFFER
|
select RING_BUFFER
|
||||||
help
|
help
|
||||||
Enable backend in APL ADSP using memory mailbox
|
Enable backend in memory using ring buffer to keep messages.
|
||||||
|
|
||||||
if LOG_BACKEND_ADSP
|
if LOG_BACKEND_RB
|
||||||
|
|
||||||
config LOG_BACKEND_ADSP_RINGBUF_BASE
|
config LOG_BACKEND_RB_MEM_BASE
|
||||||
hex "Ringbuf base address"
|
hex "Ring buffer memory base address"
|
||||||
help
|
help
|
||||||
Address of the ring buffer in the memory.
|
Address of the ring buffer in the memory.
|
||||||
|
|
||||||
config LOG_BACKEND_ADSP_RINGBUF_SIZE
|
config LOG_BACKEND_RB_MEM_SIZE
|
||||||
hex "Size of the ring buffer"
|
hex "Size of the ring buffer"
|
||||||
help
|
help
|
||||||
Size of the ring buffer.
|
Size of the ring buffer.
|
||||||
|
|
||||||
endif # LOG_BACKEND_ADSP
|
endif # LOG_BACKEND_RB
|
||||||
|
|
||||||
config LOG_BACKEND_SHOW_COLOR
|
config LOG_BACKEND_SHOW_COLOR
|
||||||
bool "Enable colors in the backend"
|
bool "Enable colors in the backend"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#define BUF_SIZE 64
|
#define BUF_SIZE 64
|
||||||
|
|
||||||
BUILD_ASSERT(CONFIG_LOG_BACKEND_ADSP_RINGBUF_SIZE % BUF_SIZE == 0);
|
BUILD_ASSERT(CONFIG_LOG_BACKEND_RB_MEM_SIZE % BUF_SIZE == 0);
|
||||||
|
|
||||||
static struct ring_buf ringbuf;
|
static struct ring_buf ringbuf;
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ static struct ring_buf ringbuf;
|
||||||
|
|
||||||
static void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
ring_buf_init(&ringbuf, CONFIG_LOG_BACKEND_ADSP_RINGBUF_SIZE,
|
ring_buf_init(&ringbuf, CONFIG_LOG_BACKEND_RB_MEM_SIZE,
|
||||||
(void *)CONFIG_LOG_BACKEND_ADSP_RINGBUF_BASE);
|
(void *)CONFIG_LOG_BACKEND_RB_MEM_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void trace(const u8_t *data, size_t length)
|
static void trace(const u8_t *data, size_t length)
|
Loading…
Add table
Add a link
Reference in a new issue