NeKernel dev
Loading...
Searching...
No Matches
XHCI.h
Go to the documentation of this file.
1/* ========================================
2
3 Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
4
5 File: Config.h
6 Purpose: XHCI (and backwards) header.
7
8 Revision History:
9
10 01/02/24: Added file (amlel)
11 03/02/24: Update filename to Config.h (amlel)
12
13======================================== */
14
15#pragma once
16
17#include <NeKit/Config.h>
18
19#define kUSBCommand (UInt16) 0x0
20#define kUSBStatus (UInt16) 0x2
21#define kUSBInterruptEnable (UInt16) 0x4
22#define kUSBFrameNum (UInt16) 0x6
23#define kUSBFrameListBaseAddress (UInt16) 0x8
24#define kUSBFrameModifyStart (UInt16) 0xC
25#define kUSBPort1StatusCtrl (UInt16) 0x10
26#define kUSBPort2StatusCtrl (UInt16) 0x12
27
28namespace Kernel {
29typedef struct USBCommandRegister final {
30 UInt8 mReserved[8]; // Reserved
31 UInt8 mMaxPacket; // 0 = Max packet size 32 bits 1 = Max packet size 64 bits
37 UInt8 mRun; // 1 = Controller execute frame list entries
39
49
50typedef struct USBInterruptEnableRegister final {
51 UInt8 mReserved[4]; // Reserved
52 UInt8 mShortPacket; // 1=Enable interrupt 0=Disable interrupt
53 UInt8 mComplete; // 1=Enable interrupt 0=Disable interrupt
54 UInt8 mResume; // 1=Enable interrupt 0=Disable interrupt
55 UInt8 mTimeoutCRC; // 1=Enable interrupt 0=Disable interrupt
57
58/*
59 Some terminology:
60
61 Frame Number: Number of processed entry of the Frame List.
62 Frame List Base Address:
63 32-bit physical adress of Frame List. Remember that first 12 bytes are
64 always 0. The Frame List must contain 1024 entries.
65*/
66} // namespace Kernel
UPS inline definitions.
Definition Device.h:12
struct Kernel::USBStatusRegister USBStatusRegister
struct Kernel::USBCommandRegister USBCommandRegister
struct Kernel::USBInterruptEnableRegister USBInterruptEnableRegister
__UINT8_TYPE__ UInt8
Definition Config.h:55
Definition XHCI.h:29
UInt8 mConfigure
Definition XHCI.h:32
UInt8 mGlobalSuspend
Definition XHCI.h:35
UInt8 mRun
Definition XHCI.h:37
UInt8 mReserved[8]
Definition XHCI.h:30
UInt8 mSoftwareDebug
Definition XHCI.h:33
UInt8 mGlobalResume
Definition XHCI.h:34
UInt8 mMaxPacket
Definition XHCI.h:31
UInt8 mHostCtrlReset
Definition XHCI.h:36
UInt8 mTimeoutCRC
Definition XHCI.h:55
UInt8 mShortPacket
Definition XHCI.h:52
UInt8 mResume
Definition XHCI.h:54
UInt8 mReserved[4]
Definition XHCI.h:51
UInt8 mComplete
Definition XHCI.h:53
Definition XHCI.h:40
UInt8 mProcessError
Definition XHCI.h:43
UInt8 mResumeDetected
Definition XHCI.h:45
UInt8 mSystemError
Definition XHCI.h:44
UInt8 mHalted
Definition XHCI.h:42
UInt8 mReserved[8]
Definition XHCI.h:41
UInt8 mErrorInterrupt
Definition XHCI.h:46
UInt8 mInterrupt
Definition XHCI.h:47