OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:53 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: EHCI BAR0 Memory address inaccessible or not initialised
PostPosted: Tue Apr 03, 2018 11:17 am 
Offline

Joined: Tue Apr 03, 2018 10:56 am
Posts: 6
Hello, one and all. This is my first post so please go easy on me! :mrgreen:

I am trying to implement EHCI in my OS, but I have encounted a bug specefic to one of my computers.

The BAR0 address from the PCI configuration space, leads to what is meant to be the host controller capability registers. On my old computer that I have, this value works and I can access them and further registers for configuration. On my main computer, when reading back the CAPLENGTH and other registers, a value of all 1s is written into all of the memory locations starting at the BAR0 address.

Is there a way to make the PCI device write and use it's host controller registers? The BAR0 address currently resides outside of Physical RAM on the convicted computer and I have tried a few methods of writing to the PCIs configuration space to change it and initialise the device, with no luck.

Edit: The BAR0 is a memory mapped 32 bit address, with bits 0-3 all 0.

Any pointers in the right direction would be appreciated as well as handy hints from previous encounters.

Thanks


Top
 Profile  
 
 Post subject: Re: EHCI BAR0 Memory address inaccessible or not initialised
PostPosted: Tue Apr 03, 2018 11:58 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
What is the actual value of the BAR? Is the device on the PCIe root bus or is it behind a bridge? Did the BIOS configure the bridge? Does the device work on Linux/Windows? Do any crazy BIOS settings regarding EHCI exist? Are you sure the device is actually an EHCI and not a XHCI?

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: EHCI BAR0 Memory address inaccessible or not initialised
PostPosted: Tue Apr 03, 2018 12:12 pm 
Offline

Joined: Tue Apr 03, 2018 10:56 am
Posts: 6
Korona wrote:
What is the actual value of the BAR? Is the device on the PCIe root bus or is it behind a bridge? Did the BIOS configure the bridge? Does the device work on Linux/Windows? Do any crazy BIOS settings regarding EHCI exist? Are you sure the device is actually an EHCI and not a XHCI?


1. 0xFED1C400
2. May be behind a bridge.
2. The device works as a custom FAT32 driven flash drive on both Windows and Linux.
4. No the Bios has no handoff/legacy settings.
5. Yes the device is EHCI, having: the correct Classcode, Subclass and Prog IF.


Last edited by psid on Tue May 01, 2018 12:59 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: EHCI BAR0 Memory address inaccessible or not initialised
PostPosted: Tue May 01, 2018 12:17 am 
Offline

Joined: Tue Apr 03, 2018 10:56 am
Posts: 6
I decided to try and divert my attention to reading from a SATA disk based on a PCI bus, so I got the BAR5 address and found that I am getting the same result from the EHCI bug, all one's get read when reading from the hardware registers.

Is this the case with uncachable memory, that they might be write only, or am I missing something obvious?

This is based on real hardware.

Thanks


Top
 Profile  
 
 Post subject: Re: EHCI BAR0 Memory address inaccessible or not initialised
PostPosted: Tue May 01, 2018 10:43 am 
Offline

Joined: Tue Apr 03, 2018 10:56 am
Posts: 6
Ok, it turns out it was the A20 line that I didn't enable. 3 lines of code (to test it) later and my problem was solved.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 60 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group