Commit graph

17 commits

Author SHA1 Message Date
Adrian Warecki 9342938ad1 mm: Fix sys_mm_drv_unmap_region documentation
Fixed an obvious mistake in the description of the return value of the
sys_mm_drv_unmap_region function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-19 16:56:05 +00:00
Daniel Leung 9c90ed6f61 mm: polish doxygen doc on memory banks driver APIs
() Put the memory bank APIs under the memory management group.
() Document the struct sys_mm_drv_bank.
() Put proper in,out for function parameters.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-21 08:42:01 +00:00
Daniel Leung 9a6e32f87c mm: rename struct mem_drv_bank to sys_mm_drv_bank
Simply to put them into correct namespace as the struct is
part of public API.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-21 08:42:01 +00:00
Daniel Leung ca1aae6183 mm: intel_adsp_mtl_tlb: move SRAM_BANK_PAGE_NUM in driver
The macro SRAM_BANK_PAGE_NUM is specfic to the mtl_tlb
driver and is not universal. So move that from public
header into the driver.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-21 08:42:01 +00:00
Daniel Leung 8021cde6de mm: polish doxygen on memory management driver APIs
Makes the HTML document on the MM driver APIs a bit more easier
to navigate (hopefully).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-21 08:42:01 +00:00
Yong Cong Sin 0538411c09 drivers: mm: refine includes of the header
Refines the `system_mm.h` to include `zephyr/types.h` instead
of `zephyr/kernel.h` as that is all it needs.

Updated the includes of `mm_drv_ti_rat.c` accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-09-26 15:09:12 +02:00
L Lakshmanan 934c6d7b33 drivers: mm: Fix cast warnings on build for RAT
Removed the unneccessary casts in the functions to remove warnings
during build for SoCs using RAT. Functionality reamins the same,
tested on board.

Signed-off-by: L Lakshmanan <l-lakshmanan@ti.com>
2023-07-11 18:20:26 +00:00
L Lakshmanan 7fc6e331d8 drivers: mm: Add support for TI RAT module using system_mm API
Added Region based Address Translation (RAT) module driver. Required by
a few Texas Instruments SoCs to fucntion. Uses
sys_mm_drv_page_phys_get() API with device_map() for address translation.

Signed-off-by: L Lakshmanan <l-lakshmanan@ti.com>
2023-07-11 09:44:48 +02:00
Jaroslaw Stelter faadbc42ee mm_drv: tlb: Fix mapped page in bank calculation
The initial implementation was broken during improvements.
There was incorrect assumption that all pages are unmapped at
initials state. In reality at the beginning whole memory is
powered on, so we should mark all pages as mapped. Later in
initialization code unused pages are unmapped and if after this
some banks become empty (all pages unmapped), the power is
switched off.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-06-20 14:00:59 -04:00
Peter Mitsis 1995aaeb14 drivers: mm: Fix include header guard
Fixes the include header guard so that it does not use
kernel.h's.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-04-12 08:58:06 +02:00
Peter Mitsis 87899c07f7 drivers: mm: Add module for tracking page usage
Adds a module for tracking page usage within a memory bank.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-02-20 09:48:44 +01:00
Carles Cufi 4796ffee7a drivers: mm: Move mm_drv_intel_adsp_mtl_tlb to zephyr/
This file was mistakenly placed in include/ instead of include/zephyr.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-11-21 20:43:50 +09:00
Ederson de Souza edd524b4e3 drivers/mm: Add API to query memory regions
Some systems may need to query the available memory regions in runtime.
For those, this patch adds a simple API that memory management drivers
can implement to provide such discovery.

A small test also added to exercise the default, empty implementation.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-10-01 14:52:29 -04:00
Anas Nashif d7f2f97fe9 doc: doxygen: add memory management group
Add new group for all memory management APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-09-07 10:36:25 +02:00
Jaroslaw Stelter cf24124efa mm: introduce update memory flags api
There are cases when attributes of mapped virtual memory need
to be updated. E.g. in case there is loadable library/module
code loaded to the l2 memory then memory needs to be read-write.
After the code is loaded and is ready to be executed then
attributes of mapped memory should be updated to
read-only/executable without loosing memory contents.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-07-13 15:53:14 +02:00
Gerard Marull-Paretas fb9b3bcd93 include: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all includes within
include directory to the new prefix <zephyr/...>. Note that the
conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:03:00 +02:00
Yuval Peress 53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00