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:
Andrei Emeltchenko 2020-02-10 13:47:06 +02:00 committed by Johan Hedberg
commit f4357837af
4 changed files with 16 additions and 17 deletions

View file

@ -42,13 +42,13 @@ if LOG
config LOG_PRINTK
default y
config LOG_BACKEND_ADSP
config LOG_BACKEND_RB
default y
config LOG_BACKEND_ADSP_RINGBUF_BASE
config LOG_BACKEND_RB_MEM_BASE
default "0xBE008000"
config LOG_BACKEND_ADSP_RINGBUF_SIZE
config LOG_BACKEND_RB_MEM_SIZE
default "0x2000"
endif # LOG

View file

@ -50,8 +50,8 @@ if(NOT CONFIG_LOG_MINIMAL)
)
zephyr_sources_ifdef(
CONFIG_LOG_BACKEND_ADSP
log_backend_adsp.c
CONFIG_LOG_BACKEND_RB
log_backend_rb.c
)
else()
zephyr_sources(log_minimal.c)

View file

@ -497,26 +497,25 @@ config LOG_BACKEND_NET_SYST_ENABLE
endif # LOG_BACKEND_NET
config LOG_BACKEND_ADSP
bool "Enable Intel ADSP backend"
depends on SOC_INTEL_APL_ADSP
config LOG_BACKEND_RB
bool "Enable memory ring buffer backend"
select RING_BUFFER
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
hex "Ringbuf base address"
config LOG_BACKEND_RB_MEM_BASE
hex "Ring buffer memory base address"
help
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"
help
Size of the ring buffer.
endif # LOG_BACKEND_ADSP
endif # LOG_BACKEND_RB
config LOG_BACKEND_SHOW_COLOR
bool "Enable colors in the backend"

View file

@ -12,7 +12,7 @@
#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;
@ -25,8 +25,8 @@ static struct ring_buf ringbuf;
static void init(void)
{
ring_buf_init(&ringbuf, CONFIG_LOG_BACKEND_ADSP_RINGBUF_SIZE,
(void *)CONFIG_LOG_BACKEND_ADSP_RINGBUF_BASE);
ring_buf_init(&ringbuf, CONFIG_LOG_BACKEND_RB_MEM_SIZE,
(void *)CONFIG_LOG_BACKEND_RB_MEM_BASE);
}
static void trace(const u8_t *data, size_t length)