Skip to content

Flash API: flash_mmap syscall allowing to obtain mapping of flash device in CPU address space #80525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

de-nordic
Copy link
Contributor

The PR consists of:

  • Flash API modification that provides implementation of flash_mmap API call and type definition for flash_driver_api callback.
  • soc_flash_nrf.c driver modification that provides support for the API call
  • Flash Simulator modification that provides support for the API call
  • tests/drivers/flash/common flash_mmap test scenario
  • test/drivers/flash_simulator flash_mmap test scenario

Fixes #80524

The commit adds new API function flash_map with supporting
flash_driver_api callback type.
The new function is provided to allow accessing flash devices,
in particular internal SoC flash devices, via processor address space.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Adds implementation for mmap callback for flash_driver_api.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds implementation of flash_mmap API call.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add flash_mmap test scenario.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add testing of flash_mmap implementation of Flash Simulator.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Simple tests for flash_mmap API calls.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Copy link

@Monday1908 Monday1908 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flash charge API

@de-nordic
Copy link
Contributor Author

Flash charge API

Gray area, as does not require any work from other developers to existing code, even though changes flash driver api.

@de-nordic
Copy link
Contributor Author

I am marking this as DNM till I get some input from vendors of SoC devices.

@de-nordic de-nordic added the DNM This PR should not be merged (Do Not Merge) label Dec 25, 2024
@kartben
Copy link
Contributor

kartben commented Jan 18, 2025

@de-nordic is it time to remove DNM?

@de-nordic
Copy link
Contributor Author

@de-nordic is it time to remove DNM?

No. I will bring this into dev/arch meeting first.
This really requires input from other vendors. I have done analysis of flash drivers of soc and spi devices, but I might have missed something and since this is new addition to a stable api, any fixes, specifically that we are nearing release date, may require stable API change.

@de-nordic
Copy link
Contributor Author

@mmahadevan108 @dleach02 Can you take a look in here? We have now issue in MCUboot mcu-tools/mcuboot#1661, that I have reported because people tried to hook flash_area_device_id and are now confused what that thing should return.
Could implementation of the flash_mmap function in Zephyr, as presented by this PR, be providing what is required by you in MCUboot so that we could fix the flash_area_get_device_id to do the thing it should?

@de-nordic de-nordic modified the milestones: v4.1.0, v4.2.0 Mar 4, 2025
Copy link

github-actions bot commented May 4, 2025

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

Copy link

github-actions bot commented Jul 6, 2025

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jul 6, 2025
@de-nordic de-nordic modified the milestones: v4.2.0, v4.3.0 Jul 17, 2025
@de-nordic de-nordic removed the Stale label Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Flash DNM This PR should not be merged (Do Not Merge) platform: nRF Nordic nRFx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flash API:flash_mmap API call for obtaining flash device mapping in CPU address space
6 participants