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

COMPONENT_WHD: make reusable code available for other targets #14471

Merged
merged 12 commits into from
May 31, 2021

Conversation

pennam
Copy link
Contributor

@pennam pennam commented Mar 25, 2021

Summary of changes

PORTENTA_H7 makes use of COMPONENT_WHD for Wi-Fi implementation, so instead of duplicating the code inside our target we propose to make reusable code available for the other. Big part of the changes are folder movements and CMake paths fix.

All commits containing code changes are prefixed with Patch.

Resuming the changes of this pr:
Moved connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD to connectivity/drivers/emac/COMPONENT_WHD
Moved targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD to
connectivity/drivers/wifi/COMPONENT_WHD
Moved targets/TARGET_Cypress/TARGET_PSOC6/common/COMPONENT_WHD to connectivity/drivers/wifi/COMPONENT_WHD/common
Split connectivity/drivers/wifi/COMPONENT_WHD/resources/firmware and connectivity/drivers/wifi/COMPONENT_WHD/resources/nvram for TARGET_Cypress and TARGET_STM
Add the interface and porting layer for PORTENTA_H7 into targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD

The code inside targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/COMPONENT_WHD/interface is Cypress code without changes, but i didn't find a better place to move it; theoretically it can also be shared and not duplicated.

/cc @facchinm

Impact of changes

All Cypress targets using COMPONENT_WHD and PORTENTA_H7_M7

Migration actions required

Documentation


Pull request type

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

Test results

Attached test results for PORTENTA_H7_M7 target
all-test-whd.txt
wifi.txt

CMake build of mbed-os-example-blinky for PORTENTA_H7_M7 and CY8CPROTO_062_4343W
mbed-os-example-blinky-cmake-portenta.txt
mbed-os-example-blinky-cmake-cy8.txt

[] 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

Reviewers


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Mar 25, 2021
@ciarmcom
Copy link
Member

@pennam, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@mergify mergify bot dismissed 0xc0170’s stale review April 6, 2021 13:53

Pull request has been modified.

@pennam
Copy link
Contributor Author

pennam commented Apr 7, 2021

@ifyall I've a more general question about this pull request since 30f6f23 is not the only change we have made to files inside COMPONENT_WHD.

  • Is it ok the idea to move COMPONENT_WHD folder outside TARGET_Cypress to let other target reuse it?
  • none of the files inside COMPONENT_WHD can be changed? To have an idea of the other changes we have made, please have a look at this commits: 30ab61c 2c438da 62d05bb cb2dc79 ad81bac a97889f 3c8e8a1

@ifyall
Copy link

ifyall commented Apr 12, 2021

@pennam,

Files in targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD come from releases of https://github.com/cypresssemiconductorco/wifi-host-driver without modification. Any changes made in targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD will get overridden the next time a wifi-host-driver release is integrated.

The following commits are OK because they are making changes outside of TARGET_PSOC6, specifically in connectivity/drivers/emac/COMPONENT_WHD/:
30ab61c
62d05bb

The NVRAM change that I originally commented on and the rest of the commits you highlighted are changes in the wifi-host-driver and will not be compatible with future releases.

Ian

@pennam
Copy link
Contributor Author

pennam commented Apr 13, 2021

@ifyall Thanks for your clarification.

What about splitting the the content of targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD in two parts leaving the resource subfolder in it and moving the src and inc subfolders into connectivity/drivers/wifi/COMPONENT_WHD without any change?

This will let use completely reuse the code inside this folder and automatically benefit of the future updates of the WHD leaving the possibility to integrate newer versions of the WHD without changing the code.

Doing this all this patches will be moved into our target folder: 54d519b ec277fe 3c8e8a1 a97889f ad81bac 2c438da

This will be fixed restoring the original resource content: 30f6f23

One last question about cb2dc79 and f2e2a15 It seems that the content of targets/TARGET_Cypress/TARGET_PSOC6/common/COMPONENT_WHD is not coming from here https://github.com/cypresssemiconductorco/wifi-host-driver. I can revert this two changes leaving the code as is, but i want to make sure is it ok to move also this folder into connectivity/drivers/wifi/COMPONENT_WHD/common

@mergify
Copy link

mergify bot commented May 4, 2021

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

@pennam
Copy link
Contributor Author

pennam commented May 4, 2021

@ifyall i've reworked the pr.

Now the only changes to the source code are the one already approved. See abb6dc2 and 323b3d6. As mentioned in my previous comment i've splitted the COMPONENT_WHD folder in two parts inc and src folders were moved into connectivity/drivers/wifi/COMPONENT_WHD and resource folder stays in targets/TARGET_Cypress/COMPONENT_WHD.

To update to a new version of WHD drivers there is no need to apply any patch, only the destination folder is different.

I've also moved the targets/TARGET_Cypress/TARGET_PSOC6/common/COMPONENT_WHD folder into connectivity/drivers/wifi/COMPONENT_WHD/network

@ifyall
Copy link

ifyall commented May 6, 2021

@pennam,

Thank you for continuing the work. Regarding the changes, you are still breaking apart the COMPONENT_WHD, leaving some pieces of it in one directory and other pieces in another. We can't break that apart, because the directories/files under https://github.com/ARMmbed/mbed-os/tree/master/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD come from https://github.com/cypresssemiconductorco/wifi-host-driver/tree/master/WiFi_Host_Driver.

Can you just move https://github.com/ARMmbed/mbed-os/tree/master/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD to connectivity/drivers/wifi/COMPONENT_WHD/ without modification?

Addition of the network contents would be optional, but OK.

Ian

@pennam
Copy link
Contributor Author

pennam commented May 18, 2021

Thanks for the hint @0xc0170 , i wasn't aware of the .codecheckignore file

@ciarmcom ciarmcom added the stale Stale Pull Request label May 21, 2021
@ciarmcom
Copy link
Member

This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/Team-Cypress, please complete review of the changes to move the PR forward. Thank you for your contributions.

@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels May 21, 2021
Copy link

@ifyall ifyall left a comment

Choose a reason for hiding this comment

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

Now that the COMPONENT_WHD directory is common between master and this PR (with the exception of the network/ directory), I am OK approving this.

@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels May 24, 2021
@ciarmcom
Copy link
Member

This pull request has automatically been marked as stale because it has had no recent activity. , please complete review of the changes to move the PR forward. Thank you for your contributions.

@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels May 28, 2021
@0xc0170 0xc0170 removed the stale Stale Pull Request label May 31, 2021
@0xc0170 0xc0170 self-requested a review May 31, 2021 12:23
@mergify mergify bot added needs: CI and removed needs: review labels May 31, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented May 31, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented May 31, 2021

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-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
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.

7 participants