mpfs/mpfs_mm_init: Fix the section align mask checks

The boundary-1 mask needs to be tested, not the alignment boundary
This commit is contained in:
Ville Juven 2022-11-04 15:04:19 +02:00 committed by Xiang Xiao
parent d4ba93067e
commit e239cd942e
2 changed files with 5 additions and 4 deletions

View File

@ -110,7 +110,8 @@
/* Minimum alignment requirement for any section of memory is 2MB */
#define RV_MMU_SECTION_ALIGN (RV_MMU_L2_PAGE_SIZE)
#define RV_MMU_SECTION_ALIGN (RV_MMU_L2_PAGE_SIZE)
#define RV_MMU_SECTION_ALIGN_MASK (RV_MMU_SECTION_ALIGN - 1)
#else
#error "Unsupported RISC-V MMU implementation selected"
#endif /* CONFIG_ARCH_MMU_TYPE_SV39 */

View File

@ -215,9 +215,9 @@ void mpfs_kernel_mappings(void)
* handle unaligned L3 sections.
*/
ASSERT((KFLASH_START & RV_MMU_SECTION_ALIGN) == 0);
ASSERT((KSRAM_START & RV_MMU_SECTION_ALIGN) == 0);
ASSERT((PGPOOL_START & RV_MMU_SECTION_ALIGN) == 0);
ASSERT((KFLASH_START & RV_MMU_SECTION_ALIGN_MASK) == 0);
ASSERT((KSRAM_START & RV_MMU_SECTION_ALIGN_MASK) == 0);
ASSERT((PGPOOL_START & RV_MMU_SECTION_ALIGN_MASK) == 0);
/* Check that the L3 table is of sufficient size */