memory manager: Add runtime memory discovery
Add runtime physical memory discovery. This allows platforms with different physical memory sizes to use the same driver for memory management. Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
This commit is contained in:
parent
ad5c3a1ae3
commit
b052143077
1 changed files with 9 additions and 0 deletions
|
@ -642,6 +642,15 @@ static int sys_mm_drv_mm_init(const struct device *dev)
|
||||||
|
|
||||||
ARG_UNUSED(dev);
|
ARG_UNUSED(dev);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Change size of avalible physical memory according to fw register information
|
||||||
|
* in runtime.
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint32_t avalible_memory_size = ace_hpsram_get_bank_count() * SRAM_BANK_SIZE;
|
||||||
|
|
||||||
|
L2_PHYS_SRAM_REGION.num_blocks = avalible_memory_size / CONFIG_MM_DRV_PAGE_SIZE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize memblocks that will store physical
|
* Initialize memblocks that will store physical
|
||||||
* page usage. Initially all physical pages are
|
* page usage. Initially all physical pages are
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue