先提一下GpioTable的structure
typedef struct {
GPIO_PAD GpioPad;
GPIO_CONFIG GpioConfig;
} GPIO_INIT_CONFIG;
typedef struct {
/**
Pad Mode
Pad can be set as GPIO or one of its native functions.
When in native mode setting Direction (except Inversion), OutputState,
InterruptConfig, Host Software Pad Ownership and OutputStateLock are unnecessary.
Refer to definition of GPIO_PAD_MODE.
Refer to EDS for each native mode according to the pad.
**/
UINT32 PadMode : 5;
/**
Host Software Pad Ownership
Set pad to ACPI mode or GPIO Driver Mode.
Refer to definition of GPIO_HOSTSW_OWN.
**/
UINT32 HostSoftPadOwn : 2;
/**
GPIO Direction
Can choose between In, In with inversion, Out, both In and Out, both In with inversion and out or disabling both.
Refer to definition of GPIO_DIRECTION for supported settings.
**/
UINT32 Direction : 6;
/**
Output State
Set Pad output value.
Refer to definition of GPIO_OUTPUT_STATE for supported settings.
This setting takes place when output is enabled.
**/
UINT32 OutputState : 2;
/**
GPIO Interrupt Configuration
Set Pad to cause one of interrupts (IOxAPIC/SCI/SMI/NMI).
This setting is applicable only if GPIO is in GpioMode with input enabled.
Refer to definition of GPIO_INT_CONFIG for supported settings.
**/
UINT32 InterruptConfig : 9;
/**
GPIO Power Configuration.
This setting controls Pad Reset Configuration.
Refer to definition of GPIO_RESET_CONFIG for supported settings.
**/
UINT32 PowerConfig : 8;
/**
GPIO Electrical Configuration
This setting controls pads termination.
Refer to definition of GPIO_ELECTRICAL_CONFIG for supported settings.
**/
UINT32 ElectricalConfig : 9;
/**
GPIO Lock Configuration
This setting controls pads lock.
Refer to definition of GPIO_LOCK_CONFIG for supported settings.
**/
UINT32 LockConfig : 4;
/**
Additional GPIO configuration
Refer to definition of GPIO_OTHER_CONFIG for supported settings.
**/
UINT32 OtherSettings : 9;
UINT32 RsvdBits : 10; ///< Reserved bits for future extension
} GPIO_CONFIG;
- 在BoardInit的時候做一個Hob出來把GpioTable放進去
- 在PchInit的時候把Hob從memory裡面拿出來
- 接著就是一隻一隻腳拿出來看然後寫進memory裡面
- 有些腳是有特殊用途的會不參考你GpioTable裡面的設定
- 那會放進什麼位置是用算的,(PCH P2SB BAR) + (GPIO COMMUNITY) + PadCfgReg
- 之後接著會掃第二遍,主要是update有interrupt的
- update完之後還會掃第三遍.................... 是要把interrupt的status清掉
沒有留言:
張貼留言