[Sound-open-firmware] [PATCH] library: fix errors with host library build
Ranjani Sridharan
ranjani.sridharan at linux.intel.com
Fri Apr 13 05:56:52 CEST 2018
Sorry, didnt see Liam's patches that fix these. Please ignore!
On Thu, 2018-04-12 at 19:44 -0700, Ranjani Sridharan wrote:
> This patch fixes compilation errors in host libary build due to
> missing header file and changes in mailbox defs.
>
> Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
> ---
> src/arch/host/include/arch/sof.h | 3 ---
> src/arch/host/include/arch/string.h | 40
> ++++++++++++++++++++++++++++++++++
> src/library/include/platform/mailbox.h | 22 +++++++++----------
> src/library/include/platform/memory.h | 3 ++-
> 4 files changed, 53 insertions(+), 15 deletions(-)
> create mode 100644 src/arch/host/include/arch/string.h
>
> diff --git a/src/arch/host/include/arch/sof.h
> b/src/arch/host/include/arch/sof.h
> index 75d0b25..ce2bd69 100644
> --- a/src/arch/host/include/arch/sof.h
> +++ b/src/arch/host/include/arch/sof.h
> @@ -42,9 +42,6 @@
> /* architecture specific stack frames to dump */
> #define ARCH_STACK_DUMP_FRAMES 32
>
> -#define arch_memcpy(dest, src, size) \
> - memcpy(dest, src, size)
> -
> static inline void *arch_get_stack_ptr(void)
> {
> void *frames[ARCH_STACK_DUMP_FRAMES];
> diff --git a/src/arch/host/include/arch/string.h
> b/src/arch/host/include/arch/string.h
> new file mode 100644
> index 0000000..56258b3
> --- /dev/null
> +++ b/src/arch/host/include/arch/string.h
> @@ -0,0 +1,40 @@
> +/*
> + * Copyright (c) 2018, Intel Corporation
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or
> without
> + * modification, are permitted provided that the following
> conditions are met:
> + * * Redistributions of source code must retain the above
> copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * Redistributions in binary form must reproduce the above
> copyright
> + * notice, this list of conditions and the following disclaimer
> in the
> + * documentation and/or other materials provided with the
> distribution.
> + * * Neither the name of the Intel Corporation nor the
> + * names of its contributors may be used to endorse or promote
> products
> + * derived from this software without specific prior written
> permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> CONTRIBUTORS "AS IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
> TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
> PARTICULAR PURPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
> CONTRIBUTORS BE
> + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
> OR
> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
> OF
> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
> BUSINESS
> + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> WHETHER IN
> + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
> OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
> ADVISED OF THE
> + * POSSIBILITY OF SUCH DAMAGE.
> + *
> + * Author: Liam Girdwood <liam.r.girdwood at linux.intel.com>
> + *
> + */
> +
> +#ifndef __INCLUDE_ARCH_STRING_SOF__
> +#define __INCLUDE_ARCH_STRING_SOF__
> +
> +void *xthal_memcpy(void *dst, const void *src, size_t len);
> +
> +#define arch_memcpy(dest, src, size) \
> + xthal_memcpy(dest, src, size)
> +
> +#endif
> diff --git a/src/library/include/platform/mailbox.h
> b/src/library/include/platform/mailbox.h
> index 650ab47..b03887e 100644
> --- a/src/library/include/platform/mailbox.h
> +++ b/src/library/include/platform/mailbox.h
> @@ -28,25 +28,25 @@
> * Author: Liam Girdwood <liam.r.girdwood at linux.intel.com>
> */
>
> -#ifndef __INCLUDE_PLATFORM_HOST_MAILBOX__
> -#define __INCLUDE_PLATFORM_HOST_MAILBOX__
> +#ifndef __INCLUDE_PLATFORM_MAILBOX__
> +#define __INCLUDE_PLATFORM_MAILBOX__
>
> #include <platform/memory.h>
>
> #define MAILBOX_HOST_OFFSET 0x144000
>
> -#define MAILBOX_OUTBOX_OFFSET 0x0
> -#define MAILBOX_OUTBOX_SIZE 0x400
> -#define MAILBOX_OUTBOX_BASE \
> - (MAILBOX_BASE + MAILBOX_OUTBOX_OFFSET)
> +#define MAILBOX_DSPBOX_OFFSET 0x0
> +#define MAILBOX_DSPBOX_SIZE 0x400
> +#define MAILBOX_DSPBOX_BASE \
> + (MAILBOX_BASE + MAILBOX_DSPBOX_OFFSET)
>
> -#define MAILBOX_INBOX_OFFSET MAILBOX_OUTBOX_SIZE
> -#define MAILBOX_INBOX_SIZE 0x400
> -#define MAILBOX_INBOX_BASE \
> - (MAILBOX_BASE + MAILBOX_INBOX_OFFSET)
> +#define MAILBOX_HOSTBOX_OFFSET MAILBOX_DSPBOX_SIZE
> +#define MAILBOX_HOSTBOX_SIZE 0x400
> +#define MAILBOX_HOSTBOX_BASE \
> + (MAILBOX_BASE + MAILBOX_HOSTBOX_OFFSET)
>
> #define MAILBOX_EXCEPTION_OFFSET \
> - (MAILBOX_INBOX_SIZE + MAILBOX_OUTBOX_SIZE)
> + (MAILBOX_HOSTBOX_SIZE + MAILBOX_DSPBOX_SIZE)
> #define MAILBOX_EXCEPTION_SIZE 0x100
> #define MAILBOX_EXCEPTION_BASE \
> (MAILBOX_BASE + MAILBOX_EXCEPTION_OFFSET)
> diff --git a/src/library/include/platform/memory.h
> b/src/library/include/platform/memory.h
> index ed7de10..00a9ad2 100644
> --- a/src/library/include/platform/memory.h
> +++ b/src/library/include/platform/memory.h
> @@ -41,6 +41,8 @@
> #define PLATFORM_HEAP_RUNTIME 1
> #define PLATFORM_HEAP_BUFFER 3
>
> +#define MAILBOX_BASE 0xFF344000
> +
> #if 0
> /* physical DSP addresses */
>
> @@ -51,7 +53,6 @@
> #define DRAM0_SIZE 0x00028000
> #define DRAM0_VBASE 0xC0000000
>
> -#define MAILBOX_BASE (DRAM0_BASE + DRAM0_SIZE - 0x2000)
>
>
> /* HEAP Constants - WARNING this MUST be aligned with the linker
> script */
More information about the Sound-open-firmware
mailing list