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.
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
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?
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!
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](https://github.com/mbed-ce/mbed-os/assets/48664615/f9e78e9a-9993-4624-91f5-03620d498b97)
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
mbedgt: test suite report:
Reviewers
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?
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!