lib: update libmetal to release v2020.01.0
Origin: https://github.com/OpenAMP/libmetal commit: e3dfc2fe85e5ceb8b193c4cf559b17bbd53e8866 Status: merge libmetal new version after removing useless dirs. Release Description: https://github.com/OpenAMP/libmetal/releases/tag/v2020.01.0 Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
This commit is contained in:
parent
45e630d615
commit
11a4d140f5
2
README
2
README
|
@ -27,7 +27,7 @@ URL:
|
||||||
https://github.com/OpenAMP/libmetal
|
https://github.com/OpenAMP/libmetal
|
||||||
|
|
||||||
commit:
|
commit:
|
||||||
a4f763094cb26cd8f7abdff251f57a6a802c039d
|
e3dfc2fe85e5ceb8b193c4cf559b17bbd53e8866
|
||||||
|
|
||||||
Maintained-by:
|
Maintained-by:
|
||||||
External
|
External
|
||||||
|
|
|
@ -9,6 +9,8 @@ names to be CC'd when submitting a patch.
|
||||||
|
|
||||||
## Project Administration
|
## Project Administration
|
||||||
Wendy Liang <wendy.liang@xilinx.com>
|
Wendy Liang <wendy.liang@xilinx.com>
|
||||||
|
Ed Mooring <ed.mooring@linaro.org>
|
||||||
|
Arnaud Pouliquen <arnaud.pouliquen@st.com>
|
||||||
|
|
||||||
### All patches CC here
|
### All patches CC here
|
||||||
open-amp@googlegroups.com
|
open-amp@googlegroups.com
|
||||||
|
@ -16,6 +18,8 @@ open-amp@googlegroups.com
|
||||||
## Machines
|
## Machines
|
||||||
### Xilinx Platform - Zynq-7000
|
### Xilinx Platform - Zynq-7000
|
||||||
Wendy Liang <wendy.liang@xilinx.com>
|
Wendy Liang <wendy.liang@xilinx.com>
|
||||||
|
Ed Mooring <ed.mooring@linaro.org>
|
||||||
|
|
||||||
### Xilinx Platform - Zynq UltraScale+ MPSoC
|
### Xilinx Platform - Zynq UltraScale+ MPSoC
|
||||||
Wendy Liang <wendy.liang@xilinx.com>
|
Wendy Liang <wendy.liang@xilinx.com>
|
||||||
|
Ed Mooring <ed.mooring@linaro.org>
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
!defined(__cplusplus)
|
!defined(__cplusplus)
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
# include <stdatomic.h>
|
# include <stdatomic.h>
|
||||||
#elif defined(__cplusplus)
|
|
||||||
# include <atomic>
|
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# include <metal/compiler/gcc/atomic.h>
|
# include <metal/compiler/gcc/atomic.h>
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -43,11 +43,10 @@ int metal_bus_find(const char *name, struct metal_bus **result)
|
||||||
|
|
||||||
metal_list_for_each(&_metal.common.bus_list, node) {
|
metal_list_for_each(&_metal.common.bus_list, node) {
|
||||||
bus = metal_container_of(node, struct metal_bus, node);
|
bus = metal_container_of(node, struct metal_bus, node);
|
||||||
if (strcmp(bus->name, name) != 0)
|
if (strcmp(bus->name, name) == 0 && result) {
|
||||||
continue;
|
|
||||||
if (result)
|
|
||||||
*result = bus;
|
*result = bus;
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
@ -106,10 +105,10 @@ int metal_generic_dev_open(struct metal_bus *bus, const char *dev_name,
|
||||||
|
|
||||||
metal_list_for_each(&_metal.common.generic_device_list, node) {
|
metal_list_for_each(&_metal.common.generic_device_list, node) {
|
||||||
dev = metal_container_of(node, struct metal_device, node);
|
dev = metal_container_of(node, struct metal_device, node);
|
||||||
if (strcmp(dev->name, dev_name) != 0)
|
if (strcmp(dev->name, dev_name) == 0) {
|
||||||
continue;
|
*device = dev;
|
||||||
*device = dev;
|
return metal_generic_dev_sys_open(dev);
|
||||||
return metal_generic_dev_sys_open(dev);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
@ -122,9 +121,9 @@ int metal_generic_dev_dma_map(struct metal_bus *bus,
|
||||||
int nents_in,
|
int nents_in,
|
||||||
struct metal_sg *sg_out)
|
struct metal_sg *sg_out)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
(void)bus;
|
(void)bus;
|
||||||
(void)device;
|
(void)device;
|
||||||
int i;
|
|
||||||
|
|
||||||
if (sg_out != sg_in)
|
if (sg_out != sg_in)
|
||||||
memcpy(sg_out, sg_in, nents_in*(sizeof(struct metal_sg)));
|
memcpy(sg_out, sg_in, nents_in*(sizeof(struct metal_sg)));
|
||||||
|
@ -144,10 +143,10 @@ void metal_generic_dev_dma_unmap(struct metal_bus *bus,
|
||||||
struct metal_sg *sg,
|
struct metal_sg *sg,
|
||||||
int nents)
|
int nents)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
(void)bus;
|
(void)bus;
|
||||||
(void)device;
|
(void)device;
|
||||||
(void)dir;
|
(void)dir;
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < nents; i++) {
|
for (i = 0; i < nents; i++) {
|
||||||
metal_cache_invalidate(sg[i].virt, sg[i].len);
|
metal_cache_invalidate(sg[i].virt, sg[i].len);
|
||||||
|
|
|
@ -14,12 +14,10 @@
|
||||||
|
|
||||||
#define metal_cpu_yield()
|
#define metal_cpu_yield()
|
||||||
|
|
||||||
#ifdef TEAKLITE4
|
|
||||||
/*
|
/*
|
||||||
* The dummy implementation is enough here since
|
* The dummy implementation is enough here since
|
||||||
* tl42x don't support the out of order and multi core
|
* ceva dsp don't support the out of order and multi core
|
||||||
*/
|
*/
|
||||||
#define __sync_synchronize()
|
#define __sync_synchronize()
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __METAL_CEVA_CPU__H__ */
|
#endif /* __METAL_CEVA_CPU__H__ */
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
collect (PROJECT_LIB_HEADERS atomic.h)
|
||||||
|
collect (PROJECT_LIB_HEADERS cpu.h)
|
||||||
|
|
||||||
|
# vim: expandtab:ts=2:sw=2:smartindent
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @file gcc/atomic.h
|
||||||
|
* @brief GCC specific atomic primitives for libmetal.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __METAL_X86_ATOMIC__H__
|
||||||
|
#define __METAL_X86_ATOMIC__H__
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __METAL_X86_ATOMIC__H__ */
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @file cpu.h
|
||||||
|
* @brief CPU specific primatives
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __METAL_X86_CPU__H__
|
||||||
|
#define __METAL_X86_CPU__H__
|
||||||
|
|
||||||
|
#define metal_cpu_yield() asm volatile("rep; nop")
|
||||||
|
|
||||||
|
#endif /* __METAL_X86_CPU__H__ */
|
|
@ -38,10 +38,10 @@ int metal_shmem_open_generic(const char *name, size_t size,
|
||||||
shmem = metal_container_of(node, struct metal_generic_shmem, node);
|
shmem = metal_container_of(node, struct metal_generic_shmem, node);
|
||||||
if (strcmp(shmem->name, name) != 0)
|
if (strcmp(shmem->name, name) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (size > metal_io_region_size(&shmem->io))
|
if (size <= metal_io_region_size(&shmem->io)) {
|
||||||
continue;
|
*result = &shmem->io;
|
||||||
*result = &shmem->io;
|
return 0;
|
||||||
return 0;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
|
@ -656,8 +656,13 @@ int metal_linux_get_device_property(struct metal_device *device,
|
||||||
fd = open(path, flags, mode);
|
fd = open(path, flags, mode);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
status = read(fd, output, len);
|
if (read(fd, output, len) < 0) {
|
||||||
|
status = -errno;
|
||||||
|
close(fd);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = close(fd);
|
||||||
return status < 0 ? -errno : 0;
|
return status < 0 ? -errno : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,12 +28,14 @@ void metal_irq_restore_enable(unsigned int flags)
|
||||||
static void metal_cntr_irq_set_enable(struct metal_irq_controller *cntr,
|
static void metal_cntr_irq_set_enable(struct metal_irq_controller *cntr,
|
||||||
int irq, unsigned int enable)
|
int irq, unsigned int enable)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_ARCH_NOINTC
|
||||||
if (irq >= 0 && irq < cntr->irq_num) {
|
if (irq >= 0 && irq < cntr->irq_num) {
|
||||||
if (enable == METAL_IRQ_ENABLE)
|
if (enable == METAL_IRQ_ENABLE)
|
||||||
up_enable_irq(irq);
|
up_enable_irq(irq);
|
||||||
else
|
else
|
||||||
up_disable_irq(irq);
|
up_disable_irq(irq);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int metal_cntr_irq_handler(int irq, void *context, void *data)
|
static int metal_cntr_irq_handler(int irq, void *context, void *data)
|
||||||
|
@ -78,7 +80,8 @@ static int metal_cntr_irq_attach(struct metal_irq_controller *cntr,
|
||||||
int metal_cntr_irq_init(void)
|
int metal_cntr_irq_init(void)
|
||||||
{
|
{
|
||||||
static METAL_IRQ_CONTROLLER_DECLARE(metal_cntr_irq,
|
static METAL_IRQ_CONTROLLER_DECLARE(metal_cntr_irq,
|
||||||
0, NR_IRQS,
|
0,
|
||||||
|
NR_IRQS ? NR_IRQS : 1,
|
||||||
NULL,
|
NULL,
|
||||||
metal_cntr_irq_set_enable,
|
metal_cntr_irq_set_enable,
|
||||||
metal_cntr_irq_attach,
|
metal_cntr_irq_attach,
|
||||||
|
|
|
@ -29,7 +29,7 @@ typedef struct k_sem metal_mutex_t;
|
||||||
* METAL_MUTEX_INIT - used for initializing an mutex elmenet in a static struct
|
* METAL_MUTEX_INIT - used for initializing an mutex elmenet in a static struct
|
||||||
* or global
|
* or global
|
||||||
*/
|
*/
|
||||||
#define METAL_MUTEX_INIT(m) Z_SEM_INITIALIZER(m, 1, 1)
|
#define METAL_MUTEX_INIT(m) _K_SEM_INITIALIZER(m, 1, 1)
|
||||||
/*
|
/*
|
||||||
* METAL_MUTEX_DEFINE - used for defining and initializing a global or
|
* METAL_MUTEX_DEFINE - used for defining and initializing a global or
|
||||||
* static singleton mutex
|
* static singleton mutex
|
||||||
|
|
Loading…
Reference in New Issue