stm32mp1: update resource table management
Rebase the resource table management to the new implementation in open-amp module Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
This commit is contained in:
parent
25ec73986b
commit
5c310521d1
6 changed files with 2 additions and 116 deletions
|
@ -6,4 +6,3 @@ zephyr_include_directories(${ZEPHYR_BASE}/drivers)
|
||||||
zephyr_sources(
|
zephyr_sources(
|
||||||
soc.c
|
soc.c
|
||||||
)
|
)
|
||||||
zephyr_sources_ifdef(CONFIG_RPROC_RSC_TABLE resource_table.c)
|
|
||||||
|
|
|
@ -11,5 +11,6 @@ config SOC_SERIES_STM32MP1X
|
||||||
select SOC_FAMILY_STM32
|
select SOC_FAMILY_STM32
|
||||||
select HAS_STM32CUBE
|
select HAS_STM32CUBE
|
||||||
select CPU_HAS_ARM_MPU
|
select CPU_HAS_ARM_MPU
|
||||||
|
select OPENAMP_RSC_TABLE if RAM_CONSOLE
|
||||||
help
|
help
|
||||||
Enable support for STM32MP1 MPU series
|
Enable support for STM32MP1 MPU series
|
||||||
|
|
|
@ -11,10 +11,3 @@ config SOC_STM32MP15_M4
|
||||||
bool "STM32MP15_M4"
|
bool "STM32MP15_M4"
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config RPROC_RSC_TABLE
|
|
||||||
bool "coprocessor resource table"
|
|
||||||
default y if RAM_CONSOLE || OPENAMP
|
|
||||||
help
|
|
||||||
add the resource table in the generated binary. This table is
|
|
||||||
compatible with linux remote proc framework and OpenAMP library.
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ SECTIONS
|
||||||
{
|
{
|
||||||
|
|
||||||
#include <linker/rel-sections.ld>
|
#include <linker/rel-sections.ld>
|
||||||
#ifdef CONFIG_RPROC_RSC_TABLE
|
#ifdef CONFIG_OPENAMP_RSC_TABLE
|
||||||
|
|
||||||
SECTION_PROLOGUE(.resource_table,, SUBALIGN(4))
|
SECTION_PROLOGUE(.resource_table,, SUBALIGN(4))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2019 STMicroelectronics
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <zephyr.h>
|
|
||||||
#include "resource_table.h"
|
|
||||||
|
|
||||||
extern char ram_console[];
|
|
||||||
|
|
||||||
#define __section_t(S) __attribute__((__section__(#S)))
|
|
||||||
#define __resource __section_t(.resource_table)
|
|
||||||
|
|
||||||
#ifdef CONFIG_RAM_CONSOLE
|
|
||||||
static volatile struct stm32_resource_table __resource resource_table = {
|
|
||||||
.ver = 1,
|
|
||||||
.num = 1,
|
|
||||||
.offset = {
|
|
||||||
offsetof(struct stm32_resource_table, cm_trace),
|
|
||||||
},
|
|
||||||
.cm_trace = {
|
|
||||||
RSC_TRACE,
|
|
||||||
(uint32_t)ram_console, CONFIG_RAM_CONSOLE_BUFFER_SIZE + 1, 0,
|
|
||||||
"cm4_log",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void resource_table_init(volatile void **table_ptr, int *length)
|
|
||||||
{
|
|
||||||
*table_ptr = &resource_table;
|
|
||||||
*length = sizeof(resource_table);
|
|
||||||
}
|
|
|
@ -1,73 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2018 Nordic Semiconductor ASA
|
|
||||||
* Copyright (c) 2019 STMicroelectronics
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef RESOURCE_TABLE_H__
|
|
||||||
#define RESOURCE_TABLE_H__
|
|
||||||
|
|
||||||
#ifndef OPENAMP_PACKED_BEGIN
|
|
||||||
#define OPENAMP_PACKED_BEGIN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef OPENAMP_PACKED_END
|
|
||||||
#define OPENAMP_PACKED_END __attribute__((__packed__))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* beginning of section: copied from OpenAMP */
|
|
||||||
/**
|
|
||||||
* struct fw_rsc_trace - trace buffer declaration
|
|
||||||
* @da: device address
|
|
||||||
* @len: length (in bytes)
|
|
||||||
* @reserved: reserved (must be zero)
|
|
||||||
* @name: human-readable name of the trace buffer
|
|
||||||
*
|
|
||||||
* This resource entry provides the host information about a trace buffer
|
|
||||||
* into which the remote remote_proc will write log messages.
|
|
||||||
*
|
|
||||||
* @da specifies the device address of the buffer, @len specifies
|
|
||||||
* its size, and @name may contain a human readable name of the trace buffer.
|
|
||||||
*
|
|
||||||
* After booting the remote remote_proc, the trace buffers are exposed to the
|
|
||||||
* user via debugfs entries (called trace0, trace1, etc..).
|
|
||||||
*/
|
|
||||||
OPENAMP_PACKED_BEGIN
|
|
||||||
struct fw_rsc_trace {
|
|
||||||
u32_t type;
|
|
||||||
u32_t da;
|
|
||||||
u32_t len;
|
|
||||||
u32_t reserved;
|
|
||||||
u8_t name[32];
|
|
||||||
} OPENAMP_PACKED_END;
|
|
||||||
|
|
||||||
OPENAMP_PACKED_BEGIN
|
|
||||||
|
|
||||||
enum fw_resource_type {
|
|
||||||
RSC_CARVEOUT = 0,
|
|
||||||
RSC_DEVMEM = 1,
|
|
||||||
RSC_TRACE = 2,
|
|
||||||
RSC_VDEV = 3,
|
|
||||||
RSC_RPROC_MEM = 4,
|
|
||||||
RSC_FW_CHKSUM = 5,
|
|
||||||
RSC_LAST = 6,
|
|
||||||
RSC_VENDOR_START = 128,
|
|
||||||
RSC_VENDOR_END = 512,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* end of section: copied from OpenAMP */
|
|
||||||
|
|
||||||
struct stm32_resource_table {
|
|
||||||
unsigned int ver;
|
|
||||||
unsigned int num;
|
|
||||||
unsigned int reserved[2];
|
|
||||||
unsigned int offset[1];
|
|
||||||
|
|
||||||
/* rpmsg trace entry */
|
|
||||||
struct fw_rsc_trace cm_trace;
|
|
||||||
} OPENAMP_PACKED_END;
|
|
||||||
|
|
||||||
void resource_table_init(volatile void **table_ptr, int *length);
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
Add table
Add a link
Reference in a new issue