summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/arch/arm/src/armv7-a/arm_addrenv.c8
-rw-r--r--nuttx/configs/sama5d4-ek/elf/defconfig2
-rw-r--r--nuttx/mm/mm_graninit.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/nuttx/arch/arm/src/armv7-a/arm_addrenv.c b/nuttx/arch/arm/src/armv7-a/arm_addrenv.c
index 25e3d88f2..cd03bddce 100644
--- a/nuttx/arch/arm/src/armv7-a/arm_addrenv.c
+++ b/nuttx/arch/arm/src/armv7-a/arm_addrenv.c
@@ -213,7 +213,7 @@ int up_addrenv_create(size_t textsize, size_t datasize,
{
/* Allocate one physical page */
- paddr = mm_pgalloc(ARCH_SECT2PG(1));
+ paddr = mm_pgalloc(1);
if (!paddr)
{
ret = -ENOMEM;
@@ -226,7 +226,7 @@ int up_addrenv_create(size_t textsize, size_t datasize,
/* Temporarily map the page into the virtual address space */
flags = irqsave();
- l1save = mmu_l1_getentry(vaddr);
+ l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
set_l1_entry(ARCH_SCRATCH_VBASE, paddr);
l2table = (FAR uint32_t *)ARCH_SCRATCH_VBASE;
@@ -256,7 +256,7 @@ int up_addrenv_create(size_t textsize, size_t datasize,
{
/* Allocate one physical page */
- paddr = mm_pgalloc(ARCH_SECT2PG(1));
+ paddr = mm_pgalloc(1);
if (!paddr)
{
ret = -ENOMEM;
@@ -269,7 +269,7 @@ int up_addrenv_create(size_t textsize, size_t datasize,
/* Temporarily map the page into the virtual address space */
flags = irqsave();
- l1save = mmu_l1_getentry(vaddr);
+ l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
set_l1_entry(ARCH_SCRATCH_VBASE, paddr);
l2table = (FAR uint32_t *)ARCH_SCRATCH_VBASE;
diff --git a/nuttx/configs/sama5d4-ek/elf/defconfig b/nuttx/configs/sama5d4-ek/elf/defconfig
index 6affa1a3b..e6a52313d 100644
--- a/nuttx/configs/sama5d4-ek/elf/defconfig
+++ b/nuttx/configs/sama5d4-ek/elf/defconfig
@@ -242,7 +242,7 @@ CONFIG_SAMA5_ISRAM_HEAP=y
CONFIG_SAMA5_DDRCS_RESERVE=y
CONFIG_SAMA5_DDRCS_HEAP_END=0x28000000
CONFIG_SAMA5_DDRCS_PGHEAP=y
-CONFIG_SAMA5_DDRCS_PGHEAP_OFFSET=0x28000000
+CONFIG_SAMA5_DDRCS_PGHEAP_OFFSET=0x08000000
CONFIG_SAMA5_DDRCS_PGHEAP_SIZE=134217728
#
diff --git a/nuttx/mm/mm_graninit.c b/nuttx/mm/mm_graninit.c
index 673e65ac7..4905cb0b5 100644
--- a/nuttx/mm/mm_graninit.c
+++ b/nuttx/mm/mm_graninit.c
@@ -104,12 +104,12 @@ gran_common_initialize(FAR void *heapstart, size_t heapsize, uint8_t log2gran,
/* Check parameters if debug is on. Note the size of a granule is
* limited to 2**31 bytes and that the size of the granule must be greater
- * than the alignment size.
+ * than or equal to the alignment size.
*/
DEBUGASSERT(heapstart && heapsize > 0 &&
log2gran > 0 && log2gran < 32 &&
- log2gran > log2align);
+ log2gran >= log2align);
/* Get the aligned start of the heap */