Skip to content
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

Add flash partition capsule support #60

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

Conversation

helloxiling
Copy link
Collaborator

@helloxiling helloxiling commented Dec 16, 2024

This PR introduces the flash partition capsule flash_partition.rs, which provides the syscall driver for user space applications to perform read, write, and erase operations on data of arbitrary length from the underlying flash storage. 

The detailed changes include: 

  1. Code reorganization: creating a separate package named flash_driver to encapsulate the relevant flash driver files. 
  2. Definition on the generic interface for reading, writing and erasing the arbitrary length of data on flash storage in flash_driver/hil.rs.
  3. Implementation of the flash storage logical driver flash_storage_to_page.rs that maps read, write, and erase operations of arbitrary length into page-based operations. This driver is essential for enabling the flash partition capsule. 
  4. Addition of in-kernel integration testing flash_storage_test.rs for the flash storage logical driver. 
  5. Bug fix in flash_ctrl driver: ensuring interrupt clearance occurs before the callback, as the callback may initiate another flash operation. 
  6. Instantiate one instance of flash partition in board.rs as a placeholder for user mode testing.
  7. Minor update: changing page_size from 1024 to 256 in flash_ctrl driver and emulated flash_ctrl to reflect the most common NOR flash configuration.

The user mode testing on flash partition will be added in separate PR.

@helloxiling helloxiling marked this pull request as ready for review December 16, 2024 17:17
runtime/flash/src/hil.rs Outdated Show resolved Hide resolved
runtime/capsules/src/flash_partition.rs Outdated Show resolved Hide resolved
runtime/capsules/src/flash_partition.rs Outdated Show resolved Hide resolved
runtime/capsules/src/flash_partition.rs Outdated Show resolved Hide resolved
runtime/capsules/src/flash_partition.rs Show resolved Hide resolved
runtime/flash/src/flash_storage_to_pages.rs Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants