Skip to content

Add power management block device driver for changing the power mode of Flash #284

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

Closed

Conversation

daniel-0723
Copy link

@daniel-0723 daniel-0723 commented Jun 12, 2024

Summary of changes

Usually, Nor Flash has more than one power mode, such as high performance mode, low power mode and deep down mode. But in QSPIF block device driver, it is not very easy to change Flash power mode. The PowerManagementBlockDevice class provides an API to change the Flash power mode if the underlying block device doesn’t support such a behavior, which is only support the MX25R6435F of QSPIF block device temporarily. But users can add codes for other power modes of other types of Flash.
powermanagement

Impact of changes

Migration actions required

Documentation


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

mbedgt: test suite report:



Reviewers


targetplatform_nametest suiteresultelapsed_time (sec)copy_method
DISCO_L475VG_IOT01A-GCC_ARMDISCO_L475VG_IOT01Astorage-blockdevice-tests-tests-blockdevice-power_management_block_deviceOK9.71default
mbedgt: test suite results: 1 OK

@multiplemonomials
Copy link
Collaborator

So I've been thinking. I really appreciate the work that you guys at Macronix are doing to add support for your stuff into Mbed. However... I am not convinced this change belongs inside the Mbed OS main repository. It only supports specific models of flash, and these features aren't really usable on the vast majority of boards sold with Mbed.

What if, instead, we made an official Macronix flash library in the mbed-ce-libraries organization? We could put this code there and you guys could work on it freely, and it wouldn't require making PRs into Mbed itself? But, users who want those features could easily import the library. Does that sound OK?

@multiplemonomials
Copy link
Collaborator

Hi @daniel-0723 , after consideration I decided to add this code to a new repo outside of the Mbed source tree: https://github.com/mbed-ce-libraries-examples/MacronixFlash

I have given you access so that you can update this code as needed. Also, I refactored the code so that it extends QSPIFBlockDevice. I think it's a lot simpler now as it only contains three functions. But feel free to add any other changes that you wish to!

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.

3 participants