Skip to content

Commit d7b596b

Browse files
authored
Merge pull request #1576 from ABOSTM/STM32MP1_UPDATE_V1.5.0
Stm32 mp1 update v1.5.0
2 parents 88c6fef + 13bfe7d commit d7b596b

File tree

579 files changed

+413250
-382976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

579 files changed

+413250
-382976
lines changed

CI/update/stm32cube.py

+40
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,24 @@ def updateMDFile(md_file, serie, version):
611611
print(regexmd_up.sub(rf"\g<1>{version}", line), end="")
612612

613613

614+
def updateOpenAmp():
615+
print("Updating OpenAmp Middleware")
616+
repo_path = repo_local_path / repo_core_name
617+
if upargs.local:
618+
cube_path = local_cube_path
619+
else:
620+
cube_name = f"{repo_generic_name}MP1"
621+
cube_path = repo_local_path / cube_name
622+
OpenAmp_cube_path = cube_path / "Middlewares" / "Third_Party" / "OpenAMP"
623+
OpenAmp_core_path = repo_path / "system" / "Middlewares" / "OpenAMP"
624+
625+
# First delete old HAL version
626+
deleteFolder(OpenAmp_core_path)
627+
628+
# Copy new one
629+
copyFolder(OpenAmp_cube_path, OpenAmp_core_path)
630+
631+
614632
def updateCore():
615633
for serie in stm32_list:
616634
if upargs.local:
@@ -713,6 +731,28 @@ def updateCore():
713731
# Apply all related patch if any
714732
applyPatch(serie, HAL_updated, CMSIS_updated, core_path)
715733

734+
if serie == "MP1":
735+
print(f"Updating {serie} OpenAmp Middleware to Cube {cube_version} ...")
736+
updateOpenAmp()
737+
openAmp_commit_msg = (
738+
f"Update OpenAmp Middleware to MP1 Cube version {cube_version}"
739+
)
740+
commitFiles(core_path, openAmp_commit_msg)
741+
print(
742+
"WARNING: OpenAmp MW has been updated, please check whether Arduino implementation:"
743+
)
744+
print(" * cores/arduino/stm32/OpenAMP/mbox_ipcc.h")
745+
print(" * cores/arduino/stm32/OpenAMP/mbox_ipcc.c")
746+
print(" * cores/arduino/stm32/OpenAMP/rsc_table.h")
747+
print(" * cores/arduino/stm32/OpenAMP/rsc_table.c")
748+
print(" * cores/arduino/stm32/OpenAMP/openamp.h")
749+
print(" * cores/arduino/stm32/OpenAMP/openamp.c")
750+
print(" * cores/arduino/stm32/OpenAMP/openamp_conf.h")
751+
print(" should be updated from Cube project:")
752+
print(
753+
" --> Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo"
754+
)
755+
716756

717757
# Parser
718758
upparser = argparse.ArgumentParser(

License.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ Note: most license information is available on top of each source file
1010
[BSD 3-Clause License](#bsd-3-clause-license) is used for:
1111

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

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

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

22+
Note:
23+
* system/STM32*xx/system_stm32*xx.c uses same license than system/Drivers/ subfolders
24+
* system/STM32*xx/stm32*xx_hal_conf_default.h uses same license than system/Drivers/CMSIS
2225
-------------------------------------------------------------------------------
2326
## LGPLv2.1
2427
GNU LESSER GENERAL PUBLIC LICENSE

cores/arduino/stm32/OpenAMP/openamp.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ struct metal_device shm_device = {
6262
static int OPENAMP_shmem_init(int RPMsgRole)
6363
{
6464
int status = 0;
65-
struct metal_device *device;
65+
struct metal_device *device = NULL;
6666
struct metal_init_params metal_params = METAL_INIT_DEFAULTS;
67-
void *rsc_tab_addr;
68-
int rsc_size;
67+
void *rsc_tab_addr = NULL;
68+
int rsc_size = 0;
6969

7070
metal_init(&metal_params);
7171

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

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

8686
shm_io = metal_device_io_region(device, 0);
8787
if (shm_io == NULL) {
@@ -113,8 +113,8 @@ static int OPENAMP_shmem_init(int RPMsgRole)
113113
*/
114114
int OPENAMP_Init()
115115
{
116-
struct fw_rsc_vdev_vring *vring_rsc;
117-
struct virtio_device *vdev;
116+
struct fw_rsc_vdev_vring *vring_rsc = NULL;
117+
struct virtio_device *vdev = NULL;
118118
int status = 0;
119119

120120
MAILBOX_Init();

cores/arduino/stm32/OpenAMP/openamp.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323

2424
#ifdef VIRTIOCON
2525

26+
#include <openamp/rpmsg.h>
27+
2628
#ifdef __cplusplus
2729
extern "C" {
2830
#endif
2931

30-
#include <openamp/rpmsg.h>
3132
#include "openamp_conf.h"
3233

3334
#define OPENAMP_send rpmsg_send
3435
#define OPENAMP_destroy_ept rpmsg_destroy_ept
3536

3637
int OPENAMP_Init(void);
3738
void OPENAMP_DeInit(void);
38-
void OPENAMP_init_ept(struct rpmsg_endpoint *ept);
3939

4040
int OPENAMP_create_endpoint(struct rpmsg_endpoint *ept, const char *name,
4141
uint32_t dest, rpmsg_ept_cb cb,

cores/arduino/stm32/OpenAMP/openamp_conf.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ extern int __OPENAMP_region_end__[]; /* defined by linker script */
5454
#define SHM_SIZE (size_t)((void *)__OPENAMP_region_end__ - (void *) __OPENAMP_region_start__)
5555

5656
#if defined STM32MP1xx
57-
#define VRING_RX_ADDRESS -1 /* allocated by Master processor: CA7 */
58-
#define VRING_TX_ADDRESS -1 /* allocated by Master processor: CA7 */
59-
#define VRING_BUFF_ADDRESS -1 /* allocated by Master processor: CA7 */
57+
#define VRING_RX_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
58+
#define VRING_TX_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
59+
#define VRING_BUFF_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
6060
#define VRING_ALIGNMENT 16 /* fixed to match with linux constraint */
6161
#ifndef VRING_NUM_BUFFS
6262
#define VRING_NUM_BUFFS 16 /* number of rpmsg buffer */

cores/arduino/stm32/stm32_def_build.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@
393393
#elif defined(STM32L562xx)
394394
#define CMSIS_STARTUP_FILE "startup_stm32l562xx.s"
395395
#elif defined(STM32MP151Axx)
396-
#define CMSIS_STARTUP_FILE "startup_stm32mp151axx_cm4 .s"
396+
#define CMSIS_STARTUP_FILE "startup_stm32mp151axx_cm4.s"
397397
#elif defined(STM32MP151Cxx)
398398
#define CMSIS_STARTUP_FILE "startup_stm32mp151cxx_cm4.s"
399399
#elif defined(STM32MP153Axx)

0 commit comments

Comments
 (0)