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

hal/ia32: Add platformctls for ehci #625

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

Conversation

adamgreloch
Copy link
Member

@adamgreloch adamgreloch commented Nov 22, 2024

Setting up EHCI controller on ia32 requires a bit of talking to bios via PCI

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)

pctl_busmaster has been removed. Its functionality is realized by pctl_pcicfg(pci_cfg_busmaster)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: ia32-generic-qemu

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

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

Copy link

github-actions bot commented Nov 22, 2024

Unit Test Results

7 958 tests  ±0   7 416 ✅ ±0   40m 13s ⏱️ -14s
  470 suites ±0     542 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 0ff94d4. ± Comparison against base commit 479e752.

♻️ This comment has been updated with latest results.

@adamgreloch adamgreloch marked this pull request as ready for review November 25, 2024 08:36
Comment on lines +139 to +142

if ((osOwned == 0) && ((dv & (1 << 24)) == 0) && ((dv & (1 << 16)) != 0)) {
break;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if ((osOwned == 0) && ((dv & (1 << 24)) == 0) && ((dv & (1 << 16)) != 0)) {
break;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

These two conditionals are for handling two separate situations: first one is relevant when the OS asks the BIOS for ownership of the USB controller, second one is when the OS wants to relinquish the ownership and return it to the BIOS. These conditions check for the states of "HC BIOS Owned" and "HC OS Owned" semaphores, respectively, to see whether the ownership was obtained/moved as needed. Removing the second case would hang the caller indefinitely if osOwned == 0

All USB UHCI/OHCI/EHCI/XHCI controllers have the same class:subclass 0c:03
and need to be differentiated based on progif (e.g. 0x20 for EHCI)

JIRA: RTOS-937
Allows for controlling the state of various pci device configuration registers

JIRA: RTOS-937
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