Skip to content

Stm32 mp1 update v1.5.0 #1576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 40 additions & 0 deletions CI/update/stm32cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,24 @@ def updateMDFile(md_file, serie, version):
print(regexmd_up.sub(rf"\g<1>{version}", line), end="")


def updateOpenAmp():
print("Updating OpenAmp Middleware")
repo_path = repo_local_path / repo_core_name
if upargs.local:
cube_path = local_cube_path
else:
cube_name = f"{repo_generic_name}MP1"
cube_path = repo_local_path / cube_name
OpenAmp_cube_path = cube_path / "Middlewares" / "Third_Party" / "OpenAMP"
OpenAmp_core_path = repo_path / "system" / "Middlewares" / "OpenAMP"

# First delete old HAL version
deleteFolder(OpenAmp_core_path)

# Copy new one
copyFolder(OpenAmp_cube_path, OpenAmp_core_path)


def updateCore():
for serie in stm32_list:
if upargs.local:
Expand Down Expand Up @@ -713,6 +731,28 @@ def updateCore():
# Apply all related patch if any
applyPatch(serie, HAL_updated, CMSIS_updated, core_path)

if serie == "MP1":
print(f"Updating {serie} OpenAmp Middleware to Cube {cube_version} ...")
updateOpenAmp()
openAmp_commit_msg = (
f"Update OpenAmp Middleware to MP1 Cube version {cube_version}"
)
commitFiles(core_path, openAmp_commit_msg)
print(
"WARNING: OpenAmp MW has been updated, please check whether Arduino implementation:"
)
print(" * cores/arduino/stm32/OpenAMP/mbox_ipcc.h")
print(" * cores/arduino/stm32/OpenAMP/mbox_ipcc.c")
print(" * cores/arduino/stm32/OpenAMP/rsc_table.h")
print(" * cores/arduino/stm32/OpenAMP/rsc_table.c")
print(" * cores/arduino/stm32/OpenAMP/openamp.h")
print(" * cores/arduino/stm32/OpenAMP/openamp.c")
print(" * cores/arduino/stm32/OpenAMP/openamp_conf.h")
print(" should be updated from Cube project:")
print(
" --> Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo"
)


# Parser
upparser = argparse.ArgumentParser(
Expand Down
7 changes: 5 additions & 2 deletions License.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ Note: most license information is available on top of each source file
[BSD 3-Clause License](#bsd-3-clause-license) is used for:

* cores/arduino/stm32/ mainly contains source from STMicroelectronics.
* system/Drivers/ subfolders include the STMicroelectronics HAL Drivers and CMSIS
ST device.
* system/Drivers/STM32*xx_HAL_Driver folders include the STMicroelectronics HAL Drivers.

[Ultimate Liberty License](#Ultimate-Liberty-License) is used for:
* system/Middlewares/STM32_USB_*_Library/ folders

[Apache License](#apache-license) is used for:
* system/Drivers/CMSIS folder includes the STMicroelectronics CMSIS device
* cores/arduino/stm32/pinmap.*

Note:
* system/STM32*xx/system_stm32*xx.c uses same license than system/Drivers/ subfolders
* system/STM32*xx/stm32*xx_hal_conf_default.h uses same license than system/Drivers/CMSIS
-------------------------------------------------------------------------------
## LGPLv2.1
GNU LESSER GENERAL PUBLIC LICENSE
Expand Down
12 changes: 6 additions & 6 deletions cores/arduino/stm32/OpenAMP/openamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ struct metal_device shm_device = {
static int OPENAMP_shmem_init(int RPMsgRole)
{
int status = 0;
struct metal_device *device;
struct metal_device *device = NULL;
struct metal_init_params metal_params = METAL_INIT_DEFAULTS;
void *rsc_tab_addr;
int rsc_size;
void *rsc_tab_addr = NULL;
int rsc_size = 0;

metal_init(&metal_params);

Expand All @@ -81,7 +81,7 @@ static int OPENAMP_shmem_init(int RPMsgRole)

shm_physmap = SHM_START_ADDRESS;
metal_io_init(&device->regions[0], (void *)SHM_START_ADDRESS, &shm_physmap,
SHM_SIZE, -1, 0, NULL);
SHM_SIZE, (unsigned int) -1, 0, NULL);

shm_io = metal_device_io_region(device, 0);
if (shm_io == NULL) {
Expand Down Expand Up @@ -113,8 +113,8 @@ static int OPENAMP_shmem_init(int RPMsgRole)
*/
int OPENAMP_Init()
{
struct fw_rsc_vdev_vring *vring_rsc;
struct virtio_device *vdev;
struct fw_rsc_vdev_vring *vring_rsc = NULL;
struct virtio_device *vdev = NULL;
int status = 0;

MAILBOX_Init();
Expand Down
4 changes: 2 additions & 2 deletions cores/arduino/stm32/OpenAMP/openamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@

#ifdef VIRTIOCON

#include <openamp/rpmsg.h>

#ifdef __cplusplus
extern "C" {
#endif

#include <openamp/rpmsg.h>
#include "openamp_conf.h"

#define OPENAMP_send rpmsg_send
#define OPENAMP_destroy_ept rpmsg_destroy_ept

int OPENAMP_Init(void);
void OPENAMP_DeInit(void);
void OPENAMP_init_ept(struct rpmsg_endpoint *ept);

int OPENAMP_create_endpoint(struct rpmsg_endpoint *ept, const char *name,
uint32_t dest, rpmsg_ept_cb cb,
Expand Down
6 changes: 3 additions & 3 deletions cores/arduino/stm32/OpenAMP/openamp_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ extern int __OPENAMP_region_end__[]; /* defined by linker script */
#define SHM_SIZE (size_t)((void *)__OPENAMP_region_end__ - (void *) __OPENAMP_region_start__)

#if defined STM32MP1xx
#define VRING_RX_ADDRESS -1 /* allocated by Master processor: CA7 */
#define VRING_TX_ADDRESS -1 /* allocated by Master processor: CA7 */
#define VRING_BUFF_ADDRESS -1 /* allocated by Master processor: CA7 */
#define VRING_RX_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
#define VRING_TX_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
#define VRING_BUFF_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
#define VRING_ALIGNMENT 16 /* fixed to match with linux constraint */
#ifndef VRING_NUM_BUFFS
#define VRING_NUM_BUFFS 16 /* number of rpmsg buffer */
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/stm32/stm32_def_build.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
#elif defined(STM32L562xx)
#define CMSIS_STARTUP_FILE "startup_stm32l562xx.s"
#elif defined(STM32MP151Axx)
#define CMSIS_STARTUP_FILE "startup_stm32mp151axx_cm4 .s"
#define CMSIS_STARTUP_FILE "startup_stm32mp151axx_cm4.s"
#elif defined(STM32MP151Cxx)
#define CMSIS_STARTUP_FILE "startup_stm32mp151cxx_cm4.s"
#elif defined(STM32MP153Axx)
Expand Down
Loading