Skip to content

Commit

Permalink
Merge pull request #50 from SPRESENSE/release-v2.0.1
Browse files Browse the repository at this point in the history
Merge release-v2.0.1 into master for v2.0.1 release
  • Loading branch information
SPRESENSE committed Jun 16, 2020
2 parents 3e49a52 + 52f61e1 commit 3834d32
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ $ git submodule foreach git checkout master
├── examples - Spresense SDK examples
├── nuttx - NuttX original kernel source + CXD5602 port.
└── sdk - Spresense SDK source and PC tools.
└─ apps - NuttX original tools and sample applications.
```

# Using docker
Expand Down Expand Up @@ -71,7 +72,6 @@ $ tools/config.py examples/hello
```
Build the example image:
``` bash
$ make buildkernel
$ make
```

Expand Down
33 changes: 26 additions & 7 deletions sdk/modules/asmp/supervisor/mpshm.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
#include "up_arch.h"
#include "chip.h"

/****************************************************************************
* Public Data
****************************************************************************/

/* __stack is the end of RAM address, it would be set by linker. */

extern char __stack[];

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
Expand All @@ -68,8 +76,8 @@
#define MPSHM_BLOCK_TILE (1 << MPSHM_BLOCK_TILE_SHIFT)
#define ALIGNUP(v, a) (((v) + ((a)-1)) & ~((a)-1))

#define MM_TILE_BASE (CONFIG_RAM_START + (CONFIG_RAM_SIZE - CONFIG_ASMP_MEMSIZE))
#define MM_TILE_SIZE CONFIG_ASMP_MEMSIZE
#define MM_TILE_BASE ((uint32_t)&__stack)
#define MM_TILE_SIZE (CONFIG_RAM_START + CONFIG_RAM_SIZE - MM_TILE_BASE)

#ifdef CONFIG_ASMP_SMALL_BLOCK
# define MPSHM_TILE_ALIGN MPSHM_BLOCK_SIZE_SHIFT
Expand Down Expand Up @@ -237,6 +245,11 @@ int mpshm_init(mpshm_t *shm, key_t key, size_t size)
return -EINVAL;
}

if (MM_TILE_SIZE <= 0)
{
return -ENOMEM;
}

memset(shm, 0, sizeof(mpshm_t));
mpobj_init(shm, SHM, key);

Expand Down Expand Up @@ -517,11 +530,17 @@ void mpshm_initialize(void)
{
int ret;

ret = tile_initialize((void *)MM_TILE_BASE, MM_TILE_SIZE, MPSHM_TILE_ALIGN);
if (ret < 0)
{
mperr("Tile memory initialization failure.\n");
}
/* MM_TILE_BASE must be aligned at 128Kbyte */

ASSERT((MM_TILE_BASE & 0x1ffff) == 0);

if (MM_TILE_SIZE > 0) {
ret = tile_initialize((void *)MM_TILE_BASE, MM_TILE_SIZE, MPSHM_TILE_ALIGN);
if (ret < 0)
{
mperr("Tile memory initialization failure.\n");
}
}

/* Clear virtual address mapping except first 64KB block.
* Because first virtual address is necessary for wake up from hot sleep.
Expand Down
2 changes: 1 addition & 1 deletion sdk/tools/mkversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ "X${TOPDIR}" = "X" ]; then
fi

APP_VERSION="0.0.0"
SDK_VERSION="SDK2.0.0"
SDK_VERSION="SDK2.0.1"
if [ -r sdk_version ]; then
SDK_VERSION="SDK`cat sdk_version`"
fi
Expand Down

0 comments on commit 3834d32

Please sign in to comment.