diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 08:48:08 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 08:48:08 +0100 |
| commit | fcc8bad0b5e0af4f1f68c96449ce086375cb4b81 (patch) | |
| tree | 0b6ab548c72900b3534a358de23728b4bc1d7275 /Drivers | |
| parent | b052cb4fbb7b83c1292a3098ee7d00e9f3f3fba1 (diff) | |
See below.
- Add USBRegs in XHCI.
- Add brief description in EFIKit/EPM.hxx
- Move HCoreKrnl into EFI/BOOT (makefile NewBoot)
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Drivers')
| -rw-r--r-- | Drivers/XHCI/USBRegs.hxx | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/Drivers/XHCI/USBRegs.hxx b/Drivers/XHCI/USBRegs.hxx new file mode 100644 index 00000000..5ef2ee2e --- /dev/null +++ b/Drivers/XHCI/USBRegs.hxx @@ -0,0 +1,66 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: USBRegs.hxx + Purpose: USB registers + + Revision History: + + 01/02/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +typedef __UINT16_TYPE__ UInt16; +typedef __UINT32_TYPE__ UInt32; +typedef __UINT8_TYPE__ UInt8; + +#define kUSBCommand (UInt16)0x0 +#define kUSBStatus (UInt16)0x2 +#define kUSBInterruptEnable (UInt16)0x4 +#define kUSBFrameNum (UInt16)0x6 +#define kUSBFrameListBaseAddress (UInt16)0x8 +#define kUSBFrameModifyStart (UInt16)0xC +#define kUSBPort1StatusCtrl (UInt16)0x10 +#define kUSBPort2StatusCtrl (UInt16)0x12 + +typedef struct USBCommandRegister final { + UInt8 mReserved[8]; // Reserved + UInt8 + mMaxPacket; // 0 = Max packet size 32 bits 1 = Max packet size 64 bits + UInt8 mConfigure; + UInt8 mSoftwareDebug; + UInt8 mGlobalResume; + UInt8 mGlobalSuspend; + UInt8 mHostCtrlReset; + UInt8 mRun; // 1 = Controller execute frame list entries +} USBCommandRegister; + +typedef struct USBStatusRegister final { + UInt8 mReserved[8]; // Reserved + UInt8 mHalted; // 1 = bit 0 in CMD is zero 0 = bit 0 in CMD is 1 + UInt8 mProcessError; + UInt8 mSystemError; + UInt8 mResumeDetected; + UInt8 mErrorInterrupt; + UInt8 mInterrupt; +} USBStatusRegister; + +typedef struct USBInterruptEnableRegister final { + UInt8 mReserved[4]; // Reserved + UInt8 mShortPacket; // 1=Enable interrupt 0=Disable interrupt + UInt8 mComplete; // 1=Enable interrupt 0=Disable interrupt + UInt8 mResume; // 1=Enable interrupt 0=Disable interrupt + UInt8 mTimeoutCRC; // 1=Enable interrupt 0=Disable interrupt +} USBInterruptEnableRegister; + +/* + Some terminology: + + Frame Number: Number of processed entry of Frame List. + Frame List Base Address: + 32-bit physical adress of Frame List. Remember that first 12 bytes are + always 0. The Frame List must contain 1024 entries. +*/ |
