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

usb: Adapt USB stack to work on ia32 #525

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adamgreloch
Copy link
Member

@adamgreloch adamgreloch commented Nov 22, 2024

JIRA: RTOS-937

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

@adamgreloch adamgreloch marked this pull request as ready for review November 25, 2024 07:33
@adamgreloch adamgreloch changed the title Adapt USB stack to work on ia32 usb: Adapt USB stack to work on ia32 Nov 25, 2024
Copy link
Member

@agkaminski agkaminski left a comment

Choose a reason for hiding this comment

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

General remark - might be nice to separate platform dependent parts in a per arch files (ehci-ia32-generic.c etc?)

Comment on lines +46 to +50
#ifdef EHCI_IMX
asm volatile("dmb" ::: "memory");
#else
__sync_synchronize();
#endif
Copy link
Member

Choose a reason for hiding this comment

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

https://godbolt.org/z/1q4s7Gsbe

Suggested change
#ifdef EHCI_IMX
asm volatile("dmb" ::: "memory");
#else
__sync_synchronize();
#endif
__sync_synchronize();

Copy link
Member Author

Choose a reason for hiding this comment

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

GCC won't reduce __sync_synchronize() to dmb prior to 9.3.1, see e.g. 9.2.1 https://godbolt.org/z/orPnWevvn

@adamgreloch
Copy link
Member Author

General remark - might be nice to separate platform dependent parts in a per arch files (ehci-ia32-generic.c etc?)

I agree and intend on doing it once I get the EHCI to work on the hardware, since for now it's uncertain which parts of the driver will end up being common. The proposed changes work on QEMU, but as it turned out during my recent tests on hardware (which weren't possible before, because I had to find the controllers' IRQs via ACPI interpretation first), EHCI emulation in QEMU was extremely permissive. I am therefore moving this PR back to draft until I fix the hardware

@adamgreloch adamgreloch marked this pull request as draft December 23, 2024 09:05
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