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 OSPI driver to support the Octa mode of Macronix octaflash MX25LM51245G #12644

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

rogeryou
Copy link
Contributor

Summary of changes

Update PR #12619.

Add OSPI HAL driver and OSPIF block device driver for using Macronix octaflash MX25LM51245G.

ST Octo-SPI was ported on QSPI MBED API, but we can only use in SPI mode and the Octo mode is not supported. So, we add OSPI driver to enable Octo mode to improve read and write performance.

Impact of changes

Enable the octa mode of MX25LM51245G.

Migration actions required

N/A

Documentation

N/A


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)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

OSPI HAL test was executed.

target platform_name test suite test case passed failed result elapsed_time (sec)
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi frequency setting test 1 0 OK 0.12
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi init/free test 1 0 OK 0.07
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi memory id test 1 0 OK 0.11
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(1-1-1)/x1 read(1-1-1)/x1 repeat/x1 test 1 0 OK 0.1
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(1-1-1)/x1 read(1-1-1)/x1 repeat/x4 test 1 0 OK 0.19
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(1-1-1)/x1 read(1-1-1)/x4 repeat/x1 test 1 0 OK 0.1
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(1-1-1)/x4 read(1-1-1)/x1 repeat/x1 test 1 0 OK 0.13
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(8D_8D_8D)/x1 read(8D_8D_8D)/x1 repeat/x1 test 1 0 OK 0.12
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(8D_8D_8D)/x1 read(8D_8D_8D)/x1 repeat/x4 test 1 0 OK 0.18
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(8D_8D_8D)/x1 read(8D_8D_8D)/x4 repeat/x1 test 1 0 OK 0.12
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(8D_8D_8D)/x4 read(8D_8D_8D)/x1 repeat/x1 test 1 0 OK 0.12
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(8_8_8)/x1 read(8_8_8)/x1 repeat/x1 test 1 0 OK 0.11
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(8_8_8)/x1 read(8_8_8)/x1 repeat/x4 test 1 0 OK 0.18
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(8_8_8)/x1 read(8_8_8)/x4 repeat/x1 test 1 0 OK 0.11
DISCO_L4R9I-GCC_ARM DISCO_L4R9I tests-mbed_hal-ospi ospi write(8_8_8)/x4 read(8_8_8)/x1 repeat/x1 test 1 0 OK 0.1

OSPIF driver test was executed.

target platform_name test suite test case passed failed result elapsed_time (sec)
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing BlockDevice erase functionality 1 0 OK 0.16
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing Deinit block device 1 0 OK 0.13
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing Init block device 1 0 OK 0.12
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing contiguous erase, write and read 1 0 OK 0.16
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing multi threads erase program read 1 0 OK 0.16
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing program read small data sizes 1 0 OK 0.17
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing read write random blocks 1 0 OK 0.15
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing unaligned erase blocks 1 0 OK 0.13
DISCO_L4R9I-GCC_ARM DISCO_L4R9I features-storage-tests-blockdevice-general_block_device OSPIF Testing write -> deinit -> init -> read 1 0 OK 0.01

Reviewers


@ciarmcom ciarmcom requested review from maclobdell, Ronny-Liu and a team March 18, 2020 08:00
@ciarmcom
Copy link
Member

@rogeryou, thank you for your changes.
@maclobdell @Ronny-Liu @ARMmbed/mbed-os-mesh @ARMmbed/mbed-os-core @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-pan @ARMmbed/mbed-os-storage @ARMmbed/mbed-os-hal @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-connectivity @ARMmbed/mbed-os-maintainers @ARMmbed/mbed-os-test @ARMmbed/mbed-os-crypto @ARMmbed/mbed-os-tls @ARMmbed/mbed-os-tools please review.

targets/targets.json Outdated Show resolved Hide resolved
hal/ospi_api.h Outdated Show resolved Hide resolved
hal/ospi_api.h Outdated Show resolved Hide resolved
hal/ospi_api.h Outdated Show resolved Hide resolved
hal/ospi_api.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

I could test quickly:

  • new test: tests-mbed_hal-ospi is OK
  • regression test: tests-mbed_hal-qspi is still OK
  • but with features-storage-tests-blockdevice-general_block_device => got crash...

TESTS/mbed_hal/ospi/main.cpp Outdated Show resolved Hide resolved
TESTS/mbed_hal/ospi/main.cpp Outdated Show resolved Hide resolved
#endif

#include "mbed_trace.h"
#define TRACE_GROUP "OSPIF"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only 4 characters are allowed for TRACE_GROUP

Copy link
Contributor Author

Choose a reason for hiding this comment

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

' #define TRACE_GROUP "OSPIF" " is copy from '#define TRACE_GROUP "QSPIF" ' in QSPIFBlockDevice.cpp .

Copy link
Contributor

Choose a reason for hiding this comment

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

' #define TRACE_GROUP "OSPIF" " is copy from '#define TRACE_GROUP "QSPIF" ' in QSPIFBlockDevice.cpp .

That one should also be fixed but I'm happy if you just fix the new one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you tell me how i can fix it ?
Thanks!
@jeromecoutant @VeijoPesonen

targets/TARGET_STM/TARGET_STM32L4/common_objects.h Outdated Show resolved Hide resolved
drivers/OSPI.h Outdated Show resolved Hide resolved
@jeromecoutant
Copy link
Collaborator

@0xc0170 Let's start CI?

@mergify
Copy link

mergify bot commented Sep 2, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@jeromecoutant
Copy link
Collaborator

@rogeryou let's solve conflicts and then let's merge !?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 10, 2020

Rebase would be good but we need first @ARMmbed/mbed-os-hal approval. Please read (I recall asking one question you might have as well #12644 (review) )

@mergify
Copy link

mergify bot commented Sep 15, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

1 similar comment
@mergify
Copy link

mergify bot commented Sep 15, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@mergify
Copy link

mergify bot commented Sep 15, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@rogeryou
Copy link
Contributor Author

rogeryou commented Sep 16, 2020

@rogeryou let's solve conflicts and then let's merge !?

@jeromecoutant @0xc0170
Hi,

I have rebased and solved the conflicts.
Please review.

@jeromecoutant
Copy link
Collaborator

@0xc0170 Can we start CI ?

@mergify mergify bot added needs: CI and removed needs: work labels Sep 24, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 25, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Sep 25, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.